From ed58a4e737bded2ccc9bbeba794f6177fbce776f Mon Sep 17 00:00:00 2001 From: Louise Skinnari Date: Fri, 27 Mar 2020 12:18:44 +0100 Subject: [PATCH 01/22] create separate PRs for the two L1TK packages --- L1Trigger/TrackFindingTMTT/BuildFile.xml | 28 + L1Trigger/TrackFindingTMTT/BuildFile_HLS.xml | 36 + L1Trigger/TrackFindingTMTT/Doxyfile | 1519 ++++++++ L1Trigger/TrackFindingTMTT/README.md | 133 + L1Trigger/TrackFindingTMTT/README_HLS.txt | 35 + .../TrackFindingTMTT/README_SimpleCode.txt | 290 ++ L1Trigger/TrackFindingTMTT/hls.xml | 21 + .../interface/ChiSquared4ParamsApprox.h | 29 + .../interface/ConverterToTTTrack.h | 63 + .../TrackFindingTMTT/interface/DeadModuleDB.h | 100 + .../TrackFindingTMTT/interface/DegradeBend.h | 81 + .../TrackFindingTMTT/interface/DigitalStub.h | 235 ++ .../TrackFindingTMTT/interface/DigitalTrack.h | 260 ++ .../TrackFindingTMTT/interface/Get3Dtracks.h | 104 + .../interface/HLS/HLSutilities.h | 191 + .../interface/HLS/KFParamsCombCallHLS.h | 107 + .../interface/HLS/KFconstants.h | 198 + .../interface/HLS/KFpragmaOpts.h | 17 + .../TrackFindingTMTT/interface/HLS/KFstate.h | 307 ++ .../TrackFindingTMTT/interface/HLS/KFstub.h | 208 ++ .../interface/HLS/KalmanMatrices.h | 235 ++ .../interface/HLS/KalmanMatrices4.h | 262 ++ .../interface/HLS/KalmanMatrices5.h | 313 ++ .../interface/HLS/KalmanUpdate.h | 63 + .../interface/HLS/KalmanUpdate_top.h | 37 + L1Trigger/TrackFindingTMTT/interface/HTbase.h | 158 + L1Trigger/TrackFindingTMTT/interface/HTcell.h | 148 + L1Trigger/TrackFindingTMTT/interface/HTrphi.h | 166 + L1Trigger/TrackFindingTMTT/interface/Histos.h | 657 ++++ .../TrackFindingTMTT/interface/InputData.h | 66 + .../interface/KF4ParamsComb.h.bak | 42 + .../interface/KF4ParamsCombIV.bak | 50 + .../interface/KF4ParamsCombV2.bak | 33 + .../interface/KF5ParamsComb.h.bak | 43 + .../TrackFindingTMTT/interface/KFParamsComb.h | 43 + .../interface/KFTrackletTrack.h | 256 ++ .../TrackFindingTMTT/interface/KalmanState.h | 108 + .../interface/KillDupFitTrks.h | 78 + .../TrackFindingTMTT/interface/KillDupTrks.h | 106 + .../interface/KillDupTrks.icc | 335 ++ .../TrackFindingTMTT/interface/L1ChiSquared.h | 62 + .../TrackFindingTMTT/interface/L1KalmanComb.h | 180 + .../interface/L1fittedTrack.h | 343 ++ .../TrackFindingTMTT/interface/L1track2D.h | 130 + .../TrackFindingTMTT/interface/L1track3D.h | 245 ++ .../TrackFindingTMTT/interface/L1trackBase.h | 67 + L1Trigger/TrackFindingTMTT/interface/Matrix.h | 63 + .../TrackFindingTMTT/interface/MiniHTstage.h | 59 + .../TrackFindingTMTT/interface/MuxHToutputs.h | 79 + L1Trigger/TrackFindingTMTT/interface/Sector.h | 113 + .../TrackFindingTMTT/interface/Settings.h | 694 ++++ .../TrackFindingTMTT/interface/SimpleLR.h | 73 + L1Trigger/TrackFindingTMTT/interface/Stub.h | 357 ++ .../TrackFindingTMTT/interface/StubCluster.h | 86 + .../TrackFindingTMTT/interface/StubKiller.h | 67 + .../interface/StubWindowSuggest.h | 70 + L1Trigger/TrackFindingTMTT/interface/TP.h | 137 + .../interface/TrackFitGeneric.h | 58 + .../interface/TrackerGeometryInfo.h | 53 + .../TrackFindingTMTT/interface/TrkRZfilter.h | 126 + .../TrackFindingTMTT/interface/Utility.h | 46 + .../interfaceDemo/DigiConverter.h | 41 + .../interfaceDemo/DigiConverter.icc | 98 + .../interfaceDemo/DigiProducer.h | 72 + .../interfaceDemo/DigiProducer.icc | 526 +++ .../TrackFindingTMTT/interfaceDemo/README | 3 + .../TrackFindingTMTT/plugins/BuildFile.xml | 5 + .../plugins/TMTrackProducer.cc | 387 ++ .../plugins/TMTrackProducer.h | 64 + .../python/TMTrackProducer_Defaults_cfi.py | 473 +++ .../python/TMTrackProducer_Ultimate_cff.py | 70 + .../python/TMTrackProducer_cff.py | 157 + .../src/ChiSquared4ParamsApprox.cc | 215 ++ .../src/ConverterToTTTrack.cc | 140 + .../TrackFindingTMTT/src/DeadModuleDB.cc | 64 + L1Trigger/TrackFindingTMTT/src/DegradeBend.cc | 205 ++ L1Trigger/TrackFindingTMTT/src/DigitalStub.cc | 431 +++ .../TrackFindingTMTT/src/DigitalTrack.cc | 304 ++ L1Trigger/TrackFindingTMTT/src/Get3Dtracks.cc | 125 + .../TrackFindingTMTT/src/HLS/HLSutilities.cc | 159 + .../src/HLS/KFParamsCombCallHLS.cc | 454 +++ .../src/HLS/KalmanMatrices.cc | 283 ++ .../src/HLS/KalmanMatrices4.cc | 176 + .../src/HLS/KalmanMatrices5.cc | 208 ++ .../TrackFindingTMTT/src/HLS/KalmanUpdate.cc | 311 ++ .../src/HLS/KalmanUpdate_top.cc | 44 + L1Trigger/TrackFindingTMTT/src/HTbase.cc | 252 ++ L1Trigger/TrackFindingTMTT/src/HTcell.cc | 142 + L1Trigger/TrackFindingTMTT/src/HTrphi.cc | 703 ++++ L1Trigger/TrackFindingTMTT/src/Histos.cc | 3260 +++++++++++++++++ L1Trigger/TrackFindingTMTT/src/InputData.cc | 149 + .../TrackFindingTMTT/src/KF4ParamsComb.cc.bak | 394 ++ .../TrackFindingTMTT/src/KF4ParamsCombIV.bak | 597 +++ .../TrackFindingTMTT/src/KF4ParamsCombV2.bak | 222 ++ .../TrackFindingTMTT/src/KF5ParamsComb.cc.bak | 427 +++ .../TrackFindingTMTT/src/KFParamsComb.cc | 460 +++ .../TrackFindingTMTT/src/KFTrackletTrack.cc | 8 + L1Trigger/TrackFindingTMTT/src/KalmanState.cc | 253 ++ .../TrackFindingTMTT/src/KillDupFitTrks.cc | 243 ++ .../TrackFindingTMTT/src/L1ChiSquared.cc | 148 + .../TrackFindingTMTT/src/L1KalmanComb.cc | 1675 +++++++++ .../src/L1KalmanComb.cc.beamConstraint | 1452 ++++++++ .../TrackFindingTMTT/src/L1fittedTrack.cc | 62 + L1Trigger/TrackFindingTMTT/src/Matrix.cc | 371 ++ L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc | 239 ++ .../TrackFindingTMTT/src/MuxHToutputs.cc | 190 + L1Trigger/TrackFindingTMTT/src/Sector.cc | 318 ++ L1Trigger/TrackFindingTMTT/src/Settings.cc | 459 +++ L1Trigger/TrackFindingTMTT/src/SimpleLR.cc | 464 +++ L1Trigger/TrackFindingTMTT/src/Stub.cc | 728 ++++ L1Trigger/TrackFindingTMTT/src/StubCluster.cc | 122 + L1Trigger/TrackFindingTMTT/src/StubKiller.cc | 241 ++ .../TrackFindingTMTT/src/StubWindowSuggest.cc | 133 + L1Trigger/TrackFindingTMTT/src/TP.cc | 186 + .../TrackFindingTMTT/src/TrackFitGeneric.cc | 53 + .../src/TrackerGeometryInfo.cc | 63 + L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc | 338 ++ L1Trigger/TrackFindingTMTT/src/Utility.cc | 184 + .../test/L1TrackNtupleMaker_cfg.py | 199 + .../test/MCsamples/1040/README | 7 + .../RelVal/DisplacedSingleMuPt1p5to8/PU0.txt | 50 + .../RelVal/DisplacedSingleMuPt2to100/PU0.txt | 50 + .../MCsamples/1040/RelVal/OnlyPU/PU200.txt | 179 + .../1040/RelVal/SingleElPt1p5to8/PU0.txt | 50 + .../1040/RelVal/SingleElPt2to100/PU0.txt | 50 + .../1040/RelVal/SingleMuPt1p5to8/PU0.txt | 49 + .../1040/RelVal/SingleMuPt2to100/PU0.txt | 50 + .../test/MCsamples/1040/RelVal/TTbar/PU0.txt | 11 + .../MCsamples/1040/RelVal/TTbar/PU140.txt | 90 + .../MCsamples/1040/RelVal/TTbar/PU200.txt | 100 + .../1040/RelVal/TTbar/localRAL/PU200.txt | 74 + .../test/MCsamples/1060/README | 7 + .../1060/RelVal/SingleElPt1p5to8/PU0.txt | 4 + .../1060/RelVal/SingleElPt2to100/PU0.txt | 5 + .../1060/RelVal/SingleMuPt1p5to8/PU0.txt | 4 + .../1060/RelVal/SingleMuPt2to100/PU0.txt | 4 + .../test/MCsamples/1060/RelVal/TTbar/PU0.txt | 10 + .../MCsamples/1060/RelVal/TTbar/PU140.txt | 90 + .../MCsamples/1060/RelVal/TTbar/PU200.txt | 90 + .../test/MCsamples/1110/README | 7 + .../RelVal/DisplacedSingleMuPt2to100/PU0.txt | 50 + .../1110/RelVal/SingleElPt1p5to8/PU0.txt | 50 + .../1110/RelVal/SingleElPt2to100/PU0.txt | 51 + .../1110/RelVal/SingleMuPt1p5to8/PU0.txt | 50 + .../1110/RelVal/SingleMuPt2to100/PU0.txt | 50 + .../test/MCsamples/1110/RelVal/TTbar/PU0.txt | 10 + .../MCsamples/1110/RelVal/TTbar/PU200.txt | 100 + .../test/MCsamples/937/README | 7 + .../MCsamples/937/RelVal/OnlyPU/PU200.txt | 255 ++ .../937/RelVal/SingleElPt1p5to8/PU0.txt | 50 + .../937/RelVal/SingleElPt2to100/PU0.txt | 100 + .../937/RelVal/SingleMuPt1p5to8/PU0.txt | 50 + .../937/RelVal/SingleMuPt2to100/PU0.txt | 52 + .../test/MCsamples/937/RelVal/TTbar/PU0.txt | 10 + .../test/MCsamples/937/RelVal/TTbar/PU140.txt | 90 + .../test/MCsamples/937/RelVal/TTbar/PU200.txt | 90 + .../test/MCsamples/937/RelVal/TTbar/PU250.txt | 90 + .../test/MCsamples/937/RelVal/TTbar/PU300.txt | 90 + .../937/RelVal/TTbar/localRAL/PU200.txt | 44 + .../TrackFindingTMTT/test/PlotEtaSectors.C | 183 + .../TrackFindingTMTT/test/TrackerLayout.png | Bin 0 -> 19529 bytes L1Trigger/TrackFindingTMTT/test/chi2dof_cut.C | 112 + L1Trigger/TrackFindingTMTT/test/make_stubs.py | 61 + L1Trigger/TrackFindingTMTT/test/plot.C | 131 + .../test/tmtt_tf_analysis_cfg.py | 214 ++ 165 files changed, 32990 insertions(+) create mode 100644 L1Trigger/TrackFindingTMTT/BuildFile.xml create mode 100644 L1Trigger/TrackFindingTMTT/BuildFile_HLS.xml create mode 100644 L1Trigger/TrackFindingTMTT/Doxyfile create mode 100644 L1Trigger/TrackFindingTMTT/README.md create mode 100644 L1Trigger/TrackFindingTMTT/README_HLS.txt create mode 100644 L1Trigger/TrackFindingTMTT/README_SimpleCode.txt create mode 100644 L1Trigger/TrackFindingTMTT/hls.xml create mode 100644 L1Trigger/TrackFindingTMTT/interface/ChiSquared4ParamsApprox.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/DegradeBend.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/DigitalStub.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/Get3Dtracks.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KFParamsCombCallHLS.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KFconstants.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KFstate.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices4.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices5.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate_top.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/HTbase.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/HTcell.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/HTrphi.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/Histos.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/InputData.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/KF4ParamsComb.h.bak create mode 100644 L1Trigger/TrackFindingTMTT/interface/KF4ParamsCombIV.bak create mode 100644 L1Trigger/TrackFindingTMTT/interface/KF4ParamsCombV2.bak create mode 100644 L1Trigger/TrackFindingTMTT/interface/KF5ParamsComb.h.bak create mode 100644 L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/KalmanState.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/KillDupFitTrks.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc create mode 100644 L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/L1track2D.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/L1track3D.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/L1trackBase.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/Matrix.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/Sector.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/Settings.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/SimpleLR.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/Stub.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/StubCluster.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/StubKiller.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/TP.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/Utility.h create mode 100644 L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h create mode 100644 L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.icc create mode 100644 L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.h create mode 100644 L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.icc create mode 100644 L1Trigger/TrackFindingTMTT/interfaceDemo/README create mode 100644 L1Trigger/TrackFindingTMTT/plugins/BuildFile.xml create mode 100644 L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc create mode 100644 L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h create mode 100644 L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py create mode 100644 L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Ultimate_cff.py create mode 100644 L1Trigger/TrackFindingTMTT/python/TMTrackProducer_cff.py create mode 100644 L1Trigger/TrackFindingTMTT/src/ChiSquared4ParamsApprox.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/DeadModuleDB.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/DegradeBend.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/DigitalStub.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/DigitalTrack.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/Get3Dtracks.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/HLS/HLSutilities.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/HLS/KFParamsCombCallHLS.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/HLS/KalmanMatrices.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/HLS/KalmanMatrices4.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/HLS/KalmanMatrices5.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/HLS/KalmanUpdate.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/HLS/KalmanUpdate_top.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/HTbase.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/HTcell.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/HTrphi.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/Histos.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/InputData.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/KF4ParamsComb.cc.bak create mode 100644 L1Trigger/TrackFindingTMTT/src/KF4ParamsCombIV.bak create mode 100644 L1Trigger/TrackFindingTMTT/src/KF4ParamsCombV2.bak create mode 100644 L1Trigger/TrackFindingTMTT/src/KF5ParamsComb.cc.bak create mode 100644 L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/KFTrackletTrack.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/KalmanState.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/KillDupFitTrks.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/L1ChiSquared.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc.beamConstraint create mode 100644 L1Trigger/TrackFindingTMTT/src/L1fittedTrack.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/Matrix.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/Sector.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/Settings.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/SimpleLR.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/Stub.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/StubCluster.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/StubKiller.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/TP.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/TrackFitGeneric.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/TrackerGeometryInfo.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/Utility.cc create mode 100644 L1Trigger/TrackFindingTMTT/test/L1TrackNtupleMaker_cfg.py create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/README create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/DisplacedSingleMuPt1p5to8/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/DisplacedSingleMuPt2to100/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/OnlyPU/PU200.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleElPt1p5to8/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleElPt2to100/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleMuPt1p5to8/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleMuPt2to100/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU140.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU200.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/localRAL/PU200.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1060/README create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleElPt1p5to8/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleElPt2to100/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleMuPt1p5to8/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleMuPt2to100/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU140.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU200.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1110/README create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/DisplacedSingleMuPt2to100/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleElPt1p5to8/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleElPt2to100/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleMuPt1p5to8/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleMuPt2to100/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/TTbar/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/TTbar/PU200.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/README create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/OnlyPU/PU200.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleElPt1p5to8/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleElPt2to100/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleMuPt1p5to8/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleMuPt2to100/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU0.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU140.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU200.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU250.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU300.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/localRAL/PU200.txt create mode 100644 L1Trigger/TrackFindingTMTT/test/PlotEtaSectors.C create mode 100644 L1Trigger/TrackFindingTMTT/test/TrackerLayout.png create mode 100644 L1Trigger/TrackFindingTMTT/test/chi2dof_cut.C create mode 100644 L1Trigger/TrackFindingTMTT/test/make_stubs.py create mode 100644 L1Trigger/TrackFindingTMTT/test/plot.C create mode 100644 L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py diff --git a/L1Trigger/TrackFindingTMTT/BuildFile.xml b/L1Trigger/TrackFindingTMTT/BuildFile.xml new file mode 100644 index 0000000000000..e28d194af9e91 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/BuildFile.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/L1Trigger/TrackFindingTMTT/BuildFile_HLS.xml b/L1Trigger/TrackFindingTMTT/BuildFile_HLS.xml new file mode 100644 index 0000000000000..ea9a0f673aab8 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/BuildFile_HLS.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/L1Trigger/TrackFindingTMTT/Doxyfile b/L1Trigger/TrackFindingTMTT/Doxyfile new file mode 100644 index 0000000000000..6cb91d26e52b8 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/Doxyfile @@ -0,0 +1,1519 @@ +# Doxyfile 1.6.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = "IanSimpleCode version of TMTrackTrigger/TMTrackFinder/" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it parses. +# With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this tag. +# The format is ext=language, where ext is a file extension, and language is one of +# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, +# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat +# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will rougly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by +# doxygen. The layout file controls the global structure of the generated output files +# in an output format independent way. The create the layout file that represents +# doxygen's defaults, run doxygen with the -l option. You can optionally specify a +# file name after the option, if omitted DoxygenLayout.xml will be used as the name +# of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = L1Trigger SimTracker + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# If the HTML_TIMESTAMP tag is set to YES then the generated HTML +# documentation will contain the timesstamp. + +HTML_TIMESTAMP = NO + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER +# are set, an additional index file will be generated that can be used as input for +# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated +# HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. +# For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's +# filter section matches. +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# When the SEARCHENGINE tag is enable doxygen will generate a search box for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP) +# there is already a search function so this one should typically +# be disabled. + +SEARCHENGINE = YES + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/L1Trigger/TrackFindingTMTT/README.md b/L1Trigger/TrackFindingTMTT/README.md new file mode 100644 index 0000000000000..797c6d969588b --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/README.md @@ -0,0 +1,133 @@ +# Setup instructions to just run + +To checkout and run, or if your modifications won't need to be put into the central repository, do (on an SL7 machine): + +``` +cmsrel CMSSW_10_6_0 +cd CMSSW_10_6_0/src +cmsenv + +git cms-init +git remote add -t TMTT_1060 TMTT git@github.com:CMS-TMTT/cmssw.git +git fetch TMTT TMTT_1060 +git cms-checkout-topic CMS-TMTT:TMTT_1060 + +scramv1 b -j 8 + +cd L1Trigger/TrackFindingTMTT/test/ +cmsRun tmtt_tf_analysis_cfg.py inputMC=MCsamples/937/RelVal/TTbar/PU200.txt Events=10 +``` + +Note : In this example, the name of the remote repository is given the label TMTT. However the ```git cms-checkout-topic``` commands (and related git cms-*-*) use the username of the remote repository (CMS-TMTT). +Note : that if you want to checkout other packages e.g. the tracklet software, which contains the ntuple maker, you should replace ```git cms-checkout-topic``` with ```git cms-merge-topic``` + +# Setup instructions for making modifications + +Follow the above instructions. At this point, you should be on a local branch called TMTT_1060. + +Below is a simple example of making modifications, pushing them to your remote repository, and making a pull request back to the repository you want your changes to end up in. In this example, we will use the following as the "central" repository (something equivalent of trunkSimpleCode9 in svn) : https://github.com/CMS-TMTT/cmssw.git . Follow the link, and fork the repository to your own account. You then need to add your newly forked repository as a remote repository in your local working area, which we will call ```origin```: +``` +git remote add origin +``` +You can get the url by clicking on "Clone or download" on the webpage for YOUR repository, and will be something like ```git@github.com:/cmssw.git``` + +Lets change branch to one called "myChanges": +``` +git checkout -b myChanges +``` +Modify some files: +``` +echo "#Hello World" >> L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py +``` +Check the status of your modifications: +``` +git status +``` +Which should show something like: +``` +# On branch myChanges +# Changes not staged for commit: +# (use "git add ..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) +# +# modified: L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py +# +no changes added to commit (use "git add" and/or "git commit -a") +``` +You can undo (revert) your changes (as explained in the message for ```git status```) with ```git checkout -- ...``` +To see your modifications, you can do: +``` +git diff L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py +#or just +#git diff +``` +Which should show something like: +```diff --git a/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py b/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py +index 7b693b9..fc59e07 100644 +--- a/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py ++++ b/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py +@@ -189,3 +189,4 @@ if options.outputDataset == 1: + process.writeDataset.outputCommands.append('keep *_TTAssociator*_TML1Tracks*_*') + + process.schedule = cms.Schedule(process.p, process.pa, process.pd) ++#Hello World +``` +Add the files, and commit: +``` +git add L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py +git commit -m "Modification to tmtt_tf_analysis_cfg comfig file" +``` +Doing ```git status``` will now show: +``` +# On branch myChanges +nothing to commit, working directory clean +``` +Now push these changes to your remote repository. +``` +git push origin myChanges +``` +You are now ready to make a pull request back to the central repository. Go the webpage for your remote repository, and you should see a box stating you have just pushed some changes to the myChanges branch, and gives the option to "Compare & pull request". Make the pull request to merge your changes in the myChanges branch to CMS-TMTT/cmssw:TMTT_1060. + +# Pull changes from the central TMTT repository +If changes (new commits) have been made to the central CMS-TMTT repository since you first checked it out, you can rebase your branch. If you have any local changes, you need to ```git add``` and ```git commit``` them first. Then do: +``` +git pull --rebase TMTT TMTT_1060 +``` +You may have to resolve conflicts, in the usual git way. Then "git push --force" if you want to submit your changes + +Alternatively, if you don't want to commit your local changes, you can do ```git stash```, perform the rebase, and then ```git stash pop```. + +# To run in a newer CMSSW release +The above repository was setup in CMSSW_10_6_0. If you want to run our TMTT software in a newer release, e.g. CMSSW_10_3_0, the command above will attempt things like merging all the differences in all packages between CMSSW_10_6_0 and CMSSW_10_3_0. This can be avoided by performing a ```git cms-rebase-topic```, or by manually performing a spare checkout. For the former, you can then make a new branch of our software for the new CMSSW release + +## Rebase +This example is moving from CMSSW_10_6_0 (the release the TMTT_1060 branch was created in) to CMSSW_10_7_0 +``` +cmsrel CMSSW_10_7_0 +cd CMSSW_10_7_0/src +cmsenv + +git cms-init +git remote add -t TMTT_1060 TMTT git@github.com:CMS-TMTT/cmssw.git +git cms-rebase-topic -o CMSSW_10_6_0 CMS-TMTT:TMTT_1060 +``` +You will end up on a branch called TMTT_1060, which will have our TMTT software on top of CMSSW_10_3_0. You can change to a new branch e.g. TMTT_1060_10_3_0, and push the new branch to the remote repository (if you have permissions). If this new CMSSW release and branch should become the "master" branch everyone should work from, then you should also update the recipes/documentation. + +## Manual sparse-checkout +Here you tell git to only consider the TMTT directory when performing a checkout (which is similar in part is what the above checkout/merge topic commands do, as you don't need to checkout all of CMSSW). + +The difference here is that if you make changes and a pull request, the pull request will be back to the CMS-TMTT:TMTT_1060 branch. +``` +cmsrel CMSSW_10_7_0 +cd CMSSW_10_7_0/src +cmsenv + +git cms-init +git remote add -t TMTT_1060 TMTT git@github.com:CMS-TMTT/cmssw.git +git fetch TMTT TMTT_1060 + +echo "/L1Trigger/TrackFindingTMTT" >> .git/info/sparse-checkout +echo "/TMTrackTrigger/MCsamples" >> .git/info/sparse-checkout + +git checkout -b myChanges TMTT/TMTT_1060 +``` diff --git a/L1Trigger/TrackFindingTMTT/README_HLS.txt b/L1Trigger/TrackFindingTMTT/README_HLS.txt new file mode 100644 index 0000000000000..c68a3732fdc28 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/README_HLS.txt @@ -0,0 +1,35 @@ +To run the TMTT tracking chain in CMSSW with the HLS version of the KF, you must have +Vivado on your computer, and have set it up by doing something like: + +setenv VIVADO_DIR /opt/ppd/tools/xilinx/Vivado/2018.1 +source $VIVADO_DIR/settings.csh + +Then checkout the TMTT CMSSW software following instructions in https://github.com/CMS-TMTT/cmssw/blob/TMTT_1025/L1Trigger/TrackFindingTMTT/README.md . + +You should then: + +1) cd L1Trigger/TrackFindingTMTT/ +1) mv BuildFile.xml BuildFile_original.xml +2) mv BuildFile_HLS.xml BuildFile.xml +3) Edit hls.xml , changing variable HLS_BASE to point to your local Vivado directory. +4) scram setup hls.xml +5) Set the TMTT cfg parameter: + TMTrackProducer.TrackFitSettings.TrackFitters = cms.vstring("KF4ParamsCombHLS") + +N.B. If using with the Demonstrator SW, also edit BuildFile.xml, to: + +i) Add: + +Notes: + +a) The HLS code is in src/HLS/ & interface/HLS/ + +b) BuildFile_HLS.xml defines a pragma variable USE_HLS , which is used to switch on a few lines of +C++ in TrackFitGeneric.cc that call the HLS code. + +c) In addition to the usual track performance summary, the HLS code prints a summary recording +if any finite bit HLS variables overflowed. + +Specific notes for use with Hybrid tracking: + +d) Edit L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h to define PT_2GEV and HYBRID_FORMAT. diff --git a/L1Trigger/TrackFindingTMTT/README_SimpleCode.txt b/L1Trigger/TrackFindingTMTT/README_SimpleCode.txt new file mode 100644 index 0000000000000..e6ebb5003b182 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/README_SimpleCode.txt @@ -0,0 +1,290 @@ +------------------------------------------------------------------------------------- +* How to setup the framework and how to run our analysis code: + +The code is in GITHUB. It can be browsed in in +https://github.com/CMS-TMTT/cmssw/blob/TMTT_1060/L1Trigger/TrackFindingTMTT/ . +(An older version of the code can be found in SVN in https://svnweb.cern.ch/cern/wsvn/UK-TrackTrig/software/cmssw/trunkSimpleCode9). + +- Setup a CMSSW environment. +cmsrel CMSSW_10_6_0 +cd CMSSW_10_6_0/src +cmsenv + +- Software checkout + +Check out from GIT following instructions in https://github.com/CMS-TMTT/cmssw/blob/TMTT_1060/L1Trigger/TrackFindingTMTT/README.md . + +- MC samples + You can use the RelVal samples in L1Trigger/TrackFindingTMTT//test/MCsamples/1040/RelVal/ or + L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/ . + These are based on CMS geometry D21 or D17 respectively. + + It is strongly recommended to copy a sample of events to your local scratch disk, since this will run much + faster than reading them from dcache or XROOTD. + +- Optionally, change the configuration parameters. (See section "Changing configuration options" below). + +- Compile: + scram b -j8 + +- Run the code + cd L1Trigger/TrackFindingTMTT/test/ + cmsRun tmtt_tf_analysis_cfg.py + + or with options: + + cmsRun tmtt_tf_analysis_cfg.py Events=50 inputMC=../../../Samples91X/930pre3/TTbar/PU200.txt histFile=outputHistFile.root makeStubs=1 + +- Look at the printout from the job. At the end, it prints the number of track candidates reconstructed + and the algorithmic tracking efficiency. + +- Look at the analysis histograms (which are explained in '(11) Class "Histos"' below). + root Hist.root + TBrowser b + +------------- + +=== Producing stubs ===: + +If you want to remake stubs on the fly (e.g. with different window sizes), you can do: + +cmsRun tmtt_tf_analysis_cfg.py makeStubs=1 + +This will run the CMSSW modules that produce the stubs (and truth association) before running our tracking algorithms. +Note this will take a long time to run (~100 events per hour for ttbar+200PU), so is only suitable for +debugging on a small number of events. + +To produce the stubs, add them to the event content, and output the new collections to file +(along with the existing event content), you can run make_stubs.py: + +cmsRun make_stubs.py inputMC=../../../Samples91X/930pre3/TTbar/PU200.txt Events=50 + +This will produce an output file output.root, which can then be read by tmtt_tf_analysis_cfg without having to remake the stubs. +i.e. you can then run with (or omit the makeStubs argument as it's False by default): + +cmsRun tmtt_tf_analysis_cfg.py makeStubs=0 + +=== Changing configuration options ===: + +a) The full set of config parameters, which comments explaining what each is, can be found in +specifiied in L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py. + +b) The file mentioned on (a) is imported by +L1Trigger/TrackFindingTMTT/python/TMTrackProducer_cff.py , +which can optionally override the values of some parameters. This file lists the subset of the cfg +parameters that are most useful. + +e.g. Enable tracking down to 2 GeV, enabled displaced tracking etc. + +c) Alternatively, you can use L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Ultimate_cff.py , +which is like (b) but includes improvements not yet available in the firmware, such as reducing the +Pt threshold to 2 GeV. It is suitable for L1 trigger studies. + +d) You can also override cfg parameters in tmtt_tf_analysis_cfg.py . A line there illustrates how. +This file imports TMTrackProducer_cff.py. + +------------- + +=== Software structure ===: + +1) Class "TMTrackProducer" -- This is the main routine, which uses classes: "InputData" to unpack the useful +data from the MC dataset, and "Sector" & "HTphi" to do the L1 Hough transform track-finding, +and "Get3Dtracks" to estimate the helix params in 3D, optionally by running an r-z track filter. +It creates matrices of "Sector", "HTphi" & "Get3Dtracks", where the matrix elements each correspond to +a different (phi,eta) sector. It then uses "TrackFitGeneric" to do the track fitting and optionally +"KillDupFitTrks" to remove duplicate tracks after the fit. It employs "Histos" to create the analysis + histograms. + To allow comparison of our tracks with those of the AM & Tracklet groups, it also converts our tracks +to the agree common TTTrack format, with this conversion done by the "ConverterToTTTrack" class. + +2) Class "InputData" -- This unpacks the most useful information from the Stubs and Tracking Particle +(truth particles) collections in the MC dataset, and it for convenient access in the "Stub" and "TP" +classes. The "Stub" class uses a class called "DigitalStub" to digitize and then undigitize again +the stub data. This process degrades slightly the resolution, as would happen in the real firmware. +The digitisation is optional. It is called from TMTrackProducer after the stubs have been assigned to +sectors. + +3) Class "Sector" -- This knows about the division of the Tracker into (phi,eta) sectors that we use +for the L1 tracking, and decides which of these sectors each stub belongs to. + +4) Class "HTrphi" implements the Hough transforms in the r-phi plane. It inherits from +a base class "HTbase". The Hough transform array is implemented as a matrix of "HTcell" +objects. The HTrphi class stores tracks it finds using the "L1track2D" class. It optionally +uses class "KillDupTrks" to attempt to eliminate duplicate tracks. And optionally, class "MuxHToutputs" +can be used to multiplex the tracks found in different HT arrays (sectors) onto a single output +optical link pair. + +5) Class "HTcell" -- This represents a single cell in an HT array. It provides functions allowing stubs +to be added to this cell, to check if the stubs in a cell give a good track candidate, and to check +if this matches a tracking particle (truth). + +6) Class "Get3Dtracks" makes an estimate of the track parameters in 3D, stored in the "L1track3D" +class, by taking the r-phi track found by the HT, assuming z0 = 0 and that eta is given by the centre +of the eta sector that track is in. Optionally it can also create a second collection of L1track3D, +by running an r-z track filter (from class "TrkRZfilter") on the tracks found by the HT, which gives +cleaner tracks with more precise r-z helix param info. + +7) Class "L1track2D" represents a 2D track, reconstructed in the r-phi or r-z plane by a Hough transform. +Class "L1track3D" represents a 3D tracks, obtained by combining the information in the 2D tracks +from r-phi and r-z Hough transforms. These classes give access to the stubs associated to each track, +to the reconstructed helix parameters, and to the associated truth particle (if any). They represent +the result of the track finding. Both inherit from a pure virtual class L1trackBase, which contains +no functionality but imposes common function names. + +8) Class "KillDupTrks" contains algorithms for killing duplicate tracks found within a single +HT array. Class "KillDupFitTrks" contains algorithms for killing duplicate fitted tracks. + +9) Class "TrkRZfilter" contains r-z track filters, such as the Seed Filter, that check if the stubs +on a track are consistent with a straight line in the r-z plane. + +10) Class "TrackFitGeneric" does one (or more) helix fit(s) to the track candidates, using various +other classes that implement linearized chi2, linear regression or Kalman filter fits. These are: + + - ChiSquared4ParamsApprox (chi2 linear fit, with maths simplified for easier use in FPGA) + - SimpleLR (linear regression fit, which is similar to chi2 fit, but assumes all hits have same uncertainty). + - KF4ParamsComb & KF5ParamsComb: Kalman Filter fits to a 4 or 5 parameter helix. + +The fit also uses a couple of dedicated utility classes (Matrix & kalmanState & StubCluster). + +11) Class "L1fittedTrack" contains the result of running a track fitter (the algorithm for which is +implemented in class "TrackFitAlgo") on the L1track3D track candidate found by the Hough transform. +It gives access to the fitted track parameters and chi2, and via a link to the L1track3D candidate +that produced it, also to the stubs on the track and the associated truth particle (if any). +It inherits from the pure virutal L1trackBase, ensuring it has some common classes with L1track3D and +L1track2D. + +12) Class "L1fittedTrk4and5" contains a pair of L1fittedTrack objects, containg the result of doing +either a 4 or 5 parameter helix fit to the track, where the former assumes d0 = 0. + +13) Class "DegradeBend" -- This is used by class "Stub" to degrade the resolution on the stub +bend information to that expected in the electronics, as opposed to that currently in CMSSW. + +14) "Utility" -- contains a few useful functions, that are not part of a class. + +15) Class "Settings" -- Reads in the configuration parameters. + +16) Class "Histos" -- Books and fills all the histograms. There are several categories of histograms, +with each category being booked/filled by its own function inside "Histos", and being placed inside its +own ROOT directory in the output histogram file. The categories are "InputData" = plots made with the +Stubs & Tracking Particles; "CheckEtaPhiSectors" = plots checking assignment of stubs to (eta,phi) +sectors; "HT" = plots checking how stubs are stored in the Hough Transform arrays; "TrackCands" = plots +showing number of track candidates found & investigating why tracking sometimes failed, +"EffiAndFakeRate" = plots of tracking efficiency. + +Each user of the code will probably want to book their own set of histograms inside "Histos". So +just consider the version of this class in GIT as a set of examples of how to do things. Don't feel +obliged to understand what every histogram does. + +17) Class "DeadModuleDB" is used both to emulate dead modules by killing stubs in certain tracker +regions, and to recover efficiency caused by dead modules indicating in which sectors looser +track-finding cuts are required. + +Class "StubKiller" also emulates dead modules. It was written in collaboration with Tracklet to +model the scenarios requested by the Stress Test committee. If it is used, then the emulation in +DeadModuleDB should not be. + +18) SimTracker/TrackTriggerAssociation/ contains a modification to the official L1 track to TrackingParticle +matching software used by Louise Skinnari's official L1 track analysis code. This modification (made by +Seb Viret) to TTTrackAssociator.h allows one incorrect hit on L1 tracks, whereas the original matching code +allowed none. + +------ + +To update the dOxygen documentation, just type "doxygen". This creates the web page inside html/ +A recent version of this documentation is in http://tomalini.web.cern.ch/tomalini/IanSimpleCode/hierarchy.html . + +=== To output TTTrack dataset to EDM output_dataset.root file (e.g. for L1 trigger studies) === + +Before doing "cmsRun tmtt_tf_analysis_cfg.py", edit this script to set "outputDataset = 1". +You may also need to edit the python associating the TMTT L1 tracks to the MC truth particles, +to specify which track fitter you are using. + +If you only want to make TTTracks, and don't care about the TMTT histograms or job summary, you +can save CPU by setting cfg params: + +TMTrackProducer.EnableMCtruth = cms.bool(False) +TMTrackProducer.EnableHistos = cms.bool(False) + +=== To run Louise Skinnari's official CMS L1 track performance analysis code === + +i) This runs on the TTTrack objects produced by our TMTrackProducer. As the Tracklet group also +produce TTTracks, this performance code can be used by all groups. (N.B. When not comparing our +results with another group, our own tmtt_tf_analysis_cfg.py analysis software described +above is usually more convenient). + +ii) To include the official analysis code in your setup, follow this recipe: + +cmsrel CMSSW_9_3_8 +cd CMSSW_9_3_8/src +cmsenv + +# Checkout the directory containing the ntuple maker analysis code from git. +git cms-merge-topic skinnari:Tracklet_932 + +# Checkout the analysis and plotting scripts from gitlab +git clone https://gitlab.cern.ch/cms-tracker-phase2-backend-development/BE_software/L1TrackTools.git + +# Checkout our private analysis code from git as explained previously. +(see above) + +# Compile +scramv1 b -j8 + +iii) To run it, do: + + cd L1Trigger/TrackFindingTMTT/test/ + cmsRun L1TrackNtupleMaker_cfg.py trkFitAlgo=All + +This runs our TMTrackProducer code, exactly as before, and configured with the same python files. +This will also run the tracklet track finding code. + +The argument trkFitAlgo specifies which track finding algorithms to run. +Possible options are KF4ParamsComb, SimpleLR, Tracklet, All + +KF4ParamsComb : TMTT chain with KF4ParamsComb track fitter (HT+KF+DR) +SimpleLR : TMTT chain with seed filter and SimpleLR track fitter (HT+SF+LR+DR) +Tracklet : Runs the default tracklet tracking from skinnari:Tracklet_93X +All : Runs all three + +Note that you can run KF4ParamsComb chain without the SF and SimpleLR with the SF in the same job. +You can also specify a comma separated list e.g. if you just wanted to run two of the fitters, you +can specify trkFitAlgo=SimpleLR,Tracklet + +It then runs CMS-agreed code to produce an ntuple from these tracks: + + L1Trigger/TrackFindingTracklet/test/L1TrackNtupleMaker.cc + +iv) When the job has finished, you will see a Hist.root file containing all the histograms produced +by our standard analysis TMTrackProducer, plus in addition the ntuples. +There will be one ntuple corresponding to the tracks produced by each track fitter you ran with, +and one ntuple for the tracklet tracks. + +v) To make .png files containing histograms of tracking efficiency, resolution etc., start root & type +the two commands: + .L ../../../L1TrackTools/L1TrackNtuplePlot.C++ + L1TrackNtuplePlot("Hist","_TMTT_KF4ParamsComb") + +Altenartively, you can copy/move your output Hist.root file to the L1TrackTools directory: + mv Hist.root ../../../L1TrackTools/ + cd ../../../L1TrackTools/ + .L L1TrackNtuplePlot.C++ + L1TrackNtuplePlot("Hist","_TMTT_KF4ParamsComb") + +After running, the histograms will be in a root file called "output_Hist_TMTT_KF4ParamsComb.root", +and also saved as pdf/png in the TrkPlots directory (if this directory doesn't exist, you will need +to create it and rerun). + +The arguments of the macro are explained around line 45, and here are some usage examples: + +To produce plots for muons (from the primary interaction), for the KF4ParamsComb fitter: + .L L1TrackNtuplePlot.C++ + L1TrackNtuplePlot("Hist", "_TMTT_KF4ParamsComb", 0, 13 ) + +To produce plots for all TP in jets with pt>100 GeV: + .L L1TrackNtuplePlot.C++ + L1TrackNtuplePlot("Hist", "_TMTT_KF4ParamsComb", 2, 0 ) + +Note that by default the efficiency is defined for TPs with pt>2GeV. To consider pt>3GeV, you need to specify a few more arguments. +e.g. to produce plots for TP with pt>3GeV in jets with pt>100 GeV: + .L L1TrackNtuplePlot.C++ + L1TrackNtuplePlot("Hist", "_TMTT_KF4ParamsComb", 2, 0, 0, false, false, 3 ) diff --git a/L1Trigger/TrackFindingTMTT/hls.xml b/L1Trigger/TrackFindingTMTT/hls.xml new file mode 100644 index 0000000000000..fef04c0ba8a08 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/hls.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/L1Trigger/TrackFindingTMTT/interface/ChiSquared4ParamsApprox.h b/L1Trigger/TrackFindingTMTT/interface/ChiSquared4ParamsApprox.h new file mode 100644 index 0000000000000..b2998b26c96dd --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/ChiSquared4ParamsApprox.h @@ -0,0 +1,29 @@ +#ifndef __CHI_SQUARED_4_PARAMS_APPROX__ +#define __CHI_SQUARED_4_PARAMS_APPROX__ + +#include "L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h" + +namespace TMTT { + +class ChiSquared4ParamsApprox : public L1ChiSquared{ + +public: + ChiSquared4ParamsApprox(const Settings* settings, const uint nPar); + + ~ChiSquared4ParamsApprox(){} + +protected: + std::vector seed(const L1track3D& l1track3D); + std::vector residuals(std::vector x); + Matrix D(std::vector x); + Matrix Vinv(); + std::map convertParams(std::vector x); + +private: + std::vector mapToVec(std::map x); + std::map vecToMap(std::vector x); +}; + +} + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h b/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h new file mode 100644 index 0000000000000..ef9b5bbe85968 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h @@ -0,0 +1,63 @@ +#ifndef __ConverterToTTTrack_H__ +#define __ConverterToTTTrack_H__ + +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" + +#include "DataFormats/L1TrackTrigger/interface/TTTypes.h" + +using namespace std; + +namespace TMTT { + +typedef edmNew::DetSetVector< TTStub > DetSetVec; +typedef edm::Ref > TTStubRef; + +//=== Convert our non-persistent L1 track collection to the official persistent CMSSW EDM TTTrack format. +//=== Works for both L1track3D and for L1fittedTrk4and5 objects. + +class ConverterToTTTrack { + +public: + + // Initialize constants. + ConverterToTTTrack(const Settings* settings) : settings_(settings) {invPtToInvR_ = settings->invPtToInvR();} + + ~ConverterToTTTrack(){} + + // N.B. The function with argument L1fittedTrk4and5 below should be used if both 4 and 5 parameter helix fit results + // are to be stored in the same TTTrack object. Whilst the function with argument L1fittedTrack should be used if + // they are two be stored in two different TTTrack objects. + // One of these is a better idea, but we don't yet know which, so keep both functions! + // N.B. Do not call these two functions for invalid fitted tracks. + + // Convert L1track3D (track candidate before fit) to TTTrack format. + TTTrack< Ref_Phase2TrackerDigi_ > makeTTTrack(const L1track3D& trk , unsigned int iPhiSec, unsigned int iEtaReg) const; + // Convert L1fittedTrack (track candidate after fit) to TTTrack format. + TTTrack< Ref_Phase2TrackerDigi_ > makeTTTrack(const L1fittedTrack& trk , unsigned int iPhiSec, unsigned int iEtaReg) const; + +private: + + // Get references to stubs on track. (Templated, so works for either L1track3D or L1fittedTrack). + template + std::vector getStubRefs(const T& trk) const { + + std::vector ttstubrefs; + const std::vector stubs = trk.getStubs(); + for (size_t ii = 0; ii < stubs.size(); ii++) { + TTStubRef ref = *stubs.at(ii); + ttstubrefs.push_back(ref); + } + + return ttstubrefs; + } + +private: + + const Settings *settings_; // Configuration parameters. + float invPtToInvR_; // converts 1/Pt to 1/radius_of_curvature +}; + +} +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h b/L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h new file mode 100644 index 0000000000000..a35bcdb0fe324 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h @@ -0,0 +1,100 @@ +#ifndef __DEADMODULEDB_H__ +#define __DEADMODULEDB_H__ + +#include "DataFormats/Math/interface/deltaPhi.h" + +#include +#include +#include +#include +#include + +using namespace std; + +namespace TMTT { + +class Settings; +class Stub; + +//=============================================================================================================== +/** +* This class allows you to declare parts of the Tracker to be dead. +* You should edit the C++ implementation of this class to specify which moduels are dead. +* +* Modify function defineDeadTrackRegions() to kill stubs in certain layers & angular regions of the tracker. +* +* Modify function defineDeadSectors() to reduce the number of layers cut on tracks in certain (eta,phi) sectors. +*/ +//=============================================================================================================== + +class DeadModuleDB { + +public: + + DeadModuleDB() {this->defineDeadTrackerRegions(); this->defineDeadSectors();} + + ~DeadModuleDB() {} + + // Does this stub lie in a dead region of the tracker? + // This function is only invoked if cfg param DeadSimulate = True & used to kill stubs to emulate dead regions. + bool killStub(const Stub* stub) const; + + // Should the required number of layers that tracks must have be reduced by 1 in the given sector, because of dead modules + // within it? This function is only invoked if cfg param DeadReduceLayers = True. + bool reduceLayerCut(unsigned int iPhiSec, unsigned int iEtaReg) const {return reduceLayerCut_.find( pair(iPhiSec, iEtaReg) ) != reduceLayerCut_.end();} + +public: + + // Define a class to describe regions of the tracker barrel that are dead. + class DeadBarrelRegion { + public: + DeadBarrelRegion(float phiMin, float phiMax, float zMin, float zMax) : + phiMin_(phiMin), phiMax_(phiMax), zMin_(zMin), zMax_(zMax) {} + public: + const float phiMin_; + const float phiMax_; + const float zMin_; + const float zMax_; + }; + + // Define a class to describe regions of the tracker endcap that are dead. + class DeadEndcapRegion { + public: + DeadEndcapRegion(float phiMin, float phiMax, float rMin, float rMax) : + phiMin_(phiMin), phiMax_(phiMax), rMin_(rMin), rMax_(rMax) {} + public: + const float phiMin_; + const float phiMax_; + const float rMin_; + const float rMax_; + }; + +private: + + // Return the difference in azimuth of two angles (phi1 - phi2) in the range 0 to 2*PI. + float deltaPhiPos(float phi1, float phi2) const {return (M_PI + reco::deltaPhi(phi1 - phi2 - M_PI, 0.) );} + + // Define regions of the tracker in which the modules are dead. + // This function is only relevant if cfg param DeadSimulate = True, when any stubs in modules within these regions are killed, + // so emulating MC with dead regions. + void defineDeadTrackerRegions(); + + // Define sectors in which the cut on number of layer numbers on tracks should be reduced by 1, because + // they contain dead modules. This function is only relevant if cfg param DeadReduceLayers = True. + // Ideally these sectors would be derived from the regions declared in definedDeadTrackerRegions(). + void defineDeadSectors(); + +private: + + // Regions of the tracker barrel & endcap which are dead. + map< unsigned int, vector > deadBarrelRegions_; + map< unsigned int, vector > deadEndcapRegions_; + + // Sectors in which layer cut should be reduced. + set< pair > reduceLayerCut_; + +}; + +} +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h b/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h new file mode 100644 index 0000000000000..32eb7a20c0d67 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h @@ -0,0 +1,81 @@ +#ifndef __DEGRADEBEND_H__ +#define __DEGRADEBEND_H__ + +#include "DataFormats/DetId/interface/DetId.h" + +#include + +class TrackerTopology; + +using namespace std; + +namespace TMTT { + +class DegradeBend { + + /* + *------------------------------------------------------------------------------------------------------------------- + * Implements reduced bits to encode stub bend information: 3 bits for PS, 4 bits for 2S, since the Tracker + * doesn't have the bandwidth to output the unreduced data from the FE electronics. + * + * This obtains the stub window sizes from a hard-wired copy of L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py . + * Whenever these window sizes are so large that not all bend values allowed within them with the available bits, + * then it automatically encodes the bend values within these windows. + * + * The TMTT L1 tracking code can optionally tighten these windows further (cfg option "KillLowPtStubs"). + * This gives slightly more granular encoding with Pt > 3 GeV. + * + * TMTT histograms "hisBendFEVsLayerOrRingPS" & "hisBendFEVsLayerOrRing2S" produced by the "Histos" class + * are useful for debugging. + * + * IMPORTANT: If the code below detects a stub with bend outside the assumed window, meaning that looser windows + * were used when generating the MC, then it sets boolean reject = true to tell you this. You should reject this stub, + * and ideally update the hard-wired constants in this C++. + *------------------------------------------------------------------------------------------------------------------- + */ + +public: + + DegradeBend(const TrackerTopology* trackerTopo) : theTrackerTopo_(trackerTopo) {} + + DegradeBend() {} + + // Given the original bend, flag indicating if this is a PS or 2S module, & detector identifier, + // this return the degraded stub bend, a boolean indicatng if stub bend was outside the assumed window + // size programmed below, and an integer indicating how many values of the original bend + // were grouped together into this single value of the degraded bend. + // + // (Input argument windowFEnew specifies the stub window size that should be used for this stub instead + // of the window sizes specified in TTStubAlgorithmRegister_cfi.py , but it will ONLY replace the latter + // sizes if it windowFEnew is smaller. If you always want to use TTStubAlgorithmRegister_cfi.py, then + // set windowFEnew to a large number, such as 99999.). + void degrade(float bend, bool psModule, const DetId& stDetId, float windowFEnew, + float& degradedBend, bool& reject, unsigned int& numInGroup) const; + +private: + + // Does the actual work of degrading the bend. + void work(float bend, bool psModule, const DetId& stDetId, float windowFEnew, + float& degradedBend, bool& reject, unsigned int& numInGroup, unsigned int& windowHalfStrips) const; + + // Check for mistakes + void sanityChecks(bool psModule, const DetId& stDetId, float windowFEnew, float degradedBend, unsigned int numInGroup, unsigned int windowHalfStrips) const; + +private: + + const TrackerTopology* theTrackerTopo_; + + // Number of bits used to encoded bend output by FE electronics. + const unsigned int bitsPS_ = 3; + const unsigned int bits2S_ = 4; + + // Stub window sizes as encoded in L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h + static std::vector< double > barrelCut_; + static std::vector< std::vector< double > > ringCut_; + static std::vector< std::vector< double > > tiltedCut_; + static std::vector< double > barrelNTilt_; +}; + +} +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h b/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h new file mode 100644 index 0000000000000..10b9887a4bfbf --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h @@ -0,0 +1,235 @@ +#ifndef __DIGITALSTUB_H__ +#define __DIGITALSTUB_H__ + +#include "FWCore/Utilities/interface/Exception.h" +#include + +using namespace std; + +//=== Used to digitize stubs both for input to GP and for input to HT. +//=== N.B. After constructing an object of type DigitalStub, you must call functions +//=== init() and make() before you try using any of the other functions to access digitized stub info. + +//=== WARNING: Not all variables available in the GP are available inside the HT or visa-versa, +//=== so think about the hardware when calling the functions below. + +namespace TMTT { + +class Settings; + +class DigitalStub { + +public: + + // Digitization for KF in Hybrid tracking + + DigitalStub(const Settings* settings, double r, double phi, double z, unsigned int iPhiSec); + + // Note configuration parameters (for TMTT tracking) + DigitalStub(const Settings* settings); + + ~DigitalStub(){} + + // Initialize stub with original, floating point stub coords, + // range of m bin (= q/Pt bin) values allowed by bend filter, + // normal & "reduced" tracker layer of stub, stub bend, and pitch & seperation of module, + // and half-length of strip or pixel in r and in z, and if it's in barrel, tilted barrel and/or PS modules. + void init(float phi_orig, float r_orig, float z_orig, + unsigned int min_qOverPt_bin_orig, unsigned int max_qOverPt_bin_orig, + unsigned int layerID, unsigned int layerIDreduced, float bend_orig, + float pitch, float sep, float rErr, float zErr, bool barrel, bool tiltedBarrel, bool psModule); + + // Digitize stub for input to Geographic Processor, with stub phi coord. measured relative to phi nonant that contains specified phi sector. + void makeGPinput(unsigned int iPhiSec); + + // Digitize stub for input to Hough transform, with stub phi coord. measured relative to specified phi sector. + // (Also still allows digital data for input to GP to be accessed). + void makeHTinput(unsigned int iPhiSec); + + // Digitize stub for input to r-z Seed Filter or Track Fitter. + // Argument is "SeedFilter" or name of Track Fitter. + void makeSForTFinput(string SForTF); + + void makeDRinput(unsigned int stubId); + + // N.B. The m_min and m_max variables should logically be calculated by DigitalStub::makeHTinput(), + // but are actually calculated by Stub::digitizeForHTinput() because too lazy to move code. + + //--- The functions below return variables post-digitization. + //--- Do not call any of the functions below, unless you have already called init() and make()! + + // Digits corresponding to stub coords. + // %%% Those common to GP & HT input. + int iDigi_Rt() const {this->okGP(); return iDigi_Rt_;} // r coord. relative to chosen radius + unsigned int iDigi_R() const {this->okSForTF(); return iDigi_R_;} // r coord. + int iDigi_Z() const {this->okGP(); return iDigi_Z_;} // z coord. + int iDigi_Z_KF() const {this->okSForTF(); return iDigi_Z_KF_;} // z coord for internal KF use + // %%% Those exclusively input to HT. + unsigned int iDigi_PhiSec() const {this->okHT(); return iDigi_PhiSec_;} // phi sector number + int iDigi_PhiS() const {this->okHT(); return iDigi_PhiS_;} // phi coord. relative to sector + // %%% Those exclusively input to GP. + unsigned int moduleType() const {this->okin(); return moduleType_;} // module type ID (gives pitch/spacing) + unsigned int iDigi_Nonant() const {this->okGP(); return iDigi_Nonant_;} // phi nonant number + int iDigi_PhiO() const {this->okGP(); return iDigi_PhiO_;} // phi coord. relative to nonant + int iDigi_Bend() const {this->okGP(); return iDigi_Bend_;} // stub bend + // %%% Those exclusively input to seed filter. + unsigned int iDigi_rErr() const {this->okSForTF(); return iDigi_rErr_;} // Stub uncertainty in r, assumed equal to half strip length. + unsigned int iDigi_zErr() const {this->okSForTF(); return iDigi_zErr_;} // Stub uncertainty in z, assumed equal to half strip length. + + // Floating point stub coords derived from digitized info (so with degraded resolution). + // %%% Those common to GP & HT input. + float phi() const {this->okGP(); return phi_;} + float r() const {this->okGP(); return r_;} + float z() const {this->okGP(); return z_;} + float rt() const {this->okGP(); return rt_;} + // %%% Those exclusively input to HT. + float phiS() const {this->okHT(); return phiS_;} + // Integer data after digitization (which doesn't degrade its resolution, but can recast it in a different form). + // m bin range (= q/Pt bin range) allowed by bend filter + // Note this range is centred on zero, so differs from Stub::min_qOverPt_bin() etc. which return a +ve number. + int m_min() const {this->okHT(); return m_min_; } + int m_max() const {this->okHT(); return m_max_; } + // Tracker layer identifier encoded as it will be sent along optical link. + // Note that this differs from the encoding returned by Stub::layerIdReduced()! + unsigned int iDigi_LayerID() const {this->okHT(); return iDigi_LayerID_;} + // %%% Those exclusively input to GP. + float phiO() const {this->okGP(); return phiO_;} + float bend() const {this->okGP(); return bend_;} + // %%% Those exclusively input to seed filter. + float rErr() const {this->okSForTF(); return rErr_;} + float zErr() const {this->okSForTF(); return zErr_;} + + //--- The functions below give access to the original variables prior to digitization. + //%%% Those common to GP & HT input. + float orig_phi() const {this->okin(); return phi_orig_;} + float orig_r() const {this->okin(); return r_orig_;} + float orig_z() const {this->okin(); return z_orig_;} + //%%% Those exclusively input to GP. + float orig_bend() const {this->okin(); return bend_orig_;} + // %%% Those exclusively input to seed filter. + float orig_rErr() const {this->okin(); return rErr_orig_;} + float orig_zErr() const {this->okin(); return zErr_orig_;} + + //--- Utility: return phi nonant number corresponding to given phi sector number. + unsigned int iGetNonant(unsigned int iPhiSec) const {return floor(iPhiSec*numPhiNonants_/numPhiSectors_);} + + unsigned int StubId() const {this->okDR(); return stubId_;} + + +private: + + // Redigitize stub for input to Geographic Processor, if it was previously digitized for a different phi sector. + void quickMakeGPinput(int iPhiSec); + + // Redigitize stub for input to Hough transform, if it was previously digitized for a different phi sector. + void quickMakeHTinput(int iPhiSec); + + // Check that stub coords. & bend angle are within assumed digitization range. + void checkInRange() const; + + // Check that digitisation followed by undigitisation doesn't change significantly the stub coordinates. + void checkAccuracy() const; + + // Check that makeGPinput() or makeHTinput() are called before accessing digitized stub info. + void okGP() const {if (! ranMakeGPinput_) throw cms::Exception("DigitalStub: You forgot to call makeGPinput() or makeHTinput()!");} + void okHT() const {if (! ranMakeHTinput_) throw cms::Exception("DigitalStub: You forgot to call makeGPinput() or makeHTinput()!");} + void okSForTF() const {if (ranMakeSForTFinput_ == "") throw cms::Exception("DigitalStub: You forgot to call makeSForTFinput()!");} + void okDR() const {if (! ranMakeDRinput_) throw cms::Exception("DigitalStub: You forgot to call makeDRinput()!");} + + + // Check that init() is called before accessing original pre-digitization variables. + void okin() const {if (! ranInit_) throw cms::Exception("DigitalStub: You forgot to call init()!");} + +private: + + //--- To check DigitialStub correctly initialized. + bool ranInit_; + bool ranMakeGPinput_; + bool ranMakeHTinput_; + string ranMakeSForTFinput_; + bool ranMakeDRinput_; + //--- configuration + + // Digitization configuration + int iFirmwareType_; + unsigned int phiSectorBits_; + unsigned int phiSBits_; + float phiSRange_; + unsigned int rtBits_; + float rtRange_; + unsigned int zBits_; + float zRange_; + unsigned int phiOBits_; + double phiORange_; + unsigned int bendBits_; + float bendRange_; + + // Digitization multipliers + float phiSMult_; + float rtMult_; + float zMult_; + double phiOMult_; + float bendMult_; + + // Are we using reduced layer ID, so layer can be packed into 3 bits? + bool reduceLayerID_; + + // Number of phi sectors and phi nonants. + unsigned int numPhiSectors_; + unsigned int numPhiNonants_; + // Phi sector and phi nonant width (radians) + double phiSectorWidth_; + double phiNonantWidth_; + // Radius from beamline with respect to which stub r coord. is measured. + float chosenRofPhi_; + + // Number of q/Pt bins in Hough transform array. + unsigned int nbinsPt_; + + //--- Original floating point stub coords before digitization. + float phi_orig_; + float r_orig_; + float z_orig_; + float rt_orig_; + double phiS_orig_; + double phiO_orig_; + unsigned int layerID_; // Tracker layer ID + unsigned int layerIDreduced_; // Tracker "reduced" layer ID + unsigned int min_qOverPt_bin_orig_; // Range in q/Pt bins in HT array compatible with stub bend. (+ve definate) + unsigned int max_qOverPt_bin_orig_; + float bend_orig_; + float rErr_orig_; + float zErr_orig_; + + //--- Digits corresponding to stub coords. + unsigned int iDigi_PhiSec_; + int iDigi_PhiS_; + int iDigi_Rt_; + unsigned int iDigi_R_; + int iDigi_Z_; + int iDigi_Z_KF_; + unsigned int iDigi_LayerID_; // Encoded tracker layer + int m_min_; // Range in q/Pt bins in HT array compatible with stub bend. (range centred on zero) + int m_max_; + unsigned int moduleType_; + unsigned int iDigi_Nonant_; + int iDigi_PhiO_; + int iDigi_Bend_; + unsigned int iDigi_rErr_; + unsigned int iDigi_zErr_; + unsigned int stubId_; + //--- Floating point stub coords derived from digitized info (so with degraded resolution). + float phi_; + float r_; + float z_; + float phiS_; + float rt_; + float phiO_; + float bend_; + float rErr_; + float zErr_; +}; + +} +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h b/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h new file mode 100644 index 0000000000000..bd9f6eb7f99b5 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h @@ -0,0 +1,260 @@ +#ifndef __DIGITALTRACK_H__ +#define __DIGITALTRACK_H__ + +#include "FWCore/Utilities/interface/Exception.h" +#include "L1Trigger/TrackFindingTMTT/interface/TP.h" +#include +#include + +using namespace std; + +namespace TMTT { + +class Settings; + +//==================================================================================================== +/** +* Used to digitize the fitted track helix params. +* WARNING: Digitizes according to common format agreed for KF and SimpleLR fitters, +* and uses KF digitisation cfg for all fitters except SimpleLR. +*/ +//==================================================================================================== + +class DigitalTrack { + +public: + + // Note configuration parameters. + DigitalTrack(const Settings* settings); + // Dummy constructor + DigitalTrack() {} + // DigitalTrack(); + + ~DigitalTrack(){} + + /// Initialize track with original, floating point coords + void init(const string& fitterName, unsigned int nHelixParams, + unsigned int iPhiSec, unsigned int iEtaReg, int mbin, int cbin, int mBinhelix, int cBinhelix, + unsigned int hitPattern, + float qOverPt_orig, float d0_orig, float phi0_orig, float tanLambda_orig, float z0_orig, float chisquaredRphi_orig, float chisquaredRz_orig, + float qOverPt_bcon_orig, float phi0_bcon_orig, float chisquaredRphi_bcon_orig, // beam-spot constrained values. + unsigned int nLayers, bool consistent, bool consistentSect, bool accepted, + float tp_qOverPt, float tp_d0, float tp_phi0, float tp_tanLambda, float tp_z0, float tp_eta, + int tp_index, bool tp_useForAlgEff, bool tp_useForEff, int tp_pdgId); + + // Digitize track + void makeDigitalTrack(); + + //--- The functions below return variables post-digitization. + //--- Do not call any of the functions below, unless you have already called init() and make()! + + // Digits corresponding to track params. + int iDigi_oneOver2r() const {this->ok(); return iDigi_oneOver2r_;} // half inverse curvature of track. + int iDigi_d0() const {this->ok(); return iDigi_d0_;} + int iDigi_phi0rel() const {this->ok(); return iDigi_phi0rel_;} // measured relative to centre of sector + int iDigi_z0() const {this->ok(); return iDigi_z0_;} + int iDigi_tanLambda() const {this->ok(); return iDigi_tanLambda_;} + unsigned int iDigi_chisquaredRphi() const {this->ok(); return iDigi_chisquaredRphi_;} + unsigned int iDigi_chisquaredRz() const {this->ok(); return iDigi_chisquaredRz_;} + + // Digits corresponding to track params with post-fit beam-spot constraint. + int iDigi_oneOver2r_bcon() const {this->ok(); return iDigi_oneOver2r_bcon_;} // half inverse curvature of track. + int iDigi_phi0rel_bcon() const {this->ok(); return iDigi_phi0rel_bcon_;} // measured relative to centre of sector + unsigned int iDigi_chisquaredRphi_bcon() const {this->ok(); return iDigi_chisquaredRphi_bcon_;} + + // Floating point track params derived from digitized info (so with degraded resolution). + float qOverPt() const {this->ok(); return qOverPt_;} + float oneOver2r() const {this->ok(); return oneOver2r_;} // half inverse curvature of track. + float d0() const {this->ok(); return d0_;} + float phi0() const {this->ok(); return phi0_;} + float phi0rel() const {this->ok(); return phi0rel_;} // measured relative to centre of sector + float z0() const {this->ok(); return z0_;} + float tanLambda() const {this->ok(); return tanLambda_;} + float chisquaredRphi() const {this->ok(); return chisquaredRphi_;} + float chisquaredRz() const {this->ok(); return chisquaredRz_;} + + // Floating point track params derived from digitized track params with post-fit beam-spot constraint. + float qOverPt_bcon() const {this->ok(); return qOverPt_bcon_;} + float oneOver2r_bcon() const {this->ok(); return oneOver2r_bcon_;} // half inverse curvature of track. + float phi0_bcon() const {this->ok(); return phi0_bcon_;} + float phi0rel_bcon() const {this->ok(); return phi0rel_bcon_;} // measured relative to centre of sector + float chisquaredRphi_bcon() const {this->ok(); return chisquaredRphi_bcon_;} + + unsigned int iPhiSec() const {this->okin(); return iPhiSec_;} + unsigned int iEtaReg() const {this->okin(); return iEtaReg_;} + int mBinhelix() const {this->okin(); return mBinhelix_;} + int cBinhelix() const {this->okin(); return cBinhelix_;} + unsigned int nlayers() const {this->okin(); return nlayers_;} + int mBinHT() const {this->okin(); return mBin_;} + int cBinHT() const {this->okin(); return cBin_;} + bool accepted() const {this->okin(); return accepted_;} + unsigned int hitPattern() const {this->okin(); return hitPattern_;} + + //--- The functions below give access to the original variables prior to digitization. + //%%% Those common to GP & HT input. + float orig_qOverPt() const {this->okin(); return qOverPt_orig_;} + float orig_oneOver2r() const {this->okin(); return oneOver2r_orig_;} // half inverse curvature of track. + float orig_d0() const {this->okin(); return d0_orig_;} + float orig_phi0() const {this->okin(); return phi0_orig_;} + float orig_phi0rel() const {this->okin(); return phi0rel_orig_;} // measured relative to centre of sector + float orig_z0() const {this->okin(); return z0_orig_;} + float orig_tanLambda() const {this->okin(); return tanLambda_orig_;} + float orig_chisquaredRphi() const {this->okin(); return chisquaredRphi_orig_;} + float orig_chisquaredRz() const {this->okin(); return chisquaredRz_orig_;} + + float tp_pt() const {this->okin(); return tp_pt_;} + float tp_eta() const {this->okin(); return tp_eta_;} + float tp_d0() const {this->okin(); return tp_d0_;} + float tp_phi0() const {this->okin(); return tp_phi0_;} + float tp_tanLambda() const {this->okin(); return tp_tanLambda_;} + float tp_z0() const {this->okin(); return tp_z0_;} + float tp_qoverpt() const {this->okin(); return tp_qoverpt_;} + int tp_index() const {this->okin(); return tp_index_;} + float tp_useForAlgEff() const {this->okin(); return tp_useForAlgEff_;} + float tp_useForEff() const {this->okin(); return tp_useForEff_;} + float tp_pdgId() const {this->okin(); return tp_pdgId_;} + + //--- Utility: return phi nonant number corresponding to given phi sector number. + unsigned int iGetNonant(unsigned int iPhiSec) const {return floor(iPhiSec*numPhiNonants_/numPhiSectors_);} + + bool available() const {return ranMake_;} + +private: + + // Check DigitalTrack correctly initialized; + void okin() const {if (! ranInit_) throw cms::Exception("DigitalTrack: You forgot to call init()!");} + void ok() const {if (! ranMake_) throw cms::Exception("DigitalTrack: You forgot to call makeDigitalTrack()!");} + + // Get digitisation configuration parameters for the specific track fitter being used here. + void getDigiCfg(const string& fitterName); + + // Check that stub coords. are within assumed digitization range. + void checkInRange() const; + + // Check that digitisation followed by undigitisation doesn't change significantly the track params. + void checkAccuracy() const; + +private: + + // Check DigitalTrack correctly initialized. + bool ranInit_; + bool ranMake_; + + // Configuration params + const Settings* settings_; + + string fitterName_; + unsigned int nHelixParams_; + + // Integer data after digitization (which doesn't degrade its resolution, but can recast it in a different form). + unsigned int nlayers_; + unsigned int iPhiSec_; + unsigned int iEtaReg_; + int mBinhelix_; + int cBinhelix_; + bool consistent_; + bool consistentSect_; + int mBin_; + int cBin_; + bool accepted_; + + float tp_qoverpt_; + float tp_pt_; + float tp_eta_; + float tp_d0_; + float tp_phi0_; + float tp_tanLambda_; + float tp_z0_; + int tp_index_; + bool tp_useForAlgEff_; + bool tp_useForEff_; + int tp_pdgId_; + + // Digitization configuration + bool skipTrackDigi_; + unsigned int oneOver2rBits_; + float oneOver2rRange_; + unsigned int d0Bits_; + float d0Range_; + unsigned int phi0Bits_; + float phi0Range_; + unsigned int z0Bits_; + float z0Range_; + unsigned int tanLambdaBits_; + float tanLambdaRange_; + unsigned int chisquaredBits_; + float chisquaredRange_; + + double oneOver2rMult_; + double d0Mult_; + double phi0Mult_; + double z0Mult_; + double tanLambdaMult_; + double chisquaredMult_; + + // Number of phi sectors and phi nonants. + unsigned int numPhiSectors_; + unsigned int numPhiNonants_; + double phiSectorWidth_; + double phiNonantWidth_; + double phiSectorCentre_; + float chosenRofPhi_; + unsigned int nbinsPt_; + float invPtToDPhi_; + + //--- Original floating point stub coords before digitization. + + unsigned int hitPattern_; + + float qOverPt_orig_; + float oneOver2r_orig_; + float d0_orig_; + float phi0_orig_; + float phi0rel_orig_; + float tanLambda_orig_; + float z0_orig_; + float chisquaredRphi_orig_; + float chisquaredRz_orig_; + + float qOverPt_bcon_orig_; + float oneOver2r_bcon_orig_; + float phi0_bcon_orig_; + float phi0rel_bcon_orig_; + float chisquaredRphi_bcon_orig_; + + //--- Digits corresponding to track params. + + int iDigi_oneOver2r_; + int iDigi_d0_; + int iDigi_phi0rel_; + int iDigi_z0_; + int iDigi_tanLambda_; + unsigned int iDigi_chisquaredRphi_; + unsigned int iDigi_chisquaredRz_; + + int iDigi_oneOver2r_bcon_; + int iDigi_phi0rel_bcon_; + unsigned int iDigi_chisquaredRphi_bcon_; + + //--- Floating point track coords derived from digitized info (so with degraded resolution). + + float qOverPt_; + float oneOver2r_; + float d0_; + float phi0_; + float phi0rel_; + float z0_; + float tanLambda_; + float chisquaredRphi_; + float chisquaredRz_; + + float qOverPt_bcon_; + float oneOver2r_bcon_; + float phi0_bcon_; + float phi0rel_bcon_; + float chisquaredRphi_bcon_; +}; + +} +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/Get3Dtracks.h b/L1Trigger/TrackFindingTMTT/interface/Get3Dtracks.h new file mode 100644 index 0000000000000..4c93e3965964c --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/Get3Dtracks.h @@ -0,0 +1,104 @@ +#ifndef __Get3Dtracks_H__ +#define __Get3Dtracks_H__ + +#include "L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" + +#include "boost/numeric/ublas/matrix.hpp" +#include +#include + +using boost::numeric::ublas::matrix; + +using namespace std; + +//=== This reconstructs 3D tracks from the 2D tracks found by the Hough transform. +//=== It can do this by simply estimating the r-z helix parameters from the centre of the eta sector +//=== and/or by running an r-z filter (e.g. Seed Filter), which also cleans up the tracks by +//=== checking their stubs consistency with a straight line in the r-z plane. +//=== +//=== To create 3D tracks, call the sequence init(), run(), and then get tracks via trackCands3D(). + +namespace TMTT { + +class Settings; +class Stub; +class TP; + +class Get3Dtracks { + +public: + + Get3Dtracks() : settings_(nullptr), iPhiSec_(0), iEtaReg_(0), etaMinSector_(0), etaMaxSector_(0), phiCentreSector_(0), runRZfilter_(false) {} + ~Get3Dtracks() {} + + //=== Main routines to make 3D tracks. + + // Initialization + void init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, + float etaMinSector, float etaMaxSector, float phiCentreSector); + + // Make 3D track collections. + void run(const vector& vecTracksRphi) { + this->makeUnfilteredTrks(vecTracksRphi); + if (runRZfilter_) this->makeRZfilteredTrks(vecTracksRphi); + } + + //=== Get 3D tracks. + + // Get 3D tracks (either r-z filtered or unfiltered, depending on the boolean). + // (Each L1track3D object gives access to stubs on each track and helix parameters + // & also to the associated truth tracking particle). + const vector& trackCands3D(bool rzFiltered) const { + if (rzFiltered) { + return vecTracks3D_rzFiltered_; + } else { + return vecTracks3D_unfiltered_; + } + } + + // Get all 3D track candidates (either r-z filtered on unfiltered, depending on the boolean), + // that are associated to the given tracking particle. + // (If the vector is empty, then the tracking particle was not reconstructed in this sector). + vector assocTrackCands3D(const TP& tp, bool rzFiltered) const; + + //=== Access to track r-z filter in case internal info from it required. + + bool ranRZfilter() const {return runRZfilter_;} // Was r-z filter required/run? + + const TrkRZfilter& getRZfilter() const {return rzFilter_;} + +private: + + // Convert 2D HT tracks within the current sector to 3D tracks, + // by adding a rough estimate of their r-z helix parameters, without running any r-z track filter. + void makeUnfilteredTrks(const vector& vecTracksRphi); + + // Make 3D tracks from the 2D HT tracks within the current sector, by running the r-z track filter. + // The r-z filter also adds an estimate of the r-z helix parameters to each track. + // (Not filled if no track fitter needs the r-z filter). + void makeRZfilteredTrks(const vector& vecTracksRphi); + +private: + + // Configuration parameters + const Settings* settings_; + unsigned int iPhiSec_; // Sector number. + unsigned int iEtaReg_; + float etaMinSector_; // Range of eta sector + float etaMaxSector_; // Range of eta sector + float phiCentreSector_; // Phi angle of centre of this (eta,phi) sector. + + bool runRZfilter_; // Does r-z track filter need to be run. + + // Track filter(s), such as r-z filters, run after the r-phi Hough transform. + TrkRZfilter rzFilter_; + + // List of all found 3D track candidates and their associated properties. + vector vecTracks3D_rzFiltered_; // After r-z filter run + vector vecTracks3D_unfiltered_; // Before r-z filter run. +}; + +} +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h b/L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h new file mode 100644 index 0000000000000..07d6fb9498486 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h @@ -0,0 +1,191 @@ +/** + * General HLS utilities, not specific to KF. + * + * Author: Ian Tomalin + */ + +#ifndef __HLSutilities__ +#define __HLSutilities__ + +#ifndef __SYNTHESIS__ +// Switch on short debug summary printout at end of job. +#define PRINT_SUMMARY +// Switch on verbose debug printout (but never during Vivado synthesis). +//#define PRINT +#endif + +#ifdef PRINT +#define PRINT_SUMMARY // Print checkCalc summary of bits used per variable. +#endif + +#ifdef PRINT_SUMMARY +//#define PRINT_HLSARGS // Print all input & outputs stubs & states from KF HLS code. +#endif + +#ifdef PRINT_SUMMARY +#include +#include +#include +#include +#endif + +// Copied from /opt/ppd/tools/xilinx/Vivado_HLS/2016.4/include/ +#include "ap_int.h" +#include "ap_fixed.h" +//#include "hls_half.h" +// Gives access to fp_struct used to cast half to ap_fixed. +//#include "hls/utils/x_hls_utils.h" + +///=== Hard-wired configuration parameters. +///=== WARNING: Since this code must be used in Vivado HLS, it can't use the Settings class. +///=== Therefore all constants are hard-wired here, so may break if you change the configuration parameters. + +#ifdef CMSSW_GIT_HASH +namespace TMTT { + +namespace KalmanHLS { +#endif + +// Used to calculate number of required bits, (which are constants downloaded into FPGA). +#define MAX2(a,b) ((a) > (b) ? (a) : (b)) +#define MAX3(a,b,c) (MAX2(MAX2(a,b),c)) +#define MAX4(a,b,c,d) (MAX2(MAX2(a,b),MAX2(c,d))) + +#ifdef PRINT_SUMMARY + +// Detect poor precision in fixed bit calculations. + +namespace CHECK_AP { + +class INFO { +public: + INFO() {} + INFO(std::string className, int intBitsCfg, int intBitsSeenHigh, int intBitsSeenLow) : className_(className), intBitsCfg_(intBitsCfg), intBitsSeenHigh_(intBitsSeenHigh), intBitsSeenLow_(intBitsSeenLow) {} +public: + std::string className_; + int intBitsCfg_; + int intBitsSeenHigh_; + int intBitsSeenLow_; +}; + +class INFO_int { +public: + INFO_int() {} + INFO_int(int intCfgHigh, int intCfgLow, int intSeenHigh, int intSeenLow) : intCfgHigh_(intCfgHigh), intCfgLow_(intCfgLow), intSeenHigh_(intSeenHigh), intSeenLow_(intSeenLow) {} +public: + int intCfgHigh_; + int intCfgLow_; + int intSeenHigh_; + int intSeenLow_; +}; + +// Map containing info about variable ranges in terms of numbers of bits required to represent them. +extern std::map apCheckMap_; + +// Map containing info about integer ranges expressed as numbers, +extern std::map intRangeMap_; + +// Print contents of map about variable ranges at end of job. +void printCheckMap(); + +// Fill info for summary table & check if fixed bit calculation suffered precision loss. +// (Two versions of this function, one for calculations in float which merely notes max & min +// values of each variable for summary printout, & one for finite bit which also checks precision). + +bool checkCalc(std::string varName, float res_fix, double res_float, double reltol = 0.1, double tol = 0.0); + +template +bool checkCalc(std::string varName, C res_fix, double res_float, double reltol = 0.1, double tol = 0.0) { + bool OK = true; + + double res_float_abs = fabs(res_float); + bool res_float_sign = (res_float >= 0); + int intBitsSeen = (res_float_abs > 0) ? std::ceil(log(res_float_abs)/log(2.)) : -99; + + std::string cNameUgly = typeid(C).name(); + std::string cName = "unknown"; + int intBitsCfg = 0; + if (cNameUgly.find("ap_int") != std::string::npos) { + cName = "ap_int "; + intBitsCfg = res_fix.width - 1; // One bit less for sign + } else if (cNameUgly.find("ap_uint") != std::string::npos) { + cName = "ap_uint "; + intBitsCfg = res_fix.width; + } else if (cNameUgly.find("ap_fixed") != std::string::npos) { + cName = "ap_fixed "; + intBitsCfg = res_fix.iwidth - 1; + } else if (cNameUgly.find("ap_ufixed") != std::string::npos) { + cName = "ap_ufixed"; + intBitsCfg = res_fix.iwidth; + } + + if (apCheckMap_.find(varName) == apCheckMap_.end()) { + apCheckMap_[varName] = INFO(cName, intBitsCfg, intBitsSeen, intBitsSeen); + } else { + int intHighOld = apCheckMap_[varName].intBitsSeenHigh_; + int intLowOld = apCheckMap_[varName].intBitsSeenLow_; + if (intHighOld < intBitsSeen) { + apCheckMap_[varName] = INFO(cName, intBitsCfg, intBitsSeen, intLowOld); + } else if (intLowOld > intBitsSeen) { + apCheckMap_[varName] = INFO(cName, intBitsCfg, intHighOld, intBitsSeen); + } + } + +#ifdef PRINT_SUMMARY + +#ifdef PRINT +#define NPRINTMAX 99999 +#else +#define NPRINTMAX 100 +#endif + + static unsigned int nErrors = 0; + + // Check -ve numbers aren't stored in unsigned variables. + if (res_float < 0) { + if (cName == "ap_uint" || cName == "ap_ufixed") { + OK = false; + if (nErrors < NPRINTMAX) std::cout<<"checkCalc SIGN ERROR ("< reltol && err > tol) { + OK = false; + if (nErrors < NPRINTMAX) { + if (intBitsSeen > intBitsCfg) { + std::cout<<"checkCalc TOO FEW INT BITS ("< "< + KalmanHLS::KFstate getDigiStateIn(unsigned int skipped, unsigned int layer, const KalmanState* state) const; + + // Implement NPAR-specific code called by getDigiStateIn(...). + template + void getDigiStateInUtil(const vector& helixParams, const TMatrixD& cov, KalmanHLS::KFstate& stateDigi) const; + + // Convert digitized ourput KF state to floating point, + // both for NPAR = 4 & 5 param helix states. + template + const KalmanState* getStateOut(const KalmanState* stateIn, const StubCluster* stubCluster, const KalmanHLS::KFstate& stateOutDigi, const KalmanHLS::KFselect& selectOutDigi); + + // Implement NPAR-specific code call by getStateOut(...). + template + void getStateOutUtil(const KalmanHLS::KFstate& stateOutDigi, const KalmanHLS::KFselect& selectOutDigi, vector& x, TMatrixD& pxx); + + // This is identical to version in KFParamsComb, deciding if a state passes cuts, + // except that it also checks the cut decisions produced by the HLS KalmanUpdate. + bool isGoodState( const KalmanState &state ) const; + +private: + // Digitisation multipliers + double rMult_; + double zMult_; + double phiMult_; + double inv2R_Mult_; + double d0_Mult_; + // Reference radius in r-phi plane. + double chosenRofPhi_; + // Number of eta sectors. + unsigned int numEtaRegions_; + + // Store the extra info provided by the HLS updator about whether the state passes cuts. + KalmanHLS::KFselect<4> selectOutDigi4_; + KalmanHLS::KFselect<5> selectOutDigi5_; +}; + +// Fully specialized templates must be declared outside class, but inside .h file, to ensure they are found. + +template <> +void KFParamsCombCallHLS::getDigiStateInUtil<4>(const vector& helixParams, const TMatrixD& cov, KalmanHLS::KFstate<4>& stateDigi) const; + +template <> +void KFParamsCombCallHLS::getDigiStateInUtil<5>(const vector& helixParams, const TMatrixD& cov, KalmanHLS::KFstate<5>& stateDigi) const; + +template <> +void KFParamsCombCallHLS::getStateOutUtil<4>(const KalmanHLS::KFstate<4>& stateOutDigi, const KalmanHLS::KFselect<4>& selectOutDigi, vector& x, TMatrixD& pxx); + +template <> +void KFParamsCombCallHLS::getStateOutUtil<5>(const KalmanHLS::KFstate<5>& stateOutDigi, const KalmanHLS::KFselect<5>& selectOutDigi, vector& x, TMatrixD& pxx); +} + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/KFconstants.h b/L1Trigger/TrackFindingTMTT/interface/HLS/KFconstants.h new file mode 100644 index 0000000000000..f61fc57e01385 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/HLS/KFconstants.h @@ -0,0 +1,198 @@ +#ifndef __KFconstants__ +#define __KFconstants__ + +#ifdef CMSSW_GIT_HASH +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstate.h" +#else +#include "KFpragmaOpts.h" +#include "HLSutilities.h" +#include "KFstub.h" +#include "KFstate.h" +#include "hls_math.h" // Provides hls::exp(), hls::pow(), hls::abs() +#endif + +#ifdef CMSSW_GIT_HASH +namespace TMTT { + +namespace KalmanHLS { +#endif + +//--- Number of helix parameters for track fit (ignored if running inside CMSSW, aside from z0 cut below). + +static const unsigned int N_HELIX_PAR = 4; + +//=== Configuration of KF data-handling === + +// These params are not used in the KF maths block, but only in the failed attempt at a +// full KF HLS implementation. + +static const unsigned int nKalmanWorkers = 18; +static const unsigned int TMperiod = 143; // clk cycles. Why not 144? + +// Set accumulation period. Latency = TMperiod*numAccEvents + extraClkCounts +static const unsigned int numAccEvents= 5; // No. of events processed in parallel within KF +static const unsigned int extraClkCounts = 50; // Time to get states through worker pipeline. + +// Max #stubs considered by KF per layer per HT track. (Keep less than KFstubN::NID) +static const unsigned int maxStubsPerLayPerTrack = 4; +// Max #stubs considered by KF per HT track. +static const unsigned int maxStubsPerTrack = 16; + +// Max #stubs HT track must have to be defined "hard" +static const unsigned int maxStubsEasy = 10; // If reduced, some tracks have wrong z0? + +// Max allowed skipped layers on easy/hard tracks. +static const unsigned int maxSkipLayersEasy = 2; +static const unsigned int maxSkipLayersHard = 1; + +// Min/max stubs required to output final fitted track. +static const unsigned int minStubsPerFitTrack = 4; +static const unsigned int maxStubsPerFitTrack = 4; + +//=== Configuration of KF maths === + +// Return number of bits needed to contain variable. +//int width(float x){return 1 + hls::ilogb(x);} + +// Digitisation multipliers (from data format doc). +// KF uses same multiplier for r as for stubs in DTC, but one extra bit to accomodate larger range, +// since KF measures r w.r.t. beamline. And it uses r multiplier for z too. + +#ifdef HYBRID_FORMAT +// Taken from smallest stub granularity in DTC in any region of tracker. +// https://twiki.cern.ch/twiki/bin/viewauth/CMS/HybridDataFormat +static const float rMult = 1. / 0.02929688; +static const float phiMult = 1. / (7.828293e-6 * 8); // Degrade tracklet granularity by factor 8 to save bits. +#else +static const float rMult = pow(2.,KFstubN::BR-1)/91.652837; +static const float phiMult = pow(2.,KFstubN::BPHI)/0.6981317; +#endif + +static const float rphiMult = rMult*phiMult; +static const float inv2R_Mult = (phiMult/rMult); +static const float chi2_Mult = 1.; + +// Beam spot length & reference radii w.r.t. beamline. +static const float beamSpotLength= 15.0; +static const float chosenRofPhi_flt = 67.240; +static const KFstubN::TR chosenRofPhi = chosenRofPhi_flt*rMult + 0.5; +static const float chosenRofZ_flt = 50.0; +static const KFstubN::TR chosenRofZ = chosenRofZ_flt*rMult; + +// These boundaries are for tilted tracker geometry. +static const KFstubN::TZ zBarrel = rMult*125.; // Largest z in barrel. +static const KFstubN::TZ zWheel12 = rMult*170.; // Largest z of endcap wheels 1 or 2. +static const KFstubN::TR rPSbarrel = rMult*60.0; // r of PS-2S transition in barrel. +static const KFstubN::TR rPSwheel12 = rMult*66.4; // r below which stub certain to be PS if in endcap wheels 1 or 2. +static const KFstubN::TR rPSwheel345 = rMult*64.6; // r below which stub certain to be PS if in endcap wheels 3, 4 or 5. + +static const float bField = 3.81120228767395; +static const float cSpeed = 2.99792458e10; // Speed of light (cm/s) +static const float invPtToInv2R = bField*(cSpeed/2.0e13); +#ifdef PT_2GEV +static const float minPt_HT = 2.; // Range of Hough transform +#else +static const float minPt_HT = 3.; // Range of Hough transform +#endif +static const float inv2Rmin_HT = invPtToInv2R*(1./minPt_HT); + +static const float kalmanMultScatTerm = 0.00075; // Same as cfg param of same name in CMSSW TMTT code. + +// Phi sectors +static const float TWO_PI = 2*3.14159265; +static const int numPhiSectors = 18; +static const float phiSectorWidth = TWO_PI / numPhiSectors; + +// Bit shift *_bitShift to calculate HT cell from ap_fixed (phi, inv2R) of helix params. +// Chosen such that pow(2,+-shift) = (dcBin_digi, dmBin_digi) calculated below. +// (where sign diff is because in KalmanUpdate.cc, one is used to shift right & one to shift left). +// Adjust if you change bits assigned to stubs. +enum {phiToCbin_bitShift = 7, inv2RToMbin_bitShift = 4}; // Shift right & left respectively to get (c,m) +enum {BCH=KFstateN::BH1-phiToCbin_bitShift, BMH=KFstateN::BH0+inv2RToMbin_bitShift}; + +// Size of HT array +static const int numPhiBins = 64; +#ifdef PT_2GEV +static const int numPtBins = 48; +#else +static const int numPtBins = 32; +#endif +static const ap_int minPhiBin = -numPhiBins/2; // BCH & BMH should be larger than BC & BM to monitor overflow. +static const ap_int maxPhiBin = numPhiBins/2 - 1; +static const ap_int minPtBin = -numPtBins/2; +static const ap_int maxPtBin = numPtBins/2 - 1; + +/* +static const float dcBin = numPhiBins / phiSectorWidth; +static const float dmBin = numPtBins / (inv2Rmin_HT); +static const float dcBin_digi = dcBin/phiMult; // = pow(2,-7) +static const float dmBin_digi = dmBin/inv2R_Mult; // = pow(2,4) +*/ + +// Eta sector boundaries in z at reference radius (assumed symmetric). +// (As this is complex, ROM initialization fails unless stored in a class ...) + +class EtaBoundaries { +public: + enum {nSec=8}; + + EtaBoundaries() { + static const float eta[nSec+1] = {0.0, 0.20, 0.41, 0.62, 0.90, 1.26, 1.68, 2.08, 2.4}; + for (unsigned int i = 0; i <= nSec; i++) { + float zAtRefR = chosenRofZ_flt/tan(2 * atan(exp(-eta[i]))); + z_[i] = rMult*zAtRefR; + } + for (unsigned int j = 0; j < nSec; j++) { + tanL_[j] = 0.5*(1/tan(2*atan(exp(-eta[j]))) + 1/tan(2*atan(exp(-eta[j+1])))); + } + } + +public: + KFstubN::TZ z_[nSec+1]; // z at ref. radius + KFstateN::TT tanL_[nSec]; // central tanL in eta sector. +}; + +// Also failed in VHDL +//static const EtaBoundaries etaBoundaries; + +//--- Cuts to select acceptable fitted track states. +//--- (Array vs #stubs on track, where element 0 is never used). +//--- N.B. If cut value is zero, this indicates cut is not applied. (Trick to avoid Vivado timing failure). + +// Pt or 1/2R cut. +static const float ptCut_flt_tight = minPt_HT - 0.05; // Smaller than HT cut to allow for resolution during KF fit. +static const float ptCut_flt_loose = minPt_HT - 0.10; +static const float inv2Rcut_flt_tight = invPtToInv2R*(1./ptCut_flt_tight); +static const float inv2Rcut_flt_loose = invPtToInv2R*(1./ptCut_flt_loose); +static const KFstateN::TR inv2Rcut_tight = inv2R_Mult*inv2Rcut_flt_tight; +static const KFstateN::TR inv2Rcut_loose = inv2R_Mult*inv2Rcut_flt_loose; +static const KFstateN::TR inv2Rcut[] = {0, 0, inv2Rcut_loose, inv2Rcut_loose, inv2Rcut_tight, inv2Rcut_tight, inv2Rcut_tight}; +static const KFstateN::TR inv2RcutMinus[] = {0, 0, -inv2Rcut_loose, -inv2Rcut_loose, -inv2Rcut_tight, -inv2Rcut_tight, -inv2Rcut_tight}; + +// z0 cut +static const KFstateN::TZ z0Cut_tight = (N_HELIX_PAR == 4) ? rMult*beamSpotLength : 1.7*rMult*beamSpotLength; // r multiplier used for z in KF. +static const KFstateN::TZ z0Cut[] = {0, 0, z0Cut_tight, z0Cut_tight, z0Cut_tight, z0Cut_tight, z0Cut_tight}; +static const KFstateN::TZ z0CutMinus[] = {0, 0, -z0Cut_tight, -z0Cut_tight, -z0Cut_tight, -z0Cut_tight, -z0Cut_tight}; + +// d0 cut +static const float d0Cut_flt_tight = 5.; +static const float d0Cut_flt_loose = 10.; +static const KFstateN::TD d0Cut_tight = rphiMult*d0Cut_flt_tight; +static const KFstateN::TD d0Cut_loose = rphiMult*d0Cut_flt_loose; +static const KFstateN::TD d0Cut[] = {0, 0, 0, d0Cut_loose, d0Cut_tight, d0Cut_tight, d0Cut_tight}; +static const KFstateN::TD d0CutMinus[] = {0, 0, 0, -d0Cut_loose, -d0Cut_tight, -d0Cut_tight, -d0Cut_tight}; + +// Chi2 cut +static const KFstateN::TCHI chi2Cut[] = {0, 0, chi2_Mult*10, chi2_Mult*30, chi2_Mult*80, chi2_Mult*120, chi2_Mult*160}; +// Scale down chi2 in r-phi plane by this factor when applying chi2 cut (to improve electron efficiency). +static const unsigned int chi2rphiScale = 8; // Must be power of 2! + +#ifdef CMSSW_GIT_HASH +} +} +#endif + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h b/L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h new file mode 100644 index 0000000000000..a84dc20441636 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h @@ -0,0 +1,17 @@ +#ifndef __KFpragmaOpts__ +#define __KFpragmaOpts__ + +/** + * Define options specified by pragma statements. + * + * Author: Ian Tomalin + */ + +// OPTION 1: +// If defined, HLS KF will cope with tracking down to 2 GeV Pt instead of 3 GeV. +#define PT_2GEV + +// If defined, HLS assumes hybrid (=tracklet) input format & digitisation multipliers. +#define HYBRID_FORMAT + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/KFstate.h b/L1Trigger/TrackFindingTMTT/interface/HLS/KFstate.h new file mode 100644 index 0000000000000..a08f66646cc40 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/HLS/KFstate.h @@ -0,0 +1,307 @@ +#ifndef __KFstate__ +#define __KFstate__ + +/** + * This defines Helix States for the Kalman Filter HLS code. + * N.B. It therefore can't use the Settings class or any external libraries! Nor can it be a C++ class. + * + * Only the KFstateN, KFstate & KFselect classes are used in the implementation of the KF maths block. + * The other classes are used in the (failed) attempt at a full KF HLS implementation. + * + * All variable names & equations come from Fruhwirth KF paper + * http://dx.doi.org/10.1016/0168-9002%2887%2990887-4 + * + * Author: Ian Tomalin + */ + +// Copied from /opt/ppd/tools/xilinx/Vivado_HLS/2016.4/include/ +#include "ap_int.h" +#include "ap_fixed.h" + +#ifdef CMSSW_GIT_HASH +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h" +#else +#include "KFpragmaOpts.h" +#include "HLSutilities.h" +#include "KFstub.h" +#endif + +#ifndef __SYNTHESIS__ +#include +#endif + +///=== Hard-wired configuration parameters. +///=== WARNING: Since this code must be used in Vivado HLS, it can't use the Settings class. +///=== Therefore all constants are hard-wired here, so may break if you change the configuration parameters. + +#ifdef CMSSW_GIT_HASH +namespace TMTT { + +namespace KalmanHLS { +#endif + +// Ultrascale DSP = (18 bits * 27 bits = 48 bits). +// Though if multiplying unsigned variables, must use 1 bit less than this. + +enum B_DSP { + // Number of bits used by DSP for multiplication of signed numbers in FPGA (Ultrascale). + B18=18, B27=27, B35=2*B18-1, B48=48, + // Number of bits used by DSP for multiplication of unsigned numbers in FPGA. + B17=B18-1, B26=B27-1, B34=B35-1, + // Number of bits used for interface to VHDL (historic, but increasing may increase VHDL BRAM use). + B25=25, B24=B25-1 +}; + +namespace KFstateN { + +// Data formats from https://gitlab.cern.ch/cms-uk-tracktrigger/firmware/l1tf/blob/master/global_formats.docx . +// Since KF maths rely on same multipliers for helix z0 & stub z, phi0 & phi, 1/2R & (r/phi), +// extra precision desired for the helix params goes after the decimal point. +// e.g. 15 bits for 1/2R, as is factor pow(2,15) more grenular than stub phi/r. +// 3 bits for phi0, as is factor pow(2,3) more granular than stub phi. +// 7 bits for z0, as is factor pow(2,7) more granular than stub r. +// TanL & chi2 have multiplier 1, so no. of integer bits must cover their range. + +// Cov. mat. bits can change, but remember to change protostate cov. matrix in VHDL. + +// Number of integer+sign bits for helix params & chi2. +// FIX: BCHI should be increased to 11, to allow for loose chi2(rphi) cut. +// (requires updating HLS IP in KF firmware & removing "bodge" from DigitalTrack.h). +enum {BH0 = 3, BH1 = 15, BH2 = 5, BH3 = 11, BH4=25, BCHI = 10}; +// Number of bits needed for integer part of helix covariance matrix +//enum {BC00 = -6, BC11 = 16, BC22 = -1, BC33=16, BC44=41+2, BC01=6, BC23=8, BC04=18, BC14=20+8+2}; +enum {BC00 = -6, BC11 = 16, BC22 = -1, BC33=16, BC44=41, BC01=5, BC23=7, BC04=17, BC14=29}; + +// Total number of bits (integer + fractional) needed for helix covariance matrix. +// Increasing to 26/27 doesn't increase DSP use, but does increase BRAM use in KF VHDL. +enum {BLENCOV = 20}; + +enum {BEV = KFstubN::BEV, + BTRK = KFstubN::BTRK, + NTRK = KFstubN::NTRK, + BLAY = KFstubN::BLAY, + NLAY = KFstubN::NLAY, + BID = KFstubN::BLAY, + NID = KFstubN::NLAY, + BSEC = KFstubN::BSEC, + BSEC1 = KFstubN::BSEC1, + BM = KFstubN::BM, BC = KFstubN::BC}; + +typedef ap_fixed TR; +typedef ap_fixed TP; +typedef ap_fixed TT; +typedef ap_fixed TZ; +typedef ap_fixed TD; + +typedef ap_ufixed TC00; +typedef ap_ufixed TC11; +typedef ap_ufixed TC22; +typedef ap_ufixed TC33; +typedef ap_fixed TC01; +typedef ap_fixed TC23; +typedef ap_ufixed TC44; +typedef ap_fixed TC04; +typedef ap_fixed TC14; + +// Additional type with extra bit, for internal use. +typedef ap_ufixed<1+BLENCOV,BC00> TC00EX; +typedef ap_ufixed<1+BLENCOV,BC11> TC11EX; +typedef ap_ufixed<1+BLENCOV,BC22> TC22EX; +typedef ap_ufixed<1+BLENCOV,BC33> TC33EX; +typedef ap_fixed <1+BLENCOV,BC01> TC01EX; +typedef ap_fixed <1+BLENCOV,BC23> TC23EX; +typedef ap_ufixed<1+BLENCOV,BC44> TC44EX; +typedef ap_fixed <1+BLENCOV,BC04> TC04EX; +typedef ap_fixed <1+BLENCOV,BC14> TC14EX; + +typedef ap_ufixed TCHI; + +typedef ap_uint TEV; +typedef ap_uint TTRK; +typedef ap_uint TLAY; +typedef ap_uint TID; +typedef ap_uint TNLAY; +typedef ap_uint TSEC; +typedef ap_uint TSEC1; + +typedef ap_int TM; +typedef ap_int TC; +}; + +#ifdef ALL_HLS // Used only for full KF implementation in HLS + +//--- Extra info about proto-state. + +class ProtoInfo { + +public: + + ProtoInfo() { + for (unsigned int i = 0; i < KFstubN::NLAY; i++) numStubsPerLay[i] = 0; + } + +public: + + KFstateN::TID numStubsPerLay[KFstubN::NLAY]; +}; + +#endif + +//--- Format of KF helix state to match VHDL, for both 4 & 5 param helix states. + +template class KFstate; + +template <> class KFstate<4> { + +public: + + KFstate<4>() : inv2R(0), phi0(0), tanL(0), z0(0), + cov_00(0), cov_11(0), cov_22(0), cov_33(0), cov_01(0), cov_23(0), + chiSquaredRphi(0), chiSquaredRz(0), cBin_ht(0), mBin_ht(0), layerID(0), nSkippedLayers(0), hitPattern(0), + trackID(0), eventID(0), phiSectID(0), etaSectID(0), etaSectZsign(0), + valid(0) {} + +public: + + // The digitized helix & covariance parameters specified here are scaled relative to the floating + // point ones by factors appearing in KF4ParamsCombHLS::getDigiState(). + + KFstateN::TR inv2R; // This is misnamed as rInv in Maxeller. Integer bits = 1+ceil(log2(51)); + KFstateN::TP phi0; // Measured with respect to centre of phi sector. Integer bits = 1+ceil(log2(8191)); + KFstateN::TT tanL; // This is misnamed as tanTheta in Maxeller. Integer bits = 1+ceil(log2(12)); + KFstateN::TZ z0; // Integer bits = 1+ceil(log2(150)); + + KFstateN::TC00 cov_00; + KFstateN::TC11 cov_11; + KFstateN::TC22 cov_22; + KFstateN::TC33 cov_33; + KFstateN::TC01 cov_01; // (inv2R, phi0) -- other off-diagonal elements assumed negligible. + KFstateN::TC23 cov_23; // (tanL, z0) -- other off-diagonal elements assumed negligible. + + KFstateN::TCHI chiSquaredRphi; // Chi2 in r-phi plane + small contributions from r-phi & r-z correlations. + KFstateN::TCHI chiSquaredRz; // Chi2 in r-z plane + + KFstateN::TC cBin_ht; // The HT cell (cbin, mbin) are centred on zero here. + KFstateN::TM mBin_ht; + + // This is the KF layer that the KF updator next wants to take a stub from, encoded by L1KalmanComb::doKF(), which in any eta region increases from 0-7 as a particle goes through each layer in turn. It is updated by the StateStubAssociator. + KFstateN::TLAY layerID; + // This is the number of skipped layers assuming we find a stub in the layer the KF updator is currently searched. The KF updator in HLS/Maxeller does not incremement it. + ap_uint<2> nSkippedLayers; + // Hit pattern + KFstateN::TNLAY hitPattern; + KFstateN::TTRK trackID; // Not used by KF updator. Just helps VHDL keep track of which state this is. + KFstateN::TEV eventID; // Not used by KF updator. Just helps VHDL keep track of which event this is. + ap_uint<1> phiSectID; + KFstateN::TSEC etaSectID; // Eta sector ID, but counting away from 0 near theta=PI/2 & increasing to 8 near endcap. (Named SectorID in Maxeller). + ap_uint<1> etaSectZsign; // True if eta sector is in +ve z side of tracker; False otherwise. (Named zSign in Maxeller). + ap_uint<1> valid; // Used by external code when calculation finished on valid input state & stub. + +#ifdef ALL_HLS + ProtoInfo protoInfo; // Extra info about proto state. +#endif + +#ifndef __SYNTHESIS__ +public: + void print(const char* text) const { + if (valid) { + std::cout< i = 0; i < KFstateN::NLAY; i++) { + if (protoInfo.numStubsPerLay[i] > 0) std::cout< class KFstate<5> : public KFstate<4> { + +public: + KFstateN::TD d0; + + KFstateN::TC44 cov_44; // (d0, d0) + KFstateN::TC04 cov_04; // (inv2R, d0) -- other off-diagonal elements assumed negligible. + KFstateN::TC14 cov_14; // (phi0, d0) -- other off-diagonal elements assumed negligible. + +#ifndef __SYNTHESIS__ +public: + void print(const char* text) const { + this->KFstate<4>::print(text); + if (valid) std::cout< class KFselect<5> : public KFselect<4> { +public: + ap_uint<1> d0Cut; +}; + +#ifdef CMSSW_GIT_HASH +} + +} +#endif + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h b/L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h new file mode 100644 index 0000000000000..27ea99a3d97ac --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h @@ -0,0 +1,208 @@ +#ifndef __KFstub__ +#define __KFstub__ + +/** + * This defines Stubs for the Kalman Filter maths HLS code. + * N.B. It therefore can't use the Settings class or any external libraries! Nor can it be a C++ class. + * + * Only the KFstubN & KFstubC classes are used in the implementation of the KF maths block. + * The other classes are used in the (failed) attempt at a full KF HLS implementation. + * + * Author: Ian Tomalin + */ + +// Must use ap_uint<1) instead of bool, due to bug in HLS IP export. + +#include "ap_int.h" +#include "ap_fixed.h" + +#ifdef CMSSW_GIT_HASH +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h" +#else +#include "KFpragmaOpts.h" +#include "HLSutilities.h" +#endif + +#ifndef __SYNTHESIS__ +#include +#endif + +///=== Hard-wired configuration parameters. +///=== WARNING: Since this code must be used in Vivado HLS, it can't use the Settings class. +///=== Therefore all constants are hard-wired here, so may break if you change the configuration parameters. + +#ifdef CMSSW_GIT_HASH +namespace TMTT { + +namespace KalmanHLS { +#endif + +///=== Numbers of bits hard-wired, since same code also used within Vivado HLS, where access to Settings class not possible. + +namespace KFstubN { + // Format of Stub taken from KF stubs.vhd, with #bits specified in L1TF config.vhd, aside from following ... + // r : KF measures it with respect to beam-line instead of critical radius, so uses 1 extra bit. + // z : KF uses same multipler as for r, whereas HT uses multiplier factor 2 smaller than r. + // By using type TZ, the additional factor 2 is applied when when KFstub is created. + +enum {BR = 12+1, BZ = 14, BPHI=14, BR1 = BR - 1, BZ1 = BZ + 1, // For stub coords. + BEV = 3, // Allows up to 8 events to be interleaved inside KF + NEV = (1 << BEV), + // BTRK = 5, // Allows up to 32 tracks cand IDs (compare TM*(320MHz/40MHz)/(5 stubs) = 29) from HT per KF worker per event. + BTRK = 6, // Allows up to 64 tracks cand IDs (bigger than needed, but avoids changing output data format of KF VHDL) + NTRK = (1 << BTRK), + BLAY = 3, // Allows up to 7+1 KF layer IDs (where +1 is for invalid layer) + NLAY = (1 << BLAY), + BID = 3, // Stub ID in layer. [pow(2,BID) - 1] must be >= MaxStubsPerLayPerTrack, + NID = (1 << BID), + BSEC = 3, // Allows up to 2*8 eta sectors, where factor 2 comes from zSign. + BSEC1 = BSEC + 1, // To allow same number of sectors in raw stub format, where no zSign used. +#ifdef PT_2GEV + BM = 6, BC = 6}; // Allow 64*64 HT array. +#else + BM = 5, BC = 6}; // Allow 32*64 HT array. +#endif + +typedef ap_ufixed TR; +typedef ap_fixed TR1; +typedef ap_fixed TZ; // Lowest integer bit has value zero. +typedef ap_fixed TPHI; +typedef ap_uint TEV; +typedef ap_uint TTRK; +typedef ap_uint TLAY; +typedef ap_uint TID; +typedef ap_uint TSEC; +typedef ap_uint TSEC1; +typedef ap_int TM; +typedef ap_int TC; +}; + +//--- Class containing stub coords used by KF maths block. + +class KFstubC { +public: + + KFstubC(const KFstubN::TR& r_, const KFstubN::TZ& z_, const KFstubN::TPHI& phi_, const ap_uint<1>& valid_) : + r(r_), z(z_), phiS(phi_), valid(valid_) {} + + KFstubC() : KFstubC(0,0,0,false) {} + +public: + + KFstubN::TR r; // Note this is r, not rT, so is unsigned. + KFstubN::TZ z; // This is (rMult/zMult) larger than digitised z used by HT, so needs one more integer bit. + KFstubN::TPHI phiS; + + ap_uint<1> valid; // Used by external code to indicate if input data is valid. + +#ifndef __SYNTHESIS__ +public: + void print(const char* text) const { + if (valid) std::cout< class BODGE; +template class MatrixInverseR; +template class MatrixH; +template class MatrixS; +template class MatrixS_transpose; +template class MatrixR; +template class MatrixK; +template class VectorRes; +template class VectorX; +template class MatrixC; + +// These hard-wired constants reduce the number of bits relative to that predicted by bit counting +// based on variable ranges observed in CMSSW. So they should be checked if the code is changed. +// (The dependence of one bodge on another is chosen to ensure that changing each affects the declaration +// of only one variable). + +enum BIT_ADJUST_PLAY {BODGE_V=5, BODGE_CHI2=12}; + +template<> +class BODGE<4> { +public: + // enum BIT_ADJUST {V=BODGE_V, S=2, R=5-S, IR=10+R+S, DET=13-2*R-2*S, K=23-IR+R, RES=2, CHI2=BODGE_CHI2}; + enum BIT_ADJUST {V=BODGE_V, S=2, R=5-S, IR=10+R+S, DET=12-2*R-2*S, K=23-IR+R, RES=1, CHI2=BODGE_CHI2}; +}; + +template<> +class BODGE<5> { +public: + enum BIT_ADJUST {V=BODGE_V, S=2, R=4-S, IR=7+R+S, DET=13-2*R-2*S, K=21-IR+R, RES=1, CHI2=BODGE_CHI2}; +}; + +// Allow some bits for correlation in helix params between r-phi and r-z planes. +enum RZ_PHI_CORR {BCORR=1}; // Set this to 1, so this correlation is almost neglected. + +// Vector of stub coords. + +class VectorM { +public: + typedef ap_fixed<1+KFstubN::BPHI,KFstubN::BPHI> TMP; + typedef ap_fixed<1+KFstubN::BZ,KFstubN::BZ1> TMZ; + + VectorM(const KFstubN::TPHI& phiS, const KFstubN::TZ& z) : _0(phiS), _1(z) { + // Compensate for stubs being rounded down when digitized, by adding extra LSB to coords set to '1'. + _0[0] = 1; + _1[0] = 1; + } +public: + // KFstubN::TPHI _0; + // KFstubN::TZ _1; + TMP _0; + TMZ _1; +}; + +// Covariance matrix of stub coords. + +class MatrixV { +public: + // Use same granularity for resolution as for residuals. + + // But with integer range reduced by BODGE_V, as hit resolution much smaller than max. stub coordinate. + enum {BVP=KFstubN::BPHI-BODGE_V, BVZ=KFstubN::BZ1-BODGE_V, BVPP=2*BVP, BVZZ=2*BVZ}; + typedef ap_ufixed TVPP; + typedef ap_ufixed TVZZ; + typedef ap_ufixed<1,1> TV0; + + enum {BM=12}; // Used for pitch. May need increasing if larger r or phi multipliers used. + typedef ap_ufixed TM; + +public: + MatrixV(const KFstubN::TR& r, const KFstubN::TZ& z, const KFstateN::TR& inv2R, const KFstateN::TT& tanL, const KFstateN::TM& mBin); + +public: + TVPP _00; + TVZZ _11; + const TV0 _01; + const TV0& _10; // Matrix symmetric so use reference to top half. + + // Record if stub is in 2S module or not. (Not pretty to include it in this class, but convenient ...) + bool _2Smodule; +}; + +// Utility for calculating pow(pitch/r, 2) from ROM. + +class PitchOverR_2 { +public: + enum {BRED = 4}; // To save ROM resources, reduce granularity in r by this number of bits. + enum {MAXN = 1 << (KFstubN::BR - BRED)}; // pow(2,BR) // Max. value of [r / pow(2,BRED)]. + // Number of bits chosen based on CalcCheck job summary. + typedef ap_ufixed<12,5> TPOR; +public: + + PitchOverR_2(const MatrixV::TM& pitch) { + for (unsigned int n = 2; n < MAXN; n++) { // Don't bother initializing first two, as would overflow bit range. + float pitchOverR = float(pitch)/(float((n << BRED)) + 0.5*(1 << BRED)); + get[n] = pitchOverR * pitchOverR; // Round to nearest half integer + } + } +public: + TPOR get[MAXN]; +}; + +// Utility for estimating pow(const/Pt, 2) from ROM, where 1/Pt is taken from HT m-bin. + +class InvPt2 { +public: + InvPt2(const ap_uint<1>& iOpt = 0, float scaleFactor = 1.) { + float theConst; + if (iOpt == 0) { + // Used to estimate increase in phi stub error due to scattering. + theConst = kalmanMultScatTerm*phiMult; + } else { + // Used to estimate increase in phi stub error due to conversion from (r,phi) to (z,phi) in endcap. + theConst = invPtToInv2R*scaleFactor*inv2R_Mult; + } + for (int m = minPtBin; m <= maxPtBin; m++) { + // Estimate Pt from Hough m-bin cell. + float constOverPt = theConst * (1./minPt_HT)*(float(m) + 0.5)/float(numPtBins/2); + get[m - minPtBin] = constOverPt*constOverPt; + } + } + + const MatrixV::TVPP& getIt(const KFstateN::TM& m) const {return this->get[m - minPtBin];} + +public: + MatrixV::TVPP get[numPtBins]; +}; + +// Utility for calculating 1/(unsigned int), where unsigned int has MaxInverseR::BDET bits and the +// most significant of these bits has value 1. (Loaded into ROM). + +class OneOverInt { +public: + enum {BDET=9}; // Number of significant bits used to calculate 1/determinant. Keep small to save resources. + //enum {MINN = (1 << (BDET - 2)), MAXN = (1 << BDET)}; // Min & max. value of r + enum {MINN = (1 << (BDET - 2)) + (1 <<(BDET - 3)), MAXN = (1 << BDET)}; // // Min & max. value of r - with min tweaked to allow room in bit range for higher order corrections later. + enum {BOI=2-BDET}; // Large enough to contain reciprocal. + typedef ap_ufixed TOI; +public: + OneOverInt() { + for (unsigned int n = 0; n < MAXN; n++) { // Don't bother initializing first two, as would overflow bit range. + if (n > MINN) { + get[n] = 1./float(n); // Round to nearest half integer + } else { + get[n] = 1./float(MINN+1); // Truncated to save bits, but better than nothing. + } + } + } + + const TOI& getIt(const ap_uint& i) const {return get[i];} + +private: + TOI get[MAXN]; +}; + + +// Inverse of matrix R. + +template +class MatrixInverseR { +public: + // Calculate number of integer bits required for elements of R (assuming matrix approximately diagonal). + enum {BIR00=B34 - MatrixR::BR00 - BODGE::IR, + BIR11=B34 - MatrixR::BR11 - BODGE::IR, + BIR01=0}; // correlation between r-phi & r-z planes not used. + typedef ap_ufixed TRI00; + typedef ap_ufixed TRI11; + typedef ap_ufixed TRI01; + + // Additional types used to cast this matrix to a lower precision one for use in chi2 calculation. + typedef ap_ufixed TRI00_short; + typedef ap_ufixed TRI11_short; + typedef ap_ufixed TRI01_short; + + enum {BDET=OneOverInt::BDET}; // Number of significant bits used to calculate 1/determinant. Keep small to save resources. + +public: + MatrixInverseR(const MatrixR& R); + +public: + // R(inverse) + TRI00 _00; + TRI11 _11; + TRI01 _01; + TRI01& _10; // Matrix symmetric, so can use reference. +}; + +// Since chi2 can be large, use more bits for internal calculation than for external number. +typedef ap_ufixed TCHI_INT; + +#ifdef CMSSW_GIT_HASH +} + +} +#endif + +#endif + + + + diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices4.h b/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices4.h new file mode 100644 index 0000000000000..07c634d23c57d --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices4.h @@ -0,0 +1,262 @@ +/** + * This defines the KF matrices and the operations performance on them. + * + * All variable names & equations come from Fruhwirth KF paper + * http://dx.doi.org/10.1016/0168-9002%2887%2990887-4 + * + * Author: Ian Tomalin + */ + +#ifndef __KalmanMatrices4__ +#define __KalmanMatrices4__ + +// Defines StateHLS & KFstate. Also defines finite bit integers & floats. +#ifdef CMSSW_GIT_HASH +#include "L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstate.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFconstants.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices4.h" +#else +#include "HLSutilities.h" +#include "KFstub.h" +#include "KFstate.h" +#include "KFconstants.h" +#include "KalmanMatrices.h" +#include "KalmanMatrices4.h" +#endif + +#ifdef CMSSW_GIT_HASH +namespace TMTT { + +namespace KalmanHLS { +#endif + +// Calculate matrix of derivatives of predicted stub coords w.r.t. helix params. + +template <> +class MatrixH<4> { +public: + enum {BH=KFstubN::BR+1}; + typedef ap_fixed TH; // One extra bit, since "-r" can be -ve. + typedef ap_ufixed<1,1> T1; + MatrixH(const KFstubN::TR& r) : _00(-r), _12(r), + _01(1), _02(0), _03(0), + _10(0), _11(0), _13(1) {} +public: + TH _00, _12; + const T1 _01, _02, _03, + _10, _11, _13; +}; + +// S = H * C + +template <> +class MatrixS<4> { +public: + enum {BH=MatrixH<4>::BH, + // Calculate number of integer bits required for all non-zero elements of S. + // (Assumes that some elements of C & H are zero and that all non-trivial elements of H have BH bits). + BS00=MAX2(BH+KFstateN::BC00, KFstateN::BC01) - BODGE<4>::S, // H00*C00 + H01*C10 + (H02*C20 + H03*C30 = zero). + BS01=MAX2(BH+KFstateN::BC01, KFstateN::BC11) - BODGE<4>::S, // H00*C01 + H01*C11 + (H02*C21 + H03*C31 = zero). + BS12=MAX2(BH+KFstateN::BC22, KFstateN::BC23) - BODGE<4>::S, // (H00*C02 + H01*C12 = zero) + H02*C22 + H03*C32. + BS13=MAX2(BH+KFstateN::BC23, KFstateN::BC33) - BODGE<4>::S // (H00*C03 + H01*C13 = zero) + H02*C23 + H03*C33. + }; + typedef ap_fixed TS00; + typedef ap_fixed TS01; + typedef ap_fixed TS12; + typedef ap_fixed TS13; + typedef ap_fixed T0; // Neglect correlation between r-phi & r-z planes for now. + +public: + + MatrixS(const MatrixH<4>& H, const MatrixC<4>& C); + +public: + + TS00 _00; + TS01 _01; + TS12 _12; + TS13 _13; + T0 _02, _03, + _10, _11 ; +}; + +// Covariance matrix of helix params. + +template <> +class MatrixC<4> { +public: + typedef ap_ufixed<1,1> T0; // HLS doesn't like zero bit variables. + + // Determine input helix coviaraiance matrix. + MatrixC(const KFstate<4>& stateIn) : + _00(stateIn.cov_00), _11(stateIn.cov_11), _22(stateIn.cov_22), _33(stateIn.cov_33), + _01(stateIn.cov_01), _23(stateIn.cov_23), + _02(0), _03(0), _12(0), _13(0), + _10(_01), _32(_23), _20(_02), _30(_03), _21(_12), _31(_13) + { + _00[0] = 1; + _11[0] = 1; + _22[0] = 1; + _33[0] = 1; + _01[0] = 1; + _23[0] = 1; + } + + // Calculate output helix covariance matrix: C' = C - K*H*C = C - K*S. + MatrixC(const MatrixC<4>& C, const MatrixK<4>& K, const MatrixS<4>& S); + +public: + // Elements that are finite + KFstateN::TC00EX _00; + KFstateN::TC11EX _11; + KFstateN::TC22EX _22; + KFstateN::TC33EX _33; + KFstateN::TC01EX _01; // (inv2R, phi0) -- other off-diagonal elements assumed negligeable. + KFstateN::TC23EX _23; // (tanL, z0) -- other off-diagonal elements assumed negligeable. + // Elements that are zero. + const T0 _02, _03, _12, _13; + // Elements below the diagonal of this symmetric matrix. + const KFstateN::TC01EX &_10; + const KFstateN::TC23EX &_32; + const T0 &_20, &_30, &_21, &_31; +}; + +// S(transpose) = C*H(transpose) + +template <> +class MatrixS_transpose<4> { +public: + typedef MatrixS<4>::TS00 TS00; + typedef MatrixS<4>::TS01 TS01; + typedef MatrixS<4>::TS12 TS12; + typedef MatrixS<4>::TS13 TS13; + typedef MatrixS<4>::T0 T0; + MatrixS_transpose(const MatrixS<4>& S) : _00(S._00), _10(S._01), _21(S._12), _31(S._13), + _01(S._10), _11(S._11), _20(S._02), _30(S._03) {} +public: + const TS00& _00; + const TS01& _10; + const TS12& _21; + const TS13& _31; + const T0& _01, + _11, + _20, + _30 ; +}; + +// Covariance matrix of predicted residuals R = V + H*C*Ht = V + H*St. + +template <> +class MatrixR<4> { +public: + enum {BH=MatrixH<4>::BH, + BS00=MatrixS<4>::BS00, + BS01=MatrixS<4>::BS01, + BS12=MatrixS<4>::BS12, + BS13=MatrixS<4>::BS13, + // Calculate number of integer bits required for elements of R. + BR00 = MAX2(MatrixV::BVPP, MAX2(BH+BS00, BS01)) - BODGE<4>::R, // H00*St00 + H01*St10 + (H02*St20 + H03*St30 = zero) + BR11 = MAX2(MatrixV::BVZZ, MAX2(BH+BS12, BS13)) - BODGE<4>::R, // (H10*St01 + H11*St11 = zero) + H12*St21 + H13*St31 + BR01 = 0 // (H00*St01 + H01*St11 + H02*St21 + H03*St31 = zero) + }; + typedef ap_ufixed TR00; + typedef ap_ufixed TR11; + typedef ap_ufixed TR01; + +public: + MatrixR(const MatrixV& V, const MatrixH<4>& H, const MatrixS_transpose<4>& St); + +public: + TR00 _00; + TR11 _11; + TR01 _01; + TR01& _10; // Matrix symmetric, so can use reference. +}; + +// Kalman gain matrix K = S(transpose)*R(inverse). + +template <> +class MatrixK<4> { +public: + enum {BS00=MatrixS<4>::BS00, + BS01=MatrixS<4>::BS01, + BS12=MatrixS<4>::BS12, + BS13=MatrixS<4>::BS13, + BIR00=MatrixInverseR<4>::BIR00, + BIR11=MatrixInverseR<4>::BIR11, + BIR01=MatrixInverseR<4>::BIR01, + BK00=(BS00+BIR00) - BODGE<4>::K, // St00*Rinv00 (+ St01*Rinv10 = zero) + BK10=(BS01+BIR00) - BODGE<4>::K, // St10*Rinv00 (+ St11*Rinv10 = zero) + BK21=(BS12+BIR11) - BODGE<4>::K, // (St20*Rinv01 = zero) + St21*Rinv11 + BK31=(BS13+BIR11) - BODGE<4>::K}; // (St30*Rinv01 = zero) + St31*Rinv11 + typedef ap_fixed TK00; + typedef ap_fixed TK10; + typedef ap_fixed TK21; + typedef ap_fixed TK31; + typedef ap_fixed T0; // Neglect correlation between r-phi & r-z + MatrixK(const MatrixS_transpose<4>& St, const MatrixInverseR<4>& RmatInv); +public: + // Additional types used to cast this matrix to a lower precision one for updated helix param calculation. + typedef ap_fixed TK00_short; + typedef ap_fixed TK10_short; + typedef ap_fixed TK21_short; + typedef ap_fixed TK31_short; +public: + TK00 _00; + TK10 _10; + TK21 _21; + TK31 _31; + T0 _01, + _11, + _20, + _30 ; +}; + + +// Hit residuals: res = m - H*x. + +template <> +class VectorRes<4> { +public: + // Use higher granularity for residuals than for stubs. + // BODGE<4>::RES should be slightly larger than BODGE_V as hits can be several sigma wrong. + // Add one extra fractional bit relative to stub, to avoid additional precision loss. + typedef ap_fixed::RES+1,KFstubN::BPHI -BODGE<4>::RES> TRP; + typedef ap_fixed::RES+1,KFstubN::BZ1 -BODGE<4>::RES> TRZ; + +public: + VectorRes(const VectorM& m, const MatrixH<4>& H, const VectorX<4>& x); + +public: + TRP _0; + TRZ _1; +}; + +// Vector of helix params. + +template <> +class VectorX<4> { +public: + // Determine input helix params. + VectorX(const KFstate<4>& stateIn) : _0(stateIn.inv2R), _1(stateIn.phi0), _2(stateIn.tanL), _3(stateIn.z0) {} + + // Calculate output helix params: x' = x + K*res + VectorX(const VectorX<4>& x, const MatrixK<4>& K, const VectorRes<4>& res); + +public: + KFstateN::TR _0; + KFstateN::TP _1; + KFstateN::TT _2; + KFstateN::TZ _3; +}; + +#ifdef CMSSW_GIT_HASH +} + +} +#endif + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices5.h b/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices5.h new file mode 100644 index 0000000000000..e78f270171a7d --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices5.h @@ -0,0 +1,313 @@ +/** + * This defines the KF matrices and the operations performance on them. + * + * All variable names & equations come from Fruhwirth KF paper + * http://dx.doi.org/10.1016/0168-9002%2887%2990887-4 + * + * Author: Ian Tomalin + */ + +#ifndef __KalmanMatrices5__ +#define __KalmanMatrices5__ + +// Defines StateHLS & KFstate. Also defines finite bit integers & floats. +#ifdef CMSSW_GIT_HASH +#include "L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstate.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFconstants.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices4.h" +#else +#include "HLSutilities.h" +#include "KFstub.h" +#include "KFstate.h" +#include "KFconstants.h" +#include "KalmanMatrices.h" +#include "KalmanMatrices5.h" +#endif + +#ifdef CMSSW_GIT_HASH +namespace TMTT { + +namespace KalmanHLS { +#endif + +// Utility for -1/r from ROM used by MatrixH<5>. + +class MinusOneOverR { +public: + enum {BRED = 4}; // To save ROM resources, reduce granularity in r by this number of bits. + enum {MAXN = 1 << (KFstubN::BR - BRED)}; // pow(2,BR) // Max. value of [r / pow(2,BRED)]. + enum {BIR = -8}; // Chosen using CheckCalc output. + typedef ap_fixed<1+KFstubN::BR,BIR> TIR; +public: + + MinusOneOverR() { + for (unsigned int n = 2; n < MAXN; n++) { // Don't bother initializing first two, as would overflow bit range. + get[n] = -1./(float((n << BRED)) + 0.5*(1 << BRED)); // Round to nearest half integer + } + } +public: + TIR get[MAXN]; +}; + + +// Calculate matrix of derivatives of predicted stub coords w.r.t. helix params. + +template <> +class MatrixH<5> { +public: + enum {BH=1+KFstubN::BR}; + enum {BHD=MinusOneOverR::BIR}; + typedef ap_fixed TH; // One extra bit, since "-r" can be -ve. + typedef ap_fixed THD; // For d0 elements (which have size -1/r) + typedef ap_ufixed<1,1> T1; + MatrixH(const KFstubN::TR& r) : _00(-r), _12(r), _04(this->setH04(r)), + _01(1), _02(0), _03(0), + _10(0), _11(0), _13(1), _14(0) { +#ifdef PRINT_SUMMARY + CHECK_AP::checkCalc("H04", _04, -1./double(r), 0.03); +#endif + } + + // Set element _04 to -1/r. + static THD setH04(const KFstubN::TR& r); + +public: + TH _00, _12; + THD _04; + const T1 _01, _02, _03, + _10, _11, _13, _14; +}; + +// S = H * C + +template <> +class MatrixS<5> { +public: + enum {BH=MatrixH<5>::BH, BHD=MatrixH<5>::BHD, + // Calculate number of integer bits required for all non-zero elements of S. + // (Assumes that some elements of C & H are zero and that all non-trivial elements of H have BH or BHD bits). + BS00=MAX3(BH+KFstateN::BC00, KFstateN::BC01, BHD+KFstateN::BC04) - BODGE<5>::S, // H00*C00 + H01*C10 + (H02*C20 + H03*C30 = zero) + H04*C40. + BS01=MAX3(BH+KFstateN::BC01, KFstateN::BC11, BHD+KFstateN::BC14) - BODGE<5>::S, // H00*C01 + H01*C11 + (H02*C21 + H03*C31 = zero) + H04*C41. + BS12=MAX2(BH+KFstateN::BC22, KFstateN::BC23) - BODGE<5>::S, // (H10*C02 + H11*C12 = zero) + H12*C22 + H13*C32 + (H14*C42 = zero). + BS13=MAX2(BH+KFstateN::BC23, KFstateN::BC33) - BODGE<5>::S, // (H10*C03 + H11*C13 = zero) + H12*C23 + H13*C33 + (H14*C43 = zero); + BS04=MAX3(BH+KFstateN::BC04, KFstateN::BC14, BHD+KFstateN::BC44) - BODGE<5>::S // H00*C04 + H01*C14 + (H02*C24 + H03*C34 = zero) + H04*C44. + }; + typedef ap_fixed TS00; + typedef ap_fixed TS01; + typedef ap_fixed TS12; + typedef ap_fixed TS13; + typedef ap_fixed TS04; + typedef ap_fixed T0; // Neglect correlation between r-phi & r-z planes for now. + +public: + + MatrixS(const MatrixH<5>& H, const MatrixC<5>& C); + +public: + + TS00 _00; + TS01 _01; + TS12 _12; + TS13 _13; + TS04 _04; + T0 _02, _03, + _10, _11, _14; +}; + +// Covariance matrix of helix params. + +template <> +class MatrixC<5> { +public: + typedef ap_ufixed<1,1> T0; // HLS doesn't like zero bit variables. + + // Determine input helix coviaraiance matrix. + MatrixC(const KFstate<5>& stateIn) : + _00(stateIn.cov_00), _11(stateIn.cov_11), _22(stateIn.cov_22), _33(stateIn.cov_33), _44(stateIn.cov_44), + _01(stateIn.cov_01), _23(stateIn.cov_23), _04(stateIn.cov_04), _14(stateIn.cov_14), + _02(0), _03(0), _12(0), _13(0), _42(0), _43(0), + _10(_01), _32(_23), _40(_04), _41(_14), _20(_02), _30(_03), _21(_12), _31(_13), _24(_42), _34(_43) { + _00[0] = 1; + _11[0] = 1; + _22[0] = 1; + _33[0] = 1; + _44[0] = 1; + _01[0] = 1; + _23[0] = 1; + _04[0] = 1; + _14[0] = 1; +} + + // Calculate output helix covariance matrix: C' = C - K*H*C = C - K*S. + MatrixC(const MatrixC<5>& C, const MatrixK<5>& K, const MatrixS<5>& S); + +public: + // Elements that are finite + KFstateN::TC00EX _00; + KFstateN::TC11EX _11; + KFstateN::TC22EX _22; + KFstateN::TC33EX _33; + KFstateN::TC44EX _44; + KFstateN::TC01EX _01; // (inv2R, phi0) -- other off-diagonal elements assumed negligeable. + KFstateN::TC23EX _23; // (tanL, z0) -- other off-diagonal elements assumed negligeable. + KFstateN::TC04EX _04; // (inv2R, d0) -- other off-diagonal elements assumed negligeable. + KFstateN::TC14EX _14; // (phi0, d0) -- other off-diagonal elements assumed negligeable. + // Elements that are zero. + const T0 _02, _03, _12, _13, _42, _43; + // Elements below the diagonal of this symmetric matrix. + const KFstateN::TC01EX &_10; + const KFstateN::TC23EX &_32; + const KFstateN::TC04EX &_40; + const KFstateN::TC14EX &_41; + const T0 &_20, &_30, &_21, &_31, &_24, &_34; +}; + +// S(transpose) = C*H(transpose) + +template <> +class MatrixS_transpose<5> { +public: + typedef MatrixS<5>::TS00 TS00; + typedef MatrixS<5>::TS01 TS01; + typedef MatrixS<5>::TS12 TS12; + typedef MatrixS<5>::TS13 TS13; + typedef MatrixS<5>::TS04 TS04; + typedef MatrixS<5>::T0 T0; + MatrixS_transpose(const MatrixS<5>& S) : _00(S._00), _10(S._01), _21(S._12), _31(S._13), _40(S._04), + _01(S._10), _11(S._11), _20(S._02), _30(S._03), _41(S._14) {} +public: + const TS00& _00; + const TS01& _10; + const TS12& _21; + const TS13& _31; + const TS04& _40; + const T0& _01, + _11, + _20, + _30, + _41; +}; + +// Covariance matrix of predicted residuals R = V + H*C*Ht = V + H*St. + +template <> +class MatrixR<5> { +public: + enum {BH=MatrixH<5>::BH, BHD=MatrixH<5>::BHD, + BS00=MatrixS<5>::BS00, + BS01=MatrixS<5>::BS01, + BS12=MatrixS<5>::BS12, + BS13=MatrixS<5>::BS13, + BS04=MatrixS<5>::BS04, + // Calculate number of integer bits required for elements of R. + BR00 = MAX2(MatrixV::BVPP, MAX3(BH+BS00, BS01, BHD+BS04)) - BODGE<5>::R, // H00*St00 + H01*St10 + (H02*St20 + H03*St30 = zero) + H04*St40 + BR11 = MAX2(MatrixV::BVZZ, MAX2(BH+BS12, BS13)) - BODGE<5>::R, // (H10*St01 + H11*St11 = zero) + H12*St21 + H13*St31 + (H14*St41 = zero) + BR01 = 0 // (H00*St01 + H01*St11 + H02*St21 + H03*St31 + H04*St41 = zero) + }; + typedef ap_ufixed TR00; + typedef ap_ufixed TR11; + typedef ap_ufixed TR01; + +public: + MatrixR(const MatrixV& V, const MatrixH<5>& H, const MatrixS_transpose<5>& St); + +public: + TR00 _00; + TR11 _11; + TR01 _01; + TR01& _10; // Matrix symmetric, so can use reference. +}; + +// Kalman gain matrix K = S(transpose)*R(inverse). + +template <> +class MatrixK<5> { +public: + enum {BS00=MatrixS<5>::BS00, + BS01=MatrixS<5>::BS01, + BS12=MatrixS<5>::BS12, + BS13=MatrixS<5>::BS13, + BS04=MatrixS<5>::BS04, + BIR00=MatrixInverseR<5>::BIR00, + BIR11=MatrixInverseR<5>::BIR11, + BIR01=MatrixInverseR<5>::BIR01, + BK00=(BS00+BIR00) - BODGE<5>::K, // St00*Rinv00 (+ St01*Rinv10 = zero) + BK10=(BS01+BIR00) - BODGE<5>::K, // St10*Rinv00 (+ St11*Rinv10 = zero) + BK21=(BS12+BIR11) - BODGE<5>::K, // (St20*Rinv01 = zero) + St21*Rinv11 + BK31=(BS13+BIR11) - BODGE<5>::K, // (St30*Rinv01 = zero) + St31*Rinv11 + BK40=(BS04+BIR00) - BODGE<5>::K}; // St40*Rinv00 (+ St41*Rinv10 = zero) + typedef ap_fixed TK00; + typedef ap_fixed TK10; + typedef ap_fixed TK21; + typedef ap_fixed TK31; + typedef ap_fixed TK40; + typedef ap_fixed T0; // Neglect correlation between r-phi & r-z + MatrixK(const MatrixS_transpose<5>& St, const MatrixInverseR<5>& RmatInv); +public: + // Additional types used to cast this matrix to a lower precision one for updated helix param calculation. + typedef ap_fixed TK00_short; + typedef ap_fixed TK10_short; + typedef ap_fixed TK21_short; + typedef ap_fixed TK31_short; + typedef ap_fixed TK40_short; +public: + TK00 _00; + TK10 _10; + TK21 _21; + TK31 _31; + TK40 _40; + T0 _01, + _11, + _20, + _30, + _41; +}; + +// Hit residuals: res = m - H*x. + +template <> +class VectorRes<5> { +public: + // Use higher granularity for residuals than for stubs. + // BODGE<5>::RES should be slightly larger than BODGE_V as hits can be several sigma wrong. + // Add one extra fractional bit relative to stub, to avoid additional precision loss. + typedef ap_fixed::RES+1,KFstubN::BPHI -BODGE<5>::RES> TRP; + typedef ap_fixed::RES+1,KFstubN::BZ1 -BODGE<5>::RES> TRZ; + +public: + VectorRes(const VectorM& m, const MatrixH<5>& H, const VectorX<5>& x); + +public: + TRP _0; + TRZ _1; +}; + +// Vector of helix params. + +template <> +class VectorX<5> { +public: + // Determine input helix params. + VectorX(const KFstate<5>& stateIn) : _0(stateIn.inv2R), _1(stateIn.phi0), _2(stateIn.tanL), _3(stateIn.z0), _4(stateIn.d0) {} + + // Calculate output helix params: x' = x + K*res + VectorX(const VectorX<5>& x, const MatrixK<5>& K, const VectorRes<5>& res); + +public: + KFstateN::TR _0; + KFstateN::TP _1; + KFstateN::TT _2; + KFstateN::TZ _3; + KFstateN::TD _4; +}; + +#ifdef CMSSW_GIT_HASH +} + +} +#endif + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate.h b/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate.h new file mode 100644 index 0000000000000..27a051c57f4f8 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate.h @@ -0,0 +1,63 @@ +/** + * This is the top-level HLS function within CMSSW, which updates a helix state by adding a stub to it. + * N.B. It therefore can't use the Settings class or any external libraries! Nor can it be a C++ class. + * + * All variable names & equations come from Fruhwirth KF paper + * http://dx.doi.org/10.1016/0168-9002%2887%2990887-4 + * + * Author: Ian Tomalin + */ + + +#ifndef __KalmanUpdate__ +#define __KalmanUpdate__ + +#ifdef CMSSW_GIT_HASH +#include "L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstate.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices4.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices5.h" +#else +#include "HLSutilities.h" +#include "KFstub.h" +#include "KFstate.h" +#include "KalmanMatrices.h" +#include "KalmanMatrices4.h" +#include "KalmanMatrices5.h" +#endif + +#ifdef CMSSW_GIT_HASH +namespace TMTT { + +namespace KalmanHLS { +#endif + +// Internal interface. +// Add stub to old KF helix state to get new KF helix state for NPAR = 4 or 5 param helix fits. +template +void kalmanUpdate(const KFstubC& stub, const KFstate& stateIn, KFstate& stateOut, KFselect& selectOut); + +// Calculate increase in chi2 (in r-phi & r-z) from adding new stub: delta(chi2) = res(transpose) * R(inverse) * res +template +void calcDeltaChi2(const VectorRes& res, const MatrixInverseR& Rinv, TCHI_INT& dChi2_phi, TCHI_INT& dChi2_z); + +// Set output helix params & associated cov matrix related to d0, & check if d0 passes cut. +// (Relevant only to 5-param helix fit) +template +void setOutputsD0(const VectorX& x_new, const MatrixC& C_new, const ap_uint<3>& nStubs, KFstate& stateOut, KFselect& selectOut); + +// Fully specialized function templates must also be declared to ensure they are found. + +#ifdef CMSSW_GIT_HASH +} + +} +#endif + +#endif + + + + diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate_top.h b/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate_top.h new file mode 100644 index 0000000000000..fd727cb883e32 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate_top.h @@ -0,0 +1,37 @@ +#ifndef __KalmanUpdate_top__ +#define __KalmanUpdate_top__ + +/** + * This is the top-level function for Vivado HLS compilation. + * It is not used by CMSSW. + * + * It is required because HLS does not allow the top-level function to be templated. + * + * Author: Ian Tomalin + */ + +#ifdef CMSSW_GIT_HASH +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstate.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate.h" +#else +#include "KFstub.h" +#include "KFstate.h" +#include "KalmanUpdate.h" +#endif + +#ifdef CMSSW_GIT_HASH +namespace TMTT { + +namespace KalmanHLS { +#endif + +void kalmanUpdate_top(const KFstubC& stub, const KFstate& stateIn, KFstate& stateOut, KFselect& selectOut); + +#ifdef CMSSW_GIT_HASH +} + +} +#endif + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/HTbase.h b/L1Trigger/TrackFindingTMTT/interface/HTbase.h new file mode 100644 index 0000000000000..cd560280b6867 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/HTbase.h @@ -0,0 +1,158 @@ +#ifndef __HTbase_H__ +#define __HTbase_H__ + +#include "L1Trigger/TrackFindingTMTT/interface/HTcell.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track2D.h" +#include "L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h" + +#include "boost/numeric/ublas/matrix.hpp" +#include +#include + +using boost::numeric::ublas::matrix; + +using namespace std; + + +//=== Base class for Hough Transform array for a single (eta,phi) sector. + +namespace TMTT { + +class Settings; +class Stub; +class TP; +class L1fittedTrack; + +class HTbase { + +public: + + HTbase() {} + virtual ~HTbase(){} + + // Initialization. + virtual void init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, + float etaMinSector, float etaMaxSector, float) = 0; + + void init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg) {settings_ = settings; iPhiSec_ = iPhiSec; iEtaReg_ = iEtaReg; optoLinkID_ = this->calcOptoLinkID();} + + // Add stub to HT array. + // N.B. The argument lists for this are different for r-phi & r-z HT, so unfortunately it can't be declared in base class. + //virtual void store(const Stub*) = 0; + + // Termination. Causes HT array to search for tracks etc. + virtual void end(); + + //=== Get info about filtered stubs in HT array. + //=== (N.B. The `filtered stubs' are stubs passing any requested stub filters, e.g. bend and/or rapidity. + //=== If no filters were requested, they are identical to the unfiltered stubs.) + + // Get sum of number of filtered stubs stored in each cell of HT array (so a stub appearing in multiple cells is counted multiple times). + virtual unsigned int numStubsInc() const; + + // Get sum the number of filtered stubs in the HT array, where each individual stub is counted only once, even if it appears in multiple cells. + virtual unsigned int numStubsExc() const; + + // Get all the cells that make up the array, which in turn give access to the stubs inside them. + // N.B. You can use getAllCells().size1() and getAllCells().size2() to get the dimensions ofthe array. + virtual const matrix& getAllCells() const {return htArray_;} + + //=== Info about track candidates found. + + // N.B. If a duplicate track filter was run inside the HT, this will contain the reduced list of tracks passing this filter. + // N.B. If some tracks could not be read out during the TM period, then such tracks are deleted from this list. + + // Get list of all track candidates found in this HT array, giving access to stubs on each track + // and helix parameters. + virtual const vector& trackCands2D() const {return trackCands2D_;} + + // Number of track candidates found in this HT array. + // If a duplicate track filter was run, this will contain the reduced list of tracks passing this filter. + virtual unsigned int numTrackCands2D() const {return trackCands2D_.size();} + + // Get number of filtered stubs assigned to track candidates found in this HT array. + virtual unsigned int numStubsOnTrackCands2D() const; + + // Get all reconstructed tracks that were associated to the given tracking particle. + // (If the vector is empty, then the tracking particle was not reconstructed in this sector). + virtual vector assocTrackCands2D(const TP& tp) const; + + //=== Function to replace the collection of 2D tracks found by this HT. + + // (This is used by classes MuxHToutputs & MiniHTstage). + virtual void replaceTrackCands2D(const vector& newTracks); + virtual void replaceTrackCands2D(const vector& newTracks) {trackCands2D_ = newTracks;} + + //=== Utilities + + // Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). + // The helix parameters returned will be those corresponding to the two axes of the HT array. + // So they might be (q/pt, phi65), (eta, z0) or (z110, z0) etc. depending on the configuration. + virtual pair helix2Dhough (unsigned int i, unsigned int j) const = 0; + + // Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). + // The helix parameters returned will be always be (q/Pt, phi0) or (tan_lambda, z0), irrespective of + // how the axes of the HT array are defined. + virtual pair helix2Dconventional(unsigned int i, unsigned int j) const = 0; + + // Which cell in HT array should this TP be in, based on its true trajectory? + // Returns 999999 in at least one index if TP not expected to be in any cell in this array. + virtual pair trueCell( const TP* tp ) const = 0; + + // Which cell in HT array should this fitted track be in, based on its fitted trajectory? + // Returns 999999 in at least one index if fitted track not expected to be in any cell in this array. + virtual pair getCell( const L1fittedTrack* fitTrk) const = 0; + + // Disable filters (used for debugging). + virtual void disableBendFilter(); + +protected: + + // Given a range in one of the coordinates specified by coordRange, calculate the corresponding range of bins. The other arguments specify the axis. And also if some cells nominally associated to stub are to be killed. + virtual pair convertCoordRangeToBinRange( pair coordRange, unsigned int nBinsAxis, float coordAxisMin, float coordAxisBinSize, unsigned int killSomeHTcells, bool debug = false) const; + +private: + + // Return a list of all track candidates found in this array, giving access to all the stubs on each one + // and the track helix parameters, plus the associated truth particle (if any). + virtual vector calcTrackCands2D() const; + + // If requested, kill those tracks in this sector that can't be read out during the time-multiplexed period, because + // the HT has associated too many stubs to tracks. + virtual vector killTracksBusySec(const vector& tracks) const = 0; + + // Define the order in which the hardware processes rows of the HT array when it outputs track candidates. + virtual vector rowOrder(unsigned int numRows) const = 0; + + // Calculate output opto-link ID from HT, assuming there is no MUX stage. + virtual unsigned int calcOptoLinkID() const { + unsigned int numPhiSecPerNon = settings_->numPhiSectors() / settings_->numPhiNonants(); + return (iEtaReg_ * numPhiSecPerNon + iPhiSec_); + } + +protected: + + const Settings* settings_; // configuration parameters. + + unsigned int iPhiSec_; // Sector number. + unsigned int iEtaReg_; + + unsigned int optoLinkID_; // ID of opto-link from HT to Track Fitter. + + // Hough transform array. + // This has two dimensions, representing the two track helix parameters being varied. + matrix htArray_; + + // Contains algorithm used for duplicate track removal. + KillDupTrks killDupTrks_; + + // List of all track candidates found by HT & their associated properties. + // If a duplicate track filter was run inside the HT, this will contain the reduced list of tracks passing this filter. + // If some tracks could not be read out during the TM period, then such tracks are deleted from this list. + vector trackCands2D_; +}; + +} + +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/HTcell.h b/L1Trigger/TrackFindingTMTT/interface/HTcell.h new file mode 100644 index 0000000000000..11498f162dd2a --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/HTcell.h @@ -0,0 +1,148 @@ +#ifndef __HTCELL_H__ +#define __HTCELL_H__ + +#include "L1Trigger/TrackFindingTMTT/interface/Utility.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "FWCore/Utilities/interface/Exception.h" + +#include +#include +#include +#include + +using namespace std; + + +//=== A single cell in a Hough Transform array. + +namespace TMTT { + +class Settings; +class Stub; + +class HTcell { + +public: + + HTcell() {} + ~HTcell() {} + + // Initialization with cfg params, + // sector number, rapidity range of current sector, estimated q/Pt of cell, + // and the bin number of the cell along the q/Pt axis of the r-phi HT array, + // and a flag indicating if this cell is the merge of smaller HT cells. + void init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, + float etaMinSector, float etaMaxSector, float qOverPt, unsigned int ibin_qOverPt, + bool mergedCell, bool miniHTcell=false); + + // Add stub to this cell in HT array. + void store (const Stub* stub) { vStubs_.push_back(stub); } + + // Add stub to this cell in HT array, indicating also which subsectors within the sector is consistent with. + void store (const Stub* stub, const vector& inSubSecs) { this->store(stub); subSectors_[stub] = inSubSecs; if (inSubSecs.size() != numSubSecs_) throw cms::Exception("HTcell: Wrong number of subsectors!");} + + // Termination. Search for track in this HT cell etc. + void end(); + + //=== Cfg of cell + + // Does this HTcell correspond to merged HT cells (e.g. 2x2)? + bool mergedCell() const {return mergedCell_;} + + //=== Get results + //=== Most of these functions operate on the filtered stubs, which are stubs passing any requested stub filters (e.g. bend filter). + //=== If no filters were requested, they are identical to the unfiltered stubs.) + + // Get filtered stubs in this cell in HT array. + const vector& stubs() const { return vFilteredStubs_; } + + // Check if a specific stub is in this cell and survived filtering. + bool stubInCell( const Stub* stub ) const { return (std::count(vFilteredStubs_.begin(), vFilteredStubs_.end(), stub ) > 0); } + + // Check if a specific stub was stored to this cell (without checking if it survived filtering). + bool stubStoredInCell( const Stub* stub ) const { return (std::count(vStubs_.begin(), vStubs_.end(), stub ) > 0); } + + // Return info useful for deciding if there is a track candidate in this cell. + unsigned int numStubs() const { return vFilteredStubs_.size(); } // Number of filtered stubs + unsigned int numLayers() const { return numFilteredLayersInCell_; } // Number of tracker layers with filtered stubs + unsigned int numLayersSubSec() const { return numFilteredLayersInCellBestSubSec_; } // Number of tracker layers with filtered stubs, requiring all stubs to be in same subsector to be counted. The number returned is the highest layer count found in any of the subsectors in this sector. If subsectors are not used, it is equal to numLayers(). + + // Useful for debugging. + unsigned int numUnfilteredStubs() const { return vStubs_.size(); } // Number of unfiltered stubs + + //=== Check if stubs in this cell form valid track candidate. + + // N.B. If subsectors within a sector are not being used, then numFilteredLayersInCellBestSubSec_ = numFilteredLayersInCell_. + // WARNING: If some tracks are killed as the r-phi HT array can't read them out within the TM period, + // killed tracks are still found by this function. It is in HTbase::calcTrackCands2D() that they are killed. + bool trackCandFound() const {return (numFilteredLayersInCellBestSubSec_ >= Utility::numLayerCut("HT", settings_, iPhiSec_, iEtaReg_, fabs(qOverPtCell_)));} + + //=== Disable filters (used for debugging). + + void disableBendFilter() {useBendFilter_ = false;} + +private: + + // Calculate how many tracker layers the filtered stubs in this cell are in + unsigned int calcNumFilteredLayers() const { return Utility::countLayers( settings_, vFilteredStubs_ ); } + + // Calculate how many tracker layers the filter stubs in this cell are in, when only the subset of those stubs + // that are in the specified subsector are counted. + unsigned int calcNumFilteredLayers(unsigned int iSubSec) const; + + // Estimate track bend angle at a given radius, derived using the track q/Pt at the centre of this HT cell, ignoring scattering. + float dphi(float rad) const { return (invPtToDphi_ * rad * qOverPtCell_); } + + // Produce a filtered collection of stubs in this cell that all have consistent bend + vector bendFilter( const vector& stubs ) const; + + // Filter stubs so as to prevent more than specified number of stubs being stored in one cell. + // This reflects finite memory of hardware. + vector maxStubCountFilter( const vector& stubs ) const; + +private: + + //=== Configuration parameters + + const Settings* settings_; + + unsigned int iPhiSec_; // Sector number + unsigned int iEtaReg_; + + float etaMinSector_; // rapidity range of this sector. + float etaMaxSector_; + + float qOverPtCell_; // track q/Pt corresponding to centre of this cell. + + // Note bin number of cell along q/Pt axis of r-phi HT array. (Not used for r-z HT). + unsigned int ibin_qOverPt_; + // Is this HT cell the merge of smaller HT cells? + bool mergedCell_; + + // Is this cell in Mini-HT? + bool miniHTcell_; + + float invPtToDphi_; // B*c/2E11 + + // Use filter in each HT cell using only stubs which have consistent bend? + bool useBendFilter_; + // A filter is used each HT cell, which prevents more than the specified number of stubs being stored in the cell. (Reflecting memory limit of hardware). + unsigned int maxStubsInCell_; + + // Number of subsectors (if any) within each sector. + unsigned int numSubSecs_; + + //=== data + + vector vStubs_; // Stubs in this cell + vector vFilteredStubs_; // Stubs in cell selected by applying all requested stub filters (e.g. bend and/or eta filter ...) + + unsigned int numFilteredLayersInCell_; // How many tracker layers these filtered stubs are in + unsigned int numFilteredLayersInCellBestSubSec_; // Ditto, but requiring all stubs to be in same subsector to be counted. This number is the highest layer count found in any of the subsectors in this sector. + + map> subSectors_; // Indicate which subsectors within the sector this stub is consistent with. +}; + +} +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/HTrphi.h b/L1Trigger/TrackFindingTMTT/interface/HTrphi.h new file mode 100644 index 0000000000000..c875056d63876 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/HTrphi.h @@ -0,0 +1,166 @@ +#ifndef __HTrphi_H__ +#define __HTrphi_H__ + +#include "L1Trigger/TrackFindingTMTT/interface/HTbase.h" + +#include +#include + +using namespace std; + +//=== The r-phi Hough Transform array for a single (eta,phi) sector. +//=== +//=== Its axes are (q/Pt, phiTrk), where phiTrk is the phi at which the track crosses a +//=== user-configurable radius from the beam-line. + +namespace TMTT { + +class Settings; +class Stub; +class TP; +class L1fittedTrack; + +class HTrphi : public HTbase { + +public: + + HTrphi() : HTbase() {} + ~HTrphi(){} + + // Initialization with sector number, eta range covered by sector and phi coordinate of its centre. + void init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, + float etaMinSector, float etaMaxSector, float phiCentreSector); + + // Add stub to HT array. + // If eta subsectors are being used within each sector, specify which ones the stub is compatible with. + void store( const Stub* stub, const vector& inEtaSubSecs); + + // Termination. Causes HT array to search for tracks etc. + // ... function end() is in base class ... + + //=== Info about track candidates found. + + // ... is available via base class ... + + //=== Utilities + + // Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). + // The helix parameters returned will be those corresponding to the two axes of the HT array. + // So they might be (q/pt, phi0) or (q/pt, phi65) etc. depending on the configuration. + pair helix2Dhough (unsigned int i, unsigned int j) const; + + // Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). + // The helix parameters returned will be always be (q/pt, phi0), irrespective of how the axes + // of the HT array are defined. + pair helix2Dconventional(unsigned int i, unsigned int j) const; + + // Which cell in HT array should this TP be in, based on its true trajectory? + // (If TP is outside HT array, it it put in the closest bin inside it). + pair trueCell( const TP* tp ) const; + + // Which cell in HT array should this fitted track be in, based on its fitted trajectory? + // Always uses beam-spot constrained trajectory if available. + // (If fitted track is outside HT array, it it put in the closest bin inside it). + pair getCell( const L1fittedTrack* fitTrk) const; + + // Check if specified cell has been merged with its 2x2 neighbours into a single cell, + // as it is in low Pt region. + bool mergedCell(unsigned int iQoverPtBin, unsigned int jPhiTrkBin) const; + + //--- Functions to check that stub filling is compatible with limitations of firmware. + + // Calculate maximum |gradient| that any stub's line across any of the r-phi HT arrays could have, to check it is < 1. + static float maxLineGrad() {return maxLineGradient_;} + // Summed over all r-phi HT arrays, returns fraction of stubs added to an HT column which do not lie NE, E or SE of stub added to previous HT column. + static float fracErrorsTypeA() {return numErrorsTypeA_/float(numErrorsNormalisation_);} + // Summed over all r-phi HT arrays, returns fraction of stubs added to more than 2 cells in one HT column. (Only a problem for Thomas' firmware). + static float fracErrorsTypeB() {return numErrorsTypeB_/float(numErrorsNormalisation_);} + + // Number of stubs received from GP, irrespective of whether the stub was actually stored in + // a cell in the HT array. + unsigned int nReceivedStubs() const {return nReceivedStubs_;} + + // Determine which m-bin (q/pt) range the specified track is in. (Used if outputting each m bin range on a different opto-link). + unsigned int getMbinRange(const L1track2D& trk) const; + +private: + + // For a given Q/Pt bin, find the range of phi bins that a given stub is consistent with. + pair iPhiRange( const Stub* stub, unsigned int iQoverPtBin, bool debug = false) const; + + // Check that limitations of firmware would not prevent stub being stored correctly in this HT column. + void countFirmwareErrors(unsigned int iQoverPtBin, unsigned int iPhiTrkBinMin, unsigned int iPhiTrkBinMax); + + // Calculate maximum |gradient| that any stub's line across this HT array could have, so can check it doesn't exceed 1. + float calcMaxLineGradArray() const; + + // If requested, kill those tracks in this sector that can't be read out during the time-multiplexed period, because + // the HT has associated too many stubs to tracks. + vector killTracksBusySec(const vector& tracks) const; + + // Define the order in which the hardware processes rows of the HT array when it outputs track candidates. + // Currently corresponds to highest Pt tracks first. + // If two tracks have the same Pt, the -ve charge one is output before the +ve charge one. + vector rowOrder(unsigned int numRows) const; + +private: + + float invPtToDphi_; // conversion constant. + unsigned int shape_; + std::vector< std::vector< std::pair< float, float > > > cellCenters_; + + //--- Specifications of HT array. + + float maxAbsQoverPtAxis_; // Max. |q/Pt| covered by HT array. + unsigned int nBinsQoverPtAxis_; // Number of bins in HT array in q/Pt. + float binSizeQoverPtAxis_; // HT array bin size in q/Pt. + + float chosenRofPhi_; // Use phi of track at radius="chosenRofPhi" to define one of the r-phi HT axes. + float phiCentreSector_; // phiTrk angle of centre of this (eta,phi) sector. + float maxAbsPhiTrkAxis_; // Half-width of phiTrk axis in HT array. + unsigned int nBinsPhiTrkAxis_; // Number of bins in HT array in phiTrk axis. + float binSizePhiTrkAxis_; // HT array bin size in phiTrk + + bool enableMerge2x2_; // Optionally merge 2x2 neighbouring cells into a single cell at low Pt, to reduce efficiency loss due to scattering. (Used also by mini-HT). + float minInvPtToMerge2x2_; + + //--- Options when filling HT array. + + unsigned int killSomeHTCellsRphi_; // Take all cells in HT array crossed by line corresponding to each stub (= 0) or take only some to reduce rate at cost of efficiency ( > 0) + bool handleStripsRphiHT_; // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when fill stubs in r-phi HT? + // Options for killing stubs/tracks that cant be sent within time-multiplexed period. + bool busyInputSectorKill_; + unsigned int busyInputSectorNumStubs_; + bool busySectorKill_; + unsigned int busySectorNumStubs_; + vector busySectorMbinRanges_; + bool busySectorUseMbinRanges_; + vector busySectorMbinOrder_; + bool busySectorUseMbinOrder_; + vector busySectorMbinLow_; + vector busySectorMbinHigh_; + + //--- Checks that stub filling is compatible with limitations of firmware. + + // Maximum |gradient| of line corresponding to any stub. Should be less than the value of 1.0 assumed by the firmware. + static float maxLineGradient_; + // Error count when stub added to cell which does not lie NE, E or SE of stub added to previous HT column. + static unsigned int numErrorsTypeA_; + // Error count when stub added to more than 2 cells in one HT column (problem only for Thomas' firmware). + static unsigned int numErrorsTypeB_; + // Error count normalisation + static unsigned int numErrorsNormalisation_; + + // Number of stubs received from GP, irrespective of whether the stub was actually stored in + // a cell in the HT array. + unsigned int nReceivedStubs_; + + // ... The Hough transform array data is in the base class ... + + // ... The list of found track candidates is in the base class ... +}; + +} + +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/Histos.h b/L1Trigger/TrackFindingTMTT/interface/Histos.h new file mode 100644 index 0000000000000..78b0b9706cfa3 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/Histos.h @@ -0,0 +1,657 @@ +#ifndef __HISTOS_H__ +#define __HISTOS_H__ + +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "CommonTools/UtilAlgos/interface/TFileService.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" +#include "L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h" + +#include "boost/numeric/ublas/matrix.hpp" +using boost::numeric::ublas::matrix; + +#include +#include +#include + +using namespace std; + +class TH1F; +class TH2F; +class TH2Poly; +class TF1; +class TProfile; +class TGraphAsymmErrors; +class TGraph; +class TEfficiency; + + +namespace TMTT { + +class InputData; +class TP; +class Sector; +class HTrphi; +class Get3Dtracks; +class L1fittedTrack; +class L1fittedTrk4and5; + +class Histos { + +public: + // Store cfg parameters. + Histos(const Settings* settings); + + virtual ~Histos(){} + + // Book & fill all histograms. + virtual void book(); + virtual void fill(const InputData& inputData, const matrix& mSectors, const matrix& mHtPhis, + const matrix mGet3Dtrks, const std::map>& fittedTracks); + + // Print tracking performance summary & make tracking efficiency histograms. + virtual void endJobAnalysis(); + + // Determine "B" parameter, used in GP firmware to allow for tilted modules. + virtual void trackerGeometryAnalysis( const TrackerGeometryInfo trackerGeometryInfo ); + + // Did user request output histograms via the TFileService in their cfg? + virtual bool available() const {return fs_.isAvailable();} + + // Should histograms be produced? + virtual bool enabled() const {return ( settings_->enableHistos() && available() );} + +protected: + + // Book histograms for specific topics. + virtual TFileDirectory bookInputData(); + virtual TFileDirectory bookEtaPhiSectors(); + virtual TFileDirectory bookRphiHT(); + virtual TFileDirectory bookRZfilters(); + virtual TFileDirectory bookStudyBusyEvents(); + virtual TFileDirectory bookTrackCands(string tName); + virtual map bookTrackFitting(); + + // Fill histograms for specific topics. + virtual void fillInputData(const InputData& inputData); + virtual void fillEtaPhiSectors(const InputData& inputData, const matrix& mSectors); + virtual void fillRphiHT(const matrix& mHtRphis); + virtual void fillRZfilters(const matrix& mGet3Dtrks); + virtual void fillStudyBusyEvents(const InputData& inputData, const matrix& mSectors, const matrix& mHtRphis, + const matrix& mGet3Dtrks); + virtual void fillTrackCands(const InputData& inputData, const vector& tracks, string tName); + virtual void fillTrackFitting(const InputData& inputData, const std::map>& fittedTracks); + + // Produce plots of tracking efficiency after HZ or after r-z track filter (run at end of job) + virtual TFileDirectory plotTrackEfficiency(string tName); + // Produce plots of tracking efficiency after track fit (run at end of job). + virtual TFileDirectory plotTrackEffAfterFit(string fitName); + + // For Hybrid tracking + // Produce plots of tracklet seed finding efficiency before track reco + virtual void plotTrackletSeedEfficiency() {}; + // Produce plots of hybrid duplicate removal efficiency after track reco + virtual void plotHybridDupRemovalEfficiency() {}; + + virtual void makeEfficiencyPlot( TFileDirectory &inputDir, TEfficiency* outputEfficiency, TH1F* pass, TH1F* all, TString name, TString title ); + + // Print summary of track-finding performance after track pattern reco. + virtual void printTrackPerformance(string tName); + + // Print summary of track-finding performance after helix fit for given track fitter. + virtual void printFitTrackPerformance(string fitName); + + // For Hybrid tracking + // Print summary of seed finding and extrapolation performance during track pattern reco. + virtual void printTrackletSeedFindingPerformance() {}; + + // Print summary of duplicate removal performance after track pattern reco. + virtual void printHybridDupRemovalPerformance() {}; + + // Understand why not all tracking particles were reconstructed. + // Returns list of tracking particles that were not reconstructed and an integer indicating why. + // Only considers TP used for algorithmic efficiency measurement. + virtual map diagnoseTracking(const vector& allTPs, const vector& tracks, + bool withRZfilter) const; + + protected: + + // Configuration parameters. + const Settings *settings_; + unsigned int genMinStubLayers_; + unsigned int numPhiSectors_; + unsigned int numEtaRegions_; + float houghMinPt_; + unsigned int houghNbinsPt_; + unsigned int houghNbinsPhi_; + float chosenRofZ_; + vector trackFitters_; + vector useRZfilter_; + bool ranRZfilter_; + bool resPlotOpt_; + + edm::Service fs_; + + // Histograms of input data. + TH1F* hisNumEvents_; + TProfile* profNumStubs_; + TH1F* hisStubsVsEta_; + TH1F* hisStubsVsR_; + TH2F* hisStubsVsRVsZ_; + TH2F* hisStubsModuleVsRVsZ_; + TH2F* hisStubsModuleTiltVsZ_; + TH2F* hisStubsdPhiCorrectionVsZ_; + TH2F* hisStubsVsRVsPhi_; + TH2F* hisStubsModuleVsRVsPhi_; + + TH2F* hisStubsVsRVsZ_outerModuleAtSmallerR_; + TH2F* hisStubsVsRVsPhi_outerModuleAtSmallerR_; + + TProfile* profNumTPs_; + TH1F* hisNumStubsPerTP_; + TH1F* hisNumPSStubsPerTP_; + TH1F* hisNum2SStubsPerTP_; + TH1F* hisNumLayersPerTP_; + TH1F* hisNumPSLayersPerTP_; + TH1F* hisNum2SLayersPerTP_; + + TH1F* hisNumLayersPerTP_lowPt_; + TH1F* hisNumPSLayersPerTP_lowPt_; + TH1F* hisNum2SLayersPerTP_lowPt_; + + TH1F* hisNumLayersPerTP_mediumPt_; + TH1F* hisNumPSLayersPerTP_mediumPt_; + TH1F* hisNum2SLayersPerTP_mediumPt_; + + TH1F* hisNumLayersPerTP_highPt_; + TH1F* hisNumPSLayersPerTP_highPt_; + TH1F* hisNum2SLayersPerTP_highPt_; + + TH1F* hisNumLayersPerTP_muons_; + TH1F* hisNumPSLayersPerTP_muons_; + TH1F* hisNum2SLayersPerTP_muons_; + + TH1F* hisNumLayersPerTP_electrons_; + TH1F* hisNumPSLayersPerTP_electrons_; + TH1F* hisNum2SLayersPerTP_electrons_; + + TH1F* hisNumLayersPerTP_pions_; + TH1F* hisNumPSLayersPerTP_pions_; + TH1F* hisNum2SLayersPerTP_pions_; + + TProfile* hisStubKillFE_; + TProfile* hisStubIneffiVsInvPt_; + TProfile* hisStubIneffiVsEta_; + TProfile* hisStubKillDegradeBend_; + TH1F* hisPtStub_; + TH1F* hisPtResStub_; + TH1F* hisBendFilterPower_; + TH1F* hisDelPhiStub_; + TH1F* hisDelPhiResStub_; + TH1F* hisDelPhiResStub_tilted_; + TH1F* hisDelPhiResStub_notTilted_; + TH1F* hisBendStub_; + TH1F* hisBendResStub_; + TH1F* hisNumMergedBend_; + TH2F* hisBendVsLayerOrRingPS_; + TH2F* hisBendVsLayerOrRing2S_; + TH2F* hisBendFEVsLayerOrRingPS_; + TH2F* hisBendFEVsLayerOrRing2S_; + TH1F* hisPhiStubVsPhiTP_; + TH1F* hisPhiStubVsPhi0TP_; + TH1F* hisPhi0StubVsPhi0TP_; + TH1F* hisPhi0StubVsPhi0TPres_; + TH1F* hisPhiStubVsPhi65TP_; + TH1F* hisPhi65StubVsPhi65TP_; + TH1F* hisPhi65StubVsPhi65TPres_; + TH1F* hisPitchOverSep_; + TH1F* hisRhoParameter_; + TH2F* hisAlphaCheck_; + TH1F* hisFracStubsSharingClus0_; + TH1F* hisFracStubsSharingClus1_; + + // Histograms of B + TH1F* hisStubB_; + TH1F* hisStubBApproxDiff_tilted_; + TGraph* graphBVsZoverR_; + + // Histograms checking that (eta,phi) sector definition is good. + TH1F* hisFracStubsInSec_; + TH1F* hisFracStubsInEtaSec_; + TH1F* hisFracStubsInPhiSec_; + TH1F* hisNumSecsPerStub_; + TH1F* hisNumEtaSecsPerStub_; + TH1F* hisNumPhiSecsPerStub_; + TH1F* hisNumStubsPerSec_; + TProfile* profNumStubsPerEtaSec_; + TH2F* hisLayerIDvsEtaSec_; + TH2F* hisLayerIDreducedvsEtaSec_; + + // Histograms checking filling of r-phi HT array. + TH2Poly* hisArrayHT_; + TF1* hisStubHT_; + TH1F* hisIncStubsPerHT_; + TH1F* hisExcStubsPerHT_; + TH2F* hisNumStubsInCellVsEta_; + TH1F* hisStubsOnRphiTracksPerHT_; + TH1F* hisHTstubsPerTrack_; + TH1F* hisHTmBin_; + TH1F* hisHTcBin_; + + // Histograms about r-z track filters (or other filters applied after r-phi HT array). + TH1F* hisNumZtrkSeedCombinations_; + TH1F* hisNumSeedCombinations_; + TH1F* hisNumGoodSeedCombinations_; + TH1F* hisCorrelationZTrk_; + + // Histograms for studying freak, large events with too many stubs. + TH1F* hisNumBusySecsInPerEvent_; + TH1F* hisNumBusySecsOutPerEvent_; + TProfile* profFracBusyInVsEtaReg_; + TProfile* profFracBusyOutVsEtaReg_; + TProfile* profFracStubsKilledVsEtaReg_; + TProfile* profFracTracksKilledVsEtaReg_; + TProfile* profFracTracksKilledVsInvPt_; + TProfile* profFracTPKilledVsEta_; + TProfile* profFracTPKilledVsInvPt_; + TH1F* hisNumTPkilledBusySec_; + map hisNumInputStubs_; + map hisQoverPtInputStubs_; + map hisNumOutputStubs_; + map hisNumTracks_; + map hisNumStubsPerTrack_; + map hisTrackQoverPt_; + map hisTrackPurity_; + map hisNumTPphysics_; + map hisNumTPpileup_; + map hisSumPtTPphysics_; + map hisSumPtTPpileup_; + + // Histograms studying 3D track candidates found by Hough Transform or r-z Track Filter. + map profNumTrackCands_; + map profNumTracksVsEta_; + map hisNumTracksVsQoverPt_; + map hisNumTrksPerSect_; + map hisNumTrksPerNon_; + map profStubsOnTracks_; + map profStubsOnTracksVsEta_; + map hisStubsOnTracksPerSect_; + map hisStubsOnTracksPerNon_; + map hisUniqueStubsOnTrksPerSect_; + map hisUniqueStubsOnTrksPerNon_; + map hisStubsPerTrack_; + map hisLayersPerTrack_; + map hisPSLayersPerTrack_; + map hisLayersPerTrueTrack_; + map hisPSLayersPerTrueTrack_; + + map hisNumStubsPerLink_; + map hisNumStubsVsLink_; + map profMeanStubsPerLink_; + map hisNumTrksPerLink_; + map hisNumTrksVsLink_; + map profMeanTrksPerLink_; + + map profExcessStubsPerTrackVsPt_; + map hisFracMatchStubsOnTracks_; + map hisDeltaBendTrue_; + map hisDeltaBendFake_; + map profFracTrueStubsVsLayer_; + map profDupTracksVsEta_; + map profDupTracksVsInvPt_; + //map hisWrongSignStubRZ_pBend_; + //map hisWrongSignStubRZ_nBend_; + + // Histos of track params after HT. + map hisQoverPt_; + map hisPhi0_; + map hisEta_; + map hisZ0_; + + // Histograms of track parameter resolution after HT transform. + map hisQoverPtRes_; + map hisPhi0Res_; + map hisEtaRes_; + map hisZ0Res_; + + map hisRecoVsTrueQinvPt_; + map hisRecoVsTruePhi0_; + map hisRecoVsTrueD0_; + map hisRecoVsTrueZ0_; + map hisRecoVsTrueEta_; + + // Diagnosis of failed tracking. + map hisRecoFailureReason_; + map hisRecoFailureLayer_; + + map hisNumStubsOnLayer_; + + // Histos used for denominator of tracking efficiency plots. + TH1F* hisTPinvptForEff_; + TH1F* hisTPptForEff_; + TH1F* hisTPetaForEff_; + TH1F* hisTPphiForEff_; + TH1F* hisTPd0ForEff_; + TH1F* hisTPz0ForEff_; + // + TH1F* hisTPinvptForAlgEff_; + TH1F* hisTPptForAlgEff_; + TH1F* hisTPetaForAlgEff_; + TH1F* hisTPphiForAlgEff_; + TH1F* hisTPd0ForAlgEff_; + TH1F* hisTPz0ForAlgEff_; + // + TH1F* hisTPphisecForAlgEff_; + TH1F* hisTPetasecForAlgEff_; + TH1F* hisTPinvptForAlgEff_inJetPtG30_; + TH1F* hisTPinvptForAlgEff_inJetPtG100_; + TH1F* hisTPinvptForAlgEff_inJetPtG200_; + + // Histograms used to make efficiency plots with 3D track candidates prior to fit. + map hisRecoTPinvptForEff_; + map hisRecoTPptForEff_; + map hisRecoTPetaForEff_; + map hisRecoTPphiForEff_; + // + map hisPerfRecoTPinvptForEff_; + map hisPerfRecoTPptForEff_; + map hisPerfRecoTPetaForEff_; + // + map hisRecoTPd0ForEff_; + map hisRecoTPz0ForEff_; + // + map hisRecoTPinvptForAlgEff_; + map hisRecoTPptForAlgEff_; + map hisRecoTPetaForAlgEff_; + map hisRecoTPphiForAlgEff_; + // + map hisPerfRecoTPinvptForAlgEff_; + map hisPerfRecoTPptForAlgEff_; + map hisPerfRecoTPetaForAlgEff_; + // + map hisRecoTPd0ForAlgEff_; + map hisRecoTPz0ForAlgEff_; + // + map hisRecoTPphisecForAlgEff_; + map hisPerfRecoTPphisecForAlgEff_; + map hisRecoTPetasecForAlgEff_; + map hisPerfRecoTPetasecForAlgEff_; + + map hisRecoTPinvptForAlgEff_inJetPtG30_; + map hisRecoTPinvptForAlgEff_inJetPtG100_; + map hisRecoTPinvptForAlgEff_inJetPtG200_; + + // Histograms for track fitting evaluation, where map index specifies name of track fitting algorithm used. + + map profNumFitTracks_; + map hisNumFitTrks_; + map hisNumFitTrksPerNon_; + map hisNumFitTrksPerSect_; + + map hisStubsPerFitTrack_; + map profStubsOnFitTracks_; + + map hisFitQinvPtMatched_; + map hisFitPhi0Matched_; + map hisFitD0Matched_; + map hisFitZ0Matched_; + map hisFitEtaMatched_; + + map hisFitQinvPtUnmatched_; + map hisFitPhi0Unmatched_; + map hisFitD0Unmatched_; + map hisFitZ0Unmatched_; + map hisFitEtaUnmatched_; + + map hisKalmanNumUpdateCalls_; + map hisKalmanChi2DofSkipLay0Matched_; + map hisKalmanChi2DofSkipLay1Matched_; + map hisKalmanChi2DofSkipLay2Matched_; + map hisKalmanChi2DofSkipLay0Unmatched_; + map hisKalmanChi2DofSkipLay1Unmatched_; + map hisKalmanChi2DofSkipLay2Unmatched_; + + map hisFitChi2Matched_; + map hisFitChi2DofMatched_; + map hisFitChi2DofRphiMatched_; + map hisFitChi2DofRzMatched_; + map hisFitBeamChi2Matched_; + map hisFitBeamChi2DofMatched_; + map profFitChi2VsEtaMatched_; + map profFitChi2DofVsEtaMatched_; + map profFitChi2VsInvPtMatched_; + map profFitChi2DofVsInvPtMatched_; + map profFitChi2VsTrueD0Matched_; + map profFitChi2DofVsTrueD0Matched_; + map hisFitChi2PerfMatched_; + map hisFitChi2DofPerfMatched_; + + map hisFitChi2Unmatched_; + map hisFitChi2DofUnmatched_; + map hisFitChi2DofRphiUnmatched_; + map hisFitChi2DofRzUnmatched_; + map hisFitBeamChi2Unmatched_; + map hisFitBeamChi2DofUnmatched_; + map profFitChi2VsEtaUnmatched_; + map profFitChi2DofVsEtaUnmatched_; + map profFitChi2VsInvPtUnmatched_; + map profFitChi2DofVsInvPtUnmatched_; + + map profFitChi2VsPurity_; + map profFitChi2DofVsPurity_; + + map hisDeltaPhitruePSbarrel_; + map hisDeltaRorZtruePSbarrel_; + map hisDeltaPhitrue2Sbarrel_; + map hisDeltaRorZtrue2Sbarrel_; + map hisDeltaPhitruePSendcap_; + map hisDeltaRorZtruePSendcap_; + map hisDeltaPhitrue2Sendcap_; + map hisDeltaRorZtrue2Sendcap_; + map hisDeltaPhifakePSbarrel_; + map hisDeltaRorZfakePSbarrel_; + map hisDeltaPhifake2Sbarrel_; + map hisDeltaRorZfake2Sbarrel_; + map hisDeltaPhifakePSendcap_; + map hisDeltaRorZfakePSendcap_; + map hisDeltaPhifake2Sendcap_; + map hisDeltaRorZfake2Sendcap_; + map profRecalcRphiChi2VsEtaTrue1_; + map profRecalcRzChi2VsEtaTrue1_; + map profRecalcChi2VsEtaTrue1_; + map profRecalcChi2VsEtaTrue2_; + map profNsigmaPhivsInvPt_; + map profNsigmaPhivsR_; + map profNsigmaPhivsTanl_; + + map hisFitVsSeedQinvPtMatched_; + map hisFitVsSeedPhi0Matched_; + map hisFitVsSeedD0Matched_; + map hisFitVsSeedZ0Matched_; + map hisFitVsSeedEtaMatched_; + + map hisFitVsSeedQinvPtUnmatched_; + map hisFitVsSeedPhi0Unmatched_; + map hisFitVsSeedD0Unmatched_; + map hisFitVsSeedZ0Unmatched_; + map hisFitVsSeedEtaUnmatched_; + + map hisNumStubsVsPurityMatched_; + map profFitFracTrueStubsVsLayerMatched_; + map profFitFracTrueStubsVsEtaMatched_; + + map hisFitVsTrueQinvPt_; + map hisFitVsTruePhi0_; + map hisFitVsTrueD0_; + map hisFitVsTrueZ0_; + map hisFitVsTrueEta_; + + map hisFitQinvPtRes_; + map hisFitPhi0Res_; + map hisFitD0Res_; + map hisFitZ0Res_; + map hisFitEtaRes_; + + map hisQoverPtResVsTrueEta_; + map hisPhi0ResVsTrueEta_; + map hisEtaResVsTrueEta_; + map hisZ0ResVsTrueEta_; + map hisD0ResVsTrueEta_; + + map hisQoverPtResVsTrueInvPt_; + map hisPhi0ResVsTrueInvPt_; + map hisEtaResVsTrueInvPt_; + map hisZ0ResVsTrueInvPt_; + map hisD0ResVsTrueInvPt_; + + map hisQoverPtResBeamVsTrueEta_; + map hisPhi0ResBeamVsTrueEta_; + map hisQoverPtResBeamVsTrueInvPt_; + map hisPhi0ResBeamVsTrueInvPt_; + + map hisFitEfficiencyVsChi2Dof_; + map hisNumStubsVsChi2Dof_; + map hisNumLayersVsChi2Dof_; + map hisAvgNumStubsPerLayerVsChi2Dof_; + + map profDupFitTrksVsEta_; + map profDupFitTrksVsInvPt_; + + // Histograms used for efficiency plots made with fitted tracks. + map hisFitTPinvptForEff_; + map hisFitTPptForEff_; + map hisFitTPetaForEff_; + map hisFitTPphiForEff_; + map hisPerfFitTPinvptForEff_; + map hisPerfFitTPptForEff_; + map hisPerfFitTPetaForEff_; + map hisFitTPd0ForEff_; + map hisFitTPz0ForEff_; + map hisFitTPinvptForAlgEff_; + map hisFitTPptForAlgEff_; + map hisFitTPetaForAlgEff_; + map hisFitTPphiForAlgEff_; + map hisPerfFitTPinvptForAlgEff_; + map hisPerfFitTPptForAlgEff_; + map hisPerfFitTPetaForAlgEff_; + map hisFitTPd0ForAlgEff_; + map hisFitTPz0ForAlgEff_; + map hisFitTPphisecForAlgEff_; + map hisFitTPetasecForAlgEff_; + map hisPerfFitTPphisecForAlgEff_; + map hisPerfFitTPetasecForAlgEff_; + map hisPerfFitTPinvptForAlgEff_inJetPtG30_; + map hisPerfFitTPinvptForAlgEff_inJetPtG100_; + map hisPerfFitTPinvptForAlgEff_inJetPtG200_; + + // Histograms of tracking efficiency & fake rate after Hough transform or after r-z track filter. + map teffEffVsInvPt_; + map teffEffVsPt_; + map teffEffVsEta_; + map teffEffVsPhi_; + // + map teffPerfEffVsInvPt_; + map teffPerfEffVsPt_; + map teffPerfEffVsEta_; + // + map teffEffVsD0_; + map teffEffVsZ0_; + // + map teffAlgEffVsInvPt_; + map teffAlgEffVsPt_; + map teffAlgEffVsEta_; + map teffAlgEffVsPhi_; + map teffAlgEffVsInvPt_inJetPtG30_; + map teffAlgEffVsInvPt_inJetPtG100_; + map teffAlgEffVsInvPt_inJetPtG200_; + // + map teffPerfAlgEffVsInvPt_; + map teffPerfAlgEffVsPt_; + map teffPerfAlgEffVsEta_; + // + map teffAlgEffVsD0_; + map teffAlgEffVsZ0_; + // + map teffAlgEffVsPhiSec_; + map teffAlgEffVsEtaSec_; + map teffPerfAlgEffVsPhiSec_; + map teffPerfAlgEffVsEtaSec_; + + // Histograms of tracking efficiency & fake rate after Hough transform based on tracks after the track fit. + map teffEffFitVsInvPt_; + map teffEffFitVsPt_; + map teffEffFitVsEta_; + map teffEffFitVsPhi_; + // + map teffPerfEffFitVsInvPt_; + map teffPerfEffFitVsPt_; + map teffPerfEffFitVsEta_; + // + map teffEffFitVsD0_; + map teffEffFitVsZ0_; + // + map teffAlgEffFitVsInvPt_; + map teffAlgEffFitVsPt_; + map teffAlgEffFitVsEta_; + map teffAlgEffFitVsPhi_; + // + map teffPerfAlgEffFitVsInvPt_; + map teffPerfAlgEffFitVsPt_; + map teffPerfAlgEffFitVsEta_; + map teffPerfAlgEffFitVsInvPt_inJetPtG30_; + map teffPerfAlgEffFitVsInvPt_inJetPtG100_; + map teffPerfAlgEffFitVsInvPt_inJetPtG200_; + // + map teffAlgEffFitVsD0_; + map teffAlgEffFitVsZ0_; + // + map teffAlgEffFitVsPhiSec_; + map teffAlgEffFitVsEtaSec_; + map teffPerfAlgEffFitVsPhiSec_; + map teffPerfAlgEffFitVsEtaSec_; + + bool plotFirst_; + + // Number of genuine reconstructed and perfectly reconstructed tracks which were fitted. + map numFitAlgEff_; + map numFitPerfAlgEff_; + + // Number of genuine reconstructed and perfectly reconstructed tracks which were fitted post-cut. + map numFitAlgEffPass_; + map numFitPerfAlgEffPass_; + + // Range in r of each barrel layer. + map mapBarrelLayerMinR_; + map mapBarrelLayerMaxR_; + // Range in z of each endcap wheel. + map mapEndcapWheelMinZ_; + map mapEndcapWheelMaxZ_; + + // Range in (r,z) of each module type. + map mapModuleTypeMinR_; + map mapModuleTypeMaxR_; + map mapModuleTypeMinZ_; + map mapModuleTypeMaxZ_; + // Extra maps for wierd barrel layers 1-2 & endcap wheels 3-5. + map mapExtraAModuleTypeMinR_; + map mapExtraAModuleTypeMaxR_; + map mapExtraAModuleTypeMinZ_; + map mapExtraAModuleTypeMaxZ_; + map mapExtraBModuleTypeMinR_; + map mapExtraBModuleTypeMaxR_; + map mapExtraBModuleTypeMinZ_; + map mapExtraBModuleTypeMaxZ_; + map mapExtraCModuleTypeMinR_; + map mapExtraCModuleTypeMaxR_; + map mapExtraCModuleTypeMinZ_; + map mapExtraCModuleTypeMaxZ_; + map mapExtraDModuleTypeMinR_; + map mapExtraDModuleTypeMaxR_; + map mapExtraDModuleTypeMinZ_; + map mapExtraDModuleTypeMaxZ_; + + bool bApproxMistake_; +}; + +} +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/InputData.h b/L1Trigger/TrackFindingTMTT/interface/InputData.h new file mode 100644 index 0000000000000..f62dd597a0b6d --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/InputData.h @@ -0,0 +1,66 @@ +#ifndef __INPUTDATA_H__ +#define __INPUTDATA_H__ + +#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "L1Trigger/TrackFindingTMTT/interface/TP.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Utilities/interface/InputTag.h" +#include + +using namespace std; + +namespace TMTT { + +class Settings; + +//=== Unpacks stub & tracking particle (truth) data into user-friendlier format in Stub & TP classes. +//=== Also makes B-field available to Settings class. + +class InputData { + +public: + + InputData(const edm::Event& iEvent, const edm::EventSetup& iSetup, Settings* settings, + const edm::EDGetTokenT tpInputTag, + const edm::EDGetTokenT stubInputTag, + const edm::EDGetTokenT stubTruthInputTag, + const edm::EDGetTokenT clusterTruthInputTag, + const edm::EDGetTokenT< reco::GenJetCollection > genJetInputTag + ); + + // Get tracking particles + const vector& getTPs() const {return vTPs_;} + // Get stubs that would be output by the front-end readout electronics + const vector& getStubs() const {return vStubs_;} + + //--- of minor importance ... + + // Get number of stubs prior to applying tighted front-end readout electronics cuts specified in section StubCuts of Analyze_Defaults_cfi.py. (Only used to measure the efficiency of these cuts). + const vector& getAllStubs() const {return vAllStubs_;} + +private: + // const edm::EDGetTokenT inputTag; + + // Can optionally be used to sort stubs by bend. + struct SortStubsInBend { + inline bool operator() (const Stub* stub1, const Stub* stub2) { + return(fabs(stub1->bend()) < fabs(stub2->bend())); + } + }; + +private: + + bool enableMCtruth_; // Notes if job will use MC truth info. + + vector vTPs_; // tracking particles + vector vStubs_; // stubs that would be output by the front-end readout electronics. + + //--- of minor importance ... + + vector vAllStubs_; // all stubs, even those that would fail any tightened front-end readout electronic cuts specified in section StubCuts of Analyze_Defaults_cfi.py. (Only used to measure the efficiency of these cuts). +}; + +} +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/KF4ParamsComb.h.bak b/L1Trigger/TrackFindingTMTT/interface/KF4ParamsComb.h.bak new file mode 100644 index 0000000000000..a207234789d85 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/KF4ParamsComb.h.bak @@ -0,0 +1,42 @@ +///=== This is the Kalman Combinatorial Filter for 4 helix parameters track fit algorithm. + +#ifndef __KF4PARAMSCOMB__ +#define __KF4PARAMSCOMB__ + +#include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" +#include +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" + +namespace TMTT { + +class KF4ParamsComb : public L1KalmanComb{ + + public: + enum PAR_IDS { INV2R, PHI0, T, Z0 }; + enum MEAS_IDS { PHI, Z }; + public: + KF4ParamsComb(const Settings* settings, const uint nPar, const string &fitterName ); + virtual ~KF4ParamsComb(){} + + protected: + virtual std::map getTrackParams(const KalmanState *state )const; + virtual std::vector seedx(const L1track3D& l1track3D)const; + virtual TMatrixD seedP(const L1track3D& l1track3D)const; + virtual std::vector d(const StubCluster* stubCluster )const; + virtual TMatrixD H(const StubCluster* stubCluster)const; + virtual TMatrixD dH(const StubCluster* stubCluster)const; + virtual TMatrixD F(const StubCluster* stubCluster=0, const KalmanState *state = 0)const; + virtual TMatrixD PxxModel( const KalmanState *state, const StubCluster *stubCluster )const; + virtual TMatrixD PddMeas(const StubCluster* stubCluster, const KalmanState *state )const; + virtual bool isGoodState( const KalmanState &state )const; + + private: + std::vector mapToVec(std::map x)const; + std::map vecToMap(std::vector x)const; +}; + +} + +#endif + + diff --git a/L1Trigger/TrackFindingTMTT/interface/KF4ParamsCombIV.bak b/L1Trigger/TrackFindingTMTT/interface/KF4ParamsCombIV.bak new file mode 100644 index 0000000000000..08a2d71785bdc --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/KF4ParamsCombIV.bak @@ -0,0 +1,50 @@ +///=== This is the Kalman Combinatorial Filter for 4 helix parameters track fit algorithm. + +///=== Written by: Sioni Summers + +#ifndef __KF4PARAMSCOMBIV__ +#define __KF4PARAMSCOMBIV__ + +#include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" +//#include "L1Trigger/TrackFindingTMTT/interface/Matrix.h" +#include +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" + +class KF4ParamsCombIV : public L1KalmanComb{ + + public: + enum BARREL_PAR_IDS { BP_RHOPHI, BP_Z, BP_INV2R, BP_T }; + enum ENDCAP_PAR_IDS { EP_RHOPHI, EP_RHO, EP_INV2RT, EP_INVT }; + enum BARREL_MEAS_IDS { BM_RHOPHI, BM_Z }; + enum ENDCAP_MEAS_IDS { EM_RHOPHI, EM_RHO }; + public: + KF4ParamsCombIV(const Settings* settings, const string &fitterName ); + virtual ~KF4ParamsCombIV(){} + std::string getParams(); + + protected: + virtual std::map getTrackParams(const KalmanState *state )const; + virtual std::vector seedx(const L1track3D& l1track3D)const; + virtual TMatrixD seedP(const L1track3D& l1track3D)const; + virtual std::vector d(const StubCluster* stubCluster )const; + virtual TMatrixD H(const StubCluster* stubCluster)const; + virtual TMatrixD F(const StubCluster* stubCluster, const KalmanState *state )const; + virtual TMatrixD PxxModel( const KalmanState *state, const StubCluster *stubCluster, unsigned stub_itr )const; + virtual TMatrixD PddMeas(const StubCluster* stubCluster, const KalmanState *state )const; + virtual void barrelToEndcap( double r, const StubCluster* stubCluster, std::vector &state, TMatrixD &cov_x )const; + virtual bool stubBelongs(const StubCluster* stubCluster, KalmanState& state, unsigned itr )const; + virtual double validationGateCutValue( const StubCluster *stubCluster, unsigned path )const; + virtual bool isGoodState( const KalmanState &state )const; + virtual std::vector residual(const StubCluster* stubCluster, const std::vector &x )const; + + private: + double getZ( const KalmanState *state )const; + double getZ0( const KalmanState *state )const; + double getZ0Variance( const KalmanState *state )const; + double getZVariance( const KalmanState *state )const; + void barrelToEndcap( double r, const StubCluster *stubCluster, std::vector &state )const; +}; +#endif + + diff --git a/L1Trigger/TrackFindingTMTT/interface/KF4ParamsCombV2.bak b/L1Trigger/TrackFindingTMTT/interface/KF4ParamsCombV2.bak new file mode 100644 index 0000000000000..569ff757dfc9b --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/KF4ParamsCombV2.bak @@ -0,0 +1,33 @@ +#ifndef __KF4ParamsCombV2_H__ +#define __KF4ParamsCombV2_H__ + +#include "L1Trigger/TrackFindingTMTT/interface/KF4ParamsComb.h" +#include + +class KF4ParamsCombV2 : public KF4ParamsComb{ + + public: + enum PAR_IDS { V2_BETA, V2_Z0P, V2_R0P, V2_RHO0 }; + enum MEAS_IDS { Z, R }; + public: + KF4ParamsCombV2(const Settings* settings, const string &fitterName ); + ~KF4ParamsCombV2(){} + std::string getParams(); + + protected: + std::map getTrackParams( const KalmanState *state )const; + std::vector seedx(const L1track3D& l1track3D)const; + TMatrixD seedP(const L1track3D& l1track3D)const; + std::vector d(const StubCluster* stubCluster )const; + TMatrixD H(const StubCluster* stubCluster)const; + TMatrixD PxxModel( const KalmanState* state, const StubCluster* stubCluster, unsigned stub_itr )const; + TMatrixD PddMeas(const StubCluster* stubCluster, const KalmanState *state )const; + std::map convertParams(std::vector x)const; + bool isGoodState( const KalmanState &state )const; + + std::vector residual(const StubCluster* stubCluster, std::vector &x )const; + +}; + +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/KF5ParamsComb.h.bak b/L1Trigger/TrackFindingTMTT/interface/KF5ParamsComb.h.bak new file mode 100644 index 0000000000000..8a3098b2df356 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/KF5ParamsComb.h.bak @@ -0,0 +1,43 @@ +///=== This is the Kalman Combinatorial Filter for 4 helix parameters track fit algorithm. + +#ifndef __KF5PARAMSCOMB__ +#define __KF5PARAMSCOMB__ + +#include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" +#include +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" + +namespace TMTT { + +class KF5ParamsComb : public L1KalmanComb{ + + public: + enum PAR_IDS { INV2R, PHI0, T, Z0, D0 }; + enum MEAS_IDS { PHI, Z }; + public: + KF5ParamsComb(const Settings* settings, const uint nPar, const string &fitterName ); + virtual ~KF5ParamsComb(){} + + protected: + virtual std::map getTrackParams(const KalmanState *state )const; + virtual std::map getTrackParams_BeamConstr(const KalmanState *state, double& deltaChi2) const; + virtual std::vector seedx(const L1track3D& l1track3D)const; + virtual TMatrixD seedP(const L1track3D& l1track3D)const; + virtual std::vector d(const StubCluster* stubCluster )const; + virtual TMatrixD H(const StubCluster* stubCluster)const; + virtual TMatrixD dH(const StubCluster* stubCluster)const; + virtual TMatrixD F(const StubCluster* stubCluster=0, const KalmanState *state = 0)const; + virtual TMatrixD PxxModel( const KalmanState *state, const StubCluster *stubCluster )const; + virtual TMatrixD PddMeas(const StubCluster* stubCluster, const KalmanState *state )const; + virtual bool isGoodState( const KalmanState &state )const; + + private: + std::vector mapToVec(std::map x)const; + std::map vecToMap(std::vector x)const; +}; + +} + +#endif + + diff --git a/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h b/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h new file mode 100644 index 0000000000000..bd8ab7c19bb82 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h @@ -0,0 +1,43 @@ +///=== This is the Kalman Combinatorial Filter for 4 & 5 helix parameters track fit algorithm. + +#ifndef __KFPARAMSCOMB__ +#define __KFPARAMSCOMB__ + +#include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" +#include +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" + +namespace TMTT { + +class KFParamsComb : public L1KalmanComb { + + public: + enum PAR_IDS { INV2R, PHI0, T, Z0, D0 }; + enum MEAS_IDS { PHI, Z }; + public: + KFParamsComb(const Settings* settings, const uint nPar, const string &fitterName ); + virtual ~KFParamsComb(){} + + protected: + virtual std::map getTrackParams(const KalmanState *state )const; + virtual std::map getTrackParams_BeamConstr(const KalmanState *state, double& chi2rphi) const; + virtual std::vector seedx(const L1track3D& l1track3D)const; + virtual TMatrixD seedP(const L1track3D& l1track3D)const; + virtual std::vector d(const StubCluster* stubCluster )const; + virtual TMatrixD H(const StubCluster* stubCluster)const; + virtual TMatrixD dH(const StubCluster* stubCluster)const; + virtual TMatrixD F(const StubCluster* stubCluster=0, const KalmanState *state = 0)const; + virtual TMatrixD PxxModel( const KalmanState *state, const StubCluster *stubCluster )const; + virtual TMatrixD PddMeas(const StubCluster* stubCluster, const KalmanState *state )const; + virtual bool isGoodState( const KalmanState &state )const; + + private: + std::vector mapToVec(std::map x)const; + std::map vecToMap(std::vector x)const; +}; + +} + +#endif + + diff --git a/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h b/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h new file mode 100644 index 0000000000000..ed5b6546a9193 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h @@ -0,0 +1,256 @@ +#ifndef __KFTrackletTrack_H__ +#define __KFTrackletTrack_H__ + +#include "FWCore/Utilities/interface/Exception.h" +#include "DataFormats/Math/interface/deltaPhi.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1trackBase.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/Utility.h" +#include "L1Trigger/TrackFindingTMTT/interface/TP.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/Sector.h" +#include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h" +#include "L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h" + +#include +#include +#include + +using namespace std; + +//=== This is used uniquely for HYBRID TRACKING. +//=== It is the equivalent of class L1fittedTrack. +//=== +//=== This represents a fitted L1 track candidate found in 3 dimensions. +//=== It gives access to the fitted helix parameters & chi2 etc. +//=== It also calculates & gives access to associated truth particle (Tracking Particle) if any. +//=== It also gives access to the 3D hough-transform track candidate (L1track3D) on which the fit was run. + +namespace TMTT { + +class KFTrackletTrack{ + +public: + + // Store a new fitted track, specifying the input Hough transform track, the stubs used for the fit, + // bit-encoded hit layers, + // the fitted helix parameters & chi2, + // and the number of helix parameters being fitted (=5 if d0 is fitted, or =4 if d0 is not fitted). + // Also specify phi sector and eta region used by track-finding code that this track was in. + // And if track fit declared this to be a valid track (enough stubs left on track after fit etc.). + KFTrackletTrack(const L1track3D& l1track3D, const vector& stubs, + unsigned int hitPattern, + float qOverPt, float d0, float phi0, float z0, float tanLambda, + float chi2rphi, float chi2rz, unsigned int nHelixParam, + unsigned int iPhiSec, unsigned int iEtaReg, bool accepted = true) : + l1track3D_(l1track3D), stubs_(stubs), hitPattern_(hitPattern), + qOverPt_(qOverPt), d0_(d0), phi0_(phi0), z0_(z0), tanLambda_(tanLambda), + chi2rphi_(chi2rphi), chi2rz_(chi2rz), + done_bcon_(false), qOverPt_bcon_(qOverPt), d0_bcon_(d0), phi0_bcon_(phi0), + chi2rphi_bcon_(chi2rphi), nHelixParam_(nHelixParam), + iPhiSec_(iPhiSec), iEtaReg_(iEtaReg), optoLinkID_(l1track3D.optoLinkID()), accepted_(accepted), + nSkippedLayers_(0), numUpdateCalls_(0), numIterations_(0) + { + // Doesn't make sense to assign stubs to track if fitter rejected it. + if (! accepted) stubs_.clear(); + //nLayers_ = Utility::countLayers(settings, stubs); // Count tracker layers these stubs are in + // matchedTP_ = Utility::matchingTP(settings, stubs, nMatchedLayers_, matchedStubs_); // Find associated truth particle & calculate info about match. + // secTmp_.init(settings, iPhiSec, iEtaReg); //Sector class used to check if fitted track trajectory is in expected sector. + // htRphiTmp_.init(settings, iPhiSec, iEtaReg, secTmp_.etaMin(), secTmp_.etaMax(), secTmp_.phiCentre()); // HT class used to identify HT cell that corresponds to fitted helix parameters. + } + + KFTrackletTrack() {}; // Creates track object, but doesn't set any variables. + + ~KFTrackletTrack() {} + + //--- Optionally set track helix params & chi2 if beam-spot constraint is used (for 5-parameter fit). + void setBeamConstr(float qOverPt_bcon, float phi0_bcon, float chi2rphi_bcon) { + done_bcon_ = true; qOverPt_bcon_ = qOverPt_bcon; d0_bcon_ = 0.0, phi0_bcon_ = phi0_bcon; + chi2rphi_bcon_ = chi2rphi_bcon; + } + + //--- Set/get additional info about fitted track that is specific to individual track fit algorithms (KF, LR, chi2) + //--- and is used for debugging/histogramming purposes. + + void setInfoKF( unsigned int nSkippedLayers, unsigned int numUpdateCalls ) { + nSkippedLayers_ = nSkippedLayers; + numUpdateCalls_ = numUpdateCalls; + } + + void getInfoKF( unsigned int& nSkippedLayers, unsigned int& numUpdateCalls ) const { + nSkippedLayers = nSkippedLayers_; + numUpdateCalls = numUpdateCalls_; + } + + + const L1track3D& getL1track3D() const {return l1track3D_;} + + // Get stubs on fitted track (can differ from those on HT track if track fit kicked out stubs with bad residuals) + const vector& getStubs() const {return stubs_;} + // Get number of stubs on fitted track. + unsigned int getNumStubs() const {return stubs_.size();} + // Get number of tracker layers these stubs are in. + unsigned int getNumLayers() const {return nLayers_;} + // Get number of stubs deleted from track candidate by fitter (because they had large residuals) + unsigned int getNumKilledStubs() const {return l1track3D_.getNumStubs() - this->getNumStubs();} + + // Get bit-encoded hit pattern (where layer number assigned by increasing distance from origin, according to layers track expected to cross). + unsigned int getHitPattern() const {return hitPattern_;} + + + //--- Get the fitted track helix parameters. + + float qOverPt() const {return qOverPt_;} + float charge() const {return (qOverPt_ > 0 ? 1 : -1);} + float invPt() const {return fabs(qOverPt_);} + float pt() const {return 1./(1.0e-6 + this->invPt());} // includes protection against 1/pt = 0. + float d0() const {return d0_;} + float phi0() const {return phi0_;} + float z0() const {return z0_;} + float tanLambda() const {return tanLambda_;} + float theta() const {return atan2(1., tanLambda_);} // Use atan2 to ensure 0 < theta < pi. + float eta() const {return -log(tan(0.5*this->theta()));} + + //--- Get the fitted helix parameters with beam-spot constraint. + //--- If constraint not applied (e.g. 4 param fit) then these are identical to unconstrained values. + + bool done_bcon() const {return done_bcon_;} // Was beam-spot constraint aplied? + float qOverPt_bcon() const {return qOverPt_bcon_;} + float charge_bcon() const {return (qOverPt_bcon_ > 0 ? 1 : -1);} + float invPt_bcon() const {return fabs(qOverPt_bcon_);} + float pt_bcon() const {return 1./(1.0e-6 + this->invPt_bcon());} + float phi0_bcon() const {return phi0_bcon_;} + + // Phi and z coordinates at which track crosses "chosenR" values used by r-phi HT and rapidity sectors respectively. + // (Optionally with beam-spot constraint applied). + float phiAtChosenR(bool beamConstraint) const { + if (beamConstraint) { + return reco::deltaPhi(phi0_bcon_ - asin((settings_->invPtToDphi() * settings_->chosenRofPhi()) * qOverPt_bcon_) - d0_bcon_/(settings_->chosenRofPhi()), 0.); + } else { + return reco::deltaPhi(phi0_ - asin((settings_->invPtToDphi() * settings_->chosenRofPhi()) * qOverPt_) - d0_/(settings_->chosenRofPhi()), 0.); + } + } + float zAtChosenR() const {return (z0_ + (settings_->chosenRofZ()) * tanLambda_);} // neglects transverse impact parameter & track curvature. + + // Get the number of helix parameters being fitted (=5 if d0 is fitted or =4 if d0 is not fitted). + float nHelixParam() const {return nHelixParam_;} + + // Get the fit degrees of freedom, chi2 & chi2/DOF + unsigned int numDOF() const {return 2*this->getNumStubs() - nHelixParam_;} + unsigned int numDOFrphi() const {return this->getNumStubs() - (nHelixParam_ - 2);} + unsigned int numDOFrz( ) const {return this->getNumStubs() - 2;} + float chi2rphi() const {return chi2rphi_;} + float chi2rz() const {return chi2rz_;} + float chi2() const {return chi2rphi_ + chi2rz_;} + float chi2dof() const {return (this->chi2())/this->numDOF();} + + //--- Ditto, but if beam-spot constraint is applied. + //--- If constraint not applied (e.g. 4 param fit) then these are identical to unconstrained values. + unsigned int numDOF_bcon() const {return (this->numDOF() - 1);} + unsigned int numDOFrphi_bcon() const {return (this->numDOFrphi() - 1);} + float chi2rphi_bcon() const {return chi2rphi_bcon_;} + float chi2_bcon() const {return chi2rphi_bcon_ + chi2rz_;} + float chi2dof_bcon() const {return (this->chi2_bcon())/this->numDOF_bcon();} + + //--- Get phi sector and eta region used by track finding code that this track is in. + unsigned int iPhiSec() const {return iPhiSec_;} + unsigned int iEtaReg() const {return iEtaReg_;} + + //--- Opto-link ID used to send this track from HT to Track Fitter + unsigned int optoLinkID() const {return optoLinkID_;} + + //--- Get whether the track has been rejected or accepted by the fit + + bool accepted() const { + return accepted_; + } + + // Comparitor useful for sorting tracks by q/Pt using std::sort(). + static bool qOverPtSortPredicate(const KFTrackletTrack& t1, const KFTrackletTrack t2) { return t1.qOverPt() < t2.qOverPt(); } + + //--- Functions to help eliminate duplicate tracks. + + // Is the fitted track trajectory should lie within the same HT cell in which the track was originally found? + + // Is the fitted track trajectory within the same (eta,phi) sector of the HT used to find it? + bool consistentSector() const { + bool insidePhi = (fabs(reco::deltaPhi(this->phiAtChosenR(done_bcon_), secTmp_.phiCentre())) < secTmp_.sectorHalfWidth()); + bool insideEta = (this->zAtChosenR() > secTmp_.zAtChosenR_Min() && this->zAtChosenR() < secTmp_.zAtChosenR_Max()); + return (insidePhi && insideEta); + } + + // Digitize track and degrade helix parameter resolution according to effect of digitisation. + void digitizeTrack(const string& fitterName); + + // Access to detailed info about digitized track + const DigitalTrack& digitaltrack() const { return digitalTrack_;} + +private: + + //--- Configuration parameters + const Settings* settings_; + + //--- The 3D hough-transform track candidate which was fitted. + L1track3D l1track3D_; + + //--- The stubs on the fitted track (can differ from those on HT track if fit kicked off stubs with bad residuals) + vector stubs_; + unsigned int nLayers_; + + //--- Bit-encoded hit pattern (where layer number assigned by increasing distance from origin, according to layers track expected to cross). + unsigned int hitPattern_; + + //--- The fitted helix parameters and fit chi-squared. + float qOverPt_; + float d0_; + float phi0_; + float z0_; + float tanLambda_; + float chi2rphi_; + float chi2rz_; + + //--- Ditto with beam-spot constraint applied in case of 5-parameter fit, plus boolean to indicate + bool done_bcon_; + float qOverPt_bcon_; + float d0_bcon_; + float phi0_bcon_; + float chi2rphi_bcon_; + + //--- The number of helix parameters being fitted (=5 if d0 is fitted or =4 if d0 is not fitted). + unsigned int nHelixParam_; + + //--- Phi sector and eta region used track finding code that this track was in. + unsigned int iPhiSec_; + unsigned int iEtaReg_; + //--- Opto-link ID from HT to Track Fitter. + unsigned int optoLinkID_; + + //--- Information about its association (if any) to a truth Tracking Particle. + const TP* matchedTP_; + vector matchedStubs_; + unsigned int nMatchedLayers_; + + //--- Has the track fit declared this to be a valid track? + bool accepted_; + + //--- Sector class used to check if fitted track trajectory is in same sector as HT used to find it. + Sector secTmp_; + //--- r-phi HT class used to determine HT cell location that corresponds to fitted track helix parameters. + HTrphi htRphiTmp_; + + //--- Info specific to KF fitter. + unsigned int nSkippedLayers_; + unsigned int numUpdateCalls_; + //--- Info specific to LR fitter. + int numIterations_; + std::string lostMatchingState_; + std::unordered_map< std::string, int > stateCalls_; + + bool digitizedTrack_; + DigitalTrack digitalTrack_; // Class used to digitize track if required. +}; + +} + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/KalmanState.h b/L1Trigger/TrackFindingTMTT/interface/KalmanState.h new file mode 100644 index 0000000000000..b473c4d7d7722 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/KalmanState.h @@ -0,0 +1,108 @@ +#ifndef __KALMAN_STATE__ +#define __KALMAN_STATE__ + +#include +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" +#include + +namespace TMTT { + +class L1KalmanComb; +class KalmanState; +class StubCluster; + +typedef std::map (*GET_TRACK_PARAMS)( const L1KalmanComb *p, const KalmanState *state ); + +class KalmanState{ + public: + KalmanState(); + KalmanState( const L1track3D& candidate, unsigned n_skipped, unsigned kLayer_next, unsigned layerId, const KalmanState *last_state, + const std::vector &x, const TMatrixD &pxx, const TMatrixD &K, const TMatrixD &dcov, + const StubCluster* stubcl, double chi2rphi, double chi2rz, + L1KalmanComb *fitter, GET_TRACK_PARAMS f ); + KalmanState(const KalmanState &p); + ~KalmanState(){} + + KalmanState & operator=( const KalmanState &other ); + + unsigned nextLayer() const { return kLayerNext_; } + unsigned layerId() const { return layerId_; } + unsigned endcapRing() const { return endcapRing_; } + bool barrel() const { return barrel_; } + unsigned nSkippedLayers() const { return n_skipped_; } + // Hit coordinates. + double r() const { return r_; } + double z() const { return z_; } + const KalmanState *last_state() const { return last_state_; } + // Helix parameters (1/2R, phi relative to sector, z0, tanLambda) + std::vector xa() const { return xa_; } + // Covariance matrix on helix params. + TMatrixD pxxa() const { return pxxa_; } + // Kalman Gain matrix + TMatrixD K() const { return K_; } + // Hit position covariance matrix. + TMatrixD dcov() const { return dcov_; } + // Hit + const StubCluster* stubCluster() const { return stubCluster_; } + double chi2() const { return chi2rphi_ + chi2rz_; } + double chi2scaled() const { return chi2rphi_/kalmanChi2RphiScale_ + chi2rz_; } // Improves electron performance. + double chi2rphi() const { return chi2rphi_; } + double chi2rz() const { return chi2rz_; } + unsigned nStubLayers() const { return n_stubs_; } + L1track3D candidate() const { return l1track3D_; } + unsigned int hitPattern() const { return hitPattern_; } // Bit-encoded KF layers the fitted track has stubs in. + + bool good( const TP *tp ) const; + double reducedChi2() const; + const KalmanState *last_update_state() const; + std::vector stubs() const; + L1KalmanComb *fitter() const{ return fitter_; } + GET_TRACK_PARAMS fXtoTrackParams() const{ return fXtoTrackParams_; }; + + + static bool orderChi2(const KalmanState *left, const KalmanState *right); + static bool orderMinSkipChi2(const KalmanState *left, const KalmanState *right); + + static bool order(const KalmanState *left, const KalmanState *right); + void dump( ostream &os, const TP *tp=0, bool all=0 ) const; + void setChi2( double chi2rphi, double chi2rz ){ chi2rphi_ = chi2rphi; chi2rz_ = chi2rz; } + + // If using HLS, note/get additional output produced by HLS core. + //void setHLSselect(unsigned int mBinHelix, unsigned int cBinHelix, bool consistent) { mBinHelixHLS_ = mBinHelix; cBinHelixHLS_ = cBinHelix; consistentHLS_ = consistent;} + //void getHLSselect(unsigned int& mBinHelix, unsigned int& cBinHelix, bool& consistent) const { mBinHelix = mBinHelixHLS_; cBinHelix = cBinHelixHLS_; consistent = consistentHLS_;} + + private: + unsigned kLayerNext_; + unsigned layerId_; + unsigned endcapRing_; + double r_; + const KalmanState *last_state_; + std::vector xa_; + TMatrixD pxxa_; + TMatrixD K_; + TMatrixD dcov_; + const StubCluster *stubCluster_; + double chi2rphi_; + double chi2rz_; + unsigned int kalmanChi2RphiScale_; + unsigned n_stubs_; + L1KalmanComb *fitter_; + GET_TRACK_PARAMS fXtoTrackParams_; + bool barrel_; + unsigned n_skipped_; + double z_; + L1track3D l1track3D_; + unsigned int hitPattern_; + + // Additional output from HLS if using it. + unsigned int mBinHelixHLS_; + unsigned int cBinHelixHLS_; + bool consistentHLS_; +}; + +} + +#endif + + diff --git a/L1Trigger/TrackFindingTMTT/interface/KillDupFitTrks.h b/L1Trigger/TrackFindingTMTT/interface/KillDupFitTrks.h new file mode 100644 index 0000000000000..d288b1fab6211 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/KillDupFitTrks.h @@ -0,0 +1,78 @@ +#ifndef __KILLDUPFITTRKS_H__ +#define __KILLDUPFITTRKS_H__ + +#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" +#include "L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h" + +#include +#include + +using namespace std; + +/** +* Kill duplicate fitted tracks. +* +* Currently this is intended to run only on tracks found within a single (eta,phi) sector. +* +* N.B. Duplicate track removal algorithms that can only be run on fitted tracks are implemented +* here, whilst those that can also be run on the L1track2D or L1track3D collections are instead +* implemented inside class KillDupTrks. +*/ + +namespace TMTT { + +class Settings; + +class KillDupFitTrks { + +public: + + KillDupFitTrks() {} + + ~KillDupFitTrks() {} + + /** + * Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. + */ + void init(const Settings* settings, unsigned int dupTrkAlg); + + /** + * Eliminate duplicate tracks from the input collection, and so return a reduced list of tracks. + */ + vector filter(const vector& vecTracks) const; + +private: + + /** + * Duplicate removal algorithm designed to run after the track helix fit, which eliminates duplicates simply + * by requiring that the fitted (q/Pt, phi0) of the track correspond to the same HT cell in which the track + * was originally found by the HT. + */ + vector filterAlg50(const vector& tracks) const; + + /** + * Duplicate removal algorithm designed to run after the track helix fit, which eliminates duplicates + * simply by requiring that no two tracks should have fitted (q/Pt, phi0) that correspond to the same HT + * cell. If they do, then only the first to arrive is kept. + */ + vector filterAlg51(const vector& tracks) const; + + /** + * Other duplicate track removal algorithms are available in class KillDupTrks, which this class + * can call. + */ + + // Debug printout of which tracks are duplicates. + void printDuplicateTracks(const vector& tracks) const; + +private: + + const Settings *settings_; // Configuration parameters. + unsigned int dupTrkAlg_; // Specifies choice of algorithm for duplicate track removal. + KillDupTrks killDupTrks_; // Contains duplicate removal algorithms common to all track types. +}; + +} + +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h b/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h new file mode 100644 index 0000000000000..fef3f2802a416 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h @@ -0,0 +1,106 @@ +#ifndef __KILLDUPTRKS_H__ +#define __KILLDUPTRKS_H__ + +#include +#include +#include +#include +#include +#include + +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/TP.h" +#include "FWCore/Utilities/interface/Exception.h" +#include + +using namespace std; + +/** +* Kill duplicate reconstructed tracks. +* e.g. Those sharing many hits in common. +* +* Currently this is intended to run only on tracks found within a single (eta,phi) sector. +* It includes a naive algorithms from Ian (dupTrkAlg = 1) & more sophisticated ones from Ivan (dupTrkAlg > 1). +* The class is implemented inside L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc +* +* The template class "T" can be any class inheriting from L1trackBase. +* +* ------------------------------------------------------------------------------------------- +* GENERAL INFO ABOUT THE FILTER ALGORITHMS DEFINED IN THE CLASS. +* Some of these algorithms are designed to work on r-phi L1track2D tracks, and some on r-z +* L1track2D tracks. Others work on L1tracks3D. +* ------------------------------------------------------------------------------------------- +*/ + +namespace TMTT { + +class L1trackBase; +class L1track2D; +class L1track3D; +class L1fittedTrack; + +template class KillDupTrks { + +public: + + KillDupTrks() + { + // Check that classed used as template "T" inherits from class L1trackBase. + static_assert(std::is_base_of::value, "KillDupTrks ERROR: You instantiated this with a template class not inheriting from L1trackBase!"); + } + + ~KillDupTrks() {} + + /** + * Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. + */ + void init(const Settings* settings, unsigned int dupTrkAlg); + + /** + * Eliminate duplicate tracks from the input collection, and so return a reduced list of tracks. + */ + vector filter(const vector& vecTracks) const; + +private: + + /** + * Implementing "inverse" OSU algorithm, check for stubs in common, + * keep largest candidates if common stubs in N or more layers (default 5 at present), both if equal + * Implementing "inverse" OSU algorithm, check for stubs in common, + * keep largest candidates if common stubs in N or more layers (default 5 at present), both if equal + */ + vector filterAlg8(const vector& vecTracks) const; + + /** Implementing "inverse" OSU algorithm, check for layers in common, reverse order as per Luis's suggestion + * Comparison window of up to 6 + * Modified version of Algo23, looking for layers in common as in Algo8 + * Check if N or more common layers (default 5 at present) + * Then keep candidate with most stubs, use |q/pT| as tie-break, finally drop "latest" if still equal + */ +vector filterAlg25(const vector& vecTracks) const; + + /** + * Prints out a consistently formatted formatted report of killed duplicate track + */ + void printKill(unsigned alg, unsigned dup, unsigned cand, T dupTrack, T candTrack) const; + + /** + * Counts candidate layers with stubs in common + */ + unsigned int layerMatches(std::vector< std::pair >* iStubs, + std::vector< std::pair >* jStubs) const; +private: + + const Settings *settings_; // Configuration parameters. + + unsigned int dupTrkAlg_; // Specifies choice of algorithm for duplicate track removal. + unsigned int dupTrkMinCommonHitsLayers_; // Min no of matched stubs & layers to keep smaller cand +}; + +} +//=== Include file which implements all the functions in the above class. +#include "L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc" + +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc b/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc new file mode 100644 index 0000000000000..22a7697d9bcde --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc @@ -0,0 +1,335 @@ +namespace TMTT { + +// Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. +template +void KillDupTrks::init(const Settings* settings, unsigned int dupTrkAlg) +{ + settings_ = settings; + + dupTrkAlg_ = dupTrkAlg; + dupTrkMinCommonHitsLayers_ = settings->dupTrkMinCommonHitsLayers(); +} + +// Count layers with stubs in common +template +unsigned int KillDupTrks::layerMatches(std::vector< std::pair >* iStubs, + std::vector< std::pair >* jStubs) const +{ unsigned int match = 0; + unsigned int indxI = 0; + unsigned int indxJ = 0; + unsigned int lenI = iStubs->size(); + unsigned int lenJ = jStubs->size(); + + std::set layers; + + while ( (indxI < lenI) && (indxJ < lenJ) ) + { + // Stub indices match? + if (iStubs->at(indxI).first == jStubs->at(indxJ).first) + { + // Get layer for stub + unsigned int layer = iStubs->at(indxI).second; + + // Any match in this layer yet? + if (layers.insert(layer).second) + { + ++match; + } + + // Next stubs + ++indxI; + ++indxJ; + } + else + { + if (iStubs->at(indxI).first < jStubs->at(indxJ).first) + { + // In i, not j + ++indxI; + } + else + { + // In j, not i + ++indxJ; + } + } + } + return match; +} + + +// Eliminate duplicate tracks from the input collection, and so return a reduced list of tracks. +template +vector KillDupTrks::filter(const vector& vecTracks) const +{ + // Short-circuit the calculation for trivial cases + if (vecTracks.size() == 0 || vecTracks.size() == 1) + { + return vecTracks; + } + + // Choose which algorithm to run, based on parameter dupTrkAlg_. + switch (dupTrkAlg_) + { + // Do no filtering at all in the 0 case + case 0: return vecTracks; break; + case 8: return filterAlg8( vecTracks ); break; + case 25: return filterAlg25( vecTracks ); break; + default: throw cms::Exception("KillDupTrks: Option DupTrkAlg in cfg has invalid value."); + } + + // We should never end up here + return vecTracks; +} + +// Implementing "inverse" OSU algorithm, check for stubs in common, +// keep largest candidates if common stubs in N or more layers (default 5 at present), both if equal +// Implementing "inverse" OSU algorithm, check for stubs in common, +// keep largest candidates if common stubs in N or more layers (default 5 at present), both if equal + +template +vector KillDupTrks::filterAlg8(const vector& vecTracks) const +{ + vector vecTracksFiltered; + + // vector (corresponding to candidate tracks) of vectors (indices for stubs) + std::vector< std::vector< std::pair > > candList; + + for (const T& trk : vecTracks) + { + const vector< const Stub * > & stubs = trk.getStubs(); + std::vector< std::pair > stubList; + + for (const auto & myStub: stubs) + { + stubList.push_back( std::pair< unsigned int,unsigned int >( myStub->index(), myStub->layerId() ) ); + } + + // now necessary due to seed-filter disordering stubs + std::sort(stubList.begin(),stubList.end()); + + // make up vector of vectors + candList.push_back(stubList); + } + + std::vector< unsigned int > indices; // to avoid expense of manipulating candidate vector + + for (std::size_t i = 0; i < candList.size(); ++i) + { + indices.push_back(i); + } + + + unsigned int i = 0; + + // Loop through vector + while ( i < (candList.size() - 1) ) + { + unsigned int j = i + 1; + + // Check rest of candidates + while (j < candList.size() ) + { + + if (layerMatches(&(candList[i]), &(candList[j])) >= dupTrkMinCommonHitsLayers_) // Enough in common to keep one and kill the other + { + unsigned int qualI = vecTracks[ indices[i] ].getNumLayers(); + unsigned int qualJ = vecTracks[ indices[j] ].getNumLayers(); + + // Keep best "quality" + if (qualI < qualJ) + { + printKill(dupTrkAlg_, i, j, vecTracks[ indices[i] ], vecTracks[ indices[j] ]); + + candList.erase(candList.begin()+i); + indices.erase(indices.begin()+i); + + // To counter increment we don't want here + --i; + + // Out of j-while + break; + } + else + { + // Delete j if lower quality (or equal to remove duplicates!) + + printKill(dupTrkAlg_, j, i, vecTracks[ indices[j] ], vecTracks[ indices[i] ]); + + candList.erase(candList.begin()+j); + indices.erase(indices.begin()+j); + } + } + else + { + // Keep both, next candidate + ++j; + } + } + ++i; + } + + for (std::size_t i = 0; i < indices.size(); ++i) + { + vecTracksFiltered.push_back(vecTracks.at(indices[i])); // copy non-dupes to output + } + + return vecTracksFiltered; +} + + +// Implementing "inverse" OSU algorithm, check for layers in common, reverse order as per Luis's suggestion +// Comparison window of up to 6 +// Modified version of Algo23, looking for layers in common as in Algo8 +// Check if N or more common layers (default 5 at present) +// Then keep candidate with most stubs, use |q/pT| as tie-break, finally drop "latest" if still equal +template +vector KillDupTrks::filterAlg25(const vector& vecTracks) const +{ // vector (corresponding to candidate tracks) of vectors (indices for stubs) + std::vector< std::vector< std::pair > > candList; + + //std::cout<<"** Alg25 comparing "< & stubs = trk.getStubs(); + std::vector< std::pair > stubList; + + for (const auto & myStub: stubs) + { + stubList.push_back( std::pair< unsigned int,unsigned int >( myStub->index(), myStub->layerId() ) ); + } + + // now necessary due to seed-filter disordering stubs + std::sort(stubList.begin(),stubList.end()); + + // make up vector of vectors + candList.push_back(stubList); + } + + std::vector< bool > indices(candList.size(),true); // since we can't manipulate const candidate vector + + unsigned int i = 0; + + // Loop through vector + while ( i < candList.size() ) + { + unsigned int range = vecTracks[i].getNumStubs(); + + // Check rest of candidates + for (unsigned int j = 0; ji) { range += vecTracks[j].getNumStubs(); + if (range >= 51) break; + } + + if (layerMatches(&(candList[i]), &(candList[j])) >= dupTrkMinCommonHitsLayers_) // Enough in common + { unsigned int qualI = vecTracks[i].getNumLayers(); + unsigned int qualJ = vecTracks[j].getNumLayers(); + + if (j fabs(vecTracks[j].qOverPt())) + { printKill(dupTrkAlg_, i, j, vecTracks[i], vecTracks[j]); + //std::cout<<"a) "<i + { if (qualI < qualJ) // Drop one with fewer layers + { printKill(dupTrkAlg_, i, j, vecTracks[i], vecTracks[j]); + //std::cout<<"c) "<"<"<qualJ "<"<="<"< vecTracksFiltered; // Copy surviving candidates to output + for (unsigned int i=0; i +void KillDupTrks::printKill(unsigned int alg, unsigned int dup, unsigned int cand, T dupTrack, T candTrack) const +{ + // condition to print debug info from duplicate track removal code. + if (settings_->debug( ) == 5) + { + std::pair duploc = dupTrack.getCellLocationHT(); + std::pair canloc = candTrack.getCellLocationHT(); + + const TP *dupTP=dupTrack.getMatchedTP(), *candTP=candTrack.getMatchedTP(); + + int dupTPIndex = dupTP == nullptr ? -1 : dupTP->index(); + int candTPIndex = candTP == nullptr ? -1 : candTP->index(); + + bool dupUsed = false, candUsed = false; + + if ( dupTP != nullptr) { dupUsed = dupTP->useForAlgEff();} + if (candTP != nullptr) { candUsed = candTP->useForAlgEff();} + + std::cout + << "** Alg" << alg + << " erasing dupe " << dup << " (TP "<< dupTPIndex << " "<< dupUsed << ")" + << " at (" << duploc.first << "," << duploc.second << ")" + << " of cand " << cand << " (TP " << candTPIndex << " " << candUsed << ")" + << " at (" << canloc.first << "," << canloc.second << ")" + << " deltas " << int(duploc.first) - int(canloc.first) << " " << int(duploc.second) - int(canloc.second) + << std::endl; + } +} + +// I thought these three lines would allow the class implementation to be inside KillDupTrks.cc instead of in KillDupTrks.icc, but seems not to work ... +//template class KillDupTrks; +//template class KillDupTrks; +//template class KillDupTrks; + +} diff --git a/L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h b/L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h new file mode 100644 index 0000000000000..5f04f3bdf5713 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h @@ -0,0 +1,62 @@ +///=== This is the base class for the linearised chi-squared track fit algorithms. + +///=== Written by: Sioni Summers and Alexander D. Morton + +#ifndef __L1_CHI_SQUARED__ +#define __L1_CHI_SQUARED__ + +#include "L1Trigger/TrackFindingTMTT/interface/Matrix.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" +#include +#include +#include + + namespace TMTT { + + +class L1ChiSquared : public TrackFitGeneric{ +public: + L1ChiSquared(const Settings* settings, const uint nPar); + + virtual ~L1ChiSquared(){} + + L1fittedTrack fit(const L1track3D& l1track3D); + +protected: + /* Methods */ + virtual std::vector seed(const L1track3D& l1track3D)=0; + virtual std::vector residuals(std::vector x)=0; + virtual Matrix D(std::vector x)=0; // derivatives + virtual Matrix Vinv()=0; // Covariances + virtual std::map convertParams(std::vector x)=0; + + /* Variables */ + std::vector stubs_; + std::map trackParams_; + uint nPar_; + float largestresid_; + int ilargestresid_; + double chiSq_; + +private: + + void calculateChiSq( std::vector resids ); + void calculateDeltaChiSq( std::vector deltaX, std::vector covX ); + + int numFittingIterations_; + int killTrackFitWorstHit_; + double generalResidualCut_; + double killingResidualCut_; + + unsigned int minStubLayers_; + unsigned int minStubLayersRed_; +}; + +} + +#endif + + diff --git a/L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h b/L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h new file mode 100644 index 0000000000000..f9ca23561067e --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h @@ -0,0 +1,180 @@ +///=== This is the base class for the Kalman Combinatorial Filter track fit algorithm. + +#ifndef __L1_KALMAN_COMB__ +#define __L1_KALMAN_COMB__ + +#include +#include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" +#include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" +#include +#include +#include +#include + +class TH1F; +class TH2F; + +namespace TMTT { + +class TP; +class KalmanState; +class StubCluster; + +class L1KalmanComb : public TrackFitGeneric{ + + public: + enum OVERLAP_TYPE { TYPE_NORMAL, TYPE_V2, TYPE_NOCLUSTERING, TYPE_TP }; + public: + L1KalmanComb(const Settings* settings, const uint nPar, const string &fitterName="", const uint nMeas=2 ); + + virtual ~L1KalmanComb() { this->resetStates(); this->deleteStubClusters();} + + L1fittedTrack fit(const L1track3D& l1track3D); + void bookHists(); + + protected: + static std::map getTrackParams( const L1KalmanComb *p, const KalmanState *state ); + virtual std::map getTrackParams( const KalmanState *state ) const=0; + + // Get track params with beam-spot constraint & chi2 (r-phi) after applying it.. + virtual std::map getTrackParams_BeamConstr( const KalmanState *state, double& chi2rphi_bcon) const { + chi2rphi_bcon = 0.0; + return (this->getTrackParams(state)); // Returns unconstrained result, unless derived class overrides it. + } + + double sectorPhi()const + { + float phiCentreSec0 = -M_PI/float(getSettings()->numPhiNonants()) + M_PI/float(getSettings()->numPhiSectors()); + return 2.*M_PI * float(iCurrentPhiSec_) / float(getSettings()->numPhiSectors()) + phiCentreSec0; + } + //bool kalmanUpdate( const StubCluster *stubCluster, KalmanState &state, KalmanState &new_state, const TP *tpa ); + virtual const KalmanState *kalmanUpdate( unsigned skipped, unsigned layer, const StubCluster* stubCluster, const KalmanState &state, const TP *); + void resetStates(); + void deleteStubClusters(); + const KalmanState *mkState( const L1track3D &candidate, unsigned skipped, unsigned layer, unsigned layerId, const KalmanState *last_state, + const std::vector &x, const TMatrixD &pxx, const TMatrixD &K, const TMatrixD &dcov, const StubCluster* stubCluster, double chi2rphi, double chi2rz ); + + protected: + /* Methods */ + std::vector Hx( const TMatrixD &pH, const std::vector &x )const; + std::vector Fx( const TMatrixD &pF, const std::vector &x )const; + TMatrixD HxxH( const TMatrixD &pH, const TMatrixD &xx )const; + void getDeltaChi2( const TMatrixD &dcov, const std::vector &delta, bool debug, + double& deltaChi2rphi, double& deltaChi2rz )const; + TMatrixD GetKalmanMatrix( const TMatrixD &h, const TMatrixD &pxcov, const TMatrixD &dcov )const; + void GetAdjustedState( const TMatrixD &K, const TMatrixD &pxcov, + const std::vector &x, const StubCluster *stubCluster, const std::vector& delta, + std::vector &new_x, TMatrixD &new_xcov )const; + + + virtual std::vector seedx(const L1track3D& l1track3D)const=0; + virtual TMatrixD seedP(const L1track3D& l1track3D)const=0; + virtual void barrelToEndcap( double r, const StubCluster *stubCluster, std::vector &x, TMatrixD &cov_x )const{} + virtual std::vector d(const StubCluster* stubCluster )const=0; + virtual TMatrixD H(const StubCluster* stubCluster)const=0; + virtual TMatrixD F(const StubCluster* stubCluster=0, const KalmanState *state=0 )const=0; + virtual TMatrixD PxxModel( const KalmanState *state, const StubCluster *stubCluster )const=0; + virtual TMatrixD PddMeas(const StubCluster* stubCluster, const KalmanState *state )const=0; + + virtual std::vector residual(const StubCluster* stubCluster, const std::vector &x, double candQoverPt )const; + virtual const KalmanState *updateSeedWithStub( const KalmanState &state, const StubCluster *stubCluster ){ return 0; } + virtual bool isGoodState( const KalmanState &state )const{ return true; } + + virtual void calcChi2( const KalmanState &state, double& chi2rphi, double& chi2rz ) const; + + virtual double getRofState( unsigned layerId, const vector &xa )const{ return 0;} + virtual unsigned int getKalmanLayer(unsigned int iEtaReg, unsigned int layerIDreduced, bool barrel)const; + + std::vector doKF( const L1track3D &l1track3D, const std::vector &stubClusters, const TP *tpa ); + + void printTPSummary( std::ostream &os, const TP *tp, bool addReturn=true ) const; + void printTP( std::ostream &os, const TP *tp ) const; + void printStubLayers( std::ostream &os, std::vector &stubs ) const; + void printStubCluster( std::ostream &os, const StubCluster * stubCluster, bool addReturn=true ) const; + void printStubClusters( std::ostream &os, std::vector &stubClusters ) const; + void printStub( std::ostream &os, const Stub * stub, bool addReturn=true ) const; + void printStubs( std::ostream &os, std::vector &stubs ) const; + + void fillSeedHists( const KalmanState *state, const TP *tpa ); + void fillCandHists( const KalmanState &state, const TP *tpa=0 ); + void fillStepHists( const TP *tpa, unsigned nItr, const KalmanState *new_state ); + + double DeltaRphiForClustering( unsigned layerId, unsigned endcapRing ); + double DeltaRForClustering( unsigned endcapRing ); + bool isOverlap( const Stub* a, const Stub*b, OVERLAP_TYPE type ); + + set getKalmanDeadLayers( bool& remove2PSCut ) const; + + // Function to calculate approximation for tilted barrel modules (aka B) copied from Stub class. + float getApproxB(float z, float r) const; + + // Is this HLS code? + virtual bool isHLS() {return false;}; + + protected: + unsigned nPar_; + unsigned nMeas_; + unsigned numEtaRegions_; + + std::vector state_list_; + std::vector stbcl_list_; + + std::vector hxaxtmin; + std::vector hxaxtmax; + std::vector hxmin; + std::vector hxmax; + std::vector hymin; + std::vector hymax; + std::vector hdxmin; + std::vector hdxmax; + std::vector hresmin; + std::vector hresmax; + std::vector hddMeasmin; + std::vector hddMeasmax; + + TH1F * hTrackEta_; + TH1F * hUniqueTrackEta_; + std::map hBarrelStubMaxDistanceMap; + std::map hEndcapStubMaxDistanceMap; + std::map hphiErrorRatioMap; + std::map hstubCombMap; + + TH1F* hndupStub_; + TH1F* hnmergeStub_; + std::map hytMap; + std::map hy0Map; + std::map hyfMap; + std::map hxMap; + std::map hxcovMap; + std::map hkMap; + std::map hresMap; + std::map hmcovMap; + + double hchi2min; + double hchi2max; + + unsigned maxNfitForDump_; + bool dump_; + unsigned int iCurrentPhiSec_; + unsigned int iCurrentEtaReg_; + unsigned int iLastPhiSec_; + unsigned int iLastEtaReg_; + + unsigned int minStubLayersRed_; + + unsigned int numUpdateCalls_; + + const TP* tpa_; +}; + +} + +#endif + + + + diff --git a/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h b/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h new file mode 100644 index 0000000000000..8c4286f77b01c --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h @@ -0,0 +1,343 @@ +#ifndef __L1fittedTrack_H__ +#define __L1fittedTrack_H__ + +#include "FWCore/Utilities/interface/Exception.h" +#include "DataFormats/Math/interface/deltaPhi.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1trackBase.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/Utility.h" +#include "L1Trigger/TrackFindingTMTT/interface/TP.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/Sector.h" +#include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h" +#include "L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h" +#include "L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h" + +#include +#include +#include +#include + +using namespace std; + +//=== This represents a fitted L1 track candidate found in 3 dimensions. +//=== It gives access to the fitted helix parameters & chi2 etc. +//=== It also calculates & gives access to associated truth particle (Tracking Particle) if any. +//=== It also gives access to the 3D hough-transform track candidate (L1track3D) on which the fit was run. + +namespace TMTT { + +class L1fittedTrack : public L1trackBase { + +public: + + // Store a new fitted track, specifying the input Hough transform track, the stubs used for the fit, + // bit-encoded hit layer pattern (numbered by increasing distance from origin), + // the fitted helix parameters & chi2, + // and the number of helix parameters being fitted (=5 if d0 is fitted, or =4 if d0 is not fitted). + // And if track fit declared this to be a valid track (enough stubs left on track after fit etc.). + L1fittedTrack(const Settings* settings, const L1track3D& l1track3D, const vector& stubs, + unsigned int hitPattern, + float qOverPt, float d0, float phi0, float z0, float tanLambda, + float chi2rphi, float chi2rz, unsigned int nHelixParam, bool accepted = true) : + L1trackBase(), + settings_(settings), + l1track3D_(l1track3D), stubs_(stubs), hitPattern_(hitPattern), + qOverPt_(qOverPt), d0_(d0), phi0_(phi0), z0_(z0), tanLambda_(tanLambda), + chi2rphi_(chi2rphi), chi2rz_(chi2rz), + done_bcon_(false), qOverPt_bcon_(qOverPt), d0_bcon_(d0), phi0_bcon_(phi0), chi2rphi_bcon_(chi2rphi), + nHelixParam_(nHelixParam), + iPhiSec_(l1track3D.iPhiSec()), iEtaReg_(l1track3D.iEtaReg()), + optoLinkID_(l1track3D.optoLinkID()), accepted_(accepted), + nSkippedLayers_(0), numUpdateCalls_(0), numIterations_(0), + digitizedTrack_(false), digitalTrack_(settings) + { + // Doesn't make sense to assign stubs to track if fitter rejected it. + if (! accepted) stubs_.clear(); + nLayers_ = Utility::countLayers(settings, stubs); // Count tracker layers these stubs are in + matchedTP_ = Utility::matchingTP(settings, stubs, nMatchedLayers_, matchedStubs_); // Find associated truth particle & calculate info about match. + // Set d0 = 0 for 4 param fit, in case fitter didn't do it. + if (nHelixParam == 4) { + d0_ = 0.; + d0_bcon_ = 0.; + } + if (! settings->hybrid()) { + secTmp_.init(settings, iPhiSec_, iEtaReg_); //Sector class used to check if fitted track trajectory is in expected sector. + htRphiTmp_.init(settings, iPhiSec_, iEtaReg_, secTmp_.etaMin(), secTmp_.etaMax(), secTmp_.phiCentre()); // HT class used to identify HT cell that corresponds to fitted helix parameters. + } + this->setConsistentHTcell(); + } + + L1fittedTrack() : L1trackBase() {}; // Creates track object, but doesn't set any variables. + + ~L1fittedTrack() {} + + //--- Optionally set track helix params & chi2 if beam-spot constraint is used (for 5-parameter fit). + void setBeamConstr(float qOverPt_bcon, float phi0_bcon, float chi2rphi_bcon) { + done_bcon_ = true; qOverPt_bcon_ = qOverPt_bcon; d0_bcon_ = 0.0, phi0_bcon_ = phi0_bcon; chi2rphi_bcon_ = chi2rphi_bcon; + } + + //--- Set/get additional info about fitted track that is specific to individual track fit algorithms (KF, LR, chi2) + //--- and is used for debugging/histogramming purposes. + + void setInfoKF( unsigned int nSkippedLayers, unsigned int numUpdateCalls ) { + nSkippedLayers_ = nSkippedLayers; + numUpdateCalls_ = numUpdateCalls; + } + void setInfoKF( unsigned int nSkippedLayers, unsigned int numUpdateCalls, bool consistentHLS ) { + this->setInfoKF(nSkippedLayers_, numUpdateCalls_); + // consistentCell_ = consistentHLS; // KF HLS code no longer calculates HT cell consistency. + } + void setInfoLR( int numIterations, std::string lostMatchingState, std::unordered_map< std::string, int > stateCalls ) { + numIterations_ = numIterations; lostMatchingState_ = lostMatchingState; stateCalls_ = stateCalls; + } + void setInfoCHI2() {} + + void getInfoKF( unsigned int& nSkippedLayers, unsigned int& numUpdateCalls ) const { + nSkippedLayers = nSkippedLayers_; + numUpdateCalls = numUpdateCalls_; + } + void getInfoLR( int& numIterations, std::string& lostMatchingState, std::unordered_map< std::string, int >& stateCalls ) const { + numIterations = numIterations_; lostMatchingState = lostMatchingState_; stateCalls = stateCalls_; + } + void getInfoCHI2() const {} + + //--- Convert fitted track to KFTrackletTrack format, for use with HYBRID. + + KFTrackletTrack returnKFTrackletTrack(){ + KFTrackletTrack trk_(getL1track3D(), getStubs(), getHitPattern(), qOverPt(), d0(), phi0(), z0(), tanLambda(), + chi2rphi(), chi2rz(), nHelixParam(), iPhiSec(), iEtaReg(), accepted()); + return trk_; + } + + + //--- Get the 3D Hough transform track candididate corresponding to the fitted track, + //--- Provide direct access to some of the info it contains. + + // Get track candidate from HT (before fit). + const L1track3D& getL1track3D() const {return l1track3D_;} + + // Get stubs on fitted track (can differ from those on HT track if track fit kicked out stubs with bad residuals) + const vector& getStubs() const {return stubs_;} + // Get number of stubs on fitted track. + unsigned int getNumStubs() const {return stubs_.size();} + // Get number of tracker layers these stubs are in. + unsigned int getNumLayers() const {return nLayers_;} + // Get number of stubs deleted from track candidate by fitter (because they had large residuals) + unsigned int getNumKilledStubs() const {return l1track3D_.getNumStubs() - this->getNumStubs();} + // Get bit-encoded hit pattern (where layer number assigned by increasing distance from origin, according to layers track expected to cross). + unsigned int getHitPattern() const {return hitPattern_;} + + // Get Hough transform cell locations in units of bin number, corresponding to the fitted helix parameters of the track. + // Always uses the beam-spot constrained helix params if they are available. + // (If fitted track is outside HT array, it it put in the closest bin inside it). + pair getCellLocationFit() const {return htRphiTmp_.getCell(this);} + // Also get HT cell determined by Hough transform. + pair getCellLocationHT() const {return l1track3D_.getCellLocationHT();} + + //--- Get information about its association (if any) to a truth Tracking Particle. + //--- Can differ from that of corresponding HT track, if track fit kicked out stubs with bad residuals. + + // Get best matching tracking particle (=nullptr if none). + const TP* getMatchedTP() const {return matchedTP_;} + // Get the matched stubs with this Tracking Particle + const vector& getMatchedStubs() const {return matchedStubs_;} + // Get number of matched stubs with this Tracking Particle + unsigned int getNumMatchedStubs() const {return matchedStubs_.size();} + // Get number of tracker layers with matched stubs with this Tracking Particle + unsigned int getNumMatchedLayers() const {return nMatchedLayers_;} + // Get purity of stubs on track (i.e. fraction matching best Tracking Particle) + float getPurity() const {return getNumMatchedStubs()/float(getNumStubs());} + // Get number of stubs matched to correct TP that were deleted from track candidate by fitter. + unsigned int getNumKilledMatchedStubs() const { + unsigned int nStubCount = l1track3D_.getNumMatchedStubs(); + if (nStubCount > 0) { // Original HT track candidate did match a truth particle + const TP* tp = l1track3D_.getMatchedTP(); + for (const Stub* s : stubs_) { + set assTPs = s->assocTPs(); + if (assTPs.find(tp) != assTPs.end()) nStubCount--; // We found a stub matched to original truth particle that survived fit. + } + } + return nStubCount; + } + + //--- Get the fitted track helix parameters. + + float qOverPt() const {return qOverPt_;} + float charge() const {return (qOverPt_ > 0 ? 1 : -1);} + float invPt() const {return fabs(qOverPt_);} + float pt() const {return 1./(1.0e-6 + this->invPt());} // includes protection against 1/pt = 0. + float d0() const {return d0_;} + float phi0() const {return phi0_;} + float z0() const {return z0_;} + float tanLambda() const {return tanLambda_;} + float theta() const {return atan2(1., tanLambda_);} // Use atan2 to ensure 0 < theta < pi. + float eta() const {return -log(tan(0.5*this->theta()));} + + //--- Get the fitted helix parameters with beam-spot constraint. + //--- If constraint not applied (e.g. 4 param fit) then these are identical to unconstrained values. + + bool done_bcon() const {return done_bcon_;} // Was beam-spot constraint aplied? + float qOverPt_bcon() const {return qOverPt_bcon_;} + float charge_bcon() const {return (qOverPt_bcon_ > 0 ? 1 : -1);} + float invPt_bcon() const {return fabs(qOverPt_bcon_);} + float pt_bcon() const {return 1./(1.0e-6 + this->invPt_bcon());} + float phi0_bcon() const {return phi0_bcon_;} + + // Phi and z coordinates at which track crosses "chosenR" values used by r-phi HT and rapidity sectors respectively. + // (Optionally with beam-spot constraint applied). + float phiAtChosenR(bool beamConstraint) const { + if (beamConstraint) { + return reco::deltaPhi(phi0_bcon_ - ((settings_->invPtToDphi() * settings_->chosenRofPhi()) * qOverPt_bcon_) - d0_bcon_/(settings_->chosenRofPhi()), 0.); + } else { + return reco::deltaPhi(phi0_ - ((settings_->invPtToDphi() * settings_->chosenRofPhi()) * qOverPt_) - d0_/(settings_->chosenRofPhi()), 0.); + } + } + float zAtChosenR() const {return (z0_ + (settings_->chosenRofZ()) * tanLambda_);} // neglects transverse impact parameter & track curvature. + + // Get the number of helix parameters being fitted (=5 if d0 is fitted or =4 if d0 is not fitted). + float nHelixParam() const {return nHelixParam_;} + + // Get the fit degrees of freedom, chi2 & chi2/DOF (also in r-phi & r-z planes). + unsigned int numDOF() const {return 2*this->getNumStubs() - nHelixParam_;} + unsigned int numDOFrphi() const {return this->getNumStubs() - (nHelixParam_ - 2);} + unsigned int numDOFrz( ) const {return this->getNumStubs() - 2;} + float chi2rphi() const {return chi2rphi_;} + float chi2rz() const {return chi2rz_;} + float chi2() const {return chi2rphi_ + chi2rz_;} + float chi2dof() const {return (this->chi2())/this->numDOF();} + + //--- Ditto, but if beam-spot constraint is applied. + //--- If constraint not applied (e.g. 4 param fit) then these are identical to unconstrained values. + unsigned int numDOF_bcon() const {return (this->numDOF() - 1);} + unsigned int numDOFrphi_bcon() const {return (this->numDOFrphi() - 1);} + float chi2rphi_bcon() const {return chi2rphi_bcon_;} + float chi2_bcon() const {return chi2rphi_bcon_ + chi2rz_;} + float chi2dof_bcon() const {return (this->chi2_bcon())/this->numDOF_bcon();} + + //--- Get phi sector and eta region used by track finding code that this track is in. + unsigned int iPhiSec() const {return iPhiSec_;} + unsigned int iEtaReg() const {return iEtaReg_;} + + //--- Opto-link ID used to send this track from HT to Track Fitter + unsigned int optoLinkID() const {return optoLinkID_;} + + //--- Get whether the track has been rejected or accepted by the fit + + bool accepted() const { + return accepted_; + } + + // Comparitor useful for sorting tracks by q/Pt using std::sort(). + static bool qOverPtSortPredicate(const L1fittedTrack& t1, const L1fittedTrack t2) { return t1.qOverPt() < t2.qOverPt(); } + + //--- Functions to help eliminate duplicate tracks. + + // Is the fitted track trajectory should lie within the same HT cell in which the track was originally found? + bool consistentHTcell() const {return consistentCell_;} + + // Determine if the fitted track trajectory should lie within the same HT cell in which the track was originally found? + void setConsistentHTcell() { + //return (max(fabs(this->deltaM()), fabs(this->deltaC())) < 0.5); + // Use helix params with beam-spot constaint if done in case of 5 param fit. + + pair htCell = this->getCellLocationHT(); + bool consistent = (htCell == this->getCellLocationFit()); + + if (l1track3D_.mergedHTcell()) { + // If this is a merged cell, check other elements of merged cell. + pair htCell10( htCell.first + 1, htCell.second); + pair htCell01( htCell.first , htCell.second + 1); + pair htCell11( htCell.first + 1, htCell.second + 1); + if (htCell10 == this->getCellLocationFit()) consistent = true; + if (htCell01 == this->getCellLocationFit()) consistent = true; + if (htCell11 == this->getCellLocationFit()) consistent = true; + } + + consistentCell_ = consistent; + } + + // Is the fitted track trajectory within the same (eta,phi) sector of the HT used to find it? + bool consistentSector() const { + bool insidePhi = (fabs(reco::deltaPhi(this->phiAtChosenR(done_bcon_), secTmp_.phiCentre())) < secTmp_.sectorHalfWidth()); + bool insideEta = (this->zAtChosenR() > secTmp_.zAtChosenR_Min() && this->zAtChosenR() < secTmp_.zAtChosenR_Max()); + return (insidePhi && insideEta); + } + + // Digitize track and degrade helix parameter resolution according to effect of digitisation. + void digitizeTrack(const string& fitterName); + + // Access to detailed info about digitized track + const DigitalTrack& digitaltrack() const { return digitalTrack_;} + +private: + + //--- Configuration parameters + const Settings* settings_; + + //--- The 3D hough-transform track candidate which was fitted. + L1track3D l1track3D_; + + //--- The stubs on the fitted track (can differ from those on HT track if fit kicked off stubs with bad residuals) + vector stubs_; + unsigned int nLayers_; + + //--- Bit-encoded hit pattern (where layer number assigned by increasing distance from origin, according to layers track expected to cross). + unsigned int hitPattern_; + + //--- The fitted helix parameters and fit chi-squared. + float qOverPt_; + float d0_; + float phi0_; + float z0_; + float tanLambda_; + float chi2rphi_; + float chi2rz_; + + //--- Ditto with beam-spot constraint applied in case of 5-parameter fit, plus boolean to indicate + bool done_bcon_; + float qOverPt_bcon_; + float d0_bcon_; + float phi0_bcon_; + float chi2rphi_bcon_; + + //--- The number of helix parameters being fitted (=5 if d0 is fitted or =4 if d0 is not fitted). + unsigned int nHelixParam_; + + //--- Phi sector and eta region used track finding code that this track was in. + unsigned int iPhiSec_; + unsigned int iEtaReg_; + //--- Opto-link ID from HT to Track Fitter. + unsigned int optoLinkID_; + + //--- Information about its association (if any) to a truth Tracking Particle. + const TP* matchedTP_; + vector matchedStubs_; + unsigned int nMatchedLayers_; + + //--- Has the track fit declared this to be a valid track? + bool accepted_; + + //--- Sector class used to check if fitted track trajectory is in same sector as HT used to find it. + Sector secTmp_; + //--- r-phi HT class used to determine HT cell location that corresponds to fitted track helix parameters. + HTrphi htRphiTmp_; + + //--- Info specific to KF fitter. + unsigned int nSkippedLayers_; + unsigned int numUpdateCalls_; + //--- Info specific to LR fitter. + int numIterations_; + std::string lostMatchingState_; + std::unordered_map< std::string, int > stateCalls_; + + bool digitizedTrack_; + DigitalTrack digitalTrack_; // Class used to digitize track if required. + + bool consistentCell_; +}; + +} + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/L1track2D.h b/L1Trigger/TrackFindingTMTT/interface/L1track2D.h new file mode 100644 index 0000000000000..57711e4829290 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/L1track2D.h @@ -0,0 +1,130 @@ +#ifndef __L1track2D_H__ +#define __L1track2D_H__ + +#include "FWCore/Utilities/interface/Exception.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1trackBase.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/Utility.h" +#include "L1Trigger/TrackFindingTMTT/interface/TP.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" + +#include +#include + +using namespace std; + +//=== L1 track cand found in 2 dimensions. +//=== Gives access to all stubs on track and to its 2D helix parameters. +//=== Also calculates & gives access to associated truth particle (Tracking Particle) if any. + +namespace TMTT { + +class L1track2D : public L1trackBase { + +public: + + // Give stubs on track, its cell location inside HT array, its 2D helix parameters. + L1track2D(const Settings* settings, const vector& stubs, + pair cellLocationHT, pair helix2D, + unsigned int iPhiSec, unsigned int iEtaReg, unsigned int optoLinkID, bool mergedHTcell) : + L1trackBase(), + settings_(settings), + stubs_(stubs), + cellLocationHT_(cellLocationHT), + helix2D_(helix2D), + estValid_(false), estZ0_(0.), estTanLambda_(0.), + iPhiSec_(iPhiSec), iEtaReg_(iEtaReg), optoLinkID_(optoLinkID), mergedHTcell_(mergedHTcell) + { + nLayers_ = Utility::countLayers(settings, stubs); // Count tracker layers these stubs are in + matchedTP_ = Utility::matchingTP(settings, stubs, nMatchedLayers_, matchedStubs_); // Find associated truth particle & calculate info about match. + } + + L1track2D() : L1trackBase() {}; // Creates track object, but doesn't set any variables. + + ~L1track2D() {} + + //--- Get information about the reconstructed track. + + // Get stubs on track candidate. + const vector& getStubs() const {return stubs_;} + // Get number of stubs on track candidate. + unsigned int getNumStubs() const {return stubs_.size();} + // Get number of tracker layers these stubs are in. + unsigned int getNumLayers() const {return nLayers_;} + // Get cell location of track candidate in Hough Transform array in units of bin number. + pair getCellLocationHT() const {return cellLocationHT_;} + // The two conventionally agreed track helix parameters relevant in this 2D plane. + // i.e. (q/Pt, phi0). + pair getHelix2D() const {return helix2D_;} + + //--- User-friendlier access to the helix parameters obtained from track location inside HT array. + + float qOverPt() const {return helix2D_.first;} + float phi0() const {return helix2D_.second;} + + //--- In the case of tracks found by the r-phi HT, a rough estimate of the (z0, tan_lambda) may be provided by any r-z + //--- track filter run after the r-phi HT. These two functions give set/get access to these. + //--- The "get" function returns a boolean indicating if an estimate exists (i.e. "set" has been called). + + void setTrkEstZ0andTanLam(float estZ0, float estTanLambda) { + estZ0_ = estZ0; estTanLambda_ = estTanLambda; estValid_ = true; + } + + bool getTrkEstZ0andTanLam(float& estZ0, float& estTanLambda) const { + estZ0 = estZ0_; estTanLambda = estTanLambda_; return estValid_; + } + + //--- Get phi sector and eta region used by track finding code that this track is in. + unsigned int iPhiSec() const {return iPhiSec_;} + unsigned int iEtaReg() const {return iEtaReg_;} + + //--- Opto-link ID used to send this track from HT to Track Fitter. Both read & write functions. + unsigned int optoLinkID() const {return optoLinkID_;} + void setOptoLinkID(unsigned int linkID) {optoLinkID_ = linkID;} + + + //--- Was this track produced from a marged HT cell (e.g. 2x2)? + bool mergedHTcell() const {return mergedHTcell_;} + + //--- Get information about its association (if any) to a truth Tracking Particle. + + // Get matching tracking particle (=nullptr if none). + const TP* getMatchedTP() const {return matchedTP_;} + // Get the matched stubs. + const vector& getMatchedStubs() const {return matchedStubs_;} + // Get number of matched stubs. + unsigned int getNumMatchedStubs() const {return matchedStubs_.size();} + // Get number of tracker layers with matched stubs. + unsigned int getNumMatchedLayers() const {return nMatchedLayers_;} + +private: + + //--- Configuration parameters + const Settings* settings_; + + //--- Information about the reconstructed track from Hough transform. + vector stubs_; + unsigned int nLayers_; + pair cellLocationHT_; + pair helix2D_; + + //--- Rough estimate of r-z track parameters from r-z filter, which may be present in case of r-phi Hough transform + bool estValid_; + float estZ0_; + float estTanLambda_; + + unsigned int iPhiSec_; + unsigned int iEtaReg_; + unsigned int optoLinkID_; + + bool mergedHTcell_; + + //--- Information about its association (if any) to a truth Tracking Particle. + const TP* matchedTP_; + vector matchedStubs_; + unsigned int nMatchedLayers_; +}; + +} + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/L1track3D.h b/L1Trigger/TrackFindingTMTT/interface/L1track3D.h new file mode 100644 index 0000000000000..f627bc08e2203 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/L1track3D.h @@ -0,0 +1,245 @@ +#ifndef __L1track3D_H__ +#define __L1track3D_H__ + +#include "DataFormats/Math/interface/deltaPhi.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1trackBase.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/Utility.h" +#include "L1Trigger/TrackFindingTMTT/interface/TP.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/Sector.h" +#include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h" + +#include +#include +#include +#include + +using namespace std; + +//=== L1 track candidate found in 3 dimensions. +//=== Gives access to all stubs on track and to its 3D helix parameters. +//=== Also calculates & gives access to associated truth particle (Tracking Particle) if any. + +namespace TMTT { + +class L1track3D : public L1trackBase { + +public: + + L1track3D(const Settings* settings, const vector& stubs, + pair cellLocationHT, pair helixRphi, pair helixRz, float helixD0, + unsigned int iPhiSec, unsigned int iEtaReg, unsigned int optoLinkID, bool mergedHTcell) : + L1trackBase(), + settings_(settings), + stubs_(stubs), + cellLocationHT_(cellLocationHT), helixRphi_(helixRphi), helixRz_ (helixRz), helixD0_(helixD0), + iPhiSec_(iPhiSec), iEtaReg_(iEtaReg), optoLinkID_(optoLinkID), mergedHTcell_(mergedHTcell), + seedLayerType_(999), seedPS_(999) + { + nLayers_ = Utility::countLayers(settings, stubs); // Count tracker layers these stubs are in + matchedTP_ = Utility::matchingTP(settings, stubs, nMatchedLayers_, matchedStubs_); // Find associated truth particle & calculate info about match. + } + + L1track3D(const Settings* settings, const vector& stubs, + pair cellLocationHT, pair helixRphi, pair helixRz, + unsigned int iPhiSec, unsigned int iEtaReg, unsigned int optoLinkID, bool mergedHTcell) : + L1track3D(settings, stubs, cellLocationHT, helixRphi, helixRz, 0.0, iPhiSec, iEtaReg, optoLinkID, mergedHTcell){} + + L1track3D() : L1trackBase() {}; // Creates track object, but doesn't set any variables. + + ~L1track3D() {} + + //--- Set/get optional info for tracklet tracks. + + // Tracklet seeding layer pair (from FPGATracklet::seedIndex()) + // 0-7 = "L1L2","L2L3","L3L4","L5L6","D1D2","D3D4","L1D1","L2D1" + void setSeedLayerType(unsigned int seedLayerType) {seedLayerType_ = seedLayerType;} + unsigned int seedLayerType() const {return seedLayerType_;} + + // Tracklet seed stub pair uses PS modules (from FPGATracket::PSseed()) + void setSeedPS(unsigned int seedPS) {seedPS_ = seedPS;} + unsigned int seedPS() const {return seedPS_;} + + // Best stub (stub with smallest Phi residual in each layer/disk) + void setBestStubs(std::unordered_set bestStubs) {bestStubs_ = bestStubs;} + std::unordered_set bestStubs() const {return bestStubs_;} + + //--- Get information about the reconstructed track. + + // Get stubs on track candidate. + const vector& getStubs() const {return stubs_;} + // Get number of stubs on track candidate. + unsigned int getNumStubs() const {return stubs_.size();} + // Get number of tracker layers these stubs are in. + unsigned int getNumLayers() const {return nLayers_;} + // Get cell location of track candidate in r-phi Hough Transform array in units of bin number. + pair getCellLocationHT() const {return cellLocationHT_;} + // The two conventionally agreed track helix parameters relevant in r-phi plane. i.e. (q/Pt, phi0) + pair getHelixRphi() const {return helixRphi_;} + // The two conventionally agreed track helix parameters relevant in r-z plane. i.e. (z0, tan_lambda) + pair getHelixRz() const {return helixRz_;} + + //--- Return chi variables, (both digitized & undigitized), which are the stub coords. relative to track. + + vector getChiPhi() { + vector result; + for (const Stub* s: stubs_) { + float chi_phi = reco::deltaPhi(s->phi(), this->phi0() - s->r() * this->qOverPt() * settings_->invPtToDphi()); + result.push_back(chi_phi); + } + return result; + } + + vector getChiPhiDigi() { + vector result; + static const float phiMult = pow(2, settings_->phiSBits()) / settings_->phiSRange(); + for (const float& chi_phi: this->getChiPhi()) { + int iDigi_chi_phi = floor(chi_phi * phiMult); + result.push_back(iDigi_chi_phi); + } + return result; + } + + vector getChiZ() { + vector result; + for (const Stub* s: stubs_) { + float chi_z = s->z() - (this->z0() + s->r()*this->tanLambda()); + result.push_back(chi_z); + } + return result; + } + + vector getChiZDigi() { + vector result; + static const float zMult = pow(2, settings_->zBits()) / settings_->zRange(); + for (const float& chi_z: this->getChiZ()) { + int iDigi_chi_z = floor(chi_z * zMult); + result.push_back(iDigi_chi_z); + } + return result; + } + + //--- User-friendlier access to the helix parameters. + + float qOverPt() const {return helixRphi_.first;} + float charge() const {return (this->qOverPt() > 0 ? 1 : -1);} + float invPt() const {return fabs(this->qOverPt());} + float pt() const {return 1./(1.0e-6 + this->invPt());} // includes protection against 1/pt = 0. + float d0() const {return helixD0_;} // Hough transform assumes d0 = 0. + float phi0() const {return helixRphi_.second;} + float z0() const {return helixRz_.first;} + float tanLambda() const {return helixRz_.second;} + float theta() const {return atan2(1., this->tanLambda());} // Use atan2 to ensure 0 < theta < pi. + float eta() const {return -log(tan(0.5*this->theta()));} + + // Phi and z coordinates at which track crosses "chosenR" values used by r-phi HT and rapidity sectors respectively. + float phiAtChosenR() const {return reco::deltaPhi(this->phi0() - (settings_->invPtToDphi() * settings_->chosenRofPhi()) * this->qOverPt(), 0.);} + float zAtChosenR() const {return (this->z0() + (settings_->chosenRofZ()) * this->tanLambda());} // neglects transverse impact parameter & track curvature. + + //--- Get phi sector and eta region used by track finding code that this track is in. + unsigned int iPhiSec() const {return iPhiSec_;} + unsigned int iEtaReg() const {return iEtaReg_;} + + //--- Opto-link ID used to send this track from HT to Track Fitter + unsigned int optoLinkID() const {return optoLinkID_;} + + //--- Was this track produced from a marged HT cell (e.g. 2x2)? + bool mergedHTcell() const {return mergedHTcell_;} + + //--- Get information about its association (if any) to a truth Tracking Particle. + + // Get best matching tracking particle (=nullptr if none). + const TP* getMatchedTP() const {return matchedTP_;} + // Get the matched stubs with this Tracking Particle + const vector& getMatchedStubs() const {return matchedStubs_;} + // Get number of matched stubs with this Tracking Particle + unsigned int getNumMatchedStubs() const {return matchedStubs_.size();} + // Get number of tracker layers with matched stubs with this Tracking Particle + unsigned int getNumMatchedLayers() const {return nMatchedLayers_;} + // Get purity of stubs on track candidate (i.e. fraction matching best Tracking Particle) + float getPurity() const {return getNumMatchedStubs()/float(getNumStubs());} + + //--- For debugging purposes. + + // Remove incorrect stubs from the track using truth information. + // Also veto tracks where the HT cell estimated from the true helix parameters is inconsistent with the cell the HT found the track in, (since probable duplicates). + // Also veto tracks that match a truth particle not used for the algo efficiency measurement. + // Return a boolean indicating if the track should be kept. (i.e. Is genuine & non-duplicate). + bool cheat() { + bool keep = false; + + vector stubsSel; + if (matchedTP_ != nullptr) { // Genuine track + for (const Stub* s : stubs_) { + const TP* tp = s->assocTP(); + if (tp != nullptr) { + if (matchedTP_->index() == tp->index()) { + stubsSel.push_back(s); // This stub was produced by same truth particle as rest of track, so keep it. + } + } + } + } + stubs_ = stubsSel; + + nLayers_ = Utility::countLayers(settings_, stubs_); // Count tracker layers these stubs are in + matchedTP_ = Utility::matchingTP(settings_, stubs_, nMatchedLayers_, matchedStubs_); // Find associated truth particle & calculate info about match. + + bool genuine = (matchedTP_ != nullptr); + + if (genuine && matchedTP_->useForAlgEff()) { + Sector secTmp; + HTrphi htRphiTmp; + secTmp.init(settings_, iPhiSec_, iEtaReg_); + htRphiTmp.init(settings_, iPhiSec_, iEtaReg_, secTmp.etaMin(), secTmp.etaMax(), secTmp.phiCentre()); + pair trueCell = htRphiTmp.trueCell(matchedTP_); + + pair htCell = this->getCellLocationHT(); + bool consistent = (htCell == trueCell); // If true, track is probably not a duplicate. + if (mergedHTcell_) { + // If this is a merged cell, check other elements of merged cell. + pair htCell10( htCell.first + 1, htCell.second); + pair htCell01( htCell.first , htCell.second + 1); + pair htCell11( htCell.first + 1, htCell.second + 1); + if (htCell10 == trueCell) consistent = true; + if (htCell01 == trueCell) consistent = true; + if (htCell11 == trueCell) consistent = true; + } + if (consistent) keep = true; + } + + return keep; // Indicate if track should be kept. + } + + +private: + + //--- Configuration parameters + const Settings* settings_; + + //--- Information about the reconstructed track. + vector stubs_; + unordered_set bestStubs_; + unsigned int nLayers_; + pair cellLocationHT_; + pair helixRphi_; + pair helixRz_; + float helixD0_; + unsigned int iPhiSec_; + unsigned int iEtaReg_; + unsigned int optoLinkID_; + bool mergedHTcell_; + + //--- Optional info used for tracklet tracks. + unsigned int seedLayerType_; + unsigned int seedPS_; + + //--- Information about its association (if any) to a truth Tracking Particle. + const TP* matchedTP_; + vector matchedStubs_; + unsigned int nMatchedLayers_; +}; + +} + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h b/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h new file mode 100644 index 0000000000000..73709b9cc4122 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h @@ -0,0 +1,67 @@ +#ifndef __L1trackBase_H__ +#define __L1trackBase_H__ + +#include +#include + +using namespace std; + +//=== L1 track base class +//=== This is a pure virtual class containing no implemented functions or data members. +//=== However, it declares functions that are common to the derived classes L1trackBase, L1track3D and L1fittedTrack, +//=== allowing software to analyse objects of all three types in the same way. + +namespace TMTT { + +class Stub; +class TP; + +class L1trackBase { + +protected: + + L1trackBase() {} + + virtual ~L1trackBase() {} + + //--- Get information about the reconstructed track. + + // Get stubs on track candidate. + virtual const vector& getStubs() const = 0; + // Get number of stubs on track candidate. + virtual unsigned int getNumStubs() const = 0; + // Get number of tracker layers these stubs are in. + virtual unsigned int getNumLayers() const = 0; + + //--- User-friendly access to the helix parameters. + + virtual float qOverPt() const = 0; + virtual float phi0() const = 0; + //virtual float z0() const = 0; + //virtual float tanLambda() const = 0; + + //--- Cell locations of the track candidate in the r-phi Hough transform array in units of bin number. + virtual pair getCellLocationHT() const = 0; + + //--- Get phi sector and eta region used by track finding code that this track is in. + virtual unsigned int iPhiSec() const = 0; + virtual unsigned int iEtaReg() const = 0; + + //--- Opto-link ID used to send this track from HT to Track Fitter + virtual unsigned int optoLinkID() const = 0; + + //--- Get information about its association (if any) to a truth Tracking Particle. + + // Get matching tracking particle (=nullptr if none). + virtual const TP* getMatchedTP() const = 0; + // Get the matched stubs. + virtual const vector& getMatchedStubs() const = 0; + // Get number of matched stubs. + virtual unsigned int getNumMatchedStubs() const = 0; + // Get number of tracker layers with matched stubs. + virtual unsigned int getNumMatchedLayers() const = 0; +}; + +} + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/Matrix.h b/L1Trigger/TrackFindingTMTT/interface/Matrix.h new file mode 100644 index 0000000000000..474ead9f777f3 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/Matrix.h @@ -0,0 +1,63 @@ +#ifndef __L1TRK_MATRIX_H__ +#define __L1TRK_MATRIX_H__ + +#include + +namespace TMTT { + +template class Matrix { + private: + std::vector > mat; + unsigned rows; + unsigned cols; + + public: + Matrix(); + Matrix(unsigned _rows, unsigned _cols, const T& _initial); + Matrix(const Matrix& rhs); + virtual ~Matrix(); + + // Operator overloading, for "standard" mathematical matrix operations + Matrix& operator=(const Matrix& rhs); + + // Matrix mathematical operations + Matrix operator+(const Matrix& rhs); + Matrix& operator+=(const Matrix& rhs); + Matrix operator-(const Matrix& rhs); + Matrix& operator-=(const Matrix& rhs); + Matrix operator*(const Matrix& rhs); + Matrix& operator*=(const Matrix& rhs); + Matrix transpose(); + T determinant(); + Matrix cofactor(); + Matrix inverse(); + + // Matrix/scalar operations + Matrix operator+(const T& rhs); + Matrix operator-(const T& rhs); + Matrix operator*(const T& rhs); + Matrix operator/(const T& rhs); + + // Matrix/vector operations + std::vector operator*(const std::vector& rhs); + std::vector diag_vec(); + + // Access the individual elements + T& operator()(const unsigned& row, const unsigned& col); + const T& operator()(const unsigned& row, const unsigned& col) const; + + // Access the row and column sizes + unsigned get_rows() const; + unsigned get_cols() const; + + // Print to stdout + void print(); + +}; + +} + +#endif + + + diff --git a/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h b/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h new file mode 100644 index 0000000000000..4f428f1a60560 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h @@ -0,0 +1,59 @@ +#ifndef __MINIHTSTAGE_H__ +#define __MINIHTSTAGE_H__ + +#include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h" + +using namespace std; +using boost::numeric::ublas::matrix; + +namespace TMTT { + +class Settings; + +class MiniHTstage { + +public: + + MiniHTstage( const Settings* settings ); + + ~MiniHTstage(){}; + + void exec( matrix< HTrphi >& mHtRphis ); + +private: + + // Do load balancing + unsigned int linkIDLoadBalanced(unsigned int link, unsigned int mBin, unsigned int cBin, unsigned int numStubs, map< pair, unsigned int>& numStubsPerLinkStage1, map< pair, unsigned int>& numStubsPerLinkStage2, bool test = false) const; + +private: + + const Settings* settings_; // Configuration parameters + bool miniHTstage_; + unsigned int muxOutputsHT_; + unsigned int houghNbinsPt_; + unsigned int houghNbinsPhi_; + unsigned int miniHoughLoadBalance_; + unsigned int miniHoughNbinsPt_; + unsigned int miniHoughNbinsPhi_; + float miniHoughMinPt_; + bool miniHoughDontKill_; + float miniHoughDontKillMinPt_; + unsigned int numSubSecsEta_; + unsigned int numPhiNonants_; + unsigned int numPhiSecPerNon_; + unsigned int numEtaRegions_; + bool busySectorKill_; + unsigned int busySectorNumStubs_; + vector< unsigned int > busySectorMbinRanges_; + float chosenRofPhi_; + float binSizeQoverPtAxis_; + float binSizePhiTrkAxis_; + float invPtToDphi_; + unsigned int nMiniHTcells_; + unsigned int nHTlinksPerNonant_; +}; + +} + +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h b/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h new file mode 100644 index 0000000000000..90889e30f891b --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h @@ -0,0 +1,79 @@ +#ifndef __MUXHTOUTPUTS_H__ +#define __MUXHTOUTPUTS_H__ + +#include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h" + +#include "boost/numeric/ublas/matrix.hpp" +#include + +using namespace std; +using boost::numeric::ublas::matrix; + +//================================================================================================== +/** +* Multiplex the tracks found by several HT onto a single output optical link. +* (where throughout this class, the word "link" corresponds to a pair of links in the hardware). +* so that tracks that can't be sent down the link within the time-multiplexed period are killed. +* +* This class replaces the 2D track collection in the r-phi HTs with the subset of the tracks +* that can be output within the TM period. +* +* If you wish to change the multiplexing algorithm, then edit this class ... +*/ +//================================================================================================== + +namespace TMTT { + +class Settings; + +class MuxHToutputs { + +public: + + // Initialize constants from configuration parameters. + MuxHToutputs(const Settings* settings); + + ~MuxHToutputs() {} + + // Determine which tracks are transmitted on each HT output optical link, taking into account the multiplexing + // of multiple (eta,phi) sectors onto single links and the truncation of the tracks caused by the requirement + // to output all the tracks within the time-multiplexed period. + // This function replaces the 2D track collection in the r-phi HT with the subset surviving the TM cut. + void exec(matrix& mHtRphis) const; + + // Determine number of optical links used to output tracks from each phi nonant + // (where "link" refers to a pair of links in the hardware). + unsigned int numLinksPerNonant() const {unsigned int iCorr = (settings_->miniHTstage()) ? 1 : 0; return numPhiSecPerNon_ * numEtaRegions_ * (busySectorMbinRanges_.size() - iCorr)/ this->muxFactor();} + +private: + + // Define the number of (eta,phi) sectors that each output opto-link takes tracks from. (Depends on MUX scheme). + unsigned int muxFactor() const; + + // Define the MUX algorithm by which tracks from the specified m-bin range in the HT for a given (phi,eta) + // sector within a phi nonant are multiplexed onto a single output optical link. + unsigned int linkID(unsigned int iSecInNon, unsigned int iEtaReg, unsigned int mBinRange) const; + + // Do sanity check of the MUX algorithm implemented in linkID(). + void sanityCheck(); + +private: + + const Settings* settings_; // Configuration parameters + + // Configuration parameters + unsigned int muxOutputsHT_; + unsigned int numPhiNonants_; + unsigned int numPhiSectors_; + unsigned int numPhiSecPerNon_; + unsigned int numEtaRegions_; + bool busySectorKill_; + unsigned int busySectorNumStubs_; + vector busySectorMbinRanges_; + bool busySectorUseMbinRanges_; +}; + +} + +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/Sector.h b/L1Trigger/TrackFindingTMTT/interface/Sector.h new file mode 100644 index 0000000000000..86144290af33d --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/Sector.h @@ -0,0 +1,113 @@ +#ifndef __SECTOR_H__ +#define __SECTOR_H__ + +#include "L1Trigger/TrackFindingTMTT/interface/TP.h" + +#include +#include + +using namespace std; + +namespace TMTT { + +class Settings; +class Stub; + +class Sector { + +public: + + Sector() : settings_(nullptr), beamWindowZ_(0), trackerOuterRadius_(0), trackerInnerRadius_(0), trackerHalfLength_(0), handleStripsPhiSec_(0), handleStripsEtaSec_(0), iPhiSec_(0), iEtaReg_(0), etaMin_(0), etaMax_(0), chosenRofZ_(0), rOuterMax_(0), zOuterMax_(0), rOuterMin_(0), zOuterMin_(0), phiCentre_(0), sectorHalfWidth_(0), chosenRofPhi_(0), useStubPhi_(0), minPt_(0), useStubPhiTrk_(0), assumedPhiTrkRes_(0), calcPhiTrkRes_(0), numSubSecsEta_(0), zOuterMinSub_(), zOuterMaxSub_() {} + + ~Sector() {} + + // Initialization. + void init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaSec); + + // Check if stub within the eta and/or phi boundaries of this sector. + bool inside ( const Stub* stub ) const {return (this->insideEta(stub) && this->insidePhi(stub));} + bool insideEta( const Stub* stub ) const; + bool insidePhi( const Stub* stub ) const; + + // Check if stub is within subsectors in eta that sector may be divided into. + vector insideEtaSubSecs( const Stub* stub) const; + + unsigned int iPhiSec() const { return iPhiSec_; } // Sector number. + unsigned int iEtaReg() const { return iEtaReg_; } + float phiCentre() const { return phiCentre_; } // Return phi of centre of this sector. + float etaMin() const { return etaMin_; } // Eta range covered by this sector. + float etaMax() const { return etaMax_; } // Eta range covered by this sector. + + float sectorHalfWidth() const {return sectorHalfWidth_;} // Half width in phi of sector measured in radians. + float zAtChosenR_Min() const {return zOuterMin_;} // Range in z of particle at chosen radius from beam line covered by this sector. + float zAtChosenR_Max() const {return zOuterMax_;} + + // For performance studies, note which stubs on given tracking particle are inside the sector. + // Returns two booleans for each stub, indicating if they are in phi & eta sectors respectively. + // You can AND them together to check if stub is in (eta,phi) sector. + unordered_map> stubsInside ( const TP& tp) const; + + // Count number of stubs in given tracking particle which are inside this (phi,eta) sector; + // or inside it if only the eta cuts are applied; or inside it if only the phi cuts are applied. + // The results are returned as the 3 last arguments of the function. + void numStubsInside( const TP& tp, + unsigned int& nStubsInsideEtaPhi, unsigned int& nStubsInsideEta, + unsigned int& nStubsInsidePhi) const ; + + // Check if the helix parameters of a tracking particle (truth) are consistent with this sector. + bool insidePhiSec(const TP& tp) const {return (fabs(tp.trkPhiAtR(chosenRofPhi_) - phiCentre_) < sectorHalfWidth_);} + bool insideEtaReg(const TP& tp) const {return (tp.trkZAtR(chosenRofZ_) > zOuterMin_ && tp.trkZAtR(chosenRofZ_) < zOuterMax_);} + +private: + + // Check if stub is within eta sector or subsector that is delimated by specified zTrk range. + bool insideEtaRange( const Stub* stub, float zRangeMin, float zRangeMax) const; + + // Digitize a floating point number to 2s complement integer, dropping anything after the decimal point. (Kristian Harder) + Long64_t forceBitWidth( const float value, const UInt_t nBits ) const; + + // Check if stub is within subsectors in eta that sector may be divided into. Uses digitized calculation corresponding to GP firmware. (Kristian Harder) + vector subEtaFwCalc(const int rT, const int z) const; + +private: + + const Settings* settings_; + + float beamWindowZ_; + float trackerOuterRadius_; + float trackerInnerRadius_; + float trackerHalfLength_; + bool handleStripsPhiSec_; + bool handleStripsEtaSec_; + + // Define eta region. + unsigned int iPhiSec_; // Sector number + unsigned int iEtaReg_; + float etaMin_; // Range in eta covered by this sector. + float etaMax_; + float chosenRofZ_; // Use z of track at radius="chosenRofZ" to define eta sectors. + float rOuterMax_; // Larger eta boundary point (r,z) + float zOuterMax_; + float rOuterMin_; // Smaller eta boundary point (r,z) + float zOuterMin_; + + // Define phi sector. + float phiCentre_; // phi of centre of sector. + float sectorHalfWidth_; // sector half-width excluding overlaps. + float chosenRofPhi_; // Use phi of track at radius="chosenRofPhi" to define phi sectors. + bool useStubPhi_; // Require stub phi to be consistent with track of Pt > HTArraySpec.HoughMinPt that crosses HT phi axis? + float minPt_; // Min Pt covered by HT array. + bool useStubPhiTrk_; // Require stub phi0 (or phi65 etc.) as estimated from stub bend, to lie within HT phi axis, allowing tolerance specified below? + float assumedPhiTrkRes_; // Tolerance in stub phi0 (or phi65) assumed to be this fraction of phi sector width. (N.B. If > 0.5, then stubs can be shared by more than 2 phi sectors). + bool calcPhiTrkRes_; // If true, tolerance in stub phi0 (or phi65 etc.) will be reduced below AssumedPhiTrkRes if stub bend resolution specified in HTFilling.BendResolution suggests it is safe to do so. + + // Possible subsectors in eta within each sector. + unsigned int numSubSecsEta_; + vector zOuterMinSub_; + vector zOuterMaxSub_; +}; + +} + +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/Settings.h b/L1Trigger/TrackFindingTMTT/interface/Settings.h new file mode 100644 index 0000000000000..25c8ec649ab27 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/Settings.h @@ -0,0 +1,694 @@ +#ifndef __SETTINGS_H__ +#define __SETTINGS_H__ + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Utilities/interface/Exception.h" +#include +#include + +using namespace std; + +// Stores all configuration parameters + some hard-wired constants. + +namespace TMTT { + +class Settings { + +public: + + // Constructor for HYBRID (sets config to hard-wired consts to allow use outside CMSSW). + Settings(); + + // Constructor for TMTT (reads config from python cfg) + Settings(const edm::ParameterSet& iConfig); + + ~Settings(){} + + //=== General settings. + + // Enable all use of MC truth info (disable to save CPU). + bool enableMCtruth() const {return enableMCtruth_;} + // Enable output histograms & job tracking performance summary (disable to save CPU). + bool enableHistos() const {return enableHistos_;} + + //=== Cuts on MC truth tracks for tracking efficiency measurements. + + double genMinPt() const {return genMinPt_;} + double genMaxAbsEta() const {return genMaxAbsEta_;} + double genMaxVertR() const {return genMaxVertR_;} + double genMaxVertZ() const {return genMaxVertZ_;} + double genMaxD0() const {return genMaxD0_;} + double genMaxZ0() const {return genMaxZ0_;} + vector genPdgIds() const {return genPdgIds_;} + // Additional cut on MC truth tracks for algorithmic tracking efficiency measurements. + unsigned int genMinStubLayers() const {return genMinStubLayers_;} // Min. number of layers TP made stub in. + + //=== Cuts applied to stubs before arriving in L1 track finding board. + + // Reduce number of bits used by front-end chips to store stub bend info? + // = 0 (no); = 1 (yes using official recipe); = 2 (yes using TMTT method) + unsigned int degradeBendRes() const {return degradeBendRes_;} + // Don't use stubs with eta beyond this cut, since the tracker geometry makes it impossible to reconstruct tracks with them. + double maxStubEta() const {return maxStubEta_;} + // Don't use stubs whose measured Pt from bend info is significantly below HTArraySpec.HoughMinPt, where "significantly" means allowing for resolution in q/Pt derived from stub bend resolution HTFilling.BendResolution + bool killLowPtStubs() const {return killLowPtStubs_;} + // Print stub windows corresponding to KillLowPtStubs, in python cfg format used by CMSSW. + bool printStubWindows() const {return printStubWindows_;} + // Bend resolution assumed by bend filter in units of strip pitch. Also used when assigning stubs to sectors if calcPhiTrkRes() is true. + double bendResolution() const {return bendResolution_;} + // Additional contribution to bend resolution from its encoding into a reduced number of bits. + // This number is the assumed resolution relative to the naive guess of its value. + // It is ignored in DegradeBendRes = 0. + double bendResolutionExtra() const {return bendResolutionExtra_;} + // Order stubs by bend in DTC, such that highest Pt stubs are transmitted first. + bool orderStubsByBend() const {return orderStubsByBend_;} + + //=== Optional stub digitization configuration + + bool enableDigitize() const {return enableDigitize_;} + //--- Parameters available in MP board. + unsigned int phiSectorBits() const {return phiSectorBits_;} + unsigned int phiSBits() const {return phiSBits_;} + double phiSRange() const {return phiSRange_;} + unsigned int rtBits() const {return rtBits_;} + double rtRange() const {return rtRange_;} + unsigned int zBits() const {return zBits_;} + double zRange() const {return zRange_;} + //--- Parameters available in GP board (excluding any in common with MP specified above). + unsigned int phiOBits() const {return phiOBits_;} + double phiORange() const {return phiORange_;} + unsigned int bendBits() const {return bendBits_;} + + //=== Configuration of Geometric Processor. + // Use an FPGA-friendly approximation to determine track angle dphi from bend in GP? + bool useApproxB() const {return useApproxB_;} + double bApprox_gradient() const {return bApprox_gradient_;} + double bApprox_intercept() const {return bApprox_intercept_;} + + //=== Definition of phi sectors. + + unsigned int numPhiNonants() const {return numPhiNonants_;} + unsigned int numPhiSectors() const {return numPhiSectors_;} + double chosenRofPhi() const {return chosenRofPhi_;} // 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. + bool useStubPhi() const {return useStubPhi_;} // Require stub phi to be consistent with track of Pt > HTArraySpec.HoughMinPt that crosses HT phi axis? + bool useStubPhiTrk() const {return useStubPhiTrk_;} // Require stub phi0 (or phi65 etc.) as estimated from stub bend, to lie within HT phi axis, allowing tolerance specified below? + double assumedPhiTrkRes() const {return assumedPhiTrkRes_;} // Tolerance in stub phi0 (or phi65) assumed to be this fraction of phi sector width. (N.B. If > 0.5, then stubs can be shared by more than 2 phi sectors). + bool calcPhiTrkRes() const {return calcPhiTrkRes_;} // If true, tolerance in stub phi0 (or phi65 etc.) will be reduced below AssumedPhiTrkRes if stub bend resolution specified in StubCuts.BendResolution suggests it is safe to do so. + bool handleStripsPhiSec() const {return handleStripsPhiSec_;} // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when assigning stubs to phi sectors? + + //=== Definition of eta sectors. + + vector etaRegions() const {return etaRegions_;} // Boundaries of eta regions de + unsigned int numEtaRegions() const {return (etaRegions_.size() - 1);} + double chosenRofZ() const {return chosenRofZ_;} // Use z of track at this radius for assignment of stubs to phi sectors & also for one of the axes of the r-z HT. + double beamWindowZ() const {return beamWindowZ_;} // Half-width of window supposed to contain beam-spot in z. + bool handleStripsEtaSec() const {return handleStripsEtaSec_;} // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when assigning stubs to eta sectors? + bool allowOver2EtaSecs() const {return allowOver2EtaSecs_;} // If True, the code will not throw an error if a stub is assigned to 3 or more eta sectors. + + //=== r-phi Hough transform array specifications. + + double houghMinPt() const {return houghMinPt_;} + unsigned int houghNbinsPt() const {return houghNbinsPt_;} // Dimension in any q/Pt related variable. Not valid if houghNcellsRphi() > 0. (If MiniHTstage = True, this refers to mini cells in whole HT array). + unsigned int houghNbinsPhi() const {return houghNbinsPhi_;} // Dimension in any track-phi related variable. Not valid if houghNcellsRphi() > 0. (If MiniHTstage = True, this refers to mini cells in whole HT array). + int houghNcellsRphi() const {return houghNcellsRphi_;} // Required no. of cells in r-phi HT array. If > 0, then parameters HoughNbinsPt and HoughNbinsPhi will be calculated from the constraints that their product should equal HoughNcellsRz and their ratio should make the maximum |gradient|" of stub lines in the HT array equal to 1. If <= 0, then HoughNbinsPt and HoughNbinsPhi will be taken from the values configured above. + bool enableMerge2x2() const {return enableMerge2x2_;} // Groups of neighbouring 2x2 cells in HT will be treated as if they are a single large cell. (Also enabled in MiniHTstage = True). + double maxPtToMerge2x2() const {return maxPtToMerge2x2_;} // but only cells with pt < maxPtToMerge2x2() will be merged in this way (irrelevant if enableMerge2x2() = false). + unsigned int numSubSecsEta() const {return numSubSecsEta_;} // Subdivide each sector into this number of subsectors in eta within r-phi HT. + unsigned int shape() const {return shape_;} // define cell shape (0 square, 1 diamond, 2 hexagon) + // Run 2nd stage HT with mini cells inside each 1st stage normal HT cell. N.B. This automatically sets EnableMerge2x2 = True & MaxPtToMerge = 999999. + bool miniHTstage() const {return miniHTstage_;} + // Number of mini cells along q/Pt & phi axes inside each normal HT cell. + unsigned int miniHoughNbinsPt() const {return miniHoughNbinsPt_;} + unsigned int miniHoughNbinsPhi() const {return miniHoughNbinsPhi_;} + // Below this Pt threshold, the mini HT will not be used, so only tracks found by 1st stage coarse HT will be output. (Used to improve low Pt tracking). (HT cell numbering remains as if mini HT were in use everywhere). + float miniHoughMinPt() const {return miniHoughMinPt_;} + // If true, allows tracks found by 1st stage coarse HT to be output if 2nd stage mini HT finds no tracks. + bool miniHoughDontKill() const {return miniHoughDontKill_;} + // If MiniHoughDontKill=True, this option restricts it to keep 1st stage HT tracks only if their Pt is exceeds this cut. (Used to improve electron tracking above this threshold). + float miniHoughDontKillMinPt() const {return miniHoughDontKillMinPt_;} + // load balancing disabled = 0; static load balancing of output links = 1; dynamic load balancing of output links = 2. + unsigned int miniHoughLoadBalance() const {return miniHoughLoadBalance_;} + + //=== Rules governing how stubs are filled into the r-phi Hough Transform array. + + // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when filling stubs in r-phi HT? + bool handleStripsRphiHT() const {return handleStripsRphiHT_;} + // Take all cells in HT array crossed by line corresponding to each stub (= 0) or take only some to reduce rate at cost + // of efficiency ( > 0). If this option is > 0, it can be 1 or 2, corresponding to different algorithms for rejecting some of the cells. + unsigned int killSomeHTCellsRphi() const {return killSomeHTCellsRphi_;} + // Use filter in each HT cell using only stubs which have consistent bend, allowing for resolution specified in StubCuts.BendResolution. + bool useBendFilter() const {return useBendFilter_;} + // A filter is used each HT cell, which prevents more than the specified number of stubs being stored in the cell. (Reflecting memory limit of hardware). N.B. If mini-HT is in use, then this cut applies to coarse-HT. + unsigned int maxStubsInCell() const {return maxStubsInCell_;} + // Similar cut for Mini-HT. + unsigned int maxStubsInCellMiniHough() const {return maxStubsInCellMiniHough_;} + // If this returns true, and if more than busySectorNumStubs() stubs are assigned to tracks by an r-phi HT array, then + // the excess tracks are killed, with lowest Pt ones killed first. This is because hardware has finite readout time. + bool busySectorKill() const {return busySectorKill_;} + unsigned int busySectorNumStubs() const {return busySectorNumStubs_;} + // If this returns a non-empty vector, then the BusySectorNumStubs cut is instead applied to the subset of tracks appearing in the following m bin ranges (q/Pt) of the HT array. The sum of the entries in the vector should equal the number of m bins in the HT, although the entries will be rescaled if this is not the case. If the vector is empty, this option is disabled. (P.S. If the HT includes "merged" cells, then the m bin ranges specified here should correspond to the bins before merging). + vector busySectorMbinRanges() const {return busySectorMbinRanges_;} + // If BusySecMbinOrder is empty, then the groupings specified in BusySectorMbinRanges are applied to the m bins in the order + // 0,1,2,3,4,5 ... . If it is not empty, then they are grouped in the order specified here. + vector busySectorMbinOrder() const {return busySectorMbinOrder_;} + // If this is True, and more than BusyInputSectorNumStubs() are input to the HT array from the GP, then + // the excess stubs are killed. This is because HT hardware has finite readin time. + bool busyInputSectorKill() const {return busyInputSectorKill_;} + unsigned int busyInputSectorNumStubs() const {return busyInputSectorNumStubs_;} + // Multiplex the outputs from several HTs onto a single pair of output optical links? + // Options: 0 = disable Mux; 1 = Dec. 2016 Mux; 2 = Mar 2018 Mux (transverse HT readout by m-bin); + // 3 = Sept 2019 Mux (transverse HT readout by m-bin) + unsigned int muxOutputsHT() const {return muxOutputsHT_;} + // Is specified eta sector enabled? + bool isHTRPhiEtaRegWhitelisted(unsigned const iEtaReg) const; + + //=== Options controlling r-z track filters (or any other track filters run after the Hough transform, as opposed to inside it). + + // Specify preferred r-z filter (from those available inside TrkRZfilter.cc) - currently only "SeedFilter". + string rzFilterName() const {return rzFilterName_;} + // --- Options relevant for Seed filter, (so only relevant if rzFilterName()="SeedFilter"). + // Added resolution beyond that estimated from hit resolution. + double seedResolution() const {return seedResolution_;} + // Store stubs compatible with all possible good seed (relevant for Seed filter)? + bool keepAllSeed() const {return keepAllSeed_;} + // Maximum number of seed combinations to check (relevant for Seed filter). + unsigned int maxSeedCombinations() const {return maxSeedCombinations_;} + // Maximum number of seed combinations consistent with (z0,eta) sector constraints to bother checking per track candidate. + unsigned int maxGoodSeedCombinations() const {return maxGoodSeedCombinations_;} + // Maximum number of seeds that a single stub can be included in. + unsigned int maxSeedsPerStub() const {return maxSeedsPerStub_;} + // Check that estimated zTrk from seeding stub is within the sector boundaries (relevant for Seed filter)? + bool zTrkSectorCheck() const {return zTrkSectorCheck_;} + // Min. number of layers in rz track that must have stubs for track to be declared found. + unsigned int minFilterLayers() const {return minFilterLayers_;} + + //=== Rules for deciding when the (HT) track finding has found an L1 track candidate + + // Min. number of layers in HT cell that must have stubs for track to be declared found. + unsigned int minStubLayers() const {return minStubLayers_;} + // Change min. number of layers cut to (MinStubLayers - 1) for tracks with Pt exceeding this cut. + // If this is set to > 10000, this option is disabled. + double minPtToReduceLayers() const {return minPtToReduceLayers_;} + // Change min. number of layers cut to (MinStubLayers - 1) for tracks in these rapidity sectors. + vector etaSecsReduceLayers() const {return etaSecsReduceLayers_;} + // Define layers using layer ID (true) or by bins in radius of 5 cm width (false)? + bool useLayerID() const {return useLayerID_;} + //Reduce this layer ID, so that it takes no more than 8 different values in any eta region (simplifies firmware)? + bool reduceLayerID() const {return reduceLayerID_;} + + //=== Specification of algorithm to eliminate duplicate tracks + + // --- Which algorithms are enabled. + // Algorithm used for duplicate removal of 2D tracks produced by r-phi HT. + unsigned int dupTrkAlgRphi() const {return dupTrkAlgRphi_;} + // Algorithm run on all 3D tracks within each sector after r-z track filter. (Ignored if r-z track filter not run). + unsigned int dupTrkAlg3D() const {return dupTrkAlg3D_;} + // Algorithm run on tracks after the track helix fit has been done. + unsigned int dupTrkAlgFit() const {return dupTrkAlgFit_;} + //--- Options used by individual algorithms. + unsigned int dupTrkMinCommonHitsLayers() const {return dupTrkMinCommonHitsLayers_;} + + //=== Rules for deciding when a reconstructed L1 track matches a MC truth particle (i.e. tracking particle). + + //--- Three different ways to define if a tracking particle matches a reco track candidate. (Usually, set two of them to ultra loose). + // Min. fraction of matched stubs relative to number of stubs on reco track. + double minFracMatchStubsOnReco() const {return minFracMatchStubsOnReco_;} + // Min. fraction of matched stubs relative to number of stubs on tracking particle. + double minFracMatchStubsOnTP() const {return minFracMatchStubsOnTP_;} + // Min. number of matched layers & min. number of matched PS layers.. + unsigned int minNumMatchLayers() const {return minNumMatchLayers_;} + unsigned int minNumMatchPSLayers() const {return minNumMatchPSLayers_;} + // Associate stub to TP only if the TP contributed to both its clusters? (If False, then associate even if only one cluster was made by TP). + bool stubMatchStrict() const {return stubMatchStrict_;} + + //=== Track Fitting Settings + + //--- Options applicable to all track fitters --- + + // Track fitting algorithms to use. You can run several in parallel. + vector trackFitters() const {return trackFitters_;} + // Indicate subset of fitters wanting r-z track filter to be run before them. + // (Excludes fitters that are not run). + vector useRZfilter() const {return useRZfilter_;} + // Print detailed summary of track fit performance at end of job (as opposed to a brief one)? + bool detailedFitOutput() const {return detailedFitOutput_;} + // Use MC truth to eliminate all fake tracks & all incorrect stubs assigned to tracks before doing fit. + bool trackFitCheat() const {return trackFitCheat_;} + + //--- Options for chi2 track fitter --- + + // Number of iterations that the track fit should perform. + unsigned int numTrackFitIterations() const {return numTrackFitIterations_;} + // Optionally remove hit with worst residual in track fit? (Only used by chi2 track fit). + bool killTrackFitWorstHit() const {return killTrackFitWorstHit_;} + // Cuts in standard deviations used to kill hits with big residuals during fit. If the residual exceeds the "General" + // cut, the hit is killed providing it leaves the track with enough hits to survive. If the residual exceeds the + // "Killing" cut, the hit is killed even if that kills the track. + double generalResidualCut() const {return generalResidualCut_;} + double killingResidualCut() const {return killingResidualCut_;} + + //--- Additional options for Thomas Schuh's Linear Regression track fitter --- + + // Max allowed iterations. + unsigned int maxIterationsLR() const { return maxIterationsLR_;} + // Internal histograms are filled if it is True + bool LRFillInternalHists() const { return LRFillInternalHists_;} + bool combineResiduals() const { return combineResiduals_; } + bool lineariseStubPosition() const { return lineariseStubPosition_; } + bool checkSectorConsistency() const { return checkSectorConsistency_; } + bool checkHTCellConsistency() const { return checkHTCellConsistency_; } + unsigned int minPSLayers() const { return minPSLayers_; } + // Digitization + bool digitizeLR() const { return digitizeLR_; } + float PhiPrecision() const { return PhiPrecision_; } + float RPrecision() const { return RPrecision_; } + float ZPrecision() const { return ZPrecision_; } + unsigned int ZSlopeWidth() const { return ZSlopeWidth_; } + unsigned int ZInterceptWidth() const { return ZInterceptWidth_; } + + //--- Additional options for Davide Cieri's Simple Linear Regression track fitter --- + + // Digitize Simple Linear Regression variables & calculation. (Disabled if EnableDigitize=False). + bool digitizeSLR() const {return digitizeSLR_;} + /// Number of bits to be used in hardware to compute the division needed to calculate the helix parameters + unsigned int dividerBitsHelix() const {return dividerBitsHelix_;} + unsigned int dividerBitsHelixZ() const {return dividerBitsHelixZ_;} + /// Number of bits to reduce the RPhi helix parameter denominator calculation weight + unsigned int ShiftingBitsDenRPhi() const {return ShiftingBitsDenRPhi_;} + + /// Number of bits to reduce the RZ helix parameter denominator calculation weight + unsigned int ShiftingBitsDenRZ() const {return ShiftingBitsDenRZ_;} + /// Number of bits to reduce the qOverPt parameter numerator calculation weight + unsigned int ShiftingBitsPt() const {return ShiftingBitsPt_;} + /// Number of bits to reduce the PhiT parameter numerator calculation weight + unsigned int ShiftingBitsPhi() const {return ShiftingBitsPhi_;} + /// Number of bits to reduce the tanLambda parameter calculation weight + unsigned int ShiftingBitsLambda() const {return ShiftingBitsLambda_;} + /// Number of bits to reduce the tanLambda parameter calculation weight + unsigned int ShiftingBitsZ0() const {return ShiftingBitsZ0_;} + /// ChiSquare Cut + double slr_chi2cut() const {return slr_chi2cut_;} + /// Cut on RPhi Residual (radians) + double ResidualCut() const {return residualCut_;} + + //--- Options for Kalman filter track fitters --- + + // Larger number has more debugging printout. + unsigned kalmanDebugLevel() const { return kalmanDebugLevel_; } + // Internal histograms are filled if it is True + bool kalmanFillInternalHists() const { return kalmanFillInternalHists_;} + // Fit will reject fitted tracks unless it can assign at least this number of stubs to them. + unsigned int kalmanMinNumStubs() const { return kalmanMinNumStubs_;} + // Fit will attempt to add up to this nummber of stubs to each fitted tracks, but won't bother adding more. + unsigned int kalmanMaxNumStubs() const { return kalmanMaxNumStubs_;} + // For 5-param helix fits, calculate also beam-constrained helix params after fit is complete, & use them for duplicate removal if DupTrkAlgFit=50. + bool kalmanAddBeamConstr() const { return kalmanAddBeamConstr_;} + // Remove requirement of at least 2 PS layers per track. + bool kalmanRemove2PScut() const { return kalmanRemove2PScut_;} + // Allow the KF to skip this many layers in total per track for "hard" or "easy" input tracks + unsigned int kalmanMaxSkipLayersHard() const { return kalmanMaxSkipLayersHard_;} + unsigned int kalmanMaxSkipLayersEasy() const { return kalmanMaxSkipLayersEasy_;} + // Max #stubs an input track can have to be defined "easy". + unsigned int kalmanMaxStubsEasy() const { return kalmanMaxStubsEasy_;} + // KF will consider only this no. of stubs per layer. + unsigned int kalmanMaxStubsPerLayer() const { return kalmanMaxStubsPerLayer_;} + // Multiple scattering term - inflate hit phi errors by this divided by Pt + double kalmanMultiScattTerm() const { return kalmanMultiScattTerm_;} + // Scale down chi2 in r-phi plane by this factor to improve electron performance. + unsigned int kalmanChi2RphiScale() const { return kalmanChi2RphiScale_;} + //--- Enable Higher order corrections + // Treat z uncertainty in tilted barrel modules correctly. + bool kalmanHOtilted() const {return kalmanHOtilted_;} + // Higher order circle explansion terms for low Pt. + bool kalmanHOhelixExp() const {return kalmanHOhelixExp_;} + // Alpha correction for non-radial 2S endcap strips. (0=disable correction, 1=correct with offset, 2=correct with non-diagonal stub covariance matrix). + unsigned int kalmanHOalpha() const {return kalmanHOalpha_;} + // 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). + unsigned int kalmanHOprojZcorr() const {return kalmanHOprojZcorr_;} + // Use dodgy calculation to account for non-radial endcap 2S modules that was used in Dec. 2016 demonstrator & use no special treatment for tilted barrel modules. + bool kalmanHOdodgy() const {return kalmanHOdodgy_;} + + //=== Treatment of dead modules. + + //--- Either use this private TMTT way of studying dead modules + // In (eta,phi) sectors containing dead modules, reduce the min. number of layers cut on tracks to (MinStubLayers() - 1)? + // The sectors affected are hard-wired in DeadModuleDB::defineDeadTrackerRegions(). + bool deadReduceLayers() const {return deadReduceLayers_;} + // Emulate dead modules by killing fraction of stubs given by DeadSimulateFrac in certain layers & angular regions of + // the tracker that are hard-wired in DeadModuleDB::defineDeadSectors(). Disable by setting <= 0. Fully enable by setting to 1. + // Do not use if KillScenario > 0. + double deadSimulateFrac() const {return deadSimulateFrac_;} + // + //--- Or this use communal way developed with Tracklet of studying dead modules + // Emulate dead/inefficient modules using the StubKiller code, with stubs killed according to the scenarios of the Stress Test group. + // (0=Don't kill any stubs; 1-5 = Scenarios from https://github.com/EmyrClement/StubKiller/blob/master/README.md). + unsigned int killScenario() const {return killScenario_;} + // Modify TMTT tracking to try to recover tracking efficiency in presence of dead modules. (Does nothing if KillScenario = 0). + bool killRecover() const {return killRecover_;} + + //=== Track fit digitisation configuration for various track fitters + + // These are used only for SimpleLR track fitter. + bool slr_skipTrackDigi() const {return slr_skipTrackDigi_;} + unsigned int slr_oneOver2rBits() const {return slr_oneOver2rBits_;} + double slr_oneOver2rRange() const {return slr_oneOver2rRange_;} + unsigned int slr_d0Bits() const {return slr_d0Bits_;} + double slr_d0Range() const {return slr_d0Range_;} + unsigned int slr_phi0Bits() const {return slr_phi0Bits_;} + double slr_phi0Range() const {return slr_phi0Range_;} + unsigned int slr_z0Bits() const {return slr_z0Bits_;} + double slr_z0Range() const {return slr_z0Range_;} + unsigned int slr_tanlambdaBits() const {return slr_tanlambdaBits_;} + double slr_tanlambdaRange() const {return slr_tanlambdaRange_;} + unsigned int slr_chisquaredBits() const {return slr_chisquaredBits_;} + double slr_chisquaredRange() const {return slr_chisquaredRange_;} + // These are used for KF track fitter and for all other track fitters (though are probably not right for other track fitters ...) + bool kf_skipTrackDigi() const {return kf_skipTrackDigi_;} + unsigned int kf_oneOver2rBits() const {return kf_oneOver2rBits_;} + double kf_oneOver2rRange() const {return kf_oneOver2rRange_;} + unsigned int kf_d0Bits() const {return kf_d0Bits_;} + double kf_d0Range() const {return kf_d0Range_;} + unsigned int kf_phi0Bits() const {return kf_phi0Bits_;} + double kf_phi0Range() const {return kf_phi0Range_;} + unsigned int kf_z0Bits() const {return kf_z0Bits_;} + double kf_z0Range() const {return kf_z0Range_;} + unsigned int kf_tanlambdaBits() const {return kf_tanlambdaBits_;} + double kf_tanlambdaRange() const {return kf_tanlambdaRange_;} + unsigned int kf_chisquaredBits() const {return kf_chisquaredBits_;} + double kf_chisquaredRange() const {return kf_chisquaredRange_;} + vector kf_chisquaredBinEdges() const {return kf_chisquaredBinEdges_;} + // Skip track digitisation when fitted is not SimpleLR or KF? + bool other_skipTrackDigi() const {return other_skipTrackDigi_;} + + //=== Debug printout & plots + + // Printout level. + unsigned int debug() const {return debug_;} + // When making helix parameter resolution plots, only use particles from the physics event (True) + // or also use particles from pileup (False) ? + bool resPlotOpt() const {return resPlotOpt_;} + // Specify sector for which debug histos for hexagonal HT will be made. + unsigned int iPhiPlot() const {return iPhiPlot_;} + unsigned int iEtaPlot() const {return iEtaPlot_;} + + // Booleain indicating if an output EDM file will be written. + // N.B. This parameter does not appear inside TMTrackProducer_Defaults_cfi.py . It is created inside tmtt_tf_analysis_cfg.py . + bool writeOutEdmFile() const {return writeOutEdmFile_;} + + //=== Hard-wired constants + + double pitchPS() const {cout<<"ERROR: Use Stub::stripPitch instead of Settings::pitchPS!";exit(1);return 0.;} // pitch of PS modules - OBSOLETE + double pitch2S() const {cout<<"ERROR: Use Stub::stripPitch instead of Settings::pitch2S!";exit(1);return 0.;} // pitch of 2S modules - OBSOLETE + double cSpeed() const {return 2.99792458e10;} // Speed of light (cm/s) + double invPtToInvR() const {return (this->getBfield())*(this->cSpeed())/1.0E13;} // B*c/1E11 - converts q/Pt to 1/radius_of_curvature + double invPtToDphi() const {return (this->getBfield())*(this->cSpeed())/2.0E13;} // B*c/2E11 - converts q/Pt to track angle at some radius from beamline. + double trackerOuterRadius() const {return 112.7;} // max. occuring stub radius. + double trackerInnerRadius() const {return 21.8;} // min. occuring stub radius. + double trackerHalfLength() const {return 270.;} // half-length of tracker. + double stripLength2S() const {cout<<"ERROR: Use Stub::stripLength instead of Settings::stripLength2S!"< genPdgIds_; + unsigned int genMinStubLayers_; + + // Cuts applied to stubs before arriving in L1 track finding board. + unsigned int degradeBendRes_; + double maxStubEta_; + bool killLowPtStubs_; + bool printStubWindows_; + double bendResolution_; + double bendResolutionExtra_; + bool orderStubsByBend_; + + // Optional stub digitization. + bool enableDigitize_; + unsigned int phiSectorBits_; + unsigned int phiSBits_; + double phiSRange_; + unsigned int rtBits_; + double rtRange_; + unsigned int zBits_; + double zRange_; + unsigned int phiOBits_; + double phiORange_; + unsigned int bendBits_; + + // Configuration of Geometric Processor. + bool useApproxB_; + double bApprox_gradient_; + double bApprox_intercept_; + + // Definition of phi sectors. + unsigned int numPhiNonants_; + unsigned int numPhiSectors_; + double chosenRofPhi_; + bool useStubPhi_; + bool useStubPhiTrk_; + double assumedPhiTrkRes_; + bool calcPhiTrkRes_; + bool handleStripsPhiSec_; + + // Definition of eta sectors. + vector etaRegions_; + double chosenRofZ_; + double beamWindowZ_; + bool handleStripsEtaSec_; + bool allowOver2EtaSecs_; + + // r-phi Hough transform array specifications. + double houghMinPt_; + unsigned int houghNbinsPt_; + unsigned int houghNbinsPhi_; + int houghNcellsRphi_; + bool enableMerge2x2_; + double maxPtToMerge2x2_; + unsigned int numSubSecsEta_; + unsigned int shape_; + bool miniHTstage_; + unsigned int miniHoughNbinsPt_; + unsigned int miniHoughNbinsPhi_; + double miniHoughMinPt_; + bool miniHoughDontKill_; + double miniHoughDontKillMinPt_; + unsigned int miniHoughLoadBalance_; + + // Rules governing how stubs are filled into the r-phi Hough Transform array. + bool handleStripsRphiHT_; + unsigned int killSomeHTCellsRphi_; + bool useBendFilter_; + unsigned int maxStubsInCell_; + unsigned int maxStubsInCellMiniHough_; + bool busySectorKill_; + unsigned int busySectorNumStubs_; + vector busySectorMbinRanges_; + vector busySectorMbinOrder_; + bool busyInputSectorKill_; + unsigned int busyInputSectorNumStubs_; + unsigned int muxOutputsHT_; + vector etaRegWhitelist_; + + // Options controlling r-z track filters (or any other track filters run after the Hough transform, as opposed to inside it). + string rzFilterName_; + double seedResolution_; + bool keepAllSeed_; + unsigned int maxSeedCombinations_; + unsigned int maxGoodSeedCombinations_; + unsigned int maxSeedsPerStub_; + bool zTrkSectorCheck_; + unsigned int minFilterLayers_; + + // Rules for deciding when the track-finding has found an L1 track candidate + unsigned int minStubLayers_; + double minPtToReduceLayers_; + vector etaSecsReduceLayers_; + bool useLayerID_; + bool reduceLayerID_; + + // Specification of algorithm to eliminate duplicate tracks + unsigned int dupTrkAlgRphi_; + unsigned int dupTrkAlg3D_; + unsigned int dupTrkAlgFit_; + unsigned int dupTrkMinCommonHitsLayers_; + + // Rules for deciding when a reconstructed L1 track matches a MC truth particle (i.e. tracking particle). + double minFracMatchStubsOnReco_; + double minFracMatchStubsOnTP_; + unsigned int minNumMatchLayers_; + unsigned int minNumMatchPSLayers_; + bool stubMatchStrict_; + + // Track Fitting Settings + vector trackFitters_; + vector useRZfilter_; + double chi2OverNdfCut_; + bool detailedFitOutput_; + bool trackFitCheat_; + // + unsigned int numTrackFitIterations_; + bool killTrackFitWorstHit_; + double generalResidualCut_; + double killingResidualCut_; + // + unsigned int maxIterationsLR_; + bool LRFillInternalHists_; + bool combineResiduals_; + bool lineariseStubPosition_; + bool checkSectorConsistency_; + bool checkHTCellConsistency_; + unsigned int minPSLayers_; + bool digitizeLR_; + float PhiPrecision_; + float RPrecision_; + float ZPrecision_; + unsigned int ZSlopeWidth_; + unsigned int ZInterceptWidth_; + // + bool digitizeSLR_; + unsigned int dividerBitsHelix_; + unsigned int dividerBitsHelixZ_; + unsigned int ShiftingBitsDenRPhi_; + unsigned int ShiftingBitsDenRZ_; + unsigned int ShiftingBitsPt_; + unsigned int ShiftingBitsPhi_; + + unsigned int ShiftingBitsLambda_; + unsigned int ShiftingBitsZ0_; + double slr_chi2cut_; + double residualCut_; + // + unsigned kalmanDebugLevel_; + bool kalmanFillInternalHists_; + unsigned int kalmanMinNumStubs_; + unsigned int kalmanMaxNumStubs_; + bool kalmanAddBeamConstr_; + bool kalmanRemove2PScut_; + unsigned int kalmanMaxSkipLayersHard_; + unsigned int kalmanMaxSkipLayersEasy_; + unsigned int kalmanMaxStubsEasy_; + unsigned int kalmanMaxStubsPerLayer_; + double kalmanMultiScattTerm_; + unsigned int kalmanChi2RphiScale_; + bool kalmanHOtilted_; + bool kalmanHOhelixExp_; + unsigned int kalmanHOalpha_; + unsigned int kalmanHOprojZcorr_; + bool kalmanHOdodgy_; + + // Treatment of dead modules. + bool deadReduceLayers_; + double deadSimulateFrac_; + unsigned int killScenario_; + bool killRecover_; + + // Track digitisation configuration for various track fitters + bool slr_skipTrackDigi_; + unsigned int slr_oneOver2rBits_; + double slr_oneOver2rRange_; + double slr_oneOver2rMult_; + unsigned int slr_d0Bits_; + double slr_d0Range_; + unsigned int slr_phi0Bits_; + double slr_phi0Range_; + unsigned int slr_z0Bits_; + double slr_z0Range_; + unsigned int slr_tanlambdaBits_; + double slr_tanlambdaRange_; + unsigned int slr_chisquaredBits_; + double slr_chisquaredRange_; + // + bool kf_skipTrackDigi_; + unsigned int kf_oneOver2rBits_; + double kf_oneOver2rRange_; + double kf_oneOver2rMult_; + unsigned int kf_d0Bits_; + double kf_d0Range_; + unsigned int kf_phi0Bits_; + double kf_phi0Range_; + unsigned int kf_z0Bits_; + double kf_z0Range_; + unsigned int kf_tanlambdaBits_; + double kf_tanlambdaRange_; + unsigned int kf_chisquaredBits_; + double kf_chisquaredRange_; + vector kf_chisquaredBinEdges_; + // + bool other_skipTrackDigi_; + + // Debug printout + unsigned int debug_; + bool resPlotOpt_; + unsigned int iPhiPlot_; + unsigned int iEtaPlot_; + + // Boolean indicating an an EDM output file will be written. + bool writeOutEdmFile_; + + // B-field in Tesla + float bField_; + + // Hybrid tracking + bool hybrid_; + + double psStripPitch_; + double psNStrips_; + double psPixelLength_; + double ssStripPitch_; + double ssNStrips_; + double ssStripLength_; + + double zMaxNonTilted_[4]; +}; + +} + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/SimpleLR.h b/L1Trigger/TrackFindingTMTT/interface/SimpleLR.h new file mode 100644 index 0000000000000..d55d6611bd7e9 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/SimpleLR.h @@ -0,0 +1,73 @@ +///=== This is the simple linear regression with 4 helix parameters (qOverPt, phiT, z0, tanLambda) track fit algorithm. + +///=== Written by: Davide Cieri (davide.cieri@stfc.ac.uk) + +#ifndef __SIMPLELR__ +#define __SIMPLELR__ + +#include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" + +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include +#include +#include + +namespace TMTT { + +class SimpleLR : public TrackFitGeneric { + +public: + SimpleLR(const Settings* settings) : TrackFitGeneric(settings), settings_(settings) {}; + + virtual ~SimpleLR() {}; + + virtual void initRun(); + + L1fittedTrack fit(const L1track3D& l1track3D); + +protected: + + const Settings* settings_; + + float phiSectorWidth_; + float phiSectorCentre_; + float phiNonantWidth_; + + float phiMult_; + float rTMult_; + float zMult_; + float qOverPtMult_; + float phiTMult_; + float z0Mult_; + float tanLambdaMult_; + float numeratorPtMult_; + float numeratorZ0Mult_; + float numeratorLambdaMult_; + float numeratorPhiMult_; + float denominatorMult_; + float chi2Mult_; + float resMult_; + float chi2cut_; + float invPtToDPhi_; + float chosenRofPhi_; + + bool digitize_; + unsigned int dividerBitsHelix_; + unsigned int dividerBitsHelixZ_; + unsigned int dividerBitsChi2_; + unsigned int shiftingBitsPhi_; + unsigned int shiftingBitsDenRPhi_; + unsigned int shiftingBitsDenRZ_; + unsigned int shiftingBitsPt_; + unsigned int shiftingBitsz0_; + unsigned int shiftingBitsLambda_; + + +}; + +} + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/Stub.h b/L1Trigger/TrackFindingTMTT/interface/Stub.h new file mode 100644 index 0000000000000..3f87526fb671e --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/Stub.h @@ -0,0 +1,357 @@ +#ifndef __STUB_H__ +#define __STUB_H__ + +#include "DataFormats/L1TrackTrigger/interface/TTTypes.h" +#include "DataFormats/L1TrackTrigger/interface/TTStub.h" +#include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h" + +// TTStubAssociationMap.h forgets to two needed files, so must include them here ... +#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h" +#include "SimTracker/TrackTriggerAssociation/interface/TTClusterAssociationMap.h" +#include "SimTracker/TrackTriggerAssociation/interface/TTStubAssociationMap.h" +#include "DataFormats/DetId/interface/DetId.h" + +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/DigitalStub.h" +#include "L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h" +#include "L1Trigger/TrackFindingTMTT/interface/DegradeBend.h" +#include "L1Trigger/TrackFindingTMTT/interface/StubKiller.h" + +#include "DataFormats/Common/interface/Ref.h" +#include "DataFormats/Common/interface/DetSetVector.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" + +#include +#include +#include +#include + +using namespace std; + +class TrackerGeometry; +class TrackerTopology; +// class DetId; + +namespace TMTT { + +class TP; + +// typedef edm::Ref< edm::DetSetVector< Phase2TrackerDigi >, Phase2TrackerDigi > Ref_Phase2TrackerDigi_; +typedef edmNew::DetSetVector< TTStub > DetSetVec; +typedef edmNew::DetSet< TTStub > DetSet; +typedef edm::Ref > TTStubRef; +typedef edm::Ref< edmNew::DetSetVector< TTCluster< Ref_Phase2TrackerDigi_ > >, TTCluster< Ref_Phase2TrackerDigi_ > > TTClusterRef; +typedef TTStubAssociationMap TTStubAssMap; +typedef TTClusterAssociationMap TTClusterAssMap; + +//=== Represents a Tracker stub (=pair of hits) + +class Stub : public TTStubRef { + +public: + + // Store useful info about the stub (for use with HYBRID code), with hard-wired constants to allow use outside CMSSW. + Stub(double phi, double r, double z, double bend, int layerid, bool psModule, bool barrel, unsigned int iphi, double alpha, const Settings* settings, const TrackerTopology* trackerTopology, unsigned int ID, unsigned int iPhiSec); + + // Store useful info about stub (for use with TMTT code). + Stub(const TTStubRef& ttStubRef, unsigned int index_in_vStubs, const Settings* settings, const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology); + + ~Stub(){} + + bool operator==(const Stub& stubOther) {return (this->index() == stubOther.index());} + + // Fill truth info with association from stub to tracking particles. + // The 1st argument is a map relating TrackingParticles to TP. + void fillTruth(const map, const TP* >& translateTP, const edm::Handle& mcTruthTTStubHandle, const edm::Handle& mcTruthTTClusterHandle); + + // Calculate bin range along q/Pt axis of r-phi Hough transform array consistent with bend of this stub. + void calcQoverPtrange(); + + // Digitize stub for input to Geographic Processor, with digitized phi coord. measured relative to closest phi sector. + // (This approximation is valid if their are an integer number of digitisation bins inside each phi nonant). + // However, you should also call digitizeForHTinput() before accessing digitized stub data, even if you only care about that going into GP! Otherwise, you will not identify stubs assigned to more than one nonant. + void digitizeForGPinput(unsigned int iPhiSec); + + // Digitize stub for input to Hough transform, with digitized phi coord. measured relative to specified phi sector. + void digitizeForHTinput(unsigned int iPhiSec); + + // Digitize stub for input to r-z Seed Filter. + // (Kept for backwards compatibility.) + void digitizeForSFinput() {this->digitizeForSForTFinput("SeedFilter");} + + // Digitize stub for input to r-z Seed Filter or Track Fitter. + // Argument is "SeedFilter" or name of Track Fitter. + void digitizeForSForTFinput(string SForTF); + + // Digitize stub for input to Duplicate Removal . + void digitizeForDRinput(unsigned int stubId); + + // Control warning messages about accessing non-digitized quantities. + void setDigitizeWarningsOn(bool newVal) {digitizeWarningsOn_ = newVal;} + + // Restore stub to pre-digitized state. i.e. Undo what function digitize() did. + + void reset_digitize(); + + // === Functions for returning info about reconstructed stubs === + + // Location in InputData::vStubs_ + unsigned int index() const { return index_in_vStubs_; } + + //--- Stub data and quantities derived from it --- + + // Stub coordinates (optionally after digitisation, if digitisation requested via cfg). + // N.B. Digitisation is not run when the stubs are created, but later, after stubs are assigned to sectors. + // Until then, these functions return the original coordinates. + float phi() const { return phi_; } + float r() const { return r_; } + float z() const { return z_; } + float theta() const { return atan2(r_, z_); } + float eta() const { return asinh(z_/r_); } + // Access to digitized version of stub coords. + const DigitalStub& digitalStub() const { return digitalStub_;} + // Access to booleans indicating if the stub has been digitized. + bool digitizedForGPinput() const { return digitizedForGPinput_;} + bool digitizedForHTinput() const { return digitizedForHTinput_;} + string digitizedForSForTFinput() const { return digitizedForSForTFinput_;} // Returns which SF or TF digitisation was done for, if any. + bool digitizedForDRinput() const { return digitizedForDRinput_;} + + // Get stub bend (i.e. displacement between two hits in stub in units of strip pitch) and its estimated resolution. + float bend() const { this->check1(); return bend_; } + // The bend resolution has a contribution from the sensor and a contribution from encoding the bend into + // a reduced number of bits. + float bendRes() const { return (settings_->bendResolution() + (numMergedBend_-1)*settings_->bendResolutionExtra()); } + // Number of bend values which loss of bit to store bend resulted in being merged into this bend value. + float numMergedBend() const { return numMergedBend_;} + // Bend angle of track measured by stub and its estimated resolution. + float dphi() const { this->check2(); return (bend_ * dphiOverBend()); } + float dphiRes() const { return (dphiOverBend() * this->bendRes()); } + // Estimated track q/Pt based on stub bend info. + float qOverPt() const { return (this->qOverPtOverBend() * this->bend()); } + float qOverPtres() const { return (this->qOverPtOverBend() * this->bendRes()); } + // Range in q/Pt bins in HT array compatible with stub bend. + unsigned int min_qOverPt_bin() const { return min_qOverPt_bin_; } + unsigned int max_qOverPt_bin() const { return max_qOverPt_bin_; } + // Estimated phi0 of track at beam-line based on stub bend info. + float beta() const { return (phi_ + dphi()); } + // Estimated phi angle at which track intercepts a given radius rad, based on stub bend info. Also estimate uncertainty on this angle due to endcap 2S module strip length. + // This is identical to beta() if rad=0. + pair trkPhiAtR(float rad) const; + // Estimated resolution in trkPhiAtR(rad) based on nominal stub bend resolution. + float trkPhiAtRres(float rad) const { return this->dphiRes() * fabs(1 - rad / r_); } + // Difference in phi between stub and angle at which track crosses given radius, assuming track has given Pt. + float phiDiff(float rad, float Pt) const { return fabs(r_ - rad)*(settings_->invPtToDphi())/Pt; } + // -- conversion factors + // Ratio of bend angle to bend, where bend is the displacement in strips between the two hits making up stub. + float dphiOverBend() const { this->check2(); return dphiOverBend_; } + // Correction factor that was used when calculating dPhiOverBend, due to tilt of module. + float dphiOverBendCorrection() const { return dphiOverBendCorrection_; } + // Approximation of dphiOverBendCorrection, used in firmware. + float dphiOverBendCorrectionApprox() const { return dphiOverBendCorrection_approx_; } + // Ratio of q/Pt to bend, where bend is the displacement in strips between the two hits making up stub. + float qOverPtOverBend() const { return this->dphiOverBend() / (r_ * settings_->invPtToDphi()); } + + //--- Info about the two clusters that make up the stub. + // Coordinates in frame of sensor, measured in units of strip pitch along two orthogonal axes running perpendicular and parallel to longer axis of pixels/strips (U & V). + array localU_cluster() const { return localU_cluster_;} + array localV_cluster() const { return localV_cluster_;} + + //--- Check if this stub will be output by front-end readout electronics, + //--- (where we can reconfigure the stub window size and rapidity cut). + //--- Don't use stubs failing this cut. + bool frontendPass() const { return frontendPass_; } + // Indicates if stub would have passed front-end cuts, were it not for window size encoded in DegradeBend.h + bool stubFailedDegradeWindow() const { return stubFailedDegradeWindow_;} + + //--- Quantities common to all stubs in a given module --- + + // Unique identifier for each stacked module, allowing one to check which stubs are on the same module. + unsigned int idDet() const { return idDet_.rawId();} + // Uncertainty in stub coordinates due to strip length, assumed equal to 0.5*strip-or-pixel-length + float rErr() const { return rErr_;} + float zErr() const { return zErr_;} + // Coordinates of centre of two sensors in (r,phi,z) + float minR() const { return moduleMinR_; } + float maxR() const { return moduleMaxR_; } + float minPhi() const { return moduleMinPhi_; } + float maxPhi() const { return moduleMaxPhi_; } + float minZ() const { return moduleMinZ_; } + float maxZ() const { return moduleMaxZ_; } + // Angle between normal to module and beam-line along +ve z axis. (In range -PI/2 to +PI/2). + float moduleTilt() const { return moduleTilt_; } + // Which of two sensors in module is furthest from beam-line? + bool outerModuleAtSmallerR() const { return outerModuleAtSmallerR_; } + // Sensor pitch over separation. + float pitchOverSep() const { return pitchOverSep_;} + // Location of stub in module in units of strip number (or pixel number along finest granularity axis). + // Range from 0 to (nStrips - 1) inclusive. + unsigned int iphi() const { return iphi_; } + // alpha correction for non-radial strips in endcap 2S modules. + // (If true hit at larger r than stub r by deltaR, then stub phi needs correcting by +alpha*deltaR). + // *** TO DO *** : Digitize this. + float alpha() const { return alpha_; } + // Module type: PS or 2S? + bool psModule() const { return psModule_; } + // Tracker layer ID number (1-6 = barrel layer; 11-15 = endcap A disk; 21-25 = endcap B disk) + unsigned int layerId() const { return layerId_; } + // Reduced layer ID (in range 1-7). This encodes the layer ID in only 3 bits (to simplify firmware) by merging some barrel layer and endcap disk layer IDs into a single ID. + unsigned int layerIdReduced() const; + // Endcap ring of module (returns zero in case of barrel) + unsigned int endcapRing() const { return endcapRing_; } + bool barrel() const { return barrel_; } + // True if stub is in tilted barrel module. + bool tiltedBarrel() const { return tiltedBarrel_; } + // Strip pitch (or pixel pitch along shortest axis). + float stripPitch() const { return stripPitch_; } + // Strip length (or pixel pitch along longest axis). + float stripLength() const { return stripLength_; } + // No. of strips in sensor. + unsigned int nStrips() const { return nStrips_; } + // Width of sensitive region of sensor. + float sensorWidth() const { return sensorWidth_; } + // Hit resolution perpendicular to strip (or to longest pixel axis) = pitch/sqrt(12). Measures phi. + float sigmaPerp() const { return sigmaPerp_; } + // Hit resolution parallel to strip (or to longest pixel axis) = length/sqrt(12). Measures r or z. + float sigmaPar() const { return sigmaPar_; } + + // Clone a few of the above functions with the less helpful names expected by the track fitting code. (Try to phase these out with time ...) + unsigned int nstrip() const { return this->nStrips(); } + float width() const { return this->sensorWidth(); } + float sigmaX() const { return this->sigmaPerp(); } + float sigmaZ() const { return this->sigmaPar(); } + + //--- Truth info + + // Association of stub to tracking particles + const set& assocTPs() const { return assocTPs_; } // Return TPs associated to this stub. (Whether only TPs contributing to both clusters are returned is determined by "StubMatchStrict" config param.) + bool genuine() const { return (assocTPs_.size() > 0); } // Did stub match at least one TP? + const TP* assocTP() const { return assocTP_; } // If only one TP contributed to both clusters, this tells you which TP it is. Returns nullptr if none. + + // Association of both clusters making up stub to tracking particles + array genuineCluster() const { return array{ {(assocTPofCluster_[0] != nullptr), (assocTPofCluster_[1] != nullptr)} }; } // Was cluster produced by a single TP? + array assocTPofCluster() const { return assocTPofCluster_; } // Which TP made each cluster. Warning: If cluster was not produced by a single TP, then returns nullptr! (P.S. If both clusters match same TP, then this will equal assocTP()). + + // Note if stub is a crazy distance from the tracking particle trajectory that produced it. (e.g. perhaps produced by delta ray) + bool crazyStub() const; + + // Get stub bend and its resolution, as available within the front end chip (i.e. prior to loss of bits + // or digitisation). + float bendInFrontend() const { return bendInFrontend_; } + float bendResInFrontend() const { return settings_->bendResolution(); } + + // Return tracker geometry (T3, T4, T5 ...) + // See https://github.com/cms-sw/cmssw/blob/CMSSW_9_1_X/Configuration/Geometry/README.md + string trackerGeometryVersion() const { return trackerGeometryVersion_;} + +private: + + // Degrade assumed stub bend resolution. + // Also return boolean indicating if stub bend was outside assumed window, so stub should be rejected + // and return an integer indicating how many values of bend are merged into this single one. + void degradeResolution(float bend, + float& degradedBend, bool& reject, unsigned int& num) const; + + // Set the frontendPass_ flag, indicating if frontend readout electronics will output this stub. + // Argument indicates if stub bend was outside window size encoded in DegradeBend.h + void setFrontend(bool rejectStub); + + // Set info about the module that this stub is in. + void setModuleInfo(const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology, const DetId& detId); + + // Determine tracker geometry version by counting modules. + void setTrackerGeometryVersion(const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology); + + // Function to calculate approximation for dphiOverBendCorrection aka B + double getApproxB(); + + // No HT firmware can access directly the stub bend info. + void check1() const {if (digitizeWarningsOn_ && digitizedForHTinput_) throw cms::Exception("Stub: You can't access digitized bend variable within HT firmware!");} + // If using daisy-chain firmware, then it makes no sense to access the digiitzed values of dphi within HT. + void check2() const {if (digitizeWarningsOn_ && digitizedForHTinput_) throw cms::Exception("Stub: You can't access digitized dphi within the HT or KF!");} + +private: + + const Settings* settings_; // configuration parameters. + + unsigned int index_in_vStubs_; // location of this stub in InputData::vStubs + + //--- Parameters passed along optical links from PP to MP (or equivalent ones if easier for analysis software to use). + // WARNING: If you add any variables in this section, take care to ensure that they are digitized correctly by Stub::digitize(). + float phi_; // stub coords, optionally after digitisation. + float r_; + float z_; + float bend_; // bend of stub. + float dphiOverBend_; // related to rho parameter. + float dphiOverBendCorrection_; // Correction from tilt of module + float dphiOverBendCorrection_approx_; // Correction from tilt of module + unsigned int min_qOverPt_bin_; // Range in q/Pt bins in HT array compatible with stub bend. + unsigned int max_qOverPt_bin_; + + //--- Info about the two clusters that make up the stub. + array localU_cluster_; + array localV_cluster_; + + //--- Parameters common to all stubs in a given module. + DetId idDet_; + float rErr_; + float zErr_; + float moduleMinR_; + float moduleMaxR_; + float moduleMinPhi_; + float moduleMaxPhi_; + float moduleMinZ_; + float moduleMaxZ_; + float moduleTilt_; + float pitchOverSep_; + unsigned int iphi_; + float alpha_; + bool psModule_; + unsigned int layerId_; + unsigned int endcapRing_; + bool barrel_; + bool tiltedBarrel_; + float sigmaPerp_; + float sigmaPar_; + float stripPitch_; + float stripLength_; + unsigned int nStrips_; + float sensorWidth_; + bool outerModuleAtSmallerR_; + //--- Truth info about stub. + const TP* assocTP_; + set assocTPs_; + //--- Truth info about the two clusters that make up the stub + array assocTPofCluster_; + + // Would front-end electronics output this stub? + bool frontendPass_; + // Did stub fail window cuts assumed in DegradeBend.h? + bool stubFailedDegradeWindow_; + // Bend in front end chip (prior to degredation by loss of bits & digitization). + float bendInFrontend_; + // Used for stub bend resolution degrading. + unsigned int numMergedBend_; + + DigitalStub digitalStub_; // Class used to digitize stub if required. + bool digitizedForGPinput_; // Has this stub been digitized for GP input? + bool digitizedForHTinput_; // Has this stub been digitized for HT input? + string digitizedForSForTFinput_; // Has this stub been digitized for seed filter or track fitter input? If so, this was its name. + bool digitizedForDRinput_; // Has this stub been digitized for seed filter input? + bool digitizeWarningsOn_; // Enable warnings about accessing non-digitized quantities. + + // Which tracker geometry is this? + static thread_local string trackerGeometryVersion_; + + // Used to provide TMTT recommendations for stub window sizes that CMS should use. + StubWindowSuggest stubWindowSuggest_; + + // Used to degrade stub bend information. + DegradeBend degradeBend_; + + //--- Utility to emulate dead modules. + static bool stubKillerInit_; + static StubKiller stubKiller_; +}; + +} +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/StubCluster.h b/L1Trigger/TrackFindingTMTT/interface/StubCluster.h new file mode 100644 index 0000000000000..c44aa1731a264 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/StubCluster.h @@ -0,0 +1,86 @@ +#ifndef __STUB_CLUSTER_H__ +#define __STUB_CLUSTER_H__ + +#include +#include + + +// Used to merge all clusters assigned to a track in a single layer into a single StubCluster +// whose coordinate is the mean of all the individual clusters. + +namespace TMTT { + +class Stub; +class TP; + +class StubCluster{ + + public : + StubCluster( std::vector stubs, double SectorPhi, int lres_dr = 1 ); + ~StubCluster(){} + + void setLayerKF(unsigned int lay){layerKF_=lay;} // KF encoded tracker layer + unsigned int layerKF() const {return layerKF_;} + + unsigned nStubs() const { return nstubs_; } + std::vector stubs() const { return stubs_; } // Returns original stubs that were usefd to make StubCluster. + double r() const { return r_; } + double phi() const { return phi_; } + double z() const { return z_; } + double eta() const { return eta_; } + std::set assocTPs() const { return assocTPs_; } + unsigned layerId() const { return layerId_; } + unsigned layerIdReduced() const { return layerIdReduced_; } + unsigned endcapRing() const { return endcapRing_; } + bool barrel() const { return barrel_; } + bool tiltedBarrel() const { return tiltedBarrel_;} + bool psModule() const { return psModule_;} + //quadratic sum of the short side error of sensors and RMS of the sensor positions along the short side. + double sigmaX() const { return sigmaX_; } + //quadratic sum of the long side error of sensors and RMS of the sensor positions along the long side. + double sigmaZ() const { return sigmaZ_; } + //phi error from strip pitch + double dphi_dl() const { return dphi_dl_; } + //phi error from strip length in the endcap + double dphi_dr() const { return dphi_dr_; } + //total phi error + double dphi() const { return dphi_; } + //strip distance in cm from the center of the sensor. + double deltal() const { return deltal_; } + //strip distance from the center of the sensor. + double deltai() const { return deltai_; } + //alpha correction for non-radial strips in endcap 2S modules. + double alpha() const { return alpha_;} + // Angle between normal to module and beam-line along +ve z axis. (In range -PI/2 to PI/2). + double moduleTilt() const { return moduleTilt_;} + + private: + std::vector stubs_; + unsigned nstubs_; + double r_; + double phi_; + double z_; + double eta_; + std::set assocTPs_; + unsigned layerId_; + unsigned layerIdReduced_; + unsigned endcapRing_; + unsigned layerKF_; + bool barrel_; + bool tiltedBarrel_; + bool psModule_; + double sigmaX_; + double sigmaZ_; + double dphi_dl_; + double dphi_dr_; + double dphi_; + double deltal_; + double deltai_; + double alpha_; + double moduleTilt_; +}; + +} + +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/StubKiller.h b/L1Trigger/TrackFindingTMTT/interface/StubKiller.h new file mode 100644 index 0000000000000..a82b35fba14a0 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/StubKiller.h @@ -0,0 +1,67 @@ +// Copied from https://raw.githubusercontent.com/EmyrClement/StubKiller/master/StubKiller.cc +// on 9th May 2018. + +#ifndef __STUBKILLER_H__ +#define __STUBKILLER_H__ + +#include "DataFormats/L1TrackTrigger/interface/TTTypes.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "Geometry/CommonTopologies/interface/PixelGeomDetUnit.h" +#include "Geometry/CommonTopologies/interface/PixelTopology.h" +#include "TRandom.h" +#include "TMath.h" + +using namespace std; + +class StubKiller { + +public: + + StubKiller(); + ~StubKiller() {} + + void initialise( unsigned int killScenario, const TrackerTopology* trackerTopology, const TrackerGeometry* trackerGeometry ); + + bool killStub( + const TTStub* stub, + const vector layersToKill, + const int minPhiToKill, + const int maxPhiToKill, + const int minZToKill, + const int maxZToKill, + const int minRToKill, + const int maxRToKill, + const double fractionOfStubsToKillInLayers, + const double fractionOfStubsToKillEverywhere + ); + + bool killStub( const TTStub* stub ); + + bool killStubInDeadModule( const TTStub* stub ); + + map getListOfDeadModules() { return deadModules_ ;} + +private: + void chooseModulesToKill(); + void addDeadLayerModulesToDeadModuleList(); + + unsigned int killScenario_; + const TrackerTopology* trackerTopology_; + const TrackerGeometry* trackerGeometry_; + + vector layersToKill_; + int minPhiToKill_; + int maxPhiToKill_; + int minZToKill_; + int maxZToKill_; + int minRToKill_; + int maxRToKill_; + double fractionOfStubsToKillInLayers_; + double fractionOfStubsToKillEverywhere_; + double fractionOfModulesToKillEverywhere_; + + map deadModules_; +}; + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h b/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h new file mode 100644 index 0000000000000..0955a3a8ee22d --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h @@ -0,0 +1,70 @@ +#ifndef __STUBWINDOWSUGGEST_H__ +#define __STUBWINDOWSUGGEST_H__ + +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" + +#include + +using namespace std; + +class TrackerTopology; + +namespace TMTT { + +class Stub; + +/** + * ======================================================================================================== + * This provides recommendations to CMS for the stub window sizes to be used in the FE electronics. + * It prints the output as a python configuration file in the form of + * L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py . + * + * The recommendations are based on the TMTT method of using the stub bend. Whilst they give + * high efficiency, they do not take into account the requirement to limit the FE electronics band-width, + * so tighter cuts may be needed in reality. + * ======================================================================================================== + */ + +class StubWindowSuggest { + +public: + + // Initialize (for use with TMTT). + StubWindowSuggest(const Settings* settings, const TrackerTopology* trackerTopo) : + settings_(settings), ptMin_(settings->houghMinPt()), theTrackerTopo_(trackerTopo) {} + + // Initialize (for use with HYBRID) + StubWindowSuggest(const Settings* settings) : settings_(settings), ptMin_(settings->houghMinPt()) {} + + ~StubWindowSuggest() {} + + // Analyse stub window required for this stub. + void process(const Stub* stub); + + // Print results (should be done in endJob(); + static void printResults(); + +private: + + // Update stored stub window size with this stub. + void updateStoredWindow(const Stub* stub, double bendWind); + +private: + + // Configuration parameters. + const Settings* settings_; + const float ptMin_; + + const TrackerTopology* theTrackerTopo_; + + // Stub window sizes as encoded in L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h + static std::vector< double > barrelCut_; + static std::vector< std::vector< double > > ringCut_; + static std::vector< std::vector< double > > tiltedCut_; + static std::vector< double > barrelNTilt_; +}; + +} + +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/TP.h b/L1Trigger/TrackFindingTMTT/interface/TP.h new file mode 100644 index 0000000000000..2ac88754f081f --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/TP.h @@ -0,0 +1,137 @@ +#ifndef __TP_H__ +#define __TP_H__ + +#include "DataFormats/Math/interface/deltaPhi.h" +#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h" +#include "DataFormats/Common/interface/Ptr.h" + +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/Utility.h" + +#include "DataFormats/JetReco/interface/GenJetCollection.h" +#include "DataFormats/JetReco/interface/GenJet.h" + +#include + +using namespace std; + +namespace TMTT { + +class Stub; + +typedef edm::Ptr TrackingParticlePtr; + +class TP : public TrackingParticlePtr { + +public: + // Fill useful info about tracking particle. + TP(const TrackingParticlePtr& tpPtr, unsigned int index_in_vTPs, const Settings* settings); + ~TP(){} + + bool operator==(const TP& tpOther) {return (this->index() == tpOther.index());} + + // Fill truth info with association from tracking particle to stubs. + void fillTruth(const vector& vStubs); + + // == Functions for returning info about tracking particles === + + // Location in InputData::vTPs_ + unsigned int index() const { return index_in_vTPs_; } + // Basic TP properties + int pdgId() const { return pdgId_; } + // Did TP come from in-time or out-of-time bunch crossing? + bool inTimeBx() const { return inTimeBx_; } + // Did it come from the main physics collision or from pileup? + bool physicsCollision() const { return physicsCollision_; } + int charge() const { return charge_; } + float mass() const { return mass_; } + float pt() const { return pt_; } + float qOverPt() const { return (pt_ > 0) ? charge_/pt_ : 9.9e9; } + float eta() const { return eta_; } + float theta() const { return theta_; } + float tanLambda() const { return tanLambda_; } + float phi0() const { return phi0_; } + // TP production vertex (x,y,z) coordinates. + float vx() const { return vx_; } + float vy() const { return vy_; } + float vz() const { return vz_; } + // d0 and z0 impact parameters with respect to (x,y) = (0,0). + float d0() const { return d0_;} + float z0() const { return z0_;} + // Estimate track bend angle at a given radius, ignoring scattering. + float dphi(float rad) const { return asin(settings_->invPtToDphi() * rad * charge_/pt_); } + // Estimated phi angle at which TP trajectory crosses a given radius rad, ignoring scattering. + float trkPhiAtR(float rad) const { return reco::deltaPhi(phi0_ - this->dphi(rad) - d0_/rad, 0.); } + // Estimated z coord at which TP trajectory crosses a given radius rad, ignoring scattering. + float trkZAtR(float rad) const { return (vz_ + rad * tanLambda_); } + // Estimated phi angle at which TP trajectory crosses the module containing the given stub. + float trkPhiAtStub(const Stub* stub) const; + // Estimated r coord at which TP trajectory crosses the module containing the given stub. + float trkRAtStub(const Stub* stub) const; + // Estimated z coord at which TP trajectory crosses the module containing the given stub. + float trkZAtStub(const Stub* stub) const; + + // == Functions returning stubs produced by tracking particle. + const vector& assocStubs() const { return assocStubs_; } // associated stubs. (Includes those failing tightened front-end electronics cuts supplied by user). (Which stubs are returned is affected by "StubMatchStrict" config param.) + unsigned int numAssocStubs() const { return assocStubs_.size(); } + unsigned int numLayers() const { return nLayersWithStubs_; } + // TP is worth keeping (e.g. for fake rate measurement) + bool use() const { return use_; } + // TP can be used for efficiency measurement (good kinematics, in-time Bx, optionally specified PDG ID). + bool useForEff() const { return useForEff_; } + // TP can be used for algorithmic efficiency measurement (also requires stubs in enough layers). + bool useForAlgEff() const { return useForAlgEff_; } + + void fillNearestJetInfo( const reco::GenJetCollection* genJets ); // Store info (deltaR, pt) with nearest jet + + float tpInJet() const { return tpInJet_ && nearestJetPt_ > 30; } + float tpInHighPtJet() const { return tpInJet_ && nearestJetPt_ > 100; } + float tpInVeryHighPtJet() const { return tpInJet_ && nearestJetPt_ > 200; } + + float nearestJetPt() const { return nearestJetPt_; } + +private: + + void fillUse(); // Fill the use_ flag. + void fillUseForEff(); // Fill the useForEff_ flag. + void fillUseForAlgEff(); // Fill the useforAlgEff_ flag. + + // Calculate how many tracker layers this TP has stubs in. + void calcNumLayers() { nLayersWithStubs_ = Utility::countLayers( settings_, assocStubs_, false); } + +private: + + unsigned int index_in_vTPs_; // location of this TP in InputData::vTPs + + const Settings* settings_; // Configuration parameters + + int pdgId_; + bool inTimeBx_; // TP came from in-time bunch crossing. + bool physicsCollision_; // True if TP from physics collision rather than pileup. + int charge_; + float mass_; + float pt_; // TP kinematics + float eta_; + float theta_; + float tanLambda_; + float phi0_; + float vx_; // TP production point. + float vy_; + float vz_; + float d0_; // d0 impact parameter with respect to (x,y) = (0,0) + float z0_; // z0 impact parameter with respect to (x,y) = (0,0) + + bool use_; // TP is worth keeping (e.g. for fake rate measurement) + bool useForEff_; // TP can be used for tracking efficiency measurement. + bool useForAlgEff_; // TP can be used for tracking algorithmic efficiency measurement. + + vector assocStubs_; + unsigned int nLayersWithStubs_; // Number of tracker layers with stubs from this TP. + + bool tpInJet_; + float nearestJetPt_; +}; + +} + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h b/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h new file mode 100644 index 0000000000000..53540d2cc1e69 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h @@ -0,0 +1,58 @@ +///=== This is the base class for all the track fit algorithms + +///=== Written by: Alexander D. Morton and Sioni Summers + +#ifndef __TrackFitGeneric_H__ +#define __TrackFitGeneric_H__ + +// Don't fit track candidates if they have more than this number of stubs. +#define __MAX_STUBS_PER_TRK__ 30 + +#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" + +#include +#include + +using namespace std; + +namespace TMTT { + +class Settings; + +class TrackFitGeneric { + +public: + + // Set configuration parameters. + TrackFitGeneric( const Settings* settings, const string &fitterName="" ); + + virtual ~TrackFitGeneric() {} + + // Static method to produce a fitter based on a string +// static std::auto_ptr create(std::string, const Settings* settings); + static TrackFitGeneric* create(std::string, const Settings* settings); + virtual void bookHists(){} + + virtual void initRun() {} + // Fit a track candidate obtained from the Hough Transform. + virtual L1fittedTrack fit( const L1track3D& l1track3D ); + + // Optional debug printout at end of job. + virtual void endJob() {} + + const Settings* getSettings()const{return settings_;} + unsigned nDupStubs()const{ return nDupStubs_; } + +protected: + + // Configuration parameters + const Settings* settings_; + const string fitterName_; + unsigned nDupStubs_; +}; + +} + +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h b/L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h new file mode 100644 index 0000000000000..e12a84794d970 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h @@ -0,0 +1,53 @@ +#ifndef __TRACKERGEOMETRYINFO_H__ +#define __TRACKERGEOMETRYINFO_H__ + +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" + +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" + +#include + +using namespace std; + +class TrackerTopology; +class TrackerGeometry; + +namespace TMTT { + + +/** + * ======================================================================================================== + * Class for storing info on tracker geometry + * Currently stores the z/r and B of tilted modules, and only needs to do this once per job + * ======================================================================================================== + */ + +class TrackerGeometryInfo { + +public: + + // Initialize. + TrackerGeometryInfo(); + + ~TrackerGeometryInfo() {} + + void getTiltedModuleInfo(const Settings* settings, const TrackerTopology* trackerTopo, const TrackerGeometry* trackerGeom); + double barrelNTiltedModules() const { return barrelNTiltedModules_; } + double barrelNLayersWithTiltedModules() const { return barrelNLayersWithTiltedModules_; } + + vector< double > moduleZoR() const { return moduleZoR_; } + vector< double > moduleB() const { return moduleB_; } + +private: + unsigned int barrelNTiltedModules_; + unsigned int barrelNLayersWithTiltedModules_; + + std::vector< double > moduleZoR_; + vector< double > moduleB_; +}; + +} + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h b/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h new file mode 100644 index 0000000000000..6fdba06c544d6 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h @@ -0,0 +1,126 @@ +#ifndef __TrkRZfilter_H__ +#define __TrkRZfilter_H__ + +#include "L1Trigger/TrackFindingTMTT/interface/L1track2D.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" +#include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h" +#include "L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h" + +#include + +using namespace std; + +//=== This class runs filters in track candidates previously found by the r-phi Hough transform, +//=== which check that each track's stubs are consistent with a straight line in the r-z plane. +//=== +//=== The filtering removes inconsistent stubs from the track candidates, & also kills some track candidates +//=== altogether if the filter leaves them with too few stubs. +//=== +//=== The r-z filters also add an estimate of the r-z helix parameters to the selected track candidates, +//=== The filtered tracks are returned at L1track3D type, since they contain this information. +//=== +//=== It does NOT contain filters such as the bend filter, which are so simple that the firmware can run them +//=== INSIDE the r-phi HT. Simple filters of this kind are in class HTcell. +//=== +//=== After creating the L1track3D tracks, TrkRZfilter can optionally run duplicate removal on them, +//=== before they are output. + +namespace TMTT { + +class Settings; +class Stub; + +class TrkRZfilter { + +public: + + TrkRZfilter() : settings_(nullptr), iPhiSec_(0), iEtaReg_(0), etaMinSector_(0), etaMaxSector_(0), phiCentreSector_(0), rzHelix_z0_(0), rzHelix_tanL_(0), rzHelix_set_(false), chosenRofZ_(0), zTrkMinSector_(0), zTrkMaxSector_(0), beamWindowZ_(0) {} + ~TrkRZfilter() {} + + struct SortStubsInLayer{ + inline bool operator() (const Stub *stub1, const Stub *stub2){ + return(fabs(stub1->layerId()) < fabs(stub2->layerId())); + } + }; + + + // Initialize configuration parameters, and note sector number, eta range covered by sector and phi coordinate of its centre. + void init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, + float etaMinSector, float etaMaxSector, float phiCentreSector); + + // Filters track candidates (found by the r-phi Hough transform), removing inconsistent stubs from the tracks, + // also killing some of the tracks altogether if they are left with too few stubs. + // Also adds an estimate of r-z helix parameters to the selected track objects, returning the tracks as L1track3D type. + // + vector filterTracks(const vector& tracks); + + //=== Extra information about each track input to filter. (Only use after you have first called filterTracks). + + // Number of seed combinations considered by the Seed Filter for each input track. + vector numSeedCombsPerTrk() const {return numSeedCombsPerTrk_; } + vector numGoodSeedCombsPerTrk() const {return numGoodSeedCombsPerTrk_; } // Only counts seeds compatible with beam-spot. + + +private: + + //--- Filters returning filtered stubs based on input ones. + + // Use Seed Filter to produce a filtered collection of stubs on this track candidate that are consistent with a straight line + // in r-z using tracklet algo. + vector seedFilter (const vector& stubs, float trkQoverPt, bool print ); + + //--- Estimate r-z helix parameters from centre of eta-sector if no better estimate provided by r-z filter. + void estRZhelix(); + +private: + + //=== Configuration parameters + + const Settings* settings_; + + unsigned int iPhiSec_; // Sector number. + unsigned int iEtaReg_; + float etaMinSector_; // rapidity range of this sector. + float etaMaxSector_; + float phiCentreSector_; // phi coordinate of its centre. + + // Track (z0, tan_lambda) estimate from r-z filter or centre of eta sector, and boolean to indicate if this data is filled. + float rzHelix_z0_; + float rzHelix_tanL_; + bool rzHelix_set_; + + // Useful info for r-z filters. + float chosenRofZ_; // Radius used to defined zTrkMinSector and zTrkMaxSector. + float zTrkMinSector_; // corresponding range of this sector specified as z coordinate of track at given radius. + float zTrkMaxSector_; + float beamWindowZ_; // Assumed length of beam spot in z. + + // Name of r-z track filter algorithm to run. + string rzFilterName_; + + // Filter stubs in cell using Seed Filter? (a tracklet-like algorithm in r-z plane). + bool useSeedFilter_; + + // Options for Seed filter. + float seedResolution_; + bool keepAllSeed_; + + // Number of seed combinations considered by the Seed Filter, for each input track. + vector numSeedCombsPerTrk_; + vector numGoodSeedCombsPerTrk_; + unsigned int maxSeedCombinations_; + unsigned int maxGoodSeedCombinations_; + unsigned int maxSeedsPerStub_; + bool zTrkSectorCheck_; + + // For debugging + unsigned int minNumMatchLayers_; + + //=== Contains algorithm used for optional duplicate track removal. + KillDupTrks killDupTrks_; +}; + +} + +#endif + diff --git a/L1Trigger/TrackFindingTMTT/interface/Utility.h b/L1Trigger/TrackFindingTMTT/interface/Utility.h new file mode 100644 index 0000000000000..890ebdb953f71 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/Utility.h @@ -0,0 +1,46 @@ +#ifndef __UTILITY_H__ +#define __UTILITY_H__ + +#include +#include +using namespace std; + +namespace TMTT { + +class TP; +class Stub; +class Settings; + +namespace Utility { + // Count number of tracker layers a given list of stubs are in. + // + // By default uses the "reduced" layer ID if the configuration file requested it. However, + // you can insist on "normal" layer ID being used instead, ignoring the configuration file, by + // setting disableReducedLayerID = true. + // + // N.B. The "reduced" layer ID merges some layer IDs, so that no more than 8 ID are needed in any + // eta region, so as to simplify the firmware. + // + // N.B. You should set disableReducedLayerID = false when counting the number of layers on a tracking + // particle or how many layers it shares with an L1 track. Such counts by CMS convention use "normal" layer ID. + // + // By default, considers both PS+2S modules, but optionally considers only the PS ones if onlyPS = true. + + unsigned int countLayers(const Settings* settings, const vector& stubs, bool disableReducedLayerID = false, bool onlyPS = false); + + // Given a set of stubs (presumably on a reconstructed track candidate) + // return the best matching Tracking Particle (if any), + // the number of tracker layers in which one of the stubs matched one from this tracking particle, + // and the list of the subset of the stubs which match those on the tracking particle. + + const TP* matchingTP(const Settings* settings, const vector& vstubs, + unsigned int& nMatchedLayersBest, vector& matchedStubsBest); + + // Determine the minimum number of layers a track candidate must have stubs in to be defined as a track. + // The first argument indicates from what type of algorithm this function is called: "HT", "SEED", "DUP" or "FIT". + unsigned int numLayerCut(string algo, const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, float invPt, float eta = 0.); +} + +} + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h new file mode 100644 index 0000000000000..5c94bf145f071 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h @@ -0,0 +1,41 @@ +#ifndef __DEMONSTRATOR_DATAFORMATS_DIGICONVERTER_H__ +#define __DEMONSTRATOR_DATAFORMATS_DIGICONVERTER_H__ + +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" + +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" + +#include "Demonstrator/DataFormats/interface/DigiDTCStub.hpp" +#include "Demonstrator/DataFormats/interface/DigiHTStub.hpp" +#include "Demonstrator/DataFormats/interface/DigiHTMiniStub.hpp" +#include "Demonstrator/DataFormats/interface/DigiKF4Track.hpp" + +namespace demo { + +/** + * @brief Utility class to convert simulation objects into edm did objects + */ + + +class DigiConverter { + public: + DigiConverter( const TMTT::Settings* settings ); + ~DigiConverter() = default; + + DigiDTCStub makeDigiDTCStub( const TMTT::Stub& aDTCStub, uint32_t aDigiPhiSec ) const; + DigiHTStub makeDigiHTStub( const TMTT::Stub& aHTStub, uint32_t aPhiSectorIdInNon, uint32_t aEtaSectorId, int cBin, int aChiZ, int aChiPhi, bool mSel) const; + DigiHTMiniStub makeDigiHTMiniStub( const TMTT::Stub& aHTMiniStub, uint32_t aPhiSectorIdInNon, uint32_t aEtaSectorId, int8_t cBin, int8_t mBin) const; + DigiKF4Track makeDigiKF4Track( const TMTT::L1fittedTrack& aFitTrk ) const; + + private: + + const TMTT::Settings *mSettings; // Configuration parameters. + +}; + + + +} // demo + +#endif /* __DEMONSTRATOR_DATAFORMATS_DIGICONVERTER_H__ */ diff --git a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.icc b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.icc new file mode 100644 index 0000000000000..3981c57fe3b6f --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.icc @@ -0,0 +1,98 @@ +#include "L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h" + + + +namespace demo { + +//----------------------------------------------------------------------------- +DigiConverter::DigiConverter( const TMTT::Settings* settings ) : +mSettings(settings) { + +} +//----------------------------------------------------------------------------- + + +//----------------------------------------------------------------------------- +DigiDTCStub +DigiConverter::makeDigiDTCStub(const TMTT::Stub& aDTCStub, uint32_t aDigiPhiSec) const { + return DigiDTCStub( + aDTCStub.digitalStub().iDigi_PhiO(), + aDTCStub.digitalStub().moduleType(), + aDigiPhiSec, + aDTCStub.digitalStub().iDigi_Z(), + aDTCStub.digitalStub().iDigi_Bend(), + aDTCStub.digitalStub().iDigi_Rt(), + true + ); +} +//----------------------------------------------------------------------------- + + +//----------------------------------------------------------------------------- +DigiHTStub +DigiConverter::makeDigiHTStub( const TMTT::Stub& aHTStub, uint32_t aPhiSectorIdInNon, uint32_t aEtaSectorId, int cBin, int aChiZ, int aChiPhi, bool mSel ) const { + return DigiHTStub( + aHTStub.layerIdReduced(), + aPhiSectorIdInNon, + aEtaSectorId, + cBin, + aChiZ, + aChiPhi, + aHTStub.digitalStub().iDigi_Rt(), + mSel, + true // valid + ); +} +//----------------------------------------------------------------------------- + + +//----------------------------------------------------------------------------- +DigiHTMiniStub +DigiConverter::makeDigiHTMiniStub( const TMTT::Stub& aHTMiniStub, uint32_t aPhiSectorIdInNon, uint32_t aEtaSectorId, int8_t cBin, int8_t mBin) const { + return DigiHTMiniStub( + aHTMiniStub.layerIdReduced(), + aPhiSectorIdInNon, + aEtaSectorId, + cBin, + mBin, + aHTMiniStub.digitalStub().iDigi_PhiS(), + aHTMiniStub.digitalStub().iDigi_Z(), + aHTMiniStub.digitalStub().iDigi_Rt(), + true // valid + ); +} +//----------------------------------------------------------------------------- + + +//----------------------------------------------------------------------------- +DigiKF4Track +DigiConverter::makeDigiKF4Track( const TMTT::L1fittedTrack& aFitTrk ) const { + + const uint numPhiSecPerNon = mSettings->numPhiSectors() / mSettings->numPhiNonants(); + + return DigiKF4Track( + aFitTrk.digitaltrack().iDigi_oneOver2r(), + aFitTrk.digitaltrack().iDigi_phi0rel(), + aFitTrk.digitaltrack().iDigi_tanLambda(), + aFitTrk.digitaltrack().iDigi_z0(), + 0, // d0 + aFitTrk.digitaltrack().iDigi_chisquaredRphi(), + aFitTrk.digitaltrack().iDigi_chisquaredRz(), + aFitTrk.getHitPattern(), + aFitTrk.getNumLayers(), + 0, + aFitTrk.getCellLocationHT().first - mSettings->houghNbinsPt() / 2, + aFitTrk.getCellLocationHT().second - mSettings->houghNbinsPhi() / 2, + aFitTrk.iPhiSec()%numPhiSecPerNon, + aFitTrk.iEtaReg(), + aFitTrk.getCellLocationFit().first - mSettings->houghNbinsPt() / 2, + aFitTrk.getCellLocationFit().second - mSettings->houghNbinsPhi() / 2, + aFitTrk.consistentHTcell(), + true + ); + +} +//----------------------------------------------------------------------------- + +} // namespace demo + diff --git a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.h b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.h new file mode 100644 index 0000000000000..61d03eaa5e9d3 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.h @@ -0,0 +1,72 @@ +#ifndef __DEMONSTRATOR_PRODUCER_DIGIPRODUCER_HPP__ +#define __DEMONSTRATOR_PRODUCER_DIGIPRODUCER_HPP__ + +#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "DataFormats/L1TrackTrigger/interface/TTTypes.h" +#include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h" +#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h" +#include "SimTracker/TrackTriggerAssociation/interface/TTClusterAssociationMap.h" +#include "SimTracker/TrackTriggerAssociation/interface/TTStubAssociationMap.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" +#include "L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h" +#include "DataFormats/Common/interface/DetSetVector.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/Histos.h" +#include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h" +#include "Demonstrator/DataFormats/interface/DigiKF4Track.hpp" +#include "Demonstrator/DataFormats/interface/DigiHTStub.hpp" +#include "Demonstrator/DataFormats/interface/DigiHTMiniStub.hpp" +#include "Demonstrator/DataFormats/interface/DigiDTCStub.hpp" + +#include +#include +#include + +using namespace std; + +namespace demo { + +/*class Settings; +class Histos; +class TrackFitGeneric;*/ + +class DigiProducer : public edm::EDProducer { + +public: + explicit DigiProducer(const edm::ParameterSet&); + ~DigiProducer(){} + +private: + + typedef std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > TTTrackCollection; + + virtual void beginRun(const edm::Run&, const edm::EventSetup&); + virtual void produce(edm::Event&, const edm::EventSetup&); + virtual void endJob() ; + +private: + const edm::EDGetTokenT tpInputTag; + const edm::EDGetTokenT stubInputTag; + const edm::EDGetTokenT stubTruthInputTag; + const edm::EDGetTokenT clusterTruthInputTag; + const edm::EDGetTokenT genJetInputTag_; + + // Configuration parameters + TMTT::Settings *settings_; + vector trackFitters_; + vector useRZfilter_; + bool runRZfilter_; + + TMTT::Histos *hists_; + map fitterWorkerMap_; + + TMTT::TrackerGeometryInfo trackerGeometryInfo_; +}; + +} + +#endif /* __DEMONSTRATOR_PRODUCER_DIGIPRODUCER_HPP__ */ + diff --git a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.icc b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.icc new file mode 100644 index 0000000000000..0d5c0f301a258 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.icc @@ -0,0 +1,526 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "L1Trigger/TrackFindingTMTT/interface/HTcell.h" +#include "L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h" +#include "L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h" +#include "L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h" + +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "MagneticField/Engine/interface/MagneticField.h" +#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" + +#include "L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h" + +#include "boost/numeric/ublas/matrix.hpp" +#include +#include +#include +#include +#include + +// If this defined, then the debug printout requested by Thomas to help with HT debugging is produced. +//#define THOMAS + +// If this is defined, then TTTrack collections will be output using tracks after HT (and optionally r-z filter) too. +//#define OutputHT_TTracks + +using namespace std; +using boost::numeric::ublas::matrix; + +namespace demo { + +DigiProducer::DigiProducer(const edm::ParameterSet& iConfig): + tpInputTag( consumes( iConfig.getParameter("tpInputTag") ) ), + stubInputTag( consumes( iConfig.getParameter("stubInputTag") ) ), + stubTruthInputTag( consumes( iConfig.getParameter("stubTruthInputTag") ) ), + clusterTruthInputTag( consumes( iConfig.getParameter("clusterTruthInputTag") ) ), + genJetInputTag_( consumes( iConfig.getParameter("genJetInputTag") ) ), + trackerGeometryInfo_() { + // Get configuration parameters + settings_ = new TMTT::Settings(iConfig); + trackFitters_ = settings_->trackFitters(); + useRZfilter_ = settings_->useRZfilter(); + runRZfilter_ = (useRZfilter_.size() > 0); // Do any fitters require an r-z track filter to be run? + + // Tame debug printout. + cout.setf(ios::fixed, ios::floatfield); + cout.precision(4); + + // Book histograms. + hists_ = new TMTT::Histos( settings_ ); + hists_->book(); + + // Create track fitting algorithm (& internal histograms if it uses them) + for (const string& fitterName : trackFitters_) { + fitterWorkerMap_[ fitterName ] = TMTT::TrackFitGeneric::create(fitterName, settings_); + fitterWorkerMap_[ fitterName ]->bookHists(); + } + + //--- Define EDM output to be written to file (if required) + + // L1 tracks found by Hough Transform + // produces< TTTrackCollection >( "TML1TracksHT" ).setBranchAlias("TML1TracksHT"); + // L1 tracks found by r-z track filter. + + produces ("SimDigiKF4Tracks").setBranchAlias("SimDigiKF4Tracks"); + produces ("SimDigiKF4TracksWithDups").setBranchAlias("SimDigiKF4TracksWithDups"); + produces ("SimDigiHTStubs").setBranchAlias("SimDigiHTStubs"); + produces ("SimDigiHTMiniStubs").setBranchAlias("SimDigiHTMiniStubs"); + produces ("SimDigiHTStubs").setBranchAlias("SimDigiHTStubs"); + produces ("SimDigiDTCStubs").setBranchAlias("SimDigiDTCStubs"); + // L1 tracks after track fit by each of the fitting algorithms under study + for (const string& fitterName : trackFitters_) { + string edmName = string("TML1Tracks") + fitterName; + produces< TTTrackCollection >(edmName).setBranchAlias(edmName); + } +} + + +void DigiProducer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) { + // Get the B-field and store its value in the Settings class. + + edm::ESHandle magneticFieldHandle; + iSetup.get().get(magneticFieldHandle); + const MagneticField* theMagneticField = magneticFieldHandle.product(); + float bField = theMagneticField->inTesla(GlobalPoint(0, 0, 0)).z(); // B field in Tesla. + cout << endl << "--- B field = " << bField << " Tesla ---" << endl << endl; + + settings_->setBfield(bField); + + // Initialize track fitting algorithm at start of run (especially with B-field dependent variables). + for (const string& fitterName : trackFitters_) { + fitterWorkerMap_[ fitterName ]->initRun(); + } + + // Print info on tilted modules + edm::ESHandle trackerGeometryHandle; + iSetup.get().get( trackerGeometryHandle ); + const TrackerGeometry* trackerGeometry = trackerGeometryHandle.product(); + + edm::ESHandle trackerTopologyHandle; + iSetup.get().get(trackerTopologyHandle); + const TrackerTopology* trackerTopology = trackerTopologyHandle.product(); + + trackerGeometryInfo_.getTiltedModuleInfo( settings_, trackerTopology, trackerGeometry ); +} + +void DigiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { + + + // Note useful info about MC truth particles and about reconstructed stubs . + TMTT::InputData inputData(iEvent, iSetup, settings_, tpInputTag, stubInputTag, stubTruthInputTag, clusterTruthInputTag, genJetInputTag_ ); + + const vector& vTPs = inputData.getTPs(); + const vector& vStubs = inputData.getStubs(); + + // Creates matrix of Sector objects, which decide which stubs are in which (eta,phi) sector + matrix mSectors(settings_->numPhiSectors(), settings_->numEtaRegions()); + // Create matrix of r-phi Hough-Transform arrays, with one-to-one correspondence to sectors. + matrix mHtRphis(settings_->numPhiSectors(), settings_->numEtaRegions()); + // Create matrix of Get3Dtracks objects, to run optional r-z track filter, with one-to-one correspondence to sectors. + matrix mGet3Dtrks(settings_->numPhiSectors(), settings_->numEtaRegions()); + + //=== Initialization + // Create utility for converting L1 tracks from our private format to official CMSSW EDM format. + const TMTT::ConverterToTTTrack converter(settings_); + const DigiConverter digiConverter(settings_); + + const unsigned int nFitAlgs = trackFitters_.size(); + + std::unique_ptr allFitTTTracksForOutput[nFitAlgs]; + std::unique_ptr allDigiKF4Tracks(new std::vector< DigiKF4Track >); + std::unique_ptr allDigiKF4TracksWithDups(new std::vector< DigiKF4Track >); + std::unique_ptr allDigiHTMiniStubs(new std::vector< DigiHTMiniStub >); + std::unique_ptr allDigiHTStubs(new std::vector< DigiHTStub >); + std::unique_ptr allDigiDTCStubs(new std::vector< DigiDTCStub >); + + map locationInsideArray; + unsigned int ialg = 0; + for (const string& fitterName : trackFitters_) { + std::unique_ptr fitTTTracksForOutput(new TTTrackCollection); + allFitTTTracksForOutput[ialg] = std::move( fitTTTracksForOutput ); + locationInsideArray[fitterName] = ialg++; + } + + //=== Do tracking in the r-phi Hough transform within each sector. + +#ifdef THOMAS + // Debug printout for Thomas + static unsigned int jEventCount = 0; + cout<<"============================ DIGI EVENT "<, ostringstream> thomasString; +#endif + + map > stubsInNonant; + uint numPhiSecPerNon = settings_->numPhiSectors() / settings_->numPhiNonants(); + + // Fill Hough-Transform arrays with stubs. + for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { + + TMTT::Sector& sector = mSectors(iPhiSec, iEtaReg); + TMTT::HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); + + // Initialize constants for this sector. + sector.init(settings_, iPhiSec, iEtaReg); + htRphi.init(settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), sector.phiCentre()); + + // Check sector is enabled (always true, except if user disabled some for special studies). + if (settings_->isHTRPhiEtaRegWhitelisted(iEtaReg)) { + + for (const TMTT::Stub* stub : vStubs) { + // Digitize stub as would be at input to GP. This doesn't need the nonant number, since we assumed an integer number of + // phi digitisation bins inside an nonant. N.B. This changes the coordinates & bend stored in the stub. + // The cast allows us to ignore the "const". + + const_cast(stub)->digitizeForGPinput(iPhiSec); + // Check if stub is inside this sector + bool inside = sector.inside( stub ); + + if (inside) { + // Check which eta subsectors within the sector the stub is compatible with (if subsectors being used). + const vector inEtaSubSecs = sector.insideEtaSubSecs( stub ); + + // Digitize stub if as would be at input to HT, which slightly degrades its coord. & bend resolution, affecting the HT performance. + const_cast(stub)->digitizeForHTinput(iPhiSec); + + // Store stub in Hough transform array for this sector, indicating its compatibility with eta subsectors with sector. + htRphi.store( stub, inEtaSubSecs ); + + unsigned int iPhiNonant = std::floor(iPhiSec / numPhiSecPerNon); + unsigned int digiPhiSec = iPhiSec % numPhiSecPerNon; + + set& stubsInThisNonant = stubsInNonant[iPhiNonant]; + if (std::count(stubsInThisNonant.begin(), stubsInThisNonant.end(), stub) == 0) { + stubsInNonant[iPhiSec/2].insert(stub); + + DigiDTCStub digiDTCStub = digiConverter.makeDigiDTCStub( *stub, digiPhiSec ); + + std::srand(stub->digitalStub().iDigi_PhiO()); + short unsigned int link_init = rand() % 48; + + digiDTCStub.setRouteId({(uint16_t)(iPhiNonant), (uint16_t)link_init, DigiRouteId::kNullTimeIndex}); + allDigiDTCStubs->push_back(digiDTCStub); + +#ifdef THOMAS + // IRT - debug printout for Thomas + unsigned int link = link_init; // GP input links in use in firmware. + if (link >= 36) { + link += 20; + } else if (link >= 12) { + link += 12; + } else { + link += 4; + } + int mBinMin = (int(stub->min_qOverPt_bin()) - int(settings_->houghNbinsPt()) / 2) / 2; + int mBinMax = (int(stub->max_qOverPt_bin()) - int(settings_->houghNbinsPt()) / 2) / 2; + thomasString[pair(iPhiNonant,stub)]<<"DIGI STUB: iNonant="< HTBase::end() + } + } + +#ifdef THOMAS + // Thomas debug printout. + for (const auto& p : thomasString) { + cout<<(p.second).str()<muxOutputsHT() > 0) { + // Multiplex outputs of several HT onto one pair of output opto-links. + // This only affects tracking performance if option busySectorKill is enabled, so that tracks that + // can't be sent down the link within the time-multiplexed period are killed. + TMTT::MuxHToutputs muxHT(settings_); + muxHT.exec(mHtRphis); + } + + // + for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { + + unsigned int iNonant = iPhiSec / numPhiSecPerNon; + unsigned int iPhiSecInNonant = iPhiSec%numPhiSecPerNon; + + for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { + + const TMTT::Sector& sector = mSectors(iPhiSec, iEtaReg); + + TMTT::Get3Dtracks& get3DtrkCoarse = mGet3Dtrks(iPhiSec, iEtaReg); + // Initialize utility for making 3D tracks from 2D ones. + get3DtrkCoarse.init(settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), sector.phiCentre()); + + // Convert 2D tracks found by HT to 3D tracks (optionally by running r-z filters & duplicate track removal) + get3DtrkCoarse.run(mHtRphis(iPhiSec, iEtaReg).trackCands2D()); + + // Loop over candidates in this phi/eta sector + for ( const TMTT::L1track3D& trk : get3DtrkCoarse.trackCands3D(false)) { + auto lMTrk = const_cast(trk); + auto lChiPhi = lMTrk.getChiPhiDigi(); + auto lChiZ = lMTrk.getChiZDigi(); + const auto& lStubs = lMTrk.getStubs(); + + int8_t cBin = (trk.getCellLocationHT().second - settings_->houghNbinsPhi() / 2) / 2; + int8_t mBin = (trk.getCellLocationHT().first - settings_->houghNbinsPt() / 2) / 2; + //bool mSel = (mBin % 2 == 0); + // IRT - fix to match firmware - no longer needed. + //mBin = -int(mBin) - 1; + bool mSel = (mBin >= 0); + + //cout<<"Thomas check: mBin="<push_back(digiTrack); + } + } + + + ///allDigiKFTracks Run duplicate track removal on the fitted tracks if requested. + const vector filtFittedTracksInSec = killDupFitTrks.filter( fittedTracksInSec ); + + // Store fitted tracks from entire tracker. + for (const TMTT::L1fittedTrack& fitTrk : filtFittedTracksInSec) { + fittedTracks[fitterName].push_back(fitTrk); + // Convert these fitted tracks to EDM format for output (used for collaborative work outside TMTT group). + TTTrack< Ref_Phase2TrackerDigi_ > fitTTTrack = converter.makeTTTrack(fitTrk, iPhiSec, iEtaReg); + allFitTTTracksForOutput[locationInsideArray[fitterName]]->push_back(fitTTTrack); + if (!settings_->enableDigitize() && "Digitization must be enabled to run the digi producer" ) {assert(0);} + + // Save digi tracks without duplicates + DigiKF4Track digiTrack = digiConverter.makeDigiKF4Track(fitTrk); + + digiTrack.setRouteId({(uint16_t)(iPhiSec / numPhiSecPerNon), DigiRouteId::kNullChannel, DigiRouteId::kNullTimeIndex}); + allDigiKF4Tracks->push_back(digiTrack); + } + } + } + } + + // Debug printout + unsigned int static nEvents = 0; + nEvents++; + if (settings_->debug() >= 1 && nEvents <= 1000) { + cout << "INPUT #TPs = " << vTPs.size() << " #STUBs = " << vStubs.size() << endl; + unsigned int numHTtracks = 0; + for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { + const TMTT::Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); + numHTtracks += get3Dtrk.trackCands3D(false).size(); + } + } + cout << "Number of tracks after HT = " << numHTtracks << endl; + for (const auto& p : fittedTracks) { + const string& fitName = p.first; + const vector& fittedTracks = p.second; + cout << "Number of tracks after " << fitName << " track helix fit = " << fittedTracks.size() << endl; + } + } + + + // Allow histogramming to plot undigitized variables. + for (const TMTT::Stub* stub : vStubs) { + if (settings_->enableDigitize()) (const_cast(stub))->setDigitizeWarningsOn(false); + } + + // Fill histograms to monitor input data & tracking performance. + hists_->fill(inputData, mSectors, mHtRphis, mGet3Dtrks, fittedTracks); + + //=== Store output EDM track and hardware stub collections. + iEvent.put(std::move(allDigiKF4Tracks), "SimDigiKF4Tracks"); + iEvent.put(std::move(allDigiKF4TracksWithDups), "SimDigiKF4TracksWithDups"); + iEvent.put(std::move(allDigiHTStubs), "SimDigiHTStubs"); + iEvent.put(std::move(allDigiHTMiniStubs), "SimDigiHTMiniStubs"); + iEvent.put(std::move(allDigiDTCStubs), "SimDigiDTCStubs"); +} + + +void DigiProducer::endJob() { + // Print stub window sizes that TMTT recommends CMS uses in FE chips. + if (settings_->printStubWindows()) TMTT::StubWindowSuggest::printResults(); + + // Optional debug printout from track fitters at end of job. + for (const string& fitterName : trackFitters_) { + fitterWorkerMap_[ fitterName ]->endJob(); + } + + // Print job summary + hists_->trackerGeometryAnalysis(trackerGeometryInfo_); + hists_->endJobAnalysis(); + + for (const string& fitterName : trackFitters_) { + //cout << "# of duplicated stubs = " << fitterWorkerMap_[fitterName]->nDupStubs() << endl; + delete fitterWorkerMap_[ string(fitterName) ]; + } + + cout << endl << "Number of (eta,phi) sectors used = (" << settings_->numEtaRegions() << "," << settings_->numPhiSectors() << ")" << endl; + +} + +DEFINE_FWK_MODULE(DigiProducer); + +} diff --git a/L1Trigger/TrackFindingTMTT/interfaceDemo/README b/L1Trigger/TrackFindingTMTT/interfaceDemo/README new file mode 100644 index 0000000000000..6052378907dbb --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interfaceDemo/README @@ -0,0 +1,3 @@ +The files in this subdirectory are compiled only when using the TMTT software with +the demonstrator code https://gitlab.cern.ch/cms-uk-tracktrigger/software/demo/Demonstrator/blob/master/README.md , +for comparing it with firmware. diff --git a/L1Trigger/TrackFindingTMTT/plugins/BuildFile.xml b/L1Trigger/TrackFindingTMTT/plugins/BuildFile.xml new file mode 100644 index 0000000000000..959b8fdd463f7 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/plugins/BuildFile.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc new file mode 100644 index 0000000000000..4908e9a34c542 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc @@ -0,0 +1,387 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "L1Trigger/TrackFindingTMTT/interface/HTcell.h" +#include "L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h" +#include "L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h" +#include "L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h" + +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "MagneticField/Engine/interface/MagneticField.h" +#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" + +#include "boost/numeric/ublas/matrix.hpp" +#include +#include +#include + +// If this is defined, then TTTrack collections will be output using tracks after HT (and optionally r-z filter) too. +//#define OutputHT_TTracks + +using namespace std; +using boost::numeric::ublas::matrix; + +namespace TMTT { + +TMTrackProducer::TMTrackProducer(const edm::ParameterSet& iConfig): + stubInputTag( consumes( iConfig.getParameter("stubInputTag") ) ), + trackerGeometryInfo_() +{ + // Get configuration parameters + settings_ = new Settings(iConfig); + + if (settings_->enableMCtruth()) { + // These lines use lots of CPU, even if no use of truth info is made later. + tpInputTag = consumes( iConfig.getParameter("tpInputTag") ); + stubTruthInputTag = consumes( iConfig.getParameter("stubTruthInputTag") ); + clusterTruthInputTag = consumes( iConfig.getParameter("clusterTruthInputTag") ); + genJetInputTag_ = consumes( iConfig.getParameter("genJetInputTag") ); + } + + trackFitters_ = settings_->trackFitters(); + useRZfilter_ = settings_->useRZfilter(); + runRZfilter_ = (useRZfilter_.size() > 0); // Do any fitters require an r-z track filter to be run? + + // Tame debug printout. + cout.setf(ios::fixed, ios::floatfield); + cout.precision(4); + + // Book histograms. + hists_ = new Histos( settings_ ); + hists_->book(); + + // Create track fitting algorithm (& internal histograms if it uses them) + for (const string& fitterName : trackFitters_) { + fitterWorkerMap_[ fitterName ] = TrackFitGeneric::create(fitterName, settings_); + fitterWorkerMap_[ fitterName ]->bookHists(); + } + + //--- Define EDM output to be written to file (if required) + +#ifdef OutputHT_TTracks + // L1 tracks found by Hough Transform + produces< TTTrackCollection >( "TML1TracksHT" ).setBranchAlias("TML1TracksHT"); + // L1 tracks found by r-z track filter. + if (runRZfilter_) produces< TTTrackCollection >( "TML1TracksRZ" ).setBranchAlias("TML1TracksRZ"); +#endif + // L1 tracks after track fit by each of the fitting algorithms under study + for (const string& fitterName : trackFitters_) { + string edmName = string("TML1Tracks") + fitterName; + produces< TTTrackCollection >(edmName).setBranchAlias(edmName); + } +} + + +void TMTrackProducer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) +{ + // Get the B-field and store its value in the Settings class. + + edm::ESHandle magneticFieldHandle; + iSetup.get().get(magneticFieldHandle); + const MagneticField* theMagneticField = magneticFieldHandle.product(); + float bField = theMagneticField->inTesla(GlobalPoint(0,0,0)).z(); // B field in Tesla. + cout<setBfield(bField); + + // Initialize track fitting algorithm at start of run (especially with B-field dependent variables). + for (const string& fitterName : trackFitters_) { + fitterWorkerMap_[ fitterName ]->initRun(); + } + + // Print info on tilted modules + edm::ESHandle trackerGeometryHandle; + iSetup.get().get( trackerGeometryHandle ); + const TrackerGeometry* trackerGeometry = trackerGeometryHandle.product(); + + edm::ESHandle trackerTopologyHandle; + iSetup.get().get(trackerTopologyHandle); + const TrackerTopology* trackerTopology = trackerTopologyHandle.product(); + + trackerGeometryInfo_.getTiltedModuleInfo( settings_, trackerTopology, trackerGeometry ); +} + +void TMTrackProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + + // edm::Handle tpHandle; + // edm::EDGetToken token( consumes>( edm::InputTag( "mix", "MergedTrackTruth" ) ) ); + // iEvent.getByToken(inputTag, tpHandle ); + + + // Note useful info about MC truth particles and about reconstructed stubs . + InputData inputData(iEvent, iSetup, settings_, tpInputTag, stubInputTag, stubTruthInputTag, clusterTruthInputTag, genJetInputTag_); + + const vector& vTPs = inputData.getTPs(); + const vector& vStubs = inputData.getStubs(); + + // Creates matrix of Sector objects, which decide which stubs are in which (eta,phi) sector + matrix mSectors(settings_->numPhiSectors(), settings_->numEtaRegions()); + // Create matrix of r-phi Hough-Transform arrays, with one-to-one correspondence to sectors. + matrix mHtRphis(settings_->numPhiSectors(), settings_->numEtaRegions()); + // Create matrix of Get3Dtracks objects, to run optional r-z track filter, with one-to-one correspondence to sectors. + matrix mGet3Dtrks(settings_->numPhiSectors(), settings_->numEtaRegions()); + + //=== Initialization + // Create utility for converting L1 tracks from our private format to official CMSSW EDM format. + const ConverterToTTTrack converter(settings_); +#ifdef OutputHT_TTracks + // Storage for EDM L1 track collection to be produced directly from HT output. + std::unique_ptr htTTTracksForOutput(new TTTrackCollection); + // Storage for EDM L1 track collection to be produced directly from r-z track filter output (if run). + std::unique_ptr rzTTTracksForOutput(new TTTrackCollection); +#endif + // Storage for EDM L1 track collection to be produced from fitted tracks (one for each fit algorithm being used). + // auto_ptr cant be stored in std containers, so use C one, together with map noting which element corresponds to which algorithm. + const unsigned int nFitAlgs = trackFitters_.size(); + std::unique_ptr allFitTTTracksForOutput[nFitAlgs]; + map locationInsideArray; + unsigned int ialg = 0; + for (const string& fitterName : trackFitters_) { + std::unique_ptr fitTTTracksForOutput(new TTTrackCollection); + allFitTTTracksForOutput[ialg] = std::move( fitTTTracksForOutput ); + locationInsideArray[fitterName] = ialg++; + } + + //=== Do tracking in the r-phi Hough transform within each sector. + + // Fill Hough-Transform arrays with stubs. + for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { + + Sector& sector = mSectors(iPhiSec, iEtaReg); + HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); + + // Initialize constants for this sector. + sector.init(settings_, iPhiSec, iEtaReg); + htRphi.init(settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), sector.phiCentre()); + + // Check sector is enabled (always true, except if user disabled some for special studies). + if (settings_->isHTRPhiEtaRegWhitelisted(iEtaReg)) { + + for (const Stub* stub: vStubs) { + // Digitize stub as would be at input to GP. This doesn't need the nonant number, since we assumed an integer number of + // phi digitisation bins inside an nonant. N.B. This changes the coordinates & bend stored in the stub. + // The cast allows us to ignore the "const". + if (settings_->enableDigitize()) (const_cast(stub))->digitizeForGPinput(iPhiSec); + + // Check if stub is inside this sector + bool inside = sector.inside( stub ); + + if (inside) { + // Check which eta subsectors within the sector the stub is compatible with (if subsectors being used). + const vector inEtaSubSecs = sector.insideEtaSubSecs( stub ); + + // Digitize stub if as would be at input to HT, which slightly degrades its coord. & bend resolution, affecting the HT performance. + if (settings_->enableDigitize()) (const_cast(stub))->digitizeForHTinput(iPhiSec); + + // Store stub in Hough transform array for this sector, indicating its compatibility with eta subsectors with sector. + htRphi.store( stub, inEtaSubSecs ); + } + } + } + + // Find tracks in r-phi HT array. + htRphi.end(); // Calls htArrayRphi_.end() -> HTBase::end() + } + } + + if (settings_->muxOutputsHT() > 0) { + // Multiplex outputs of several HT onto one pair of output opto-links. + // This only affects tracking performance if option busySectorKill is enabled, so that tracks that + // can't be sent down the link within the time-multiplexed period are killed. + MuxHToutputs muxHT(settings_); + muxHT.exec(mHtRphis); + } + + // Optionally, run 2nd stage mini HT -- WITHOUT TRUNCATION ??? + if ( settings_->miniHTstage() ) { + MiniHTstage miniHTstage( settings_ ); + miniHTstage.exec( mHtRphis ); + } + + //=== Make 3D tracks, optionally running r-z track filters (such as Seed Filter) & duplicate track removal. + + for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { + + const Sector& sector = mSectors(iPhiSec, iEtaReg); + + // Get tracks found by r-phi HT. + const HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); + const vector& vecTracksRphi = htRphi.trackCands2D(); + + Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); + // Initialize utility for making 3D tracks from 2D ones. + get3Dtrk.init(settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), sector.phiCentre()); + + // Convert 2D tracks found by HT to 3D tracks (optionally by running r-z filters & duplicate track removal) + get3Dtrk.run(vecTracksRphi); + +#ifdef OutputHT_TTracks + // Convert these tracks to EDM format for output (used for collaborative work outside TMTT group). + // Do this for tracks output by HT & optionally also for those output by r-z track filter. + const vector& vecTrk3D_ht = get3Dtrk.trackCands3D(false); + for (const L1track3D& trk : vecTrk3D_ht) { + TTTrack< Ref_Phase2TrackerDigi_ > htTTTrack = converter.makeTTTrack(trk, iPhiSec, iEtaReg); + htTTTracksForOutput->push_back( htTTTrack ); + } + + if (runRZfilter_) { + const vector& vecTrk3D_rz = get3Dtrk.trackCands3D(true); + for (const L1track3D& trk : vecTrk3D_rz) { + TTTrack< Ref_Phase2TrackerDigi_ > rzTTTrack = converter.makeTTTrack(trk, iPhiSec, iEtaReg); + rzTTTracksForOutput->push_back( rzTTTrack ); + } + } +#endif + } + } + + // Initialize the duplicate track removal algorithm that can optionally be run after the track fit. + KillDupFitTrks killDupFitTrks; + killDupFitTrks.init(settings_, settings_->dupTrkAlgFit()); + + //=== Do a helix fit to all the track candidates. + + map> fittedTracks; + // Initialize with empty vector in case no fitted tracks found. + for (const string& fitterName : trackFitters_) { // Loop over fit algos. + fittedTracks[fitterName] = vector(); + } + + for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { + + const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); + + // Loop over all the fitting algorithms we are trying. + for (const string& fitterName : trackFitters_) { + + // Does this fitter require r-z track filter to be run before it? + bool useRZfilt = (std::count(useRZfilter_.begin(), useRZfilter_.end(), fitterName) > 0); + + // Get 3D track candidates found by Hough transform (plus optional r-z filters/duplicate removal) in this sector. + const vector& vecTrk3D = get3Dtrk.trackCands3D(useRZfilt); + + // Fit all tracks in this sector + vector fittedTracksInSec; + for (const L1track3D& trk : vecTrk3D) { + + // IRT + //bool OK = (trk.getMatchedTP() != nullptr && trk.getMatchedTP()->pt() > 50 && fabs(trk.getMatchedTP()->eta()) > 1.4 && fabs(trk.getMatchedTP()->eta()) < 1.8); + //if (trk.getNumStubs() != trk.getNumLayers()) OK = false; + //if (not OK) continue; + + // Ensure stubs assigned to this track is digitized with respect to the phi sector the track is in. + if (settings_->enableDigitize()) { + const vector& stubsOnTrk = trk.getStubs(); + for (const Stub* s : stubsOnTrk) { + (const_cast(s))->digitizeForHTinput(iPhiSec); + // Also digitize stub in way this specific track fitter uses it. + (const_cast(s))->digitizeForSForTFinput(fitterName); + } + } + + L1fittedTrack fitTrack = fitterWorkerMap_[fitterName]->fit(trk); + + if (fitTrack.accepted()) { // If fitter accepted track, then store it. + // Optionally digitize fitted track, degrading slightly resolution. + if (settings_->enableDigitize()) fitTrack.digitizeTrack(fitterName); + // Store fitted tracks, such that there is one fittedTracks corresponding to each HT tracks. + // N.B. Tracks rejected by the fit are also stored, but marked. + fittedTracksInSec.push_back(fitTrack); + } + } + + // Run duplicate track removal on the fitted tracks if requested. + const vector filtFittedTracksInSec = killDupFitTrks.filter( fittedTracksInSec ); + + // Store fitted tracks from entire tracker. + for (const L1fittedTrack& fitTrk : filtFittedTracksInSec) { + fittedTracks[fitterName].push_back(fitTrk); + // Convert these fitted tracks to EDM format for output (used for collaborative work outside TMTT group). + TTTrack< Ref_Phase2TrackerDigi_ > fitTTTrack = converter.makeTTTrack(fitTrk, iPhiSec, iEtaReg); + allFitTTTracksForOutput[locationInsideArray[fitterName]]->push_back(fitTTTrack); + } + } + } + } + + // Debug printout + unsigned int static nEvents = 0; + nEvents++; + if (settings_->debug() >= 1 && nEvents <= 1000) { + cout<<"INPUT #TPs = "<printStubWindows()) StubWindowSuggest::printResults(); + + // Optional debug printout from track fitters at end of job. + for (const string& fitterName : trackFitters_) { + fitterWorkerMap_[ fitterName ]->endJob(); + } + + // Print job summary + hists_->trackerGeometryAnalysis(trackerGeometryInfo_); + hists_->endJobAnalysis(); + + for (const string& fitterName : trackFitters_) { + //cout << "# of duplicated stubs = " << fitterWorkerMap_[fitterName]->nDupStubs() << endl; + delete fitterWorkerMap_[ string(fitterName) ]; + } + + cout<numEtaRegions() << "," << settings_->numPhiSectors()<<")"< +#include +#include + +using namespace std; + +namespace TMTT { + +class Settings; +class Histos; +class TrackFitGeneric; + +class TMTrackProducer : public edm::EDProducer { + +public: + explicit TMTrackProducer(const edm::ParameterSet&); + ~TMTrackProducer(){} + +private: + + typedef std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > TTTrackCollection; + + virtual void beginRun(const edm::Run&, const edm::EventSetup&); + virtual void produce(edm::Event&, const edm::EventSetup&); + virtual void endJob() ; + +private: + edm::EDGetTokenT stubInputTag; + edm::EDGetTokenT tpInputTag; + edm::EDGetTokenT stubTruthInputTag; + edm::EDGetTokenT clusterTruthInputTag; + edm::EDGetTokenT genJetInputTag_; + + // Configuration parameters + Settings *settings_; + vector trackFitters_; + vector useRZfilter_; + bool runRZfilter_; + + Histos *hists_; + map fitterWorkerMap_; + + TrackerGeometryInfo trackerGeometryInfo_; +}; + +} + +#endif + diff --git a/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py new file mode 100644 index 0000000000000..15097a143b3f5 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py @@ -0,0 +1,473 @@ +import FWCore.ParameterSet.Config as cms + +#--------------------------------------------------------------------------------------------------------- +# This describes the full TMTT track reconstruction chain with 3 GeV threshold, where: +# the GP divides the tracker into 18 eta sectors (each sub-divided into 2 virtual eta subsectors); +# the HT uses a 32x18 array followed by 2x2 mini-HT array, with transverese HT readout & multiplexing, +# followed by the KF (or optionally SF+SLR) track fit; duplicate track removal (Algo50) is run. +#--------------------------------------------------------------------------------------------------------- + +TMTrackProducer_params = cms.PSet( + + tpInputTag = cms.InputTag("mix", "MergedTrackTruth"), + stubInputTag = cms.InputTag("TTStubsFromPhase2TrackerDigis", "StubAccepted"), + stubTruthInputTag = cms.InputTag("TTStubAssociatorFromPixelDigis", "StubAccepted"), + clusterTruthInputTag = cms.InputTag("TTClusterAssociatorFromPixelDigis", "ClusterAccepted"), + genJetInputTag = cms.InputTag("ak4GenJets", ""), + + # Enable all use of MC truth info (disable to save CPU) + EnableMCtruth = cms.bool(True), + # Enable output histograms & job tracking performance summary (disable to save CPU) + EnableHistos = cms.bool(True), + + #=== Cuts on MC truth particles (i.e., tracking particles) used for tracking efficiency measurements. + + GenCuts = cms.PSet( + GenMinPt = cms.double(3.0), + GenMaxAbsEta = cms.double(2.4), + GenMaxVertR = cms.double(1.0), # Max distance of particle production vertex from centre of CMS. + GenMaxVertZ = cms.double(30.0), + GenMaxD0 = cms.double(5.0), # Max transverse impact parameter. + GenMaxZ0 = cms.double(999.0), # Max transverse impact parameter. + GenPdgIds = cms.vuint32(), # Only particles with these PDG codes used for efficiency measurement. + + # Additional cut on MC truth tracks used for algorithmic tracking efficiency measurements. + # You should usually set this equal to value of L1TrackDef.MinStubLayers below, unless L1TrackDef.MinPtToReduceLayers + # is < 10000, in which case, set it equal to (L1TrackDef.MinStubLayers - 1). + GenMinStubLayers = cms.uint32(4) + ), + + #=== Cuts applied to stubs before arriving in L1 track finding board. + + StubCuts = cms.PSet( + # Reduce number of bits used by front-end chips to store stub bend info? + # = 0 (no); = 1 (yes using official recipe); = 2 (yes using TMTT method) + DegradeBendRes = cms.uint32(2), + # Don't use stubs with eta beyond this cut, since the tracker geometry makes it impossible to reconstruct tracks with them. + MaxStubEta = cms.double(2.4), + # Don't use stubs whose measured Pt from bend info is significantly below HTArraySpec.HoughMinPt, where "significantly" means allowing for resolution in q/Pt derived from stub bend resolution specified below. + KillLowPtStubs = cms.bool(True), + # Print stub windows corresponding to KillLowPtStubs, in python cfg format used by CMSSW. + PrintStubWindows = cms.bool(False), + # Bend resolution assumed by bend filter in units of strip pitch. Also used when assigning stubs to sectors if EtaPhiSectors.CalcPhiTrkRes=True. And by the bend filter if HTFillingRphi.UseBendFilter=True. + # Suggested value: 1.19 if DegradeBendRes = 0, or 1.249 if it > 0. + # N.B. Avoid 1/4-integer values due to rounding error issues. + BendResolution = cms.double(1.249), + # Additional contribution to bend resolution from its encoding into a reduced number of bits. + # This number is the assumed resolution relative to the naive guess of its value. + # It is ignored in DegradeBendRes = 0. + BendResolutionExtra = cms.double(0.0), + # Order stubs by bend in DTC, such that highest Pt stubs are transmitted first. + OrderStubsByBend = cms.bool(True) + ), + + #=== Optional Stub digitization. + + StubDigitize = cms.PSet( + EnableDigitize = cms.bool(True), # Digitize stub coords? If not, use floating point coords. + # + #--- Parameters available in MP board. (And in case of Hybrid used internally in KF) + # + PhiSectorBits = cms.uint32(6), # Bits used to store phi sector number -- NOT USED + PhiSBits = cms.uint32(14), # Bits used to store phiS coord. (13 enough?) + PhiSRange = cms.double(0.698131700), # Range phiS coord. covers in radians. + RtBits = cms.uint32(12), # Bits used to store Rt coord. + RtRange = cms.double(91.652837), # Range Rt coord. covers in units of cm. + ZBits = cms.uint32(14), # Bits used to store z coord. + ZRange = cms.double(733.2227), # Range z coord. covers in units of cm. + # + #--- Parameters available in GP board (excluding any in common with MP specified above). + # + PhiOBits = cms.uint32(15), # Bits used to store PhiO parameter. + PhiORange = cms.double(1.3962634), # Range PhiO parameter covers. + BendBits = cms.uint32(6) # Bits used to store stub bend. + ), + + #=== Configuration of Geometric Processor. + + GeometricProc = cms.PSet( + # Use an FPGA-friendly approximation to determine track angle dphi from bend in GP? + UseApproxB = cms.bool(True), # Use approximation for B + # Params of approximation if used. + BApprox_gradient = cms.double(0.886454), # Gradient term of linear equation for approximating B + BApprox_intercept = cms.double(0.504148) # Intercept term of linear equation for approximating B + ), + + #=== Division of Tracker into phi sectors. + + PhiSectors = cms.PSet( + NumPhiNonants = cms.uint32(9), # Divisions of Tracker at DTC + NumPhiSectors = cms.uint32(18), # Divisions of Tracker at GP. + ChosenRofPhi = cms.double(67.240), # 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. + #--- You can set one or both the following parameters to True. + UseStubPhi = cms.bool(True), # Require stub phi to be consistent with track of Pt > HTArraySpec.HoughMinPt that crosses HT phi axis? + UseStubPhiTrk = cms.bool(True), # Require stub phi0 (or phi65 etc.) as estimated from stub bend, to lie within HT phi axis, allowing tolerance(s) specified below? + AssumedPhiTrkRes = cms.double(0.5), # Tolerance in stub phi0 (or phi65) assumed to be this fraction of phi sector width. (N.B. If > 0.5, then stubs can be shared by more than 2 phi sectors). + CalcPhiTrkRes = cms.bool(True), # If true, tolerance in stub phi0 (or phi65 etc.) will be reduced below AssumedPhiTrkRes if stub bend resolution specified in StubCuts.BendResolution suggests it is safe to do so. + HandleStripsPhiSec = cms.bool(False) # If True, adjust algorithm to allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when assigning stubs to phi sectors. + ), + + #=== Division of Tracker into eta sectors + + EtaSectors = cms.PSet( +# Eta boundaries for 18 eta regions +# EtaRegions = cms.vdouble(-2.4,-2.16,-1.95,-1.7,-1.43,-1.16,-0.89,-0.61,-0.31,0.0,0.31,0.61,0.89,1.16,1.43,1.7,1.95,2.16,2.4), +# Eta boundaries for 16 eta regions + EtaRegions = cms.vdouble(-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), + ChosenRofZ = cms.double(50.), # 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! + BeamWindowZ = cms.double(15), # Half-width of window assumed to contain beam-spot in z. + HandleStripsEtaSec = cms.bool(False), # If True, adjust algorithm to allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when assigning stubs to eta sectors. + AllowOver2EtaSecs = cms.bool(True) # If True, the code will not throw an error if a stub is assigned to 3 or more eta sectors. + ), + + #=== r-phi Hough transform array specifications. + + HTArraySpecRphi = cms.PSet( + HoughMinPt = cms.double(3.0), # Min track Pt that Hough Transform must find. Also used by StubCuts.KillLowPtStubs and by EtaPhiSectors.UseStubPhi. + # If MiniHTstage = True, these refers to mini cells in whole HT array. + HoughNbinsPt = cms.uint32(32), # HT array dimension in track q/Pt. Ignored if HoughNcellsRphi > 0. (If MiniHTstage = True, this refers to mini cells in whole HT array). + HoughNbinsPhi = cms.uint32(64), # HT array dimension in track phi0 (or phi65 or any other track phi angle. Ignored if HoughNcellsRphi > 0. (If MiniHTstage = True, this refers to mini cells in whole HT array). + HoughNcellsRphi = cms.int32(-1), # If > 0, then parameters HoughNbinsPt and HoughNbinsPhi will be calculated from the constraints that their product should equal HoughNcellsRphi and their ratio should make the maximum |gradient|" of stub lines in the HT array equal to 1. If <= 0, then HoughNbinsPt and HoughNbinsPhi will be taken from the values configured above. + EnableMerge2x2 = cms.bool(False), # Groups of neighbouring 2x2 cells in HT will be treated as if they are a single large cell? N.B. You can only enable this option if your HT array has even numbers of bins in both dimensions. And this cfg param ignored if MiniHTstage = True. HISTORIC OPTION. SUGGEST NOT USING! + MaxPtToMerge2x2 = cms.double(3.5), # but only cells with pt < MaxPtToMerge2x2 will be merged in this way (irrelevant if EnableMerge2x2 = false). + NumSubSecsEta = cms.uint32(2), # Subdivide each sector into this number of subsectors in eta within r-phi HT. + Shape = cms.uint32(0), # cell shape: 0 for square, 1 for diamond, 2 hexagon (with vertical sides), 3 square with alternate rows shifted by 0.5*cell_width. + MiniHTstage = cms.bool(True), # Run 2nd stage HT with mini cells inside each 1st stage normal HT cell.. + MiniHoughNbinsPt = cms.uint32(2), # Number of mini cells along q/Pt axis inside each normal HT cell. + MiniHoughNbinsPhi = cms.uint32(2), # Number of mini cells along phi axis inside each normal HT cell. + MiniHoughMinPt = cms.double(3.0), # Below this Pt threshold, the mini HT will not be used, to reduce sensitivity to scattering, with instead tracks found by 1st stage coarse HT sent to output. (HT cell numbering remains as if mini HT were in use everywhere). + MiniHoughDontKill = cms.bool(False), # If true, allows tracks found by 1st stage coarse HT to be output if 2nd stage mini HT finds no tracks. + MiniHoughDontKillMinPt = cms.double(8.0), # If MiniHoughDontKill=True, this option restricts it to keep 1st stage HT tracks only if their Pt is exceeds this cut. (Used to improve electron tracking above this threshold). + MiniHoughLoadBalance = cms.uint32(2) # Load balancing disabled = 0; static load balancing of output links = 1; dynamic load balancing of output links = 2. + ), + + #=== Rules governing how stubs are filled into the r-phi Hough Transform array. + + HTFillingRphi = cms.PSet( + # If True, adjust algorithm to allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when filling r-phi HT with stubs. + HandleStripsRphiHT = cms.bool(False), + # Take all cells in r-phi HT array crossed by line corresponding to each stub (= 0) or take only some to reduce rate at cost + # of efficiency ( > 0). If this option is > 0, it can be 1 or 2, corresponding to different algorithms for rejecting + # some of the cells. "1" is an algorithm invented by Ian, whereas "2" corresponds to Thomas' 1st firmware implementation which only handled 1 cell per HT column. + # Suggest setting KillSomeHTCellsRphi=1 (=0) if HTArraySpec.ChosenRofPhi=0 (>0) + KillSomeHTCellsRphi = cms.uint32(0), + # Use filter in each r-phi HT cell, filling it only with stubs that have consistent bend information? + # The assumed bend resolution is specified in StubCuts.BendResolution. + UseBendFilter = cms.bool(True), + # Use filter in each HT cell, preventing more than the specified number of stubs being stored in the cell. (Reflecting memory limit of hardware). N.B. Results depend on assumed order of stubs. + # N.B. If mini-HT is in use, then this cut applies to coarse-HT. + #MaxStubsInCell = cms.uint32(99999), # Setting this to anything more than 99 disables this option + MaxStubsInCell = cms.uint32(32), # set it equal to value used in hardware. + MaxStubsInCellMiniHough = cms.uint32(16), # Same type of cut for mini-HT (if in use) + # If BusySectorKill = True, and more than BusySectorNumStubs stubs are assigned to tracks by an r-phi HT array, then the excess tracks are killed, with lowest Pt ones killed first. This is because HT hardware has finite readout time. + BusySectorKill = cms.bool(True), + BusySectorNumStubs = cms.uint32(162), # Or 144 if only 320 MHz FW. + # If BusySectorMbinRanges is not empty, then the BusySectorNumStubs cut is instead applied to the subset of tracks appearing in the following m bin (q/Pt) ranges of the HT array. The sum of the entries in the vector should equal the number of m bins in the HT. (N.B. If EnableMerge2x2 or MiniHTstage = True, then the m bin ranges here correspond to the bins before merging. Also in these cases, the odd m-bin numbers don't correspond to HT outputs, so should be all grouped together on a single imaginary link). + # If BusySectorMbinOrder is not empty, then the m-bins are grouped in the specified order, instead of sequentially. + # (Histos NumStubsPerLink, NumStubsVsLink & MeanStubsPerLink useful for optimising this option). + # + # Choice for 16x32 coarse HT array followed by 2x2 mini-HT array with 3 GeV Pt threshold. + BusySectorMbinRanges = cms.vuint32(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 16), + BusySectorMbinOrder = cms.vuint32(0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30, 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31), + # Choice for 24x32 coarse HT array followed by 2x2 mini-HT array with 2 GeV Pt threshold. + #BusySectorMbinRanges = cms.vuint32(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 24), + #BusySectorMbinOrder = cms.vuint32(0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46, 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47), + # + # If BusyInputSectorKill = True, and more than BusyInputSectorNumStubs are input to the HT array from the GP, then + # the excess stubs are killed. This is because HT hardware has finite readin time. + # Results unreliable as depend on assumed order of stubs. + BusyInputSectorKill = cms.bool(True), + BusyInputSectorNumStubs = cms.uint32(162), # Or 144 if only 320 MHz FW + # Multiplex the outputs from several HTs onto a single pair of output optical links? + # Options: 0 = disable Mux; 1 = Dec. 2016 Mux; 2 = Mar 2018 Mux (for transverse HT readout by m-bin). + # (The mux algorithm is hard-wired in class MuxHToutputs, and currently only works if option BusySectorMbinRanges is being used); 3 = Sept 2019 Mux (transerse HT readout by m-bin), with single m bin in entire nonant going to each link. + MuxOutputsHT = cms.uint32(3), + # If this is non-empty, then only the specified eta sectors are enabled, to study them individually. + EtaRegWhitelist = cms.vuint32() + ), + + #=== Options controlling r-z track filters (or any other track filters run after the Hough transform, as opposed to inside it). + #=== (Irrelevant for track fitters that don't require any r-z filter run before them). + + RZfilterOpts = cms.PSet( + # Specify preferred r-z filter (from those available inside TrkRZfilter.cc) - currently only "SeedFilter". + RZFilterName = cms.string("SeedFilter"), + #--- Options relevant for Seed filter, (so only relevant if rzFilterName="SeedFilter"). + # Added resolution beyond that estimated from hit resolution. + SeedResolution = cms.double(0.), + # Store stubs compatible with all possible good seed. + KeepAllSeed = cms.bool(False), + # Maximum number of seed combinations to bother checking per track candidate. + #MaxSeedCombinations = cms.uint32(999), + MaxSeedCombinations = cms.uint32(15), + # Maximum number of seed combinations consistent with (z0,eta) sector constraints to bother checking per track candidate. + #MaxGoodSeedCombinations = cms.uint32(13), + MaxGoodSeedCombinations = cms.uint32(10), + # Maximum number of seeds that a single stub can be included in. + MaxSeedsPerStub = cms.uint32(4), + # Reject tracks whose estimated rapidity from seed filter is inconsistent range of with eta sector. (Kills some duplicate tracks). + zTrkSectorCheck = cms.bool(True), + # Min. number of layers in rz track that must have stubs for track to be declared found by seed filter. + MinFilterLayers = cms.uint32(4) + ), + + #=== Rules for deciding when the (HT) track finding has found an L1 track candidate + + L1TrackDef = cms.PSet( + # Min. number of layers the track must have stubs in. + MinStubLayers = cms.uint32(5), + # Change min. number of layers cut to (MinStubLayers - 1) for tracks with Pt exceeding this cut. + # If this is set to > 10000 , this option is disabled. + MinPtToReduceLayers = cms.double(99999.), + # Change min. number of layers cut to (MinStubLayers - 1) for tracks in these rapidity sectors. + # (Histogram "AlgEffVsEtaSec" will help you identify which sectors to declare). + #EtaSecsReduceLayers = cms.vuint32(), + EtaSecsReduceLayers = cms.vuint32(5,12), + # Define layers using layer ID (true) or by bins in radius of 5 cm width (false). + UseLayerID = cms.bool(True), + # Reduce this layer ID, so that it takes no more than 8 different values in any eta region (simplifies firmware). + ReducedLayerID = cms.bool(True) + ), + + #=== Specification of algorithm to eliminate duplicate tracks. + + DupTrkRemoval = cms.PSet( + #--- Specify which duplicate removal algorithm(s) to run: option 0 means disable duplicate track removal, whilst > 0 runs a specific algorithm (options 8 & 25 are only ones implemented). + # Algorithm used for duplicate removal of 2D tracks produced by r-phi HT. Assumed to run before tracks are output from HT board. + DupTrkAlgRphi = cms.uint32(0), + #DupTrkAlgRphi = cms.uint32(25), + # Algorithm run on all 3D tracks within each sector after r-z track filter. + # (Ignored if no r-z track filter is run). + DupTrkAlg3D = cms.uint32(0), + #DupTrkAlg3D = cms.uint32(8), + # Algorithm run on tracks after the track helix fit has been done. (Ian's talk in 26/8/2016 meeting) + # To use it, you must set DupTrkAlgRphi = DupTrkAlg3D = 0. + DupTrkAlgFit = cms.uint32(50), + #--- Options used by individual algorithms. + # Parameter for "inverse" OSU duplicate-removal algorithm + # Specifies minimum number of common stubs in same number of layers to keep smaller candidate in comparison. + DupTrkMinCommonHitsLayers = cms.uint32(5), + ), + + #=== Rules for deciding when a reconstructed L1 track matches a MC truth particle (i.e. tracking particle). + + TrackMatchDef = cms.PSet( + #--- Three different ways to define if a tracking particle matches a reco track candidate. (Usually, set two of them to ultra loose). + # Min. fraction of matched stubs relative to number of stubs on reco track. + MinFracMatchStubsOnReco = cms.double(-99.), + # Min. fraction of matched stubs relative to number of stubs on tracking particle. + MinFracMatchStubsOnTP = cms.double(-99.), + # Min. number of matched layers. + MinNumMatchLayers = cms.uint32(4), + # Min. number of matched PS layers. + MinNumMatchPSLayers = cms.uint32(0), + # Associate stub to TP only if the TP contributed to both its clusters? (If False, then associate even if only one cluster was made by TP). + StubMatchStrict = cms.bool(False) + ), + + #=== Track Fitting Algorithm Settings. + + TrackFitSettings = cms.PSet( + # + #--- Options applicable to all track fitters --- + # + # Track Fitting algortihms to use. You can run several in parallel. + # TrackFitLinearAlgo & ChiSquared* are chi2 fits, KF* is a Kalman filter fit, + # & SimpleLR is a linear regression fit that neglects the hit uncertainties. + # The number 4 or 5 in the name indicates if 4 or 5 helix parameters are fitted. + # Options KF4ParamsComb, KF5ParamsComb or SimpleLR are the best ones. + # KF*ParamsCombHLS is the HLS version of the code, which only works if linked with Vivado libraries. + TrackFitters = cms.vstring( + # "ChiSquared4ParamsApprox", + # "SimpleLR", + # "KF4ParamsCombHLS", + # "KF5ParamsCombHLS", + "KF5ParamsComb", + "KF4ParamsComb" + ), + # Indicate subset of fitters wanting r-z track filter to be run before them. (Irrelevant for those not specified in "TrackFitters"). + # Typically, Chi2 & LR fits work best with r-z filter & KF works best without it. + UseRZfilter = cms.vstring( + "ChiSquared4ParamsApprox", + "SimpleLR" + ), + # Print detailed summary of track fit performance at end of job (as opposed to a brief one). + DetailedFitOutput = cms.bool(False), + # + # Use MC truth to eliminate all fake tracks & all incorrect stubs assigned to tracks before doing fit. + TrackFitCheat = cms.bool(False), + # + #--- Options for chi2 track fitter --- + # + # Number of fitting iterations to undertake. (15 is not realistic in hardware, but is necessary to kill bad hits) + NumTrackFitIterations = cms.uint32(15), + # Optionally kill hit with biggest residuals in track fit (occurs after the first fit, so three iterations would have two killings). + KillTrackFitWorstHit = cms.bool(True), + # Cuts in standard deviations used to kill hits with big residuals during fit. If the residual exceeds the "General" cut, the hit is killed providing it leaves the track with enough hits to survive. If the residual exceeds the "Killing" cut, the hit is killed even if that kills the track. + GeneralResidualCut = cms.double(3.0), + KillingResidualCut = cms.double(20.0), + # + #--- Additional options for Thomas Schuh's Linear Regression track fitter --- + # + # Maximum allowed number of iterations of LR fitter. + MaxIterationsLR = cms.uint32( 8 ), + # Internal histograms are filled if it is True + LRFillInternalHists = cms.bool(False), + # If False: residual of a stub is the max of its r-phi & r-z residuals. + # If True: the residual is the mean of these residuals. + CombineResiduals = cms.bool( True ), + # Correct stub phi coordinate for higher orders in circle expansion, so that a trajectory is straight in r-phi. + LineariseStubPosition = cms.bool( True ), + # Checks if the fitted track is consistent with the sector, if not it will be not accepted. + CheckSectorConsistency = cms.bool( False ), + # Checks if the fitted track r phi parameter are consistent with the HT candidate parameter within in range of +- 2 cells. + CheckHTCellConsistency = cms.bool( False ), + # Tracks must have stubs in at least this number of PS layers. + MinPSLayers = cms.uint32( 2 ), + # Digitization + DigitizeLR = cms.bool( False ), + PhiPrecision = cms.double( 0.009 / 108. ), + RPrecision = cms.double( 0.14 ), + ZPrecision = cms.double( 0.28 ), + ZSlopeWidth = cms.uint32( 11 ), + ZInterceptWidth = cms.uint32( 11 ), + # + #--- Additional options for Davide Cieri's Simple Linear Regression track fitter --- + # + # Digitize Simple Linear Regression variables and calculation. (Disabled if EnableDigitize=False). + DigitizeSLR = cms.bool(True), + # Number of bits to be used in hardware to compute the division needed to calculate the helix params + DividerBitsHelix = cms.uint32(23), + DividerBitsHelixZ = cms.uint32(23), + # Number of bits to reduce the rphi helix parameter calculation weight + ShiftingBitsDenRPhi = cms.uint32(14), + # Number of bits to reduce the rphi helix parameter calculation weight + ShiftingBitsDenRZ = cms.uint32(14), + # Number of bits to reduce the phi0 parameter calculation weight + ShiftingBitsPhi = cms.uint32(10), + # Number of bits to reduce the qOverPt parameter calculation weight + ShiftingBitsPt = cms.uint32(3), + # Number of bits to reduce the tanLambda parameter calculation weight + ShiftingBitsLambda = cms.uint32(1), + # Number of bits to reduce the z0 parameter calculation weight + ShiftingBitsZ0 = cms.uint32(16), + # Fit ChiSquare Cut (tightening reduces fake track rate at cost of efficiency) + SLR_chi2cut = cms.double(100.), + # Cut on Rphi Residuals (radians) - stubs killed until only 4 left or all have residuals below this cut. + ResidualCut = cms.double(0.0), + #ResidualCut = cms.double(0.0005), # This allows more than 4 stubs per track. + # + #--- Options for Kalman filter track fitters --- + # + # Larger number has more debug printout. "1" is useful for understanding why tracks are lost, best combined with TrackFitCheat=True. + KalmanDebugLevel = cms.uint32(0), + # Internal histograms are filled if it is True + KalmanFillInternalHists = cms.bool(False), + # Fit will reject fitted tracks unless it can assign at least this number of stubs to them. + KalmanMinNumStubs = cms.uint32(4), + # Fit will attempt to add up to this nummber of stubs to each fitted tracks, but won't bother adding more. + KalmanMaxNumStubs = cms.uint32(4), + # For 5-param helix fits, calculate also beam-constrained helix params after fit is complete, & use them for duplicate removal if DupTrkAlgFit=50. + KalmanAddBeamConstr = cms.bool(True), + # Remove requirement of at least 2 PS layers per track. + KalmanRemove2PScut = cms.bool(False), + # Allow the KF to skip this many layers in total per track. + KalmanMaxSkipLayersHard = cms.uint32(1), # For HT tracks with many stubs + KalmanMaxSkipLayersEasy = cms.uint32(2), # For HT tracks with few stubs + KalmanMaxStubsEasy = cms.uint32(10), # Max stubs an HT track can have to be "easy". + # KF will consider at most this #stubs per layer to save time. + KalmanMaxStubsPerLayer = cms.uint32(4), + # Multiple scattering term - inflate hit phi errors by this divided by Pt + # (0.00075 gives best helix resolution & 0.00450 gives best chi2 distribution). + KalmanMultiScattTerm = cms.double(0.00075), + # Scale down chi2 in r-phi plane by this factor to improve electron performance (should be power of 2) + KalmanChi2RphiScale = cms.uint32(8), + # N.B. KF track fit chi2 cut is not cfg param, but instead is hard-wired in KF4ParamsComb::isGoodState(...). + #--- Enable Higher order corrections + # Treat z uncertainty in tilted barrel modules correctly. + KalmanHOtilted = cms.bool(False), + # Higher order circle explansion terms for low Pt. + KalmanHOhelixExp = cms.bool(False), + # 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. + KalmanHOalpha = cms.uint32(0), + # 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. + KalmanHOprojZcorr = cms.uint32(0), + # Use dodgy calculation to account for non-radial endcap 2S modules that was used in Dec. 2016 demonstrator & use no special treatment for tilted modules. + KalmanHOdodgy = cms.bool(True) + ), + + #=== Treatment of dead modules. + + DeadModuleOpts = cms.PSet( + #--- Either use this private TMTT way of studying dead modules + # In (eta,phi) sectors containing dead modules, reduce the min. number of layers cut on tracks to (MinStubLayers - 1)? + # The sectors affected are hard-wired in DeadModuleDB::defineDeadTrackerRegions(). + DeadReduceLayers = cms.bool( False ), + # Emulate dead modules by killing fraction of stubs given by DeadSimulateFrac in certain layers & angular regions of + # the tracker that are hard-wired in DeadModuleDB::defineDeadSectors(). Disable by setting <= 0. Fully enable by setting to 1. + # Do not use if KillScenario > 0. + DeadSimulateFrac = cms.double(-999.), + # + #--- Or this use communal way developed with Tracklet of studying dead modules + # Emulate dead/inefficient modules using the StubKiller code, with stubs killed according to the scenarios of the Stress Test group. + # (0=Don't kill any stubs; 1-5 = Scenarios from https://github.com/EmyrClement/StubKiller/blob/master/README.md). + KillScenario = cms.uint32(0), + # Modify TMTT tracking to try to recover tracking efficiency in presence of dead modules. (Does nothing if KillScenario = 0). + KillRecover = cms.bool (True) + ), + + #=== Fitted track digitisation. + + TrackDigi=cms.PSet( + # For firmware reasons, can't use common digitisation cfg for all fitters. + + #======= SimpleLR digi parameters ======== + SLR_skipTrackDigi = cms.bool( False ), # Optionally skip track digitisation if done internally inside fitting code. + SLR_oneOver2rBits = cms.uint32(13), + SLR_oneOver2rRange = cms.double(0.01354135), + SLR_d0Bits = cms.uint32(12), # Made up by Ian as never yet discussed. + SLR_d0Range = cms.double(10.), + SLR_phi0Bits = cms.uint32(18), + SLR_phi0Range = cms.double(1.3962636), # phi0 is actually only digitised relative to centre of sector. + SLR_z0Bits = cms.uint32(12), + SLR_z0Range = cms.double(51.555509), + SLR_tanlambdaBits = cms.uint32(15), + SLR_tanlambdaRange = cms.double(32.0), + SLR_chisquaredBits = cms.uint32(8), + SLR_chisquaredRange = cms.double(128.), + + #====== Kalman Filter digi parameters ======== + KF_skipTrackDigi = cms.bool( False ), # Optionally skip track digitisation if done internally inside fitting code. + KF_oneOver2rBits = cms.uint32(15), + KF_oneOver2rRange = cms.double(0.0076171313), # pT > 1.5 GeV + KF_d0Bits = cms.uint32(12), + KF_d0Range = cms.double(31.992876), + KF_phi0Bits = cms.uint32(12), + KF_phi0Range = cms.double(0.6981317), # phi0 digitised relative to centre of sector. (Required range 2pi/18 + 2*overlap; overlap = 0.19206rads*(2GeV/ptCut)*(chosenR/67.24). MUST DOUBLE TO GO TO 2 GEV. + KF_z0Bits = cms.uint32(12), + KF_z0Range = cms.double(45.826419), + KF_tanlambdaBits = cms.uint32(16), + KF_tanlambdaRange = cms.double(16.), + KF_chisquaredBits = cms.uint32(15), # N.B. 17 bits are used internally inside KF. + KF_chisquaredRange = cms.double(1024.), + KF_chisquaredBinEdges = cms.vdouble(0, 0.5, 1, 2, 3, 5, 7, 10, 20, 40, 100, 200, 500, 1000, 3000 ), # Additional bin for >3000 + KF_bendchisquaredBinEdges = cms.vdouble(0, 0.5, 1, 2, 3, 5, 10, 50 ), # Additional bin for >50 + + #====== Other track fitter Digi params. + # Currently equal to those for KF, although you can skip track digitisation for them with following. + Other_skipTrackDigi = cms.bool( True ) + ), + + #===== Use HYBRID TRACKING (Tracklet pattern reco + TMTT KF -- requires tracklet C++ too) ===== + + Hybrid = cms.bool( False), + + #===== Debug printout & plots + Debug = cms.uint32(1), #(0=none, 1=print #tracks/event, 2+ print more info) + # When making helix parameter resolution plots, only use particles from the physics event (True) + # or also use particles from pileup (False) ? + ResPlotOpt = cms.bool (True), + # Specify sector for which debug histos for hexagonal HT will be made. + iPhiPlot = cms.uint32(0), + iEtaPlot = cms.uint32(9) +) diff --git a/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Ultimate_cff.py b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Ultimate_cff.py new file mode 100644 index 0000000000000..82b0b171af04b --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Ultimate_cff.py @@ -0,0 +1,70 @@ +import FWCore.ParameterSet.Config as cms + +#--------------------------------------------------------------------------------------------------------- +# This describes the full TMTT track reconstruction chain with 2 GeV threshold, where: +# the GP divides the tracker into 18 eta sectors (each sub-divided into 2 virtual eta subsectors); +# the HT uses a 32x18 array followed by 2x2 Mini-HT array, with transverese HT readout & multiplexing, +# followed by the KF (or optionally SF+SLR) track fit; duplicate track removal (Algo50) is run. +# +# It represents the tracking as planned for 2026. It is a good basis for L1 trigger studies etc. +#--------------------------------------------------------------------------------------------------------- + +#=== Import default values for all parameters & define EDProducer. + +from L1Trigger.TrackFindingTMTT.TMTrackProducer_Defaults_cfi import TMTrackProducer_params + +TMTrackProducer = cms.EDProducer('TMTrackProducer', + # Load cfg parameters from TMTrackProducer_Defaults_cfi.py + TMTrackProducer_params +) + +#=================================================================================================== +# Uncomment the following 2 lines to disable all use of MC truth info & all output histograms. +# THIS SAVES CPU, SO IS GOOD IDEA IF YOU ONLY CARE ABOUT PRODUCING TTTrack COLLECTION! +#=================================================================================================== + +#TMTrackProducer.EnableMCtruth = cms.bool(False) +#TMTrackProducer.EnableHistos = cms.bool(False) + +#=================================================================================================== +#=== The following override the default values. +#=================================================================================================== + +#--- Configure track fitter(s). + +# Use only 4 parameter helix fit Kalman Filter. +TMTrackProducer.TrackFitSettings.TrackFitters = cms.vstring("KF4ParamsComb") + +# Allow KF to assign stubs in up to this many layers to fitted tracks. +TMTrackProducer.TrackFitSettings.KalmanMaxNumStubs = cms.uint32(6) +# Enable more sophisticated fit mathematics in KF. +TMTrackProducer.TrackFitSettings.KalmanHOtilted = cms.bool(True) +TMTrackProducer.TrackFitSettings.KalmanHOhelixExp = cms.bool(True) +TMTrackProducer.TrackFitSettings.KalmanHOalpha = cms.uint32(1) +TMTrackProducer.TrackFitSettings.KalmanHOprojZcorr = cms.uint32(1) +TMTrackProducer.TrackFitSettings.KalmanHOdodgy = cms.bool(False) + +# Disable internal digitisation of SimpleLR fitter, as was never retuned for nonants. +TMTrackProducer.TrackFitSettings.DigitizeSLR = cms.bool(False) + +#--- Switch on 2nd stage Mini HT with 2 GeV Pt threshold & allow it to find tracks with stubs in as few as 4 layers. + +TMTrackProducer.HTArraySpecRphi.HoughNbinsPt = cms.uint32(48) +TMTrackProducer.HTArraySpecRphi.HoughNbinsPhi = cms.uint32(64) +TMTrackProducer.GenCuts.GenMinPt = cms.double(2.0) +TMTrackProducer.HTArraySpecRphi.HoughMinPt = cms.double(2.0) +TMTrackProducer.HTArraySpecRphi.MiniHoughMinPt = cms.double(3.0) # Mini-HT not used below this Pt, to reduce sensitivity to scattering. +TMTrackProducer.L1TrackDef.MinStubLayers = cms.uint32(4) +TMTrackProducer.HTFillingRphi.BusySectorMbinRanges = cms.vuint32(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 24) +TMTrackProducer.HTFillingRphi.BusySectorMbinOrder = cms.vuint32(0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47) + +#--- phi digitisation range needs to be increased to go down to 2 GeV. +#--- phi0 digitised relative to centre of sector. (Required range 2pi/18 + 2*overlap; overlap = 0.19206rads*(2GeV/ptCut)*(chosenR/67.24) + +TMTrackProducer.TrackDigi.KF_phi0Range = cms.double(2*0.6981317) +# FIX: To make this change in KF FW, change phi0 bit selection in DRstate.vhd to bits 17-6 (instead of 16-5). + +# MuxHToutputs sends all HT outputs for an entire nonant and 1 m-bin to a single output link. +# This works for Pt > 3 GeV, gives truncation for Pt > 2 GeV. To solve, need to double number of outputs, +# with one for each phi sector in nonant. Not yet implemented, so for now disable HT output truncation. +TMTrackProducer.HTFillingRphi.BusySectorNumStubs = cms.uint32(999) diff --git a/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_cff.py b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_cff.py new file mode 100644 index 0000000000000..ab31246c691a4 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_cff.py @@ -0,0 +1,157 @@ +import FWCore.ParameterSet.Config as cms + +#--------------------------------------------------------------------------------------------------------- +# This describes the full TMTT track reconstruction chain with 3 GeV threshold, where: +# the GP divides the tracker into 18 eta sectors (each sub-divided into 2 virtual eta subsectors); +# the HT uses a 32x18 array followed by 2x2 Mini-HT array, with transverese HT readout & multiplexing, +# followed by the KF (or optionally SF+SLR) track fit; duplicate track removal (Algo50) is run. +# +# This usually corresponds to the current firmware. +#--------------------------------------------------------------------------------------------------------- + +#=== Import default values for all parameters & define EDProducer. + +from L1Trigger.TrackFindingTMTT.TMTrackProducer_Defaults_cfi import TMTrackProducer_params + +TMTrackProducer = cms.EDProducer('TMTrackProducer', + # Load cfg parameters from TMTrackProducer_Defaults_cfi.py + TMTrackProducer_params +) + +#=================================================================================================== +#=== Parameters changed from their default values. +#=================================================================================================== + +#--- Disable internal digitisation of SimpleLR fitter, as it was never retuned for nonants. +TMTrackProducer.TrackFitSettings.DigitizeSLR = cms.bool(False) + +#=================================================================================================== +#=== All the following parameters already have identical values in TMTrackProducer_Defaults_cfi . +#=== They are listed here just to remind you of the most interesting parameters to play with. +#=================================================================================================== + +#--- Configure track fitting + +# Use only 4 or 5 parameter helix fit Kalman Filter (which automatically runs on tracks produced with no r-z track filter) +#TMTrackProducer.TrackFitSettings.TrackFitters = cms.vstring("KF5ParamsComb", "KF4ParamsComb") +# Use only Linear Regression Fitter (which automatically runs on tracks produced by r-z track filter). +#TMTrackProducer.TrackFitSettings.TrackFitters = cms.vstring("SimpleLR") + +# Allow KF to assign stubs in up to this many layers to fitted tracks. +#TMTrackProducer.TrackFitSettings.KalmanMaxNumStubs = cms.uint32(6) +# Enable more sophisticated fit mathematics in KF. +#TMTrackProducer.TrackFitSettings.KalmanHOtilted = cms.bool(True) +#TMTrackProducer.TrackFitSettings.KalmanHOhelixExp = cms.bool(True) +#TMTrackProducer.TrackFitSettings.KalmanHOalpha = cms.uint32(2) +#TMTrackProducer.TrackFitSettings.KalmanHOprojZcorr = cms.uint32(2) +#TMTrackProducer.TrackFitSettings.KalmanHOdodgy = cms.bool(False) + +#--- Switch off parts of the track reconstruction chain. + +#TMTrackProducer.DupTrkRemoval.DupTrkAlgRphi = cms.uint32(0) +#TMTrackProducer.DupTrkRemoval.DupTrkAlg3D = cms.uint32(0) +#TMTrackProducer.DupTrkRemoval.DupTrkAlgFit = cms.uint32(0) +#TMTrackProducer.TrackFitSettings.TrackFitters = cms.vstring() + +#--- Keep Pt threshold at 3 GeV, with coarse HT, but switch off Mini-HT. + +#TMTrackProducer.HTArraySpecRphi.MiniHTstage = cms.bool(False) +#TMTrackProducer.HTFillingRphi.MaxStubsInCell = cms.uint32(16) +#TMTrackProducer.HTArraySpecRphi.HoughNbinsPt = cms.uint32(16) +#TMTrackProducer.HTArraySpecRphi.HoughNbinsPhi = cms.uint32(32) +#TMTrackProducer.HTFillingRphi.BusySectorMbinRanges = cms.vuint32(2,2,2,2,2,2,2,2) +#TMTrackProducer.HTFillingRphi.BusySectorMbinOrder = cms.vuint32(0,8, 1,9, 2,10, 3,11, 4,12, 5,13, 6,14, 7,15) + +#--- Reduce Pt threshold to 2 GeV, with coarse HT, and switch off Mini-HT. + +#TMTrackProducer.HTArraySpecRphi.MiniHTstage = cms.bool(False) +#TMTrackProducer.HTFillingRphi.MaxStubsInCell = cms.uint32(16) +#TMTrackProducer.HTArraySpecRphi.HoughNbinsPt = cms.uint32(24) +#TMTrackProducer.HTArraySpecRphi.HoughNbinsPhi = cms.uint32(32) +#TMTrackProducer.GenCuts.GenMinPt = cms.double(2.0) +#TMTrackProducer.HTArraySpecRphi.HoughMinPt = cms.double(2.0) +#TMTrackProducer.HTFillingRphi.BusySectorMbinRanges = cms.vuint32(2,2,2,2,2,2,2,2,2,2,2,2) +#TMTrackProducer.HTFillingRphi.BusySectorMbinOrder = cms.vuint32(0,12, 1,13, 2,14, 3,15, 4,16, 5,17, 6,18, 7,19, 8,20, 9,21, 10,22, 11,23) + +#--- Reduce Pt threshold to 2 GeV, with coarse HT, followed by Mini-HT. + +#TMTrackProducer.HTArraySpecRphi.HoughNbinsPt = cms.uint32(48) +#TMTrackProducer.HTArraySpecRphi.HoughNbinsPhi = cms.uint32(64) +#TMTrackProducer.GenCuts.GenMinPt = cms.double(2.0) +#TMTrackProducer.HTArraySpecRphi.HoughMinPt = cms.double(2.0) +#TMTrackProducer.HTArraySpecRphi.MiniHoughMinPt = cms.double(3.0) # Mini-HT not used below this Pt, to reduce sensitivity to scattering. +#TMTrackProducer.HTFillingRphi.BusySectorMbinRanges = cms.vuint32(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 24) +#TMTrackProducer.HTFillingRphi.BusySectorMbinOrder = cms.vuint32(0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47) + +#--- Additional Mini-HT options to improve electron/displaced tracking. + +# Next 2 lines cause tracks found by 1st stage HT to be output if above specified Pt threshold & mini-HT found no tracks. +# Improves electron tracking. Setting Pt threshold to 0 improves displaced tracking. +#TMTrackProducer.HTArraySpecRphi.MiniHoughDontKill = cms.bool(True) +#TMTrackProducer.HTArraySpecRphi.MiniHoughDontKillMinPt = cms.double(8.) +# Extreme displaced tracking also benefits from following. +#TMTrackProducer.L1TrackDef.MinStubLayers = cms.uint32(4) # HT accepts tracks with >= 4 layers +#TMTrackProducer.TrackFitSettings.KalmanRemove2PScut = cms.bool(True) +#To study displaced tracking, include non-prompt particles in efficiency definition. +#TMTrackProducer.GenCuts.GenMaxVertR = cms.double(30.) + +#--- Unusual HT cell shapes + +# Simplify HT MUX to allow easy playing with the number of m bins. +#TMTrackProducer.HTFillingRphi.BusySectorMbinOrder = cms.vuint32() + +# Diamond shaped cells: (64,62), (34,32) or (46,44) sized array interesting. +#TMTrackProducer.HTArraySpecRphi.Shape = cms.uint32(1) +#TMTrackProducer.HTArraySpecRphi.HoughNbinsPt = cms.uint32(38) +#TMTrackProducer.HTArraySpecRphi.HoughNbinsPhi = cms.uint32(32) + +# Hexagonal shaped cells: (64,42), (50,32) or (56,36) sized array interesting. +#TMTrackProducer.HTArraySpecRphi.Shape = cms.uint32(2) +#TMTrackProducer.HTArraySpecRphi.HoughNbinsPt = cms.uint32(56) +#TMTrackProducer.HTArraySpecRphi.HoughNbinsPhi = cms.uint32(32) + +# Brick-wall arranged cells: (64,30) or (66,32) sized array interesting. +#TMTrackProducer.HTArraySpecRphi.Shape = cms.uint32(3) +#TMTrackProducer.HTArraySpecRphi.HoughNbinsPt = cms.uint32(64) +#TMTrackProducer.HTArraySpecRphi.HoughNbinsPhi = cms.uint32(27) + +#--- Older cfg giving similar tracking performance with slightly larger resource use. + +#TMTrackProducer.PhiSectors.NumPhiSectors = cms.uint32(36) +#TMTrackProducer.EtaSectors.EtaRegions = cms.vdouble(-2.4, -2.0, -1.53, -0.98, -0.37, 0.37, 0.98, 1.53, 2.0, 2.4) +#TMTrackProducer.EtaSectors.ChosenRofZ = cms.double(45.) +#TMTrackProducer.EtaSectors.AllowOver2EtaSecs = cms.bool(False) +#TMTrackProducer.HTArraySpecRphi.HoughNbinsPhi = cms.uint32(32) +#TMTrackProducer.HTArraySpecRphi.NumSubSecsEta = cms.uint32(1) + +#--- Stub digitization (switch on/off and/or change defaults). + +#TMTrackProducer.StubDigitize.EnableDigitize = cms.bool(True) + +#--- Reduce requirement on number of layers a track must have stubs in, either globally or in specific eta regions. + +#TMTrackProducer.L1TrackDef.MinStubLayers = cms.uint32(4) # Reduce it globally +#TMTrackProducer.L1TrackDef.EtaSecsReduceLayers = cms.vuint32(5,12) # barrel-endcap transition region + +#--- If globally reducing number of layers cut, best to also use just one HT output opto-link per m-bin. +# For 3 GeV threshold with no mini-HT. +#TMTrackProducer.HTFillingRphi.BusySectorMbinRanges = cms.vuint32(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1) +# For 2 GeV threshold with mini-HT. +#TMTrackProducer.HTFillingRphi.BusySectorMbinRanges = cms.vuint32(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 24) + +#--- Change TP to track matching criteria. + +#TMTrackProducer.GenCuts.GenMinStubLayers = cms.uint32(4) +#TMTrackProducer.TrackMatchDef.MinNumMatchLayers = cms.uint32(4) + +#--- Switch off data truncation due to finite band-width. + +#TMTrackProducer.HTFillingRphi.BusySectorKill = cms.bool(False) +#TMTrackProducer.HTFillingRphi.BusyInputSectorKill = cms.bool(False) + +# Don't order stubs by bend in DTC, such that highest Pt stubs are transmitted first. +#TMTrackProducer.StubCuts.OrderStubsByBend = cms.bool(False) + +#--- Switch on FPGA-friendly approximation to B parameter in GP - will be used in future GP firmware. +#--- (used to relate track angle dphi to stub bend) +#TMTrackProducer.GeometricProc.UseApproxB = cms.bool(True) diff --git a/L1Trigger/TrackFindingTMTT/src/ChiSquared4ParamsApprox.cc b/L1Trigger/TrackFindingTMTT/src/ChiSquared4ParamsApprox.cc new file mode 100644 index 0000000000000..136351ac9719e --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/ChiSquared4ParamsApprox.cc @@ -0,0 +1,215 @@ +#include "L1Trigger/TrackFindingTMTT/interface/ChiSquared4ParamsApprox.h" + +namespace TMTT { + +ChiSquared4ParamsApprox::ChiSquared4ParamsApprox(const Settings* settings, const uint nPar) : L1ChiSquared(settings, nPar){ + //parameterStream_ << "4Params_TrackletStyle_MCTruthSeed"; + //configParameters_ = (lsStr_.str()); + largestresid_ = -1.0; + ilargestresid_ = -1; + +} + +std::map ChiSquared4ParamsApprox::vecToMap(std::vector x){ + // Convert a vector of track parameters to a labelled map for ease of use + std::map result; + result["rInv"] = x[0]; + result["phi0"] = x[1]; + result["t"] = x[2]; + result["z0"] = x[3]; + return result; +} + +std::vector ChiSquared4ParamsApprox::mapToVec(std::map x){ + // Conevrt the map of labelled track parameters to a vector (in correct order) + std::vector result; + result.resize(4); + result[0] = x["rInv"]; + result[1] = x["phi0"]; + result[2] = x["t"]; + result[3] = x["z0"]; + return result; +} + +std::vector ChiSquared4ParamsApprox::seed(const L1track3D& l1track3D){ + /* Cheat by using MC trutth to initialize helix parameters. Useful to check if conevrgence is the problem */ + std::map x; + x["rInv"] = getSettings()->invPtToInvR() * l1track3D.qOverPt(); + x["phi0"] = l1track3D.phi0(); + x["z0"] = l1track3D.z0(); + x["t"] = l1track3D.tanLambda(); + return mapToVec(x); +} + +Matrix ChiSquared4ParamsApprox::D(std::vector x){ + Matrix D(2 * stubs_.size(), nPar_, 0.0); // Empty matrix + int j = 0; + std::map y = vecToMap(x); // Get the track params by label + double rInv = y["rInv"]; + double phi0 = y["phi0"]; + double t = y["t"]; + for (unsigned i = 0; i < stubs_.size(); i++){ + double ri=stubs_[i]->r(); + if( stubs_[i]->barrel() ){ + D(j, 0) = -0.5*ri*ri; // Fine for now; + D(j, 1) = ri; // Fine + //D(j, 2); + //D(j, 3); + j++; + //D(j, 0) + //D(j, 1) + D(j, 2) = ri; // ri; // Fine for now + D(j, 3) = 1; // Fine + j++; + } + else { + //here we handle a disk hit + //first we have the r position + double phii=stubs_[i]->phi(); + int iphi=stubs_[i]->iphi(); + + // N.B. These represent HALF the width and number of strips of sensor. + double width = stubs_[i]->width()/2.0; + double nstrip = stubs_[i]->nstrip()/2.0; + + double Deltai=width*(iphi-nstrip)/nstrip; //A bit of a hack... + + if (stubs_[i]->z()>0.0) Deltai=-Deltai; + double DeltaiOverRi = Deltai/ri; + double theta0=(DeltaiOverRi)+0.67*(DeltaiOverRi)*(DeltaiOverRi)*(DeltaiOverRi); + + double phi_track=phi0-0.5*rInv*ri; //Expected phi hit given the track + //std::cout << phi_track << "/" << phi0 << "/" << rInv << "/" << t << std::endl; + + double tInv = 1/t; + + D(j, 0) = -0.167*ri*ri*ri*rInv; // Tweaking of constant? + D(j, 1) = 0; // Exact + D(j, 2) = -ri*tInv; // Fine; + D(j, 3) = -1*tInv; // Fine + j++; + //second the rphi position + D(j, 0) = -0.5 * ri * ri; // Needs fine tuning, was (phimultiplier*-0.5*(zi-z0)/t+rmultiplier*drdrinv); + D(j, 1) = ri; // Fine, originally phimultiplier + D(j, 2) = ri*0.5*rInv*ri*tInv - ((phi_track-phii)-theta0)*ri*tInv; + D(j, 3) = ri*0.5*rInv*tInv - ((phi_track-phii)-theta0)*tInv; + j++; + } + } + return D; +} + +Matrix ChiSquared4ParamsApprox::Vinv(){ + Matrix Vinv(2*stubs_.size(), 2*stubs_.size(), 0.0); + for(unsigned i = 0; i < stubs_.size(); i++){ + if(stubs_[i]->barrel()){ + Vinv(2*i, 2*i) = 1/stubs_[i]->sigmaX(); + Vinv(2*i + 1, 2*i + 1) = 1/stubs_[i]->sigmaZ(); + }else{ + Vinv(2*i, 2*i) = 1/stubs_[i]->sigmaZ(); + Vinv(2*i + 1, 2*i + 1) = 1/stubs_[i]->sigmaX(); + } + + } + return Vinv; +} + +std::vector ChiSquared4ParamsApprox::residuals(std::vector x) { + + unsigned int n=stubs_.size(); + + std::vector delta; + delta.resize(2*n); + + std::map trackParams = vecToMap(x); // Get the track params by label + double rInv = trackParams["rInv"]; + double phi0 = trackParams["phi0"]; + double t = trackParams["t"]; + double z0 = trackParams["z0"]; + + double chiSq=0.0; + + unsigned int j=0; + + if (getSettings()->debug()==6) std::cout << "Residuals ("<invPtToInvR()/rInv<<"]: "; + + largestresid_ = -1.0; + ilargestresid_ = -1; + + for(unsigned int i=0;ir(); + double zi=stubs_[i]->z(); + double phii=stubs_[i]->phi(); + const double sigmax=stubs_[i]->sigmaX(); + const double sigmaz=stubs_[i]->sigmaZ(); + + if ( stubs_[i]->barrel() ) { + //we are dealing with a barrel stub + + double halfRinvRi = 0.5*ri*rInv; + double aSinHalfRinvRi = halfRinvRi + 0.67*halfRinvRi*halfRinvRi*halfRinvRi; + + double deltaphi=phi0-aSinHalfRinvRi-phii; + if (deltaphi>M_PI) deltaphi-=2*M_PI; + if (deltaphi<-M_PI) deltaphi+=2*M_PI; + delta[j++]=(ri*deltaphi)/sigmax; // TODO this is different from tracklet + delta[j++]=(z0+(2.0/rInv)*t*aSinHalfRinvRi-zi)/sigmaz; + }else { + //we are dealing with a disk hit + + double tInv = 1/t; + + double r_track=(zi-z0)*tInv; + double phi_track=phi0-0.5*rInv*(zi-z0)*tInv; + int iphi=stubs_[i]->iphi(); + + // N.B. These represent HALF the width and number of strips of sensor. + double width = stubs_[i]->width()/2.0; + double nstrip = stubs_[i]->nstrip()/2.0; + + double Deltai=width*(iphi-nstrip)/nstrip; //A bit of a hack... + + if (stubs_[i]->z()>0.0) Deltai=-Deltai; + + double DeltaiOverRi = Deltai/ri; + double theta0=(DeltaiOverRi)+0.67*(DeltaiOverRi)*(DeltaiOverRi)*(DeltaiOverRi); //+0.125*DeltaiOverRi*DeltaiOverRi*DeltaiOverRi*DeltaiOverRi*DeltaiOverRi; + + double Delta=Deltai-r_track*(theta0-(phi_track-phii)); + + delta[j++]=(r_track-ri)/sigmaz; + delta[j++]=Delta/sigmax; + } + + if (getSettings()->debug()==6) std::cout << delta[j-2]<<" "<largestresid_) { + largestresid_=fabs(delta[j-2]); + ilargestresid_=i; + } + + if (fabs(delta[j-1])>largestresid_) { + largestresid_=fabs(delta[j-1]); + ilargestresid_=i; + } + if (getSettings()->debug()==6) std::cout << __FILE__ << ":" << __LINE__ << " - Residuals(): delta["<debug()==6) std::cout << __FILE__ << ":" << __LINE__ << " - Residuals(): chisq: " << chiSq << std::endl; + + } + + return delta; + +} + +std::map ChiSquared4ParamsApprox::convertParams(std::vector x){ + std::map y = vecToMap(x); // Get track parameters by label + std::map result; + result["qOverPt"] = y["rInv"] / getSettings()->invPtToInvR(); + result["phi0"] = y["phi0"]; + result["z0"] = y["z0"]; + result["t"] = y["t"]; + return result; +} + +} diff --git a/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc b/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc new file mode 100644 index 0000000000000..2e8c1be47d288 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc @@ -0,0 +1,140 @@ +#include "L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h" +#include "FWCore/Utilities/interface/Exception.h" + +//=== Convert our non-persistent L1track3D object (track candidate found by Hough transform prior to fit) +//=== to the official persistent CMSSW EDM TTrack format. + +namespace TMTT { + + +TTTrack< Ref_Phase2TrackerDigi_ > ConverterToTTTrack::makeTTTrack(const L1track3D& trk, unsigned int iPhiSec, unsigned int iEtaReg) const { + + // Get references to stubs on this track. + std::vector ttstubrefs = this->getStubRefs(trk); + + // Set helix parameters. + const unsigned int nPar4 = 4; // Number of helix parameters determined by HT. + + /* + // Create TTTrack object using these stubs. + TTTrack< Ref_Phase2TrackerDigi_ > track(ttstubrefs); + + // Note which (eta,phi) sector this track was reconstructed in by HT. + track.setSector(iPhiSec); + track.setWedge(iEtaReg); + + // Set helix parameters. + const unsigned int nPar = trk.nHelixParam(); // Number of helix parameters determined by HT. + // Get and store fitted track parameters + GlobalPoint bsPosition(-trk.d0()*sin(trk.phi0()), + trk.d0()*cos(trk.phi0()), + trk.z0()); // Point of closest approach of track to beam-line. + track.setPOCA(bsPosition, nPar); + float pt = trk.pt(); // pt + track.setMomentum( + GlobalVector( + GlobalVector::Cylindrical( + pt, + trk.phi0(), // phi + pt*trk.tanLambda() // pz + ) + ), + nPar + ); + track.setRInv(invPtToInvR_ * trk.qOverPt(), nPar); + track.setChi2(trk.chi2(), nPar); + track.setStubPtConsistency(-1, nPar); + */ + + // new TTTrack constructor + double tmp_rinv = invPtToInvR_ * trk.qOverPt(); + double tmp_phi = trk.phi0(); + double tmp_tanL = trk.tanLambda(); + double tmp_z0 = trk.z0(); + double tmp_d0 = trk.d0(); + double tmp_chi2 = -1; + unsigned int tmp_hit = 0; + unsigned int tmp_npar = nPar4; + double tmp_Bfield = settings_->getBfield(); + TTTrack< Ref_Phase2TrackerDigi_ > track(tmp_rinv, tmp_phi, tmp_tanL, tmp_z0, tmp_d0, tmp_chi2, 0,0,0, tmp_hit, tmp_npar, tmp_Bfield); + + // set stub references + track.setStubRefs(ttstubrefs); + + // Note which (eta,phi) sector this track was reconstructed in by HT. + track.setPhiSector(iPhiSec); + track.setEtaSector(iEtaReg); + + track.setStubPtConsistency(-1); // not filled. + + return track; +} + +//=== Convert our non-persistent L1fittedTrack object (fitted track candidate) +//=== to the official persistent CMSSW EDM TTrack format. + +TTTrack< Ref_Phase2TrackerDigi_ > ConverterToTTTrack::makeTTTrack(const L1fittedTrack& trk, unsigned int iPhiSec, unsigned int iEtaReg) const{ + + // Check that this track is valid. + if (! trk.accepted()) throw cms::Exception("ConverterToTTTrack ERROR: requested to convert invalid L1fittedTrack."); + + // Get references to stubs on this track. + std::vector ttstubrefs = this->getStubRefs(trk); + + const unsigned int nPar = trk.nHelixParam(); // Number of helix parameters determined by HT. + + /* + // Create TTTrack object using these stubs. + TTTrack< Ref_Phase2TrackerDigi_ > track(ttstubrefs); + + // Note which (eta,phi) sector this track was reconstructed in by HT. + track.setSector(iPhiSec); + track.setWedge(iEtaReg); + + // Set helix parameters. + // Get and store fitted track parameters + GlobalPoint bsPosition(-trk.d0()*sin(trk.phi0()), + trk.d0()*cos(trk.phi0()), + trk.z0()); // Point of closest approach of track to beam-line. + track.setPOCA(bsPosition, nPar); + float pt = trk.pt(); // pt + track.setMomentum( + GlobalVector( + GlobalVector::Cylindrical( + pt, + trk.phi0(), // phi + pt*trk.tanLambda() // pz + ) + ), + nPar + ); + track.setRInv(invPtToInvR_ * trk.qOverPt(), nPar); + track.setChi2(trk.chi2(), nPar); + track.setStubPtConsistency(-1, nPar); + */ + + // new TTTrack constructor + double tmp_rinv = invPtToInvR_ * trk.qOverPt(); + double tmp_phi = trk.phi0(); + double tmp_tanL = trk.tanLambda(); + double tmp_z0 = trk.z0(); + double tmp_d0 = trk.d0(); + double tmp_chi2 = -1; + unsigned int tmp_hit = 0; + unsigned int tmp_npar = nPar; + double tmp_Bfield = settings_->getBfield(); + TTTrack< Ref_Phase2TrackerDigi_ > track(tmp_rinv, tmp_phi, tmp_tanL, tmp_z0, tmp_d0, tmp_chi2, 0,0,0, tmp_hit, tmp_npar, tmp_Bfield); + + // set stub references + track.setStubRefs(ttstubrefs); + + // Note which (eta,phi) sector this track was reconstructed in by HT. + track.setPhiSector(iPhiSec); + track.setEtaSector(iEtaReg); + + track.setStubPtConsistency(-1); // not filled. + + + return track; +} +} diff --git a/L1Trigger/TrackFindingTMTT/src/DeadModuleDB.cc b/L1Trigger/TrackFindingTMTT/src/DeadModuleDB.cc new file mode 100644 index 0000000000000..ebbdeba9fbc41 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/DeadModuleDB.cc @@ -0,0 +1,64 @@ +#include +#include + +//=== Does this stub lie in a dead region of the tracker? +//=== This function is only invoked if cfg param DeadSimulate = True & used to kill stubs to emulate dead regions. + +namespace TMTT { + +bool DeadModuleDB::killStub(const Stub* stub) const { + bool dead = false; + if (stub->barrel()) { + if (deadBarrelRegions_.find(stub->layerId()) != deadBarrelRegions_.end()) { + const vector& bRegions = deadBarrelRegions_.at(stub->layerId()); + for (const DeadModuleDB::DeadBarrelRegion& bDead : bRegions) { + if (this->deltaPhiPos(stub->phi(), bDead.phiMin_) < this->deltaPhiPos(bDead.phiMax_, bDead.phiMin_) && + stub->z() > bDead.zMin_ && stub->z() < bDead.zMax_) dead = true; + } + } + } else { + if (deadEndcapRegions_.find(stub->layerId()) != deadEndcapRegions_.end()) { + const vector& eRegions = deadEndcapRegions_.at(stub->layerId()); + for (const DeadModuleDB::DeadEndcapRegion& eDead : eRegions) { + if (this->deltaPhiPos(stub->phi(), eDead.phiMin_) < this->deltaPhiPos(eDead.phiMax_, eDead.phiMin_) && + stub->r() > eDead.rMin_ && stub->r() < eDead.rMax_) dead = true; + } + } + } + return dead; +} + +//=== Define regions of the tracker in which the modules are dead. +//=== This function is only involed if cfg param DeadSimulate = True, when any stubs in modules within these regions are killed, +//=== so emulating MC with dead regions. + +void DeadModuleDB::defineDeadTrackerRegions() { + // Example of how to declare a region of the tracker barrel as dead. + const unsigned int iLayer = 5; // (1-6 = barrel layer; 11-15 = endcap A disk; 21-25 = endcap B disk) +//=== Should this stub be killed to emulate dead modules lying within a dead tracker region? +//=== This function is only invoked if cfg param DeadSimulate = True + + const float phiMin = 0.5; + const float phiMax = 2.5; + const float zMin = -100.0; + const float zMax = 0.0; + deadBarrelRegions_[iLayer] .push_back( DeadModuleDB::DeadBarrelRegion(phiMin, phiMax, zMin, zMax) ); +} + +//=== Define sectors in which the cut on number of layer numbers on tracks should be reduced by 1, because +//=== they contain dead modules. This function is only invoked if cfg param DeadReduceLayers = True. +//=== Ideally these sectors would be derived from the regions declared in definedDeadTrackerRegions(). + +void DeadModuleDB::defineDeadSectors() { + + // Example of how to declare sectors as dead. + // N.B. Histograms "AlgEffVsPhiSec", "AlgEffVsEtaSec", "AlgEffFitVsPhiSec*" and "AlgEffFitVsEtaSec*" + // will help you determine which sectors you need to declare here. + for (unsigned int iPhiSec = 9; iPhiSec <= 13; iPhiSec++) { + for (unsigned int iEtaReg = 5; iEtaReg <= 8; iEtaReg++) { + reduceLayerCut_.insert( pair (iPhiSec, iEtaReg) ); + } + } +} + +} \ No newline at end of file diff --git a/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc b/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc new file mode 100644 index 0000000000000..0c5b2c3eceb72 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc @@ -0,0 +1,205 @@ +#include "L1Trigger/TrackFindingTMTT/interface/DegradeBend.h" + +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "DataFormats/SiStripDetId/interface/StripSubdetector.h" +#include "FWCore/Utilities/interface/Exception.h" + +#include +#include +#include +#include +#include + +using namespace std; + +namespace TMTT { + +//--- Stub window sizes copied from L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py + +std::vector< double > DegradeBend::barrelCut_ = + {0, 2.0, 2.0, 3.5, 4.5, 5.5, 6.5}; +std::vector< std::vector< double > > DegradeBend::ringCut_ = + {{0}, + {0, 1, 1.5, 1.5, 2, 2, 2.5, 3, 3, 3.5, 4, 2.5, 3, 3.5, 4.5, 5.5}, + {0, 1, 1.5, 1.5, 2, 2, 2, 2.5, 3, 3, 3, 2, 3, 4, 5, 5.5}, + {0, 1.5, 1.5, 2, 2, 2.5, 2.5, 2.5, 3.5, 2.5, 5, 5.5, 6}, + {0, 1.0, 1.5, 1.5, 2, 2, 2, 2, 3, 3, 6, 6, 6.5}, + {0, 1.0, 1.5, 1.5, 1.5, 2, 2, 2, 3, 3, 6, 6, 6.5}}; +std::vector< std::vector< double > > DegradeBend::tiltedCut_ = + {{0}, + {0, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2., 2., 1.5, 1.5, 1., 1.}, + {0, 3., 3., 3., 3., 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2, 2}, + {0, 4.5, 4.5, 4, 4, 4, 4, 3.5, 3.5, 3.5, 3, 3, 3}}; +std::vector< double > DegradeBend::barrelNTilt_ = + {0., 12., 12., 12., 0., 0., 0.}; + +//--- Given the original bend, flag indicating if this is a PS or 2S module, & detector identifier, +//--- this return the degraded stub bend, a boolean indicatng if stub bend was outside the assumed window +//--- size programmed below, and an integer indicating how many values of the original bend +//--- were grouped together into this single value of the degraded bend. + +void DegradeBend::degrade(float bend, bool psModule, const DetId& stDetId, float windowFEnew, + float& degradedBend, bool& reject, unsigned int& numInGroup) const { + + // Get degraded bend value. + unsigned int windowHalfStrips; + this->work(bend, psModule, stDetId, windowFEnew, + degradedBend, reject, numInGroup, windowHalfStrips); + + // Check for mistakes. + this->sanityChecks(psModule, stDetId, windowFEnew, degradedBend, numInGroup, windowHalfStrips); +} + +//--- Does the actual work of degrading the bend. + +void DegradeBend::work(float bend, bool psModule, const DetId& stDetId, float windowFEnew, + float& degradedBend, bool& reject, unsigned int& numInGroup, unsigned int& windowHalfStrips) const { + + // Calculate stub window size in half-strip units used to produce stubs. + // This code should be kept identical to that in + // L1Trigger/TrackTrigger/src/TTStubAlgorithm_official.cc + + unsigned int window = 0; + + if (stDetId.subdetId()==StripSubdetector::TOB) + { + int layer = theTrackerTopo_->layer(stDetId); + int ladder = theTrackerTopo_->tobRod(stDetId); + int type = 2*theTrackerTopo_->tobSide(stDetId)-3; // -1 for tilted-, 1 for tilted+, 3 for flat + double corr=0; + + if (type<3) // Only for tilted modules + { + corr = (barrelNTilt_.at(layer)+1)/2.; + ladder = corr-(corr-ladder)*type; // Corrected ring number, bet 0 and barrelNTilt.at(layer), in ascending |z| + window = 2*(tiltedCut_.at(layer)).at(ladder); + } + else // Classic barrel window otherwise + { + window = 2*barrelCut_.at( layer ); + } + } + else if (stDetId.subdetId()==StripSubdetector::TID) + { + window = 2*(ringCut_.at( theTrackerTopo_->tidWheel(stDetId))).at(theTrackerTopo_->tidRing(stDetId)); + } + + // Compare this with the possibly tighter window provided by the user, converting to half-strip units. + unsigned int newWindow = (unsigned int)(2*windowFEnew); + if (window > newWindow) window = newWindow; + + // This is the window size measured in half-strips. + windowHalfStrips = window; + + // Number of degraded bend values should correspond to 3 bits (PS modules) or 4 bits (2S modules), + // so measuring everything in half-strip units, max integer "window" size that can be encoded without + // compression given by 2*window+1 <= pow(2,B), where B is number of bits. + // Hence no compression required if window cut is abs(b) < 3 (PS) or 7 (2S). Must introduce one merge for + // each 1 unit increase in "window" beyond this. + + // Bend is measured with granularity of 0.5 strips. + // Convert it to integer measured in half-strip units for this calculation! + + int b = std::round(2*bend); + + if (abs(b) <= window) { + reject = false; + float degradedB; + unsigned int numBends = 2*window + 1; + unsigned int numAllowed = (psModule) ? pow(2, bitsPS_) : pow(2, bits2S_); + // Existance of bend = 0 means can only use an odd number of groups. + numAllowed -= 1; + if (numBends <= numAllowed) { + // Can output uncompressed bend info. + numInGroup = 1; + degradedB = float(b); + } else { + unsigned int inSmallGroup = numBends/numAllowed; + unsigned int numLargeGroups = numBends%numAllowed; + unsigned int inLargeGroup = inSmallGroup + 1; + unsigned int numSmallGroups = numAllowed - numLargeGroups; + vector groups; + for (unsigned int i = 0; i < numLargeGroups/2; i++) groups.push_back(inLargeGroup); + for (unsigned int i = 0; i < numSmallGroups/2; i++) groups.push_back(inSmallGroup); + // Only one of numLargeGroups & numSmallGroups can be odd, since numAllowed is odd. + // And whichever one is odd is associated to a group with an odd number of elements since numBends is odd, + if (numLargeGroups%2 == 1 && inLargeGroup%2 == 1) { + groups.push_back(inLargeGroup); + } else if (numSmallGroups%2 == 1 && inSmallGroup%2 == 1) { + groups.push_back(inSmallGroup); + } else { + throw cms::Exception("DegradeBend: logic error with odd numbers"); + } + for (unsigned int i = 0; i < numSmallGroups/2; i++) groups.push_back(inSmallGroup); + for (unsigned int i = 0; i < numLargeGroups/2; i++) groups.push_back(inLargeGroup); + + degradedB = 999; + int iUp = -int(window) - 1; + for (unsigned int& inGroup: groups) { + iUp += inGroup; + int iDown = iUp - inGroup + 1; + if (b <= iUp && b >= iDown) { + numInGroup = inGroup; + degradedB = 0.5*(iUp + iDown); + } + } + if (degradedB == 999) throw cms::Exception("DegradeResolution: Logic error in loop over groups"); + } + + // This is degraded bend in full strip units (neglecting bend sign). + degradedBend = float(degradedB)/2.; + + } else { + // This shouldn't happen. If it does, the the window sizes assumed in this code are tighter than the ones + // actually used to produce the stubs. + reject = true; + numInGroup = 0; + degradedBend = 99999; + } +} + +//--- Check for mistakes. + +void DegradeBend::sanityChecks(bool psModule, const DetId& stDetId, float windowFEnew, float degradedBend, unsigned int numInGroup, unsigned int windowHalfStrips) const { + + pair p(windowHalfStrips, psModule); + + // Map notes if this (window size, psModule) combination has already been checked. + static map, bool> checked; + + if (checked.find(p) == checked.end()) { + bool wasDegraded = false; // Was any stub bend encoding required for this window size? + set degradedBendTmpValues; + set bendTmpMatches; + + // Loop over all bend values allowed within the window size. + for (int bendHalfStrips = -int(windowHalfStrips); bendHalfStrips <= int(windowHalfStrips); bendHalfStrips++) { + float bendTmp = float(bendHalfStrips)/2.; + float degradedBendTmp; + bool rejectTmp; + unsigned int numInGroupTmp = 0; + unsigned int windowHalfStripsTmp = 0; + this->work(bendTmp, psModule, stDetId, windowFEnew, + degradedBendTmp, rejectTmp, numInGroupTmp, windowHalfStripsTmp); + if (numInGroupTmp > 1) wasDegraded = true; + degradedBendTmpValues.insert(degradedBendTmp); + if (degradedBend == degradedBendTmp) bendTmpMatches.insert(bendTmp); // Gives same degraded bend as original problem. + + // Sanity checks. + if (rejectTmp) throw cms::Exception("DegradeBend: `rejected' flag set, despite bend being within window")<<" fabs("< "< maxAllowed) throw cms::Exception("DegradeBend: Bend encoding using too many bits")< "<phiSBits()), // No. of bits to store phiS coord. + phiSRange_ (settings->phiSRange()), // Range of phiS coord. in radians. + rtBits_ (settings->rtBits()), // No. of bits to store rT coord. + rtRange_ (settings->rtRange()), // Range of rT coord. in cm. + zBits_ (settings->zBits()), // No. of bits to store z coord. + zRange_ (settings->zRange()), // Range of z coord in cm. + phiSMult_ (pow(2, phiSBits_)/phiSRange_), + rtMult_ (pow(2, rtBits_ )/rtRange_), + zMult_ (pow(2, zBits_ )/zRange_), + // Radius from beamline with respect to which stub r coord. is measured. + numPhiSectors_ (settings->numPhiSectors()), + numPhiNonants_ (9), + phiSectorWidth_(2.*M_PI / float(numPhiSectors_)), + chosenRofPhi_ (settings->chosenRofPhi()) +{ + // Centre of this sector in phi. (Nonant 0 is centred on x-axis). + double phiCentreSec0 = -M_PI/float(numPhiNonants_) + M_PI/float(numPhiSectors_); + double phiSectorCentre = phiSectorWidth_ * float(iPhiSec) + phiCentreSec0; + + r_orig_ = r; + phi_orig_ = phi; + z_orig_ = z; + + rt_orig_ = r_orig_ - chosenRofPhi_; + phiS_orig_ = reco::deltaPhi(phi_orig_, phiSectorCentre); + + // Digitize + iDigi_Rt_ = floor(rt_orig_*rtMult_); + iDigi_PhiS_ = floor(phiS_orig_*phiSMult_); + iDigi_Z_ = floor(z_orig_*zMult_); + iDigi_Z_KF_ = iDigi_Z_; + + /* + + // SKIP UNTIL HYBRID DIGITISATION PARAMS IMPLEMENTED + + // Undigitize + r_ = (iDigi_R_ + 0.5)/rtMult_; + phiS_ = (iDigi_PhiS_ + 0.5)/phiSMult_; + phi_ = reco::deltaPhi(phiS_, -phiSectorRef); // N.B. phi_ measured w.r.t sector here, but w.r.t. + z_ = (iDigi_Z_ + 0.5)/zMult_; + + // Check that stub coords. are within assumed digitization range. + this->checkInRange(); + + // Check that digitization followed by undigitization doesn't change results too much. + this->checkAccuracy(); + + */ +} + + +//=== Note configuration parameters (for use with TMTT tracking). + +DigitalStub::DigitalStub(const Settings* settings) : + + // To check that DigitalStub is correctly initialized. + ranInit_(false), + ranMakeGPinput_(false), + ranMakeHTinput_(false), + ranMakeSForTFinput_(""), + + // Digitization configuration parameters + phiSectorBits_ (settings->phiSectorBits()), // No. of bits to store phi sector number + //--- Parameters available in HT board. + phiSBits_ (settings->phiSBits()), // No. of bits to store phiS coord. + phiSRange_ (settings->phiSRange()), // Range of phiS coord. in radians. + rtBits_ (settings->rtBits()), // No. of bits to store rT coord. + rtRange_ (settings->rtRange()), // Range of rT coord. in cm. + zBits_ (settings->zBits()), // No. of bits to store z coord. + zRange_ (settings->zRange()), // Range of z coord in cm. + //--- Parameters available in GP board (excluding any in common with HT specified above). + phiOBits_ (settings->phiOBits()), // No. of bits to store phiO parameter. + phiORange_ (settings->phiORange()), // Range of phiO parameter + bendBits_ (settings->bendBits()), // No. of bits to store stub bend. + + // Note if using reduced layer ID, so tracker layer can be encoded in 3 bits. + reduceLayerID_ (settings->reduceLayerID()), + + // Number of phi sectors and phi nonants. + numPhiSectors_ (settings->numPhiSectors()), + numPhiNonants_ (settings->numPhiNonants()), + // Phi sector and phi nonant width (radians) + phiSectorWidth_(2.*M_PI / float(numPhiSectors_)), + phiNonantWidth_(2.*M_PI / float(numPhiNonants_)), + // Radius from beamline with respect to which stub r coord. is measured. + chosenRofPhi_ (settings->chosenRofPhi()), + + // Number of q/Pt bins in Hough transform array. + nbinsPt_ ((int) settings->houghNbinsPt()) +{ + // Calculate multipliers to digitize the floating point numbers. + phiSMult_ = pow(2, phiSBits_)/phiSRange_; + rtMult_ = pow(2, rtBits_ )/rtRange_; + zMult_ = pow(2, zBits_ )/zRange_; + phiOMult_ = pow(2, phiOBits_)/phiORange_; + + bendMult_ = 4.; // No precision lost by digitization, since original bend (after encoding) has steps of 0.25 (in units of pitch). + bendRange_ = round(pow(2, bendBits_)/bendMult_); // discrete values, so digitisation different +} + +//=== Initialize stub with original, floating point stub coords, +//=== range of m bin (= q/Pt bin) values allowed by bend filter, +//=== normal & "reduced" tracker layer of stub, stub bend, and pitch & seperation of module, +//=== and half-length of strip or pixel in r and in z, and if it's in barrel, tilted barrel and/or PS module. + +void DigitalStub::init(float phi_orig, float r_orig, float z_orig, + unsigned int min_qOverPt_bin_orig, unsigned int max_qOverPt_bin_orig, + unsigned int layerID, unsigned int layerIDreduced, float bend_orig, + float pitch, float sep, float rErr, float zErr, bool barrel, bool tiltedBarrel, bool psModule) { + + ranInit_ = true; // Note we ran init(). + // Variables in HT. + phi_orig_ = phi_orig; + r_orig_ = r_orig; + z_orig_ = z_orig; + min_qOverPt_bin_orig_ = min_qOverPt_bin_orig; + max_qOverPt_bin_orig_ = max_qOverPt_bin_orig; + layerID_ = layerID; + layerIDreduced_ = layerIDreduced; + // Variables exclusively in GP. + bend_orig_ = bend_orig; + rErr_orig_ = rErr; + zErr_orig_ = zErr; + + // Calculate unique module type ID, allowing pitch/sep of module to be determined. + // (N.B. Module types 0 & 1 have identical pitch & sep, but one is tilted & one is flat barrel module). + + moduleType_ = 999; + // EJC new (additional) module type for tilted geometry + const vector pitchVsType = {0.0099, 0.0099, 0.0099, 0.0099, 0.0089, 0.0099, 0.0089, 0.0089}; + const vector sepVsType = {0.26 , 0.26 , 0.16 , 0.4 , 0.18 , 0.4 , 0.18 , 0.4 }; + const vector barrelVsType = {true , true , true , true , true , false , false , false }; + const vector psVsType = {true , true , true , true , false , true , false , false }; + const vector tiltedVsType = {false , true , false , true , false, false , false , false }; + if (pitchVsType.size() != sepVsType.size()) throw cms::Exception("DigitalStub: module type array size wrong"); + const float tol = 0.001; // Tolerance + for (unsigned int i = 0; i < pitchVsType.size(); i++) { + if (fabs(pitch - pitchVsType[i]) < tol && fabs(sep - sepVsType[i]) < tol && barrel == barrelVsType[i] && tiltedBarrel == tiltedVsType[i] && psModule == psVsType[i]) { + moduleType_ = i; + } + } + if (moduleType_ == 999) throw cms::Exception("DigitalStub: unknown module type")<<"pitch="<quickMakeGPinput(iPhiSec); + return; + } + } + + ranMakeGPinput_ = true; // Note we ran make(). + + //--- Shift axes of coords. if required. + + // r coordinate relative to specified point. + rt_orig_ = r_orig_ - chosenRofPhi_; + + // Phi coord. of stub relative to centre of nonant. + double phiNonantCentre = phiNonantWidth_ * double(iPhiNon); + + phiO_orig_ = reco::deltaPhi(phi_orig_, phiNonantCentre); + + //--- Digitize variables used exclusively in GP. + iDigi_Nonant_ = iPhiNon; + iDigi_PhiO_ = floor(phiO_orig_*phiOMult_); + iDigi_Bend_ = round(bend_orig_*bendMult_); // discrete values, so digitisation different + //--- Digitize variables used in both GP & HT. + iDigi_Rt_ = floor(rt_orig_*rtMult_); + iDigi_Z_ = floor(z_orig_*zMult_); + + //--- Determine floating point stub coords. from digitized numbers (so with degraded resolution). + //--- First for variables used exclusively in GP. + phiO_ = (iDigi_PhiO_ + 0.5)/phiOMult_; + bend_ = iDigi_Bend_/bendMult_; // discrete values, so digitisation different + phi_ = reco::deltaPhi(phiO_, -phiNonantCentre); + //--- Then for variables used in both GP & HT. + rt_ = (iDigi_Rt_ + 0.5)/rtMult_; + r_ = rt_ + chosenRofPhi_; + z_ = (iDigi_Z_ + 0.5)/zMult_; +} + +//=== Digitize stub for input to Hough transform, with stub phi coord. measured relative to specified phi sector. + +void DigitalStub::makeHTinput(unsigned int iPhiSec) { + + if (! ranInit_) throw cms::Exception("DigitalStub: You forgot to call init() before makeHTinput()!"); + + // Digitize for GP input if not already done, since some variables are shared by GP & HT. + this->makeGPinput(iPhiSec); + + // If this stub was already digitized, we don't have to redo all the work again. Save CPU. + if (ranMakeHTinput_) { + if (iPhiSec == iDigi_PhiSec_) { + return; // Work already done. + } else { + this->quickMakeHTinput(iPhiSec); + return; + } + } + + ranMakeHTinput_ = true; // Note we ran makeHTinput(). + + //--- Shift axes of coords. if required. + + // Centre of this sector in phi + double phiCentreSec0 = -M_PI/float(numPhiNonants_) + M_PI/float(numPhiSectors_); + double phiSectorCentre = phiSectorWidth_ * float(iPhiSec) + phiCentreSec0; + + // Point in sector from which stub phiS should be measured. + double phiSectorRef = phiSectorCentre; + + // Phi coord. of stub relative to centre of sector. + phiS_orig_ = reco::deltaPhi(phi_orig_, phiSectorRef); + + //--- Digitize variables used exclusively by HT. + iDigi_PhiSec_ = iPhiSec; + iDigi_PhiS_ = floor(phiS_orig_*phiSMult_); + // Don't bother digitising here variables used by both GP & HT, as makeGPinput() will already have digitized them. + + // N.B. If using daisy-chain firmware, then should logically recalculate m bin range here, since it depends on the now + // digitized r and z coordinates. But too lazy to move code here from Stub::digitizeForHTinput(), where calculation + // actually done. + + //--- Determine floating point stub coords. from digitized numbers (so with degraded resolution). + //--- First for variables used exclusively by HT + phiS_ = (iDigi_PhiS_ + 0.5)/phiSMult_; + phi_ = reco::deltaPhi(phiS_, -phiSectorRef); // N.B. phi_ measured w.r.t sector here, but w.r.t. nonant in makeGPinput() + // Don't bother with variables used by both GP & HT, as makeGPinput() will already have already calculated them. + + //--- Do next two checks here rather than in makeGPinput(), as the latter may be called for stubs in the wrong nonant, so out of range. + + // Check that stub coords. are within assumed digitization range. + this->checkInRange(); + + // Check that digitization followed by undigitization doesn't change results too much. + this->checkAccuracy(); + + // Adjust m-bin range, as hardware counts q/Pt bins in HT array using a signed integer in a symmetric range about zero. + const int min_array_bin = (nbinsPt_%2 == 0) ? -(nbinsPt_/2) : -(nbinsPt_ - 1)/2; + m_min_ = min_qOverPt_bin_orig_ + min_array_bin; + m_max_ = max_qOverPt_bin_orig_ + min_array_bin; + + //--- Produce tracker layer identifier, encoded as it is sent along the optical link. + + if (reduceLayerID_) { + // Firmware is using "reduced" layer ID, which can be packed into 3 bits in range 1-7. + iDigi_LayerID_ = layerIDreduced_; + + } else { + // Firmware is using normal layer ID, which needs more than 3 bits to store it. + // Encode barrel layers as 0 to 5. + iDigi_LayerID_ = layerID_ - 1; + // Endcode endcap layers as 6 to 10, not bothering to distinguish the two endcaps. + if (iDigi_LayerID_ == 10 || iDigi_LayerID_ == 20) { + iDigi_LayerID_ = 6; + } else if (iDigi_LayerID_ == 11 || iDigi_LayerID_ == 21) { + iDigi_LayerID_ = 7; + } else if (iDigi_LayerID_ == 12 || iDigi_LayerID_ == 22) { + iDigi_LayerID_ = 8; + } else if (iDigi_LayerID_ == 13 || iDigi_LayerID_ == 23) { + iDigi_LayerID_ = 9; + } else if (iDigi_LayerID_ == 14 || iDigi_LayerID_ == 24) { + iDigi_LayerID_ = 10; + } + } +} + +//=== Digitize stub for input to r-z Seed Filter or Track Fitter. +//=== Argument is "SeedFilter" or name of Track Fitter. +//=== N.B. This digitisation is done internally within the FPGA not for transmission along opto-links. + +void DigitalStub::makeSForTFinput(string SForTF) { + if (! ranInit_) throw cms::Exception("DigitalStub: You forgot to call init() before makeSForTFinput()!"); + + // Save CPU by not digitizing stub again if already done. + if (ranMakeSForTFinput_ != SForTF) { + ranMakeSForTFinput_ = SForTF; // Note we ran makeSForTFinput(). + + // The stub r coordinate is calculated inside the seed filter from the value of rT. + // Best to choose a ref. radius such that digitising then undigitising it leaves it unchanged. + iDigi_R_ = iDigi_Rt_ + std::round(chosenRofPhi_*rtMult_); + + //--- Determine floating point variables from digtized numbers. + r_ = (iDigi_R_ + 0.5)/rtMult_; + rt_ = r_ - chosenRofPhi_; + + if (SForTF.find("KF") != string::npos) { + // Digitize variables that are exclusive to Kalman filter. + // Data format uses z directly from HT, as its multiplier is exactly a factor 2 + // smaller than for r, which is easy to fix in VHDL-HLS interface. + iDigi_Z_KF_ = iDigi_Z_; + // Determine floating point variable from digitized one, using z multiplier. + z_ = (iDigi_Z_KF_ + 0.5)/zMult_; + } else { + // If not using KF, then restore z value from HT. + iDigi_Z_KF_ = 0; // Shoudln't be used in this case. + z_ = (iDigi_Z_ + 0.5)/zMult_; + } + + if (SForTF == "SeedFilter") { + //--- Digitize variables used exclusively in seed filter. + // The stub (r,z) uncertainties are actually calculated inside the seed filter and not passed to it along optical links. + iDigi_rErr_ = ceil(rErr_orig_*rtMult_); // Round up to avoid zero uncertainty ... + iDigi_zErr_ = ceil(zErr_orig_*zMult_); + //--- Determine floating point variables from digtized numbers + rErr_ = (iDigi_rErr_ - 0.5)/rtMult_; + zErr_ = (iDigi_zErr_ - 0.5)/zMult_; + } else { + // Restore original value. Although perhaps better to leave? + rErr_ = rErr_orig_; + zErr_ = zErr_orig_; + } + } +} + +void DigitalStub::makeDRinput(unsigned int stubId){ + if (! ranInit_) throw cms::Exception("DigitalStub: You forgot to call init() before makeDRinput()!"); + + ranMakeDRinput_ = true; // Note we ran makeDRinput(). + stubId_ = stubId; +} + + +//=== Redigitize stub for input to Geographic Processor, if it was previously digitized for a different phi sector. + +void DigitalStub::quickMakeGPinput(int iPhiSec) { + + //--- Shift axes of coords. if required. + + // Phi coord. of stub relative to centre of nonant. + unsigned int iPhiNon = floor(iPhiSec*numPhiNonants_/numPhiSectors_); + double phiNonantCentre = phiNonantWidth_ * double(iPhiNon); + phiO_orig_ = reco::deltaPhi(phi_orig_, phiNonantCentre); + + //--- Digitize variables used exclusively in GP. + iDigi_Nonant_ = iPhiNon; + iDigi_PhiO_ = floor(phiO_orig_*phiOMult_); + + //--- Determine floating point stub coords. from digitized numbers (so with degraded resolution). + //--- Variables used exclusively in GP. + phiO_ = (iDigi_PhiO_)/phiOMult_; + phi_ = reco::deltaPhi(phiO_, -phiNonantCentre); +} + +//=== Redigitize stub for input to Hough transform, if it was previously digitized for a different phi sector. + +void DigitalStub::quickMakeHTinput(int iPhiSec) { + + //--- Shift axes of coords. if required. + + // Centre of this sector in phi + double phiCentreSec0 = -M_PI/float(numPhiNonants_) + M_PI/float(numPhiSectors_); + double phiSectorCentre = phiSectorWidth_ * float(iPhiSec) + phiCentreSec0; + + // Point in sector from which stub phiS should be measured. + double phiSectorRef = phiSectorCentre; + + // Phi coord. of stub relative to centre of sector. + phiS_orig_ = reco::deltaPhi(phi_orig_, phiSectorRef); + + // Check that stub coords. are within assumed digitization range. + this->checkInRange(); + + //--- Digitize variables used in HT. + iDigi_PhiSec_ = iPhiSec; + iDigi_PhiS_ = floor(phiS_orig_*phiSMult_); + + //--- Determine floating point stub coords. from digitized numbers (so with degraded resolution). + //--- First for variables used in HT. + phiS_ = (iDigi_PhiS_)/phiSMult_; + phi_ = reco::deltaPhi(phiS_, -phiSectorRef); +} + +//=== Check that stub coords. are within assumed digitization range. + +void DigitalStub::checkInRange() const { + // All ranges are centred at zero, except for rho, which is +ve-definate. + if (fabs(phiS_orig_) >= 0.5*phiSRange_) throw cms::Exception("DigitalStub: Stub phiS is out of assumed digitization range.")<<" |phiS| = " < "<<0.5*phiSRange_<= 0.5*rtRange_) throw cms::Exception("DigitalStub: Stub rT is out of assumed digitization range.") <<" |rt| = " < "<<0.5*rtRange_ <= 0.5*zRange_) throw cms::Exception("DigitalStub: Stub z is out of assumed digitization range.") <<" |z| = " < "<<0.5*zRange_ <= 0.5*phiORange_) throw cms::Exception("DigitalStub: Stub phiO is out of assumed digitization range.")<<" |phiO| = " < "<<0.5*phiORange_ <= 0.5*bendRange_) throw cms::Exception("DigitalStub: Stub bend is out of assumed digitization range.")<<" |bend| = " < "<<0.5*bendRange_ < 0.001 || fabs(TB) > 0.3 || fabs(TC) > 0.25 || fabs(TD) > 0.005 || fabs(TE) > 0.01) { + nErr++; + cout<<"WARNING: DigitalStub lost precision: "< + +namespace TMTT { + +//=== Note configuration parameters. + +DigitalTrack::DigitalTrack(const Settings* settings) : + + // Check DigitalTrack correctly initialized. + ranInit_ (false), + ranMake_ (false), + + // Digitization configuration parameters + settings_(settings), + + // Number of phi sectors and phi nonants. + numPhiSectors_ (settings->numPhiSectors()), + numPhiNonants_ (settings->numPhiNonants()), + // Phi sector and phi nonant width (radians) + phiSectorWidth_(2.*M_PI / float(numPhiSectors_)), + phiNonantWidth_(2.*M_PI / float(numPhiNonants_)), + // Radius from beamline with respect to which stub r coord. is measured. + chosenRofPhi_ (settings->chosenRofPhi()), + + // Number of q/Pt bins in Hough transform array. + nbinsPt_ ((int) settings->houghNbinsPt()), + invPtToDPhi_ (settings->invPtToDphi()) +{ +} + +//=== Get digitisation configuration parameters for the specific track fitter being used here. + +void DigitalTrack::getDigiCfg(const string& fitterName) { + if (fitterName == "SimpleLR") { + // SimpleLR track fitter + skipTrackDigi_ = settings_->slr_skipTrackDigi(); + oneOver2rBits_ = settings_->slr_oneOver2rBits(); + oneOver2rRange_ = settings_->slr_oneOver2rRange(); + d0Bits_ = settings_->slr_d0Bits(); + d0Range_ = settings_->slr_d0Range(); + phi0Bits_ = settings_->slr_phi0Bits(); + phi0Range_ = settings_->slr_phi0Range(); + z0Bits_ = settings_->slr_z0Bits(); + z0Range_ = settings_->slr_z0Range(); + tanLambdaBits_ = settings_->slr_tanlambdaBits(); + tanLambdaRange_ = settings_->slr_tanlambdaRange(); + chisquaredBits_ = settings_->slr_chisquaredBits(); + chisquaredRange_= settings_->slr_chisquaredRange(); + } else { + // KF track fitter + // Also used for all other fitters, though unlikely to be correct them them ... + if (fitterName == "KF4ParamsComb" || fitterName == "KF5ParamsComb" || fitterName == "KF4ParamsCombHLS") { + skipTrackDigi_ = settings_->kf_skipTrackDigi(); + } else { + skipTrackDigi_ = settings_->other_skipTrackDigi(); // Allows to skip digitisation for other fitters + } + oneOver2rBits_ = settings_->kf_oneOver2rBits(); + oneOver2rRange_ = settings_->kf_oneOver2rRange(); + d0Bits_ = settings_->kf_d0Bits(); + d0Range_ = settings_->kf_d0Range(); + phi0Bits_ = settings_->kf_phi0Bits(); + phi0Range_ = settings_->kf_phi0Range(); + z0Bits_ = settings_->kf_z0Bits(); + z0Range_ = settings_->kf_z0Range(); + tanLambdaBits_ = settings_->kf_tanlambdaBits(); + tanLambdaRange_ = settings_->kf_tanlambdaRange(); + chisquaredBits_ = settings_->kf_chisquaredBits(); + chisquaredRange_= settings_->kf_chisquaredRange(); + } + + // Calculate multipliers to digitize the floating point numbers. + oneOver2rMult_ = pow(2.,oneOver2rBits_)/oneOver2rRange_; + d0Mult_ = pow(2.,d0Bits_)/d0Range_; + phi0Mult_ = pow(2.,phi0Bits_)/phi0Range_; + z0Mult_ = pow(2.,z0Bits_)/z0Range_; + tanLambdaMult_ = pow(2.,tanLambdaBits_)/tanLambdaRange_; + chisquaredMult_= pow(2.,chisquaredBits_)/chisquaredRange_; +} + +//=== Initialize track with original, floating point track params + +void DigitalTrack::init(const string& fitterName, unsigned int nHelixParams, + unsigned int iPhiSec, unsigned int iEtaReg, int mbin, int cbin, int mBinhelix, int cBinhelix, + unsigned int hitPattern, + float qOverPt_orig, float d0_orig, float phi0_orig, float tanLambda_orig, float z0_orig, float chisquaredRphi_orig, float chisquaredRz_orig, + float qOverPt_bcon_orig, float phi0_bcon_orig, float chisquaredRphi_bcon_orig, // beam-spot constrained values. + unsigned int nLayers, bool consistent, bool consistentSect, bool accepted, + float tp_qOverPt, float tp_d0, float tp_phi0, float tp_tanLambda, float tp_z0, float tp_eta, + int tp_index, bool tp_useForAlgEff, bool tp_useForEff, int tp_pdgId) +{ + ranInit_ = true; // Note we ran init(). + + fitterName_ = fitterName; + nHelixParams_ = nHelixParams; + + // Get digitisation parameters for this particular track fitter. + this->getDigiCfg(fitterName); + + double phiCentreSec0 = -M_PI/float(numPhiNonants_) + M_PI/float(numPhiSectors_); + phiSectorCentre_ = phiSectorWidth_ * float(iPhiSec) + phiCentreSec0; + + // FIX: Remove this BODGE once BCHI increased to 11 in KFstate.h + if (chisquaredRphi_orig >= chisquaredRange_) chisquaredRphi_orig = chisquaredRange_ - 0.1; + if (chisquaredRphi_bcon_orig >= chisquaredRange_) chisquaredRphi_bcon_orig = chisquaredRange_ - 0.1; + + qOverPt_orig_ = qOverPt_orig; + oneOver2r_orig_ = qOverPt_orig*invPtToDPhi_; + d0_orig_ = d0_orig; + phi0_orig_ = phi0_orig; + phi0rel_orig_ = reco::deltaPhi(phi0_orig_, phiSectorCentre_); + tanLambda_orig_ = tanLambda_orig; + z0_orig_ = z0_orig; + chisquaredRphi_orig_ = chisquaredRphi_orig; + chisquaredRz_orig_ = chisquaredRz_orig; + + // Same again with beam-spot constraint. + qOverPt_bcon_orig_ = qOverPt_bcon_orig; + oneOver2r_bcon_orig_ = qOverPt_bcon_orig*invPtToDPhi_; + phi0_bcon_orig_ = phi0_bcon_orig; + phi0rel_bcon_orig_ = reco::deltaPhi(phi0_bcon_orig_, phiSectorCentre_); + chisquaredRphi_bcon_orig_= chisquaredRphi_bcon_orig; + + nlayers_ = nLayers; + iPhiSec_ = iPhiSec; + iEtaReg_ = iEtaReg; + mBin_ = mbin; + cBin_ = cbin; + mBinhelix_ = mBinhelix; + cBinhelix_ = cBinhelix; + hitPattern_ = hitPattern; + + consistent_ = consistent; + consistentSect_ = consistentSect; + accepted_ = accepted; + tp_tanLambda_ = tp_tanLambda; + tp_qoverpt_ = tp_qOverPt; + tp_pt_ = 1./(1.0e-6 + fabs(tp_qOverPt)); + tp_d0_ = tp_d0; + tp_eta_ = tp_eta; + tp_phi0_ = tp_phi0; + tp_z0_ = tp_z0; + tp_index_ = tp_index; + tp_useForAlgEff_ = tp_useForAlgEff; + tp_useForEff_ = tp_useForEff; + tp_pdgId_ = tp_pdgId; +} + +//=== Digitize track + +void DigitalTrack::makeDigitalTrack() { + + if (! ranInit_) throw cms::Exception("DigitalTrack: You forgot to call init() before makeDigitalTrack()!"); + + ranMake_ = true; // Note we ran makeDigitalTrack() + + if (skipTrackDigi_) { + // Optionally skip track digitisaton if done internally inside track fitting code, so + // retain original helix params. + iDigi_oneOver2r_ = 0; + iDigi_d0_ = 0; + iDigi_phi0rel_ = 0; + iDigi_tanLambda_ = 0; + iDigi_z0_ = 0; + iDigi_chisquaredRphi_ = 0; + iDigi_chisquaredRz_ = 0; + + iDigi_oneOver2r_bcon_ = 0; + iDigi_phi0rel_bcon_ = 0; + iDigi_chisquaredRphi_bcon_ = 0; + + oneOver2r_ = oneOver2r_orig_; + qOverPt_ = qOverPt_orig_; + d0_ = d0_orig_; + phi0rel_ = phi0rel_orig_; + phi0_ = phi0_orig_; + tanLambda_ = tanLambda_orig_; + z0_ = z0_orig_; + chisquaredRphi_ = chisquaredRphi_orig_; + chisquaredRz_ = chisquaredRz_orig_; + + // Same again with beam-spot constraint. + oneOver2r_bcon_ = oneOver2r_bcon_orig_; + qOverPt_bcon_ = qOverPt_bcon_orig_; + phi0rel_bcon_ = phi0rel_bcon_orig_; + phi0_bcon_ = phi0_bcon_orig_; + chisquaredRphi_bcon_ = chisquaredRphi_bcon_orig_; + + } else { + + //--- Digitize variables + + iDigi_oneOver2r_ = floor(oneOver2r_orig_*oneOver2rMult_); + iDigi_d0_ = floor(d0_orig_*d0Mult_); + iDigi_phi0rel_ = floor(phi0rel_orig_*phi0Mult_); + iDigi_tanLambda_ = floor(tanLambda_orig_*tanLambdaMult_); + iDigi_z0_ = floor(z0_orig_*z0Mult_); + iDigi_chisquaredRphi_ = floor(chisquaredRphi_orig_*chisquaredMult_); + iDigi_chisquaredRz_ = floor(chisquaredRz_orig_*chisquaredMult_); + + // If fitted declared track invalid, it will have set its chi2 to very large number. + // So truncate it at maximum allowed by digitisation range. + if ( ! accepted_ ) { + iDigi_chisquaredRphi_ = pow(2.,chisquaredBits_) - 1; + iDigi_chisquaredRz_ = pow(2.,chisquaredBits_) - 1; + } + + // Same again with beam-spot constraint. + iDigi_oneOver2r_bcon_ = floor(oneOver2r_bcon_orig_*oneOver2rMult_); + iDigi_phi0rel_bcon_ = floor(phi0rel_bcon_orig_*phi0Mult_); + iDigi_chisquaredRphi_bcon_ = floor(chisquaredRphi_bcon_orig_*chisquaredMult_); + if ( ! accepted_ ) iDigi_chisquaredRphi_bcon_ = pow(2.,chisquaredBits_) - 1; + + // if(settings_->digitizeSLR()){ + // mBinhelix_ = floor(iDigi_1over2r_/pow(2,5)); + // cBinhelix_ = floor(iDigi_phiT_/pow(2,7)); + // } + + //--- Determine floating point track params from digitized numbers (so with degraded resolution). + + oneOver2r_ = (iDigi_oneOver2r_ + 0.5)/oneOver2rMult_; + qOverPt_ = oneOver2r_/invPtToDPhi_; + if (nHelixParams_ == 5) { + d0_ = (iDigi_d0_ + 0.5)/d0Mult_; + } else { + d0_ = 0.; + } + phi0rel_ = (iDigi_phi0rel_ + 0.5)/phi0Mult_; + phi0_ = reco::deltaPhi(phi0rel_, -phiSectorCentre_); + tanLambda_ = (iDigi_tanLambda_ + 0.5)/tanLambdaMult_; + z0_ = (iDigi_z0_ + 0.5)/z0Mult_; + chisquaredRphi_ = (iDigi_chisquaredRphi_ + 0.5)/chisquaredMult_; + chisquaredRz_ = (iDigi_chisquaredRz_ + 0.5)/chisquaredMult_; + + // Same again with beam-spot constraint. + if (nHelixParams_ == 5) { + oneOver2r_bcon_ = (iDigi_oneOver2r_bcon_ + 0.5)/oneOver2rMult_; + qOverPt_bcon_ = oneOver2r_bcon_/invPtToDPhi_; + phi0rel_bcon_ = (iDigi_phi0rel_bcon_ + 0.5)/phi0Mult_; + phi0_bcon_ = reco::deltaPhi(phi0rel_bcon_, -phiSectorCentre_); + chisquaredRphi_bcon_ = (iDigi_chisquaredRphi_bcon_ + 0.5)/chisquaredMult_; + } else { + oneOver2r_bcon_ = oneOver2r_; + qOverPt_bcon_ = qOverPt_; + phi0rel_bcon_ = phi0rel_; + phi0_bcon_ = phi0_; + chisquaredRphi_bcon_ = chisquaredRphi_; + } + + // Check that track coords. are within assumed digitization range. + this->checkInRange(); + + // Check that digitization followed by undigitization doesn't change results too much. + this->checkAccuracy(); + } +} + +//=== Check that stub coords. are within assumed digitization range. + +void DigitalTrack::checkInRange() const { + if (accepted_) { // Don't bother apply to tracks rejected by the fitter. + if (fabs(oneOver2r_orig_) >= 0.5*oneOver2rRange_) throw cms::Exception("DigitalTrack: Track oneOver2r is out of assumed digitization range.")<<" |oneOver2r| = " < "<<0.5*oneOver2rRange_<<"; Fitter="< "<<0.5*phi0Range_<<"; Fitter="< "<<0.5*z0Range_<<"; Fitter="< "<<0.5*d0Range_<<"; Fitter="< "<<0.5*tanLambdaRange_<<"; Fitter="< "< "< +#include + +using namespace std; + +namespace TMTT { + +class Settings; + +//=== Initialization + +void Get3Dtracks::init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, + float etaMinSector, float etaMaxSector, float phiCentreSector) { + + // Store config params & arguments. + settings_ = settings; + iPhiSec_ = iPhiSec; // Sector number + iEtaReg_ = iEtaReg; + etaMinSector_ = etaMinSector; // Range of eta sector + etaMaxSector_ = etaMaxSector; // Range of eta sector + phiCentreSector_ = phiCentreSector; // Centre of phi sector + + // Note if any fitters require an r-z track filter to be run. + runRZfilter_ = (settings->useRZfilter().size() > 0); + + // Initialize any track filters (e.g. r-z) run after the r-phi Hough transform. + if (runRZfilter_) rzFilter_.init(settings_, iPhiSec_, iEtaReg_, etaMinSector_, etaMaxSector_, phiCentreSector_); +} + +//=== Convert 2D tracks found by HT within the current sector to 3D tracks, without running any r-z track filter. +//=== by adding a rough estimate of their r-z helix parameters. + +void Get3Dtracks::makeUnfilteredTrks(const vector& vecTracksRphi) { + + vecTracks3D_unfiltered_.clear(); + + for (const L1track2D& trkRphi : vecTracksRphi) { + const vector& stubsOnTrkRphi = trkRphi.getStubs(); // stubs assigned to track + + float qOverPt = trkRphi.getHelix2D().first; + float phi0 = trkRphi.getHelix2D().second; + + if (settings_->enableDigitize()) { + // Centre of HT bin lies on boundary of two fitted track digi bins, so nudge slightly +ve (like FW) + // to remove ambiguity. + const float small = 0.1; + const unsigned int nHelixBits = 18; // Bits used internally in KF HLS to represent helix params. + qOverPt += (2./settings_->invPtToInvR()) * + small*settings_->kf_oneOver2rRange()/pow(2., nHelixBits); + phi0 += small*settings_->kf_phi0Range() /pow(2., nHelixBits); + } + pair helixRphi(qOverPt, phi0); + + // Estimate r-z track helix parameters from centre of eta sector. + float z0 = 0.; + float tan_lambda = 0.5*(1/tan(2*atan(exp(-etaMinSector_))) + 1/tan(2*atan(exp(-etaMaxSector_)))); + + // float etaCentreSector = 0.5*(etaMinSector_ + etaMaxSector_); + // float theta = 2. * atan(exp(-etaCentreSector)); + // tan_lambda = 1./tan(theta); + + pair helixRz(z0, tan_lambda); + + // Create 3D track, by adding r-z helix params to 2D track + L1track3D trk3D(settings_, stubsOnTrkRphi, + trkRphi.getCellLocationHT(), helixRphi, helixRz, + iPhiSec_ , iEtaReg_ , trkRphi.optoLinkID(), trkRphi.mergedHTcell()); + // L1track3D trk3D(settings_, stubsOnTrkRphi, + // trkRphi.getCellLocationHT(), trkRphi.getHelix2D(), helixRz, + // iPhiSec_ , iEtaReg_ , trkRphi.optoLinkID(), trkRphi.mergedHTcell()); + + // Optionally use MC truth to eliminate all fake tracks & all incorrect stubs assigned to tracks + // before doing fit (for debugging). + bool cheat_keep = true; + if (settings_->trackFitCheat()) cheat_keep = trk3D.cheat(); + + // Add to list of stored 3D tracks. + if (cheat_keep) vecTracks3D_unfiltered_.push_back( trk3D ); + } +} + +//=== Make 3D tracks from the 2D tracks found by the HT within the current sector, by running the r-z track filter. +//=== The r-z filter also adds an estimate of the r-z helix parameters to each track. + +void Get3Dtracks::makeRZfilteredTrks(const vector& vecTracksRphi) { + vecTracks3D_rzFiltered_ = rzFilter_.filterTracks(vecTracksRphi); + + // Optionally use MC truth to eliminate all fake tracks & all incorrect stubs assigned to tracks + // before doing fit (for debugging). + if (settings_->trackFitCheat()) { + vector vecTracks3D_tmp; + for (const L1track3D& trk : vecTracks3D_rzFiltered_) { + L1track3D trk_tmp = trk; + bool cheat_keep = trk_tmp.cheat(); + if (cheat_keep) vecTracks3D_tmp.push_back(trk_tmp); + } + vecTracks3D_rzFiltered_ = vecTracks3D_tmp; + } +} + +//=== Get all 3D track candidates (either r-z filtered on unfiltered, depending on the boolean), +//=== that are associated to the given tracking particle. +//=== (If the vector is empty, then the tracking particle was not reconstructed in this sector). + +vector Get3Dtracks::assocTrackCands3D(const TP& tp, bool rzFiltered) const { + + const vector& allTracks3D = (rzFiltered) ? vecTracks3D_rzFiltered_ : vecTracks3D_unfiltered_; + + vector assocRecoTrk; + + // Loop over track candidates, looking for those associated to given TP. + for (const L1track3D& trk : allTracks3D) { + if (trk.getMatchedTP() != nullptr) { + if (trk.getMatchedTP()->index() == tp.index()) assocRecoTrk.push_back(&trk); + } + } + + return assocRecoTrk; +} + +} diff --git a/L1Trigger/TrackFindingTMTT/src/HLS/HLSutilities.cc b/L1Trigger/TrackFindingTMTT/src/HLS/HLSutilities.cc new file mode 100644 index 0000000000000..582ea6ddf043b --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/HLS/HLSutilities.cc @@ -0,0 +1,159 @@ +/** + * General HLS utilities, not specific to KF. + * + * Author: Ian Tomalin + */ + +#ifdef CMSSW_GIT_HASH +#include "L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h" +#else +#include "HLSutilities.h" +#endif + +#ifdef CMSSW_GIT_HASH +namespace TMTT { + +namespace KalmanHLS { +#endif + +#ifdef PRINT_SUMMARY + +namespace CHECK_AP { + +// Map containing info about variable ranges in terms of numbers of bits required to represent them. +std::map apCheckMap_ = std::map(); + +// Map containing info about integer ranges expressed as numbers, +std::map intRangeMap_ = std::map(); + +// Print contents of map about variable ranges. + +void printCheckMap() { + + // Print summary about all variables & bits needed to represent them. + + std::cout<::const_iterator iter; + for (iter = apCheckMap_.begin(); iter != apCheckMap_.end(); iter++) { + const std::string& varName = iter->first; + const INFO& info = iter->second; + std::string status = (info.intBitsCfg_ >= info.intBitsSeenHigh_) ? "OK" : "BAD"; + int iWantBitRange = info.intBitsSeenHigh_-info.intBitsSeenLow_; + std::cout<::const_iterator iterInt; + for (iterInt = intRangeMap_.begin(); iterInt != intRangeMap_.end(); iterInt++) { + const std::string& varName = iterInt->first; + const INFO_int& info = iterInt->second; + std::string status = (info.intCfgHigh_ >= info.intSeenHigh_ && info.intCfgLow_ <= info.intSeenLow_) ? "OK" : "BAD"; + std::cout<= 0); + int intBitsSeen = (res_float_abs > 0) ? std::ceil(log(res_float_abs)/log(2.)) : -99; + + std::string cName = "float "; + int intBitsCfg = 99; + + if (apCheckMap_.find(varName) == apCheckMap_.end()) { + apCheckMap_[varName] = INFO(cName, intBitsCfg, intBitsSeen, intBitsSeen); + } else { + int intHighOld = apCheckMap_[varName].intBitsSeenHigh_; + int intLowOld = apCheckMap_[varName].intBitsSeenLow_; + if (intHighOld < intBitsSeen) { + apCheckMap_[varName] = INFO(cName, intBitsCfg, intBitsSeen, intLowOld); + } else if (intLowOld > intBitsSeen) { + apCheckMap_[varName] = INFO(cName, intBitsCfg, intHighOld, intBitsSeen); + } + } + return true; +} + +// Fill info for integer range summary table. + +bool checkIntRange(std::string varName, int intCfgHigh, int intCfgLow, int intValue) { + + bool OK = (intValue <= intCfgHigh && intValue >= intCfgLow); + + if (intRangeMap_.find(varName) == intRangeMap_.end()) { + intRangeMap_[varName] = INFO_int(intCfgHigh, intCfgLow, intValue, intValue); + } else { + int intHighOld = intRangeMap_[varName].intSeenHigh_; + int intLowOld = intRangeMap_[varName].intSeenLow_; + if (intHighOld < intValue) { + intRangeMap_[varName] = INFO_int(intCfgHigh, intCfgLow, intValue, intLowOld); + } else if (intLowOld > intValue) { + intRangeMap_[varName] = INFO_int(intCfgHigh, intCfgLow, intHighOld, intValue); + } + } + +#ifdef PRINT_SUMMARY + +#ifdef PRINT +#define NPRINTMAXI 99999 +#else +#define NPRINTMAXI 100 +#endif + + static unsigned int nErrors = 0; + + // Check -ve numbers aren't stored in unsigned variables. + if (not OK) { + nErrors++; + if (nErrors < NPRINTMAXI) std::cout<<"checkCalc INT RANGE ERROR: "< 0); +#ifdef PRINT_SUMMARY + static unsigned int detErrCount = 0; + if ((not OK) && detErrCount < 100) { + detErrCount++; + std::cout<<"checkCalc NEGATIVE DETERMINANT "< 0); +#ifdef PRINT_SUMMARY + static unsigned int detErrCount = 0; + if ((not OK) && detErrCount < 100) { + detErrCount++; + std::cout<<"checkCalc NEGATIVE DETERMINANT "< +#include + +namespace TMTT { + +//--- Explicit instantiation required for all non-specialized templates, to allow them to be implemented +//--- in .cc files. + +template KalmanHLS::KFstate<4> KFParamsCombCallHLS::getDigiStateIn(unsigned int skipped, unsigned int layer, const KalmanState* state) const; + +template KalmanHLS::KFstate<5> KFParamsCombCallHLS::getDigiStateIn(unsigned int skipped, unsigned int layer, const KalmanState* state) const; + +template const KalmanState* KFParamsCombCallHLS::getStateOut<4>(const KalmanState* stateIn, const StubCluster* stubCluster, const KalmanHLS::KFstate<4>& stateOutDigi, const KalmanHLS::KFselect<4>& selectOutDigi); + +template const KalmanState* KFParamsCombCallHLS::getStateOut<5>(const KalmanState* stateIn, const StubCluster* stubCluster, const KalmanHLS::KFstate<5>& stateOutDigi, const KalmanHLS::KFselect<5>& selectOutDigi); + +//--- Normal code below ... + +KFParamsCombCallHLS::KFParamsCombCallHLS(const Settings* settings, const uint nPar, const string &fitterName ) : KFParamsComb(settings, nPar, fitterName) { + + // Get digitisation multipliers. + rMult_ = pow(2, getSettings()->rtBits() ) / (getSettings()->rtRange()); + zMult_ = pow(2, getSettings()->zBits() ) / (getSettings()->zRange()); + phiMult_ = pow(2, getSettings()->phiSBits() ) / (getSettings()->phiSRange()); + const double small = 1.e-6; + if (fabs(rMult_ - KalmanHLS::rMult) / rMult_ > small || fabs(zMult_ - KalmanHLS::rMult / 2) / zMult_ > small || fabs(phiMult_ - KalmanHLS::phiMult) / phiMult_ > small) { + throw cms::Exception("ERROR: KFParamsCombCallHLS inconsistent digi multipliers.")<<" r="<chosenRofPhi(); + // Number of eta sectors. + numEtaRegions_ = getSettings()->numEtaRegions(); + +#ifdef PT_2GEV + if (settings->houghMinPt() > 2.5) throw cms::Exception("KFParamsConmbCallHLS: Edit KFpragmaOpts.h to undefine PT_2GEV"); +#else + if (settings->houghMinPt() < 2.5) throw cms::Exception("KFParamsConmbCallHLS: Edit KFpragmaOpts.h to define PT_2GEV"); +#endif + +#ifdef HYBRID_FORMAT + if (not settings_->hybrid()) throw cms::Exception("KFParamsConmbCallHLS: Edit KFpragmaOpts.h to undefine HYBRID_FORMAT"); +#else + if (settings_->hybrid()) throw cms::Exception("KFParamsConmbCallHLS: Edit KFpragmaOpts.h to define HYBRID_FORMAT"); +#endif +} + +//=== Update KF helix params with this stub. +//=== (Override KF state updator in L1KalmanComb with version suitable for HLS). + +const KalmanState* KFParamsCombCallHLS::kalmanUpdate( unsigned skipped, unsigned layer, const StubCluster *stubCluster, const KalmanState &stateIn, const TP *tpa ) { + + // cout.setf(ios::scientific, ios::floatfield); // Get useful debug printout ... + cout.unsetf(ios::floatfield); // Get useful debug printout ... + cout.precision(8); + + // Get digitised stub info + KalmanHLS::KFstubC stubDigi = this->getDigiStub(stubCluster, &stateIn); + + if (nPar_ == 4) { + + // Get digitised KF state info + KalmanHLS::KFstate<4> stateInDigi = this->getDigiStateIn<4>(skipped, layer, &stateIn); + + // Call HLS code to add stub to helix state. + KalmanHLS::KFstate<4> stateOutDigi; + KalmanHLS::KFselect<4> selectOutDigi; + KalmanHLS::kalmanUpdate(stubDigi, stateInDigi, stateOutDigi, selectOutDigi); + + // Convert digitized ourput KF state to floating point. + const KalmanState* newState = this->getStateOut(&stateIn, stubCluster, stateOutDigi, selectOutDigi); + + return newState; + + } else { + + // Get digitised KF state info + KalmanHLS::KFstate<5> stateInDigi = this->getDigiStateIn<5>(skipped, layer, &stateIn); + + // Call HLS code to add stub to helix state. + KalmanHLS::KFstate<5> stateOutDigi; + KalmanHLS::KFselect<5> selectOutDigi; + KalmanHLS::kalmanUpdate(stubDigi, stateInDigi, stateOutDigi, selectOutDigi); + + // Convert digitized ourput KF state to floating point. + const KalmanState* newState = this->getStateOut(&stateIn, stubCluster, stateOutDigi, selectOutDigi); + + return newState; + } +} + +//=== Get digital stub that the KF VHDL injects into the KF state updater (Maxeller/HLS) + +KalmanHLS::KFstubC KFParamsCombCallHLS::getDigiStub(const StubCluster* stubCluster, const KalmanState* state) { + // Get digitised stub(s) making up stub cluster. + const vector stubs = stubCluster->stubs(); + if (stubs.size() != 1) throw cms::Exception("KFParamsCombCallHLS: Can't cope with StubCluster that doesn't contain a single stub")<digitalStub(); + + KalmanHLS::KFstubC stubDigi; + // KF uses stub r, not rT. + stubDigi.r = digiStub.iDigi_Rt() + std::round(rMult_*chosenRofPhi_); + // KF VHDL z multiplier is factor 2 smaller than r multiplier, with BZ = BZ1 - 1 + // bits assigned to integer part of z in VHDL, and BZ1 bits assigned to it in HLS. Following statement + // therefore doubles the effective z multiplier. + enum {BZ = KalmanHLS::KFstubN::BZ, BZ1 = KalmanHLS::KFstubN::BZ1}; + stubDigi.z.range(BZ-1, 0) = ap_fixed(digiStub.iDigi_Z_KF()).range(BZ-1, 0); + stubDigi.phiS = digiStub.iDigi_PhiS(); + + #ifdef IRT_DEBUG + if (state->candidate().getMatchedTP() != nullptr) { + unsigned int iPhiSec = state->candidate().iPhiSec(); + + // Centre of phi (tracking) nonant zero must be along x-axis to be consistent with tracker cabling map. + // Define phi sector zero to start at lower end of phi range in nonant 0. + float phiCentreSec0 = -M_PI/float(getSettings()->numPhiNonants()) + M_PI/float(getSettings()->numPhiSectors()); + float phiSec = 2.*M_PI * float(iPhiSec) / float(getSettings()->numPhiSectors()) + phiCentreSec0; // Centre of sector in phi + + float phiStubOff = reco::deltaPhi(digiStub.phi(), digiStub.phiS()); + cout<<"KF sector phi check "<phi(),phiSec)<psModule()< +KalmanHLS::KFstate KFParamsCombCallHLS::getDigiStateIn(unsigned int skipped, unsigned int layer, const KalmanState* state) const { + // Calculate factors to convert floating point helix params to digitized ones. + // Based on constants & functions named *HWU* in +//https://svnweb.cern.ch/cern/wsvn/UK-TrackTrig/firmware/trunk/cactusupgrades/projects/tracktrigger/kalmanfit/firmware/cgn/src/formats/Constants.maxj . + + KalmanHLS::KFstate stateDigi; + + // Cell HT found track in, with (mbin,cbin) centred on zero. + pair htCell = state->candidate().getCellLocationHT(); + // Digitized HT cell info must be centred on zero. (See L1fittedTrack::digitalTrack()). + stateDigi.mBin_ht = htCell.first - floor(getSettings()->houghNbinsPt()/2); + stateDigi.cBin_ht = htCell.second - floor(getSettings()->houghNbinsPhi()/2); + + stateDigi.hitPattern = state->hitPattern(); + + // Fitted helix parameters. + vector helixParams = state->xa(); + double inv2R = helixParams[0]; // Half inverse radius of curvature. + double phi0 = helixParams[1]; // Measured with respect to centre of phi sector. + double tanL = helixParams[2]; + double z0 = helixParams[3]; + TMatrixD cov = state->pxxa(); + double cov_inv2R_inv2R = cov[0][0]; + double cov_phi0_phi0 = cov[1][1]; + double cov_tanL_tanL = cov[2][2]; + double cov_z0_z0 = cov[3][3]; + double cov_inv2R_phi0 = cov[0][1]; + double cov_tanL_z0 = cov[2][3]; + + // Digitize helix parameters, using multiplication factors in + // Demonstrator Units" section of https://twiki.cern.ch/twiki/pub/CMS/CMSUKTrkTrig/KFequations.pdf . + + // Using the specified multipliers, which are related to those used for stubs (see getDigiStub()) simplifies the maths. + // The helix params need better granularity than the stubs, which is accomodated by using additional bits after the + // decimal point in the digitized numbers (profitting from Maxeller/HLS ability to handle floats). + + stateDigi.inv2R = inv2R*inv2R_Mult_; // See inv2RToHWU() in Maxeller code in above web link. + stateDigi.phi0 = phi0*phiMult_; + + #ifdef IRT_DEBUG + if (state->candidate().getMatchedTP() != nullptr) { + unsigned int iPhiSec = state->candidate().iPhiSec(); + float phiCentreSec0 = -M_PI/float(getSettings()->numPhiNonants()) + M_PI/float(getSettings()->numPhiSectors()); + float phiSec = 2.*M_PI * float(iPhiSec) / float(getSettings()->numPhiSectors()) + phiCentreSec0; // Centre of sector in phi + cout<<"KF Input track (float): q/pt = "<invPtToInvR())<<" phi0 = "<getDigiStateInUtil(helixParams, cov, stateDigi); + + stateDigi.chiSquaredRphi = state->chi2rphi(); + stateDigi.chiSquaredRz = state->chi2rz(); + + // This is the KF layer that we are currently looking for stubs in, incremented by L1KalmanComb::doKF(), which in any eta region increases from 0-7 as a particle goes through each layer in turn. + stateDigi.layerID = layer; + // This is the number of skipped layers assuming we find a stub in the layer currently being searched. + stateDigi.nSkippedLayers = skipped; + + stateDigi.trackID = 0; // Not used by KF updator. + stateDigi.eventID = 0; // Not used by KF updator. + + unsigned int iEtaReg = state->candidate().iEtaReg(); // Although this comes from the state, it is actually the eta region of the stub. + // This is encoded in tortuous way copied from Maxeller code (lines 127-133). +//https://svnweb.cern.ch/cern/wsvn/UK-TrackTrig/firmware/trunk/cactusupgrades/projects/tracktrigger/kalmanfit/firmware/hdl/packages/stubs.vhd + if (iEtaReg < numEtaRegions_/2) { + stateDigi.etaSectID = (numEtaRegions_/2 - 1) - iEtaReg; // Count eta regions increasing away from theta = 90 degrees. + stateDigi.etaSectZsign = true; // Eta sector in -ve z half of Tracker. + } else { + stateDigi.etaSectID = iEtaReg - numEtaRegions_/2; + stateDigi.etaSectZsign = false; + } + + stateDigi.valid = true; + + return stateDigi; +} + +//=== Implement NPAR-specific code called by getDigiStateIn(...). + +template <> +void KFParamsCombCallHLS::getDigiStateInUtil<4>(const vector& helixParams, const TMatrixD& cov, KalmanHLS::KFstate<4>& stateDigi) const {} + +template <> +void KFParamsCombCallHLS::getDigiStateInUtil<5>(const vector& helixParams, const TMatrixD& cov, KalmanHLS::KFstate<5>& stateDigi) const { + + double d0 = helixParams[4]; + double cov_d0_d0 = cov[4][4]; + double cov_inv2R_d0 = cov[0][4]; + double cov_phi0_d0 = cov[1][4]; + + stateDigi.d0 = d0*d0_Mult_; + stateDigi.cov_44 = cov_d0_d0 * d0_Mult_ * d0_Mult_; + stateDigi.cov_04 = cov_inv2R_d0 * inv2R_Mult_ * d0_Mult_; + stateDigi.cov_14 = cov_phi0_d0 * phiMult_ * d0_Mult_; + KalmanHLS::CHECK_AP::checkCalc("helix4", stateDigi.d0 , d0*d0_Mult_ , 9.9e9, 0.1); + KalmanHLS::CHECK_AP::checkCalc("C44_old", stateDigi.cov_44, cov_d0_d0 * d0_Mult_ * d0_Mult_); + KalmanHLS::CHECK_AP::checkCalc("C04_old", stateDigi.cov_04, cov_inv2R_d0 * inv2R_Mult_ * d0_Mult_); + KalmanHLS::CHECK_AP::checkCalc("C14_old", stateDigi.cov_14, cov_phi0_d0 * phiMult_ * d0_Mult_); +} + +//=== Convert digitized ourput KF state to floating point for both NPAR = 4 & 5 param helix fits. + +template +const KalmanState* KFParamsCombCallHLS::getStateOut(const KalmanState* stateIn, const StubCluster* stubCluster, const KalmanHLS::KFstate& stateOutDigi, const KalmanHLS::KFselect& selectOutDigi) { + // Convert digitized helix state to floating point one. + // Also copy some info directly from input floating point to output floating point state, if unchanged. + + // Fill arguments of L1KalmanComb::mkState(), which is called to make a KalmanState object. + const L1track3D& candidate = stateIn->candidate(); + unsigned int n_skipped = stateOutDigi.nSkippedLayers; + unsigned int kLayer_next = stateOutDigi.layerID; // Unchanged by KF updator. + unsigned int layerId = stateIn->layerId(); + const KalmanState* last_state = stateIn; + + // Factors to convert digitized helix params to floating ones are inverse of those in getDigiStateIn(). + vector x(NPAR); // helix params + x[0] = (double(stateOutDigi.inv2R) + 0.5 / pow(2, stateOutDigi.inv2R.width - stateOutDigi.inv2R.iwidth)) / inv2R_Mult_; + x[1] = (double(stateOutDigi.phi0) + 0.5 / pow(2, stateOutDigi.phi0.width - stateOutDigi.phi0.iwidth )) / phiMult_; + x[2] = (double(stateOutDigi.tanL) + 0.5 / pow(2, stateOutDigi.tanL.width - stateOutDigi.tanL.iwidth )); + x[3] = (double(stateOutDigi.z0) + 0.5 / pow(2, stateOutDigi.z0.width - stateOutDigi.z0.iwidth )) / rMult_; + + TMatrixD pxx(NPAR,NPAR); // helix covariance matrix + pxx[0][0] = (double(stateOutDigi.cov_00) + 0.5 / pow(2, stateOutDigi.cov_00.width - stateOutDigi.cov_00.iwidth)) / (inv2R_Mult_ * inv2R_Mult_); + pxx[1][1] = (double(stateOutDigi.cov_11) + 0.5 / pow(2, stateOutDigi.cov_11.width - stateOutDigi.cov_11.iwidth)) / (phiMult_ * phiMult_); + pxx[2][2] = (double(stateOutDigi.cov_22) + 0.5 / pow(2, stateOutDigi.cov_22.width - stateOutDigi.cov_22.iwidth)); + pxx[3][3] = (double(stateOutDigi.cov_33) + 0.5 / pow(2, stateOutDigi.cov_33.width - stateOutDigi.cov_33.iwidth)) / (rMult_ * rMult_); + pxx[0][1] = (double(stateOutDigi.cov_01) + 0.5 / pow(2, stateOutDigi.cov_01.width - stateOutDigi.cov_01.iwidth)) / (inv2R_Mult_ * phiMult_); + pxx[1][0] = pxx[0][1]; + pxx[2][3] = (double(stateOutDigi.cov_23) + 0.5 / pow(2, stateOutDigi.cov_23.width - stateOutDigi.cov_23.iwidth)) / (rMult_); + pxx[3][2] = pxx[2][3]; + + this->getStateOutUtil(stateOutDigi, selectOutDigi, x, pxx); + + TMatrixD K(nPar_,2); // KF gain matrix - don't provide, as can't be used? + TMatrixD dcov(2,2); // Stub (phi,z) position covariance matrix - don't provide as can't be used? + const StubCluster* stubcl = stubCluster; + double chi2rphi = (double(stateOutDigi.chiSquaredRphi) + 0.5 / pow(2, stateOutDigi.chiSquaredRphi.width - stateOutDigi.chiSquaredRphi.iwidth)); + double chi2rz = (double(stateOutDigi.chiSquaredRz) + 0.5 / pow(2, stateOutDigi.chiSquaredRz.width - stateOutDigi.chiSquaredRz.iwidth)); + + const KalmanState* ks = this->mkState(candidate, n_skipped, kLayer_next, layerId, last_state, + x, pxx, K, dcov, stubcl, chi2rphi, chi2rz); + +#ifdef PRINT_HLSARGS + std::cout<invPtToInvR() / (2*state.xa()[INV2R]) ); + double z0=fabs( state.xa()[Z0] ); + + // Check if this state passes Algo50 duplicate removal cuts. + // (Approximate since it negelects "rescue" step of Algo50). + //bool algo50_HLS = true; + if (nStubLayers > 3) { + // algo50_HLS = (selectOutDigi_.consistent && selectOutDigi_.sectorCut); + // Debug printout to debug Algo50. To be used with "Cheat" cfg option. + // And print fittedTrack.consistent() from TMTrackProducer.cc. + // + // cout<<"algo50: HT consistent="<kalmanDebugLevel() >= 1) { + if (goodState && not goodState_HLS) { + // Errors caused by small precision errors in chi2 cut value. + if (nPar_ == 4) { + cout<<"ERROR: KF HLS incorrectly rejected state "< +#endif + +#ifdef CMSSW_GIT_HASH +namespace TMTT { + +namespace KalmanHLS { +#endif + +//--- Explicit instantiation required for all non-specialized templates, to allow them to be implemented +//--- in .cc files. + +template MatrixInverseR<4>::MatrixInverseR(const MatrixR<4>& R); + +template MatrixInverseR<5>::MatrixInverseR(const MatrixR<5>& R); + +// Covariance matrix of stub coords. + +MatrixV::MatrixV(const KFstubN::TR& r, const KFstubN::TZ& z, const KFstateN::TR& inv2R, const KFstateN::TT& tanL, const KFstateN::TM& mBin) : _01(0), _10(_01) { + + // Numbers from http://ghugo.web.cern.ch/ghugo/layouts/July/OT613_200_IT4025/layout.html + // Module pitch for tilted tracker geometry divided by sqrt(12) to get resolution. + //static const float invRoot12 = 1./sqrt(12.); + static const float invRoot12 = 0.288675; // 1/sqrt(12) + // Declaring these static causes cosimulation to set them to zero. Why? + // But it is OK if invRoot12 is defined as 0.288 instead of 1/sqrt(12.) + static const TM pitchPS = rphiMult*invRoot12*0.0099; // < 1024 + static const TM pitch2S = rphiMult*invRoot12*0.0089; + // Factor 1.41 allows for digitisation granularity (Sioni). + //static const TM lengthPS = rMult*invRoot12*0.15; + static const TM lengthPS = 1.41*rMult*invRoot12*0.15; + static const TM length2S = rMult*invRoot12*5.02; // < 16 + + // Initialise pitch/r ROMs. + static const PitchOverR_2 calcPitchPSoverR_2(pitchPS); + static const PitchOverR_2 calcPitch2SoverR_2(pitch2S); + + PitchOverR_2::TPOR pitchPSoverR_2 = calcPitchPSoverR_2.get[r.to_uint() >> PitchOverR_2::BRED]; + PitchOverR_2::TPOR pitch2SoverR_2 = calcPitch2SoverR_2.get[r.to_uint() >> PitchOverR_2::BRED]; + +#ifdef PRINT_SUMMARY + CHECK_AP::checkCalc("p*p/r*r", pitch2SoverR_2, double(pitch2S*pitch2S)/double(r*r)); +#endif +#ifdef PRINT + std::cout<<"p/r check "< sigmaZ; // Uncertainty in z. + MatrixV::TVPP sigmaPhiExtra2; + + // Initialize ROM used to calculate contribution to phi uncertainty from (r,phi) to (z,phi) conversion in endcap. + static const InvPt2 calcPhiExtra2_PS(1, lengthPS); + static const InvPt2 calcPhiExtra2_2S(1, length2S); + + if (absZ < zBarrel) { + // Barrel +#ifdef PRINT + std::cout<<"BARREL "<(BDET-1)]); + double trueDet = double(R._00)*double(R._11)-double(R._01)*double(R._10); + double trueInvDet = 1./trueDet; + double true_ri00 = double(R._11)*trueInvDet; + double true_ri11 = double(R._00)*trueInvDet; + double true_ri01 = -double(R._10)*trueInvDet; + // double invDet = double(invDet_short)*double(ap_ufixed<1-MIN_SHIFT+MAX_SHIFT, 1-MIN_SHIFT>(1) >> SHIFT); + double invDet = double(invDet_short)*double(ap_ufixed<1+NR_EXTRA, 1+IR_EXTRA>(1) >> SHIFT); + CHECK_AP::checkCalc("DET", det, trueDet, 0.00001); + // Precision of this (controlled by BDET) is critical. + // CHECK_AP::checkCalc("INVDET", invDet_short, + // trueInvDet/double(ap_ufixed<1-MIN_SHIFT+MAX_SHIFT, 1-MIN_SHIFT>(1) >> SHIFT), 0.0001); + CHECK_AP::checkCalc("INVDET", invDet_short, + trueInvDet/double(ap_ufixed<1+NR_EXTRA, 1+IR_EXTRA>(1) >> SHIFT), 0.0001); + CHECK_AP::checkCalc("INVR00", _00, true_ri00, 0.001); + CHECK_AP::checkCalc("INVR01", _01, true_ri01, 0.001); + CHECK_AP::checkCalc("INVR11", _11, true_ri11, 0.001); +#endif +} + +#ifdef CMSSW_GIT_HASH +} + +} +#endif + diff --git a/L1Trigger/TrackFindingTMTT/src/HLS/KalmanMatrices4.cc b/L1Trigger/TrackFindingTMTT/src/HLS/KalmanMatrices4.cc new file mode 100644 index 0000000000000..2aa8ca1a49e86 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/HLS/KalmanMatrices4.cc @@ -0,0 +1,176 @@ +///=== This is the base class for the Kalman Combinatorial Filter track fit algorithm. + +///=== All variable names & equations come from Fruhwirth KF paper +///=== http://dx.doi.org/10.1016/0168-9002%2887%2990887-4 + +///=== Written by: Ian Tomalin + +#ifdef CMSSW_GIT_HASH +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices4.h" +#else +#include "KalmanMatrices4.h" +#endif + +#ifdef PRINT_SUMMARY +#include +#endif + +#ifdef CMSSW_GIT_HASH +namespace TMTT { + +namespace KalmanHLS { +#endif + +// Calculate S = H * C + +MatrixS<4>::MatrixS(const MatrixH<4>& H, const MatrixC<4>& C) { + _00 = H._00 * C._00 + H._01 * C._10 + H._02 * C._20 + H._03 * C._30; + _01 = H._00 * C._01 + H._01 * C._11 + H._02 * C._21 + H._03 * C._31; + _02 = H._00 * C._02 + H._01 * C._12 + H._02 * C._22 + H._03 * C._32; + _03 = H._00 * C._03 + H._01 * C._13 + H._02 * C._23 + H._03 * C._33; + _10 = H._10 * C._00 + H._11 * C._10 + H._12 * C._20 + H._13 * C._30; + _11 = H._10 * C._01 + H._11 * C._11 + H._12 * C._21 + H._13 * C._31; + _12 = H._10 * C._02 + H._11 * C._12 + H._12 * C._22 + H._13 * C._32; + _13 = H._10 * C._03 + H._11 * C._13 + H._12 * C._23 + H._13 * C._33; + +#ifdef PRINT_SUMMARY + double s00 = H._00 * C._00 + H._01 * C._10 + H._02 * C._20 + H._03 * C._30; + double s01 = H._00 * C._01 + H._01 * C._11 + H._02 * C._21 + H._03 * C._31; + double s02 = H._00 * C._02 + H._01 * C._12 + H._02 * C._22 + H._03 * C._32; + double s03 = H._00 * C._03 + H._01 * C._13 + H._02 * C._23 + H._03 * C._33; + double s10 = H._10 * C._00 + H._11 * C._10 + H._12 * C._20 + H._13 * C._30; + double s11 = H._10 * C._01 + H._11 * C._11 + H._12 * C._21 + H._13 * C._31; + double s12 = H._10 * C._02 + H._11 * C._12 + H._12 * C._22 + H._13 * C._32; + double s13 = H._10 * C._03 + H._11 * C._13 + H._12 * C._23 + H._13 * C._33; + CHECK_AP::checkCalc("S00", _00, s00, 0.03); + CHECK_AP::checkCalc("S01", _01, s01, 0.03); + CHECK_AP::checkCalc("S02", _02, s02, 0.03); + CHECK_AP::checkCalc("S03", _03, s03, 0.03); + CHECK_AP::checkCalc("S10", _10, s10, 0.03); + CHECK_AP::checkCalc("S11", _11, s11, 0.03); + CHECK_AP::checkCalc("S12", _12, s12, 0.03); + CHECK_AP::checkCalc("S13", _13, s13, 0.03); +#endif +} + +// Calculate covariance matrix of predicted residuals R = V + H*C*Ht = V + H*St. + +MatrixR<4>::MatrixR(const MatrixV& V, const MatrixH<4>& H, const MatrixS_transpose<4>& St) : + _10(_01) +{ + _00 = V._00 + (H._00*St._00 + H._01*St._10 + H._02*St._20 + H._03*St._30); + _01 = V._01 + (H._00*St._01 + H._01*St._11 + H._02*St._21 + H._03*St._31); + // R._10 // Matrix symmetric so don't need to calculate this element. + _11 = V._11 + (H._10*St._01 + H._11*St._11 + H._12*St._21 + H._13*St._31); + +#ifdef PRINT_SUMMARY + double r00 = V._00 + (H._00*St._00 + H._01*St._10 + H._02*St._20 + H._03*St._30); + double r01 = V._01 + (H._00*St._01 + H._01*St._11 + H._02*St._21 + H._03*St._31); + double r11 = V._11 + (H._10*St._01 + H._11*St._11 + H._12*St._21 + H._13*St._31); + CHECK_AP::checkCalc("R00", _00, r00); + CHECK_AP::checkCalc("R01", _01, r01); + CHECK_AP::checkCalc("R11", _11, r11); +#endif +} + +// Kalman gain matrix K = S*R(inverse). + +MatrixK<4>::MatrixK(const MatrixS_transpose<4>& St, const MatrixInverseR<4>& RmatInv) { + _00 = St._00 * RmatInv._00 + St._01 * RmatInv._10; + _10 = St._10 * RmatInv._00 + St._11 * RmatInv._10; + _20 = St._20 * RmatInv._00 + St._21 * RmatInv._10; + _30 = St._30 * RmatInv._00 + St._31 * RmatInv._10; + _01 = St._00 * RmatInv._01 + St._01 * RmatInv._11; + _11 = St._10 * RmatInv._01 + St._11 * RmatInv._11; + _21 = St._20 * RmatInv._01 + St._21 * RmatInv._11; + _31 = St._30 * RmatInv._01 + St._31 * RmatInv._11; + +#ifdef PRINT_SUMMARY + double k00 = double(St._00) * double(RmatInv._00) + double(St._01) * double(RmatInv._10); + double k10 = double(St._10) * double(RmatInv._00) + double(St._11) * double(RmatInv._10); + double k20 = double(St._20) * double(RmatInv._00) + double(St._21) * double(RmatInv._10); + double k30 = double(St._30) * double(RmatInv._00) + double(St._31) * double(RmatInv._10); + double k01 = double(St._00) * double(RmatInv._01) + double(St._01) * double(RmatInv._11); + double k11 = double(St._10) * double(RmatInv._01) + double(St._11) * double(RmatInv._11); + double k21 = double(St._20) * double(RmatInv._01) + double(St._21) * double(RmatInv._11); + double k31 = double(St._30) * double(RmatInv._01) + double(St._31) * double(RmatInv._11); + CHECK_AP::checkCalc("K00", _00, k00, 0.001); + CHECK_AP::checkCalc("K10", _10, k10, 0.001); + CHECK_AP::checkCalc("K20", _20, k20, 0.001); + CHECK_AP::checkCalc("K30", _30, k30, 0.001); + CHECK_AP::checkCalc("K01", _01, k01, 0.001); + CHECK_AP::checkCalc("K11", _11, k11, 0.001); + CHECK_AP::checkCalc("K21", _21, k21, 0.001); + CHECK_AP::checkCalc("K31", _31, k31, 0.001); +#endif +} + +// Hit residuals: res = m - H*x. + +VectorRes<4>::VectorRes(const VectorM& m, const MatrixH<4>& H, const VectorX<4>& x) { + _0 = m._0 - (H._00 * x._0 + H._01 * x._1 + H._02 * x._2 + H._03 * x._3); + _1 = m._1 - (H._10 * x._1 + H._11 * x._1 + H._12 * x._2 + H._13 * x._3); +#ifdef PRINT_SUMMARY + double r0 = double(m._0) - (double(H._00) * double(x._0) + double(H._01) * double(x._1) + + double(H._02) * double(x._2) + double(H._03) * double(x._3)); + double r1 = double(m._1) - (double(H._10) * double(x._0) + double(H._11) * double(x._1) + + double(H._12) * double(x._2) + double(H._13) * double(x._3)); + CHECK_AP::checkCalc("RES0", _0, r0, 0.1, 0.1); + CHECK_AP::checkCalc("RES1", _1, r1, 0.1, 0.1); +#endif +} + +// Calculate output helix params: x' = x + K*res + +VectorX<4>::VectorX(const VectorX<4>& x, const MatrixK<4>& K, const VectorRes<4>& res) { + typedef MatrixK<4>::TK00_short TK00_short; + typedef MatrixK<4>::TK10_short TK10_short; + typedef MatrixK<4>::TK21_short TK21_short; + typedef MatrixK<4>::TK31_short TK31_short; + typedef MatrixK<4>::T0 T0; + _0 = x._0 + KFstateN::TR(TK00_short(K._00) * res._0 + T0 (K._01) * res._1); + _1 = x._1 + KFstateN::TP(TK10_short(K._10) * res._0 + T0 (K._11) * res._1); + _2 = x._2 + KFstateN::TT(T0 (K._20) * res._0 + TK21_short(K._21) * res._1); + _3 = x._3 + KFstateN::TZ(T0 (K._30) * res._0 + TK31_short(K._31) * res._1); +} + + +// Calculate output helix covariance matrix: C' = C - K*H*C = C - K*S. + +MatrixC<4>::MatrixC(const MatrixC<4>& C, const MatrixK<4>& K, const MatrixS<4>& S) : + _02(0), _03(0), _12(0), _13(0), + _10(_01), _32(_23), _20(_02), _30(_03), _21(_12), _31(_13) +{ + // Covariance matrix is symmetric & some elements can be neglected. + _00 = C._00 - KFstateN::TC00EX(K._00 * S._00 + K._01 * S._10); + _11 = C._11 - KFstateN::TC11EX(K._10 * S._01 + K._11 * S._11); + _22 = C._22 - KFstateN::TC22EX(K._20 * S._02 + K._21 * S._12); + _33 = C._33 - KFstateN::TC33EX(K._30 * S._03 + K._31 * S._13); + _01 = C._01 - KFstateN::TC01EX(K._00 * S._01 + K._01 * S._11); + _23 = C._23 - KFstateN::TC23EX(K._20 * S._03 + K._21 * S._13); + +#ifdef PRINT_SUMMARY + double c00new = double(C._00) - (double(K._00) * double(S._00) + double(K._01) * double(S._10)); + double c11new = double(C._11) - (double(K._10) * double(S._01) + double(K._11) * double(S._11)); + double c22new = double(C._22) - (double(K._20) * double(S._02) + double(K._21) * double(S._12)); + double c33new = double(C._33) - (double(K._30) * double(S._03) + double(K._31) * double(S._13)); + double c01new = double(C._01) - (double(K._00) * double(S._01) + double(K._01) * double(S._11)); + double c23new = double(C._23) - (double(K._20) * double(S._03) + double(K._21) * double(S._13)); + CHECK_AP::checkCalc("C00_new", _00, c00new, 0.05); + CHECK_AP::checkCalc("C11_new", _11, c11new, 0.03); + CHECK_AP::checkCalc("C22_new", _22, c22new, 0.04); + CHECK_AP::checkCalc("C33_new", _33, c33new, 0.03); + CHECK_AP::checkCalc("C01_new", _01, c01new, 0.03); + CHECK_AP::checkCalc("C23_new", _23, c23new, 0.03); + CHECK_AP::checkDet("C_new(rphi)",_00,_11,_01); + CHECK_AP::checkDet("C_new(rz)" ,_22,_33,_23); +#endif + +} + +#ifdef CMSSW_GIT_HASH +} + +} +#endif + diff --git a/L1Trigger/TrackFindingTMTT/src/HLS/KalmanMatrices5.cc b/L1Trigger/TrackFindingTMTT/src/HLS/KalmanMatrices5.cc new file mode 100644 index 0000000000000..dd329f8712435 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/HLS/KalmanMatrices5.cc @@ -0,0 +1,208 @@ +///=== This is the base class for the Kalman Combinatorial Filter track fit algorithm. + +///=== All variable names & equations come from Fruhwirth KF paper +///=== http://dx.doi.org/10.1016/0168-9002%2887%2990887-4 + +///=== Written by: Ian Tomalin + +#ifdef CMSSW_GIT_HASH +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices5.h" +#else +#include "KalmanMatrices5.h" +#endif + +#ifdef PRINT_SUMMARY +#include +#endif + +#ifdef CMSSW_GIT_HASH +namespace TMTT { + +namespace KalmanHLS { +#endif + +// Calculate matrix of derivatives of predicted stub coords w.r.t. helix params. + +MatrixH<5>::THD MatrixH<5>::setH04(const KFstubN::TR& r) { + static const MinusOneOverR calcMinusOneOverR; // Get -1/r + THD h04 = calcMinusOneOverR.get[r.to_uint() >> MinusOneOverR::BRED]; + return h04; +} + +// Calculate S = H * C + +MatrixS<5>::MatrixS(const MatrixH<5>& H, const MatrixC<5>& C) { + _00 = H._00 * C._00 + H._01 * C._10 + H._02 * C._20 + H._03 * C._30 + H._04 * C._40; + _01 = H._00 * C._01 + H._01 * C._11 + H._02 * C._21 + H._03 * C._31 + H._04 * C._41; + _02 = H._00 * C._02 + H._01 * C._12 + H._02 * C._22 + H._03 * C._32 + H._04 * C._42; + _03 = H._00 * C._03 + H._01 * C._13 + H._02 * C._23 + H._03 * C._33 + H._04 * C._43; + _04 = H._00 * C._04 + H._01 * C._14 + H._02 * C._24 + H._03 * C._34 + H._04 * C._44; + _10 = H._10 * C._00 + H._11 * C._10 + H._12 * C._20 + H._13 * C._30 + H._14 * C._40; + _11 = H._10 * C._01 + H._11 * C._11 + H._12 * C._21 + H._13 * C._31 + H._14 * C._41; + _12 = H._10 * C._02 + H._11 * C._12 + H._12 * C._22 + H._13 * C._32 + H._14 * C._42; + _13 = H._10 * C._03 + H._11 * C._13 + H._12 * C._23 + H._13 * C._33 + H._14 * C._43; + _14 = H._10 * C._04 + H._11 * C._14 + H._12 * C._24 + H._13 * C._34 + H._14 * C._44; + +#ifdef PRINT_SUMMARY + double s00 = H._00 * C._00 + H._01 * C._10 + H._02 * C._20 + H._03 * C._30 + H._04 * C._40; + double s01 = H._00 * C._01 + H._01 * C._11 + H._02 * C._21 + H._03 * C._31 + H._04 * C._41; + double s02 = H._00 * C._02 + H._01 * C._12 + H._02 * C._22 + H._03 * C._32 + H._04 * C._42; + double s03 = H._00 * C._03 + H._01 * C._13 + H._02 * C._23 + H._03 * C._33 + H._04 * C._43; + double s04 = H._00 * C._04 + H._01 * C._14 + H._02 * C._24 + H._03 * C._34 + H._04 * C._44; + double s10 = H._10 * C._00 + H._11 * C._10 + H._12 * C._20 + H._13 * C._30 + H._14 * C._40; + double s11 = H._10 * C._01 + H._11 * C._11 + H._12 * C._21 + H._13 * C._31 + H._14 * C._41; + double s12 = H._10 * C._02 + H._11 * C._12 + H._12 * C._22 + H._13 * C._32 + H._14 * C._42; + double s13 = H._10 * C._03 + H._11 * C._13 + H._12 * C._23 + H._13 * C._33 + H._14 * C._43; + double s14 = H._10 * C._04 + H._11 * C._14 + H._12 * C._24 + H._13 * C._34 + H._14 * C._44; + CHECK_AP::checkCalc("S00", _00, s00, 0.03); + CHECK_AP::checkCalc("S01", _01, s01, 0.03); + CHECK_AP::checkCalc("S02", _02, s02, 0.03); + CHECK_AP::checkCalc("S03", _03, s03, 0.03); + CHECK_AP::checkCalc("S04", _04, s04, 0.03); + CHECK_AP::checkCalc("S10", _10, s10, 0.03); + CHECK_AP::checkCalc("S11", _11, s11, 0.03); + CHECK_AP::checkCalc("S12", _12, s12, 0.03); + CHECK_AP::checkCalc("S13", _13, s13, 0.03); + CHECK_AP::checkCalc("S14", _14, s14, 0.03); +#endif +} + +// Calculate covariance matrix of predicted residuals R = V + H*C*Ht = V + H*St. + +MatrixR<5>::MatrixR(const MatrixV& V, const MatrixH<5>& H, const MatrixS_transpose<5>& St) : + _10(_01) +{ + _00 = V._00 + (H._00*St._00 + H._01*St._10 + H._02*St._20 + H._03*St._30 + H._04*St._40); + _01 = V._01 + (H._00*St._01 + H._01*St._11 + H._02*St._21 + H._03*St._31 + H._04*St._41); + // R._10 // Matrix symmetric so don't need to calculate this element. + _11 = V._11 + (H._10*St._01 + H._11*St._11 + H._12*St._21 + H._13*St._31 + H._14*St._41); + +#ifdef PRINT_SUMMARY + double r00 = V._00 + (H._00*St._00 + H._01*St._10 + H._02*St._20 + H._03*St._30 + H._04*St._40); + double r01 = V._01 + (H._00*St._01 + H._01*St._11 + H._02*St._21 + H._03*St._31 + H._04*St._41); + double r11 = V._11 + (H._10*St._01 + H._11*St._11 + H._12*St._21 + H._13*St._31 + H._14*St._41); + CHECK_AP::checkCalc("R00", _00, r00); + CHECK_AP::checkCalc("R01", _01, r01); + CHECK_AP::checkCalc("R11", _11, r11); +#endif +} + +// Kalman gain matrix K = S*R(inverse). + +MatrixK<5>::MatrixK(const MatrixS_transpose<5>& St, const MatrixInverseR<5>& RmatInv) { + _00 = St._00 * RmatInv._00 + St._01 * RmatInv._10; + _10 = St._10 * RmatInv._00 + St._11 * RmatInv._10; + _20 = St._20 * RmatInv._00 + St._21 * RmatInv._10; + _30 = St._30 * RmatInv._00 + St._31 * RmatInv._10; + _40 = St._40 * RmatInv._00 + St._41 * RmatInv._10; + _01 = St._00 * RmatInv._01 + St._01 * RmatInv._11; + _11 = St._10 * RmatInv._01 + St._11 * RmatInv._11; + _21 = St._20 * RmatInv._01 + St._21 * RmatInv._11; + _31 = St._30 * RmatInv._01 + St._31 * RmatInv._11; + _41 = St._30 * RmatInv._01 + St._41 * RmatInv._11; + +#ifdef PRINT_SUMMARY + double k00 = double(St._00) * double(RmatInv._00) + double(St._01) * double(RmatInv._10); + double k10 = double(St._10) * double(RmatInv._00) + double(St._11) * double(RmatInv._10); + double k20 = double(St._20) * double(RmatInv._00) + double(St._21) * double(RmatInv._10); + double k30 = double(St._30) * double(RmatInv._00) + double(St._31) * double(RmatInv._10); + double k40 = double(St._40) * double(RmatInv._00) + double(St._41) * double(RmatInv._10); + double k01 = double(St._00) * double(RmatInv._01) + double(St._01) * double(RmatInv._11); + double k11 = double(St._10) * double(RmatInv._01) + double(St._11) * double(RmatInv._11); + double k21 = double(St._20) * double(RmatInv._01) + double(St._21) * double(RmatInv._11); + double k31 = double(St._30) * double(RmatInv._01) + double(St._31) * double(RmatInv._11); + double k41 = double(St._40) * double(RmatInv._01) + double(St._41) * double(RmatInv._11); + CHECK_AP::checkCalc("K00", _00, k00, 0.001); + CHECK_AP::checkCalc("K10", _10, k10, 0.001); + CHECK_AP::checkCalc("K20", _20, k20, 0.001); + CHECK_AP::checkCalc("K30", _30, k30, 0.001); + CHECK_AP::checkCalc("K40", _40, k40, 0.001); + CHECK_AP::checkCalc("K01", _01, k01, 0.001); + CHECK_AP::checkCalc("K11", _11, k11, 0.001); + CHECK_AP::checkCalc("K21", _21, k21, 0.001); + CHECK_AP::checkCalc("K31", _31, k31, 0.001); + CHECK_AP::checkCalc("K41", _41, k41, 0.001); +#endif +} + +// Hit residuals: res = m - H*x. + +VectorRes<5>::VectorRes(const VectorM& m, const MatrixH<5>& H, const VectorX<5>& x) { + _0 = m._0 - (H._00 * x._0 + H._01 * x._1 + H._02 * x._2 + H._03 * x._3 + H._04 * x._4); + _1 = m._1 - (H._10 * x._1 + H._11 * x._1 + H._12 * x._2 + H._13 * x._3 + H._14 * x._4); +#ifdef PRINT_SUMMARY + double r0 = double(m._0) - (double(H._00) * double(x._0) + double(H._01) * double(x._1) + + double(H._02) * double(x._2) + double(H._03) * double(x._3) + + double(H._04) * double(x._4)); + double r1 = double(m._1) - (double(H._10) * double(x._0) + double(H._11) * double(x._1) + + double(H._12) * double(x._2) + double(H._13) * double(x._3) + + double(H._14) * double(x._4)); + CHECK_AP::checkCalc("RES0", _0, r0, 0.1, 0.1); + CHECK_AP::checkCalc("RES1", _1, r1, 0.1, 0.1); +#endif +} + +// Calculate output helix params: x' = x + K*res + +VectorX<5>::VectorX(const VectorX<5>& x, const MatrixK<5>& K, const VectorRes<5>& res) { + typedef MatrixK<5>::TK00_short TK00_short; + typedef MatrixK<5>::TK10_short TK10_short; + typedef MatrixK<5>::TK21_short TK21_short; + typedef MatrixK<5>::TK31_short TK31_short; + typedef MatrixK<5>::TK40_short TK40_short; + typedef MatrixK<5>::T0 T0; + _0 = x._0 + KFstateN::TR(TK00_short(K._00) * res._0 + T0 (K._01) * res._1); + _1 = x._1 + KFstateN::TP(TK10_short(K._10) * res._0 + T0 (K._11) * res._1); + _2 = x._2 + KFstateN::TT(T0 (K._20) * res._0 + TK21_short(K._21) * res._1); + _3 = x._3 + KFstateN::TZ(T0 (K._30) * res._0 + TK31_short(K._31) * res._1); + _4 = x._4 + KFstateN::TD(TK40_short(K._40) * res._0 + T0 (K._41) * res._1); +} + + +// Calculate output helix covariance matrix: C' = C - K*H*C = C - K*S. + +MatrixC<5>::MatrixC(const MatrixC<5>& C, const MatrixK<5>& K, const MatrixS<5>& S) : + _02(0), _03(0), _12(0), _13(0), _42(0), _43(0), + _10(_01), _32(_23), _40(_04), _41(_14), _20(_02), _30(_03), _21(_12), _31(_13), _24(_42), _34(_43) +{ + // Covariance matrix is symmetric & some elements can be neglected. + _00 = C._00 - KFstateN::TC00EX(K._00 * S._00 + K._01 * S._10); + _11 = C._11 - KFstateN::TC11EX(K._10 * S._01 + K._11 * S._11); + _22 = C._22 - KFstateN::TC22EX(K._20 * S._02 + K._21 * S._12); + _33 = C._33 - KFstateN::TC33EX(K._30 * S._03 + K._31 * S._13); + _44 = C._44 - KFstateN::TC44EX(K._40 * S._04 + K._41 * S._14); + _01 = C._01 - KFstateN::TC01EX(K._00 * S._01 + K._01 * S._11); + _23 = C._23 - KFstateN::TC23EX(K._20 * S._03 + K._21 * S._13); + _04 = C._04 - KFstateN::TC04EX(K._00 * S._04 + K._01 * S._14); + _14 = C._14 - KFstateN::TC14EX(K._10 * S._04 + K._11 * S._14); + +#ifdef PRINT_SUMMARY + double c00new = double(C._00) - (double(K._00) * double(S._00) + double(K._01) * double(S._10)); + double c11new = double(C._11) - (double(K._10) * double(S._01) + double(K._11) * double(S._11)); + double c22new = double(C._22) - (double(K._20) * double(S._02) + double(K._21) * double(S._12)); + double c33new = double(C._33) - (double(K._30) * double(S._03) + double(K._31) * double(S._13)); + double c44new = double(C._44) - (double(K._40) * double(S._04) + double(K._41) * double(S._14)); + double c01new = double(C._01) - (double(K._00) * double(S._01) + double(K._01) * double(S._11)); + double c23new = double(C._23) - (double(K._20) * double(S._03) + double(K._21) * double(S._13)); + double c04new = double(C._04) - (double(K._00) * double(S._04) + double(K._01) * double(S._14)); + double c14new = double(C._14) - (double(K._10) * double(S._04) + double(K._11) * double(S._14)); + CHECK_AP::checkCalc("C00_new", _00, c00new, 0.03); + CHECK_AP::checkCalc("C11_new", _11, c11new, 0.03); + CHECK_AP::checkCalc("C22_new", _22, c22new, 0.03); + CHECK_AP::checkCalc("C33_new", _33, c33new, 0.03); + CHECK_AP::checkCalc("C44_new", _44, c44new, 0.03); + CHECK_AP::checkCalc("C01_new", _01, c01new, 0.03); + CHECK_AP::checkCalc("C23_new", _23, c23new, 0.03); + CHECK_AP::checkCalc("C04_new", _04, c04new, 0.03); + CHECK_AP::checkCalc("C14_new", _14, c14new, 0.03); + CHECK_AP::checkDet("C_new(rphi)",_00,_11,_44, _01, _04, _14); + CHECK_AP::checkDet("C_new(rz)" ,_22,_33,_23); +#endif +} + +#ifdef CMSSW_GIT_HASH +} + +} +#endif + diff --git a/L1Trigger/TrackFindingTMTT/src/HLS/KalmanUpdate.cc b/L1Trigger/TrackFindingTMTT/src/HLS/KalmanUpdate.cc new file mode 100644 index 0000000000000..7f8eef04f291c --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/HLS/KalmanUpdate.cc @@ -0,0 +1,311 @@ +/** + * This is the top-level HLS function, which updates a helix state by adding a stub to it. + * N.B. It therefore can't use the Settings class or any external libraries! Nor can it be a C++ class. + * + * All variable names & equations come from Fruhwirth KF paper + * http://dx.doi.org/10.1016/0168-9002%2887%2990887-4 + * + * Author: Ian Tomalin + */ + +#ifdef CMSSW_GIT_HASH +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h" +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFconstants.h" +#else +#include "KalmanUpdate.h" +#include "KalmanMatrices.h" +#include "HLSutilities.h" +#include "KFconstants.h" +#endif + +#ifdef PRINT_SUMMARY +#include +#endif + +#ifdef CMSSW_GIT_HASH +namespace TMTT { + +namespace KalmanHLS { +#endif + +//--- Explicit instantiation required for all non-specialized templates, to allow them to be implemented +//--- in .cc files. + +template void kalmanUpdate(const KFstubC& stub, const KFstate<4>& stateIn, KFstate<4>& stateOut, KFselect<4>& selectOut); + +template void kalmanUpdate(const KFstubC& stub, const KFstate<5>& stateIn, KFstate<5>& stateOut, KFselect<5>& selectOut); + +template void calcDeltaChi2(const VectorRes<4>& res, const MatrixInverseR<4>& Rinv, TCHI_INT& dChi2_phi, TCHI_INT& dChi2_z); + +template void calcDeltaChi2(const VectorRes<5>& res, const MatrixInverseR<5>& Rinv, TCHI_INT& dChi2_phi, TCHI_INT& dChi2_z); + +//=== Add stub to old KF helix state to get new KF helix state. + +template +void kalmanUpdate(const KFstubC& stub, const KFstate& stateIn, KFstate& stateOut, KFselect& selectOut) { + + stateOut.cBin_ht = stateIn.cBin_ht; + stateOut.mBin_ht = stateIn.mBin_ht; + stateOut.layerID = stateIn.layerID; + stateOut.nSkippedLayers = stateIn.nSkippedLayers; + stateOut.hitPattern = stateIn.hitPattern; + stateOut.trackID = stateIn.trackID; + stateOut.eventID = stateIn.eventID; + stateOut.phiSectID = stateIn.phiSectID; + stateOut.etaSectID = stateIn.etaSectID; + stateOut.etaSectZsign = stateIn.etaSectZsign; + stateOut.valid = (stub.valid && stateIn.valid); + +#ifdef PRINT_SUMMARY + static bool first = true; + if (first) { + first = false; + std::cout< MAX_CHI2) chi2_phi = MAX_CHI2; + if (chi2_z > MAX_CHI2) chi2_z = MAX_CHI2; + stateOut.chiSquaredRphi = chi2_phi; + stateOut.chiSquaredRz = chi2_z; + + stateOut.inv2R = x_new._0; + stateOut.phi0 = x_new._1; + stateOut.tanL = x_new._2; + stateOut.z0 = x_new._3; + stateOut.cov_00 = C_new._00; + stateOut.cov_11 = C_new._11; + stateOut.cov_22 = C_new._22; + stateOut.cov_33 = C_new._33; + stateOut.cov_01 = C_new._01; + stateOut.cov_23 = C_new._23; + + // Check if output helix passes cuts. + // (Copied from Maxeller code KFWorker.maxj) + ap_uint<3> nStubs = stateIn.layerID - stateIn.nSkippedLayers; // Number of stubs on state including current one. + + // IRT - feed in test helix params to debug cases seen in QuestaSim. (1/2r, phi, tanl, z0) + //x_new._0 = float(-8163)/float(1 << (B18 - KFstateN::BH0)); + //x_new._1 = float(-57543)/float(1 << (B18 - KFstateN::BH1)); + //x_new._2 = float(4285)/float(1 << (B18 - KFstateN::BH2)); + //x_new._3 = float(-7652)/float(1 << (B18 - KFstateN::BH3)); + + KFstateN::TZ cut_z0 = z0Cut[nStubs]; + KFstateN::TZ cut_z0_minus = z0CutMinus[nStubs]; + KFstateN::TR cut_inv2R = inv2Rcut[nStubs]; + KFstateN::TR cut_inv2R_minus = inv2RcutMinus[nStubs]; + KFstateN::TCHI cut_chi2 = chi2Cut[nStubs]; + // Don't do "hls::abs(x_new._3) <= cut_z0)" as this wastes 2 clk cycles. + // Also, don't do "cut_z0_minus = - cut_z0" or this fails Vivado implementation with timing errors. + selectOut.z0Cut = ((x_new._3 >= cut_z0_minus && x_new._3 <= cut_z0) || (cut_z0 == 0)); // cut = 0 means cut not applied. + selectOut.ptCut = ((x_new._0 >= cut_inv2R_minus && x_new._0 <= cut_inv2R) || (cut_inv2R == 0)); + selectOut.chiSquaredCut = ((chi2_phi / chi2rphiScale + chi2_z <= cut_chi2) || (cut_chi2 == 0)); + selectOut.sufficientPScut = not (nStubs <= 2 && V._2Smodule); + // IRT -- very useful whilst optimising variable bit ranges, to skip all but first iteration. + //selectOut.ptCut = false; + + //=== Set output helix params & associated cov matrix related to d0, & check if d0 passes cut. + //=== (Relevant only to 5-param helix fit) + setOutputsD0(x_new, C_new, nStubs, stateOut, selectOut); + +#ifdef PRINT_HLSARGS + stub.print("HLS INPUT stub:"); + stateIn.print("HLS INPUT state:"); + stateOut.print("HLS OUTPUT state:"); + selectOut.print("HLS OUTPUT extra:"); +#endif +} + +//=== Calculate increase in chi2 (in r-phi & r-z) from adding new stub: delta(chi2) = res(transpose) * R(inverse) * res + +template +void calcDeltaChi2(const VectorRes& res, const MatrixInverseR& Rinv, TCHI_INT& dChi2_phi, TCHI_INT& dChi2_z) { + // Simplify calculation by noting that Rinv is symmetric. + typedef typename MatrixInverseR::TRI00_short TRI00_short; + typedef typename MatrixInverseR::TRI11_short TRI11_short; + typedef typename MatrixInverseR::TRI01_short TRI01_short; + dChi2_phi = (res._0 * res._0) * TRI00_short(Rinv._00) + + 2 * (res._0 * res._1) * TRI01_short(Rinv._01); + dChi2_z = (res._1 * res._1) * TRI11_short(Rinv._11); +#ifdef PRINT_SUMMARY + double chi2_00 = double(res._0) * double(res._0) * double(Rinv._00); + double chi2_01 = double(res._0) * double(res._1) * double(Rinv._01); + double chi2_11 = double(res._1) * double(res._1) * double(Rinv._11); + CHECK_AP::checkCalc("dChi2_phi", dChi2_phi, chi2_00 + 2*chi2_01, 0.1, 0.1); + CHECK_AP::checkCalc("dChi2_z" , dChi2_z , chi2_11 , 0.1, 0.1); +#ifdef PRINT + std::cout<<"Delta chi2_phi = "<& x_new, const MatrixC<4>& C_new, const ap_uint<3>& nStubs, KFstate<4>& stateOut, KFselect<4>& selectOut) {} + +void setOutputsD0(const VectorX<5>& x_new, const MatrixC<5>& C_new, const ap_uint<3>& nStubs, KFstate<5>& stateOut, KFselect<5>& selectOut) { + stateOut.d0 = x_new._4; + stateOut.cov_44 = C_new._44; + stateOut.cov_04 = C_new._04; + stateOut.cov_14 = C_new._14; + KFstateN::TD cut_d0 = d0Cut[nStubs]; + KFstateN::TD cut_d0_minus = d0CutMinus[nStubs]; + selectOut.d0Cut = ((x_new._4 >= cut_d0_minus && x_new._4 <= cut_d0) || (cut_d0 == 0)); +} + + // ----- The following code is now done in VHDL at end of KF, so no longer needed in HLS. ----- + // ----- It used to be run at the end of kalmanUpdate(...) ----- + + /* + + typename KFstateN::TP phiAtRefR = x_new._1 - chosenRofPhi * x_new._0; + KFstubN::TZ zAtRefR = x_new._3 + chosenRofZ * x_new._2; // Intentional use of KFstubN::TZ type + + // Constants BMH & BCH below set in KFconstants.h + // Casting from ap_fixed to ap_int rounds to zero, not -ve infinity, so cast to ap_fixed with no fractional part first. + ap_int mBin_fit_tmp = ap_fixed( + ap_fixed(x_new._0) << inv2RToMbin_bitShift + ); + ap_int cBin_fit_tmp = ap_fixed( + ap_fixed(phiAtRefR) >> phiToCbin_bitShift + ); + bool cBinInRange = (cBin_fit_tmp >= minPhiBin && cBin_fit_tmp <= maxPhiBin); + + // Duplicate removal works best in mBin_fit is forced back into HT array if it lies just outside. + KFstateN::TM mBin_fit_tmp_trunc; + if (mBin_fit_tmp < minPtBin) { + mBin_fit_tmp_trunc = minPtBin; + } else if (mBin_fit_tmp > maxPtBin) { + mBin_fit_tmp_trunc = maxPtBin; + } else { + mBin_fit_tmp_trunc = mBin_fit_tmp; + } + KFstateN::TC cBin_fit_tmp_trunc = cBin_fit_tmp; + selectOut.mBin_fit = mBin_fit_tmp_trunc; + selectOut.cBin_fit = cBin_fit_tmp_trunc; + //std::cout<<"MBIN helix "< etaBounds.z_[TMPS] && zAtRefR < etaBounds.z_[TMPS+1]); + + if (stateIn.etaSectZsign == 1) zAtRefR = -zAtRefR; + bool inEtaSector = (zAtRefR > etaBounds.z_[stateIn.etaSectID] && zAtRefR < etaBounds.z_[stateIn.etaSectID+1]); + + selectOut.sectorCut = (cBinInRange && inEtaSector); + selectOut.consistent = (mBin_fit_tmp_trunc == stateIn.mBin_ht && cBin_fit_tmp_trunc == stateIn.cBin_ht); + + //std::cout<<"ZCALC "<& stateIn, KFstate& stateOut, KFselect& selectOut) { + +#pragma HLS PIPELINE II=1 + //#pragma HLS INTERFACE ap_ctrl_hs register port=return + //#pragma HLS INTERFACE ap_none port=stub register + //#pragma HLS INTERFACE ap_none port=stateIn register + //#pragma HLS INTERFACE ap_none port=stateOut register + //#pragma HLS INTERFACE ap_none port=selectOut register + +#pragma HLS INTERFACE ap_ctrl_hs port=return +#pragma HLS INTERFACE ap_none port=stub +#pragma HLS INTERFACE ap_none port=stateIn +#pragma HLS INTERFACE ap_none port=stateOut +#pragma HLS INTERFACE ap_none port=selectOut + + kalmanUpdate(stub, stateIn, stateOut, selectOut); +} + +#ifdef CMSSW_GIT_HASH +} + +} +#endif diff --git a/L1Trigger/TrackFindingTMTT/src/HTbase.cc b/L1Trigger/TrackFindingTMTT/src/HTbase.cc new file mode 100644 index 0000000000000..e1e9b31d3cba2 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/HTbase.cc @@ -0,0 +1,252 @@ +#include "L1Trigger/TrackFindingTMTT/interface/HTbase.h" +#include "L1Trigger/TrackFindingTMTT/interface/InputData.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" + +#include "DataFormats/Math/interface/deltaPhi.h" + +#include +#include + +using namespace std; + +namespace TMTT { + +//=== Termination. Causes HT array to search for tracks etc. + +void HTbase::end() { + + // Calculate useful info about each cell in array. + for (unsigned int i = 0; i < htArray_.size1(); i++) { + for (unsigned int j = 0; j < htArray_.size2(); j++) { + htArray_(i,j).end(); // Calls HTcell::end() + } + } + + // Produce a list of all track candidates found in this array, each containing all the stubs on each one + // and the track helix parameters, plus the associated truth particle (if any). + trackCands2D_ = this->calcTrackCands2D(); + + // Run algorithm to kill duplicate tracks (e.g. those sharing many hits in common). + trackCands2D_ = killDupTrks_.filter( trackCands2D_ ); + + // If requested, kill those tracks in this sector that can't be read out during the time-multiplexed period, because + // the HT has associated too many stubs to tracks. + if (settings_->busySectorKill()) { + trackCands2D_ = this->killTracksBusySec( trackCands2D_ ); + } +} + +//=== Number of filtered stubs in each cell summed over all cells in HT array. +//=== If a stub appears in multiple cells, it will be counted multiple times. +unsigned int HTbase::numStubsInc() const { + + unsigned int nStubs = 0; + + // Loop over cells in HT array. + for (unsigned int i = 0; i < htArray_.size1(); i++) { + for (unsigned int j = 0; j < htArray_.size2(); j++) { + nStubs += htArray_(i,j).numStubs(); // Calls HTcell::numStubs() + } + } + + return nStubs; +} + +//=== Number of filtered stubs in HT array. +//=== If a stub appears in multiple cells, it will be counted only once. +unsigned int HTbase::numStubsExc() const { + + unordered_set stubIDs; // Each ID stored only once, no matter how often it is added. + + // Loop over cells in HT array. + for (unsigned int i = 0; i < htArray_.size1(); i++) { + for (unsigned int j = 0; j < htArray_.size2(); j++) { + // Loop over stubs in each cells, storing their IDs. + const vector& vStubs = htArray_(i,j).stubs(); // Calls HTcell::stubs() + for (const Stub* stub : vStubs) { + stubIDs.insert( stub->index() ); + } + } + } + + return stubIDs.size(); +} + +//=== Get number of filtered stubs assigned to track candidates found in this HT array. + +unsigned int HTbase::numStubsOnTrackCands2D() const { + + unsigned int nStubs = 0; + + // Loop over track candidates + for (const L1track2D& trk : trackCands2D_) { + nStubs += trk.getStubs().size(); + } + + return nStubs; +} + +//=== Get all reconstructed tracks that were associated to the given tracking particle. +//=== (If the vector is empty, then the tracking particle was not reconstructed in this sector). + +vector HTbase::assocTrackCands2D(const TP& tp) const { + + vector assocRecoTrk; + + // Loop over track candidates, looking for those associated to given TP. + for (const L1track2D& trk : trackCands2D_) { + if (trk.getMatchedTP() != nullptr) { + if (trk.getMatchedTP()->index() == tp.index()) assocRecoTrk.push_back(&trk); + } + } + + return assocRecoTrk; +} + +//=== Function to replace the collection of 2D tracks found by this HT. +//=== (This is used by class MuxHToutputs to kill tracks that can't be output in the time-multiplexed period). + +void HTbase::replaceTrackCands2D(const vector& newTracks) { + vector tmpTracks; + for (const L1track2D* trk : newTracks) { + tmpTracks.push_back(*trk); + } + trackCands2D_.clear(); + trackCands2D_ = tmpTracks; +} + +//=== Disable filters (used for debugging). + +void HTbase::disableBendFilter() { + // Loop over cells in HT array. + for (unsigned int i = 0; i < htArray_.size1(); i++) { + for (unsigned int j = 0; j < htArray_.size2(); j++) { + htArray_(i,j).disableBendFilter(); + } + } +} + +//=== Given a range in one of the coordinates specified by coordRange, calculate the corresponding range of bins. The other arguments specify the axis. And also if some cells nominally associated to stub are to be killed. + +pair HTbase::convertCoordRangeToBinRange( pair coordRange, unsigned int nBinsAxis, float coordAxisMin, float coordAxisBinSize, unsigned int killSomeHTcells, bool debug) const { + + float coordMin = coordRange.first; + float coordMax = coordRange.second; + float coordAvg = ( coordRange.first + coordRange.second ) / 2.; + + int iCoordBinMin, iCoordBinMax; + + //--- There are various options for doing this. + //--- Option killSomeHTcells = 0 is the obvious one. + //--- If killSomeHTcells > 0, then some of the cells nominally associated with the stub are killed. + + if (killSomeHTcells == 0) { + // Take the full range of phi bins consistent with the stub. + iCoordBinMin = floor( ( coordMin - coordAxisMin ) / coordAxisBinSize ); + iCoordBinMax = floor( ( coordMax - coordAxisMin ) / coordAxisBinSize ); + } else if (killSomeHTcells == 1) { + // Use the reduced range of bins. + // This algorithm, proposed by Ian, should reduce the rate, at the cost of some efficiency. + const float fracCut = 0.3; + iCoordBinMin = floor( ( coordMin - coordAxisMin ) / coordAxisBinSize ); + iCoordBinMax = floor( ( coordMax - coordAxisMin ) / coordAxisBinSize ); + unsigned int nbins = iCoordBinMax - iCoordBinMin + 1; + if (nbins >= 2) { // Can't reduce range if already only 1 bin + float lower = coordAxisMin + (iCoordBinMin + 1) * coordAxisBinSize; // upper edge of lowest bin + float upper = coordAxisMin + (iCoordBinMax ) * coordAxisBinSize; // lower edge of highest bin. + // Calculate fractional amount of min and max bin that this stub uses. + float extraLow = (lower - coordMin) / coordAxisBinSize; + float extraUp = (coordMax - upper) / coordAxisBinSize; + if (min(extraLow,extraUp) < -0.001 || max(extraLow, extraUp) > 1.001) cout<<"THIS SHOULD NOT HAPPEN "<= 3 || extraLow < extraUp)) iCoordBinMin += 1; + if (extraUp < fracCut && (nbins >= 3 || extraUp < extraLow)) iCoordBinMax -= 1; + } + } else if ( killSomeHTcells == 2 ) { + // This corresponds to Thomas's firmware implementation, which can't fill more than one HT cell per column. + iCoordBinMin = floor( ( coordAvg - coordAxisMin ) / coordAxisBinSize ); + iCoordBinMax = iCoordBinMin; + } else { + throw cms::Exception("HT: invalid HoughUseFullRange option in cfg"); + } + + if (debug) cout<<"Initial Coord range: "< max. + if (iCoordBinMin > int(nBinsAxis) - 1 || iCoordBinMax < 0) { + iCoordBinMin = int(nBinsAxis) - 1; + iCoordBinMax = 0; + } + + return pair(iCoordBinMin, iCoordBinMax); +} + +//=== Return a list of all track candidates found in this array, giving access to all the stubs on each one +//=== and the track helix parameters, plus the associated truth particle (if any). + +vector HTbase::calcTrackCands2D() const { + + vector trackCands2D; + + if (settings_->debug() == 3) cout<<"Printing track candidates in an HT array"< iOrder = this->rowOrder(numRows); + bool wantOrdering = (iOrder.size() > 0); + + unsigned int numStubsLeft = 0; + unsigned int numStubsRight = 0; + + // Loop over cells in HT array. + for (unsigned int i = 0; i < numRows; i++) { + + // Access rows in specific order if required. + unsigned int iPos = wantOrdering ? iOrder[i] : i; + + for (unsigned int j = 0; j < numCols; j++) { + if (htArray_(iPos,j).trackCandFound()) { // track candidate found in this cell. + + // Note if this corresponds to a merged HT cell (e.g. 2x2). + const bool merged = htArray_(iPos,j).mergedCell(); + + // Get stubs on this track candidate. + const vector& stubs = htArray_(iPos,j).stubs(); + + // And note location of cell inside HT array. + const pair cellLocation(iPos, j); + + // Get (q/Pt, phi0) or (tan_lambda, z0) corresponding to middle of this cell. + const pair helixParams2D = this->helix2Dconventional(iPos, j); + + // Store all this reconstruction info about this track. + // The L1track2D class automatically finds the associated MC truth Tracking Particle particle (if any) + L1track2D l1Trk2D(settings_, stubs, cellLocation, helixParams2D, iPhiSec_, iEtaReg_, optoLinkID_, merged); + + // Store all this info about the track. + trackCands2D.push_back( l1Trk2D ); + + } else { + if (settings_->debug() == 3) cout<<" ."; // Indicate no track in this cell. + } + } + if (settings_->debug() == 3) cout< +#include "L1Trigger/TrackFindingTMTT/interface/TP.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" + +namespace TMTT { + +//=== Initialization with cfg params, +//=== rapidity range of current sector, and estimated q/Pt of cell, +//=== and the bin number of the cell along the q/Pt axis of the r-phi HT array, +//=== and a flag indicating if this cell is the merge of smaller HT cells. + + +void HTcell::init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, + float etaMinSector, float etaMaxSector, float qOverPt, unsigned int ibin_qOverPt, + bool mergedCell, bool miniHTcell) +{ + settings_ = settings; + + // Sector number + iPhiSec_ = iPhiSec; + iEtaReg_ = iEtaReg; + + // Note track q/Pt. + // In this case of an r-phi HT, each cell corresponds to a unique q/Pt. + // In the case of an r-z HT, it is assumed that we know q/Pt from previously run r-phi HT. + qOverPtCell_ = qOverPt; + // Note bin number of cell along q/Pt axis of r-phi HT array. (Not used if r-z HT). + ibin_qOverPt_ = ibin_qOverPt; + mergedCell_ = mergedCell; + // Is cell in Mini-HT? + miniHTcell_ = miniHTcell; + // Rapidity range of sector. + etaMinSector_ = etaMinSector; + etaMaxSector_ = etaMaxSector; + + invPtToDphi_ = settings->invPtToDphi(); // B*c/2E11 + + // Use filter in each HT cell using only stubs which have consistent bend? + useBendFilter_ = settings->useBendFilter(); + + // A filter is used each HT cell, which prevents more than the specified number of stubs being stored in the cell. (Reflecting memory limit of hardware). + if (miniHTcell_) { + maxStubsInCell_ = settings->maxStubsInCellMiniHough(); + } else { + maxStubsInCell_ = settings->maxStubsInCell(); + } + + // Check if subsectors are being used within each sector. These are only ever used for r-phi HT. + numSubSecs_ = settings->numSubSecsEta(); +} + +//=== Termination. Search for track in this HT cell etc. + +void HTcell::end(){ + // Produce list of filtered stubs by applying all requested filters (e.g. on stub bend). + // (If no filters are requested, then filtered & unfiltered stub collections will be identical). + + // N.B. Other filters, such as the r-z filters, which the firmware runs after the HT because they are too slow within it, + // are not defined here, but instead inside class TrkFilterAfterRphiHT. + + + vFilteredStubs_ = vStubs_; + if (useBendFilter_) vFilteredStubs_ = this->bendFilter(vFilteredStubs_); + + // Prevent too many stubs being stored in a single HT cell if requested (to reflect hardware memory limits). + // N.B. This MUST be the last filter applied. + if (maxStubsInCell_ <= 99) vFilteredStubs_ = this->maxStubCountFilter(vFilteredStubs_); + + // Calculate the number of layers the filtered stubs in this cell are in. + numFilteredLayersInCell_ = this->calcNumFilteredLayers(); + + if (numSubSecs_ > 1) { + // If using subsectors within each sector, calculate the number of layers the filters stubs in this cell are in, + // when one considers only the subset of the stubs within each subsector. + // Look for the "best" subsector. + numFilteredLayersInCellBestSubSec_ = 0; + for (unsigned int i = 0; i < numSubSecs_; i++) { + unsigned int numLaySubSec = this->calcNumFilteredLayers(i); + numFilteredLayersInCellBestSubSec_ = max(numFilteredLayersInCellBestSubSec_, numLaySubSec); + } + } else { + // If only 1 sub-sector, then subsector and sector are identical. + numFilteredLayersInCellBestSubSec_ = numFilteredLayersInCell_; + } +} + +// Calculate how many tracker layers the filter stubs in this cell are in, when only the subset of those stubs +// that are in the specified subsector are counted. + +unsigned int HTcell::calcNumFilteredLayers(unsigned int iSubSec) const { + vector stubsInSubSec; + for (const Stub* s : vFilteredStubs_) { + const vector& inSubSec = subSectors_.at(s); // Find out which subsectors this stub is in. + if (inSubSec[iSubSec]) stubsInSubSec.push_back(s); + } + return Utility::countLayers( settings_, stubsInSubSec ); +} + + +//=== Produce a filtered collection of stubs in this cell that all have consistent bend. +//=== Only called for r-phi Hough transform. + +vector HTcell::bendFilter( const vector& stubs ) const { + + // Create bend-filtered stub collection. + vector filteredStubs; + for (const Stub* s : stubs) { + + // Require stub bend to be consistent with q/Pt of this cell. + + unsigned int minBin = s->min_qOverPt_bin(); + unsigned int maxBin = s->max_qOverPt_bin(); + if ( mergedCell_ ) { + if ( minBin % 2 == 1 ) minBin--; + // Next line not wanted with current m-bin range definition in Stub::calcQoverPtRange(). + //if ( maxBin % 2 == 1 ) maxBin++; + } + if (minBin <= ibin_qOverPt_ && ibin_qOverPt_ <= maxBin ) filteredStubs.push_back(s); + } + + return filteredStubs; +} + +//=== Filter stubs so as to prevent more than specified number of stubs being stored in one cell. +//=== This reflects finite memory of hardware. + +vector HTcell::maxStubCountFilter( const vector& stubs ) const { + vector filteredStubs; + // If there are too many stubs in a cell, the hardware keeps (maxStubsInCell - 1) of the first stubs in the list + // plus the last stub. + if (stubs.size() > maxStubsInCell_) { + for (unsigned int i = 0; i < maxStubsInCell_ - 1; i++) { // first stubs + filteredStubs.push_back(stubs[i]); + } + filteredStubs.push_back(stubs[ stubs.size() - 1] ); // plus last stub + } else { + filteredStubs = stubs; + } + return filteredStubs; +} + +} diff --git a/L1Trigger/TrackFindingTMTT/src/HTrphi.cc b/L1Trigger/TrackFindingTMTT/src/HTrphi.cc new file mode 100644 index 0000000000000..29c495b78e181 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/HTrphi.cc @@ -0,0 +1,703 @@ +#include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h" +#include "L1Trigger/TrackFindingTMTT/interface/InputData.h" +#include "L1Trigger/TrackFindingTMTT/interface/TP.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" + +#include "DataFormats/Math/interface/deltaPhi.h" +#include "FWCore/Utilities/interface/Exception.h" + +#include +#include + +namespace TMTT { + +//=== The r-phi Hough Transform array for a single (eta,phi) sector. +//=== +//=== Its axes are (q/Pt, phiTrk), where phiTrk is the phi at which the track crosses a +//=== user-configurable radius from the beam-line. + +using namespace std; + +// Maximum |gradient| of line corresponding to any stub. Should be less than the value of 1.0 assumed by the firmware. +float HTrphi::maxLineGradient_ = 0.; +// Error count when stub added to cell which does not lie NE, E or SE of stub added to previous HT column. +unsigned int HTrphi::numErrorsTypeA_ = 0; +// Error count when stub added to more than 2 cells in one HT column (problem only for Thomas' firmware). +unsigned int HTrphi::numErrorsTypeB_ = 0; +// Error count normalisation +unsigned int HTrphi::numErrorsNormalisation_ = 0; + +//=== Initialise + +void HTrphi::init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, + float etaMinSector, float etaMaxSector, float phiCentreSector) { + + HTbase::init(settings, iPhiSec, iEtaReg); + + invPtToDphi_ = settings->invPtToDphi(); + shape_ = settings->shape(); + + int nCellsHT = settings->houghNcellsRphi(); // Total number of required cells in HT array (if > 0) + + //--- Specification of HT q/Pt axis. + + maxAbsQoverPtAxis_ = 1./settings->houghMinPt(); // Max. |q/Pt| covered by HT array. + nBinsQoverPtAxis_ = settings->houghNbinsPt(); // No. of bins in HT array in q/Pt. + if (nCellsHT > 0) nBinsQoverPtAxis_ = 1; // Will calculate number of bins automatically. Initialize it to non-zero value. + binSizeQoverPtAxis_ = 2*maxAbsQoverPtAxis_ / nBinsQoverPtAxis_; + if ( shape_ == 2 || shape_ == 1 || settings_->shape() == 3 ) + binSizeQoverPtAxis_ = 2. * maxAbsQoverPtAxis_ / ( nBinsQoverPtAxis_ - 1. ); + + //--- Specification of HT phiTrk axis + + // N.B. phiTrk corresponds to phi where track crosses radius = chosenRofPhi_. + chosenRofPhi_ = settings->chosenRofPhi(); + phiCentreSector_ = phiCentreSector; // Centre of phiTrk sector. + maxAbsPhiTrkAxis_ = M_PI / float(settings->numPhiSectors()); // Half-width of phiTrk axis in HT array. + nBinsPhiTrkAxis_ = settings->houghNbinsPhi(); // No. of bins in HT array phiTrk + if (nCellsHT > 0) nBinsPhiTrkAxis_ = 1; // Will calculate number of bins automatically. Initialize it to non-zero value. + binSizePhiTrkAxis_ = 2*maxAbsPhiTrkAxis_ / nBinsPhiTrkAxis_; + if ( shape_ == 2 ) + binSizePhiTrkAxis_ = 2. * maxAbsPhiTrkAxis_ / ( nBinsPhiTrkAxis_ - 1. / 6. ); + else if ( shape_ == 1 ) + binSizePhiTrkAxis_ = 2. * maxAbsPhiTrkAxis_ / ( nBinsPhiTrkAxis_ - 1. / 2. ); + + // Did user specify number of cells required in HT array? If so, determine number of bins along + // array axes such that their product equals required number of cells, and that their ratio gives + // a maximum line |gradient| of stubs crossing the array of 1.0. + if (nCellsHT > 0) { + // Get line gradient with current array axes. + float currentLineGrad = this->calcMaxLineGradArray(); + // Calculate new number of bins on each axis to meet constraint. + float fact = nBinsQoverPtAxis_ * currentLineGrad / nBinsPhiTrkAxis_; + nBinsQoverPtAxis_ = ceil( sqrt(nCellsHT * fact) ); + nBinsPhiTrkAxis_ = int ( sqrt(nCellsHT / fact) ); + // And recalculate bin size accordingly. + binSizeQoverPtAxis_ = 2*maxAbsQoverPtAxis_ / nBinsQoverPtAxis_; + binSizePhiTrkAxis_ = 2*maxAbsPhiTrkAxis_ / nBinsPhiTrkAxis_; + } + + // Note max. |gradient| that the line corresponding to any stub in any of the r-phi HT arrays could have. + // Firmware assumes this should not exceed 1.0; + HTrphi::maxLineGradient_ = max( HTrphi::maxLineGradient_, this->calcMaxLineGradArray()); + + // Optionally merge 2x2 neighbouring cells into a single cell at low Pt, to reduce efficiency loss due to + // scattering. (Do this if either of options EnableMerge2x2 or MiniHTstage are enabled. + // N.B These two options are never both enabled). + enableMerge2x2_ = (settings->enableMerge2x2() || settings->miniHTstage()); + if (settings->miniHTstage()) { + // Mini-HT stage cfg: Merge all bins, irrespective of Pt. + minInvPtToMerge2x2_ = 0.; + } else { + // Merged cells cfg: Merge bins below specified Pt threshold. + minInvPtToMerge2x2_ = 1./(settings->maxPtToMerge2x2()); + if (minInvPtToMerge2x2_ > maxAbsQoverPtAxis_) enableMerge2x2_ = false; + } + + // Merging 2x2 cells into 1 merged cell is only allowed if HT array dimensions are even. + // (This restriction could be removed along q/Pt axis, since there are also unmerged cells there. But this + // would require correcting the code after each called to mergedCell() below, since + // "if (i%2 == 1) iStore = i - 1" not correct in this case). + if (enableMerge2x2_ && (nBinsQoverPtAxis_%2 != 0 || nBinsPhiTrkAxis_%2 != 0)) throw cms::Exception("HTrphi: You are not allowed to set EnableMerge2x2 or MiniHTstage = True if you have an odd number of bins in r-phi HT array ")<killSomeHTCellsRphi(); + // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when fill stubs in r-phi HT? + handleStripsRphiHT_ = settings->handleStripsRphiHT(); + + // Used to kill excess stubs or tracks that can't be transmitted within time-multiplexed period. + nReceivedStubs_ = 0; + busyInputSectorKill_ = settings_->busyInputSectorKill(); // Kill excess stubs going fron GP to HT? + busyInputSectorNumStubs_ = settings_->busyInputSectorNumStubs(); // Max. num. of stubs that can be sent from GP to HT within TM period + busySectorKill_ = settings_->busySectorKill(); // Kill excess tracks flowing out of HT? + busySectorNumStubs_ = settings_->busySectorNumStubs(); // Max. num. of stubs that can be sent out of HT within TM period + busySectorMbinRanges_ = settings_->busySectorMbinRanges(); // or individual m bin (=q/Pt) ranges to be output to optical links. + busySectorUseMbinRanges_ = ( ! busySectorMbinRanges_.empty() ); // m bin ranges option disabled if vector empty. + busySectorMbinOrder_ = settings_->busySectorMbinOrder(); // Specifies which m bins should be grouped together by BusySectorMbinRanges. If empty, then they are grouped in order 0,1,2,3,4,5 ... + busySectorUseMbinOrder_ = ( ! busySectorMbinOrder_.empty() ); + + bool rescaleMbins = false; + if (busySectorUseMbinRanges_) { + // Check if the total number of bins specified in cfg option BusySectorMbinRanges corresponds + // to the number of m bins (q/Pt) in the HT. If not, determine how much the ranges must be scaled + // to make this true. + unsigned int nTotalBins = 0; + for (unsigned int j = 0; j < busySectorMbinRanges_.size(); j++) { + nTotalBins += busySectorMbinRanges_[j]; + } + rescaleMbins = (nTotalBins != nBinsQoverPtAxis_); + // No rescaling allowed with MBinOrder option. + if (rescaleMbins && busySectorUseMbinOrder_) throw cms::Exception("HTrphi: BusySectorUserMbin error"); + float rescaleFactor = rescaleMbins ? float(nBinsQoverPtAxis_)/float(nTotalBins) : 1. ; + // Find lower and upper inclusive limits of each m bin range to be sent to a separate optical link. + busySectorMbinLow_.resize( busySectorMbinRanges_.size() ); + busySectorMbinHigh_.resize( busySectorMbinRanges_.size() ); + float mBinSum = 0.; + for (unsigned int i = 0; i < busySectorMbinRanges_.size(); i++) { + busySectorMbinLow_[i] = std::round(mBinSum); + busySectorMbinHigh_[i] = std::round(mBinSum + rescaleFactor * busySectorMbinRanges_[i]) - 1; + mBinSum += rescaleFactor * busySectorMbinRanges_[i]; + } + } + + //--- Options for duplicate track removal after running HT. + unsigned int dupTrkAlgRphi = settings->dupTrkAlgRphi(); + HTbase::killDupTrks_.init(settings, dupTrkAlgRphi); + + // Resize HT array to suit these specifications, and initialise each cell with configuration parameters. + HTbase::htArray_.resize(nBinsQoverPtAxis_, nBinsPhiTrkAxis_, false); + // + for (unsigned int i = 0; i < nBinsQoverPtAxis_; i++) { + for (unsigned int j = 0; j < nBinsPhiTrkAxis_; j++) { + pair helix = this->helix2Dconventional(i, j); // Get track params at centre of cell. + float qOverPt = helix.first; + // Check if this cell is merged with its neighbours (as in low Pt region). + bool mergedCell = false; + if (enableMerge2x2_ && this->mergedCell(i, j)) mergedCell = true; + HTbase::htArray_(i,j).init( settings, iPhiSec, iEtaReg, + etaMinSector, etaMaxSector, qOverPt, i, mergedCell); // Calls HTcell::init() + } + } + + static bool first = true; + if (first) { + first = false; + cout<<"=== R-PHI HOUGH TRANSFORM AXES RANGES: abs(q/Pt) < "< > binCenters; + for ( unsigned int c = 0; c < nBinsPhiTrkAxis_; c++ ) + binCenters.push_back( this->helix2Dhough( m, c ) ); + cellCenters_.push_back( binCenters ); + } + +} + +//=== Add stub to HT array. +//=== If eta subsectors are being used within each sector, specify which ones the stub is compatible with. + +void HTrphi::store(const Stub* stub, const vector& inEtaSubSecs) { + + // Optionally, only store stubs that can be sent from GP to HT within TM period. + if ( ( ! busyInputSectorKill_) || (nReceivedStubs_ < busyInputSectorNumStubs_) ) { + + nReceivedStubs_++; + + // Loop over q/Pt related bins in HT array. + for (unsigned int i = 0; i < nBinsQoverPtAxis_; i++) { + + if ( shape_ == 0) { + + //--- This is a traditional HT with square cells. + + // In this q/Pt bin, find the range of phi bins that this stub is consistent with. + pair iRange = this->iPhiRange( stub, i); + unsigned int iPhiTrkBinMin = iRange.first; + unsigned int iPhiTrkBinMax = iRange.second; + + // Store stubs in these cells. + for (unsigned int j = iPhiTrkBinMin; j <= iPhiTrkBinMax; j++) { + + bool canStoreStub = true; + unsigned int iStore = i; + unsigned int jStore = j; + + // Optionally merge 2x2 neighbouring cells into a single cell at low Pt, to reduce efficiency loss + // due to scattering. + if (enableMerge2x2_) { + // Check if this cell is merged with its neighbours (as in low Pt region). + if (this->mergedCell(i, j)) { + // Get location of cell that this cell is merged into (iStore, jStore). + // Calculation assumes HT array has even number of bins in both dimensions. + if (i%2 == 1) iStore = i - 1; + if (j%2 == 1) jStore = j - 1; + // If this stub was already stored in this merged 2x2 cell, then don't store it again. + if (HTbase::htArray_(iStore, jStore).stubStoredInCell( stub )) canStoreStub = false; + } + } + + if (canStoreStub) HTbase::htArray_(iStore, jStore).store( stub, inEtaSubSecs ); // Calls HTcell::store() + } + + // Check that limitations of firmware would not prevent stub being stored correctly in this HT column. + this->countFirmwareErrors(i, iPhiTrkBinMin, iPhiTrkBinMax); + + } else { + + //--- This is are novel HT with unusual shaped cells. + + if ( shape_ == 1 ) { + + //--- This HT has diamond shaped cells. + + float qOverPtBin = -maxAbsQoverPtAxis_ + i * binSizeQoverPtAxis_; + float phiTrk = reco::deltaPhi( stub->phi(), phiCentreSector_ ) + invPtToDphi_ * qOverPtBin * ( stub->r() - chosenRofPhi_ ) + maxAbsPhiTrkAxis_; + if ( i % 2 == 0 ) + phiTrk += binSizePhiTrkAxis_ / 2.; + unsigned int binCenter = std::floor( phiTrk / binSizePhiTrkAxis_ ); + if ( binCenter < nBinsPhiTrkAxis_ ) + HTbase::htArray_(i, binCenter).store( stub, inEtaSubSecs ); + + } else if ( shape_ == 2 ) { + + //--- This HT has hexagonal cells (with two of its sides parallel to the phi axis). + + float qOverPtBin = -maxAbsQoverPtAxis_ + i * binSizeQoverPtAxis_; + float qOverPtBinVar = binSizeQoverPtAxis_; + float phiTrk = reco::deltaPhi( stub->phi(), phiCentreSector_ ) + invPtToDphi_ * qOverPtBin * ( stub->r() - chosenRofPhi_ ) + maxAbsPhiTrkAxis_; + float phiTrkVar = invPtToDphi_ * qOverPtBinVar * std::fabs( stub->r() - chosenRofPhi_ ); + float phiTrkMin = phiTrk - phiTrkVar; + float phiTrkMax = phiTrk + phiTrkVar; + if ( i % 2 == 0 ) + phiTrk += binSizePhiTrkAxis_ / 6.; + else { + phiTrk -= binSizePhiTrkAxis_ / 3.; + phiTrkMin -= binSizePhiTrkAxis_ / 2.; + phiTrkMax -= binSizePhiTrkAxis_ / 2.; + } + unsigned int iCenter = std::floor( phiTrk / binSizePhiTrkAxis_ * 3. ); + unsigned int iMin = std::floor( phiTrkMin / binSizePhiTrkAxis_ * 3. ); + unsigned int iMax = std::floor( phiTrkMax / binSizePhiTrkAxis_ * 3. ); + std::pair< bool, unsigned int > binCenter; + std::pair< bool, unsigned int > binMin; + std::pair< bool, unsigned int > binMax; + binCenter.second = iCenter / 3; + binMin.second = iMin / 3; + binMax.second = iMax / 3; + binCenter.first = !( iCenter % 3 == 2 ); + binMin.first = ( iMin % 3 == 0 ); + binMax.first = ( iMax % 3 == 0 ); + if ( binCenter.first && binCenter.second < nBinsPhiTrkAxis_ ) + HTbase::htArray_(i, binCenter.second).store( stub, inEtaSubSecs ); + else if ( binMin.first && binMin.second < nBinsPhiTrkAxis_ ) + HTbase::htArray_(i, binMin.second).store( stub, inEtaSubSecs ); + else if ( binMax.first && binMax.second < nBinsPhiTrkAxis_ ) + HTbase::htArray_(i, binMax.second).store( stub, inEtaSubSecs ); + + } else if ( shape_ == 3 ) { + + //--- This HT has square cells with alternate rows shifted horizontally by 0.5*cell_width. + + float qOverPtBin = -maxAbsQoverPtAxis_ + i * binSizeQoverPtAxis_; + float qOverPtBinVar = binSizeQoverPtAxis_; + float phiTrk = reco::deltaPhi( stub->phi(), phiCentreSector_ ) + invPtToDphi_ * qOverPtBin * ( stub->r() - chosenRofPhi_ ) + maxAbsPhiTrkAxis_; + float phiTrkVar = invPtToDphi_ * qOverPtBinVar * std::fabs( stub->r() - chosenRofPhi_ ); + float phiTrkMin = phiTrk - phiTrkVar; + float phiTrkMax = phiTrk + phiTrkVar; + unsigned int iMin = std::floor( phiTrkMin / binSizePhiTrkAxis_ * 2. ); + unsigned int iMax = std::floor( phiTrkMax / binSizePhiTrkAxis_ * 2. ); + std::pair< bool, unsigned int > binMin; + std::pair< bool, unsigned int > binMax; + binMin.second = iMin / 2; + binMax.second = iMax / 2; + binMin.first = ( iMin % 2 == i % 2 ); + binMax.first = ( iMax % 2 == i % 2 ); + if ( binMin.first && binMin.second < nBinsPhiTrkAxis_ ) + HTbase::htArray_(i, binMin.second).store( stub, inEtaSubSecs ); + else if ( binMax.first && binMax.second < nBinsPhiTrkAxis_ ) + HTbase::htArray_(i, binMax.second).store( stub, inEtaSubSecs ); + } + } + } + } +} + +//=== Determine the m-bin (q/pt) range the specified track is in. (Used if outputting each m bin range on a different opto-link). + +unsigned int HTrphi::getMbinRange(const L1track2D& trk) const { + if (busySectorUseMbinRanges_) { + unsigned int mBin = trk.getCellLocationHT().first; + unsigned int mBinOrder; + if (busySectorUseMbinOrder_) { + // User wants to group bins in a wierd order. + mBinOrder = 99999; + for (unsigned int k = 0; k < busySectorMbinOrder_.size(); k++) { + if (mBin == busySectorMbinOrder_[k]) mBinOrder = k; + } + if (mBinOrder == 99999) throw cms::Exception("HTrphi::getMbinRange() mBinOrder calculation wrong."); + } else { + // User grouping bins in numerical order 0,1,2,3,4,5... + mBinOrder = mBin; + } + for (unsigned int i = 0; i < busySectorMbinRanges_.size(); i++) { + if (mBinOrder >= busySectorMbinLow_[i] && mBinOrder <= busySectorMbinHigh_[i]) return i; + } + throw cms::Exception("HTrphi::getMbinRange() messed up"); + } else { + return 0; + } +} + +//=== For a given Q/Pt bin, find the range of phi bins that a given stub is consistent with. +//=== Return as a pair (min bin, max bin) +//=== If it range lies outside the HT array, then the min bin will be set larger than the max bin. + +pair HTrphi::iPhiRange( const Stub* stub, unsigned int iQoverPtBin, bool debug) const { + + // Note q/Pt value corresponding to centre of this bin. + float qOverPtBin = -maxAbsQoverPtAxis_ + (iQoverPtBin + 0.5) * binSizeQoverPtAxis_; + // Note change in this q/Pt value needed to reach either edge of the bin. + float qOverPtBinVar = 0.5*binSizeQoverPtAxis_; + + // Reducing effective bin width can reduce fake rate. + //qOverPtVar = 0.4*binSizeQoverPtAxis_; + + // Calculate range of track-phi that would allow a track in this q/Pt range to pass through the stub. + float phiTrk = stub->phi() + invPtToDphi_ * qOverPtBin * (stub->r() - chosenRofPhi_); + // The next line does the phiTrk calculation without the usual approximation, but it doesn't + // improve performance. + //float phiTrk = stub->phi() + asin(invPtToDphi_ * qOverPtBin * stub->r()) - asin(invPtToDphi_ * qOverPtBin * chosenRofPhi_); + float phiTrkVar = invPtToDphi_ * qOverPtBinVar * fabs(stub->r() - chosenRofPhi_); + float phiTrkMin = phiTrk - phiTrkVar; + float phiTrkMax = phiTrk + phiTrkVar; + + // Allow for uncertainty due to strip length if requested. + if (handleStripsRphiHT_) { + // Estimate uncertainty due to strip length, using first order derivative of phiTrk w.r.t. stub coords. + // Note that barrel modules only care about zErr and endcap ones about rErr. + float phiTrkVarStub; + if (stub->barrel()) { + phiTrkVarStub = 0.; + } else { + phiTrkVarStub = invPtToDphi_ * fabs(qOverPtBin) * stub->rErr(); + } + phiTrkMin -= phiTrkVarStub; + phiTrkMax += phiTrkVarStub; + } + + // Allow for multiple scattering/resolution + // phiTrkMin -= 0.005; + // phiTrkMax += 0.005; + + float deltaPhiMin = reco::deltaPhi(phiTrkMin, phiCentreSector_); // Offset to centre of sector. + float deltaPhiMax = reco::deltaPhi(phiTrkMax, phiCentreSector_); + pair phiTrkRange( deltaPhiMin, deltaPhiMax ); + + // Determine which HT array cell range in track-phi this range "phiTrkRange" corresponds to. + pair iPhiTrkBinRange = this->HTbase::convertCoordRangeToBinRange(phiTrkRange, nBinsPhiTrkAxis_, (-maxAbsPhiTrkAxis_), binSizePhiTrkAxis_, killSomeHTCellsRphi_); + + return iPhiTrkBinRange; +} + +//=== Check that limitations of firmware would not prevent stub being stored correctly in this HT column. + +void HTrphi::countFirmwareErrors(unsigned int iQoverPtBin, unsigned int iPhiTrkBinMin, unsigned int iPhiTrkBinMax) { + static unsigned int iPhiTrkBinMinLast = 0; + static unsigned int iPhiTrkBinMaxLast = 99999; + // Reinitialize if this is left-most column in HT array. + if (iQoverPtBin == 0) { + iPhiTrkBinMinLast = 0; + iPhiTrkBinMaxLast = 99999; + } + + // Only do check if stub is being stored somewhere in this HT column. + if (iPhiTrkBinMax >= iPhiTrkBinMin) { + //--- Remaining code below checks that firmware could successfully store this stub in this column. + // (a) Does cell lie NE, E or SE of cell filled in previous column? + bool OK_a = (iPhiTrkBinMin + 1 >= iPhiTrkBinMinLast) && (iPhiTrkBinMax <= iPhiTrkBinMaxLast + 1); + // (b) Are no more than 2 cells filled in this column (problem only for Thomas' firmware) + bool OK_b = (iPhiTrkBinMax - iPhiTrkBinMin + 1 <= 2); + + if ( ! OK_a ) numErrorsTypeA_++; + if ( ! OK_b ) numErrorsTypeB_++; + numErrorsNormalisation_++; // No. of times a stub is added to an HT column. + + iPhiTrkBinMinLast = iPhiTrkBinMin; + iPhiTrkBinMaxLast = iPhiTrkBinMax; + } +} + +//=== Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). +//=== The helix parameters returned will be those corresponding to the two axes of the HT array. +//=== So they might be (q/pt, phi0) or (q/pt, phi65) etc. depending on the configuration. + +pair HTrphi::helix2Dhough(unsigned int i, unsigned int j) const { + + unsigned int qOverPtBin = i; + unsigned int phiTrkBin = j; + + // If using merged 2x2 cells in low Pt parts of array, must correct for this. + bool merged = false; + if (enableMerge2x2_) { + // Check if this cell is merged with its neighbours (as in low Pt region). + if (this->mergedCell(i, j)) { + merged = true; + // Get location of cell that this cell is merged into (iStore, jStore). + // Calculation assumes HT array has even number of bins in both dimensions. + if (i%2 == 1) qOverPtBin = i - 1; + if (j%2 == 1) phiTrkBin = j - 1; + } + } + + float qOverPtBinCenter = .5; + float phiTrkBinCenter = .5; + + if ( shape_ == 2 || shape_ == 1 || shape_ == 3 ) + qOverPtBinCenter = 0.; + + if ( shape_ == 2 ) + phiTrkBinCenter = ( qOverPtBin % 2 == 0 ) ? 1. / 6. : 2. / 3.; + else if ( shape_ == 1 ) + phiTrkBinCenter = ( qOverPtBin % 2 == 0 ) ? 0. : 1. / 2.; + else if ( shape_ == 3 ) + phiTrkBinCenter = ( qOverPtBin % 2 == 0 ) ? 1. / 4. : 3. / 4.; + + float qOverPt = - maxAbsQoverPtAxis_ + ( qOverPtBin + qOverPtBinCenter ) * binSizeQoverPtAxis_; + float phiTrk = - maxAbsPhiTrkAxis_ + ( phiTrkBin + phiTrkBinCenter ) * binSizePhiTrkAxis_; + + if (merged) { + qOverPt += 0.5*binSizeQoverPtAxis_; + phiTrk += 0.5*binSizePhiTrkAxis_; + } + + phiTrk = reco::deltaPhi(phiTrk + phiCentreSector_, 0.); // Correct phiTrk to centre of sector, taking care of 2*pi wrapping + return pair(qOverPt, phiTrk); +} + +//=== Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). +//=== The helix parameters returned will be always be (q/pt, phi0), irrespective of how the axes +//=== of the HT array are defined. + +pair HTrphi::helix2Dconventional(unsigned int i, unsigned int j) const { + // Get the helix parameters corresponding to the axes definitions of the HT. + pair helix2Dht = this->helix2Dhough(i,j); + // Convert to the conventionally agreed pair of helix parameters, (q/pt, phi0). + float qOverPt = helix2Dht.first; // easy + float phi0 = reco::deltaPhi(helix2Dht.second + invPtToDphi_*chosenRofPhi_*qOverPt, 0.); // If HT defined track phi other than at r=0, must correct to get phi0. Allow for 2*pi wrapping of phi. + return pair(qOverPt, phi0); +} + +//=== Which cell in HT array should this TP be in, based on its true trajectory? +//=== (If TP is outside HT array, it it put in the closest bin inside it). + +pair HTrphi::trueCell( const TP* tp ) const { + + // Get HT axis variables corresponding to this TP. + float qOverPt = tp->qOverPt(); + float phiTrk = tp->trkPhiAtR( chosenRofPhi_ ); + // Measure phi relative to centre of sector. + float deltaPhi = reco::deltaPhi(phiTrk, phiCentreSector_); + // Convert to bin numbers inside HT array. + int iQoverPt = floor( ( qOverPt - ( -maxAbsQoverPtAxis_) ) / binSizeQoverPtAxis_ ); + int iPhiTrk = floor( ( deltaPhi - ( -maxAbsPhiTrkAxis_ ) ) / binSizePhiTrkAxis_ ); + // Check if this cell was within the HT array. + if (iQoverPt >= 0 && iQoverPt < int(nBinsQoverPtAxis_) && iPhiTrk >= 0 && iPhiTrk < int(nBinsPhiTrkAxis_)) { + // Check if this cell is merged with its neighbours (as in low Pt region), and if so return merged cell location. + /* + if (this->mergedCell((unsigned int) iQoverPt, (unsigned int) iPhiTrk)) { + if (iQoverPt%2 == 1) iQoverPt -= 1; + if (iPhiTrk%2 == 1) iPhiTrk -= 1; + } + */ + } else { + // TP is not in this HT array at all. Flag this by setting "outside" bin index to 0 (Nbins) if outside array below (above). + if (iQoverPt < 0) iQoverPt = 0; + if (iQoverPt >= int(nBinsQoverPtAxis_)) iQoverPt = nBinsQoverPtAxis_ - 1; + if (iPhiTrk < 0) iPhiTrk = 0; + if (iPhiTrk >= int(nBinsPhiTrkAxis_)) iPhiTrk = nBinsPhiTrkAxis_ - 1; + } + return pair(iQoverPt, iPhiTrk); +} + +//=== Which cell in HT array should this fitted track be in, based on its fitted trajectory? +//=== Always uses beam-spot constrained trajectory if available. +//=== (If fitted track is outside HT array, it it put in the closest bin inside it). + +pair HTrphi::getCell( const L1fittedTrack* fitTrk) const { + + bool beamConstraint = fitTrk->done_bcon(); // Is beam-spot constraint available? (e.g. 5 param helix fit) + // Get HT axis variables corresponding to this fitted track. + float qOverPt = beamConstraint ? fitTrk->qOverPt_bcon() : fitTrk->qOverPt(); + // Convert phi0 to phi at chosen radius used in HT. + float phiTrk = fitTrk->phiAtChosenR(beamConstraint); + // Measure phi relative to centre of sector. + float deltaPhi = reco::deltaPhi(phiTrk, phiCentreSector_); + // Convert to bin numbers inside HT array. + int iQoverPt = 999999; + int iPhiTrk = 999999; + + if ( shape_ == 0) { + + //--- This is a traditional HT with square cells. + + iQoverPt = floor( ( qOverPt - ( -maxAbsQoverPtAxis_) ) / binSizeQoverPtAxis_ ); + iPhiTrk = floor( ( deltaPhi - ( -maxAbsPhiTrkAxis_ ) ) / binSizePhiTrkAxis_ ); + + + // Check if this cell was within the HT array. + if (iQoverPt >= 0 && iQoverPt < int(nBinsQoverPtAxis_) && iPhiTrk >= 0 && iPhiTrk < int(nBinsPhiTrkAxis_)) { + // Check if this cell is merged with its neighbours (as in low Pt region), and if so return merged cell location. + // New: because 2nd stage mini HT may recreate tracks from merged cells with finer cell granularity, one can't predict + // if a merged cell was used to create a track merely by looking at its cell location. + // So instead ask L1track3D, which knows if it was created from a merged HT cell or not. + + /* + if (fitTrk->getL1track3D().mergedHTcell()) { + if (iQoverPt%2 == 1) iQoverPt -= 1; + if (iPhiTrk%2 == 1) iPhiTrk -= 1; + } + */ + } else { + // Fitted track is not in this HT array at all. Flag this by setting "outside" bin index to 0 (Nbins-1) if outside array below (above). + if (iQoverPt < 0) iQoverPt = 0; + if (iQoverPt >= int(nBinsQoverPtAxis_)) iQoverPt = nBinsQoverPtAxis_ - 1; + if (iPhiTrk < 0) iPhiTrk = 0; + if (iPhiTrk >= int(nBinsPhiTrkAxis_)) iPhiTrk = nBinsPhiTrkAxis_ - 1; + } + + } else { + + //--- This is are novel HT with unusual shaped cells. + + float minD = std::numeric_limits< float >::infinity(); + float d( 0 ); + unsigned int m( 0 ); + for ( auto binCenters : cellCenters_ ) { + unsigned int c( 0 ); + for ( auto cellCenter : binCenters ) { + d = std::pow( ( cellCenter.first - qOverPt ) / (float)binSizeQoverPtAxis_ , 2 ) + std::pow( ( cellCenter.second - phiTrk ) / (float)binSizePhiTrkAxis_ , 2 ); + if ( d < minD ) { + minD = d; + iQoverPt = m; + iPhiTrk = c; + } + c++; + } + m++; + } + // Fitted track is not in this HT array at all. Flag this by setting "outside" bin index to 0 (Nbins-1) if outside array below (above). + if (iQoverPt < 0) iQoverPt = 0; + if (iQoverPt >= int(nBinsQoverPtAxis_)) iQoverPt = nBinsQoverPtAxis_ - 1; + if (iPhiTrk < 0) iPhiTrk = 0; + if (iPhiTrk >= int(nBinsPhiTrkAxis_)) iPhiTrk = nBinsPhiTrkAxis_ - 1; + } + + return pair(iQoverPt, iPhiTrk); +} + +//=== Check if specified cell is merged with its 2x2 neighbours into a single cell, +//=== as it is in low Pt region. + +bool HTrphi::mergedCell(unsigned int iQoverPtBin, unsigned int jPhiTrkBin) const { + + bool merge = false; + + if (enableMerge2x2_) { + unsigned int i = iQoverPtBin; + unsigned int j = jPhiTrkBin; + + // Calculate number of merged bins on each q/Pt side of array. + float fMergeBins = (maxAbsQoverPtAxis_ - minInvPtToMerge2x2_)/(2.*binSizeQoverPtAxis_); + // Number of unmerged bins this corresponds to, which must be even, since each merged bin comprises two normal q/pt bins. + unsigned int numQoverPtBinsToMerge = 2 * min( (unsigned int)(std::round(fMergeBins)), (nBinsQoverPtAxis_/4) ); + // IRT - bug fix + const float small = 0.001; + if (minInvPtToMerge2x2_ < small && (unsigned int)(std::round(2.*fMergeBins))%2 == 1) numQoverPtBinsToMerge++; + unsigned int iB = (nBinsQoverPtAxis_ - 1) - i; // Count backwards across array. + if (min(i, iB) < numQoverPtBinsToMerge) merge = true; + } + + return merge; +} + +//=== Calculate maximum |gradient| that any stub's line across this HT array could have, so can check it doesn't exceed 1. + +float HTrphi::calcMaxLineGradArray() const { + // Get max. |gradient| possible in this HT array. + float gradOuter = fabs(invPtToDphi_ * (settings_->trackerOuterRadius() - chosenRofPhi_)); + float gradInner = fabs(invPtToDphi_ * (settings_->trackerInnerRadius() - chosenRofPhi_)); + float maxGrad = max(gradOuter, gradInner); + // Convert it to units of bin width. + maxGrad *= binSizeQoverPtAxis_ / binSizePhiTrkAxis_; + if ( shape_ == 2 ) + maxGrad *= 3.; + else if ( shape_ == 1 ) + maxGrad *= 2.; + else if ( shape_ == 3 ) + maxGrad *= 4.; + return maxGrad; +} + +//=== If requested, kill those tracks in this sector that can't be read out during the time-multiplexed period, because +//=== the HT has associated too many stubs to tracks. + +vector HTrphi::killTracksBusySec(const vector& tracks) const { + + vector outTracks; + + if (busySectorKill_) { + + unsigned int nStubsOut = 0; // #stubs assigned to tracks in this sector. + vector nStubsOutInRange(busySectorMbinRanges_.size(), 0); // #stubs assigned to each m bin range in this sector. + + for (const L1track2D& trk : tracks) { + bool keep = true; + unsigned int nStubs = trk.getNumStubs(); // #stubs on this track. + if (busySectorUseMbinRanges_) { // Are tracks from different m bin ranges output seperately to increase bandwidth? + unsigned int mBinRange = this->getMbinRange(trk); // Which m bin range is this track in? + nStubsOutInRange[ mBinRange ] += nStubs; + if (nStubsOutInRange[ mBinRange ] > busySectorNumStubs_) keep = false; + } else { + nStubsOut += nStubs; + if (nStubsOut > busySectorNumStubs_) keep = false; + } + + if (keep) outTracks.push_back(trk); + } + + } else { + + outTracks = tracks; + + } + + return outTracks; +} + +//=== Define the order in which the hardware processes rows of the HT array when it outputs track candidates. +//=== Currently corresponds to highest Pt tracks first. +//=== If two tracks have the same Pt, the -ve charge one is output before the +ve charge one. + +vector HTrphi::rowOrder(unsigned int numRows) const { + vector iOrder; + + // Logic slightly different depending on whether HT array has even or odd number of rows. + const bool oddNumRows = (numRows%2 == 1); + + // This selects middle rows first before moving to exterior ones. + if (oddNumRows) { + unsigned int middleRow = (numRows - 1)/2; + iOrder.push_back(middleRow); + for (unsigned int i = 1; i <= (numRows - 1)/2; i++) { + iOrder.push_back(middleRow - i); // -ve charge + iOrder.push_back(middleRow + i); // +ve charge + } + } else { + unsigned int startRowPos = numRows/2; + unsigned int startRowNeg = startRowPos - 1; + for (unsigned int i = 0; i < numRows/2; i++) { + iOrder.push_back(startRowNeg - i); // -ve charge + iOrder.push_back(startRowPos + i); // +ve charge + } + } + + return iOrder; +} + +} diff --git a/L1Trigger/TrackFindingTMTT/src/Histos.cc b/L1Trigger/TrackFindingTMTT/src/Histos.cc new file mode 100644 index 0000000000000..3a8d29757b848 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/Histos.cc @@ -0,0 +1,3260 @@ +#include "L1Trigger/TrackFindingTMTT/interface/Histos.h" +#include "L1Trigger/TrackFindingTMTT/interface/InputData.h" +#include "L1Trigger/TrackFindingTMTT/interface/Sector.h" +#include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h" +#include "L1Trigger/TrackFindingTMTT/interface/Get3Dtracks.h" +#include "L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" +#include "L1Trigger/TrackFindingTMTT/interface/Utility.h" + +#include "DataFormats/Math/interface/deltaPhi.h" +#include "DataFormats/Math/interface/deltaR.h" +#include "FWCore/Utilities/interface/Exception.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +using namespace std; + +namespace TMTT { + +//=== Store cfg parameters. + +Histos::Histos(const Settings* settings) : settings_(settings), plotFirst_(true), bApproxMistake_(false) { + genMinStubLayers_ = settings->genMinStubLayers(); + numPhiSectors_ = settings->numPhiSectors(); + numEtaRegions_ = settings->numEtaRegions(); + houghMinPt_ = settings->houghMinPt(); + houghNbinsPt_ = settings->houghNbinsPt(); + houghNbinsPhi_ = settings->houghNbinsPhi(); + chosenRofZ_ = settings->chosenRofZ(); + trackFitters_ = settings->trackFitters(); + useRZfilter_ = settings->useRZfilter(); + ranRZfilter_ = (useRZfilter_.size() > 0); // Was any r-z track filter run? + resPlotOpt_ = settings->resPlotOpt(); // Only use signal events for helix resolution plots? +} + +//=== Book all histograms + +void Histos::book() { + // Don't bother booking histograms if user didn't request them via TFileService in their cfg. + if ( ! this->enabled() ) return; + + TH1::SetDefaultSumw2(true); + + // Book histograms about input data. + this->bookInputData(); + // Book histograms checking if (eta,phi) sector definition choices are good. + this->bookEtaPhiSectors(); + // Book histograms checking filling of r-phi HT array. + this->bookRphiHT(); + // Book histograms about r-z track filters. + if (ranRZfilter_) this->bookRZfilters(); + // Book histograms for studying freak, extra large events at HT. + this->bookStudyBusyEvents(); + // Book histograms studying 3D track candidates found after HT. + this->bookTrackCands("HT"); + // Book histograms studying 3D track candidates found after r-z track filter. + if (ranRZfilter_) this->bookTrackCands("RZ"); + // Book histograms studying track fitting performance + this->bookTrackFitting(); +} + +//=== Fill all histograms + +void Histos::fill(const InputData& inputData, const matrix& mSectors, const matrix& mHtRphis, + const matrix mGet3Dtrks, const std::map>& fittedTracks) +{ + // Don't bother filling histograms if user didn't request them via TFileService in their cfg. + if ( ! this->enabled() ) return; + + // Fill histograms about input data. + this->fillInputData(inputData); + // Fill histograms checking if (eta,phi) sector definition choices are good. + this->fillEtaPhiSectors(inputData, mSectors); + // Fill histograms checking filling of r-phi HT array. + this->fillRphiHT(mHtRphis); + // Fill histograms about r-z track filters. + if (ranRZfilter_) this->fillRZfilters(mGet3Dtrks); + // Fill histograms for studying freak, extra large events at HT. + this->fillStudyBusyEvents(inputData, mSectors, mHtRphis, mGet3Dtrks); + // Fill histograms studying 3D track candidates found after HT. + vector tracksHT; + bool withRZfilter = false; + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); + const std::vector< L1track3D >& tracks = get3Dtrk.trackCands3D(withRZfilter); + tracksHT.insert(tracksHT.end(), tracks.begin(), tracks.end()); + } + this->fillTrackCands(inputData, tracksHT, "HT"); + // Fill histograms studying 3D track candidates found after r-z track filter. + if (ranRZfilter_) { + vector tracksRZ; + bool withRZfilter = true; + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); + const std::vector< L1track3D >& tracks = get3Dtrk.trackCands3D(withRZfilter); + tracksRZ.insert(tracksRZ.end(), tracks.begin(), tracks.end()); + } + this->fillTrackCands(inputData, tracksRZ, "RZ"); + } + // Fill histograms studying track fitting performance + this->fillTrackFitting(inputData, fittedTracks); +} + +//=== Book histograms using input stubs and tracking particles. + +TFileDirectory Histos::bookInputData() { + TFileDirectory inputDir = fs_->mkdir("InputData"); + + // N.B. Histograms of the kinematics and production vertex of tracking particles + // are booked in bookTrackCands(), since they are used to study the tracking efficiency. + + hisNumEvents_ = inputDir.make("NumEvents",";; No. of events",1,-0.5,0.5); + + // Count stubs & tracking particles. + + profNumStubs_ = inputDir.make("NumStubs","; Category; No. stubs in tracker",4,0.5,4.5); + profNumStubs_->GetXaxis()->SetBinLabel(1,"All stubs"); + profNumStubs_->GetXaxis()->SetBinLabel(2,"Genuine stubs"); + profNumStubs_->GetXaxis()->SetBinLabel(3,"Stubs matched to TP"); + profNumStubs_->GetXaxis()->SetBinLabel(4,"Stubs matched to TP for eff"); + profNumStubs_->LabelsOption("d"); + + hisStubsVsEta_ = inputDir.make("StubsVsEta","; #eta; No. stubs in tracker",30,-3.0,3.0); + hisStubsVsR_ = inputDir.make("StubsVsR","; radius (cm); No. stubs in tracker",1200,0.,120.); + + hisStubsVsRVsZ_ = inputDir.make("StubsVsRVsZ","; z (cm); radius (cm); No. stubs in tracker",1000,-280,280,1000,0,130); + hisStubsModuleVsRVsZ_ = inputDir.make("StubsModuleVsRVsZ","; z (cm); radius (cm); No. stubs in tracker",1000,-280,280,1000,0,130); + hisStubsVsRVsPhi_ = inputDir.make("StubsVsRVsPhi","; x (cm); y (cm); No. stubs in tracker",1000,-130,130,1000,-130,130); + hisStubsModuleVsRVsPhi_ = inputDir.make("StubsModuleVsRVsPhi","; x (cm); y (cm); No. stubs in tracker",1000,-130,130,1000,-130,130); + hisStubsModuleTiltVsZ_ = inputDir.make("StubsModuleTiltVsZ","; z (cm); Tilt; Module tilt vs z",1000,-280,280,128,-3.2,3.2); + hisStubsdPhiCorrectionVsZ_ = inputDir.make("StubsdPhiCorrectionVsZ","; z (cm); Correction; dPhi Correction vs z",1000,-280,280,100,-1,10); + + hisStubsVsRVsZ_outerModuleAtSmallerR_ = inputDir.make("StubsVsRVsZ_outerModuleAtSmallerR","; z (cm); radius (cm); No. stubs in tracker",1000,-280,280,1000,0,130); + hisStubsVsRVsPhi_outerModuleAtSmallerR_ = inputDir.make("StubsVsRVsPhi_outerModuleAtSmallerR","; x (cm); y (cm); No. stubs in tracker",1000,-130,130,1000,-130,130); + + profNumTPs_ = inputDir.make("NumTPs","; Category; No. of TPs in tracker",3,0.5,3.5); + profNumTPs_->GetXaxis()->SetBinLabel(1,"All TPs"); + profNumTPs_->GetXaxis()->SetBinLabel(2,"TPs for eff."); + profNumTPs_->GetXaxis()->SetBinLabel(3,"TPs for alg. eff."); + profNumTPs_->LabelsOption("d"); + + hisNumStubsPerTP_ = inputDir.make("NumStubsPerTP","; Number of stubs per TP for alg. eff.",50,-0.5,49.5); + hisNumPSStubsPerTP_ = inputDir.make("NumPSStubsPerTP","; Number of PS stubs per TP for alg. eff.",50,-0.5,49.5); + hisNum2SStubsPerTP_ = inputDir.make("Num2SStubsPerTP","; Number of 2S stubs per TP for alg. eff.",50,-0.5,49.5); + + hisNumLayersPerTP_ = inputDir.make("NumLayersPerTP","; Number of layers per TP for alg. eff.",50,-0.5,49.5); + hisNumPSLayersPerTP_ = inputDir.make("NumPSLayersPerTP","; Number of PS layers per TP for alg. eff.",50,-0.5,49.5); + hisNum2SLayersPerTP_ = inputDir.make("Num2SLayersPerTP","; Number of 2S layers per TP for alg. eff.",50,-0.5,49.5); + + hisNumLayersPerTP_muons_ = inputDir.make("NumLayersPerTP_muons","; Number of layers per TP for alg. eff.",50,-0.5,49.5); + hisNumPSLayersPerTP_muons_ = inputDir.make("NumPSLayersPerTP_muons","; Number of PS layers per TP for alg. eff.",50,-0.5,49.5); + hisNum2SLayersPerTP_muons_ = inputDir.make("Num2SLayersPerTP_muons","; Number of 2S layers per TP for alg. eff.",50,-0.5,49.5); + + hisNumLayersPerTP_electrons_ = inputDir.make("NumLayersPerTP_electrons","; Number of layers per TP for alg. eff.",50,-0.5,49.5); + hisNumPSLayersPerTP_electrons_ = inputDir.make("NumPSLayersPerTP_electrons","; Number of PS layers per TP for alg. eff.",50,-0.5,49.5); + hisNum2SLayersPerTP_electrons_ = inputDir.make("Num2SLayersPerTP_electrons","; Number of 2S layers per TP for alg. eff.",50,-0.5,49.5); + + hisNumLayersPerTP_pions_ = inputDir.make("NumLayersPerTP_pions","; Number of layers per TP for alg. eff.",50,-0.5,49.5); + hisNumPSLayersPerTP_pions_ = inputDir.make("NumPSLayersPerTP_pions","; Number of PS layers per TP for alg. eff.",50,-0.5,49.5); + hisNum2SLayersPerTP_pions_ = inputDir.make("Num2SLayersPerTP_pions","; Number of 2S layers per TP for alg. eff.",50,-0.5,49.5); + + hisNumLayersPerTP_lowPt_ = inputDir.make("NumLayersPerTP_lowPt","; Number of layers per TP for alg. eff.",50,-0.5,49.5); + hisNumPSLayersPerTP_lowPt_ = inputDir.make("NumPSLayersPerTP_lowPt","; Number of PS layers per TP for alg. eff.",50,-0.5,49.5); + hisNum2SLayersPerTP_lowPt_ = inputDir.make("Num2SLayersPerTP_lowPt","; Number of 2S layers per TP for alg. eff.",50,-0.5,49.5); + + hisNumLayersPerTP_mediumPt_ = inputDir.make("NumLayersPerTP_mediumPt","; Number of layers per TP for alg. eff.",50,-0.5,49.5); + hisNumPSLayersPerTP_mediumPt_ = inputDir.make("NumPSLayersPerTP_mediumPt","; Number of PS layers per TP for alg. eff.",50,-0.5,49.5); + hisNum2SLayersPerTP_mediumPt_ = inputDir.make("Num2SLayersPerTP_mediumPt","; Number of 2S layers per TP for alg. eff.",50,-0.5,49.5); + + hisNumLayersPerTP_highPt_ = inputDir.make("NumLayersPerTP_highPt","; Number of layers per TP for alg. eff.",50,-0.5,49.5); + hisNumPSLayersPerTP_highPt_ = inputDir.make("NumPSLayersPerTP_highPt","; Number of PS layers per TP for alg. eff.",50,-0.5,49.5); + hisNum2SLayersPerTP_highPt_ = inputDir.make("Num2SLayersPerTP_highPt","; Number of 2S layers per TP for alg. eff.",50,-0.5,49.5); + + // Study efficiency of tightened front end-electronics cuts. + + hisStubKillFE_ = inputDir.make("StubKillFE","; barrelLayer or 10+endcapRing; Stub fraction rejected by readout chip",30,-0.5,29.5); + hisStubIneffiVsInvPt_ = inputDir.make("StubIneffiVsPt","; 1/Pt; Inefficiency of readout chip for good stubs",30,0.0,1.0); + hisStubIneffiVsEta_ = inputDir.make("StubIneffiVsEta","; |#eta|; Inefficiency of readout chip for good stubs",30,0.0,3.0); + hisStubKillDegradeBend_ = inputDir.make("StubKillDegradeBend","; barrelLayer or 10+endcapRing; Stub fraction killed by DegradeBend.h window cut",30,-0.5,29.5); + + // Study stub resolution. + + hisPtStub_ = inputDir.make("PtStub","; Stub q/Pt",50,-0.5,0.5); + hisPtResStub_ = inputDir.make("PtResStub","; Stub q/Pt minus TP q/Pt",50,-0.5,0.5); + hisBendFilterPower_ = inputDir.make("BendFilterPower","; Fraction of q/Pt range allowed",102,-0.01,1.01); + hisDelPhiStub_ = inputDir.make("DelPhiStub","; Stub bend angle",50,-0.2,0.2); + hisDelPhiResStub_ = inputDir.make("DelPhiResStub","; Stub bend angle minus TP bend angle",200,-0.2,0.2); + + hisDelPhiResStub_tilted_ = inputDir.make("DelPhiResStub_tilted","; Stub bend angle minus TP bend angle",200,-0.2,0.2); + hisDelPhiResStub_notTilted_ = inputDir.make("DelPhiResStub_notTilted","; Stub bend angle minus TP bend angle",200,-0.2,0.2); + + hisBendStub_ = inputDir.make("BendStub","; Stub bend in units of strips",57,-7.125,7.125); + hisBendResStub_ = inputDir.make("BendResStub","; Stub bend minus TP bend in units of strips",100,-5.,5.); + hisNumMergedBend_ = inputDir.make("NumMergedBend","; No. of bend values merged together by loss of bit",10,-0.5,9.5); + hisBendVsLayerOrRingPS_ = inputDir.make("BendVsLayerOrRingPS","; PS barrelLayer or 10+endcapRing; Stub bend",30,-0.5,29.5,57,-7.125,7.125); + hisBendVsLayerOrRing2S_ = inputDir.make("BendVsLayerOrRing2S","; 2S barrelLayer or 10+endcapRing; Stub bend",30,-0.5,29.5,57,-7.125,7.125); + hisBendFEVsLayerOrRingPS_ = inputDir.make("BendFEVsLayerOrRingPS","; PS barrelLayer or 10+endcapRing; Stub bend in FE chip",30,-0.5,29.5,57,-7.125,7.125); + hisBendFEVsLayerOrRing2S_ = inputDir.make("BendFEVsLayerOrRing2S","; 2S barrelLayer or 10+endcapRing; Stub bend in FE chip",30,-0.5,29.5,57,-7.125,7.125); + + hisPhiStubVsPhiTP_ = inputDir.make("PhiStubVsPhiTP","; Stub #phi minus TP #phi at stub radius",100,-0.05,0.05); + hisPhiStubVsPhi0TP_ = inputDir.make("PhiStubVsPhi0TP","; Stub #phi minus TP #phi0",100,-0.3,0.3); + hisPhi0StubVsPhi0TP_ = inputDir.make("Phi0StubVsPhi0TP","; #phi0 of Stub minus TP",100,-0.2,0.2); + hisPhi0StubVsPhi0TPres_= inputDir.make("Phi0StubVsPhi0TPres","; #phi0 of Stub minus TP / resolution",100,-5.0,5.0); + hisPhiStubVsPhi65TP_ = inputDir.make("PhiStubVsPhi65TP","; Stub #phi minus TP phitrk65",100,-0.2,0.2); + hisPhi65StubVsPhi65TP_ = inputDir.make("Phi65StubVsPhi65TP","; phitrk65 of Stub minus TP",100,-0.2,0.2); + hisPhi65StubVsPhi65TPres_ = inputDir.make("Phi65StubVsPhi65TPres","; phitrk65 of Stub minus TP / resolution",100,-5.0,5.0); + + // Note ratio of sensor pitch to separation (needed to understand how many bits this can be packed into). + hisPitchOverSep_ = inputDir.make("PitchOverSep","; ratio of sensor pitch / separation",100,0.0,0.1); + hisRhoParameter_ = inputDir.make("RhoParameter","; rho parameter",100,0.0,0.2); + // Check alpha correction. + hisAlphaCheck_ = inputDir.make("AlphaCheck", "; #phi from stub; #phi from strip",40,-0.2,0.2,40,-0.2,0.2); + // Count stubs sharing a common cluster. + hisFracStubsSharingClus0_ = inputDir.make("FracStubsSharingClus0","Fraction of stubs sharing cluster in seed sensor",102,-0.01,1.01); + hisFracStubsSharingClus1_ = inputDir.make("FracStubsSharingClus1","Fraction of stubs sharing cluster in correlation sensor",102,-0.01,1.01); + + hisStubB_ = inputDir.make("StubB","Variable B for all stubs on TP",100,0.9,10); + hisStubBApproxDiff_tilted_ = inputDir.make("StubBApproxDiff_tilted_","Difference between exact and approximate values for B",100,-1,1); + + // Histos for denominator of tracking efficiency + float maxAbsQoverPt = 1. / houghMinPt_; // Max. |q/Pt| covered by HT array. + unsigned int nPhi = numPhiSectors_; + unsigned int nEta = numEtaRegions_; + hisTPinvptForEff_ = inputDir.make("TPinvptForEff", "; 1/Pt of TP (used for effi. measurement);",24,0.,1.5*maxAbsQoverPt); + hisTPptForEff_ = inputDir.make("TPptForEff", "; Pt of TP (used for effi. measurement);",25,0.0,100.0); + hisTPetaForEff_ = inputDir.make("TPetaForEff","; #eta of TP (used for effi. measurement);",20,-3.,3.); + hisTPphiForEff_ = inputDir.make("TPphiForEff","; #phi of TP (used for effi. measurement);",20,-M_PI,M_PI); + hisTPd0ForEff_ = inputDir.make("TPd0ForEff", "; d0 of TP (used for effi. measurement);",40,0.,4.); + hisTPz0ForEff_ = inputDir.make("TPz0ForEff", "; z0 of TP (used for effi. measurement);",50,0.,25.); + // + hisTPinvptForAlgEff_ = inputDir.make("TPinvptForAlgEff", "; 1/Pt of TP (used for alg. effi. measurement);",24,0.,1.5*maxAbsQoverPt); + hisTPptForAlgEff_ = inputDir.make("TPptForAlgEff", "; Pt of TP (used for alg. effi. measurement);",25,0.0,100.0); + hisTPetaForAlgEff_ = inputDir.make("TPetaForAlgEff","; #eta of TP (used for alg. effi. measurement);",20,-3.,3.); + hisTPphiForAlgEff_ = inputDir.make("TPphiForAlgEff","; #phi of TP (used for alg. effi. measurement);",20,-M_PI,M_PI); + hisTPd0ForAlgEff_ = inputDir.make("TPd0ForAlgEff", "; d0 of TP (used for alg. effi. measurement);",40,0.,4.); + hisTPz0ForAlgEff_ = inputDir.make("TPz0ForAlgEff", "; z0 of TP (used for alg. effi. measurement);",50,0.,25.); + // + hisTPphisecForAlgEff_ = inputDir.make("TPphisecForAlgEff", "; #phi sectorof TP (used for alg. effi. measurement);",nPhi,-0.5,nPhi-0.5); + hisTPetasecForAlgEff_ = inputDir.make("TPetasecForAlgEff", "; #eta sector of TP (used for alg. effi. measurement);",nEta,-0.5,nEta-0.5); + // + hisTPinvptForAlgEff_inJetPtG30_ = inputDir.make("TPinvptForAlgEff_inJetPtG30", "; 1/Pt of TP (used for effi. measurement);",24,0.,1.5*maxAbsQoverPt); + hisTPinvptForAlgEff_inJetPtG100_ = inputDir.make("TPinvptForAlgEff_inJetPtG100", "; 1/Pt of TP (used for effi. measurement);",24,0.,1.5*maxAbsQoverPt); + hisTPinvptForAlgEff_inJetPtG200_ = inputDir.make("TPinvptForAlgEff_inJetPtG200", "; 1/Pt of TP (used for effi. measurement);",24,0.,1.5*maxAbsQoverPt); + + return inputDir; +} + +//=== Fill histograms using input stubs and tracking particles. + +void Histos::fillInputData(const InputData& inputData) { + const vector& vStubs = inputData.getStubs(); + const vector& vTPs = inputData.getTPs(); + + hisNumEvents_->Fill(0.); + + // Count stubs. + unsigned int nStubsGenuine = 0; + unsigned int nStubsWithTP = 0; + unsigned int nStubsWithTPforEff = 0; + for (const Stub* stub : vStubs) { + if (stub->genuine()) { + nStubsGenuine++; + if (stub->assocTP() != nullptr) { + nStubsWithTP++; + if (stub->assocTP()->useForEff()) nStubsWithTPforEff++; + } + } + } + profNumStubs_->Fill(1, vStubs.size()); + profNumStubs_->Fill(2, nStubsGenuine); + profNumStubs_->Fill(3, nStubsWithTP); + profNumStubs_->Fill(4, nStubsWithTPforEff); + + for (const Stub* stub : vStubs) { + hisStubsVsEta_->Fill(stub->eta()); + hisStubsVsR_->Fill(stub->r()); + hisStubsVsRVsZ_->Fill( stub->z(), stub->r() ); + hisStubsModuleVsRVsZ_->Fill( stub->minZ(), stub->minR() ); + hisStubsModuleVsRVsZ_->Fill( stub->maxZ(), stub->maxR() ); + + hisStubsModuleTiltVsZ_->Fill( stub->minZ(), stub->moduleTilt() ); + hisStubsModuleTiltVsZ_->Fill( stub->maxZ(), stub->moduleTilt() ); + + if ( stub->barrel() && stub->outerModuleAtSmallerR() ) { + hisStubsVsRVsZ_outerModuleAtSmallerR_->Fill( stub->z(), stub->r() ); + } + + hisStubsdPhiCorrectionVsZ_->Fill( stub->minZ(), stub->dphiOverBendCorrection() ); + + hisStubsVsRVsPhi_->Fill( stub->r() * sin( stub->phi() ), stub->r() * cos( stub->phi() ) ); + hisStubsModuleVsRVsPhi_->Fill( stub->minR() * sin( stub->minPhi() ), stub->minR() * cos( stub->minPhi() ) ); + hisStubsModuleVsRVsPhi_->Fill( stub->maxR() * sin( stub->maxPhi() ), stub->maxR() * cos( stub->maxPhi() ) ); + + if ( stub->barrel() && stub->outerModuleAtSmallerR() ) { + hisStubsVsRVsPhi_outerModuleAtSmallerR_->Fill( stub->r() * sin( stub->phi() ), stub->r() * cos( stub->phi() ) ); + } + + } + + // Count tracking particles. + unsigned int nTPforEff = 0; + unsigned int nTPforAlgEff = 0; + for (const TP& tp: vTPs) { + if (tp.useForEff()) nTPforEff++; + if (tp.useForAlgEff()) nTPforAlgEff++; + } + profNumTPs_->Fill(1, vTPs.size()); + profNumTPs_->Fill(2, nTPforEff); + profNumTPs_->Fill(3, nTPforAlgEff); + + // Study efficiency of stubs to pass front-end electronics cuts. + + const vector& vAllStubs = inputData.getAllStubs(); // Get all stubs prior to FE cuts to do this. + for (const Stub s : vAllStubs) { + unsigned int layerOrTenPlusRing = s.barrel() ? s.layerId() : 10 + s.endcapRing(); + // Fraction of all stubs (good and bad) failing tightened front-end electronics cuts. + hisStubKillFE_->Fill(layerOrTenPlusRing, (! s.frontendPass())); + // Fraction of stubs rejected by window cut in DegradeBend.h + // If it is non-zero, then encoding in DegradeBend.h should ideally be changed to make it zero. + hisStubKillDegradeBend_->Fill(layerOrTenPlusRing, s.stubFailedDegradeWindow()); + } + + // Study efficiency for good stubs of tightened front end-electronics cuts. + for (const TP& tp : vTPs) { + if (tp.useForAlgEff()) {// Only bother for stubs that are on TP that we have a chance of reconstructing. + const vector stubs = tp.assocStubs(); + for (const Stub* s : stubs) { + hisStubIneffiVsInvPt_->Fill(1./tp.pt() , (! s->frontendPass()) ); + hisStubIneffiVsEta_->Fill (fabs(tp.eta()), (! s->frontendPass()) ); + } + } + } + + // Plot stub bend-derived information. + for (const Stub* stub : vStubs) { + hisPtStub_->Fill(stub->qOverPt()); + hisDelPhiStub_->Fill(stub->dphi()); + hisBendStub_->Fill(stub->dphi() / stub->dphiOverBend()); + // Number of bend values merged together by loss of a bit. + hisNumMergedBend_->Fill(stub->numMergedBend()); + // Min. & max allowed q/Pt obtained from stub bend. + float minQoverPt = max(float(-1./(houghMinPt_)), stub->qOverPt() - stub->qOverPtres()); + float maxQoverPt = min(float(1./(houghMinPt_)), stub->qOverPt() + stub->qOverPtres()); + // Frac. of full q/Pt range allowed by stub bend. + float fracAllowed = (maxQoverPt - minQoverPt)/(2./(houghMinPt_)); + hisBendFilterPower_->Fill(fracAllowed); + unsigned int layerOrTenPlusRing = stub->barrel() ? stub->layerId() : 10 + stub->endcapRing(); + // Also plot bend before & after to degradation. + if (stub->psModule()) { + hisBendFEVsLayerOrRingPS_->Fill(layerOrTenPlusRing, stub->bendInFrontend()); + hisBendVsLayerOrRingPS_->Fill(layerOrTenPlusRing, stub->bend()); + } else { + hisBendFEVsLayerOrRing2S_->Fill(layerOrTenPlusRing, stub->bendInFrontend()); + hisBendVsLayerOrRing2S_->Fill(layerOrTenPlusRing, stub->bend()); + } + } + + // Look at stub resolution. + for (const TP& tp: vTPs) { + if (tp.useForAlgEff()) { + const vector& assStubs= tp.assocStubs(); + hisNumStubsPerTP_->Fill( assStubs.size() ); + + unsigned int numPSstubs = 0; + unsigned int num2Sstubs = 0; + + //cout<<"=== TP === : index="<pitchOverSep(); + if ( ! stub->barrel() ) rho *= fabs(stub->z())/stub->r(); + hisRhoParameter_->Fill(rho); + + // Check how strip number correlates with phi coordinate relative to module centre. + // (Useful for "alpha" correction for non-radial strips in endcap 2S modules). + float fracPosInModule = (float(2 * stub->iphi()) - float(stub->nstrip())) / float(stub->nstrip()); + float phiFromStrip = 0.5 * stub->width() * fracPosInModule / stub->r(); + if (stub->z() < 0 && (not stub->barrel())) phiFromStrip *= -1; + if (stub->outerModuleAtSmallerR()) phiFromStrip *= -1; // Module flipped. + float phiFromStub = reco::deltaPhi(stub->phi(), 0.5*(stub->minPhi() + stub->maxPhi())); + hisAlphaCheck_->Fill(phiFromStub, phiFromStrip); + } + + // Check fraction of stubs sharing a common cluster. + // Loop over both clusters in each stub, so looking for common clusters in seed (0) or correlation (1) sensor of module. + typedef pair< unsigned int, pair > ClusterLocation; + for (unsigned int iClus = 0; iClus <= 1; iClus++) { + map commonClusterMap; + for (const Stub* stub : vStubs) { + // Encode detector ID & strip (or pixel) numbers in both dimensions. + const ClusterLocation loc( stub->idDet(), pair(stub->localU_cluster()[iClus], stub->localV_cluster()[iClus]) ); + if (commonClusterMap.find(loc) == commonClusterMap.end()) { + commonClusterMap[loc] = 1; + } else { + commonClusterMap[loc]++; + } + } + unsigned int nShare = 0; + for (map::const_iterator it = commonClusterMap.begin(); it != commonClusterMap.end(); it++) { + if (it->second != 1) nShare += it->second; // 2 or more stubs share a cluster at this detid*strip. + } + if (iClus == 0) { + hisFracStubsSharingClus0_->Fill(float(nShare)/float(vStubs.size())); + } else { + hisFracStubsSharingClus1_->Fill(float(nShare)/float(vStubs.size())); + } + } + + // Determine r (z) range of each barrel layer (endcap wheel). + + for (const Stub* stub : vStubs) { + unsigned int layer = stub->layerId(); + if (stub->barrel()) { + // Get range in r of each barrel layer. + float r = stub->r(); + if (mapBarrelLayerMinR_.find(layer) == mapBarrelLayerMinR_.end()) { + mapBarrelLayerMinR_[layer] = r; + mapBarrelLayerMaxR_[layer] = r; + } else { + if (mapBarrelLayerMinR_[layer] > r) mapBarrelLayerMinR_[layer] = r; + if (mapBarrelLayerMaxR_[layer] < r) mapBarrelLayerMaxR_[layer] = r; + } + } else { + layer = layer%10; + // Range in |z| of each endcap wheel. + float z = fabs(stub->z()); + if (mapEndcapWheelMinZ_.find(layer) == mapEndcapWheelMinZ_.end()) { + mapEndcapWheelMinZ_[layer] = z; + mapEndcapWheelMaxZ_[layer] = z; + } else { + if (mapEndcapWheelMinZ_[layer] > z) mapEndcapWheelMinZ_[layer] = z; + if (mapEndcapWheelMaxZ_[layer] < z) mapEndcapWheelMaxZ_[layer] = z; + } + } + } + + // Determine Range in (r,|z|) of each module type. + + for (const Stub* stub : vStubs) { + float r = stub->r(); + float z = fabs(stub->z()); + unsigned int modType = stub->digitalStub().moduleType(); + // Do something ugly, as modules in 1-2nd & 3-4th endcap wheels are different to those in wheel 5 ... + // And boundary between flat & tilted modules in barrel layers 1-3 varies in z. + if (stub->barrel() && stub->layerId() == 1) { // barrel layer 1 + if (mapExtraAModuleTypeMinR_.find(modType) == mapExtraAModuleTypeMinR_.end()) { + mapExtraAModuleTypeMinR_[modType] = r; + mapExtraAModuleTypeMaxR_[modType] = r; + mapExtraAModuleTypeMinZ_[modType] = z; + mapExtraAModuleTypeMaxZ_[modType] = z; + } else { + if (mapExtraAModuleTypeMinR_[modType] > r) mapExtraAModuleTypeMinR_[modType] = r; + if (mapExtraAModuleTypeMaxR_[modType] < r) mapExtraAModuleTypeMaxR_[modType] = r; + if (mapExtraAModuleTypeMinZ_[modType] > z) mapExtraAModuleTypeMinZ_[modType] = z; + if (mapExtraAModuleTypeMaxZ_[modType] < z) mapExtraAModuleTypeMaxZ_[modType] = z; + } + } else if (stub->barrel() && stub->layerId() == 2) { // barrel layer 2 + if (mapExtraBModuleTypeMinR_.find(modType) == mapExtraBModuleTypeMinR_.end()) { + mapExtraBModuleTypeMinR_[modType] = r; + mapExtraBModuleTypeMaxR_[modType] = r; + mapExtraBModuleTypeMinZ_[modType] = z; + mapExtraBModuleTypeMaxZ_[modType] = z; + } else { + if (mapExtraBModuleTypeMinR_[modType] > r) mapExtraBModuleTypeMinR_[modType] = r; + if (mapExtraBModuleTypeMaxR_[modType] < r) mapExtraBModuleTypeMaxR_[modType] = r; + if (mapExtraBModuleTypeMinZ_[modType] > z) mapExtraBModuleTypeMinZ_[modType] = z; + if (mapExtraBModuleTypeMaxZ_[modType] < z) mapExtraBModuleTypeMaxZ_[modType] = z; + } + } else if (! stub->barrel() && (stub->layerId()%10 == 1 || stub->layerId()%10 == 2)) { // endcap wheel 1-2 + if (mapExtraCModuleTypeMinR_.find(modType) == mapExtraCModuleTypeMinR_.end()) { + mapExtraCModuleTypeMinR_[modType] = r; + mapExtraCModuleTypeMaxR_[modType] = r; + mapExtraCModuleTypeMinZ_[modType] = z; + mapExtraCModuleTypeMaxZ_[modType] = z; + } else { + if (mapExtraCModuleTypeMinR_[modType] > r) mapExtraCModuleTypeMinR_[modType] = r; + if (mapExtraCModuleTypeMaxR_[modType] < r) mapExtraCModuleTypeMaxR_[modType] = r; + if (mapExtraCModuleTypeMinZ_[modType] > z) mapExtraCModuleTypeMinZ_[modType] = z; + if (mapExtraCModuleTypeMaxZ_[modType] < z) mapExtraCModuleTypeMaxZ_[modType] = z; + } + } else if (! stub->barrel() && (stub->layerId()%10 == 3 || stub->layerId()%10 == 4)) { // endcap wheel 3-4 + if (mapExtraDModuleTypeMinR_.find(modType) == mapExtraDModuleTypeMinR_.end()) { + mapExtraDModuleTypeMinR_[modType] = r; + mapExtraDModuleTypeMaxR_[modType] = r; + mapExtraDModuleTypeMinZ_[modType] = z; + mapExtraDModuleTypeMaxZ_[modType] = z; + } else { + if (mapExtraDModuleTypeMinR_[modType] > r) mapExtraDModuleTypeMinR_[modType] = r; + if (mapExtraDModuleTypeMaxR_[modType] < r) mapExtraDModuleTypeMaxR_[modType] = r; + if (mapExtraDModuleTypeMinZ_[modType] > z) mapExtraDModuleTypeMinZ_[modType] = z; + if (mapExtraDModuleTypeMaxZ_[modType] < z) mapExtraDModuleTypeMaxZ_[modType] = z; + } + } else { // barrel layer 3-6 or endcap wheel 5. + if (mapModuleTypeMinR_.find(modType) == mapModuleTypeMinR_.end()) { + mapModuleTypeMinR_[modType] = r; + mapModuleTypeMaxR_[modType] = r; + mapModuleTypeMinZ_[modType] = z; + mapModuleTypeMaxZ_[modType] = z; + } else { + if (mapModuleTypeMinR_[modType] > r) mapModuleTypeMinR_[modType] = r; + if (mapModuleTypeMaxR_[modType] < r) mapModuleTypeMaxR_[modType] = r; + if (mapModuleTypeMinZ_[modType] > z) mapModuleTypeMinZ_[modType] = z; + if (mapModuleTypeMaxZ_[modType] < z) mapModuleTypeMaxZ_[modType] = z; + } + } + } + + //=== Make denominator of tracking efficiency plots + + for (const TP& tp: vTPs) { + + if (tp.useForEff()) { // Check TP is good for efficiency measurement. + + // Check which eta and phi sectors this TP is in. + int iPhiSec_TP = -1; + int iEtaReg_TP = -1; + Sector sectorTmp; + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + sectorTmp.init(settings_, iPhiSec, 0); + if (sectorTmp.insidePhiSec(tp)) iPhiSec_TP = iPhiSec; + } + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + sectorTmp.init(settings_, 0, iEtaReg); + if (sectorTmp.insideEtaReg(tp)) iEtaReg_TP = iEtaReg; + } + + // Plot kinematics of all good TP. + hisTPinvptForEff_->Fill(1./tp.pt()); + hisTPptForEff_->Fill(tp.pt()); + hisTPetaForEff_->Fill(tp.eta()); + hisTPphiForEff_->Fill(tp.phi0()); + // Plot also production point of all good TP. + hisTPd0ForEff_->Fill(fabs(tp.d0())); + hisTPz0ForEff_->Fill(fabs(tp.z0())); + + if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. + hisTPinvptForAlgEff_->Fill(1./tp.pt()); + hisTPptForAlgEff_->Fill(tp.pt()); + hisTPetaForAlgEff_->Fill(tp.eta()); + hisTPphiForAlgEff_->Fill(tp.phi0()); + // Plot also production point of all good TP. + hisTPd0ForAlgEff_->Fill(fabs(tp.d0())); + hisTPz0ForAlgEff_->Fill(fabs(tp.z0())); + // Plot sector nunber. + hisTPphisecForAlgEff_->Fill(iPhiSec_TP); + hisTPetasecForAlgEff_->Fill(iEtaReg_TP); + + // Plot 1/pt for TPs inside a jet + if ( tp.tpInJet() ) { + hisTPinvptForAlgEff_inJetPtG30_->Fill(1./tp.pt()); + } + if ( tp.tpInHighPtJet() ) { + hisTPinvptForAlgEff_inJetPtG100_->Fill(1./tp.pt()); + } + if ( tp.tpInVeryHighPtJet() ) { + hisTPinvptForAlgEff_inJetPtG200_->Fill(1./tp.pt()); + } + } + } + } +} + +//=== Book histograms checking if (eta,phi) sector defis(nition choices are good. + +TFileDirectory Histos::bookEtaPhiSectors() { + TFileDirectory inputDir = fs_->mkdir("CheckSectors"); + + // Check if TP lose stubs because not all in same sector. + + hisFracStubsInSec_ = inputDir.make("FracStubsInSec","; Fraction of stubs on TP in best (#eta,#phi) sector;",102,-0.01,1.01); + hisFracStubsInEtaSec_ = inputDir.make("FracStubsInEtaSec","; Fraction of stubs on TP in best #eta sector;",102,-0.01,1.01); + hisFracStubsInPhiSec_ = inputDir.make("FracStubsInPhiSec","; Fraction of stubs on TP in best #phi sector;",102,-0.01,1.01); + + // Check if stubs excessively duplicated between overlapping sectors. + + hisNumSecsPerStub_ = inputDir.make("NumSecPerStub","; Number of (#eta,#phi) sectors each stub appears in",20,-0.5,19.5); + hisNumEtaSecsPerStub_ = inputDir.make("NumEtaSecPerStub","; Number of #eta sectors each stub appears in",20,-0.5,19.5); + hisNumPhiSecsPerStub_ = inputDir.make("NumPhiSecPerStub","; Number of #phi sectors each stub appears in",20,-0.5,19.5); + + // Count stubs per (eta,phi) sector. + hisNumStubsPerSec_ = inputDir.make("NumStubsPerSec","; Number of stubs per sector",250,-0.5,249.5); + // Ditto, summed over all phi. This checks if equal stubs go into each eta region, important for latency. + unsigned int nEta = numEtaRegions_; + profNumStubsPerEtaSec_ = inputDir.make("NumStubsPerEtaSec",";#eta sector; Number of stubs per #eta sector",nEta,-0.5,nEta-0.5); + + // Check which tracker layers are present in each eta sector. + hisLayerIDvsEtaSec_ = inputDir.make("LayerIDvsEtaSec",";#eta sector; layer ID",nEta,-0.5,nEta-0.5,20,0.5,20.5); + hisLayerIDreducedvsEtaSec_ = inputDir.make("LayerIDreducedvsEtaSec",";#eta sector; reduced layer ID",nEta,-0.5,nEta-0.5,20,0.5,20.5); + + return inputDir; +} + +//=== Fill histograms checking if (eta,phi) sector definition choices are good. + +void Histos::fillEtaPhiSectors(const InputData& inputData, const matrix& mSectors) { + + const vector& vStubs = inputData.getStubs(); + const vector& vTPs = inputData.getTPs(); + + //=== Loop over good tracking particles, looking for the (eta,phi) sector in which each has the most stubs. + //=== and checking what fraction of its stubs were in this sector. + + for (const TP& tp : vTPs) { + if (tp.useForAlgEff()) { + unsigned int nStubs = tp.numAssocStubs(); // no. of stubs in this TP. + + // Number of stubs this TP has in best (eta,phi) sector, and also just dividing sectors in phi or just in eta. + unsigned int nStubsInBestSec = 0; + unsigned int nStubsInBestEtaSec = 0; + unsigned int nStubsInBestPhiSec = 0; + + // Loop over (eta, phi) sectors. + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + + const Sector& sector = mSectors(iPhiSec, iEtaReg); + + // Count number of stubs in given tracking particle which are inside this (phi,eta) sector; + // or inside it if only the eta cuts are applied; or inside it if only the phi cuts are applied. + unsigned int nStubsInSec, nStubsInEtaSec, nStubsInPhiSec; + sector.numStubsInside( tp, nStubsInSec, nStubsInEtaSec, nStubsInPhiSec); + + // Note best results obtained in any sector. + nStubsInBestSec = max( nStubsInBestSec, nStubsInSec); + nStubsInBestEtaSec = max( nStubsInBestEtaSec, nStubsInEtaSec); + nStubsInBestPhiSec = max( nStubsInBestPhiSec, nStubsInPhiSec); + } + } + + // Plot fraction of stubs on each TP in its best sector. + hisFracStubsInSec_->Fill ( float(nStubsInBestSec) / float(nStubs) ); + hisFracStubsInEtaSec_->Fill( float(nStubsInBestEtaSec) / float(nStubs) ); + hisFracStubsInPhiSec_->Fill( float(nStubsInBestPhiSec) / float(nStubs) ); + } + } + + //=== Loop over all stubs, counting how many sectors each one appears in. + + for (const Stub* stub : vStubs) { + + // Number of (eta,phi), phi & eta sectors containing this stub. + unsigned int nSecs = 0; + unsigned int nEtaSecs = 0; + unsigned int nPhiSecs = 0; + + // Loop over (eta, phi) sectors. + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + + const Sector& sector = mSectors(iPhiSec, iEtaReg); + + // Check if sector contains stub stub, and if so count it. + // Take care to just use one eta (phi) typical region when counting phi (eta) sectors. + if ( sector.inside ( stub ) ) nSecs++; + if ( iPhiSec == 0 && sector.insideEta( stub ) ) nEtaSecs++; + if ( iEtaReg == 0 && sector.insidePhi( stub ) ) nPhiSecs++; + + // Also note which tracker layers are present in each eta sector. + if (iPhiSec == 0 && sector.insideEta( stub)) { + const TP* assocTP = stub->assocTP(); + if (assocTP != nullptr) { + if (assocTP->useForAlgEff()) { + unsigned int lay = stub->layerId(); + if (lay > 20) lay -= 10; // Don't bother distinguishing two endcaps. + hisLayerIDvsEtaSec_->Fill(iEtaReg, lay); + hisLayerIDreducedvsEtaSec_->Fill(iEtaReg, stub->layerIdReduced()); // Plot also simplified layerID for hardware, which tries to avoid more than 8 ID in any given eta region. + } + } + } + } + } + + // Plot number of sectors each stub appears in. + hisNumSecsPerStub_->Fill ( nSecs ); + hisNumEtaSecsPerStub_->Fill( nEtaSecs ); + hisNumPhiSecsPerStub_->Fill( nPhiSecs ); + + if ( ! settings_->allowOver2EtaSecs()) { + if (nEtaSecs > 2) throw cms::Exception("Histos ERROR: Stub assigned to more than 2 eta regions. Please redefine eta regions to avoid this!")<<" stub r="<r()<<" eta="<eta()<Fill(nStubs); + nStubsInEtaSec += nStubs; + } + profNumStubsPerEtaSec_->Fill(iEtaReg, nStubsInEtaSec); + } +} + +//=== Book histograms checking filling of r-phi HT array. + +TFileDirectory Histos::bookRphiHT() { + + TFileDirectory inputDir = fs_->mkdir("HTrphi"); + + // The next block of code is to book a histogram to study unusual HT cell shapes. + + unsigned int shape = settings_->shape(); + float maxAbsQoverPtAxis = 1. / houghMinPt_; // Max. |q/Pt| covered by HT array. + float maxAbsPhiTrkAxis = M_PI / (float)numPhiSectors_; // Half-width of phiTrk axis in HT array. + float binSizeQoverPtAxis = 2. * maxAbsQoverPtAxis / (float)houghNbinsPt_; + if ( shape == 2 || shape == 1 || shape == 3 ) + binSizeQoverPtAxis = 2. * maxAbsQoverPtAxis / ( houghNbinsPt_ - 1. ); + float binSizePhiTrkAxis = 2. * maxAbsPhiTrkAxis / (float)houghNbinsPhi_; + if ( shape == 2 ) + binSizePhiTrkAxis = 2. * maxAbsPhiTrkAxis / ( houghNbinsPhi_ - 1. / 6. ); + else if ( shape == 1 ) + binSizePhiTrkAxis = 2. * maxAbsPhiTrkAxis / ( houghNbinsPhi_ - 1. / 2. ); + hisArrayHT_ = inputDir.make< TH2Poly >( "ArrayHT", "HT Array; m Bins; c Bins", + -maxAbsQoverPtAxis, maxAbsQoverPtAxis, -maxAbsPhiTrkAxis, maxAbsPhiTrkAxis ); + //hisStubHT_ = inputDir.make< TF1 >( "StubHT", "[0]+[1]*x", -maxAbsQoverPtAxis, maxAbsQoverPtAxis ); + //hisStubHT_->SetMinimum( -maxAbsPhiTrkAxis ); + //hisStubHT_->SetMaximum( maxAbsPhiTrkAxis ); + float xloop, yloop, xtemp; + Double_t x[7], y[7]; + switch ( shape ) { + case 0 : + xloop = - maxAbsQoverPtAxis; + yloop = - maxAbsPhiTrkAxis; + for ( unsigned int row = 0; row < houghNbinsPhi_; row++ ) { + xtemp = xloop; + for ( unsigned int column = 0; column < houghNbinsPt_; column++ ) { + // Go around the square + x[0] = xtemp; + y[0] = yloop; + x[1] = x[0]; + y[1] = y[0] + binSizePhiTrkAxis; + x[2] = x[1] + binSizeQoverPtAxis; + y[2] = y[1]; + x[3] = x[2]; + y[3] = y[0]; + x[4] = x[0]; + y[4] = y[0]; + hisArrayHT_->AddBin(5, x, y); + // Go right + xtemp += binSizeQoverPtAxis; + } + yloop += binSizePhiTrkAxis; + } + break; + case 1 : + xloop = - maxAbsQoverPtAxis - binSizeQoverPtAxis; + yloop = - maxAbsPhiTrkAxis; + for ( unsigned int row = 0; row < houghNbinsPhi_ * 2; row++ ) { + xtemp = xloop; + for ( unsigned int column = 0; column < houghNbinsPt_; column++ ) { + // Go around the square + x[0] = xtemp; + y[0] = yloop; + x[1] = x[0] + binSizeQoverPtAxis; + y[1] = y[0] + binSizePhiTrkAxis / 2.; + x[2] = x[1] + binSizeQoverPtAxis; + y[2] = y[0]; + x[3] = x[1]; + y[3] = y[0] - binSizePhiTrkAxis / 2.; + x[4] = x[0]; + y[4] = y[0]; + hisArrayHT_->AddBin(5, x, y); + // Go right + xtemp += binSizeQoverPtAxis * 2.; + } + xloop += ( row % 2 == 0 ) ? binSizeQoverPtAxis : - binSizeQoverPtAxis; + yloop += binSizePhiTrkAxis / 2.; + } + break; + case 2 : + xloop = - maxAbsQoverPtAxis - binSizeQoverPtAxis; + yloop = - maxAbsPhiTrkAxis; + for ( unsigned int row = 0; row < houghNbinsPhi_ * 2; row++ ) { + xtemp = xloop; + for ( unsigned int column = 0; column < houghNbinsPt_; column++ ) { + // Go around the hexagon + x[0] = xtemp; + y[0] = yloop; + x[1] = x[0]; + y[1] = y[0] + binSizePhiTrkAxis / 3.; + x[2] = x[1] + binSizeQoverPtAxis; + y[2] = y[1] + binSizePhiTrkAxis / 6.; + x[3] = x[2] + binSizeQoverPtAxis; + y[3] = y[1]; + x[4] = x[3]; + y[4] = y[0]; + x[5] = x[2]; + y[5] = y[4] - binSizePhiTrkAxis / 6.; + x[6] = x[0]; + y[6] = y[0]; + hisArrayHT_->AddBin(7, x, y); + // Go right + xtemp += binSizeQoverPtAxis * 2.; + } + xloop += ( row % 2 == 0 ) ? binSizeQoverPtAxis : - binSizeQoverPtAxis; + yloop += binSizePhiTrkAxis / 2.; + } + break; + case 3 : + xloop = - maxAbsQoverPtAxis - binSizeQoverPtAxis; + yloop = - maxAbsPhiTrkAxis; + for ( unsigned int row = 0; row < houghNbinsPhi_ * 2; row++ ) { + xtemp = xloop; + for ( unsigned int column = 0; column < houghNbinsPt_; column++ ) { + // Go around the square + x[0] = xtemp; + y[0] = yloop; + x[1] = x[0]; + y[1] = y[0] + binSizePhiTrkAxis / 2.; + x[2] = x[1] + binSizeQoverPtAxis * 2.; + y[2] = y[1]; + x[3] = x[2]; + y[3] = y[0]; + x[4] = x[0]; + y[4] = y[0]; + hisArrayHT_->AddBin(5, x, y); + // Go right + xtemp += binSizeQoverPtAxis * 2.; + } + xloop += ( row % 2 == 0 ) ? binSizeQoverPtAxis : - binSizeQoverPtAxis; + yloop += binSizePhiTrkAxis / 2.; + } + break; + } + + hisIncStubsPerHT_ = inputDir.make("IncStubsPerHT","; Number of filtered stubs per r#phi HT array (inc. duplicates)",100,0.,-1.); + hisExcStubsPerHT_ = inputDir.make("ExcStubsPerHT","; Number of filtered stubs per r#phi HT array (exc. duplicates)",250,-0.5,249.5); + + hisNumStubsInCellVsEta_ = inputDir.make("NumStubsInCellVsEta","; no. of stubs per HT cell summed over phi sector; #eta region",100,-0.5,499.5, numEtaRegions_, -0.5, numEtaRegions_ - 0.5); + + hisStubsOnRphiTracksPerHT_ = inputDir.make("StubsOnRphiTracksPerHT","; Number of stubs assigned to tracks per r#phi HT array",500,-0.5,499.5); + + hisHTstubsPerTrack_ = inputDir.make("stubsPerTrk","No. stubs per track",25,-0.5,24.5); + hisHTmBin_ = inputDir.make("mBin","HT m bin", houghNbinsPt_, -0.5, houghNbinsPt_-0.5); + hisHTcBin_ = inputDir.make("cBin","HT c bin", houghNbinsPhi_, -0.5, houghNbinsPhi_-0.5); + + return inputDir; +} + +//=== Fill histograms checking filling of r-phi HT array. + +void Histos::fillRphiHT(const matrix& mHtRphis) { + + //--- Loop over (eta,phi) sectors, counting the number of stubs in the HT array of each. + + if ( plotFirst_ ) { + const HTrphi& htRphi = mHtRphis(settings_->iPhiPlot(),settings_->iEtaPlot()); + float phiCentreSector = -M_PI + ( 1. + 2. * settings_->iPhiPlot() ) * M_PI / (float)numPhiSectors_; + const matrix& htRphiMatrix = htRphi.getAllCells(); + const Stub* stub( nullptr ); + for (unsigned int i = 0; i < htRphiMatrix.size1(); i++) + for (unsigned int j = 0; j < htRphiMatrix.size2(); j++) { + std::pair< float, float > cell = htRphi.helix2Dhough(i,j); + unsigned int numStubs = htRphiMatrix(i,j).numStubs(); + hisArrayHT_->Fill(cell.first, reco::deltaPhi(cell.second, phiCentreSector), numStubs); + if ( numStubs > 0 ) + stub = htRphiMatrix(i,j).stubs().front(); + } + if ( stub != nullptr ) { + //hisStubHT_->SetParameters( reco::deltaPhi( stub->phi(), phiCentreSector ), settings_->invPtToDphi() * ( stub->r() - settings_->chosenRofPhi() ) ); + //hisStubHT_->Draw(); + } + } + plotFirst_ = false; + + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + const HTrphi& htRphi = mHtRphis (iPhiSec, iEtaReg); + + // Here, if a stub appears in multiple cells, it is counted multiple times. + hisIncStubsPerHT_->Fill( htRphi.numStubsInc() ); + // Here, if a stub appears in multiple cells, it is counted only once. + hisExcStubsPerHT_->Fill( htRphi.numStubsExc() ); + } + } + + //--- Count number of stubs in each cell of HT array, summing over all the phi sectors within a given + //--- eta region. This determines the buffer size needed to store them in the firmware. + + // Loop over eta regions. + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + // Get dimensions of HT array (assumed same for all phi sectors) + unsigned int iPhiSecDummy = 0; + const matrix& rphiHTcellsDummy = mHtRphis(iPhiSecDummy, iEtaReg).getAllCells(); + const unsigned int nbins1 = rphiHTcellsDummy.size1(); + const unsigned int nbins2 = rphiHTcellsDummy.size2(); + // Loop over cells inside HT array + for (unsigned int m = 0; m < nbins1; m++) { + for (unsigned int n = 0; n < nbins2; n++) { + // Loop over phi sectors + unsigned int nStubsInCellPhiSum = 0; + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + const HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); + const matrix& rphiHTcells = htRphi.getAllCells(); + nStubsInCellPhiSum += rphiHTcells(m,n).numStubs(); + } + // Plot total number of stubs in this cell, summed over all phi sectors. + hisNumStubsInCellVsEta_->Fill( nStubsInCellPhiSum, iEtaReg ); + } + } + } + + //--- Count number of cells assigned to track candidates by r-phi HT (before any rz filtering + //--- or rz HT has been run). + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + const HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); + hisStubsOnRphiTracksPerHT_->Fill(htRphi.numStubsOnTrackCands2D()); + // Also note cell location of HT tracks. + for (const L1track2D& trk : htRphi.trackCands2D()) { + hisHTstubsPerTrack_->Fill(trk.getNumStubs()); + hisHTmBin_->Fill(trk.getCellLocationHT().first); + hisHTcBin_->Fill(trk.getCellLocationHT().second); + } + } + } +} + +//=== Book histograms about r-z track filters (or other filters applied after r-phi HT array). + +TFileDirectory Histos::bookRZfilters() { + + TFileDirectory inputDir = fs_->mkdir("RZfilters"); + + //--- Histograms for Seed Filter + if (settings_->rzFilterName() == "SeedFilter") { + // Check number of track seeds that r-z filters must check. + hisNumSeedCombinations_ = inputDir.make("NumSeedCombinations_","; Number of seed combinations per track cand; no. seeds ; ", 50, -0.5 , 49.5); + hisNumGoodSeedCombinations_ = inputDir.make("NumGoodSeedCombinations_","; Number of good seed combinations per track cand; ", 30, -0.5 , 29.5); + } + return inputDir; +} + +//=== Fill histograms about r-z track filters. + +void Histos::fillRZfilters(const matrix& mGet3Dtrks) { + + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); + + //--- Histograms for Seed Filter + if (settings_->rzFilterName() == "SeedFilter") { + // Check number of track seeds per sector that r-z "seed" filter checked. + const vector numSeedComb = get3Dtrk.getRZfilter().numSeedCombsPerTrk(); + for (const unsigned int& num : numSeedComb) { + hisNumSeedCombinations_->Fill(num) ; + } + // Same again, but this time only considering seeds the r-z filters defined as "good". + const vector numGoodSeedComb = get3Dtrk.getRZfilter().numGoodSeedCombsPerTrk(); + for (const unsigned int& num : numGoodSeedComb) { + hisNumGoodSeedCombinations_->Fill(num) ; + } + } + } + } +} + +//=== Book histograms studying track candidates found by Hough Transform. + +TFileDirectory Histos::bookTrackCands(string tName) { + + // Now book histograms for studying tracking in general. + + // Define lambda function to facilitate adding "tName" to directory & histogram names. + //auto addn = [tName](string s){ return TString::Format("%s_%s", s.c_str(), tName.c_str()).Data(); }; + auto addn = [tName](string s){ return TString::Format("%s_%s", s.c_str(), tName.c_str()); }; + + TFileDirectory inputDir = fs_->mkdir(addn("TrackCands").Data()); + + bool TMTT = (tName == "HT" || tName == "RZ"); + + // Count tracks in various ways (including/excluding duplicates, excluding fakes ...) + profNumTrackCands_[tName] = inputDir.make(addn("NumTrackCands"),"; class; N. of tracks in tracker",7,0.5,7.5); + profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(7,"TP for eff recoed"); + profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(6,"TP recoed"); + profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(5,"TP recoed x #eta sector dups"); + profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(4,"TP recoed x sector dups"); + profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(2,"TP recoed x track dups"); + profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(1,"reco tracks including fakes"); + profNumTrackCands_[tName]->LabelsOption("d"); + + unsigned int nPhi = numPhiSectors_; + unsigned int nEta = numEtaRegions_; + float maxAbsQoverPt = 1./houghMinPt_; // Max. |q/Pt| covered by HT array. + hisNumTracksVsQoverPt_[tName] = inputDir.make(addn("NumTracksVsQoverPt"),"; Q/Pt; No. of tracks in tracker",100, -maxAbsQoverPt, maxAbsQoverPt); + hisNumTrksPerNon_[tName] = inputDir.make(addn("NumTrksPerNon"), "; No. tracks per nonant;",200,-0.5,199.5); + if (TMTT) { + profNumTracksVsEta_[tName] = inputDir.make(addn("NumTracksVsEta"),"; #eta region; No. of tracks in tracker", nEta, -0.5, nEta - 0.5); + hisNumTrksPerSect_[tName] = inputDir.make(addn("NumTrksPerSect"),"; No. tracks per sector;",100,-0.5,99.5); + } + + // Count stubs per event assigned to tracks (determines HT data output rate) + + profStubsOnTracks_[tName] = inputDir.make(addn("StubsOnTracks"),"; ; No. of stubs on tracks per event",1,0.5,1.5); + hisStubsOnTracksPerNon_[tName] = inputDir.make(addn("StubsOnTracksPerNon"),"; No. of stubs on tracks per nonant", 1000,-0.5,999.5); + hisUniqueStubsOnTrksPerNon_[tName] = inputDir.make(addn("UniqueStubsOnTrksPerNon"),"; No. of unique stubs on tracks per nonant", 500,-0.5,499.5); + if (TMTT) { + profStubsOnTracksVsEta_[tName] = inputDir.make(addn("StubsOnTracksVsEta"),"; #eta region; No. of stubs on tracks per event", nEta, -0.5, nEta - 0.5); + hisStubsOnTracksPerSect_[tName] = inputDir.make(addn("StubsOnTracksPerSect"),"; No. of stubs on tracks per sector", 500,-0.5,499.5); + hisUniqueStubsOnTrksPerSect_[tName] = inputDir.make(addn("UniqueStubsOnTrksPerSect"),"; No. of unique stubs on tracks per sector", 500,-0.5,499.5); + } + + hisStubsPerTrack_[tName] = inputDir.make(addn("StubsPerTrack"),";No. of stubs per track;",50,-0.5,49.5); + hisLayersPerTrack_[tName] = inputDir.make(addn("LayersPerTrack"),";No. of layers with stubs per track;",20,-0.5,19.5); + hisPSLayersPerTrack_[tName] = inputDir.make(addn("PSLayersPerTrack"),";No. of PS layers with stubs per track;",20,-0.5,19.5); + hisLayersPerTrueTrack_[tName] = inputDir.make(addn("LayersPerTrueTrack"),";No. of layers with stubs per genuine track;",20,-0.5,19.5); + hisPSLayersPerTrueTrack_[tName] = inputDir.make(addn("PSLayersPerTrueTrack"),";No. of PS layers with stubs per genuine track;",20,-0.5,19.5); + + if (TMTT) { + hisNumStubsPerLink_[tName] = inputDir.make(addn("NumStubsPerLink"), "; Mean #stubs per MHT output opto-link;", 50,-0.5,199.5); + hisNumStubsVsLink_[tName] = inputDir.make(addn("NumStubsVsLink"), "; MHT output opto-link; No. stubs/event", 36, -0.5, 35.5, 20,-0.5,199.5); + profMeanStubsPerLink_[tName] = inputDir.make(addn("MeanStubsPerLink"), "; Mean #stubs per MHT output opto-link;", 36,-0.5,35.5); + hisNumTrksPerLink_[tName] = inputDir.make(addn("NumTrksPerLink"), "; Mean #tracks per MHT output opto-link;", 50,-0.5,49.5); + hisNumTrksVsLink_[tName] = inputDir.make(addn("NumTrksVsLink"), "; MHT output opto-link; No. tracks/event", 72, -0.5, 71.5, 20,-0.5,49.5); + profMeanTrksPerLink_[tName] = inputDir.make(addn("MeanTrksPerLink"), "; Mean #tracks per MHT output opto-link;", 36,-0.5,35.5); + } + + if (TMTT) { + // Checks if tracks have too many stubs to be stored in memory in each cell. + profExcessStubsPerTrackVsPt_[tName] = inputDir.make(addn("ExcessStubsPerTrackVsPt"),";q/Pt; Prob. of too many stubs per track",16,0.,maxAbsQoverPt); + } + + hisFracMatchStubsOnTracks_[tName] = inputDir.make(addn("FracMatchStubsOnTracks"),"; Fraction of stubs on tracks matching best TP;",101,-0.005,1.005); + + profFracTrueStubsVsLayer_[tName] = inputDir.make(addn("FracTrueStubsVsLayer"),";Layer ID; fraction of true stubs",30,0.5,30.5); + + // Check how much stub bend differs from predicted one. + hisDeltaBendTrue_[tName] = inputDir.make(addn("DeltaBendTrue"),"True stubs; stub bend minus true bend / resolution;",100,-2.,2.); + hisDeltaBendFake_[tName] = inputDir.make(addn("DeltaBendFake"),"Fake stubs; stub bend minus true bend / resolution;",100,-2.,2.); + + if (TMTT) { + // Study duplication of tracks within HT. + profDupTracksVsEta_[tName] = inputDir.make(addn("DupTracksVsTPeta"), "; #eta; No. of duplicate tracks per TP in individual HT array;",15,0.0,3.0); + profDupTracksVsInvPt_[tName] = inputDir.make(addn("DupTracksVsInvPt"), "; 1/Pt; No. of duplicate tracks per TP",16,0.,maxAbsQoverPt); + } + + // Histos of track params. + hisQoverPt_[tName] = inputDir.make(addn("QoverPt"),"; track q/Pt", 100,-0.5,0.5); + hisPhi0_[tName] = inputDir.make(addn("Phi0"), "; track #phi0",70,-3.5,3.5); + hisEta_[tName] = inputDir.make(addn("Eta"), "; track #eta", 70,-3.5,3.5); + hisZ0_[tName] = inputDir.make(addn("Z0"), "; track z0", 100,-25.0,25.0); + + // Histos of track parameter resolution + hisQoverPtRes_[tName] = inputDir.make(addn("QoverPtRes"),"; track resolution in q/Pt", 100,-0.06,0.06); + hisPhi0Res_[tName] = inputDir.make(addn("Phi0Res"), "; track resolution in #phi0",100,-0.04,0.04); + hisEtaRes_[tName] = inputDir.make(addn("EtaRes"), "; track resolution in #eta", 100,-1.0,1.0); + hisZ0Res_[tName] = inputDir.make(addn("Z0Res"), "; track resolution in z0", 100,-10.0,10.0); + + hisRecoVsTrueQinvPt_[tName] = inputDir.make(addn("RecoVsTrueQinvPt"), "; TP q/p_{T}; Reco q/p_{T} (good #chi^{2})", 60, -0.6, 0.6, 240, -0.6, 0.6 ); + hisRecoVsTruePhi0_[tName] = inputDir.make(addn("RecoVsTruePhi0"), "; TP #phi_{0}; Reco #phi_{0} (good #chi^{2})", 70, -3.5, 3.5, 280, -3.5, 3.5 ); + hisRecoVsTrueD0_[tName] = inputDir.make(addn("RecoVsTrueD0"), "; TP d_{0}; Reco d_{0} (good #chi^{2})", 100, -2., 2., 100, -2., 2. ); + hisRecoVsTrueZ0_[tName] = inputDir.make(addn("RecoVsTrueZ0"), "; TP z_{0}; Reco z_{0} (good #chi^{2})" , 100, -25., 25., 100, -25., 25. ); + hisRecoVsTrueEta_[tName] = inputDir.make(addn("RecoVsTrueEta"), "; TP #eta; Reco #eta (good #chi^{2})", 70, -3.5, 3.5, 70, -3.5, 3.5 ); + + // Histos for tracking efficiency vs. TP kinematics + hisRecoTPinvptForEff_[tName] = inputDir.make(addn("RecoTPinvptForEff"), "; 1/Pt of TP (used for effi. measurement);",24,0.,1.5*maxAbsQoverPt); + hisRecoTPptForEff_[tName] = inputDir.make(addn("RecoTPptForEff"), "; Pt of TP (used for effi. measurement);",25,0.0,100.0); + hisRecoTPetaForEff_[tName] = inputDir.make(addn("RecoTPetaForEff"),"; #eta of TP (used for effi. measurement);",20,-3.,3.); + hisRecoTPphiForEff_[tName] = inputDir.make(addn("RecoTPphiForEff"),"; #phi of TP (used for effi. measurement);",20,-M_PI,M_PI); + + // Histo for efficiency to reconstruct track perfectly (no incorrect hits). + hisPerfRecoTPinvptForEff_[tName] = inputDir.make(addn("PerfRecoTPinvptForEff"), "; 1/Pt of TP (used for perf. effi. measurement);",24,0.,1.5*maxAbsQoverPt); + hisPerfRecoTPptForEff_[tName] = inputDir.make(addn("PerfRecoTPptForEff"), "; Pt of TP (used for perf. effi. measurement);",25,0.0,100.0); + hisPerfRecoTPetaForEff_[tName] = inputDir.make(addn("PerfRecoTPetaForEff"),"; #eta of TP (used for perf. effi. measurement);",20,-3.,3.); + + // Histos for tracking efficiency vs. TP production point + hisRecoTPd0ForEff_[tName] = inputDir.make(addn("RecoTPd0ForEff"), "; d0 of TP (used for effi. measurement);",40,0.,4.); + hisRecoTPz0ForEff_[tName] = inputDir.make(addn("RecoTPz0ForEff"), "; z0 of TP (used for effi. measurement);",50,0.,25.); + + // Histos for algorithmic tracking efficiency vs. TP kinematics + hisRecoTPinvptForAlgEff_[tName] = inputDir.make(addn("RecoTPinvptForAlgEff"), "; 1/Pt of TP (used for alg. effi. measurement);",24,0.,1.5*maxAbsQoverPt); + hisRecoTPptForAlgEff_[tName] = inputDir.make(addn("RecoTPptForAlgEff"), "; Pt of TP (used for alg. effi. measurement);",25,0.0,100.0); + hisRecoTPetaForAlgEff_[tName] = inputDir.make(addn("RecoTPetaForAlgEff"),"; #eta of TP (used for alg. effi. measurement);",20,-3.,3.); + hisRecoTPphiForAlgEff_[tName] = inputDir.make(addn("RecoTPphiForAlgEff"),"; #phi of TP (used for alg. effi. measurement);",20,-M_PI,M_PI); + + // Histos for algorithmic tracking efficiency in jets. + hisRecoTPinvptForAlgEff_inJetPtG30_[tName] = inputDir.make(addn("RecoTPinvptForAlgEff_inJetPtG30"), "; 1/Pt of TP (used for effi. measurement);",24,0.,1.5*maxAbsQoverPt); + hisRecoTPinvptForAlgEff_inJetPtG100_[tName] = inputDir.make(addn("RecoTPinvptForAlgEff_inJetPtG100"), "; 1/Pt of TP (used for effi. measurement);",24,0.,1.5*maxAbsQoverPt); + hisRecoTPinvptForAlgEff_inJetPtG200_[tName] = inputDir.make(addn("RecoTPinvptForAlgEff_inJetPtG200"), "; 1/Pt of TP (used for effi. measurement);",24,0.,1.5*maxAbsQoverPt); + + // Histo for efficiency to reconstruct track perfectly (no incorrect hits). + hisPerfRecoTPinvptForAlgEff_[tName] = inputDir.make(addn("PerfRecoTPinvptForAlgEff"), "; 1/Pt of TP (used for perf. alg. effi. measurement);",24,0.,1.5*maxAbsQoverPt); + hisPerfRecoTPptForAlgEff_[tName] = inputDir.make(addn("PerfRecoTPptForAlgEff"), "; Pt of TP (used for perf. alg. effi. measurement);",25,0.0,100.0); + hisPerfRecoTPetaForAlgEff_[tName] = inputDir.make(addn("PerfRecoTPetaForAlgEff"),"; #eta of TP (used for perf. alg. effi. measurement);",20,-3.,3.); + + // Histos for algorithmic tracking efficiency vs. TP production point + hisRecoTPd0ForAlgEff_[tName] = inputDir.make(addn("RecoTPd0ForAlgEff"), "; d0 of TP (used for alg. effi. measurement);",40,0.,4.); + hisRecoTPz0ForAlgEff_[tName] = inputDir.make(addn("RecoTPz0ForAlgEff"), "; z0 of TP (used for alg. effi. measurement);",50,0.,25.); + + // Histos for algorithmic tracking efficiency vs sector number (to check if looser cuts are needed in certain regions) + hisRecoTPphisecForAlgEff_[tName] = inputDir.make(addn("RecoTPphisecForAlgEff"), "; #phi sector of TP (used for alg. effi. measurement);",nPhi,-0.5,nPhi-0.5); + hisRecoTPetasecForAlgEff_[tName] = inputDir.make(addn("RecoTPetasecForAlgEff"), "; #eta sector of TP (used for alg. effi. measurement);",nEta,-0.5,nEta-0.5); + + // Histo for efficiency to reconstruct tracks perfectly (no incorrect hits). + hisPerfRecoTPphisecForAlgEff_[tName] = inputDir.make(addn("PerfRecoTPphisecForAlgEff"), "; #phi sector of TP (used for perf. alg. effi. measurement);",nPhi,-0.5,nPhi-0.5); + hisPerfRecoTPetasecForAlgEff_[tName] = inputDir.make(addn("PerfRecoTPetasecForAlgEff"), "; #eta sector of TP (used for perf. alg. effi. measurement);",nEta,-0.5,nEta-0.5); + + if (TMTT) { + // For those tracking particles causing the algorithmic efficiency to be below 100%, plot a flag indicating why. + hisRecoFailureReason_[tName] = inputDir.make(addn("RecoFailureReason"),"; Reason TP (used for alg. effi.) not reconstructed;",1,-0.5,0.5); + //hisRecoFailureLayer_[tName] = inputDir.make(addn("RecoFailureLayer"),"; Layer ID of lost stubs on unreconstructed TP;",30,-0.5,29.5); + } + + //hisWrongSignStubRZ_pBend_[tName] = inputDir.make(addn("WrongSignStubRZ_pBend"),"RZ of stubs with positive bend, but with wrong sign; z (cm); radius (cm); No. stubs in tracker",100,-280,280,100,0,130); + //hisWrongSignStubRZ_nBend_[tName] = inputDir.make(addn("WrongSignStubRZ_nBend"),"RZ of stubs with negative bend, but with wrong sign; z (cm); radius (cm); No. stubs in tracker",100,-280,280,100,0,130); + + hisNumStubsOnLayer_[tName] = inputDir.make(addn("NumStubsOnLayer"),"; Layer occupancy;",16,1,17); + + return inputDir; +} + +//=== Fill histograms studying track candidates found before track fit is run. + +void Histos::fillTrackCands(const InputData& inputData, const vector& tracks, string tName) { + + bool withRZfilter = (tName == "RZ"); + + bool TMTT = (tName == "HT" || tName == "RZ"); + + // Now fill histograms for studying tracking in general. + + const vector& vTPs = inputData.getTPs(); + + // Debug histogram for LR track fitter. + for (const L1track3D& t : tracks) { + const std::vector< const Stub* > stubs = t.getStubs(); + std::map< unsigned int, unsigned int > layerMap; + for ( auto s : stubs ) + layerMap[ s->layerIdReduced() ]++; + for ( auto l : layerMap ) + hisNumStubsOnLayer_[tName]->Fill( l.second ); + } + + //=== Count track candidates found in the tracker. + + const unsigned int numPhiNonants = settings_->numPhiNonants();; + matrix nTrksPerSec(numPhiSectors_, numEtaRegions_, 0); + vector nTrksPerEtaReg(numEtaRegions_, 0); + vector nTrksPerNonant(numPhiNonants, 0); + for (const L1track3D& t : tracks) { + unsigned int iNonant = floor((t.iPhiSec())*numPhiNonants/(numPhiSectors_)); // phi nonant number + nTrksPerSec(t.iPhiSec(), t.iEtaReg())++; + nTrksPerEtaReg[t.iEtaReg()]++; + nTrksPerNonant[iNonant]++; + } + + profNumTrackCands_[tName]->Fill(1.0, tracks.size()); // Plot mean number of tracks/event. + if (TMTT) { + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + hisNumTrksPerSect_[tName]->Fill(nTrksPerSec(iPhiSec, iEtaReg)); + } + profNumTracksVsEta_[tName]->Fill(iEtaReg, nTrksPerEtaReg[iEtaReg]); + } + } + for (unsigned int iNonant = 0; iNonant < numPhiNonants; iNonant++) { + hisNumTrksPerNon_[tName]->Fill(nTrksPerNonant[iNonant]); + } + + //=== Count stubs per event assigned to track candidates in the Tracker + + unsigned int nStubsOnTracks = 0; + matrix nStubsOnTracksInSec(numPhiSectors_,numEtaRegions_,0); + vector nStubsOnTracksInEtaReg(numEtaRegions_, 0); + vector nStubsOnTracksInNonant(numPhiNonants, 0); + map< pair, set > uniqueStubsOnTracksInSect; + map< unsigned int, set > uniqueStubsOnTracksInNonant; + + matrix nStubsOnTrksInSec(numPhiSectors_, numEtaRegions_, 0); + for (const L1track3D& t : tracks) { + const vector& stubs = t.getStubs(); + unsigned int nStubs = stubs.size(); + unsigned int iNonant = floor((t.iPhiSec())*numPhiNonants/(numPhiSectors_)); // phi nonant number + // Count stubs on all tracks in this sector & nonant. + nStubsOnTracks+= nStubs; + nStubsOnTrksInSec(t.iPhiSec(), t.iEtaReg()) += nStubs; + nStubsOnTracksInEtaReg[t.iEtaReg()] += nStubs; + nStubsOnTracksInNonant[iNonant] += nStubs; + // Note unique stubs in sector & nonant. + uniqueStubsOnTracksInSect[pair(t.iPhiSec(), t.iEtaReg())].insert(stubs.begin(), stubs.end()); + uniqueStubsOnTracksInNonant[iNonant].insert(stubs.begin(), stubs.end()); + } + + profStubsOnTracks_[tName]->Fill(1.0, nStubsOnTracks); + if (TMTT) { + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + hisStubsOnTracksPerSect_[tName]->Fill(nStubsOnTrksInSec(iPhiSec, iEtaReg)); + // Plot number of stubs assigned to tracks per sector, never counting each individual stub more than once. + hisUniqueStubsOnTrksPerSect_[tName]->Fill(uniqueStubsOnTracksInSect[pair(iPhiSec, iEtaReg)].size()); + } + profStubsOnTracksVsEta_[tName]->Fill(iEtaReg, nStubsOnTracksInEtaReg[iEtaReg]); + } + } + for (unsigned int iNonant = 0; iNonant < numPhiNonants; iNonant++) { + hisStubsOnTracksPerNon_[tName]->Fill(nStubsOnTracksInNonant[iNonant]); + // Plot number of stubs assigned to tracks per nonant, never counting each individual stub more than once. + hisUniqueStubsOnTrksPerNon_[tName]->Fill(uniqueStubsOnTracksInNonant[iNonant].size()); + } + + // Plot number of tracks & number of stubs per output HT opto-link. + + if (TMTT && not withRZfilter) { + static bool firstMess = true; + const unsigned int numPhiSecPerNon = numPhiSectors_/numPhiNonants; + // Hard-wired bodge + const unsigned int nLinks = houghNbinsPt_/2; // Hard-wired to number of course HT bins. Check. + + for (unsigned int iPhiNon = 0; iPhiNon < numPhiNonants; iPhiNon++) { + // Each nonant has a separate set of links. + vector stubsToLinkCount(nLinks, 0); // Must use vectors to count links with zero entries. + vector trksToLinkCount(nLinks, 0); + for (const L1track3D& trk : tracks) { + unsigned int iNonantTrk = floor((trk.iPhiSec())*numPhiNonants/(numPhiSectors_)); // phi nonant number + if (iPhiNon == iNonantTrk) { + unsigned int link = trk.optoLinkID(); + if (link < nLinks) { + stubsToLinkCount[link] += trk.getNumStubs(); + trksToLinkCount[link] += 1; + } else if (firstMess) { + firstMess = false; + cout<Fill(nstbs); + hisNumStubsVsLink_[tName]->Fill(link, nstbs); + profMeanStubsPerLink_[tName]->Fill(link, nstbs); + } + + for (unsigned int link = 0; link < nLinks; link++) { + unsigned int ntrks = trksToLinkCount[link]; + hisNumTrksPerLink_[tName]->Fill(ntrks); + hisNumTrksVsLink_[tName]->Fill(link, ntrks); + profMeanTrksPerLink_[tName]->Fill(link, ntrks); + } + } + } + + + // Plot q/pt spectrum of track candidates, and number of stubs/tracks + for (const L1track3D& trk : tracks) { + hisNumTracksVsQoverPt_[tName]->Fill(trk.qOverPt()); // Plot reconstructed q/Pt of track cands. + hisStubsPerTrack_[tName]->Fill(trk.getNumStubs()); // Stubs per track. + const TP* tp = trk.getMatchedTP(); + if (TMTT) { + // For genuine tracks, check how often they have too many stubs to be stored in cell memory. (Perhaps worse for high Pt particles in jets?). + if (tp != nullptr) { + if (tp->useForAlgEff()) profExcessStubsPerTrackVsPt_[tName]->Fill(1./tp->pt(), trk.getNumStubs() > 16); + } + } + hisLayersPerTrack_[tName]->Fill(trk.getNumLayers()); // Number of reduced layers with stubs per track. + hisPSLayersPerTrack_[tName]->Fill( Utility::countLayers(settings_, trk.getStubs(), false, true) ); // Number of reduced PS layers with stubs per track. + // Also plot just for genuine tracks. + if (tp != nullptr && tp->useForAlgEff()) { + hisLayersPerTrueTrack_[tName]->Fill(trk.getNumLayers()); // Number of reduced layers with stubs per track. + hisPSLayersPerTrueTrack_[tName]->Fill( Utility::countLayers(settings_, trk.getStubs(), false, true) ); // Number of reduced PS layers with stubs per track. + } + } + + // Count fraction of stubs on each track matched to a TP that are from same TP. + + for (const L1track3D& trk : tracks) { + // Only consider tracks that match a tracking particle used for the alg. efficiency measurement. + const TP* tp = trk.getMatchedTP(); + if (tp != nullptr) { + if (tp->useForAlgEff()) { + hisFracMatchStubsOnTracks_[tName]->Fill( trk.getPurity() ); + + const vector stubs = trk.getStubs(); + for (const Stub* s : stubs) { + // Was this stub produced by correct truth particle? + const set stubTPs = s->assocTPs(); + bool trueStub = (stubTPs.find(tp) != stubTPs.end()); + + // Fraction of wrong stubs vs. tracker layer. + profFracTrueStubsVsLayer_[tName]->Fill(s->layerId(), trueStub); + + // Check how much stub bend differs from predicted one, relative to nominal bend resolution. + float diffBend = (s->qOverPt() - trk.qOverPt()) / s->qOverPtOverBend(); + if (trueStub) { + hisDeltaBendTrue_[tName]->Fill(diffBend/s->bendRes()); + } else { + hisDeltaBendFake_[tName]->Fill(diffBend/s->bendRes()); + } + + // Debug printout to understand for matched tracks, how far stubs lie from true particle trajectory + // Only prints for tracks with huge number of stubs, to also understand why these tracks exist. + //if (trk.getNumStubs() > 20) { + /* + if (trk.pt() > 20) { + cout<<"--- Checking how far stubs on matched tracks lie from true particle trajectory. ---"<pt()<<" "<d0()<sigmaPerp(); + float sigRorZ = deltaRorZ/s->sigmaPar(); + string ohoh = (fabs(sigPhiR) > 5 || fabs(sigRorZ) > 5) ? "FAR" : "NEAR"; + if (trueStub) { + cout<<" Real stub "<phi()<<" "<eta()<<" bend="<bend()<<" iphi="<iphi()<minPhi()<<" "<minZ()< matchedTrks; + for (const L1track3D& trk : tracks) { + const TP* tpAssoc = trk.getMatchedTP(); + if (tpAssoc != nullptr) { + if (tpAssoc->index() == tp.index()) matchedTrks.push_back(&trk); + } + } + unsigned int nTrk = matchedTrks.size(); + + bool tpRecoed = false; + + if (nTrk > 0) { + tpRecoed = true; // This TP was reconstructed at least once in tracker. + nTrksMatchingTPs += nTrk; // Increment sum by no. of tracks this TP was reconstructed as + + set iEtaRegRecoed; + for (const L1track3D* trk : matchedTrks) iEtaRegRecoed.insert(trk->iEtaReg()); + nEtaSecsMatchingTPs = iEtaRegRecoed.size(); + + set< pair > iSecRecoed; + for (const L1track3D* trk : matchedTrks) iSecRecoed.insert({trk->iPhiSec(), trk->iEtaReg()}); + nSecsMatchingTPs = iSecRecoed.size(); + + + if (TMTT) { + for (const auto& p : iSecRecoed) { + unsigned int nTrkInSec = 0; + for (const L1track3D* trk : matchedTrks) { + if (trk->iPhiSec() == p.first && trk->iEtaReg() == p.second) nTrkInSec++; + } + if (nTrkInSec > 0) { + profDupTracksVsEta_[tName]->Fill(fabs(tp.eta()), nTrkInSec - 1); // Study duplication of tracks within an individual HT array. + profDupTracksVsInvPt_[tName]->Fill(fabs(tp.qOverPt()), nTrkInSec - 1); // Study duplication of tracks within an individual HT array. + } + } + } + } + + if (tpRecoed) { + // Increment sum each time a TP is reconstructed at least once inside Tracker + if (tp.useForEff()) nRecoedTPsForEff++; + nRecoedTPs++; + } + } + + //--- Plot mean number of tracks/event, counting number due to different kinds of duplicates + + // Plot number of TPs used for the efficiency measurement that are reconstructed. + profNumTrackCands_[tName]->Fill(7.0, nRecoedTPsForEff); + // Plot number of TPs that are reconstructed. + profNumTrackCands_[tName]->Fill(6.0, nRecoedTPs); + // Plot number of TPs that are reconstructed. Count +1 for each eta sector they are reconstructed in. + profNumTrackCands_[tName]->Fill(5.0, nEtaSecsMatchingTPs); + // Plot number of TPs that are reconstructed. Count +1 for each (eta,phi) sector they are reconstructed in. + profNumTrackCands_[tName]->Fill(4.0, nSecsMatchingTPs); + // Plot number of TP that are reconstructed. Count +1 for each track they are reconstructed as. + profNumTrackCands_[tName]->Fill(2.0, nTrksMatchingTPs); + + // Histos of track helix params. + for (const L1track3D& trk : tracks) { + hisQoverPt_[tName]->Fill(trk.qOverPt()); + hisPhi0_[tName]->Fill(trk.phi0()); + hisEta_[tName]->Fill(trk.eta()); + hisZ0_[tName]->Fill(trk.z0()); + } + + // Histos of track parameter resolution + + for (const TP& tp: vTPs) { + + if ((resPlotOpt_ && tp.useForAlgEff()) || (not resPlotOpt_)) { // Check TP is good for efficiency measurement (& also comes from signal event if requested) + + // For each tracking particle, find the corresponding reconstructed track(s). + for (const L1track3D& trk : tracks) { + const TP* tpAssoc = trk.getMatchedTP(); + if (tpAssoc != nullptr) { + if (tpAssoc->index() == tp.index()) { + hisQoverPtRes_[tName]->Fill(trk.qOverPt() - tp.qOverPt()); + hisPhi0Res_[tName]->Fill(reco::deltaPhi(trk.phi0(), tp.phi0())); + hisEtaRes_[tName]->Fill(trk.eta() - tp.eta()); + hisZ0Res_[tName]->Fill(trk.z0() - tp.z0()); + + hisRecoVsTrueQinvPt_[tName]->Fill( tp.qOverPt(), trk.qOverPt() ); + hisRecoVsTruePhi0_[tName]->Fill( tp.phi0(), trk.phi0( )); + hisRecoVsTrueD0_[tName]->Fill( tp.d0(), trk.d0() ); + hisRecoVsTrueZ0_[tName]->Fill( tp.z0(), trk.z0() ); + hisRecoVsTrueEta_[tName]->Fill( tp.eta(), trk.eta() ); + } + } + } + } + } + + //=== Study tracking efficiency by looping over tracking particles. + + for (const TP& tp: vTPs) { + + if (tp.useForEff()) { // Check TP is good for efficiency measurement. + + // Check which eta and phi sectors this TP is in. + int iPhiSec_TP = -1; + int iEtaReg_TP = -1; + Sector sectorTmp; + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + sectorTmp.init(settings_, iPhiSec, 0); + if (sectorTmp.insidePhiSec(tp)) iPhiSec_TP = iPhiSec; + } + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + sectorTmp.init(settings_, 0, iEtaReg); + if (sectorTmp.insideEtaReg(tp)) iEtaReg_TP = iEtaReg; + } + + // Check if this TP was reconstructed anywhere in the tracker.. + bool tpRecoed = false; + bool tpRecoedPerfect = false; + for (const L1track3D& trk : tracks) { + const TP* tpAssoc = trk.getMatchedTP(); + if (tpAssoc != nullptr) { + if (tpAssoc->index() == tp.index()) { + tpRecoed = true; + if (trk.getPurity() == 1.) tpRecoedPerfect = true; + } + } + } + + // If TP was reconstucted by HT, then plot its kinematics. + if (tpRecoed) { + hisRecoTPinvptForEff_[tName]->Fill(1./tp.pt()); + hisRecoTPptForEff_[tName]->Fill(tp.pt()); + hisRecoTPetaForEff_[tName]->Fill(tp.eta()); + hisRecoTPphiForEff_[tName]->Fill(tp.phi0()); + // Plot also production point of all good reconstructed TP. + hisRecoTPd0ForEff_[tName]->Fill(fabs(tp.d0())); + hisRecoTPz0ForEff_[tName]->Fill(fabs(tp.z0())); + // Also plot efficiency to perfectly reconstruct the track (no fake hits) + if (tpRecoedPerfect) { + hisPerfRecoTPinvptForEff_[tName]->Fill(1./tp.pt()); + hisPerfRecoTPptForEff_[tName]->Fill(tp.pt()); + hisPerfRecoTPetaForEff_[tName]->Fill(tp.eta()); + } + if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. + hisRecoTPinvptForAlgEff_[tName]->Fill(1./tp.pt()); + hisRecoTPptForAlgEff_[tName]->Fill(tp.pt()); + hisRecoTPetaForAlgEff_[tName]->Fill(tp.eta()); + hisRecoTPphiForAlgEff_[tName]->Fill(tp.phi0()); + // Plot also production point of all good reconstructed TP. + hisRecoTPd0ForAlgEff_[tName]->Fill(fabs(tp.d0())); + hisRecoTPz0ForAlgEff_[tName]->Fill(fabs(tp.z0())); + // Plot sector number to understand if looser cuts are needed in certain eta regions. + hisRecoTPphisecForAlgEff_[tName]->Fill(iPhiSec_TP); + hisRecoTPetasecForAlgEff_[tName]->Fill(iEtaReg_TP); + + // Plot efficiency in jets + if ( tp.tpInJet() ) { + hisRecoTPinvptForAlgEff_inJetPtG30_[tName]->Fill(1./tp.pt()); + } + if ( tp.tpInHighPtJet() ) { + hisRecoTPinvptForAlgEff_inJetPtG100_[tName]->Fill(1./tp.pt()); + } + if ( tp.tpInVeryHighPtJet() ) { + hisRecoTPinvptForAlgEff_inJetPtG200_[tName]->Fill(1./tp.pt()); + } + + // Also plot efficiency to perfectly reconstruct the track (no fake hits) + if (tpRecoedPerfect) { + hisPerfRecoTPinvptForAlgEff_[tName]->Fill(1./tp.pt()); + hisPerfRecoTPptForAlgEff_[tName]->Fill(tp.pt()); + hisPerfRecoTPetaForAlgEff_[tName]->Fill(tp.eta()); + hisPerfRecoTPphisecForAlgEff_[tName]->Fill(iPhiSec_TP); + hisPerfRecoTPetasecForAlgEff_[tName]->Fill(iEtaReg_TP); + } + } + } + } + } + + if (TMTT) { + // Diagnose reason why not all viable tracking particles were reconstructed. + const map diagnosis = this->diagnoseTracking(inputData.getTPs(), tracks, withRZfilter); + for (const auto& iter: diagnosis) { + hisRecoFailureReason_[tName]->Fill(iter.second.c_str(), 1.); // Stores flag indicating failure reason. + } + } +} + +//=== Understand why not all tracking particles were reconstructed. +//=== Returns list of tracking particles that were not reconstructed and an string indicating why. +//=== Only considers TP used for algorithmic efficiency measurement. + +// (If string = "mystery", reason for loss unknown. This may be a result of reconstruction of one +// track candidate preventing reconstruction of another. e.g. Due to duplicate track removal). + +map Histos::diagnoseTracking(const vector& allTPs, const vector& tracks, + bool withRZfilter) const +{ + map diagnosis; + + for (const TP& tp: allTPs) { + + string recoFlag = "unknown"; + + if ( tp.useForAlgEff()) { //--- Only consider TP that are reconstructable. + + //--- Check if this TP was reconstructed anywhere in the tracker.. + bool tpRecoed = false; + for (const L1track3D& trk : tracks) { + const TP* tpAssoc = trk.getMatchedTP(); + if (tpAssoc != nullptr) { + if (tpAssoc->index() == tp.index()) tpRecoed = true; + } + } + + if ( tpRecoed) { + + recoFlag = "success"; // successfully reconstructed so don't bother studying. + + } else { + + //--- Check if TP was still reconstructable after cuts applied to stubs by front-end electronics. + vector fePassStubs; + for (const Stub* s : tp.assocStubs()) { + if (s->frontendPass()) fePassStubs.push_back(s); + } + bool fePass = ( Utility::countLayers(settings_, fePassStubs) >= genMinStubLayers_ ); + + if ( ! fePass) { + + recoFlag = "FE electronics"; // Tracking failed because of front-end electronics cuts. + + } else { + + //--- Check if assignment to (eta,phi) sectors prevented this TP being reconstruted. + bool insideSecPass = false; + bool insidePhiSecPass = false; + bool insideEtaRegPass = false; + unsigned int nLayers = 0; + // The next to variables are vectors in case track could be recontructed in more than one sector. + vector< vector > insideSecStubs; + vector sectorBest; + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + + Sector sectorTmp; + sectorTmp.init(settings_, iPhiSec, iEtaReg); + + // Get stubs on given tracking particle which are inside this (phi,eta) sector; + vector insideSecStubsTmp; + vector insidePhiSecStubsTmp; + vector insideEtaRegStubsTmp; + for (const Stub* s: fePassStubs) { + if (sectorTmp.inside(s)) insideSecStubsTmp.push_back(s); + if (sectorTmp.insidePhi(s)) insidePhiSecStubsTmp.push_back(s); + if (sectorTmp.insideEta(s)) insideEtaRegStubsTmp.push_back(s); + } + // Check if TP could be reconstructed in this (phi,eta) sector. + unsigned int nLayersTmp = Utility::countLayers(settings_, insideSecStubsTmp); + if ( nLayersTmp >= genMinStubLayers_ ) { + insideSecPass = true; + if (nLayers <= nLayersTmp) { + if (nLayers < nLayersTmp) { + nLayers = nLayersTmp; + insideSecStubs.clear(); + sectorBest.clear(); + } + insideSecStubs.push_back( insideSecStubsTmp ); + sectorBest.push_back( sectorTmp ); + } + } + // Check if TP could be reconstructed in this (phi) sector. + unsigned int nLayersPhiTmp = Utility::countLayers(settings_, insidePhiSecStubsTmp); + if ( nLayersPhiTmp >= genMinStubLayers_ ) insidePhiSecPass = true; + // Check if TP could be reconstructed in this (eta) region. + unsigned int nLayersEtaTmp = Utility::countLayers(settings_, insideEtaRegStubsTmp); + if ( nLayersEtaTmp >= genMinStubLayers_ ) insideEtaRegPass = true; + } + } + + if ( ! insideSecPass) { + + // Tracking failed because of stub to sector assignment. + if ( ! insideEtaRegPass) { + recoFlag = "#eta sector"; // failed because of stub assignment to eta region. + } else if ( ! insidePhiSecPass) { + recoFlag = "#phi sector"; // failed because of stub assignment to phi sector. + } else { + recoFlag = "sector"; // failed because of stub assignment to (eta,phi) sector. + } + + } else { + + //--- Check if TP was reconstructed by r-phi Hough transform with its bend filted turned off. + + // Consider all sectors in which the track might be reconstructed. + bool rphiHTunfilteredPass = false; + for (unsigned int iSec = 0; iSec < sectorBest.size(); iSec++) { + const Sector& secBest = sectorBest[iSec]; + HTrphi htRphiUnfiltered; + htRphiUnfiltered.init(settings_, secBest.iPhiSec(), secBest.iEtaReg(), + secBest.etaMin(), secBest.etaMax(), secBest.phiCentre()); + htRphiUnfiltered.disableBendFilter(); // Switch off bend filter + for (const Stub* s: insideSecStubs[iSec]) { + // Check which eta subsectors within the sector the stub is compatible with (if subsectors being used). + const vector inEtaSubSecs = secBest.insideEtaSubSecs( s ); + htRphiUnfiltered.store(s, inEtaSubSecs); + } + htRphiUnfiltered.end(); + // Check if r-phi HT with its filters switched off found the track + if (htRphiUnfiltered.numTrackCands2D() > 0) rphiHTunfilteredPass = true; + } + + if ( ! rphiHTunfilteredPass ) { + + recoFlag = "r-#phi HT UNfiltered"; // Tracking failed r-phi HT even with its bend filter turned off. + + } else { + + //--- Check if TP was reconstructed by filtered r-phi HT. + + // Consider all sectors in which the track might be reconstructed. + bool rphiHTpass = false; + bool rzFilterPass = false; + for (unsigned int iSec = 0; iSec < sectorBest.size(); iSec++) { + const Sector& secBest = sectorBest[iSec]; + HTrphi htRphiTmp; + htRphiTmp.init(settings_, secBest.iPhiSec(), secBest.iEtaReg(), + secBest.etaMin(), secBest.etaMax(), secBest.phiCentre()); + for (const Stub* s: insideSecStubs[iSec]) { + // Check which eta subsectors within the sector the stub is compatible with (if subsectors being used). + const vector inEtaSubSecs = secBest.insideEtaSubSecs( s ); + htRphiTmp.store(s, inEtaSubSecs); + } + htRphiTmp.end(); + + // Check if r-phi HT found the track + if (htRphiTmp.numTrackCands2D() > 0) rphiHTpass = true; + // Check if track r-z filters run after r-phi HT kept track. + if (rphiHTpass) { + // Do so by getting tracks found by r-phi HT and running them through r-z filter. + const vector& trksRphi = htRphiTmp.trackCands2D(); + + // Initialize utility for making 3D tracks from 2S ones. + Get3Dtracks get3DtrkTmp; + get3DtrkTmp.init(settings_, secBest.iPhiSec(), secBest.iEtaReg(), + secBest.etaMin(), secBest.etaMax(), secBest.phiCentre()); + // Convert 2D tracks found by HT to 3D tracks (optionally by running r-z filters & duplicate track removal) + get3DtrkTmp.run(trksRphi); + if (get3DtrkTmp.trackCands3D(withRZfilter).size() > 0) rzFilterPass = true; + } + } + + if ( ! rphiHTpass) { + + recoFlag = "r-#phi HT BENDfiltered"; // Tracking failed r-phi HT with its bend filter on. + + //--- Debug printout to understand stubs failing bend filter. + + + // cout<<"TRACK FAILING BEND FILTER: pt="<bend(); + // float bendRes = s->bendRes(); + // float theory = tp.qOverPt()/s->qOverPtOverBend(); + // cout<<" BEND: measured="<z() << " " << s->layerId()<<" PS="<psModule()<<" Barrel="<barrel() << endl; + + // if (fabs(bend - theory) > bendRes) { + // bool cluster0_OK = false; + // if (s->genuineCluster()[0]) cluster0_OK = (s->assocTPofCluster()[0]->index() == tp.index()); + // bool cluster1_OK = false; + // if (s->genuineCluster()[1]) cluster1_OK = (s->assocTPofCluster()[1]->index() == tp.index()); + // cout<< " STUB FAILED: layer="<layerId()<<" PS="<psModule()<<" clusters match="<bend() << " " << s->stripPitch() << " " << s->stripPitch() / s->pitchOverSep() << " " << s->dphiOverBend() << " " << s->dphi() << std::endl; + // cout << "Min R, Z : " << s->minR() << " " << s->minZ() << std::endl; + + // if ( fabs( bend * -1.0 - theory ) > bendRes ) { + // okIfBendMinus1 = false; + // } + // else { + // if ( bend > 0 ) hisWrongSignStubRZ_pBend_->Fill( s->z(), s->r() ); + // else if ( bend < 0 ) hisWrongSignStubRZ_nBend_->Fill( s->z(), s->r() ); + // } + // } + // } + // } + + // if ( okIfBendMinus1 ) { + // recoFlag = "BEND WRONG SIGN"; // Tracking failed r-phi HT with its bend filter on, but would have passed if bend of stubs had opposite sign. + // } + + + } else { + + + if ( ! rzFilterPass) { + + recoFlag = "r-z filter"; // Tracking failed r-z filter. + + } else { + + recoFlag = "mystery"; // Mystery: logically this tracking particle should have been reconstructed. This may be a result of a duplicate track removal algorithm (or something else where finding one track candidate prevents another being found). + } + } + } + } + } + diagnosis[&tp] = recoFlag; + } + } + } + return diagnosis; +} + +//=== Book histograms studying freak, large events with too many stubs. + +TFileDirectory Histos::bookStudyBusyEvents() { + + TFileDirectory inputDir = fs_->mkdir("BusyEvents"); + + // Look at (eta, phi) sectors with too many input stubs or too many output (= assigned to tracks) stubs. + + unsigned int nEta = numEtaRegions_; + + hisNumBusySecsInPerEvent_ = inputDir.make("NumBusySecsInPerEvent" ,"; No. sectors with too many input stubs/event" , 20, -0.5, 19.5); + hisNumBusySecsOutPerEvent_ = inputDir.make("NumBusySecsOutPerEvent","; No. sectors with too many output stubs/event", 20, -0.5, 19.5); + profFracBusyInVsEtaReg_ = inputDir.make("FracBusyInVsEtaReg" ,"; #eta region; Frac. of sectors with too many input stubs" , nEta, -0.5, nEta-0.5); + profFracBusyOutVsEtaReg_ = inputDir.make("FracBusyOutVsEtaReg","; #eta region; Frac. of sectors with too many output stubs", nEta, -0.5, nEta-0.5); + profFracStubsKilledVsEtaReg_ = inputDir.make("FracStubsKilledInVsEtaReg" ,"; #eta region; Frac. of input stubs killed" , nEta, -0.5, nEta-0.5); + profFracTracksKilledVsEtaReg_ = inputDir.make("FracTracksKilledInVsEtaReg" ,"; #eta region; Frac. of track killed" , nEta, -0.5, nEta-0.5); + profFracTracksKilledVsInvPt_ = inputDir.make("FracTracksKilledInVsInvPt" ,";1/Pt; Frac. of track killed" , 16, 0., 1./houghMinPt_); + profFracTPKilledVsEta_ = inputDir.make("FracTPKilledInVsEta" ,";#eta; Efficiency loss due to busy sectors" , 16, 0., settings_->maxStubEta()); + profFracTPKilledVsInvPt_ = inputDir.make("FracTPKilledInVsInvPt" ,";1/Pt; Efficiency loss due to busy sectors" , 16, 0., 1./houghMinPt_); + hisNumTPkilledBusySec_ = inputDir.make("NumTPkilledBusySec","; No. of TP killed in each busy sector",30,-0.5,29.5); + + // Compare properties of sectors with/without too many output stubs. + + const vector tnames = {"BusyOutSec", "QuietOutSec"}; + const vector enames = {" in busy output sector", " in quiet output sector"}; + for (unsigned int i = 0; i <= 1; i++) { + const string tn = tnames[i]; + const string en = enames[i]; + + hisNumInputStubs_[tn] = inputDir.make(("NumInputStubs"+(tn)).c_str(), ("; No. input stubs"+(en)).c_str(), 250, -0.5, 249.5); + hisQoverPtInputStubs_[tn] = inputDir.make(("QoverPtInputStubs"+(tn)).c_str(), ("; q/Pt of input stubs"+(en)).c_str(), 30, 0., 1./houghMinPt_); + hisNumOutputStubs_[tn] = inputDir.make(("NumOutputStubs"+(tn)).c_str(), ("; No. output stubs"+(en)).c_str(), 1000, -0.5, 999.5); + hisNumTracks_[tn] = inputDir.make(("NumTracks"+(tn)).c_str(), ("; No. tracks"+(en)).c_str(), 200, -0.5, 199.5); + hisNumStubsPerTrack_[tn] = inputDir.make(("NumStubsPerTrack"+(tn)).c_str(), ("; No. stubs/track"+(en)).c_str(), 50, -0.5, 49.5); + hisTrackQoverPt_[tn] = inputDir.make(("TrackQoverPt"+(tn)).c_str(), ("; Track q/pt"+(en)).c_str(), 30, 0., 1./houghMinPt_); + hisTrackPurity_[tn] = inputDir.make(("TrackPurity"+(tn)).c_str(), ("; Track purity"+(en)).c_str(), 102, -0.01, 1.01); + hisNumTPphysics_[tn] = inputDir.make(("NumTPphysics"+(tn)).c_str(), ("; No. physics TP"+(en)).c_str(), 30, -0.5, 29.5); + hisNumTPpileup_[tn] = inputDir.make(("NumTPpileup"+(tn)).c_str(), ("; No. pileup TP"+(en)).c_str(), 30, -0.5, 29.5); + hisSumPtTPphysics_[tn] = inputDir.make(("SumPtTPphysics"+(tn)).c_str(), ("; Sum Pt physics TP"+(en)).c_str(), 100, 0.0, 100.); + hisSumPtTPpileup_[tn] = inputDir.make(("SumPtTPpileup"+(tn)).c_str(), ("; Sum Pt pileup TP"+(en)).c_str(), 100, 0.0, 100.); + } + + return inputDir; +} + +//=== Fill histograms studying freak, large events with too many stubs at HT. + +void Histos::fillStudyBusyEvents(const InputData& inputData, const matrix& mSectors, const matrix& mHtRphis, + const matrix& mGet3Dtrks) { + + const bool withRZfilter = false; // Care about events at HT. + + const unsigned int numStubsCut = settings_->busySectorNumStubs(); // No. of stubs per HT array the hardware can output. + + const vector& vStubs = inputData.getStubs(); + const vector& vTPs = inputData.getTPs(); + + // Create map containing L1 tracks found in whole of tracker together with flag indicating if the + // track was killed because it was in a busy sector. + map trksInEntireTracker; + + unsigned int nBusySecIn = 0; + unsigned int nBusySecOut = 0; + + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + const Sector& sector = mSectors(iPhiSec, iEtaReg); + const HTrphi& htRphi = mHtRphis (iPhiSec, iEtaReg); + const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); + const vector& tracks = get3Dtrk.trackCands3D(withRZfilter); + + //--- Look for too many stubs input to sector. + + unsigned int nStubsIn = htRphi.nReceivedStubs(); + // Plot fraction of input stubs that would be killed by 36BX period. + for (unsigned int j = 0; j < nStubsIn; j++) { + bool kill = (j >= numStubsCut); + profFracStubsKilledVsEtaReg_->Fill(iEtaReg, kill); + } + bool tooBusyIn = (nStubsIn > numStubsCut); + if (tooBusyIn) nBusySecIn++; + profFracBusyInVsEtaReg_->Fill(iEtaReg, tooBusyIn); // Sector had too many input stubs. + + //--- Look for too many stubs assigned to output tracks. + + // Order tracks in increasing order of abs(q/Pt). + // Use multimap rather than map to do this, as some tracks may have identical q/Pt, and it will store all of them, unlike map. + multimap orderedTrks; + for (const L1track3D& trk : tracks) { + orderedTrks.insert( pair( fabs(trk.qOverPt()), &trk) ); + } + + // Create map containing L1 tracks found in whole of tracker together with flag indicating if the + // track was killed because it was in a busy sector. + map trksInSector; + + // Check how many tracks would be killed by 36BX period, assuming we kill preferentially low Pt ones. + bool tooBusyOut = false; + unsigned int nStubsOut = 0; + + for (const auto& oTrk : orderedTrks) { + float ptInv = oTrk.first; + const L1track3D* trk = oTrk.second; + bool kill = false; + nStubsOut += trk->getNumStubs(); + if (nStubsOut > numStubsCut) kill = true; + + if (kill) tooBusyOut = true; // Note that some tracks were killed in this sector. + + profFracTracksKilledVsEtaReg_->Fill(iEtaReg, kill); + profFracTracksKilledVsInvPt_->Fill(ptInv, kill); + + // Form a map of all tracks in the entire tracker & also just in this sector, with a flag indicating if they were killed as in a busy sector. + trksInEntireTracker[trk] = kill; + trksInSector[trk] = kill; + } + + if (tooBusyOut) nBusySecOut++; + profFracBusyOutVsEtaReg_->Fill(iEtaReg, tooBusyOut); // Sector had too many output stubs. + + //--- Compare properties of sectors with/without too many output stubs. + + const vector tnames = {"BusyOutSec", "QuietOutSec"}; + + // Loop over sectors with too many/not too many output stubs. + for (const string& tn : tnames) { + if ((tn == "BusyOutSec" && tooBusyOut) || (tn == "QuietOutSec" && (! tooBusyOut))) { + + hisNumInputStubs_[tn]->Fill(nStubsIn); + + // Check if q/Pt estimated from stub bend differs in busy & quiet sectors. + for (const Stub* stub : vStubs) { + if ( sector.inside( stub ) ) hisQoverPtInputStubs_[tn]->Fill(abs(stub->qOverPt())); + } + + // Look at reconstructed tracks in this sector. + hisNumOutputStubs_[tn]->Fill(nStubsOut); + hisNumTracks_[tn]->Fill(tracks.size()); + for (const L1track3D& trk : tracks) { + hisNumStubsPerTrack_[tn]->Fill(trk.getNumStubs()); + hisTrackQoverPt_[tn]->Fill(trk.qOverPt()); + hisTrackPurity_[tn]->Fill(trk.getPurity()); + } + + // Look at total Pt of truth particles in this sector to understand if it contains a jet. + unsigned int num_TP_physics = 0; + unsigned int num_TP_pileup = 0; + float sumPt_TP_physics = 0.; + float sumPt_TP_pileup = 0.; + for (const TP& tp : vTPs) { + bool tpInSector = (fabs(tp.trkPhiAtR(settings_->chosenRofPhi()) - sector.phiCentre()) < sector.sectorHalfWidth() && + tp.trkZAtR(chosenRofZ_) > sector.zAtChosenR_Min() && + tp.trkZAtR(chosenRofZ_) < sector.zAtChosenR_Max()); + if (tpInSector) { + if (tp.physicsCollision()) { // distinguish truth particles from physics collision vs from pileup. + num_TP_physics++; + sumPt_TP_physics += tp.pt(); + } else { + num_TP_pileup++; + sumPt_TP_pileup += tp.pt(); + } + } + } + hisNumTPphysics_[tn]->Fill(num_TP_physics); + hisNumTPpileup_[tn]->Fill(num_TP_pileup); + hisSumPtTPphysics_[tn]->Fill(sumPt_TP_physics); + hisSumPtTPpileup_[tn]->Fill(sumPt_TP_pileup); + } + } + + //--- Count tracking particles lost by killing tracks in individual busy sectors. + if (tooBusyOut) { + unsigned int nTPkilled = 0; + for (const TP& tp: vTPs) { + if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. + + bool tpRecoed = false; + bool tpRecoedSurvived = false; + for (const auto& trkm : trksInSector) { + const L1track3D* trk = trkm.first; + bool kill = trkm.second; + if (trk->getMatchedTP() == &tp) { + tpRecoed = true; // Truth particle was reconstructed + if (! kill) tpRecoedSurvived = true; // Ditto & reconstructed track wasn't killed by busy sector. + } + } + + bool tpKilled = tpRecoed && ( ! tpRecoedSurvived ); + if (tpKilled) nTPkilled++; + } + } + hisNumTPkilledBusySec_->Fill(nTPkilled); + } + } + } + + hisNumBusySecsInPerEvent_->Fill(nBusySecIn); // No. of sectors per event with too many input stubs. + hisNumBusySecsOutPerEvent_->Fill(nBusySecOut); // No. of sectors per event with too many output stubs. + + //--- Check loss in tracking efficiency caused by killing tracks in busy sectors. + + for (const TP& tp: vTPs) { + if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. + + bool tpRecoed = false; + bool tpRecoedSurvived = false; + for (const auto& trkm : trksInEntireTracker) { + const L1track3D* trk = trkm.first; + bool kill = trkm.second; + if (trk->getMatchedTP() == &tp) { + tpRecoed = true; // Truth particle was reconstructed + if (! kill) tpRecoedSurvived = true; // Ditto & reconstructed track wasn't killed by busy sector. + } + } + bool tpKilled = tpRecoed && ( ! tpRecoedSurvived ); + profFracTPKilledVsEta_->Fill(fabs(tp.eta()), tpKilled); + profFracTPKilledVsInvPt_->Fill(fabs(tp.qOverPt()), tpKilled); + } + } +} + +//=== Book histograms for studying track fitting. + +map Histos::bookTrackFitting() { + + const float maxEta = settings_->maxStubEta(); + const float maxAbsQoverPt = 1./houghMinPt_; // Max. |q/Pt| covered by HT array. + + // Book histograms for 4 and 5 parameter helix fits. + + map inputDirMap; + + for (const string& fitName : trackFitters_ ) { + + // Define lambda function to facilitate adding "fitName" histogram names. + auto addn = [fitName](string s){ return TString::Format("%s_%s", s.c_str(), fitName.c_str()); }; + + //std::cout << "Booking histograms for " << fitName << std::endl; + TFileDirectory inputDir = fs_->mkdir( fitName ); + inputDirMap[fitName] = inputDir; + + profNumFitTracks_[fitName] = inputDir.make(addn("NumFitTracks"), "; class; # of fitted tracks", 11, 0.5, 11.5, -0.5, 9.9e6); + profNumFitTracks_[fitName]->GetXaxis()->SetBinLabel(7, "TP for eff fitted"); + profNumFitTracks_[fitName]->GetXaxis()->SetBinLabel(6, "TP fitted"); + profNumFitTracks_[fitName]->GetXaxis()->SetBinLabel(2, "Fit tracks that are genuine"); + profNumFitTracks_[fitName]->GetXaxis()->SetBinLabel(1, "Fit tracks including fakes"); + profNumFitTracks_[fitName]->LabelsOption("d"); + + hisNumFitTrks_[fitName] = inputDir.make(addn("NumFitTrks"), "; No. fitted tracks in tracker;",200,-0.5,399.5); + hisNumFitTrksPerNon_[fitName] = inputDir.make(addn("NumFitTrksPerNon"), "; No. fitted tracks per nonant;",200,-0.5,199.5); + hisNumFitTrksPerSect_[fitName] = inputDir.make(addn("NumFitTrksPerSect"), "; No. fitted tracks per sector;",100,-0.5,99.5); + + hisStubsPerFitTrack_[fitName] = inputDir.make(addn("StubsPerFitTrack"), "; No. of stubs per fitted track",20,-0.5,19.5); + profStubsOnFitTracks_[fitName] = inputDir.make(addn("StubsOnFitTracks"), "; ; No. of stubs on all fitted tracks per event",1,0.5,1.5); + + hisFitQinvPtMatched_[fitName] = inputDir.make(addn("FitQinvPtMatched"),"Fitted q/p_{T} for matched tracks", 120, -0.6, 0.6 ); + hisFitPhi0Matched_[fitName] = inputDir.make(addn("FitPhi0Matched"), "Fitted #phi_{0} for matched tracks", 70, -3.5, 3.5 ); + hisFitD0Matched_[fitName] = inputDir.make(addn("FitD0Matched"), "Fitted d_{0} for matched tracks", 100, -2., 2. ); + hisFitZ0Matched_[fitName] = inputDir.make(addn("FitZ0Matched"), "Fitted z_{0} for matched tracks", 100, -25., 25. ); + hisFitEtaMatched_[fitName] = inputDir.make(addn("FitEtaMatched"), "Fitted #eta for matched tracks", 70, -3.5, 3.5 ); + + hisFitQinvPtUnmatched_[fitName] = inputDir.make(addn("FitQinvPtUnmatched"), "Fitted q/p_{T} for unmatched tracks", 120, -0.6, 0.6 ); + hisFitPhi0Unmatched_[fitName] = inputDir.make(addn("FitPhi0Unmatched"), "Fitted #phi_{0} for unmatched tracks", 70, -3.5, 3.5 ); + hisFitD0Unmatched_[fitName] = inputDir.make(addn("FitD0Unmatched"), "Fitted d_{0} for unmatched tracks", 100, -2., 2. ); + hisFitZ0Unmatched_[fitName] = inputDir.make(addn("FitZ0Unmatched"), "Fitted z_{0} for unmatched tracks", 100, -25., 25. ); + hisFitEtaUnmatched_[fitName] = inputDir.make(addn("FitEtaUnmatched"), "Fitted #eta for unmatched tracks", 70, -3.5, 3.5 ); + + const unsigned int nBinsChi2 = 29; + const float chi2dofBins[nBinsChi2+1] = + {0.0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8,2.0,2.4,2.8,3.2,3.6,4.0,4.5,5.0,6.0,7.0,8.0,9.0,10.0,12.0,14.0,16.0,18.0,20.0,25.0,30.0}; + float chi2Bins[nBinsChi2+1]; + for (unsigned int k = 0; k < nBinsChi2+1; k++) chi2Bins[k] = chi2dofBins[k]*6; + + hisFitChi2Matched_[fitName] = inputDir.make(addn("FitChi2Matched"), ";#chi^{2};", nBinsChi2, chi2Bins ); + hisFitChi2DofMatched_[fitName] = inputDir.make(addn("FitChi2DofMatched"), ";#chi^{2}/DOF;", nBinsChi2, chi2dofBins ); + hisFitChi2DofRphiMatched_[fitName] = inputDir.make(addn("FitChi2DofRphiMatched"), ";#chi^{2}rphi;", nBinsChi2, chi2Bins ); + hisFitChi2DofRzMatched_[fitName] = inputDir.make(addn("FitChi2DofRzMatched"), ";#chi^{2}rz/DOF;", nBinsChi2, chi2Bins ); + if (settings_->kalmanAddBeamConstr() && fitName.find("KF5") != string::npos) { // Histograms of chi2 with beam-spot constraint only make sense for 5 param fit. + hisFitBeamChi2Matched_[fitName] = inputDir.make(addn("FitBeamChi2Matched"), "; Beam constr #chi^{2};", nBinsChi2, chi2Bins); + hisFitBeamChi2DofMatched_[fitName] = inputDir.make(addn("FitBeamChi2DofMatched"), ";Beam constr #chi^{2}/DOF;", nBinsChi2, chi2dofBins ); + } + profFitChi2VsEtaMatched_[fitName] = inputDir.make(addn("FitChi2VsEtaMatched"), "; #eta; Fit #chi^{2}", 24, 0., maxEta ); + profFitChi2DofVsEtaMatched_[fitName] = inputDir.make(addn("FitChi2DofVsEtaMatched"), "; #eta; Fit #chi^{2}/dof", 24, 0., maxEta ); + profFitChi2VsInvPtMatched_[fitName] = inputDir.make(addn("FitChi2VsInvPtMatched"), "; 1/p_{T}; Fit #chi^{2}", 25, 0., maxAbsQoverPt ); + profFitChi2DofVsInvPtMatched_[fitName] = inputDir.make(addn("FitChi2DofVsInvPtMatched"), "; 1/p_{T}; Fit #chi^{2}/dof", 25, 0., maxAbsQoverPt ); + const unsigned int nBinsD0 = 8; + const float d0Bins[nBinsD0+1]={0.0,0.05,0.10,0.15,0.20,0.3,0.5,1.0,2.0}; + profFitChi2VsTrueD0Matched_[fitName] = inputDir.make(addn("FitChi2VsTrueD0Matched"), "; true d0 (cm); Fit #chi^{2}", nBinsD0, d0Bins ); + profFitChi2DofVsTrueD0Matched_[fitName] = inputDir.make(addn("FitChi2DofVsTrueD0Matched"), "; true d0 (cm); Fit #chi^{2}/dof", nBinsD0, d0Bins); + + hisFitChi2PerfMatched_[fitName] = inputDir.make(addn("FitChi2PerfMatched"), ";#chi^{2};", nBinsChi2, chi2Bins ); + hisFitChi2DofPerfMatched_[fitName] = inputDir.make(addn("FitChi2DofPerfMatched"), ";#chi^{2}/DOF;", nBinsChi2, chi2dofBins ); + + hisFitChi2Unmatched_[fitName] = inputDir.make(addn("FitChi2Unmatched"), ";#chi^{2};", nBinsChi2, chi2Bins ); + hisFitChi2DofUnmatched_[fitName] = inputDir.make(addn("FitChi2DofUnmatched"), ";#chi^{2}/DOF;", nBinsChi2, chi2dofBins ); + hisFitChi2DofRphiUnmatched_[fitName] = inputDir.make(addn("FitChi2DofRphiUnmatched"), ";#chi^{2}rphi/DOF;", nBinsChi2, chi2Bins ); + hisFitChi2DofRzUnmatched_[fitName] = inputDir.make(addn("FitChi2DofRzUnmatched"), ";#chi^{2}rz/DOF;", nBinsChi2, chi2Bins ); + if (settings_->kalmanAddBeamConstr() && fitName.find("KF5") != string::npos) { // Histograms of chi2 with beam-spot constraint only make sense for 5 param fit. + hisFitBeamChi2Unmatched_[fitName] = inputDir.make(addn("FitBeamChi2Unmatched"), "; Beam constr #Chi^{2};", nBinsChi2, chi2Bins ); + hisFitBeamChi2DofUnmatched_[fitName] = inputDir.make(addn("FitBeamChi2DofUnmatched"), "; Beam constr #Chi^{2}/DOF;", nBinsChi2, chi2dofBins ); + } + profFitChi2VsEtaUnmatched_[fitName] = inputDir.make(addn("FitChi2VsEtaUnmatched"), "; #eta; Fit #chi2", 24, 0., maxEta ); + profFitChi2DofVsEtaUnmatched_[fitName] = inputDir.make(addn("FitChi2DofVsEtaUnmatched"), "; #eta; Fit #chi2/dof", 24, 0., maxEta ); + profFitChi2VsInvPtUnmatched_[fitName] = inputDir.make(addn("FitChi2VsInvPtUnmatched"), "; 1/p_{T}; Fit #chi2", 25, 0., maxAbsQoverPt ); + profFitChi2DofVsInvPtUnmatched_[fitName] = inputDir.make(addn("FitChi2DofVsInvPtUnmatched"), "; 1/p_{T}; Fit #chi2/dof", 25, 0., maxAbsQoverPt ); + + profFitChi2VsPurity_[fitName] = inputDir.make(addn("FitChi2VsPurity"), "#Chi^{2} vs stub purity", 102, -0.01, 1.01 ); + profFitChi2DofVsPurity_[fitName] = inputDir.make(addn("FitChi2DofVsPurity"), "#Chi^{2}/DOF vs stub purity", 102, -0.01, 1.01 ); + + // Monitoring specific track fit algorithms. + if (fitName.find("KF") != string::npos) { + hisKalmanNumUpdateCalls_[fitName] = inputDir.make(addn("KalmanNumUpdateCalls"), "; Calls to KF updator;",100,-0.5,99.5); + hisKalmanChi2DofSkipLay0Matched_[fitName] = inputDir.make(addn("KalmanChi2DofSkipLay0Matched"), ";#chi^{2} for nSkippedLayers = 0;", nBinsChi2, chi2Bins ); + hisKalmanChi2DofSkipLay1Matched_[fitName] = inputDir.make(addn("KalmanChi2DofSkipLay1Matched"), ";#chi^{2} for nSkippedLayers = 1;", nBinsChi2, chi2Bins ); + hisKalmanChi2DofSkipLay2Matched_[fitName] = inputDir.make(addn("KalmanChi2DofSkipLay2Matched"), ";#chi^{2} for nSkippedLayers = 2;", nBinsChi2, chi2Bins ); + hisKalmanChi2DofSkipLay0Unmatched_[fitName] = inputDir.make(addn("KalmanChi2DofSkipLay0Unmatched"), ";#chi^{2} for nSkippedLayers = 0;", nBinsChi2, chi2Bins ); + hisKalmanChi2DofSkipLay1Unmatched_[fitName] = inputDir.make(addn("KalmanChi2DofSkipLay1Unmatched"), ";#chi^{2} for nSkippedLayers = 1;", nBinsChi2, chi2Bins ); + hisKalmanChi2DofSkipLay2Unmatched_[fitName] = inputDir.make(addn("KalmanChi2DofSkipLay2Unmatched"), ";#chi^{2} for nSkippedLayers = 2;", nBinsChi2, chi2Bins ); + } + + // See how far stubs lie from fitted (or true) trajectory + hisDeltaPhitruePSbarrel_[fitName] = inputDir.make(addn("DeltaPhitruePSbarrel"),"PS modules; ##sigma of true stubs from true traj. in phi;",100,-5.0,5.0); + hisDeltaRorZtruePSbarrel_[fitName] = inputDir.make(addn("DeltaRorZtruePSbarrel"),"PS modules; ##sigma of true stubs from true traj. in r-z;",100,-5.0,5.0); + hisDeltaPhitrue2Sbarrel_[fitName] = inputDir.make(addn("DeltaPhitrue2Sbarrel"),"2S modules; ##sigma of true stubs from true traj. in phi;",100,-5.0,5.0); + hisDeltaRorZtrue2Sbarrel_[fitName] = inputDir.make(addn("DeltaRorZtrue2Sbarrel"),"2S modules; ##sigma of true stubs from true traj. in r-z;",100,-5.0,5.0); + hisDeltaPhitruePSendcap_[fitName] = inputDir.make(addn("DeltaPhitruePSendcap"),"PS modules; ##sigma of true stubs from true traj. in phi;",100,-5.0,5.0); + hisDeltaRorZtruePSendcap_[fitName] = inputDir.make(addn("DeltaRorZtruePSendcap"),"PS modules; ##sigma of true stubs from true traj. in r-z;",100,-5.0,5.0); + hisDeltaPhitrue2Sendcap_[fitName] = inputDir.make(addn("DeltaPhitrue2Sendcap"),"2S modules; ##sigma of true stubs from true traj. in phi;",100,-5.0,5.0); + hisDeltaRorZtrue2Sendcap_[fitName] = inputDir.make(addn("DeltaRorZtrue2Sendcap"),"2S modules; ##sigma of true stubs from true traj. in r-z;",100,-5.0,5.0); + hisDeltaPhifakePSbarrel_[fitName] = inputDir.make(addn("DeltaPhifakePSbarrel"),"PS modules; ##sigma of fake stubs from true traj. in phi;",100,-5.0,5.0); + hisDeltaRorZfakePSbarrel_[fitName] = inputDir.make(addn("DeltaRorZfakePSbarrel"),"PS modules; ##sigma of fake stubs from true traj. in r-z;",100,-5.0,5.0); + hisDeltaPhifake2Sbarrel_[fitName] = inputDir.make(addn("DeltaPhifake2Sbarrel"),"2S modules; ##sigma of fake stubs from true traj. in phi;",100,-5.0,5.0); + hisDeltaRorZfake2Sbarrel_[fitName] = inputDir.make(addn("DeltaRorZfake2Sbarrel"),"2S modules; ##sigma of fake stubs from true traj. in r-z;",100,-5.0,5.0); + hisDeltaPhifakePSendcap_[fitName] = inputDir.make(addn("DeltaPhifakePSendcap"),"PS modules; ##sigma of fake stubs from true traj. in phi;",100,-5.0,5.0); + hisDeltaRorZfakePSendcap_[fitName] = inputDir.make(addn("DeltaRorZfakePSendcap"),"PS modules; ##sigma of fake stubs from true traj. in r-z;",100,-5.0,5.0); + hisDeltaPhifake2Sendcap_[fitName] = inputDir.make(addn("DeltaPhifake2Sendcap"),"2S modules; ##sigma of fake stubs from true traj. in phi;",100,-5.0,5.0); + hisDeltaRorZfake2Sendcap_[fitName] = inputDir.make(addn("DeltaRorZfake2Sendcap"),"2S modules; ##sigma of fake stubs from true traj. in r-z;",100,-5.0,5.0); + profRecalcRphiChi2VsEtaTrue1_[fitName] = inputDir.make(addn("RecalcRphiChi2VsEtaTrue1"), "; #eta; Recalculated r-#phi #chi2 method 1 for matched tracks", 24, 0., maxEta ); + profRecalcRzChi2VsEtaTrue1_[fitName] = inputDir.make(addn("RecalcRzChi2VsEtaTrue1"), "; #eta; Recalculated r-z #chi2 method 1 for matched tracks", 24, 0., maxEta ); + profRecalcChi2VsEtaTrue1_[fitName] = inputDir.make(addn("RecalcChi2VsEtaTrue1"), "; #eta; Recalculated #chi2 method 1 for matched tracks", 24, 0., maxEta ); + profRecalcChi2VsEtaTrue2_[fitName] = inputDir.make(addn("RecalcChi2VsEtaTrue2"), "; #eta; Recalculated #chi2 method 2 for matched tracks", 24, 0., maxEta ); + profNsigmaPhivsInvPt_[fitName] = inputDir.make(addn("NsigmaPhivsInvPt"),"; 1/Pt; Num #sigma of true stubs from true traj.",16,0.,maxAbsQoverPt); + profNsigmaPhivsR_[fitName] = inputDir.make(addn("NsigmaPhivsR"),"; r; Num #sigma of true stubs from true traj.",22,0.,110.); + profNsigmaPhivsTanl_[fitName] = inputDir.make(addn("NsigmaPhivsTanl"),"; tan #lambda; Num #sigma of true stubs from true traj.",20,0.,6.); + + hisFitVsSeedQinvPtMatched_[fitName] = inputDir.make(addn("FitVsSeedQinvPtMatched"), "; Seed q/p_{T} (Genuine Cand); Fitted q/p_{T}", 120, -0.6, 0.6, 120, -0.6, 0.6 ); + hisFitVsSeedPhi0Matched_[fitName] = inputDir.make(addn("FitVsSeedPhi0Matched"), "; Seed #phi_{0} (Genuine Cand); Fitted #phi_{0}", 70, -3.5, 3.5, 70, -3.5, 3.5 ); + hisFitVsSeedD0Matched_[fitName] = inputDir.make(addn("FitVsSeedD0Matched"), "; Seed d_{0} (Genuine Cand); Fitted d_{0}", 100, -2., 2., 100, -2., 2. ); + hisFitVsSeedZ0Matched_[fitName] = inputDir.make(addn("FitVsSeedZ0Matched"), "; Seed z_{0} (Genuine Cand); Fitted z_{0}", 100, -25., 25., 100, -25., 25. ); + hisFitVsSeedEtaMatched_[fitName] = inputDir.make(addn("FitVsSeedEtaMatched"), "; Seed #eta (Genuine Cand); Fitted #eta", 70, -3.5, 3.5, 70, -3.5, 3.5 ); + + hisFitVsSeedQinvPtUnmatched_[fitName] = inputDir.make(addn("FitVsSeedQinvPtUnmatched"), "; Seed q/p_{T} (Fake Cand); Fitted q/p_{T}", 120, -0.6, 0.6, 120, -0.6, 0.6 ); + hisFitVsSeedPhi0Unmatched_[fitName] = inputDir.make(addn("FitVsSeedPhi0Unmatched"), "; Seed #phi_{0} (Fake Cand); Fitted #phi_{0}", 70, -3.5, 3.5, 70, -3.5, 3.5 ); + hisFitVsSeedD0Unmatched_[fitName] = inputDir.make(addn("FitVsSeedD0Unmatched"), "; Seed d_{0} (Fake Cand); Fitted d_{0}", 100, -2., 2., 100, -2., 2. ); + hisFitVsSeedZ0Unmatched_[fitName] = inputDir.make(addn("FitVsSeedZ0Unmatched"), "; Seed z_{0} (Fake Cand); Fitted z_{0}", 100, -25., 25., 100, -25., 25. ); + hisFitVsSeedEtaUnmatched_[fitName] = inputDir.make(addn("FitVsSeedEtaUnmatched"), "; Seed #eta (Fake Cand); Fitted #eta", 70, -3.5, 3.5, 70, -3.5, 3.5 ); + + hisNumStubsVsPurityMatched_[fitName] = inputDir.make(addn("NumStubsVsPurityMatched"), "; Purity; Number of stubs", 102, -0.01, 1.01, 30, 0.0, 30.0); + profFitFracTrueStubsVsLayerMatched_[fitName] = inputDir.make(addn("FitFracTrueStubsVsLayerMatched") ,";Layer ID; fraction of true stubs",30,0.5,30.5); + profFitFracTrueStubsVsEtaMatched_[fitName] = inputDir.make(addn("FitFracTrueStubsVsEtaMatched") ,";#eta; fraction of true stubs",24,0.,3.); + + // Plots of helix param resolution. + + hisFitVsTrueQinvPt_[fitName] = inputDir.make(addn("FitVsTrueQinvPt"), "; TP q/p_{T}; Fitted q/p_{T} (good #chi^{2})", 120, -0.6, 0.6, 120, -0.6, 0.6 ); + hisFitVsTruePhi0_[fitName] = inputDir.make(addn("FitVsTruePhi0"), "; TP #phi_{0}; Fitted #phi_{0} (good #chi^{2})", 70, -3.5, 3.5, 70, -3.5, 3.5 ); + hisFitVsTrueD0_[fitName] = inputDir.make(addn("FitVsTrueD0"), "; TP d_{0}; Fitted d_{0} (good #chi^{2})", 100, -2., 2., 100, -2., 2. ); + hisFitVsTrueZ0_[fitName] = inputDir.make(addn("FitVsTrueZ0"), "; TP z_{0}; Fitted z_{0} (good #chi^{2})" , 100, -25., 25., 100, -25., 25. ); + hisFitVsTrueEta_[fitName] = inputDir.make(addn("FitVsTrueEta"), "; TP #eta; Fitted #eta (good #chi^{2})", 70, -3.5, 3.5, 70, -3.5, 3.5 ); + + hisFitQinvPtRes_[fitName] = inputDir.make(addn("FitQinvPtRes"), "Fitted minus true q/p_{T} (good #chi^{2})", 100, -0.1, 0.1 ); + hisFitPhi0Res_[fitName] = inputDir.make(addn("FitPhi0Res"), "Fitted minus true #phi_{0} (good #chi^{2})", 100, -0.02, 0.02 ); + hisFitD0Res_[fitName] = inputDir.make(addn("FitD0Res"), "Fitted minus true d_{0} (good #chi^{2})", 100, -0.2, 0.2 ); + hisFitZ0Res_[fitName] = inputDir.make(addn("FitZ0Res"), "Fitted minus true z_{0} (good #chi^{2})", 100, -2., 2. ); + hisFitEtaRes_[fitName] = inputDir.make(addn("FitEtaRes"), "Fitted minus true #eta (good #chi^{2})", 100, -0.02, 0.02 ); + + hisQoverPtResVsTrueEta_[fitName] = inputDir.make(addn("QoverPtResVsTrueEta"), "q/p_{T} resolution; |#eta|; q/p_{T} resolution", 24, 0.0, maxEta); + hisPhi0ResVsTrueEta_[fitName] = inputDir.make(addn("PhiResVsTrueEta"), "#phi_{0} resolution; |#eta|; #phi_{0} resolution", 24, 0.0, maxEta); + hisEtaResVsTrueEta_[fitName] = inputDir.make(addn("EtaResVsTrueEta"), "#eta resolution; |#eta|; #eta resolution", 24, 0.0, maxEta); + hisZ0ResVsTrueEta_[fitName] = inputDir.make(addn("Z0ResVsTrueEta"), "z_{0} resolution; |#eta|; z_{0} resolution", 24, 0.0, maxEta); + hisD0ResVsTrueEta_[fitName] = inputDir.make(addn("D0ResVsTrueEta"), "d_{0} resolution; |#eta|; d_{0} resolution", 24, 0.0, maxEta); + + hisQoverPtResVsTrueInvPt_[fitName] = inputDir.make(addn("QoverPtResVsTrueInvPt"), "q/p_{T} resolution; 1/p_{T}; q/p_{T} resolution", 25, 0.0, maxAbsQoverPt); + hisPhi0ResVsTrueInvPt_[fitName] = inputDir.make(addn("PhiResVsTrueInvPt"), "#phi_{0} resolution; 1/p_{T}; #phi_{0} resolution", 25, 0.0, maxAbsQoverPt); + hisEtaResVsTrueInvPt_[fitName] = inputDir.make(addn("EtaResVsTrueInvPt"), "#eta resolution; 1/p_{T}; #eta resolution", 25, 0.0, maxAbsQoverPt); + hisZ0ResVsTrueInvPt_[fitName] = inputDir.make(addn("Z0ResVsTrueInvPt"), "z_{0} resolution; 1/p_{T}; z_{0} resolution", 25, 0.0, maxAbsQoverPt); + hisD0ResVsTrueInvPt_[fitName] = inputDir.make(addn("D0ResVsTrueInvPt"), "d_{0} resolution; 1/p_{T}; d_{0} resolution", 25, 0.0, maxAbsQoverPt); + + if (settings_->kalmanAddBeamConstr() && fitName.find("KF5") != string::npos) { // Histograms of resolution with beam-spot constraint only make sense for 5 param fit. + hisQoverPtResBeamVsTrueEta_[fitName] = inputDir.make(addn("QoverPtResBeamVsTrueEta"), "q/p_{T} resolution with beam constr; |#eta|; q/p_{T} resolution", 24, 0.0, maxEta); + hisPhi0ResBeamVsTrueEta_[fitName] = inputDir.make(addn("PhiResBeamVsTrueEta"), "#phi_{0} resolution with beam constr; |#eta|; #phi_{0} resolution", 24, 0.0, maxEta); + + hisQoverPtResBeamVsTrueInvPt_[fitName] = inputDir.make(addn("QoverPtResBeamVsTrueInvPt"), "q/p_{T} resolution with beam constr; 1/p_{T}; q/p_{T} resolution", 25, 0.0, maxAbsQoverPt); + hisPhi0ResBeamVsTrueInvPt_[fitName] = inputDir.make(addn("PhiResBeamVsTrueInvPt"), "#phi_{0} resolution with beam constr; 1/p_{T}; #phi_{0} resolution", 25, 0.0, maxAbsQoverPt); + } + + // Duplicate track histos. + profDupFitTrksVsEta_[fitName] = inputDir.make(addn("DupFitTrksVsEta") ,"; #eta; No. of duplicate tracks per TP",12,0.,3.); + profDupFitTrksVsInvPt_[fitName] = inputDir.make(addn("DupFitTrksVsInvPt") ,"; 1/Pt; No. of duplicate tracks per TP",houghNbinsPt_,0.,maxAbsQoverPt); + + // Histos for tracking efficiency vs. TP kinematics. (Binning must match similar histos in bookTrackCands()). + hisFitTPinvptForEff_[fitName] = inputDir.make(addn("FitTPinvptForEff") ,"; 1/Pt of TP (used for effi. measurement);",24,0.,1.5*maxAbsQoverPt); + hisFitTPptForEff_[fitName] = inputDir.make(addn("FitTPptForEff") ,"; Pt of TP (used for effi. measurement);",25,0.0,100.0); + hisFitTPetaForEff_[fitName] = inputDir.make(addn("FitTPetaForEff"),"; #eta of TP (used for effi. measurement);",20,-3.,3.); + hisFitTPphiForEff_[fitName] = inputDir.make(addn("FitTPphiForEff"),"; #phi of TP (used for effi. measurement);",20,-M_PI,M_PI); + + // Histo for efficiency to reconstruct track perfectly (no incorrect hits). (Binning must match similar histos in bookTrackCands()). + hisPerfFitTPinvptForEff_[fitName] = inputDir.make(addn("PerfFitTPinvptForEff") ,"; 1/Pt of TP (used for perf. effi. measurement);",24,0.,1.5*maxAbsQoverPt); + hisPerfFitTPptForEff_[fitName] = inputDir.make(addn("PerfFitTPptForEff") ,"; Pt of TP (used for perf. effi. measurement);",25,0.0,100.0); + hisPerfFitTPetaForEff_[fitName] = inputDir.make(addn("PerfFitTPetaForEff"),"; #eta of TP (used for perfect effi. measurement);",20,-3.,3.); + + // Histos for tracking efficiency vs. TP production point. (Binning must match similar histos in bookTrackCands()). + hisFitTPd0ForEff_[fitName] = inputDir.make(addn("FitTPd0ForEff"),"; d0 of TP (used for effi. measurement);",40, 0.,4.); + hisFitTPz0ForEff_[fitName] = inputDir.make(addn("FitTPz0ForEff"),"; z0 of TP (used for effi. measurement);",50,0.,25.); + + // Histos for algorithmic tracking efficiency vs. TP kinematics. (Binning must match similar histos in bookTrackCands()). + hisFitTPinvptForAlgEff_[fitName] = inputDir.make(addn("FitTPinvptForAlgEff") ,"; 1/Pt of TP (used for alg. effi. measurement);",24,0.,1.5*maxAbsQoverPt); + hisFitTPptForAlgEff_[fitName] = inputDir.make(addn("FitTPptForAlgEff") ,"; Pt of TP (used for alg. effi. measurement);",25,0.0,100.0); + hisFitTPetaForAlgEff_[fitName] = inputDir.make(addn("FitTPetaForAlgEff"),"; #eta of TP (used for alg. effi. measurement);",20,-3.,3.); + hisFitTPphiForAlgEff_[fitName] = inputDir.make(addn("FitTPphiForAlgEff"),"; #phi of TP (used for alg. effi. measurement);",20,-M_PI,M_PI); + + // Histo for efficiency to reconstruct track perfectly (no incorrect hits). (Binning must match similar histos in bookTrackCands()). + hisPerfFitTPinvptForAlgEff_[fitName] = inputDir.make(addn("PerfFitTPinvptForAlgEff") ,"; 1/Pt of TP (used for perf. alg. effi. measurement);",24,0.,1.5*maxAbsQoverPt); + hisPerfFitTPptForAlgEff_[fitName] = inputDir.make(addn("PerfFitTPptForAlgEff") ,"; Pt of TP (used for perf. alg. effi. measurement);",25,0.0,100.0); + hisPerfFitTPetaForAlgEff_[fitName] = inputDir.make(addn("PerfFitTPetaForAlgEff"),"; #eta of TP (used for perf. alg. effi. measurement);",20,-3.,3.); + + // Ditto for tracks inside jets. + hisPerfFitTPinvptForAlgEff_inJetPtG30_[fitName] = inputDir.make(addn("PerfFitTPinvptForAlgEff_inJetPtG30") ,"; 1/Pt of TP (used for perf. alg. effi. measurement);",24,0.,1.5*maxAbsQoverPt); + hisPerfFitTPinvptForAlgEff_inJetPtG100_[fitName] = inputDir.make(addn("PerfFitTPinvptForAlgEff_inJetPtG100") ,"; 1/Pt of TP (used for perf. alg. effi. measurement);",24,0.,1.5*maxAbsQoverPt); + hisPerfFitTPinvptForAlgEff_inJetPtG200_[fitName] = inputDir.make(addn("PerfFitTPinvptForAlgEff_inJetPtG200") ,"; 1/Pt of TP (used for perf. alg. effi. measurement);",24,0.,1.5*maxAbsQoverPt); + + // Histos for algorithmic tracking efficiency vs. TP production point. (Binning must match similar histos in bookTrackCands()). + hisFitTPd0ForAlgEff_[fitName] = inputDir.make(addn("FitTPd0ForAlgEff") ,"; d0 of TP (used for alg. effi. measurement);",40,0.,4.); + hisFitTPz0ForAlgEff_[fitName] = inputDir.make(addn("FitTPz0ForAlgEff") ,"; z0 of TP (used for alg. effi. measurement);",50,0.,25.); + + // Histo for algorithmic tracking efficiency vs sector number (to check if looser cuts are needed in certain regions) + unsigned int nPhi = numPhiSectors_; + unsigned int nEta = numEtaRegions_; + hisFitTPphisecForAlgEff_[fitName] = inputDir.make(addn("FitTPphisecForAlgEff") ,"; #phi sector of TP (used for alg. effi. measurement);",nPhi,-0.5,nPhi-0.5); + hisFitTPetasecForAlgEff_[fitName] = inputDir.make(addn("FitTPetasecForAlgEff") ,"; #eta sector of TP (used for alg. effi. measurement);",nEta,-0.5,nEta-0.5); + hisPerfFitTPphisecForAlgEff_[fitName] = inputDir.make(addn("PerfFitTPphisecForAlgEff") ,"; #phi sector of TP (used for perf. alg. effi. measurement);",nPhi,-0.5,nPhi-0.5); + hisPerfFitTPetasecForAlgEff_[fitName] = inputDir.make(addn("PerfFitTPetasecForAlgEff") ,"; #eta sector of TP (used for perf. alg. effi. measurement);",nEta,-0.5,nEta-0.5); + } + + return inputDirMap; +} + +//=== Fill histograms for studying track fitting. + +void Histos::fillTrackFitting( const InputData& inputData, const map>& mFittedTracks) { + + const vector& vTPs = inputData.getTPs(); + + // Loop over all the fitting algorithms we are trying. + for (const string& fitName : trackFitters_) { + + const vector& fittedTracks = mFittedTracks.at(fitName); // Get fitted tracks. + + // Count tracks + unsigned int nFitTracks = 0; + unsigned int nFitsMatchingTP = 0; + + const unsigned int numPhiNonants = settings_->numPhiNonants(); + vector nFitTracksPerNonant(numPhiNonants,0); + map, unsigned int> nFitTracksPerSector; + + for (const L1fittedTrack& fitTrk : fittedTracks) { + nFitTracks++; + // Get matched truth particle, if any. + const TP* tp = fitTrk.getMatchedTP(); + if (tp != nullptr) nFitsMatchingTP++; + // Count fitted tracks per nonant. + unsigned int iNonant = ( numPhiSectors_ > 0 ) ? floor(fitTrk.iPhiSec()*numPhiNonants/(numPhiSectors_)) : 0; // phi nonant number + nFitTracksPerNonant[iNonant]++; + nFitTracksPerSector[pair(fitTrk.iPhiSec(), fitTrk.iEtaReg())]++; + } + + profNumFitTracks_[fitName]->Fill(1, nFitTracks); + profNumFitTracks_[fitName]->Fill(2, nFitsMatchingTP); + + hisNumFitTrks_[fitName]->Fill(nFitTracks); + for (const unsigned int& num : nFitTracksPerNonant) { + hisNumFitTrksPerNon_[fitName]->Fill(num); + } + for (const auto& p : nFitTracksPerSector) { + hisNumFitTrksPerSect_[fitName]->Fill(p.second); + } + + // Count stubs assigned to fitted tracks. + unsigned int nTotStubs = 0; + for (const L1fittedTrack& fitTrk : fittedTracks) { + unsigned int nStubs = fitTrk.getNumStubs(); + hisStubsPerFitTrack_[fitName]->Fill(nStubs); + nTotStubs += nStubs; + } + profStubsOnFitTracks_[fitName]->Fill(1., nTotStubs); + + // Note truth particles that are successfully fitted. And which give rise to duplicate tracks. + + map tpRecoedMap; // Note which truth particles were successfully fitted. + map tpPerfRecoedMap; // Note which truth particles were successfully fitted with no incorrect hits. + map tpRecoedDup; // Note that this TP gave rise to duplicate tracks. + for (const TP& tp: vTPs) { + tpRecoedMap[&tp] = false; + tpPerfRecoedMap[&tp] = false; + unsigned int nMatch = 0; + for (const L1fittedTrack& fitTrk : fittedTracks) { + const TP* assocTP = fitTrk.getMatchedTP(); // Get the TP the fitted track matches to, if any. + if (assocTP == &tp) { + tpRecoedMap[&tp] = true; + if (fitTrk.getPurity() == 1.) tpPerfRecoedMap[&tp] = true; + nMatch++; + } + } + tpRecoedDup[&tp] = nMatch; + } + + // Count truth particles that are successfully fitted. + + unsigned int nFittedTPs = 0; + unsigned int nFittedTPsForEff = 0; + for (const TP& tp: vTPs) { + if (tpRecoedMap[&tp]) { // Was this truth particle successfully fitted? + nFittedTPs++; + if (tp.useForEff()) nFittedTPsForEff++; + } + } + + profNumFitTracks_[fitName]->Fill(6, nFittedTPs); + profNumFitTracks_[fitName]->Fill(7, nFittedTPsForEff); + + // Loop over fitted tracks again. + + for (const L1fittedTrack& fitTrk : fittedTracks) { + + // Info for specific track fit algorithms. + unsigned int nSkippedLayers = 0; + unsigned int numUpdateCalls = 0; + if (fitName.find("KF") != string::npos) { + fitTrk.getInfoKF(nSkippedLayers, numUpdateCalls); + hisKalmanNumUpdateCalls_[fitName]->Fill(numUpdateCalls); + } + + //--- Compare fitted tracks that match truth particles to those that don't. + + // Get original HT track candidate prior to fit for comparison. + const L1track3D& htTrk = fitTrk.getL1track3D(); + + // Get matched truth particle, if any. + const TP* tp = fitTrk.getMatchedTP(); + + if (tp != nullptr) { + hisFitQinvPtMatched_[fitName]->Fill( fitTrk.qOverPt() ); + hisFitPhi0Matched_[fitName]->Fill( fitTrk.phi0() ); + hisFitD0Matched_[fitName]->Fill( fitTrk.d0() ); + hisFitZ0Matched_[fitName]->Fill( fitTrk.z0() ); + hisFitEtaMatched_[fitName]->Fill( fitTrk.eta() ); + + hisFitChi2Matched_[fitName]->Fill( fitTrk.chi2() ); + hisFitChi2DofMatched_[fitName]->Fill( fitTrk.chi2dof() ); + hisFitChi2DofRphiMatched_[fitName]->Fill( fitTrk.chi2rphi() / fitTrk.numDOFrphi()); + hisFitChi2DofRzMatched_[fitName]->Fill( fitTrk.chi2rz() / fitTrk.numDOFrz()); + if (settings_->kalmanAddBeamConstr() && fitName.find("KF5") != string::npos) { // Histograms of chi2 with beam-spot constraint only make sense for 5 param fit. + hisFitBeamChi2Matched_[fitName]->Fill( fitTrk.chi2_bcon() ); + hisFitBeamChi2DofMatched_[fitName]->Fill( fitTrk.chi2dof_bcon() ); + } + profFitChi2VsEtaMatched_[fitName]->Fill( fabs(fitTrk.eta()), fitTrk.chi2() ); + profFitChi2DofVsEtaMatched_[fitName]->Fill( fabs(fitTrk.eta()), fitTrk.chi2dof() ); + profFitChi2VsInvPtMatched_[fitName]->Fill( fabs(fitTrk.qOverPt()), fitTrk.chi2() ); + profFitChi2DofVsInvPtMatched_[fitName]->Fill( fabs(fitTrk.qOverPt()), fitTrk.chi2dof() ); + profFitChi2VsTrueD0Matched_[fitName]->Fill( fabs(tp->d0()), fitTrk.chi2() ); + profFitChi2DofVsTrueD0Matched_[fitName]->Fill( fabs(tp->d0()), fitTrk.chi2dof() ); + + // Check chi2/dof for perfectly reconstructed tracks. + if (fitTrk.getPurity() == 1.) { + hisFitChi2PerfMatched_[fitName]->Fill( fitTrk.chi2() ); + hisFitChi2DofPerfMatched_[fitName]->Fill( fitTrk.chi2dof() ); + } + + if (fitName.find("KF") != string::npos) { + // No. of skipped layers on track during Kalman track fit. + if (nSkippedLayers == 0) { + hisKalmanChi2DofSkipLay0Matched_[fitName]->Fill(fitTrk.chi2dof()); + } else if (nSkippedLayers == 1) { + hisKalmanChi2DofSkipLay1Matched_[fitName]->Fill(fitTrk.chi2dof()); + } else if (nSkippedLayers >= 2) { + hisKalmanChi2DofSkipLay2Matched_[fitName]->Fill(fitTrk.chi2dof()); + } + } + + // Compared fitted track helix params with seed track from HT. + hisFitVsSeedQinvPtMatched_[fitName]->Fill( htTrk.qOverPt(), fitTrk.qOverPt() ); + hisFitVsSeedPhi0Matched_[fitName]->Fill( htTrk.phi0(), fitTrk.phi0() ); + hisFitVsSeedD0Matched_[fitName]->Fill( htTrk.d0(), fitTrk.d0() ); + hisFitVsSeedZ0Matched_[fitName]->Fill( htTrk.z0(), fitTrk.z0() ); + hisFitVsSeedEtaMatched_[fitName]->Fill( htTrk.eta(), fitTrk.eta() ); + + // Study incorrect hits on matched tracks. + hisNumStubsVsPurityMatched_[fitName]->Fill( fitTrk.getNumStubs(), fitTrk.getPurity() ); + + const vector stubs = fitTrk.getStubs(); + for (const Stub* s : stubs) { + // Was this stub produced by correct truth particle? + const set stubTPs = s->assocTPs(); + bool trueStub = (stubTPs.find(tp) != stubTPs.end()); + profFitFracTrueStubsVsLayerMatched_[fitName]->Fill(s->layerId(), trueStub); + profFitFracTrueStubsVsEtaMatched_[fitName]->Fill(fabs(s->eta()), trueStub); + } + + } else { + hisFitQinvPtUnmatched_[fitName]->Fill( fitTrk.qOverPt() ); + hisFitPhi0Unmatched_[fitName]->Fill( fitTrk.phi0() ); + hisFitD0Unmatched_[fitName]->Fill( fitTrk.d0() ); + hisFitZ0Unmatched_[fitName]->Fill( fitTrk.z0() ); + hisFitEtaUnmatched_[fitName]->Fill( fitTrk.eta() ); + + hisFitChi2Unmatched_[fitName]->Fill( fitTrk.chi2() ); + hisFitChi2DofUnmatched_[fitName]->Fill( fitTrk.chi2dof() ); + hisFitChi2DofRphiUnmatched_[fitName]->Fill( fitTrk.chi2rphi() / fitTrk.numDOFrphi()); + hisFitChi2DofRzUnmatched_[fitName]->Fill( fitTrk.chi2rz() / fitTrk.numDOFrz()); + if (settings_->kalmanAddBeamConstr() && fitName.find("KF5") != string::npos) { // Histograms of chi2 with beam-spot constraint only make sense for 5 param fit. + hisFitBeamChi2Unmatched_[fitName]->Fill( fitTrk.chi2_bcon() ); + hisFitBeamChi2DofUnmatched_[fitName]->Fill( fitTrk.chi2dof_bcon() ); + } + profFitChi2VsEtaUnmatched_[fitName]->Fill( fabs(fitTrk.eta()), fitTrk.chi2() ); + profFitChi2DofVsEtaUnmatched_[fitName]->Fill( fabs(fitTrk.eta()), fitTrk.chi2dof() ); + profFitChi2VsInvPtUnmatched_[fitName]->Fill( fabs(fitTrk.qOverPt()), fitTrk.chi2() ); + profFitChi2DofVsInvPtUnmatched_[fitName]->Fill( fabs(fitTrk.qOverPt()), fitTrk.chi2dof() ); + + if (fitName.find("KF") != string::npos) { + // No. of skipped layers on track during Kalman track fit. + if (nSkippedLayers == 0) { + hisKalmanChi2DofSkipLay0Unmatched_[fitName]->Fill(fitTrk.chi2dof()); + } else if (nSkippedLayers == 1) { + hisKalmanChi2DofSkipLay1Unmatched_[fitName]->Fill(fitTrk.chi2dof()); + } else if (nSkippedLayers >= 2) { + hisKalmanChi2DofSkipLay2Unmatched_[fitName]->Fill(fitTrk.chi2dof()); + } + } + + hisFitVsSeedQinvPtUnmatched_[fitName]->Fill( htTrk.qOverPt(), fitTrk.qOverPt() ); + hisFitVsSeedPhi0Unmatched_[fitName]->Fill( htTrk.phi0(), fitTrk.phi0() ); + hisFitVsSeedD0Unmatched_[fitName]->Fill( htTrk.d0(), fitTrk.d0() ); + hisFitVsSeedZ0Unmatched_[fitName]->Fill( htTrk.z0(), fitTrk.z0() ); + hisFitVsSeedEtaUnmatched_[fitName]->Fill( htTrk.eta(), fitTrk.eta() ); + } + + // Study how incorrect stubs on track affect fit chi2. + profFitChi2VsPurity_[fitName]->Fill( fitTrk.getPurity(), fitTrk.chi2()); + profFitChi2DofVsPurity_[fitName]->Fill( fitTrk.getPurity(), fitTrk.chi2dof()); + + // Look at stub residuals w.r.t. fitted (or true) track. + if (tp != nullptr) { + //if (tp != nullptr && tp->pt() > 50 && fabs(tp->pdgId()) == 13 && tp->charge() > 0) { + //if (tp != nullptr && tp->pt() > 2 && tp->pt() < 2.5 && fabs(tp->pdgId()) == 13 && tp->charge() > 0) { + // --- Options for recalc histograms + // Choose to get residuals from truth particle or fitted track? + // (Only applies to chi2 method 2 below). + const bool recalc_useTP = false; + // debug printout + const bool recalc_debug = false; + // In residual plots, use residuals from method 2. (Imperfect, as neglects r-phi to r-z correlation). + const bool recalc_method2 = true; + + float recalcChiSquared_1_rphi = 0.; + float recalcChiSquared_1_rz = 0.; + float recalcChiSquared_2 = 0.; + const vector stubs = fitTrk.getStubs(); + if (recalc_debug) cout<<"RECALC loop stubs : HT cell=("<Fill( std::abs(tp->eta()), std::abs( fitTrk.qOverPt_bcon() - tp->qOverPt() ) ); + hisPhi0ResBeamVsTrueEta_[fitName]->Fill( std::abs(tp->eta()), std::abs(reco::deltaPhi(fitTrk.phi0_bcon(), tp->phi0()) ) ); + + hisQoverPtResBeamVsTrueInvPt_[fitName]->Fill( std::abs(tp->qOverPt()), std::abs( fitTrk.qOverPt_bcon() - tp->qOverPt() ) ); + hisPhi0ResBeamVsTrueInvPt_[fitName]->Fill( std::abs(tp->qOverPt()), std::abs(reco::deltaPhi(fitTrk.phi0_bcon(), tp->phi0()) ) ); + } + } + } + } + + //=== Study duplicate tracks. + + for (const TP& tp: vTPs) { + if (tpRecoedMap[&tp]) { // Was this truth particle successfully fitted? + profDupFitTrksVsEta_[fitName]->Fill(fabs(tp.eta()), tpRecoedDup[&tp] - 1); + profDupFitTrksVsInvPt_[fitName]->Fill(fabs(tp.qOverPt()), tpRecoedDup[&tp] - 1); + } + } + + //=== Study tracking efficiency by looping over tracking particles. + + for (const TP& tp: vTPs) { + + if (tp.useForEff()) { // Check TP is good for efficiency measurement. + + // Check which phi & eta sectors this TP is in. + int iEtaReg_TP = -1; + int iPhiSec_TP = -1; + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + Sector secTmp; + secTmp.init(settings_, iPhiSec, 0); + if (secTmp.insidePhiSec(tp)) iPhiSec_TP = iPhiSec; + } + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + Sector secTmp; + secTmp.init(settings_, 0, iEtaReg); + if (secTmp.insideEtaReg(tp)) iEtaReg_TP = iEtaReg; + } + + // If TP was reconstucted by HT, then plot its kinematics. + if (tpRecoedMap[&tp]) { // This truth particle was successfully fitted. + hisFitTPinvptForEff_[fitName]->Fill(1./tp.pt()); + hisFitTPptForEff_[fitName]->Fill(tp.pt()); + hisFitTPetaForEff_[fitName]->Fill(tp.eta()); + hisFitTPphiForEff_[fitName]->Fill(tp.phi0()); + // Plot also production point of all good reconstructed TP. + hisFitTPd0ForEff_[fitName]->Fill(fabs(tp.d0())); + hisFitTPz0ForEff_[fitName]->Fill(fabs(tp.z0())); + // Also plot efficiency to perfectly reconstruct the track (no fake hits) + if (tpPerfRecoedMap[&tp]) { // This truth particle was successfully fitted with no incorrect hits. + hisPerfFitTPinvptForEff_[fitName]->Fill(1./tp.pt()); + hisPerfFitTPptForEff_[fitName]->Fill(tp.pt()); + hisPerfFitTPetaForEff_[fitName]->Fill(tp.eta()); + } + if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. + hisFitTPinvptForAlgEff_[fitName]->Fill(1./tp.pt()); + hisFitTPptForAlgEff_[fitName]->Fill(tp.pt()); + hisFitTPetaForAlgEff_[fitName]->Fill(tp.eta()); + hisFitTPphiForAlgEff_[fitName]->Fill(tp.phi0()); + // Plot also production point of all good reconstructed TP. + hisFitTPd0ForAlgEff_[fitName]->Fill(fabs(tp.d0())); + hisFitTPz0ForAlgEff_[fitName]->Fill(fabs(tp.z0())); + // Plot sector number to understand if looser cuts are needed in certain regions. + hisFitTPphisecForAlgEff_[fitName]->Fill(iPhiSec_TP); + hisFitTPetasecForAlgEff_[fitName]->Fill(iEtaReg_TP); + // Also plot efficiency to perfectly reconstruct the track (no fake hits) + if (tpPerfRecoedMap[&tp]) { + hisPerfFitTPinvptForAlgEff_[fitName]->Fill(1./tp.pt()); + hisPerfFitTPptForAlgEff_[fitName]->Fill(tp.pt()); + hisPerfFitTPetaForAlgEff_[fitName]->Fill(tp.eta()); + hisPerfFitTPphisecForAlgEff_[fitName]->Fill(iPhiSec_TP); + hisPerfFitTPetasecForAlgEff_[fitName]->Fill(iEtaReg_TP); + // Efficiency inside jets. + if ( tp.tpInJet() ) { + hisPerfFitTPinvptForAlgEff_inJetPtG30_[fitName]->Fill(1./tp.pt()); + } + if ( tp.tpInHighPtJet() ) { + hisPerfFitTPinvptForAlgEff_inJetPtG100_[fitName]->Fill(1./tp.pt()); + } + if ( tp.tpInVeryHighPtJet() ) { + hisPerfFitTPinvptForAlgEff_inJetPtG200_[fitName]->Fill(1./tp.pt()); + } + } + } + } + } + } + } +} + +//=== Produce plots of tracking efficiency after HT or after r-z track filter (run at end of job). + +TFileDirectory Histos::plotTrackEfficiency(string tName) { + + // Define lambda function to facilitate adding "tName" to directory & histogram names. + auto addn = [tName](string s){ return TString::Format("%s_%s", s.c_str(), tName.c_str()); }; + + TFileDirectory inputDir = fs_->mkdir(addn("Effi").Data()); + // Plot tracking efficiency + makeEfficiencyPlot(inputDir, teffEffVsInvPt_[tName], hisRecoTPinvptForEff_[tName], hisTPinvptForEff_, + addn("EffVsInvPt"), "; 1/Pt; Tracking efficiency" ); + makeEfficiencyPlot(inputDir, teffEffVsPt_[tName], hisRecoTPptForEff_[tName], hisTPptForEff_, + addn("EffVsPt"), "; Pt; Tracking efficiency" ); + makeEfficiencyPlot(inputDir, teffEffVsEta_[tName], hisRecoTPetaForEff_[tName], hisTPetaForEff_, + addn("EffVsEta"), "; #eta; Tracking efficiency" ); + + // std::cout << "Made first graph" << std::endl; + // graphEffVsEta_[tName] = inputDir.make(hisRecoTPetaForEff_[tName], hisTPetaForEff_); + // graphEffVsEta_[tName]->SetNameTitle("EffVsEta","; #eta; Tracking efficiency"); + makeEfficiencyPlot(inputDir, teffEffVsPhi_[tName], hisRecoTPphiForEff_[tName], hisTPphiForEff_, + addn("EffVsPhi"), "; #phi; Tracking efficiency"); + + makeEfficiencyPlot( inputDir, teffEffVsD0_[tName], hisRecoTPd0ForEff_[tName], hisTPd0ForEff_, + addn("EffVsD0"),"; d0 (cm); Tracking efficiency"); + makeEfficiencyPlot( inputDir, teffEffVsZ0_[tName], hisRecoTPz0ForEff_[tName], hisTPz0ForEff_, + addn("EffVsZ0"),"; z0 (cm); Tracking efficiency"); + + // Also plot efficiency to reconstruct track perfectly. + makeEfficiencyPlot( inputDir, teffPerfEffVsInvPt_[tName], hisPerfRecoTPinvptForEff_[tName], hisTPinvptForEff_, + addn("PerfEffVsInvPt"),"; 1/Pt; Tracking perfect efficiency"); + makeEfficiencyPlot( inputDir, teffPerfEffVsPt_[tName], hisPerfRecoTPptForEff_[tName], hisTPptForEff_, + addn("PerfEffVsPt"),"; Pt; Tracking perfect efficiency"); + makeEfficiencyPlot( inputDir, teffPerfEffVsEta_[tName], hisPerfRecoTPetaForEff_[tName], hisTPetaForEff_, + addn("PerfEffVsEta"),"; #eta; Tracking perfect efficiency"); + + // Plot algorithmic tracking efficiency + makeEfficiencyPlot( inputDir, teffAlgEffVsInvPt_[tName], hisRecoTPinvptForAlgEff_[tName], hisTPinvptForAlgEff_, + addn("AlgEffVsInvPt"),"; 1/Pt; Tracking efficiency"); + makeEfficiencyPlot( inputDir, teffAlgEffVsPt_[tName], hisRecoTPptForAlgEff_[tName], hisTPptForAlgEff_, + addn("AlgEffVsPt"),"; Pt; Tracking efficiency"); + makeEfficiencyPlot( inputDir, teffAlgEffVsEta_[tName], hisRecoTPetaForAlgEff_[tName], hisTPetaForAlgEff_, + addn("AlgEffVsEta"),"; #eta; Tracking efficiency"); + makeEfficiencyPlot( inputDir, teffAlgEffVsPhi_[tName], hisRecoTPphiForAlgEff_[tName], hisTPphiForAlgEff_, + addn("AlgEffVsPhi"),"; #phi; Tracking efficiency"); + + makeEfficiencyPlot( inputDir, teffAlgEffVsD0_[tName], hisRecoTPd0ForAlgEff_[tName], hisTPd0ForAlgEff_, + addn("AlgEffVsD0"),"; d0 (cm); Tracking efficiency"); + makeEfficiencyPlot( inputDir, teffAlgEffVsZ0_[tName], hisRecoTPz0ForAlgEff_[tName], hisTPz0ForAlgEff_, + addn("AlgEffVsZ0"),"; z0 (cm); Tracking efficiency"); + + makeEfficiencyPlot( inputDir, teffAlgEffVsPhiSec_[tName], hisRecoTPphisecForAlgEff_[tName], hisTPphisecForAlgEff_, + addn("AlgEffVsPhiSec"),"; #phi sector; Tracking efficiency"); + makeEfficiencyPlot( inputDir, teffAlgEffVsEtaSec_[tName], hisRecoTPetasecForAlgEff_[tName], hisTPetasecForAlgEff_, + addn("AlgEffVsEtaSec"),"; #eta sector; Tracking efficiency"); + + makeEfficiencyPlot( inputDir, teffAlgEffVsInvPt_inJetPtG30_[tName], hisRecoTPinvptForAlgEff_inJetPtG30_[tName], hisTPinvptForAlgEff_inJetPtG30_, + addn("AlgEffVsInvPt_inJetPtG30"),"; 1/Pt; Tracking efficiency"); + + makeEfficiencyPlot( inputDir, teffAlgEffVsInvPt_inJetPtG100_[tName], hisRecoTPinvptForAlgEff_inJetPtG100_[tName], hisTPinvptForAlgEff_inJetPtG100_, + addn("AlgEffVsInvPt_inJetPtG100"),"; 1/Pt; Tracking efficiency"); + + makeEfficiencyPlot( inputDir, teffAlgEffVsInvPt_inJetPtG200_[tName], hisRecoTPinvptForAlgEff_inJetPtG200_[tName], hisTPinvptForAlgEff_inJetPtG200_, + addn("AlgEffVsInvPt_inJetPtG200"),"; 1/Pt; Tracking efficiency"); + + // Also plot algorithmic efficiency to reconstruct track perfectly. + makeEfficiencyPlot( inputDir, teffPerfAlgEffVsInvPt_[tName], hisPerfRecoTPinvptForAlgEff_[tName], hisTPinvptForAlgEff_, + addn("PerfAlgEffVsInvPt"),"; 1/Pt; Tracking perfect efficiency"); + makeEfficiencyPlot( inputDir, teffPerfAlgEffVsPt_[tName], hisPerfRecoTPptForAlgEff_[tName], hisTPptForAlgEff_, + addn("PerfAlgEffVsPt"),"; Pt; Tracking perfect efficiency"); + makeEfficiencyPlot( inputDir, teffPerfAlgEffVsEta_[tName], hisPerfRecoTPetaForAlgEff_[tName], hisTPetaForAlgEff_, + addn("PerfAlgEffVsEta"),"; #eta; Tracking perfect efficiency"); + + makeEfficiencyPlot( inputDir, teffPerfAlgEffVsPhiSec_[tName], hisPerfRecoTPphisecForAlgEff_[tName], hisTPphisecForAlgEff_, + addn("PerfAlgEffVsPhiSec"),"; #phi sector; Tracking perfect efficiency"); + makeEfficiencyPlot( inputDir, teffPerfAlgEffVsEtaSec_[tName], hisPerfRecoTPetasecForAlgEff_[tName], hisTPetasecForAlgEff_, + addn("PerfAlgEffVsEtaSec"),"; #eta sector; Tracking perfect efficiency"); + + return inputDir; +} + +//=== Produce plots of tracking efficiency after track fit (run at end of job). + +TFileDirectory Histos::plotTrackEffAfterFit(string fitName) { + + // Define lambda function to facilitate adding "fitName" to directory & histogram names. + auto addn = [fitName](string s){ return TString::Format("%s_%s", s.c_str(), fitName.c_str()); }; + + TFileDirectory inputDir = fs_->mkdir(addn("Effi").Data()); + // Plot tracking efficiency + makeEfficiencyPlot( inputDir, teffEffFitVsInvPt_[fitName], hisFitTPinvptForEff_[fitName], hisTPinvptForEff_, + addn("EffFitVsInvPt"),"; 1/Pt; Tracking efficiency"); + makeEfficiencyPlot( inputDir, teffEffFitVsPt_[fitName], hisFitTPptForEff_[fitName], hisTPptForEff_, + addn("EffFitVsPt"),"; Pt; Tracking efficiency"); + makeEfficiencyPlot( inputDir, teffEffFitVsEta_[fitName], hisFitTPetaForEff_[fitName], hisTPetaForEff_, + addn("EffFitVsEta"),"; #eta; Tracking efficiency"); + makeEfficiencyPlot( inputDir, teffEffFitVsPhi_[fitName], hisFitTPphiForEff_[fitName], hisTPphiForEff_, + addn("EffFitVsPhi"),"; #phi; Tracking efficiency"); + + makeEfficiencyPlot( inputDir, teffEffFitVsD0_[fitName], hisFitTPd0ForEff_[fitName], hisTPd0ForEff_, + addn("EffFitVsD0"),"; d0 (cm); Tracking efficiency"); + makeEfficiencyPlot( inputDir, teffEffFitVsZ0_[fitName], hisFitTPz0ForEff_[fitName], hisTPz0ForEff_, + addn("EffFitVsZ0"),"; z0 (cm); Tracking efficiency"); + + // Also plot efficiency to reconstruct track perfectly. + makeEfficiencyPlot( inputDir, teffPerfEffFitVsInvPt_[fitName], hisPerfFitTPinvptForEff_[fitName], hisTPinvptForEff_, + addn("PerfEffFitVsInvPt"),"; 1/Pt; Tracking perfect efficiency"); + makeEfficiencyPlot( inputDir, teffPerfEffFitVsPt_[fitName], hisPerfFitTPptForEff_[fitName], hisTPptForEff_, + addn("PerfEffFitVsPt"),"; Pt; Tracking perfect efficiency"); + makeEfficiencyPlot( inputDir, teffPerfEffFitVsEta_[fitName], hisPerfFitTPetaForEff_[fitName], hisTPetaForEff_, + addn("PerfEffFitVsEta"),"; #eta; Tracking perfect efficiency"); + + // Plot algorithmic tracking efficiency + makeEfficiencyPlot( inputDir, teffAlgEffFitVsInvPt_[fitName], hisFitTPinvptForAlgEff_[fitName], hisTPinvptForAlgEff_, + addn("AlgEffFitVsInvPt"),"; 1/Pt; Tracking efficiency"); + makeEfficiencyPlot( inputDir, teffAlgEffFitVsPt_[fitName], hisFitTPptForAlgEff_[fitName], hisTPptForAlgEff_, + addn("AlgEffFitVsPt"),"; Pt; Tracking efficiency"); + makeEfficiencyPlot( inputDir, teffAlgEffFitVsEta_[fitName], hisFitTPetaForAlgEff_[fitName], hisTPetaForAlgEff_, + addn("AlgEffFitVsEta"),"; #eta; Tracking efficiency"); + makeEfficiencyPlot( inputDir, teffAlgEffFitVsPhi_[fitName], hisFitTPphiForAlgEff_[fitName], hisTPphiForAlgEff_, + addn("AlgEffFitVsPhi"),"; #phi; Tracking efficiency"); + + makeEfficiencyPlot( inputDir, teffAlgEffFitVsD0_[fitName], hisFitTPd0ForAlgEff_[fitName], hisTPd0ForAlgEff_, + addn("AlgEffFitVsD0"),"; d0 (cm); Tracking efficiency"); + makeEfficiencyPlot( inputDir, teffAlgEffFitVsZ0_[fitName], hisFitTPz0ForAlgEff_[fitName], hisTPz0ForAlgEff_, + addn("AlgEffFitVsZ0"),"; z0 (cm); Tracking efficiency"); + + makeEfficiencyPlot( inputDir, teffAlgEffFitVsPhiSec_[fitName], hisFitTPphisecForAlgEff_[fitName], hisTPphisecForAlgEff_, + addn("AlgEffFitVsPhiSec"),"; #phi sector; Tracking efficiency"); + makeEfficiencyPlot( inputDir, teffAlgEffFitVsEtaSec_[fitName], hisFitTPetasecForAlgEff_[fitName], hisTPetasecForAlgEff_, + addn("AlgEffFitVsEtaSec"),"; #eta sector; Tracking efficiency"); + + // Also plot algorithmic efficiency to reconstruct track perfectly. + makeEfficiencyPlot( inputDir, teffPerfAlgEffFitVsInvPt_[fitName], hisPerfFitTPinvptForAlgEff_[fitName], hisTPinvptForAlgEff_, + addn("PerfAlgEffFitVsInvPt"),"; 1/Pt; Tracking perfect efficiency"); + makeEfficiencyPlot( inputDir, teffPerfAlgEffFitVsPt_[fitName], hisPerfFitTPptForAlgEff_[fitName], hisTPptForAlgEff_, + addn("PerfAlgEffFitVsPt"),"; Pt; Tracking perfect efficiency"); + makeEfficiencyPlot( inputDir, teffPerfAlgEffFitVsEta_[fitName], hisPerfFitTPetaForAlgEff_[fitName], hisTPetaForAlgEff_, + addn("Perf AlgEffFitVsEta"),"; #eta; Tracking perfect efficiency"); + makeEfficiencyPlot( inputDir, teffPerfAlgEffFitVsInvPt_inJetPtG30_[fitName], hisPerfFitTPinvptForAlgEff_inJetPtG30_[fitName], hisTPinvptForAlgEff_inJetPtG30_, + addn("PerfAlgEffFitVsInvPt_inJetPtG30"),"; 1/Pt; Tracking perfect efficiency"); + makeEfficiencyPlot( inputDir, teffPerfAlgEffFitVsInvPt_inJetPtG100_[fitName], hisPerfFitTPinvptForAlgEff_inJetPtG100_[fitName], hisTPinvptForAlgEff_inJetPtG100_, + addn("PerfAlgEffFitVsInvPt_inJetPtG100"),"; 1/Pt; Tracking perfect efficiency"); + makeEfficiencyPlot( inputDir, teffPerfAlgEffFitVsInvPt_inJetPtG200_[fitName], hisPerfFitTPinvptForAlgEff_inJetPtG200_[fitName], hisTPinvptForAlgEff_inJetPtG200_, + addn("PerfAlgEffFitVsInvPt_inJetPtG200"),"; 1/Pt; Tracking perfect efficiency"); + + makeEfficiencyPlot( inputDir, teffPerfAlgEffFitVsPhiSec_[fitName], hisPerfFitTPphisecForAlgEff_[fitName], hisTPphisecForAlgEff_, + addn("PerfAlgEffFitVsPhiSec"),"; #phi sector; Tracking perfect efficiency"); + makeEfficiencyPlot( inputDir, teffPerfAlgEffFitVsEtaSec_[fitName], hisPerfFitTPetasecForAlgEff_[fitName], hisTPetasecForAlgEff_, + addn("PerfAlgEffFitVsEtaSec"),"; #eta sector; Tracking perfect efficiency"); + + return inputDir; +} + +void Histos::makeEfficiencyPlot( TFileDirectory &inputDir, TEfficiency* outputEfficiency, TH1F* pass, TH1F* all, TString name, TString title ) { + + outputEfficiency = inputDir.make(*pass, *all); + outputEfficiency->SetName(name); + outputEfficiency->SetTitle(title); +} + +//=== Print summary of track-finding performance after track pattern reco. + +void Histos::printTrackPerformance(string tName) { + + float numTrackCands = profNumTrackCands_[tName]->GetBinContent(1); // No. of track cands + float numTrackCandsErr = profNumTrackCands_[tName]->GetBinError(1); // No. of track cands uncertainty + float numMatchedTrackCandsIncDups = profNumTrackCands_[tName]->GetBinContent(2); // Ditto, counting only those matched to TP + float numMatchedTrackCandsExcDups = profNumTrackCands_[tName]->GetBinContent(6); // Ditto, but excluding duplicates + float numFakeTracks = numTrackCands - numMatchedTrackCandsIncDups; + float numExtraDupTracks = numMatchedTrackCandsIncDups - numMatchedTrackCandsExcDups; + float fracFake = numFakeTracks/(numTrackCands + 1.0e-6); + float fracDup = numExtraDupTracks/(numTrackCands + 1.0e-6); + + float numStubsOnTracks = profStubsOnTracks_[tName]->GetBinContent(1); + float meanStubsPerTrack = numStubsOnTracks/(numTrackCands + 1.0e-6); //protection against demoninator equals zero. + unsigned int numRecoTPforAlg = hisRecoTPinvptForAlgEff_[tName]->GetEntries(); + // Histograms of input truth particles (e.g. hisTPinvptForAlgEff_), used for denominator of efficiencies, are identical, + // irrespective of whether made after HT or after r-z track filter, so always use the former. + unsigned int numTPforAlg = hisTPinvptForAlgEff_->GetEntries(); + unsigned int numPerfRecoTPforAlg = hisPerfRecoTPinvptForAlgEff_[tName]->GetEntries(); + float algEff = float(numRecoTPforAlg)/(numTPforAlg + 1.0e-6); //protection against demoninator equals zero. + float algEffErr = sqrt(algEff*(1-algEff)/(numTPforAlg + 1.0e-6)); // uncertainty + float algPerfEff = float(numPerfRecoTPforAlg)/(numTPforAlg + 1.0e-6); //protection against demoninator equals zero. + float algPerfEffErr = sqrt(algPerfEff*(1-algPerfEff)/(numTPforAlg + 1.0e-6)); // uncertainty + + cout.setf(ios::fixed, ios::floatfield); + cout.precision(4); + + cout<<"========================================================================="<GetBinContent(1); // No. of track cands + float numFitTracksErr = profNumFitTracks_[fitName]->GetBinError(1); // No. of track cands uncertainty + float numMatchedFitTracksIncDups = profNumFitTracks_[fitName]->GetBinContent(2); // Ditto, counting only those matched to TP + float numMatchedFitTracksExcDups = profNumFitTracks_[fitName]->GetBinContent(6); // Ditto, but excluding duplicates + float numFakeFitTracks = numFitTracks - numMatchedFitTracksIncDups; + float numExtraDupFitTracks = numMatchedFitTracksIncDups - numMatchedFitTracksExcDups; + float fracFakeFit = numFakeFitTracks/(numFitTracks + 1.0e-6); + float fracDupFit = numExtraDupFitTracks/(numFitTracks + 1.0e-6); + + float numStubsOnFitTracks = profStubsOnFitTracks_[fitName]->GetBinContent(1); + float meanStubsPerFitTrack = numStubsOnFitTracks/(numFitTracks + 1.0e-6); //protection against demoninator equals zero. + unsigned int numFitTPforAlg = hisFitTPinvptForAlgEff_[fitName]->GetEntries(); + // Histograms of input truth particles (e.g. hisTPinvptForAlgEff_), used for denominator of efficiencies, are identical, + // irrespective of whether made after HT or after r-z track filter, so always use the former. + unsigned int numTPforAlg = hisTPinvptForAlgEff_->GetEntries(); + unsigned int numPerfFitTPforAlg = hisPerfFitTPinvptForAlgEff_[fitName]->GetEntries(); + float fitEff = float(numFitTPforAlg)/(numTPforAlg + 1.0e-6); //protection against demoninator equals zero. + float fitEffErr = sqrt(fitEff*(1-fitEff)/(numTPforAlg + 1.0e-6)); // uncertainty + float fitPerfEff = float(numPerfFitTPforAlg)/(numTPforAlg + 1.0e-6); //protection against demoninator equals zero. + float fitPerfEffErr = sqrt(fitPerfEff*(1-fitPerfEff)/(numTPforAlg + 1.0e-6)); // uncertainty + + // Does this fitter require r-z track filter to be run before it? + bool useRZfilt = (std::count(useRZfilter_.begin(), useRZfilter_.end(), fitName) > 0); + + cout<<"========================================================================="<rzFilterName()<<"' r-z track filter.)"<detailedFitOutput() ){ + cout << endl<< "More detailed information about helix fit:"<enabled() ) return; + + // Protection when running in wierd mixed hybrid-TMTT modes. + bool wierdMixedMode = (hisRecoTPinvptForEff_.find("TRACKLET") == hisRecoTPinvptForEff_.end()); + + if (settings_->hybrid() && not wierdMixedMode) { + + // Produce plots of tracking efficieny after tracklet pattern reco. + this->plotTrackletSeedEfficiency(); + this->plotTrackEfficiency("TRACKLET"); + this->plotHybridDupRemovalEfficiency(); + + } else { + + // Produce plots of tracking efficiency using track candidates found after HT. + this->plotTrackEfficiency("HT"); + + // Optionally produce plots of tracking efficiency using track candidates found after r-z track filter. + if (ranRZfilter_) this->plotTrackEfficiency("RZ"); + } + + // Produce more plots of tracking efficiency using track candidates after track fit. + for (auto &fitName : trackFitters_) { + this->plotTrackEffAfterFit(fitName); + } + + cout << "=========================================================================" << endl; + + // Print r (z) range in which each barrel layer (endcap wheel) appears. + // (Needed by firmware). + cout<hybrid() && not wierdMixedMode) { + //--- Print summary of tracklet pattern reco + this->printTrackletSeedFindingPerformance(); + this->printTrackPerformance("TRACKLET"); + this->printHybridDupRemovalPerformance(); + } else { + //--- Print summary of track-finding performance after HT + this->printTrackPerformance("HT"); + //--- Optionally print summary of track-finding performance after r-z track filter. + if (ranRZfilter_) this->printTrackPerformance("RZ"); + } + + //--- Print summary of track-finding performance after helix fit, for each track fitting algorithm used. + for (const string& fitName : trackFitters_) { + this->printFitTrackPerformance(fitName); + } + cout << "=========================================================================" << endl; + + if (not settings_->hybrid()) { + // Check that stub filling was consistent with known limitations of HT firmware design. + + cout< 0.) { + + cout<<"WARNING: Despite line gradients being less than one, some fraction of HT columns have filled cells with no filled neighbours in W, SW or NW direction. Firmware will object to this! "; + cout<<"This fraction = "< 0.) { + + cout<<"WARNING: Despite line gradients being less than one, some fraction of HT columns recorded individual stubs being added to more than two cells! Thomas firmware will object to this! "; + cout<<"This fraction = "<GetMean(); + if (meanShared > 0.01) cout<GetMean(2); + if (meanFracStubsLost > 0.001) cout<enabled() ) return; + + cout << endl << "=========================================================================" << endl; + cout << "--- Fit to cfg params for FPGA-friendly approximation to B parameter in GP & KF ---" << endl; + cout << "--- (used to allowed for tilted barrel modules) ---" << endl; + // Check that info on the correct number of modules has been stored + if ( trackerGeometryInfo.moduleZoR().size() != trackerGeometryInfo.barrelNTiltedModules() * trackerGeometryInfo.barrelNLayersWithTiltedModules() * 2 ) { + cout << "WARNING : Expected " << trackerGeometryInfo.barrelNTiltedModules() * trackerGeometryInfo.barrelNLayersWithTiltedModules() * 2 << " modules, but only recorded info on " << trackerGeometryInfo.moduleZoR().size() << endl; + } + + TFileDirectory inputDir = fs_->mkdir("InputData"); + graphBVsZoverR_ = inputDir.make( trackerGeometryInfo.moduleZoR().size(), &trackerGeometryInfo.moduleZoR()[0], &trackerGeometryInfo.moduleB()[0] ); + graphBVsZoverR_->SetNameTitle("B vs module Z/R","; Module Z/R; B"); + graphBVsZoverR_->Fit("pol1","q"); + TF1* fittedFunction = graphBVsZoverR_->GetFunction("pol1"); + double gradient = fittedFunction->GetParameter(1); + double intercept = fittedFunction->GetParameter(0); + cout << " BApprox_gradient (fitted) = " << gradient << endl; + cout << " BApprox_intercept (fitted) = " << intercept << endl; + // Check fitted params consistent with those assumed in cfg file. + if (settings_->useApproxB()) { + double gradientDiff = fabs( gradient - settings_->bApprox_gradient() ); + double interceptDiff = fabs( intercept - settings_->bApprox_intercept() ); + if ( gradientDiff > 0.001 || interceptDiff > 0.001 ) { // Uncertainty independent of number of events + cout << endl << "WARNING: fitted parameters inconsistent with those specified in cfg file:" << endl; + cout << " BApprox_gradient (cfg) = " << settings_->bApprox_gradient() << endl; + cout << " BApprox_intercept (cfg) = " << settings_->bApprox_intercept() << endl; + bApproxMistake_ = true; // Note that problem has occurred. + } + } + +} + + +} diff --git a/L1Trigger/TrackFindingTMTT/src/InputData.cc b/L1Trigger/TrackFindingTMTT/src/InputData.cc new file mode 100644 index 0000000000000..bc6fcb907231f --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/InputData.cc @@ -0,0 +1,149 @@ +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Utilities/interface/InputTag.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" + +#include "SimDataFormats/Track/interface/SimTrack.h" +#include "SimDataFormats/EncodedEventId/interface/EncodedEventId.h" + +// #include "Geometry/Records/interface/StackedTrackerGeometryRecord.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" + +// TTStubAssociationMap.h forgets to two needed files, so must include them here ... +#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h" +#include "SimTracker/TrackTriggerAssociation/interface/TTClusterAssociationMap.h" +#include "SimTracker/TrackTriggerAssociation/interface/TTStubAssociationMap.h" + +#include "DataFormats/JetReco/interface/GenJetCollection.h" +#include "DataFormats/JetReco/interface/GenJet.h" + +#include "L1Trigger/TrackFindingTMTT/interface/InputData.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" + +#include + +using namespace std; + +namespace TMTT { + +InputData::InputData(const edm::Event& iEvent, const edm::EventSetup& iSetup, Settings* settings, + const edm::EDGetTokenT tpInputTag, + const edm::EDGetTokenT stubInputTag, + const edm::EDGetTokenT stubTruthInputTag, + const edm::EDGetTokenT clusterTruthInputTag, + const edm::EDGetTokenT< reco::GenJetCollection > genJetInputTag + ) + { + + vTPs_.reserve(2500); + vStubs_.reserve(35000); + vAllStubs_.reserve(35000); + + // Note if job will use MC truth info (or skip it to save CPU). + enableMCtruth_ = settings->enableMCtruth(); + + // Get TrackingParticle info + + edm::Handle tpHandle; + + if (enableMCtruth_) { + iEvent.getByToken(tpInputTag, tpHandle ); + + unsigned int tpCount = 0; + for (unsigned int i = 0; i < tpHandle->size(); i++) { + const TrackingParticle& tPart = tpHandle->at(i); + // Creating Ptr uses CPU, so apply Pt cut here, copied from TP::fillUse(), to avoid doing it too often. + const float ptMin = min(settings->genMinPt(), 0.7*settings->houghMinPt()); + if (tPart.pt() > ptMin) { + TrackingParticlePtr tpPtr(tpHandle, i); + // Store the TrackingParticle info, using class TP to provide easy access to the most useful info. + TP tp(tpPtr, tpCount, settings); + // Only bother storing tp if it could be useful for tracking efficiency or fake rate measurements. + if (tp.use()) { + + edm::Handle< reco::GenJetCollection > genJetHandle; + iEvent.getByToken(genJetInputTag, genJetHandle); + if ( genJetHandle.isValid() ) { + tp.fillNearestJetInfo( genJetHandle.product() ); + } + + vTPs_.push_back( tp ); + tpCount++; + } + } + } + } + + // Also create map relating edm::Ptr to TP. + + map, const TP* > translateTP; + + if (enableMCtruth_) { + for (const TP& tp : vTPs_) { + TrackingParticlePtr tpPtr(tp); + translateTP[tpPtr] = &tp; + } + } + + // Get the tracker geometry info needed to unpack the stub info. + + edm::ESHandle trackerGeometryHandle; + iSetup.get().get( trackerGeometryHandle ); + + const TrackerGeometry* trackerGeometry = trackerGeometryHandle.product(); + + edm::ESHandle trackerTopologyHandle; + iSetup.get().get(trackerTopologyHandle); + + const TrackerTopology* trackerTopology = trackerTopologyHandle.product(); + + // Get stub info, by looping over modules and then stubs inside each module. + // Also get the association map from stubs to tracking particles. + + edm::Handle ttStubHandle; + edm::Handle mcTruthTTStubHandle; + edm::Handle mcTruthTTClusterHandle; + iEvent.getByToken(stubInputTag, ttStubHandle ); + if (enableMCtruth_) { + iEvent.getByToken(stubTruthInputTag, mcTruthTTStubHandle ); + iEvent.getByToken(clusterTruthInputTag, mcTruthTTClusterHandle ); + } + + unsigned int stubCount = 0; + + for (DetSetVec::const_iterator p_module = ttStubHandle->begin(); p_module != ttStubHandle->end(); p_module++) { + for (DetSet::const_iterator p_ttstub = p_module->begin(); p_ttstub != p_module->end(); p_ttstub++) { + TTStubRef ttStubRef = edmNew::makeRefTo(ttStubHandle, p_ttstub ); + + // Store the Stub info, using class Stub to provide easy access to the most useful info. + Stub stub(ttStubRef, stubCount, settings, trackerGeometry, trackerTopology ); + // Also fill truth associating stubs to tracking particles. + if (enableMCtruth_) stub.fillTruth(translateTP, mcTruthTTStubHandle, mcTruthTTClusterHandle); + vAllStubs_.push_back( stub ); + stubCount++; + } + } + + // Produced reduced list containing only the subset of stubs that the user has declared will be + // output by the front-end readout electronics. + for (const Stub& s : vAllStubs_) { + if (s.frontendPass()) vStubs_.push_back( &s ); + } + // Optionally sort stubs according to bend, so highest Pt ones are sent from DTC to GP first. + if (settings->orderStubsByBend()) std::sort(vStubs_.begin(), vStubs_.end(), SortStubsInBend()); + + // Note list of stubs produced by each tracking particle. + // (By passing vAllStubs_ here instead of vStubs_, it means that any algorithmic efficiencies + // measured will be reduced if the tightened frontend electronics cuts, specified in section StubCuts + // of Analyze_Defaults_cfi.py, are not 100% efficient). + if (enableMCtruth_) { + for (unsigned int j = 0; j < vTPs_.size(); j++) { + vTPs_[j].fillTruth(vAllStubs_); + } + } +} + +} diff --git a/L1Trigger/TrackFindingTMTT/src/KF4ParamsComb.cc.bak b/L1Trigger/TrackFindingTMTT/src/KF4ParamsComb.cc.bak new file mode 100644 index 0000000000000..26ebf1652da9a --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/KF4ParamsComb.cc.bak @@ -0,0 +1,394 @@ +///=== This is the Kalman Combinatorial Filter for 4 helix parameters track fit algorithm. + + +#include "L1Trigger/TrackFindingTMTT/interface/KF4ParamsComb.h" +#include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" +#include "L1Trigger/TrackFindingTMTT/interface/StubCluster.h" +#define CKF_DEBUG + +namespace TMTT { + +/* +// Scattering constants - HISTORIC NOT USED. + +static unsigned nlayer_eta[25] = +{ 6, 6, 6, 6, +6, 6, 6, 6, 6, 6, 6, 7, 7, 7, +7, 7, 7, 7, 6, 6, 6, 6, 6, 6}; + +static double matx_outer[25] = { +0.16, 0.17, 0.18, 0.19, 0.20, +0.21, 0.26, 0.22, 0.26, 0.38, +0.41, 0.40, 0.44, 0.50, 0.54, +0.60, 0.44, 0.48, 0.60, 0.68, +0.50, 0.48, 0.64, 0.39, 0.20 +}; + +static double matx_inner[25] = { +0.14, 0.1, 0.1, 0.1, 0.1, +0.1, 0.1, 0.1, 0.1, 0.1, +0.12, 0.1, 0.1, 0.1, 0.15, +0.20, 0.25, 0.25, 0.3, 0.3, +0.35, 0.40, 0.40, 0.6, 0.6 +}; +*/ + +static double wrapRadian( double t ){ + + if( t > 0 ){ + while( t > M_PI ) t-= 2*M_PI; + } + else{ + while( t < - M_PI ) t+= 2*M_PI; + } + return t; +} + + + +KF4ParamsComb::KF4ParamsComb(const Settings* settings, const uint nPar, const string &fitterName ) : L1KalmanComb(settings, nPar, fitterName ){ + + hdxmin[INV2R] = -1.1e-4; + hdxmax[INV2R] = +1.1e-4; + hdxmin[PHI0] = -6.e-3; + hdxmax[PHI0] = +6.e-3; + hdxmin[Z0] = -4.1; + hdxmax[Z0] = +4.1; + hdxmin[T] = -6.; + hdxmax[T] = +6.; + + hxmin[INV2R] = -0.3 * 0.0057; + hxmax[INV2R] = +0.3 * 0.0057; + hxmin[PHI0] = -0.3; + hxmax[PHI0] = +0.3; + hxmin[Z0] = -120; + hxmax[Z0] = +120; + hxmin[T] = -6.; + hxmax[T] = +6.; + + hddMeasmin[PHI0] = -1.e1; + hddMeasmax[PHI0] = +1.e1; + + hresmin[PHI0] = -0.5; + hresmax[PHI0] = +0.5; + + hresmin[PHI0] = -10.; + hresmax[PHI0] = +10.; + + + hxaxtmin[INV2R] = -1.e-3; + hxaxtmax[INV2R] = +1.e-3; + hxaxtmin[PHI0] = -1.e-1; + hxaxtmax[PHI0] = +1.e-1; + hxaxtmin[Z0] = -10.; + hxaxtmax[Z0] = +10.; + hxaxtmin[T] = -1.e-0; + hxaxtmax[T] = +1.e-0; +} + + +std::map KF4ParamsComb::getTrackParams(const KalmanState *state )const{ + + std::vector x = state->xa(); + std::map y; + y["qOverPt"] = x.at(INV2R) / getSettings()->invPtToInvR() * 2.; + y["phi0"] = wrapRadian( x.at(PHI0) + sectorPhi() ); + y["z0"] = x.at(Z0); + y["t"] = x.at(T); + y["d0"] = 0; + return y; +} + +/* The Kalman measurement matrix = derivative of helix intercept w.r.t. helix params + * Here I always measure phi(r), and z(r) */ +TMatrixD KF4ParamsComb::H(const StubCluster* stubCluster)const{ + TMatrixD h(2, nPar_); + double r = stubCluster->r(); + h(PHI,INV2R) = -r; + h(PHI,PHI0) = 1; + h(Z,Z0) = 1; + h(Z,T) = r; + return h; +} + +// Not used? + +TMatrixD KF4ParamsComb::dH(const StubCluster* stubCluster)const{ + + double dr(0); + if(stubCluster->layerId() > 10){ + dr = stubCluster->sigmaZ(); + } + + TMatrixD h(2, nPar_); + h(PHI,INV2R) = -dr; + h(Z,T) = dr; + + return h; +} + +/* Seed the state vector */ +std::vector KF4ParamsComb::seedx(const L1track3D& l1track3D)const{ + + std::vector x(nPar_); + x[INV2R] = getSettings()->invPtToInvR() * l1track3D.qOverPt()/2; + x[PHI0] = wrapRadian( l1track3D.phi0() - sectorPhi() ); + x[Z0] = l1track3D.z0(); + x[T] = l1track3D.tanLambda(); + + return x; +} + +/* Seed the covariance matrix */ +TMatrixD KF4ParamsComb::seedP(const L1track3D& l1track3D)const{ + TMatrixD p(nPar_,nPar_); + + double c = getSettings()->invPtToInvR() / 2; + + if ( getSettings()->numEtaRegions() == 18 ) { + + // optimised for 18x2 sectors with additional error factor in pt/phi to avoid pulling towards wrong HT params + p(INV2R,INV2R) = 0.0157 * 0.0157 * c * c * 4; + p(PHI0,PHI0) = 0.0051 * 0.0051 * 4; + p(Z0,Z0) = 5.0 * 5.0; + p(T,T) = 0.25 * 0.25 * 4; // IRT: increased by factor 4, as was affecting fit chi2. + + } else { + + // choose large errors + p(INV2R,INV2R) = 0.0157 * 0.0157 * c * c * 10; + p(PHI0,PHI0) = 0.0051 * 0.0051 * 10; + p(Z0,Z0) = 5.0 * 5.0; + p(T,T) = 0.25 * 0.25 * 10; + + } + + return p; +} + +/* The forecast matrix + * (here equals identity matrix) */ +TMatrixD KF4ParamsComb::F(const StubCluster* stubCluster, const KalmanState *state )const{ + TMatrixD F(nPar_,nPar_); + for(unsigned int n = 0; n < nPar_; n++) + F(n, n) = 1; + return F; +} + +/* the vector of measurements */ +std::vector KF4ParamsComb::d(const StubCluster* stubCluster )const{ + std::vector meas; + meas.resize(2); + meas[PHI] = wrapRadian( stubCluster->phi() - sectorPhi() ); + meas[Z] = stubCluster->z(); + return meas; +} + +// Assumed hit resolution in (phi,z) +TMatrixD KF4ParamsComb::PddMeas(const StubCluster* stubCluster, const KalmanState *state )const{ + + double inv2R = (getSettings()->invPtToInvR()) * 0.5 * state->candidate().qOverPt(); // alternatively use state->xa().at(INV2R) + double inv2R2 = inv2R * inv2R; + + double tanl = state->xa().at(T); // factor of 0.9 improves rejection + double tanl2 = tanl * tanl; + + TMatrixD p(2,2); + + double vphi(0); + double vz(0); + double vcorr(0); + + // consider error due to integerisation only for z (r in encap) coord when enabled + double err_digi2(0); + if (getSettings()->enableDigitize()) err_digi2 = 0.15625 * 0.15625 / 12.0; + + double a = stubCluster->sigmaX() * stubCluster->sigmaX(); + double b = stubCluster->sigmaZ() * stubCluster->sigmaZ() + err_digi2; + double r2 = stubCluster->r() * stubCluster->r(); + double invr2 = 1./r2; + + // Scattering term scaling as 1/Pt. + double sigmaScat = getSettings()->kalmanMultiScattTerm()/(state->candidate().pt()); + double sigmaScat2 = sigmaScat * sigmaScat; + + if ( stubCluster->barrel() ) { + + vphi = (a * invr2) + sigmaScat2; + + if (stubCluster->tiltedBarrel()) { + // Convert uncertainty in (r,phi) to (z,phi). + float scaleTilted = 1.; + if (getSettings()->kalmanHOtilted()) { + if ( getSettings()->useApproxB() ) { // Simple firmware approximation + scaleTilted = getApproxB(stubCluster->z(), stubCluster->r()); + } else { // Exact C++ implementation. + float tilt = stubCluster->moduleTilt(); + scaleTilted = sin(tilt) + cos(tilt)*tanl; + } + } + float scaleTilted2 = scaleTilted*scaleTilted; + // This neglects the non-radial strip effect, assumed negligeable for PS. + vz = b * scaleTilted2; + } else { + vz = b; + } + + if (getSettings()->kalmanHOdodgy()) { + // Use original (Dec. 2016) dodgy implementation was this. + vz = b; + } + + } else { + + vphi = a * invr2 + sigmaScat2; + vz = (b * tanl2); + + if (not stubCluster->psModule()) { // Neglect these terms in PS + double beta = 0.; + // Add correlation term related to conversion of stub residuals from (r,phi) to (z,phi). + if (getSettings()->kalmanHOprojZcorr() == 2) beta += -inv2R; + // Add alpha correction for non-radial 2S endcap strips.. + if (getSettings()->kalmanHOalpha() == 2) beta += -stubCluster->alpha(); // alpha is 0 except in endcap 2S disks + + double beta2 = beta * beta; + vphi += b * beta2; + vcorr = b * (beta * tanl); + + // IRT - for checking efficiency of removing phi-z correlation from projection. + // "ultimate_off1" + //vphi = a * invr2 + b * pow(-stubCluster->alpha(), 2) + b * inv2R2 + sigmaScat2; + //vcorr = b * ((-stubCluster->alpha()) * tanl); + + // IRT - This higher order correction doesn't significantly improve the track fit performance, so commented out. + //if (getSettings()->kalmanHOhelixExp()) { + // float dsByDr = 1. + (1./2.)*r2*inv2R2; // Allows for z = z0 + s*tanL, where s is not exactly r due to circle. + // vcorr *= dsByDr; + // vz *= dsByDr * dsByDr; + //} + + if (getSettings()->kalmanHOdodgy()) { + // Use original (Dec. 2016) dodgy implementation was this. + vphi = (a * invr2) + (b * inv2R2) + sigmaScat2; + vcorr = 0.; + vz = (b * tanl2); + } + } + } + + p(PHI, PHI) = vphi; + p(Z, Z) = vz; + p(PHI, Z) = vcorr; + p(Z, PHI) = vcorr; + + return p; + +} + +// State uncertainty due to scattering -- HISTORIC NOT USED +TMatrixD KF4ParamsComb::PxxModel( const KalmanState *state, const StubCluster *stubCluster )const +{ + + TMatrixD p(nPar_,nPar_); + + /* + if( getSettings()->kalmanMultiScattFactor() ){ + + unsigned i_eta = abs( stubCluster->eta() / 0.1 ); + if( i_eta > 24 ) i_eta = 24; + double dl = matx_outer[i_eta] / nlayer_eta[i_eta]; + + unsigned stub_itr = state->nextLayer(); + + const KalmanState * last_update_state = state->last_update_state(); + unsigned last_itr(1); + if( last_update_state ) last_itr = last_update_state->nextLayer(); + dl = ( stub_itr - last_itr ) * dl; + + if( dl ){ + std::map y = getTrackParams( state ); + double dtheta0 = 1./sqrt(3) * 0.0136 * fabs(y["qOverPt"]) * sqrt(dl)*( 1+0.038*log(dl) ); + dtheta0 *= getSettings()->kalmanMultiScattFactor(); + p(PHI0, PHI0) = dtheta0 * dtheta0; // Despite the name, I think this is uncertainty in phi0. I guess uncertainty in theta0 neglected compared to detector resolution. + } + } + */ + + return p; +} + +bool KF4ParamsComb::isGoodState( const KalmanState &state )const +{ + + unsigned nStubLayers = state.nStubLayers(); + bool goodState( true ); + + // todo : make configurable + + // N.B. Code below changed by Alexander Morton to allow tracking down to Pt = 2 GeV. + + double pt=fabs( getSettings()->invPtToInvR() / (2*state.xa()[INV2R]) ); + double z0=fabs( state.xa()[Z0] ); + + // state parameter selections + if( nStubLayers >= 2 ){ + + if( z0 > 15. ) goodState = false; + + const double tolerance = (nStubLayers >= 4) ? 0.05 : 0.1; + if( pt < getSettings()->houghMinPt() - tolerance) goodState = false; + } + + // chi2 selections + if (getSettings()->kalmanMultiScattTerm() < 0.0001) { // scattering ignored + if( nStubLayers == 2 ) { + if (state.chi2() > 15.0) goodState=false; // No separate pT selection needed + } else if ( nStubLayers == 3 ) { + if (state.chi2() > 100.0 && pt > 2.7) goodState=false; + if (state.chi2() > 120.0 && pt <= 2.7) goodState=false; + } else if ( nStubLayers == 4 ) { + if (state.chi2() > 320.0 && pt > 2.7) goodState=false; + if (state.chi2() > 1420.0 && pt <= 2.7) goodState=false; + } else if ( nStubLayers == 5 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! + if (state.chi2() > 480.0 && pt > 2.7) goodState=false; + if (state.chi2() > 2130.0 && pt <= 2.7) goodState=false; + } else if ( nStubLayers >= 6 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! + if (state.chi2() > 640.0 && pt > 2.7) goodState=false; + if (state.chi2() > 2840.0 && pt <= 2.7) goodState=false; + } + + } else { // scattering taken into account. + + if( nStubLayers == 2 ) { + if (state.chi2() > 10.0) goodState=false; // No separate pT selection needed + } else if ( nStubLayers == 3 ) { + if (state.chi2() > 30.0) goodState=false; + } else if ( nStubLayers == 4 ) { + if (state.chi2() > 80.0) goodState=false; + } else if ( nStubLayers == 5 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! + if (state.chi2() > 120.0) goodState=false; + } else if ( nStubLayers >= 6 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! + if (state.chi2() > 160.0) goodState=false; + } + } + + // IRT + //if( nStubLayers >= 4 ) { + //std::map trackParams = getTrackParams(&state); + //L1fittedTrack fitTrkTmp(getSettings(), state.candidate(), state.stubs(), trackParams["qOverPt"], trackParams["d0"], trackParams["phi0"], trackParams["z0"], trackParams["t"], state.chi2(), nPar_, true); + //if (abs(int(fitTrkTmp.getCellLocationFit().first) - int(fitTrkTmp.getCellLocationHT().first)) > 1 || abs(int(fitTrkTmp.getCellLocationFit().second) - int(fitTrkTmp.getCellLocationHT().second)) > 1) goodState = false; + //cout<<"Consistent "< 0 ){ + while( t > M_PI ) t-= 2*M_PI; + } + else{ + while( t < - M_PI ) t+= 2*M_PI; + } + return t; +} + +KF4ParamsCombIV::KF4ParamsCombIV(const Settings* settings, const string &fitterName ) : L1KalmanComb(settings, 4, fitterName ){ + + hdxmin[0] = -0.0060; + hdxmax[0] = +0.0060; + hdxmin[1] = -4.1; + hdxmax[1] = +4.1; + hdxmin[2] = -1.1e-4; + hdxmax[2] = +1.1e-4; + hdxmin[3] = -1.; + hdxmax[3] = +1.; + + hxmin[0] = -50; + hxmax[0] = +50; + hxmin[1] = -120; + hxmax[1] = +120; + hxmin[2] = -0.3 * 0.0057; + hxmax[2] = +0.3 * 0.0057; + hxmin[3] = -6.; + hxmax[3] = +6.; + + hddMeasmin[1] = -1.e1; + hddMeasmax[1] = +1.e1; + + hresmin[0] = -0.5; + hresmax[0] = +0.5; + hresmin[1] = -10.; + hresmax[1] = +10.; + + + hxaxtmin[0] = -1.e-3; + hxaxtmax[0] = +1.e-3; + hxaxtmin[1] = -1.e-1; + hxaxtmax[1] = +1.e-1; + hxaxtmin[2] = -10.; + hxaxtmax[2] = +10.; + hxaxtmin[3] = -6.e-0; + hxaxtmax[3] = +6.e-0; +} + +std::map KF4ParamsCombIV::getTrackParams(const KalmanState *state )const{ + + std::map y; + if( state->barrel() ){ + y["phi0"] = wrapRadian( state->xa().at(BP_RHOPHI) / state->r() + state->r() * state->xa().at(BP_INV2R) + sectorPhi() ); + y["z0"] = state->xa().at(BP_Z) - state->r() * state->xa().at(BP_T); + y["qOverPt"] = state->xa().at(BP_INV2R) / getSettings()->invPtToInvR() * 2.; + y["t"] = state->xa().at(BP_T); + + } + else{ + double t = 1./state->xa().at(EP_INVT); + double inv2R = state->xa().at(EP_INV2RT) * t; + y["phi0"] = wrapRadian( state->xa().at(EP_RHOPHI) / state->xa().at(EP_RHO) + state->xa().at(EP_RHO) * inv2R + sectorPhi() ); + y["z0"] = state->z() - state->xa().at(EP_RHO) * t; + y["qOverPt"] = inv2R / getSettings()->invPtToInvR() * 2.; + y["t"] = t; + } + y["d0"] = 0; + return y; +} +/* The Kalman measurement matrix + * Here I always measure phi(r), and z(r) */ +TMatrixD KF4ParamsCombIV::H(const StubCluster* stubCluster)const{ + TMatrixD h(2, 4); + if( stubCluster->barrel() ){ + h(BM_RHOPHI,BP_RHOPHI) = 1; + h(BM_Z,BP_Z) = 1; + } + else{ + h(EM_RHOPHI,BP_RHOPHI) = 1; + h(EM_RHO,EP_RHO) = 1; + } + return h; +} + +/* Seed the state vector */ +std::vector KF4ParamsCombIV::seedx(const L1track3D& l1track3D)const{ + + std::vector x(nPar_); + x[BP_RHOPHI] = 0.1 * wrapRadian( l1track3D.phi0() - sectorPhi() ); + x[BP_Z] = l1track3D.z0(); + x[BP_INV2R] = getSettings()->invPtToInvR() * l1track3D.qOverPt()/2; + x[BP_T] = 0.; + if (settings_->useZTrkFilter() || settings_->useSeedFilter()) { + x[BP_T] = l1track3D.tanLambda(); + } + else{ + + if( getSettings()->numEtaRegions() == 9 ) { + switch ( iCurrentEtaReg_ ){ + case 0 : + x[BP_T] = -4.4; + break; + case 1 : + x[BP_T] = -2.8; + break; + case 2 : + x[BP_T] = -1.6; + break; + case 3 : + x[BP_T] = -0.7; + break; + case 4 : + x[BP_T] = 0.0; + break; + case 8 : + x[BP_T] = +4.4; + break; + case 7 : + x[BP_T] = +2.8; + break; + case 6 : + x[BP_T] = +1.6; + break; + case 5 : + x[BP_T] = +0.7; + break; + } + } + else{ + x[BP_T] = 0.0; + if( iCurrentEtaReg_ > getSettings()->numEtaRegions() / 2 ) x[BP_T] = 2.8; + else if( iCurrentEtaReg_ < getSettings()->numEtaRegions() / 2 - 1 ) x[BP_T] = -2.8; + } + } + return x; +} + +/* Seed the covariance matrix + * Note: 1024 is an arbitrary 'large' value */ +TMatrixD KF4ParamsCombIV::seedP(const L1track3D& l1track3D)const{ + TMatrixD p(4,4); + double c = getSettings()->invPtToInvR() / 2; + //0.0057 + // + p(BP_RHOPHI,BP_RHOPHI) = 0.1 * 0.006* 0.1 * 0.006; + p(BP_Z,BP_Z) = 4.0*4.0; + p(BP_INV2R,BP_INV2R) = 0.020*0.020 * c * c; + //0.020*c = 0.0001 + + if( getSettings()->numEtaRegions() == 9 ) { + switch ( iCurrentEtaReg_ ){ + case 0 : + case 8 : + p(BP_T,BP_T) = 0.5*0.5; + break; + case 1 : + case 7 : + p(BP_T,BP_T) = 0.4*0.4; + break; + case 2 : + case 6 : + p(BP_T,BP_T) = 0.37*0.37; + break; + case 3 : + case 5 : + p(BP_T,BP_T) = 0.27*0.27; + break; + case 4 : + p(BP_T,BP_T) = 0.27*0.27; + break; + } + } + else{ + p(BP_T,BP_T) = 0.5*0.5; + } + + return p; +} +double KF4ParamsCombIV::getZ( const KalmanState *state )const{ + + double z(0); + if( state->barrel() ){ + z = state->xa().at(BP_Z); + } + else{ + z = state->z(); + } + return z; +} + +double KF4ParamsCombIV::getZ0( const KalmanState *state )const{ + + double z0(0); + if( state->barrel() ){ + if( state->nStubLayers() == 0 ) z0 = state->xa().at(BP_Z); + else + z0 = state->xa().at(BP_Z) - state->r() * state->xa().at(BP_T); + } + else{ + z0 = state->z() - state->xa().at(EP_RHO) / state->xa().at(EP_INVT); + } + return z0; +} +double KF4ParamsCombIV::getZVariance( const KalmanState *state )const{ + + double vz(0); + if( state->barrel() ){ + vz = state->pxxa()(BP_Z, BP_Z); + } + + return vz; +} + +double KF4ParamsCombIV::getZ0Variance( const KalmanState *state )const{ + + + double vz0(0); + if( state->barrel() ){ + if( state->nStubLayers() == 0 ) state->pxxa()(BP_Z, BP_Z); + else + vz0 = state->pxxa()(BP_Z, BP_Z) + state->r() * state->r() * state->pxxa()(BP_T, BP_T); + } + else{ + double r = state->xa().at(EP_RHO); + double vr = state->pxxa()(EP_RHO,EP_RHO); + double invt = state->xa().at(EP_INVT); + double vinvt = state->pxxa()(EP_INVT, EP_INVT); + vz0 = r/invt * r/invt * ( vr/(r*r) + vinvt/(invt*invt) ); + } + return vz0; +} +void KF4ParamsCombIV::barrelToEndcap( double r, const StubCluster *stubCluster, std::vector &x )const{ + + double rhophi = x[BP_RHOPHI]; + double Inv2R = x[BP_INV2R]; + double t = x[BP_T]; + + x[EP_RHOPHI] = rhophi; + x[EP_RHO] = r; + if( t ){ + x[EP_INV2RT] = Inv2R / t; + x[EP_INVT] = 1./t; + } + else{ + // if( iCurrentEtaReg_ > 4 ) t = 1.; + if( iCurrentEtaReg_ > getSettings()->numEtaRegions() / 2 ) t = 1.; + else t = -1.; + x[EP_INV2RT] = Inv2R * t; + x[EP_INVT] = 1. * t; + } +} + + +/* The forecast matrix */ +TMatrixD KF4ParamsCombIV::F(const StubCluster* stubCluster, const KalmanState *state )const{ + + TMatrixD F(4,4); + for(int n = 0; n < 4; n++) + F(n, n) = 1; + + if( stubCluster->barrel() ){ + double deltar = stubCluster->r() - state->r(); + F(BP_RHOPHI,BP_RHOPHI) = stubCluster->r()/state->r(); + F(BP_RHOPHI,BP_INV2R) = - deltar * stubCluster->r(); + F(BP_Z,BP_T) = deltar; + } + else{ + double statez = getZ(state); + double deltaz = stubCluster->z() - statez; + double z0 = getZ0( state ); + + // F(EP_RHOPHI,EP_RHOPHI) = 1 + z0 * ( 1./statez - 1./stub->z() ); + if( state->barrel() ){ + double t = state->xa().at(BP_T); + if( state->nStubLayers() == 0 ){ + double deltar = stubCluster->r() - state->r(); + F(EP_RHOPHI,EP_RHOPHI) = stubCluster->r() / state->r(); + F(EP_RHOPHI,EP_INV2RT) = - stubCluster->r()*stubCluster->z(); + F(EP_RHO,EP_INVT) = stubCluster->z(); + } + else{ + // F(EP_RHOPHI,EP_RHOPHI) = 1 + z0 * ( 1./statez - 1./stub->z() ); + F(EP_RHOPHI,EP_RHOPHI) = stubCluster->r() / state->r(); + F(EP_RHOPHI,EP_INV2RT) = - deltaz * stubCluster->r(); + F(EP_RHO,EP_INVT) = deltaz; + } + } + else{ + //F(EP_RHOPHI,EP_RHOPHI) = 1 + z0 * ( 1./statez - 1./stub->z() ); + F(EP_RHOPHI,EP_RHOPHI) = stubCluster->r()/ state->r(); + F(EP_RHOPHI,EP_INV2RT) = - deltaz * stubCluster->r(); + F(EP_RHO,EP_INVT) = deltaz; + } + } + + return F; +} + +/* the vector of measurements */ +std::vector KF4ParamsCombIV::d(const StubCluster* stubCluster )const{ + std::vector meas; + meas.resize(2); + if( stubCluster->barrel() ){ + meas[0] = stubCluster->r() * wrapRadian( stubCluster->phi() - sectorPhi() ); + meas[1] = stubCluster->z(); + } + else{ + meas[0] = stubCluster->r() * wrapRadian( stubCluster->phi() - sectorPhi() ); + meas[1] = stubCluster->r(); + } + return meas; +} + +TMatrixD KF4ParamsCombIV::PddMeas(const StubCluster* stubCluster, const KalmanState *state )const{ + + + double rdphi = stubCluster->r() * stubCluster->dphi(); + TMatrixD p(2,2); + p(0,0) = rdphi * rdphi; + p(1,1) = stubCluster->sigmaZ() * stubCluster->sigmaZ(); + + return p; +} + +/* State uncertainty */ +TMatrixD KF4ParamsCombIV::PxxModel( const KalmanState *state, const StubCluster *stubCluster, unsigned stub_itr )const +{ + + TMatrixD p(4,4); + + if( getSettings()->kalmanMultiScattFactor() ){ + unsigned i_eta = abs( stubCluster->eta() / 0.1 ); + if( i_eta > 24 ) i_eta = 24; + double dl = matx_outer[i_eta] / nlayer_eta[i_eta]; + + const KalmanState * last_update_state = state->last_update_state(); + unsigned last_itr(1); + if( last_update_state ) last_itr = last_update_state->nIterations(); + dl = ( stub_itr - last_itr ) * dl; + + if( dl ){ + std::map y = getTrackParams( state ); + double dtheta0 = 1./sqrt(3) * 0.0136 * fabs(y["qOverPt"]) * sqrt(dl)*( 1+0.038*log(dl) ); + dtheta0 *= getSettings()->kalmanMultiScattFactor(); + double drphi = stubCluster->r() * dtheta0; + p(0,0) = drphi * drphi; + } + } + + if( stubCluster->barrel() || state->nStubLayers() == 0 ) return p; + // if( stubCluster->barrel() ) return p; + + //error from z_{k-1} + if( state->barrel() ){ + + double vz = state->pxxa()( BP_Z, BP_Z ); + + std::vector x = state->xa(); + barrelToEndcap(state->r(), stubCluster, x); + + double dfx = stubCluster->r() * x.at(EP_INV2RT); + p(EP_RHOPHI, EP_RHOPHI) += vz * dfx * dfx; + + dfx = -1. * x.at(EP_INVT); + p(EP_RHO, EP_RHO) += vz * dfx * dfx; + + } + return p; +} + +void KF4ParamsCombIV::barrelToEndcap( double r, const StubCluster *stubCluster, std::vector &x, TMatrixD &cov_x )const +{ + + double Inv2R = x[BP_INV2R]; + double t = x[BP_T]; + + barrelToEndcap( r, stubCluster, x ); + + // if( r != 0.1 ){ + TMatrixD G(4,4); + /* + * new_cov_x = y + * y(0,0) = cov_x(0,0)^2 + cov_x(0,2)^2 + * y(0,2) = G(2,2) * ( cov_x(0,0) + cov_x(2,2) ) * cov_x(0,2) + * y(2,0) = y(0,2) + * y(2,2) = G(2,2)^2 * ( cov_x(0,2)^2 + cov_x(2,2)^2 ) + G(2,3) * ( cov_x(1,3)^2 + cov_x(3,3)^2 ) + * y(2,3) = G(2,3) * G(3,3) * ( cov_x(1,3)^2 + cov_x(3,3)^2 ) + * y(3,2) = y(2,3) + * y(3,3) = G(3,3)^2 * ( cov_x(1,3)^2 + cov_x(3,3)^2 ) + */ + + G(EP_RHOPHI,BP_RHOPHI) = 1.; + G(EP_RHOPHI,BP_Z) = 0.; + G(EP_RHOPHI,BP_INV2R) = 0.; + G(EP_RHOPHI,BP_T) = 0.; + + G(EP_RHO,BP_RHOPHI) = 0; + G(EP_RHO,BP_Z) = 0; + G(EP_RHO,BP_INV2R) = 0; + G(EP_RHO,BP_T) = 0; + + G(EP_INV2RT,BP_RHOPHI) = 0.; + G(EP_INV2RT,BP_Z) = 0.; + if( t ){ + G(EP_INV2RT,BP_INV2R) = 1./t; + G(EP_INV2RT,BP_T) = Inv2R * -1./(t*t); + } + else{ + G(EP_INV2RT,BP_INV2R) = 1.; + G(EP_INV2RT,BP_T) = Inv2R * -1.; + } + + G(EP_INVT,BP_RHOPHI) = 0; + G(EP_INVT,BP_Z) = 0; + G(EP_INVT,BP_INV2R) = 0; + if( t ){ + G(EP_INVT,BP_T) = -1./(t*t); + } + else{ + G(EP_INVT,BP_T) = -1.; + } + + TMatrixD org(cov_x); + TMatrixD GT(TMatrixD::kTransposed, G ); + + cov_x = G * org * GT; + // } +} + + +std::string KF4ParamsCombIV::getParams(){ + return "KF4ParamsCombIV"; +} + +/* Determine with a stub belongs/does not belong to a candidate + * Decision based on hit and state uncertainty */ +bool KF4ParamsCombIV::stubBelongs(const StubCluster* stubCluster, KalmanState& state, unsigned itr )const{ + + return true; + +} +double KF4ParamsCombIV::validationGateCutValue( const StubCluster *stubCluster, unsigned path )const +{ + double max_rchi2(100); + if( path > 10 ) return max_rchi2; + + if( stubCluster->barrel() ){ + switch ( stubCluster->layerId() ){ + case 3: + max_rchi2 = 50; + case 4: + max_rchi2 = 30; + case 5: + max_rchi2 = 40; + case 6: + max_rchi2 = 40; + } + } + else{ + switch ( stubCluster->endcapRing() ){ + case 2: + max_rchi2 = 50; + case 3: + max_rchi2 = 80; + case 4: + max_rchi2 = 100; + case 5: + max_rchi2 = 80; + case 6: + max_rchi2 = 130; + case 7: + max_rchi2 = 80; + case 8: + max_rchi2 = 130; + case 9: + max_rchi2 = 130; + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + max_rchi2 = 50; + } + } + + return max_rchi2; +} + +bool KF4ParamsCombIV::isGoodState( const KalmanState &state )const +{ + unsigned nStubLayers = state.nStubLayers(); + bool goodState( true ); + + if( nStubLayers == 2 ){ + + double z0=fabs( getTrackParams( &state )["z0"] ); + if( z0 > 20. ) goodState = false; + } + + + if( nStubLayers >= 3 ){ + + double max_rchi2(100); + + if( state.path() < 11 ){ + + + if( state.barrel() ){ + + switch ( state.layerId() ){ + case 3: + max_rchi2 = 50; + case 4: + max_rchi2 = 80; + case 5: + max_rchi2 = 80; + case 6: + max_rchi2 = 50; + } + } + else{ + switch ( state.endcapRing() ){ + case 2: + max_rchi2 = 10; + case 3: + max_rchi2 = 30; + case 4: + max_rchi2 = 70; + case 5: + max_rchi2 = 40; + case 6: + max_rchi2 = 60; + case 7: + max_rchi2 = 50; + case 8: + max_rchi2 = 70; + case 9: + max_rchi2 = 50; + case 10: + max_rchi2 = 30; + case 11: + case 12: + case 13: + case 14: + case 15: + max_rchi2 = 20; + } + } + } + if( state.reducedChi2() > max_rchi2 ) goodState=false; + } + + return goodState; +} + +std::vector KF4ParamsCombIV::residual(const StubCluster* stubCluster, const std::vector &x )const{ + + std::vector vd = d(stubCluster); + std::vector hx = Hx( H(stubCluster), x ); + std::vector delta(2); + // cout << "hx " << hx.at(0) << " " << hx.at(1) << endl; + // cout << "vd " << vd.at(0) << " " << vd.at(1) << endl; + for( unsigned i=0; i<2; i++ ) delta.at(i) = vd.at(i) - hx.at(i); + return delta; +} + diff --git a/L1Trigger/TrackFindingTMTT/src/KF4ParamsCombV2.bak b/L1Trigger/TrackFindingTMTT/src/KF4ParamsCombV2.bak new file mode 100644 index 0000000000000..c4df336d9bcfd --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/KF4ParamsCombV2.bak @@ -0,0 +1,222 @@ +#include "L1Trigger/TrackFindingTMTT/interface/KF4ParamsCombV2.h" +#include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" +#include "L1Trigger/TrackFindingTMTT/interface/StubCluster.h" +//#include "L1Trigger/TrackFindingTMTT/interface/Matrix.h" +#include +#define CKF_DEBUG + +static unsigned nlayer_eta[25] = +{ 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, + 7, 7, 7, 7, 6, 6, 6, 6, 6, 6}; + +static double matx_outer[25] = { +0.16, 0.17, 0.18, 0.19, 0.20, +0.21, 0.26, 0.22, 0.26, 0.38, +0.41, 0.40, 0.44, 0.50, 0.54, +0.60, 0.44, 0.48, 0.60, 0.68, +0.50, 0.48, 0.64, 0.39, 0.20 +}; + +static double matx_inner[25] = { +0.14, 0.1, 0.1, 0.1, 0.1, +0.1, 0.1, 0.1, 0.1, 0.1, +0.12, 0.1, 0.1, 0.1, 0.15, +0.20, 0.25, 0.25, 0.3, 0.3, +0.35, 0.40, 0.40, 0.6, 0.6 +}; +static double wrapRadian( double t ){ + + if( t > 0 ){ + while( t > M_PI ) t-= 2*M_PI; + } + else{ + while( t < - M_PI ) t+= 2*M_PI; + } + return t; +} +KF4ParamsCombV2::KF4ParamsCombV2(const Settings* settings, const string &fitterName ) : + KF4ParamsComb(settings, 4, fitterName ){ + + + hdxmin[0] = -4.e-2; + hdxmax[0] = +4.e-2; + hdxmin[1] = -1.001e-1; + hdxmax[1] = +1.001e-1; + hdxmin[2] = -5.; + hdxmax[2] = +5.; + hdxmin[3] = -4.e-1; + hdxmax[3] = +4.e-1; + + hddMeasmin[1] = -1.e-1; + hddMeasmax[1] = +1.e-1; + + hresmin[0] = -100.; + hresmax[0] = +100.; + hresmin[1] = -100.; + hresmax[1] = +100.; + + hxaxtmin[0] = -1000; + hxaxtmax[0] = +1000; + hxaxtmin[1] = -1000; + hxaxtmax[1] = +1000; + hxaxtmin[2] = -1000; + hxaxtmax[2] = +1000; + hxaxtmin[3] = -1000; + hxaxtmax[3] = +1000; +} + +std::string KF4ParamsCombV2::getParams(){ + return "KF4ParamsCombV2"; +} + +std::map KF4ParamsCombV2::getTrackParams( const KalmanState *state )const{ + + std::vector x = state->xa(); + + std::map z; + double beta = x.at(V2_BETA); + double z0p = x.at(V2_Z0P); + double R0p = x.at(V2_R0P); + double rho0 = x.at(V2_RHO0); + + z["qOverPt"] = 1./( getSettings()->invPtToInvR() * 0.5 * R0p ); + z["phi0"] = wrapRadian( rho0 / R0p + sectorPhi() ); + z["z0"] = z0p - beta * wrapRadian( z["phi0"] - sectorPhi() ); + z["t"] = beta / R0p; + return z; +} + +std::vector KF4ParamsCombV2::residual(const StubCluster* stubCluster, std::vector &x )const +{ + std::vector hx = Hx( H(stubCluster), x ); + std::vector vd = d(stubCluster); + + std::vector delta(2); + for( unsigned i=0; i<2; i++ ){ + delta.at(i) = vd.at(i) - hx.at(i); + } + + return delta; +} + +/* Seed the state vector */ +std::vector KF4ParamsCombV2::seedx(const L1track3D& l1track3D)const{ + std::vector x; + x.resize(4); + double InvR0 = getSettings()->invPtToInvR() * l1track3D.qOverPt(); + double R0 = 1./InvR0; + double beta = 2 * R0 * l1track3D.tanLambda(); + + x[V2_BETA] = beta; + x[V2_Z0P] = l1track3D.z0() + beta * wrapRadian( l1track3D.phi0() - sectorPhi() ); + x[V2_R0P] = 2. * R0; + x[V2_RHO0] = 2. * R0 * wrapRadian( l1track3D.phi0() - sectorPhi() ); + return x; +} + +TMatrixD KF4ParamsCombV2::seedP(const L1track3D& l1track3D)const{ + TMatrixD p(4,4); + + p(V2_BETA,V2_BETA) = 1.e+10; + p(V2_Z0P,V2_Z0P) = 1.e+4; + p(V2_R0P,V2_R0P) = 1.e+10; + p(V2_RHO0,V2_RHO0) = 1.e+4; + + return p; +} + +/* the vector of measurements */ +std::vector KF4ParamsCombV2::d(const StubCluster* stubCluster )const{ + + std::vector meas; + meas.resize(2); + meas[0] = stubCluster->z(); + meas[1] = stubCluster->r(); + return meas; +} + +/* The Kalman measurement matrix + * Here I always measure phi(r), and z(r) */ +TMatrixD KF4ParamsCombV2::H(const StubCluster* stubCluster)const{ + TMatrixD h(2, 4); + h(0,0) = -( stubCluster->phi() - sectorPhi() ); + h(0,1) = 1; + h(1,2) = -( stubCluster->phi() - sectorPhi() ); + h(1,3) = 1; + return h; +} +TMatrixD KF4ParamsCombV2::PxxModel( const KalmanState *state, const StubCluster *stubCluster, unsigned stub_itr )const{ + //not easy to implement the multiple scattering. + TMatrixD p(4,4); + + if( getSettings()->kalmanMultiScattFactor() ){ + unsigned i_eta = abs( stubCluster->eta() / 0.1 ); + if( i_eta > 24 ) i_eta = 24; + double dl = matx_outer[i_eta] / nlayer_eta[i_eta]; + + const KalmanState * last_update_state = state->last_update_state(); + unsigned last_itr(1); + if( last_update_state ) last_itr = last_update_state->nIterations(); + dl = ( stub_itr - last_itr ) * dl; + + if( dl ){ + std::map y = getTrackParams( state ); + double dtheta0 = 1./sqrt(3) * 0.0136 * fabs(y["qOverPt"]) * sqrt(dl)*( 1+0.038*log(dl) ); + dtheta0 *= getSettings()->kalmanMultiScattFactor(); + double dbeta = state->xa().at(V2_BETA) * dtheta0; + p(V2_Z0P,V2_Z0P) = dbeta * dbeta; + double drho0 = state->xa().at(V2_R0P) * dtheta0; + p(V2_RHO0, V2_RHO0) = drho0 * drho0; + } + } + + return p; +} + +TMatrixD KF4ParamsCombV2::PddMeas(const StubCluster* stubCluster, const KalmanState *state )const{ + + const std::vector &x = state->xa(); + + TMatrixD p(2,2); + + double dztOverdphi = -1. * x.at(V2_BETA); + double drtOverdphi = -1. * x.at(V2_R0P); + + double dz(0), dr(0); + if(stubCluster->layerId() < 10){ + dz = stubCluster->sigmaZ(); + } + else{ + dr = stubCluster->sigmaZ(); + } + + double dphi = stubCluster->dphi(); + p(0,0) = dz * dz + dztOverdphi * dztOverdphi * dphi * dphi; + + double dphi_dr = stubCluster->dphi_dr(); + double dphi_dl = stubCluster->dphi_dl(); + double drho_dr = dr + drtOverdphi * dphi_dr; + double drho_dl = drtOverdphi * dphi_dl; + p(1,1) = drho_dr * drho_dr + drho_dl * drho_dl; + + return p; +} + + +bool KF4ParamsCombV2::isGoodState( const KalmanState &state )const +{ + unsigned nStubLayers = state.nStubLayers(); + bool goodState( true ); + /* + std::map x = getTrackParams( &state ); + double z0=fabs( x["z0"] ); + if( z0 > 20. ) goodState = false; + */ + + if( nStubLayers >= 3 && state.reducedChi2() > getSettings()->kalmanStateReducedChi2CutValue() ) goodState=false; + + return goodState; + +} + diff --git a/L1Trigger/TrackFindingTMTT/src/KF5ParamsComb.cc.bak b/L1Trigger/TrackFindingTMTT/src/KF5ParamsComb.cc.bak new file mode 100644 index 0000000000000..704d0caab0883 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/KF5ParamsComb.cc.bak @@ -0,0 +1,427 @@ +///=== This is the Kalman Combinatorial Filter for 4 helix parameters track fit algorithm. + + +#include "L1Trigger/TrackFindingTMTT/interface/KF5ParamsComb.h" +#include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" +#include "L1Trigger/TrackFindingTMTT/interface/StubCluster.h" +#define CKF_DEBUG + +namespace TMTT { + + +/* +// Scattering constants - HISTORIC NOT USED. + +static unsigned nlayer_eta[25] = +{ 6, 6, 6, 6, +6, 6, 6, 6, 6, 6, 6, 7, 7, 7, +7, 7, 7, 7, 6, 6, 6, 6, 6, 6}; + +static double matx_outer[25] = { +0.16, 0.17, 0.18, 0.19, 0.20, +0.21, 0.26, 0.22, 0.26, 0.38, +0.41, 0.40, 0.44, 0.50, 0.54, +0.60, 0.44, 0.48, 0.60, 0.68, +0.50, 0.48, 0.64, 0.39, 0.20 +}; + +static double matx_inner[25] = { +0.14, 0.1, 0.1, 0.1, 0.1, +0.1, 0.1, 0.1, 0.1, 0.1, +0.12, 0.1, 0.1, 0.1, 0.15, +0.20, 0.25, 0.25, 0.3, 0.3, +0.35, 0.40, 0.40, 0.6, 0.6 +}; +*/ + +static double wrapRadian( double t ){ + + if( t > 0 ){ + while( t > M_PI ) t-= 2*M_PI; + } + else{ + while( t < - M_PI ) t+= 2*M_PI; + } + return t; +} + + + +KF5ParamsComb::KF5ParamsComb(const Settings* settings, const uint nPar, const string &fitterName ) : L1KalmanComb(settings, nPar, fitterName ){ + + hdxmin[INV2R] = -1.1e-4; + hdxmax[INV2R] = +1.1e-4; + hdxmin[PHI0] = -6.e-3; + hdxmax[PHI0] = +6.e-3; + hdxmin[Z0] = -4.1; + hdxmax[Z0] = +4.1; + hdxmin[T] = -6.; + hdxmax[T] = +6.; + hdxmin[D0] = -1.001; + hdxmax[D0] = +1.001; + + hxmin[INV2R] = -0.3 * 0.0057; + hxmax[INV2R] = +0.3 * 0.0057; + hxmin[PHI0] = -0.3; + hxmax[PHI0] = +0.3; + hxmin[Z0] = -120; + hxmax[Z0] = +120; + hxmin[T] = -6.; + hxmax[T] = +6.; + hxmin[D0] = -3.5; + hxmax[D0] = +3.5; + + hddMeasmin[PHI0] = -1.e1; + hddMeasmax[PHI0] = +1.e1; + + hresmin[PHI0] = -0.5; + hresmax[PHI0] = +0.5; + + hresmin[PHI0] = -10.; + hresmax[PHI0] = +10.; + + hxaxtmin[INV2R] = -1.e-3; + hxaxtmax[INV2R] = +1.e-3; + hxaxtmin[PHI0] = -1.e-1; + hxaxtmax[PHI0] = +1.e-1; + hxaxtmin[Z0] = -10.; + hxaxtmax[Z0] = +10.; + hxaxtmin[T] = -1.e-0; + hxaxtmax[T] = +1.e-0; + hxaxtmin[D0] = -1.001; + hxaxtmax[D0] = +1.001; +} + + +std::map KF5ParamsComb::getTrackParams(const KalmanState *state )const{ + + std::vector x = state->xa(); + std::map y; + y["qOverPt"] = x.at(INV2R) / getSettings()->invPtToInvR() * 2.; + y["phi0"] = wrapRadian( x.at(PHI0) + sectorPhi() ); + y["z0"] = x.at(Z0); + y["t"] = x.at(T); + y["d0"] = x.at(D0); + return y; +} + +/* Get track params with beam-spot constraint & track fit chi2 from applying it. */ + +std::map KF5ParamsComb::getTrackParams_BeamConstr( const KalmanState *state, double& chi2 ) const { + std::map y; + std::vector x = state->xa(); + TMatrixD cov_xa = state->pxxa(); + double deltaChi2 = (x.at(D0) * x.at(D0)) / cov_xa[D0][D0]; + chi2 = state->chi2() + deltaChi2; + // Apply beam-spot constraint to helix params in transverse plane only, as most sensitive to it. + x[INV2R] -= x.at(D0) * (cov_xa[INV2R][D0] / cov_xa[D0][D0]); + x[PHI0 ] -= x.at(D0) * (cov_xa[PHI0 ][D0] / cov_xa[D0][D0]); + x[D0 ] = 0.0; + y["qOverPt"] = x.at(INV2R) / getSettings()->invPtToInvR() * 2.; + y["phi0"] = wrapRadian( x.at(PHI0) + sectorPhi() ); + y["z0"] = x.at(Z0); + y["t"] = x.at(T); + y["d0"] = x.at(D0); + return y; +} + + +/* The Kalman measurement matrix = derivative of helix intercept w.r.t. helix params + * Here I always measure phi(r), and z(r) */ +TMatrixD KF5ParamsComb::H(const StubCluster* stubCluster)const{ + TMatrixD h(2, nPar_); + double r = stubCluster->r(); + h(PHI,INV2R) = -r; + h(PHI,PHI0) = 1; + h(PHI,D0) = -1./r; + h(Z,Z0) = 1; + h(Z,T) = r; + return h; +} + +// Not used? + +TMatrixD KF5ParamsComb::dH(const StubCluster* stubCluster)const{ + + double dr(0); + if(stubCluster->layerId() > 10){ + dr = stubCluster->sigmaZ(); + } + + double r = stubCluster->r(); + + TMatrixD h(2, nPar_); + h(PHI,INV2R) = -dr; + h(PHI,D0) = dr/(r*r); + h(Z,T) = dr; + + return h; +} + +/* Seed the state vector */ +std::vector KF5ParamsComb::seedx(const L1track3D& l1track3D)const{ + + std::vector x(nPar_); + x[INV2R] = getSettings()->invPtToInvR() * l1track3D.qOverPt()/2; + x[PHI0] = wrapRadian( l1track3D.phi0() - sectorPhi() ); + x[Z0] = l1track3D.z0(); + x[T] = l1track3D.tanLambda(); + x[D0] = 0; + + return x; +} + +/* Seed the covariance matrix */ +TMatrixD KF5ParamsComb::seedP(const L1track3D& l1track3D)const{ + TMatrixD p(nPar_,nPar_); + + double c = getSettings()->invPtToInvR() / 2; + + // Assumed track seed (from HT) uncertainty in transverse impact parameter. + const float d0Sigma = 1.0; + + if ( getSettings()->numEtaRegions() == 18 ) { + + // optimised for 18x2 with additional error factor in pt/phi to avoid pulling towards wrong HT params + p(INV2R,INV2R) = 0.0157 * 0.0157 * c * c * 4; + p(PHI0,PHI0) = 0.0051 * 0.0051 * 4; + p(Z0,Z0) = 5.0 * 5.0; + p(T,T) = 0.25 * 0.25 * 4; // IRT: increased by factor 4, as was affecting fit chi2. + p(D0,D0) = d0Sigma * d0Sigma; + + } else { + + // choose large errors + p(INV2R,INV2R) = 0.0157 * 0.0157 * c * c * 10; + p(PHI0,PHI0) = 0.0051 * 0.0051 * 10; + p(Z0,Z0) = 5.0 * 5.0; + p(T,T) = 0.25 * 0.25 * 10; + p(D0,D0) = d0Sigma * d0Sigma; + + } + + return p; +} + +/* The forecast matrix + * (here equals identity matrix) */ +TMatrixD KF5ParamsComb::F(const StubCluster* stubCluster, const KalmanState *state )const{ + TMatrixD F(nPar_,nPar_); + for(unsigned int n = 0; n < nPar_; n++) + F(n, n) = 1; + return F; +} + +/* the vector of measurements */ +std::vector KF5ParamsComb::d(const StubCluster* stubCluster )const{ + std::vector meas; + meas.resize(2); + meas[PHI] = wrapRadian( stubCluster->phi() - sectorPhi() ); + meas[Z] = stubCluster->z(); + return meas; +} + +// Assumed hit resolution in (phi,z) +TMatrixD KF5ParamsComb::PddMeas(const StubCluster* stubCluster, const KalmanState *state )const{ + + double inv2R = (getSettings()->invPtToInvR()) * 0.5 * state->candidate().qOverPt(); // alternatively use state->xa().at(INV2R) + double inv2R2 = inv2R * inv2R; + + double tanl = state->xa().at(T); // factor of 0.9 improves rejection + double tanl2 = tanl * tanl; + + TMatrixD p(2,2); + + double vphi(0); + double vz(0); + double vcorr(0); + + // consider error due to integerisation only for z (r in encap) coord when enabled + double err_digi2(0); + if (getSettings()->enableDigitize()) err_digi2 = 0.15625 * 0.15625 / 12.0; + + double a = stubCluster->sigmaX() * stubCluster->sigmaX(); + double b = stubCluster->sigmaZ() * stubCluster->sigmaZ() + err_digi2; + double r2 = stubCluster->r() * stubCluster->r(); + double invr2 = 1./r2; + + // Scattering term scaling as 1/Pt. + double sigmaScat = getSettings()->kalmanMultiScattTerm()/(state->candidate().pt()); + double sigmaScat2 = sigmaScat * sigmaScat; + + if ( stubCluster->barrel() ) { + + vphi = (a * invr2) + sigmaScat2; + + if (stubCluster->tiltedBarrel()) { + // Convert uncertainty in (r,phi) to (z,phi). + float scaleTilted = 1.; + if (getSettings()->kalmanHOtilted()) { + if ( getSettings()->useApproxB() ) { // Simple firmware approximation + scaleTilted = getApproxB(stubCluster->z(), stubCluster->r()); + } else { // Exact C++ implementation. + float tilt = stubCluster->moduleTilt(); + scaleTilted = sin(tilt) + cos(tilt)*tanl; + } + } + float scaleTilted2 = scaleTilted*scaleTilted; + // This neglects the non-radial strip effect, assumed negligeable for PS. + vz = b * scaleTilted2; + } else { + vz = b; + } + + if (getSettings()->kalmanHOdodgy()) { + // Use original (Dec. 2016) dodgy implementation was this. + vz = b; + } + + } else { + + vphi = a * invr2 + sigmaScat2; + vz = (b * tanl2); + + if (not stubCluster->psModule()) { // Neglect these terms in PS + double beta = 0.; + // Add correlation term related to conversion of stub residuals from (r,phi) to (z,phi). + if (getSettings()->kalmanHOprojZcorr() == 2) beta += -inv2R; + // Add alpha correction for non-radial 2S endcap strips.. + if (getSettings()->kalmanHOalpha() == 2) beta += -stubCluster->alpha(); // alpha is 0 except in endcap 2S disks + + double beta2 = beta * beta; + vphi += b * beta2; + vcorr = b * (beta * tanl); + + // IRT - for checking efficiency of removing phi-z correlation from projection. + // "ultimate_off1" + //vphi = a * invr2 + b * pow(-stubCluster->alpha(), 2) + b * inv2R2 + sigmaScat2; + //vcorr = b * ((-stubCluster->alpha()) * tanl); + + // IRT - This higher order correction doesn't significantly improve the track fit performance, so commented out. + //if (getSettings()->kalmanHOhelixExp()) { + // float dsByDr = 1. + (1./2.)*r2*inv2R2; // Allows for z = z0 + s*tanL, where s is not exactly r due to circle. + // vcorr *= dsByDr; + // vz *= dsByDr * dsByDr; + //} + + if (getSettings()->kalmanHOdodgy()) { + // Use original (Dec. 2016) dodgy implementation was this. + vphi = (a * invr2) + (b * inv2R2) + sigmaScat2; + vcorr = 0.; + vz = (b * tanl2); + } + } + } + + p(PHI, PHI) = vphi; + p(Z, Z) = vz; + p(PHI, Z) = vcorr; + p(Z, PHI) = vcorr; + + return p; + +} + +// State uncertainty due to scattering -- HISTORIC NOT USED +TMatrixD KF5ParamsComb::PxxModel( const KalmanState *state, const StubCluster *stubCluster )const +{ + + TMatrixD p(nPar_,nPar_); + + /* + if( getSettings()->kalmanMultiScattFactor() ){ + + unsigned i_eta = abs( stubCluster->eta() / 0.1 ); + if( i_eta > 24 ) i_eta = 24; + double dl = matx_outer[i_eta] / nlayer_eta[i_eta]; + + unsigned stub_itr = state->nextLayer(); + + const KalmanState * last_update_state = state->last_update_state(); + unsigned last_itr(1); + if( last_update_state ) last_itr = last_update_state->nextLayer(); + dl = ( stub_itr - last_itr ) * dl; + + if( dl ){ + std::map y = getTrackParams( state ); + double dtheta0 = 1./sqrt(3) * 0.0136 * fabs(y["qOverPt"]) * sqrt(dl)*( 1+0.038*log(dl) ); + dtheta0 *= getSettings()->kalmanMultiScattFactor(); + p(PHI0, PHI0) = dtheta0 * dtheta0; // Despite the name, I think this is uncertainty in phi0. I guess uncertainty in theta0 neglected compared to detector resolution. + } + } + */ + + return p; +} + +bool KF5ParamsComb::isGoodState( const KalmanState &state )const +{ + + unsigned nStubLayers = state.nStubLayers(); + bool goodState( true ); + + // todo : make configurable + + // N.B. Code below changed by Alexander Morton to allow tracking down to Pt = 2 GeV. + + double pt=fabs( getSettings()->invPtToInvR() / (2*state.xa()[INV2R]) ); + double z0=fabs( state.xa()[Z0] ); + + // state parameter selections + if( nStubLayers >= 2 ){ + + if( z0 > 15. ) goodState = false; + + const double tolerance = (nStubLayers >= 4) ? 0.05 : 0.1; // Loosen this for nStubLayers = 2 ??? + if( pt < getSettings()->houghMinPt() - tolerance) goodState = false; + + if( nStubLayers >= 3 ){ + double d0=fabs( state.xa()[D0] ); + if( d0 > 10. ) goodState = false; + } + } + + // chi2 selections + if (getSettings()->kalmanMultiScattTerm() < 0.0001) { // scattering ignored + if( nStubLayers == 2 ) { + if (state.chi2() > 15.0) goodState=false; // No separate pT selection needed + } else if ( nStubLayers == 3 ) { + if (state.chi2() > 100.0 && pt > 2.7) goodState=false; + if (state.chi2() > 120.0 && pt <= 2.7) goodState=false; + } else if ( nStubLayers == 4 ) { + if (state.chi2() > 320.0 && pt > 2.7) goodState=false; + if (state.chi2() > 1420.0 && pt <= 2.7) goodState=false; + } else if ( nStubLayers == 5 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! + if (state.chi2() > 480.0 && pt > 2.7) goodState=false; + if (state.chi2() > 2130.0 && pt <= 2.7) goodState=false; + } else if ( nStubLayers >= 6 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! + if (state.chi2() > 640.0 && pt > 2.7) goodState=false; + if (state.chi2() > 2840.0 && pt <= 2.7) goodState=false; + } + + } else { // scattering taken into account. + + if( nStubLayers == 2 ) { + if (state.chi2() > 10.0) goodState=false; // No separate pT selection needed + } else if ( nStubLayers == 3 ) { + if (state.chi2() > 30.0) goodState=false; + } else if ( nStubLayers == 4 ) { + if (state.chi2() > 80.0) goodState=false; + } else if ( nStubLayers == 5 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! + if (state.chi2() > 120.0) goodState=false; + } else if ( nStubLayers >= 6 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! + if (state.chi2() > 160.0) goodState=false; + } + } + + if ( getSettings()->kalmanDebugLevel() >= 1 && tpa_ != nullptr) { + if (not goodState) cout<<"State veto: nlay="< KFParamsComb::getTrackParams(const KalmanState *state )const{ + + std::vector x = state->xa(); + std::map y; + y["qOverPt"] = 2. * x.at(INV2R) / getSettings()->invPtToInvR(); + y["phi0"] = reco::deltaPhi( x.at(PHI0) + sectorPhi(), 0. ); + y["z0"] = x.at(Z0); + y["t"] = x.at(T); + if (nPar_ == 5) { + y["d0"] = x.at(D0); + } + return y; +} + +/* If using 5 param helix fit, get track params with beam-spot constraint & track fit chi2 from applying it. */ +/* (N.B. chi2rz unchanged by constraint) */ + +std::map KFParamsComb::getTrackParams_BeamConstr( const KalmanState *state, double& chi2rphi ) const { + if (nPar_ == 5) { + std::map y; + std::vector x = state->xa(); + TMatrixD cov_xa = state->pxxa(); + double deltaChi2rphi = (x.at(D0) * x.at(D0)) / cov_xa[D0][D0]; + chi2rphi = state->chi2rphi() + deltaChi2rphi; + // Apply beam-spot constraint to helix params in transverse plane only, as most sensitive to it. + x[INV2R] -= x.at(D0) * (cov_xa[INV2R][D0] / cov_xa[D0][D0]); + x[PHI0 ] -= x.at(D0) * (cov_xa[PHI0 ][D0] / cov_xa[D0][D0]); + x[D0 ] = 0.0; + y["qOverPt"] = 2. * x.at(INV2R) / getSettings()->invPtToInvR(); + y["phi0"] = reco::deltaPhi( x.at(PHI0) + sectorPhi(), 0. ); + y["z0"] = x.at(Z0); + y["t"] = x.at(T); + y["d0"] = x.at(D0); + return y; + } else { + return (this->getTrackParams(state)); + } +} + + +/* The Kalman measurement matrix = derivative of helix intercept w.r.t. helix params + * Here I always measure phi(r), and z(r) */ +TMatrixD KFParamsComb::H(const StubCluster* stubCluster)const{ + TMatrixD h(2, nPar_); + double r = stubCluster->r(); + h(PHI,INV2R) = -r; + h(PHI,PHI0) = 1; + if (nPar_ == 5) { + h(PHI,D0) = -1./r; + } + h(Z,Z0) = 1; + h(Z,T) = r; + return h; +} + +// Not used? + +TMatrixD KFParamsComb::dH(const StubCluster* stubCluster)const{ + + double dr(0); + if(stubCluster->layerId() > 10){ + dr = stubCluster->sigmaZ(); + } + + double r = stubCluster->r(); + + TMatrixD h(2, nPar_); + h(PHI,INV2R) = -dr; + if (nPar_ == 5) { + h(PHI,D0) = dr/(r*r); + } + h(Z,T) = dr; + + return h; +} + +/* Seed the state vector */ +std::vector KFParamsComb::seedx(const L1track3D& l1track3D)const{ + + std::vector x(nPar_); + x[INV2R] = getSettings()->invPtToInvR() * l1track3D.qOverPt()/2; + x[PHI0] = reco::deltaPhi( l1track3D.phi0() - sectorPhi(), 0. ); + x[Z0] = l1track3D.z0(); + x[T] = l1track3D.tanLambda(); + if (nPar_ == 5) { + x[D0] = l1track3D.d0(); + } + + return x; +} + +/* Seed the covariance matrix */ +TMatrixD KFParamsComb::seedP(const L1track3D& l1track3D)const{ + TMatrixD p(nPar_,nPar_); + + double invPtToInv2R = getSettings()->invPtToInvR() / 2; + + // Assumed track seed (from HT) uncertainty in transverse impact parameter. + const float d0Sigma = 1.0; + + if (getSettings()->hybrid()) { + + p(INV2R,INV2R) = 0.0157 * 0.0157 * invPtToInv2R * invPtToInv2R * 4; + p(PHI0,PHI0) = 0.0051 * 0.0051 * 4; + p(Z0,Z0) = 5.0 * 5.0; + p(T,T) = 0.25 * 0.25 * 4; + // N.B. (z0, tanL, d0) seed uncertainties could be smaller for hybrid, if seeded in PS? -- not tried + //if (l1track3D.seedPS() > 0) { // Tracklet seed used PS layers + // p(Z0,Z0) /= (4.*4.).; + // p(T,T) /= (4.*4.); + // } + if (nPar_ == 5) { + p(D0,D0) = d0Sigma * d0Sigma; + } + + } else { + + // optimised for 18x2 with additional error factor in pt/phi to avoid pulling towards wrong HT params + p(INV2R,INV2R) = 0.0157 * 0.0157 * invPtToInv2R * invPtToInv2R * 4; // Base on HT cell size + p(PHI0,PHI0) = 0.0051 * 0.0051 * 4; // Based on HT cell size. + p(Z0,Z0) = 5.0 * 5.0; + p(T,T) = 0.25 * 0.25 * 4; // IRT: increased by factor 4, as was affecting fit chi2. + if (nPar_ == 5) { + p(D0,D0) = d0Sigma * d0Sigma; + } + + if ( getSettings()->numEtaRegions() <= 12 ) { + // Inflate eta errors + p(T,T) = p(T,T) * 2 * 2; + } + } + + return p; +} + +/* The forecast matrix + * (here equals identity matrix) */ +TMatrixD KFParamsComb::F(const StubCluster* stubCluster, const KalmanState *state )const{ + TMatrixD F(nPar_,nPar_); + for(unsigned int n = 0; n < nPar_; n++) + F(n, n) = 1; + return F; +} + +/* the vector of measurements */ +std::vector KFParamsComb::d(const StubCluster* stubCluster )const{ + std::vector meas; + meas.resize(2); + meas[PHI] = reco::deltaPhi( stubCluster->phi(), sectorPhi() ); + meas[Z] = stubCluster->z(); + return meas; +} + +// Assumed hit resolution in (phi,z) +TMatrixD KFParamsComb::PddMeas(const StubCluster* stubCluster, const KalmanState *state )const{ + + double inv2R = (getSettings()->invPtToInvR()) * 0.5 * state->candidate().qOverPt(); // alternatively use state->xa().at(INV2R) + double inv2R2 = inv2R * inv2R; + + double tanl = state->xa().at(T); // factor of 0.9 improves rejection + double tanl2 = tanl * tanl; + + TMatrixD p(2,2); + + double vphi(0); + double vz(0); + double vcorr(0); + + // consider error due to integerisation only for z (r in encap) coord when enabled + double err_digi2(0); + if (getSettings()->enableDigitize()) err_digi2 = 0.15625 * 0.15625 / 12.0; + + double a = stubCluster->sigmaX() * stubCluster->sigmaX(); + double b = stubCluster->sigmaZ() * stubCluster->sigmaZ() + err_digi2; + double r2 = stubCluster->r() * stubCluster->r(); + double invr2 = 1./r2; + + // Scattering term scaling as 1/Pt. + double sigmaScat = getSettings()->kalmanMultiScattTerm()/(state->candidate().pt()); + double sigmaScat2 = sigmaScat * sigmaScat; + + if ( stubCluster->barrel() ) { + + vphi = (a * invr2) + sigmaScat2; + + if (stubCluster->tiltedBarrel()) { + // Convert uncertainty in (r,phi) to (z,phi). + float scaleTilted = 1.; + if (getSettings()->kalmanHOtilted()) { + if ( getSettings()->useApproxB() ) { // Simple firmware approximation + scaleTilted = getApproxB(stubCluster->z(), stubCluster->r()); + } else { // Exact C++ implementation. + float tilt = stubCluster->moduleTilt(); + scaleTilted = sin(tilt) + cos(tilt)*tanl; + } + } + float scaleTilted2 = scaleTilted*scaleTilted; + // This neglects the non-radial strip effect, assumed negligeable for PS. + vz = b * scaleTilted2; + } else { + vz = b; + } + + if (getSettings()->kalmanHOdodgy()) { + // Use original (Dec. 2016) dodgy implementation was this. + vz = b; + } + + } else { + + vphi = a * invr2 + sigmaScat2; + vz = (b * tanl2); + + if (not stubCluster->psModule()) { // Neglect these terms in PS + double beta = 0.; + // Add correlation term related to conversion of stub residuals from (r,phi) to (z,phi). + if (getSettings()->kalmanHOprojZcorr() == 2) beta += -inv2R; + // Add alpha correction for non-radial 2S endcap strips.. + if (getSettings()->kalmanHOalpha() == 2) beta += -stubCluster->alpha(); // alpha is 0 except in endcap 2S disks + + double beta2 = beta * beta; + vphi += b * beta2; + vcorr = b * (beta * tanl); + + // IRT - for checking efficiency of removing phi-z correlation from projection. + // "ultimate_off1" + //vphi = a * invr2 + b * pow(-stubCluster->alpha(), 2) + b * inv2R2 + sigmaScat2; + //vcorr = b * ((-stubCluster->alpha()) * tanl); + + // IRT - This higher order correction doesn't significantly improve the track fit performance, so commented out. + //if (getSettings()->kalmanHOhelixExp()) { + // float dsByDr = 1. + (1./2.)*r2*inv2R2; // Allows for z = z0 + s*tanL, where s is not exactly r due to circle. + // vcorr *= dsByDr; + // vz *= dsByDr * dsByDr; + //} + + if (getSettings()->kalmanHOdodgy()) { + // Use original (Dec. 2016) dodgy implementation was this. + vphi = (a * invr2) + (b * inv2R2) + sigmaScat2; + vcorr = 0.; + vz = (b * tanl2); + } + } + } + + p(PHI, PHI) = vphi; + p(Z, Z) = vz; + p(PHI, Z) = vcorr; + p(Z, PHI) = vcorr; + + return p; + +} + +// State uncertainty due to scattering -- HISTORIC NOT USED +TMatrixD KFParamsComb::PxxModel( const KalmanState *state, const StubCluster *stubCluster )const +{ + + TMatrixD p(nPar_,nPar_); + + /* + if( getSettings()->kalmanMultiScattFactor() ){ + + unsigned i_eta = abs( stubCluster->eta() / 0.1 ); + if( i_eta > 24 ) i_eta = 24; + double dl = matx_outer[i_eta] / nlayer_eta[i_eta]; + + unsigned stub_itr = state->nextLayer(); + + const KalmanState * last_update_state = state->last_update_state(); + unsigned last_itr(1); + if( last_update_state ) last_itr = last_update_state->nextLayer(); + dl = ( stub_itr - last_itr ) * dl; + + if( dl ){ + std::map y = getTrackParams( state ); + double dtheta0 = 1./sqrt(3) * 0.0136 * fabs(y["qOverPt"]) * sqrt(dl)*( 1+0.038*log(dl) ); + dtheta0 *= getSettings()->kalmanMultiScattFactor(); + p(PHI0, PHI0) = dtheta0 * dtheta0; // Despite the name, I think this is uncertainty in phi0. I guess uncertainty in theta0 neglected compared to detector resolution. + } + } + */ + + return p; +} + +bool KFParamsComb::isGoodState( const KalmanState &state )const +{ + // Cut values. (Layer 0 entry here is dummy). -- todo : make configurable + + vector z0Cut, ptTolerance, d0Cut, chi2Cut; + // Layer = 0 1 2 3 4 5 6 + ptTolerance = { 999., 999., 0.1, 0.1, 0.05, 0.05, 0.05}; + d0Cut = { 999., 999., 999., 10., 10., 10., 10.}; // Only used for 5 param fit. + if (nPar_ == 5) { // specific cuts for displaced tracking case. + // Layer = 0 1 2 3 4 5 6 + z0Cut = { 999., 999., 1.7*15., 1.7*15., 1.7*15., 1.7*15., 1.7*15.}; // Larger values require digisation change. + chi2Cut = { 999., 999., 10., 30., 80., 120., 160.}; // Maybe loosen for high d0 ? + } else { // specific cuts for prompt tracking case. + // Layer = 0 1 2 3 4 5 6 + z0Cut = { 999., 999., 15., 15., 15., 15., 15.}; + chi2Cut = { 999., 999., 10., 30., 80., 120., 160.}; + } + + unsigned nStubLayers = state.nStubLayers(); + bool goodState( true ); + + std::map y = getTrackParams( &state ); + double qOverPt = y["qOverPt"]; + double pt=fabs( 1/qOverPt ); + double z0=fabs( y["z0"] ); + + // state parameter selections + + if (z0 > z0Cut[nStubLayers] ) goodState = false; + if( pt < getSettings()->houghMinPt() - ptTolerance[nStubLayers] ) goodState = false; + if (nPar_ == 5) { + double d0=fabs( state.xa()[D0] ); + if( d0 > d0Cut[nStubLayers] ) goodState = false; + } + + // chi2 selection + + double chi2scaled = state.chi2scaled(); // chi2(r-phi) scaled down to improve electron performance. + + if (getSettings()->kalmanMultiScattTerm() > 0.0001) { // Scattering taken into account + + if (chi2scaled > chi2Cut[nStubLayers]) goodState=false; // No separate pT selection needed + + } else { // scattering ignored - HISTORIC + + // N.B. Code below changed by Alexander Morton to allow tracking down to Pt = 2 GeV. + if( nStubLayers == 2 ) { + if (chi2scaled > 15.0) goodState=false; // No separate pT selection needed + } else if ( nStubLayers == 3 ) { + if (chi2scaled > 100.0 && pt > 2.7) goodState=false; + if (chi2scaled > 120.0 && pt <= 2.7) goodState=false; + } else if ( nStubLayers == 4 ) { + if (chi2scaled > 320.0 && pt > 2.7) goodState=false; + if (chi2scaled > 1420.0 && pt <= 2.7) goodState=false; + } else if ( nStubLayers == 5 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! + if (chi2scaled > 480.0 && pt > 2.7) goodState=false; + if (chi2scaled > 2130.0 && pt <= 2.7) goodState=false; + } else if ( nStubLayers >= 6 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! + if (chi2scaled > 640.0 && pt > 2.7) goodState=false; + if (chi2scaled > 2840.0 && pt <= 2.7) goodState=false; + } + + } + + const bool countUpdateCalls = false; // Print statement to count calls to Updator. + + if ( countUpdateCalls || + (getSettings()->kalmanDebugLevel() >= 2 && tpa_ != nullptr) || + (getSettings()->kalmanDebugLevel() >= 2 && getSettings()->hybrid()) ) { + if (not goodState) cout<<"State veto:"; + if (goodState) cout<<"State kept:"; + cout<<" nlay="< + +namespace TMTT { + +KalmanState::KalmanState(): kLayerNext_(0), layerId_(0), xa_(0), pxxa_(), K_(), dcov_(), stubCluster_(0), chi2rphi_(0), chi2rz_(0), fitter_(0), fXtoTrackParams_(0), barrel_(true), n_skipped_(0){ +} + +KalmanState::KalmanState( const L1track3D& candidate, unsigned n_skipped, unsigned kLayer_next, unsigned layerId, const KalmanState *last_state, + const std::vector &x, const TMatrixD &pxx, const TMatrixD &K, const TMatrixD &dcov, + const StubCluster* stubCluster, double chi2rphi, double chi2rz, + L1KalmanComb *fitter, GET_TRACK_PARAMS f ){ + + l1track3D_ = candidate; + n_skipped_ = n_skipped; + kLayerNext_ = kLayer_next; + layerId_ = layerId; + last_state_ = last_state; + xa_ = x; + pxxa_.Clear(); + pxxa_.ResizeTo( pxx.GetNrows(), pxx.GetNcols() ); + pxxa_ = pxx; + K_.ResizeTo( K.GetNrows(), K.GetNcols() ); + K_ = K; + dcov_.ResizeTo( dcov.GetNrows(), dcov.GetNcols() ); + dcov_ = dcov; + stubCluster_ = stubCluster; + chi2rphi_ = chi2rphi; + chi2rz_ = chi2rz; + kalmanChi2RphiScale_ = fitter->getSettings()->kalmanChi2RphiScale(); + + hitPattern_ = 0; + if (last_state != nullptr) hitPattern_ = last_state->hitPattern(); // Bit encoded list of hit layers + if (stubCluster != nullptr) hitPattern_ |= (1 << (stubCluster->layerKF())); + + // EJC CLANG complains about this line, + // const KalmanState *state = this; + + r_ = 0.1; + z_ = 0; + barrel_ = true; + endcapRing_ = 0; + + if( stubCluster ) { + r_ = stubCluster->r(); + z_ = stubCluster->z(); + barrel_ = stubCluster->barrel(); + endcapRing_ = stubCluster->endcapRing(); + } + + n_stubs_ = kLayerNext_ - n_skipped_; + + fitter_ = fitter; + fXtoTrackParams_ = f; +} + +KalmanState::KalmanState(const KalmanState &p){ + + l1track3D_ = p.candidate(); + n_skipped_ = p.nSkippedLayers(); + kLayerNext_ = p.nextLayer(); + layerId_ = p.layerId(); + endcapRing_ = p.endcapRing(); + r_ = p.r(); + z_ = p.z(); + last_state_ = p.last_state(); + xa_ = p.xa(); + pxxa_ = p.pxxa(); + K_ = p.K(); + dcov_ = p.dcov(); + stubCluster_ = p.stubCluster(); + chi2rphi_ = p.chi2rphi(); + chi2rz_ = p.chi2rz(); + n_stubs_ = p.nStubLayers(); + fitter_ = p.fitter(); + fXtoTrackParams_ = p.fXtoTrackParams(); + barrel_ = p.barrel(); +} + +KalmanState & KalmanState::operator=( const KalmanState &other ) +{ + if (&other == this) + return *this; + + l1track3D_ = other.candidate(); + n_skipped_ = other.nSkippedLayers(); + kLayerNext_ = other.nextLayer(); + layerId_ = other.layerId(); + endcapRing_ = other.endcapRing(); + r_ = other.r(); + z_ = other.z(); + last_state_ = other.last_state(); + xa_ = other.xa(); + pxxa_ = other.pxxa(); + K_ = other.K(); + dcov_ = other.dcov(); + stubCluster_ = other.stubCluster(); + chi2rphi_ = other.chi2rphi(); + chi2rz_ = other.chi2rz(); + n_stubs_ = other.nStubLayers(); + fitter_ = other.fitter(); + fXtoTrackParams_ = other.fXtoTrackParams(); + barrel_ = other.barrel(); + return *this; +} + +bool KalmanState::good( const TP *tp )const{ + + const KalmanState *state = this; + while( state ){ + const StubCluster *stubCluster = state->stubCluster(); + if( stubCluster ){ + set tps = stubCluster->assocTPs(); + + if( tps.find(tp) == tps.end() ) return false; + } + state = state->last_state(); + } + return true; +} + +double KalmanState::reducedChi2() const +{ + if( 2 * n_stubs_ - xa_.size() > 0 ) return (this->chi2())/ ( 2 * n_stubs_ - xa_.size() ); + else return 0; +} + +const KalmanState *KalmanState::last_update_state()const +{ + const KalmanState *state = this; + while( state ){ + if( state->stubCluster() ) return state; + state = state->last_state(); + } + return 0; +} + +std::vector KalmanState::stubs()const +{ + std::vector all_stubs; + + const KalmanState *state = this; + while( state ){ + const StubCluster *stbcl = state->stubCluster(); + if( stbcl ){ + std::vector stubs = stbcl->stubs(); + for( unsigned i=0; i < stubs.size(); i++ ){ + all_stubs.push_back( stubs.at(i) ); + } + } + state = state->last_state(); + } + std::reverse(all_stubs.begin(), all_stubs.end()); // Put innermost stub first. + return all_stubs; +} + +bool KalmanState::order(const KalmanState *left, const KalmanState *right){ return (left->nStubLayers() > right->nStubLayers()); } + +bool KalmanState::orderMinSkipChi2(const KalmanState *left, const KalmanState *right){ + return ( left->chi2scaled()*(left->nSkippedLayers()+1) < right->chi2scaled()*(right->nSkippedLayers()+1) ); +} + +bool KalmanState::orderChi2(const KalmanState *left, const KalmanState *right){ + return ( left->chi2scaled() < right->chi2scaled() ); +} + +void KalmanState::dump( ostream &os, const TP *tp, bool all )const +{ + std::map tp_x; + bool useForAlgEff(false); + if( tp ){ + useForAlgEff = tp->useForAlgEff(); + tp_x["qOverPt"] = tp->qOverPt(); + tp_x["phi0"] = tp->phi0(); + tp_x["z0"] = tp->z0(); + tp_x["t"] = tp->tanLambda(); + tp_x["d0"] = tp->d0(); + } + std::map y = fXtoTrackParams_( fitter_, this ); + + os << "KalmanState : "; + os << "next Kalman layer = " << kLayerNext_ << ", "; + os << "layerId = " << layerId_ << ", "; + os << " n_skipped = " << n_skipped_ << ", "; + os << "barrel = " << barrel_ << ", "; + os << "endcapRing = " << endcapRing_ << ", "; + os << "r = " << r_ << ", "; + os << "z = " << z_ << ", "; + for( auto pair : y ){ + os << pair.first << ":" << y[pair.first] << " "; + } + os << endl; + os << "xa = ( "; + for( unsigned i=0; iindex() << " "; + os << "layerId : " << stub->layerId() << " "; + os << "[r,phi,z] = "; + os << "[" << stub->r() << ", " << stub->phi() << ", " << stub->z() << "] "; + os << " assoc TP indices = [ "; + std::set tps = stub->assocTPs(); + for( auto tp : tps ) os << tp->index() << " "; + os << "] "; + os << endl; + } + if( tp ){ + os << "\tTP index = " << tp->index() << " useForAlgEff = " << useForAlgEff << " "; + os << "rel. residual "; + for( auto pair : tp_x ){ + os << pair.first << ":" << ( y[pair.first] - pair.second ) / pair.second << " "; + } + } + else{ + os << "\tTP index = "; + } + os << endl; + + if( stubCluster_ ){ + os << "\tstub [r,phi,z] = "; + os << "[" << stubCluster_->r() << ", " << stubCluster_->phi() << ", " << stubCluster_->z() << "] "; + os << " assoc TP indices = [ "; + std::set tps = stubCluster_->assocTPs(); + for( auto tp : tps ) os << tp->index() << " "; + os << "] "; + } + else{ + os << "\tvirtual stub"; + } + os << endl; + + if( all ){ + const KalmanState *state = last_state(); + if( state ){ + state->dump( os, tp, all ); + // state = state->last_state(); + } + else return; + } +} + +} + diff --git a/L1Trigger/TrackFindingTMTT/src/KillDupFitTrks.cc b/L1Trigger/TrackFindingTMTT/src/KillDupFitTrks.cc new file mode 100644 index 0000000000000..c2cd0eb771a52 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/KillDupFitTrks.cc @@ -0,0 +1,243 @@ +#include "L1Trigger/TrackFindingTMTT/interface/KillDupFitTrks.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "FWCore/Utilities/interface/Exception.h" +#include + +namespace TMTT { + +//=== Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. + +void KillDupFitTrks::init(const Settings* settings, unsigned int dupTrkAlg) +{ + settings_ = settings; + dupTrkAlg_ = dupTrkAlg; + killDupTrks_.init(settings, dupTrkAlg); // Initialise duplicate removal algorithms that are common to all tracks. +} + +//=== Eliminate duplicate tracks from the input collection, and so return a reduced list of tracks. + +vector KillDupFitTrks::filter(const vector& vecTracks) const +{ + if (dupTrkAlg_ == 0) { + + // We are not running duplicate removal, so return original fitted track collection. + return vecTracks; + + } else { + + // Choose which algorithm to run, based on parameter dupTrkAlg_. + switch (dupTrkAlg_) { + // Run filters that only work on fitted tracks. + case 50: return filterAlg50( vecTracks ) ; break; + case 51: return filterAlg51( vecTracks ); break; + // Run filters that work on any type of track (l1track2d, l1track3d, l1fittedtrack). + default: return killDupTrks_.filter(vecTracks); + } + + // Should never get here ... + } +} + +//=== Duplicate removal algorithm designed to run after the track helix fit, which eliminates duplicates +//=== simply by requiring that the fitted (q/Pt, phi0) of the track correspond to the same HT cell in +//=== which the track was originally found by the HT. +//=== N.B. This code runs on tracks in a single sector. It could be extended to run on tracks in entire +//=== tracker by adding the track's sector number to memory "htCellUsed" below. + + +vector KillDupFitTrks::filterAlg50(const vector& tracks) const +{ + // Hard-wired options to play with. + const bool debug = false; + const bool doRecoveryStep = true; // Do 2nd pass through rejected tracks to see if any should be rescued. + const bool reduceDups = true; // Option attempting to reduce duplicate tracks during 2nd pass. + const bool memorizeAllHTcells = false; // First pass stores in memory all cells that the HT found tracks in, not just those of tracks accepted by the first pass. + const bool doSectorCheck = false; // Require fitted helix to lie within sector. + const bool usePtAndZ0Cuts = false; + // IRT - was false + const bool goOutsideArray = true; // Also store in memory stubs outside the HT array during 2nd pass. + // IRT - was false + const bool limitDiff = true; // Limit allowed diff. between HT & Fit cell to <= 1. + + if (debug && tracks.size() > 0) cout<<"START "< tracksFiltered; + + // Make a first pass through the tracks, doing initial identification of duplicate tracks. + // N.B. BY FILLING THIS WITH CELLS AROUND SELECTED TRACKS, RATHER THAN JUST THE CELL CONTAINING THE + // TRACK, ONE CAN REDUCE THE DUPLICATE RATE FURTHER, AT COST TO EFFICIENCY. + set< pair > htCellUsed; + vector tracksRejected; + + // For checking if multiple tracks corresponding to same TP are accepted by duplicate removal. + map> tpFound; + map tpFoundAtPass; + + for (const L1fittedTrack& trk : tracks) { + + // Only consider tracks whose fitted helix parameters are in the same sector as the HT originally used to find the track. + if ( ( ! doSectorCheck) || trk.consistentSector() ) { + if ( ( ! usePtAndZ0Cuts) || ( fabs(trk.z0()) < settings_->beamWindowZ() && trk.pt() > settings_->houghMinPt() - 0.2) ) { + + // For debugging. + const TP* tp = trk.getMatchedTP(); + + // Check if this track's fitted (q/pt, phi0) helix parameters correspond to the same HT cell as the HT originally found the track in. + bool consistentCell = trk.consistentHTcell(); + if (consistentCell) { + // This track is probably not a duplicate, so keep & and store its HT cell location (which equals the HT cell corresponding to the fitted track). + tracksFiltered.push_back(trk); + // Memorize HT cell location corresponding to this track (identical for HT track & fitted track). + if ( ! memorizeAllHTcells) { + pair htCell = trk.getCellLocationHT(); + htCellUsed.insert( htCell ); + if (trk.getL1track3D().mergedHTcell()) { + // If this is a merged cell, block the other elements too, in case a track found by the HT in an unmerged cell + // has a fitted cell there. + pair htCell10( htCell.first + 1, htCell.second); + pair htCell01( htCell.first , htCell.second + 1); + pair htCell11( htCell.first + 1, htCell.second + 1); + htCellUsed.insert( htCell10 ); + htCellUsed.insert( htCell01 ); + htCellUsed.insert( htCell11 ); + } + } + + if (debug && tp != nullptr) { + cout<<"FIRST PASS: m="<index()].first<<","<index()].second<<") dup="<index()]<index()) != tpFound.end()) tpFound[tp->index()] = trk.getCellLocationFit(); + tpFoundAtPass[tp->index()] = 1; + } + + } else { + + if (limitDiff) { + const unsigned int maxDiff = 1; + if (abs(int(trk.getCellLocationHT().first) - int(trk.getCellLocationFit().first)) <= maxDiff && + abs(int(trk.getCellLocationHT().second) - int(trk.getCellLocationFit().second)) <= maxDiff) tracksRejected.push_back(&trk); + } else { + tracksRejected.push_back(&trk); + } + + if (debug && tp != nullptr) { + cout<<"FIRST REJECT: m="<index()].first<<","<index()].second<<") dup="<index()]< htCell = trk.getCellLocationFit(); // Intentionally used fit instead of HT here. + htCellUsed.insert( htCell ); + if (trk.getL1track3D().mergedHTcell()) { + // If this is a merged cell, block the other elements too, in case a track found by the HT in an unmerged cell + // has a fitted cell there. + // N.B. NO GOOD REASON WHY "-1" IS NOT DONE HERE TOO. MIGHT REDUCE DUPLICATE RATE? + pair htCell10( htCell.first + 1, htCell.second); + pair htCell01( htCell.first , htCell.second + 1); + pair htCell11( htCell.first + 1, htCell.second + 1); + htCellUsed.insert( htCell10 ); + htCellUsed.insert( htCell01 ); + htCellUsed.insert( htCell11 ); + } + } + } + } + } + + if (doRecoveryStep) { + // Making a second pass through the rejected tracks, checking if any should be rescued. + for (const L1fittedTrack* trk : tracksRejected) { + + + // Get location in HT array corresponding to fitted track helix parameters. + pair htCell = trk->getCellLocationFit(); + // If this HT cell was not already memorized, rescue this track, since it is probably not a duplicate, + // but just a track whose fitted helix parameters are a bit wierd for some reason. + if (std::count(htCellUsed.begin(), htCellUsed.end(), htCell) == 0) { + tracksFiltered.push_back(*trk); // Rescue track. + // Optionally store cell location to avoid rescuing other tracks at the same location, which may be duplicates of this track. + bool outsideCheck =( goOutsideArray || trk->pt() > settings_->houghMinPt() ); + if (reduceDups && outsideCheck) htCellUsed.insert( htCell ); + + // For debugging. + const TP* tp = trk->getMatchedTP(); + + if (debug && tp != nullptr) { + cout<<"SECOND PASS: m="<getCellLocationHT().first<<"/"<getCellLocationFit().first<<" c="<getCellLocationHT().second<<"/"<getCellLocationFit().second<<" Delta(m,c)=("<getCellLocationHT().first) - int(trk->getCellLocationFit().first)<<","<getCellLocationHT().second) - int(trk->getCellLocationFit().second)<<") pure="<getPurity()<<" merged="<getL1track3D().mergedHTcell()<<" #layers="<getL1track3D().getNumLayers()<<" tp="<index()<<" dupCell=("<index()].first<<","<index()].second<<") dup="<index()]<index()) != tpFound.end()) tpFound[tp->index()] = htCell; + tpFoundAtPass[tp->index()] = 2; + } + } + } + } + + // Debug printout to identify duplicate tracks that survived. + if (debug) this->printDuplicateTracks(tracksFiltered); + + return tracksFiltered; +} +//=== Duplicate removal algorithm designed to run after the track helix fit, which eliminates duplicates +//=== simply by requiring that no two tracks should have fitted (q/Pt, phi0) that correspond to the same HT +//=== cell. If they do, then only the first to arrive is kept. +//=== N.B. This code runs on tracks in a single sector. It could be extended to run on tracks in entire +//=== tracker by adding the track's sector number to memory "htCellUsed" below. + +vector KillDupFitTrks::filterAlg51(const vector& tracks) const +{ + // Hard-wired options to play with. + const bool debug = false; + + if (debug && tracks.size() > 0) cout<<"START "< tracksFiltered; + set< pair > htCellUsed; + + for (const L1fittedTrack& trk : tracks) { + // Get location in HT array corresponding to fitted track helix parameters. + pair htCell = trk.getCellLocationFit(); + // If this HT cell was not already memorized, rescue this track, since it is probably not a duplicate, + // but just a track whose fitted helix parameters are a bit wierd for some reason. + if (std::count(htCellUsed.begin(), htCellUsed.end(), htCell) == 0) { + tracksFiltered.push_back(trk); // Rescue track. + // Store cell location to avoid rescuing other tracks at the same location, which may be duplicates of this track. + htCellUsed.insert( htCell ); + if (debug) { + const TP* tp = trk.getMatchedTP(); + int tpIndex = (tp != nullptr) ? tp->index() : -999; + cout<<"ALG51: m="<getCellLocationFit().first<<" c="<getCellLocationHT().second<<"/"<getCellLocationFit().second<<" tp="<index()<<" tp_pt="<pt()<<" fit_pt="<pt()<<" pure="<getPurity()< 0) cout<<"FOUND "< +#include +#include + +namespace TMTT { + +template +std::vector operator-(const std::vector& a, const std::vector& b){ + assert(a.size() == b.size()); + std::vector result; + result.reserve(a.size()); + std::transform(a.begin(), a.end(), b.begin(), std::back_inserter(result), std::minus()); + return result; +} + +L1ChiSquared::L1ChiSquared(const Settings* settings, const uint nPar) : TrackFitGeneric(settings), chiSq_ (0.0){ + // Bad stub killing settings + numFittingIterations_ = getSettings()->numTrackFitIterations(); + killTrackFitWorstHit_ = getSettings()->killTrackFitWorstHit(); + generalResidualCut_ = getSettings()->generalResidualCut(); // The cut used to remove bad stubs (if nStubs > minLayers) + killingResidualCut_ = getSettings()->killingResidualCut(); // The cut used to kill off tracks entirely + + //--- These two parameters are used to check if after the fit, there are still enough stubs on the track + minStubLayers_ = getSettings()->minStubLayers(); + nPar_ = nPar; +} + +void L1ChiSquared::calculateChiSq( std::vector resids ){ + chiSq_ = 0.0; + uint j=0; + for ( uint i=0; i delX, std::vector covX ){ + for ( uint i=0; i x = seed(l1track3D); + + Matrix d = D(x); + Matrix dtVinv = d.transpose() * Vinv(); +// Matrix M = dtVinv * d; + Matrix M = dtVinv * (dtVinv.transpose()); //TODO this match tracklet code, but not literature:w + + std::vector resids = residuals(x); +// std::cout << "resids.size(): " << resids.size() << std::endl; + std::vector deltaX = M.inverse() * dtVinv * resids; + x = x - deltaX; + std::vector covX = d.transpose() * Vinv() * resids; + + calculateChiSq(resids); + calculateDeltaChiSq (deltaX, covX); + resids = residuals(x); // update resids. + + for (int i=1;i1) { + /* + // Original buggy code of 18th April 2018 + if ( killTrackFitWorstHit_ && (largestresid_ > killingResidualCut_ || (largestresid_ > generalResidualCut_ && Utility::countLayers( getSettings(), stubs_ ) > minStubLayersRed_)) ) { + cout<<"RATS KILLED STUB "< "< "<debug() == 6) std::cout << __FILE__ " : Killed stub " << ilargestresid_ << "." << std::endl; + } + */ + + // IRT - Debugged code of 19th April 2018 + bool killWorstStub = false; + if (killTrackFitWorstHit_) { + if (largestresid_ > killingResidualCut_) { + killWorstStub = true; + } else if (largestresid_ > generalResidualCut_) { + std::vector stubsTmp = stubs_; + stubsTmp.erase(stubsTmp.begin()+ilargestresid_); + if (Utility::countLayers( getSettings(), stubsTmp ) >= minStubLayersRed_) killWorstStub = true; + } else { + // Get better apparent tracking performance by always killing worst stub until only 4 layers left. + if (Utility::countLayers( getSettings(), stubs_ ) > minStubLayersRed_) killWorstStub = true; + } + } + + if (killWorstStub) { + stubs_.erase(stubs_.begin()+ilargestresid_); + if (getSettings()->debug() == 6) std::cout << __FILE__ " : Killed stub " << ilargestresid_ << "." << std::endl; + + // Reject tracks with too many killed stubs & stop iterating. + unsigned int nLayers = Utility::countLayers( getSettings(), stubs_ ); // Count tracker layers with stubs + bool valid = nLayers >= minStubLayersRed_; + + if ( ! valid ){ + const unsigned int hitPattern = 0; // FIX: Needs setting + return L1fittedTrack (getSettings(), l1track3D, stubs_, hitPattern, l1track3D.qOverPt(), 0., l1track3D.phi0(), l1track3D.z0(), l1track3D.tanLambda(), 999999., 4, valid); + } + } + + d = D(x); // Calculate derivatives + dtVinv = d.transpose() * Vinv(); + M = dtVinv * (dtVinv.transpose()); + resids = residuals(x); // Calculate new residuals + std::vector deltaX = M.inverse() * dtVinv * resids; + x = x - deltaX; + std::vector covX = d.transpose() * Vinv() * resids; + resids = residuals(x); // update resids. + + calculateChiSq(resids); + calculateDeltaChiSq (deltaX, covX); + } + } + + std::map tp = convertParams(x); // tp = track params + + // Reject tracks with too many killed stubs + unsigned int nLayers = Utility::countLayers( getSettings(), stubs_ ); // Count tracker layers with stubs + bool valid4par = nLayers >= minStubLayersRed_; + + const unsigned int hitPattern = 0; // FIX: Needs setting + if ( valid4par ){ + return L1fittedTrack(getSettings(), l1track3D, stubs_, hitPattern, tp["qOverPt"], 0, tp["phi0"], tp["z0"], tp["t"], chiSq_, nPar_, valid4par); + } + else{ + return L1fittedTrack (getSettings(), l1track3D, stubs_, hitPattern, l1track3D.qOverPt(), 0., l1track3D.phi0(), l1track3D.z0(), l1track3D.tanLambda(), 999999., 4, valid4par); + } +} + + +} diff --git a/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc b/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc new file mode 100644 index 0000000000000..f3f879e508ef7 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc @@ -0,0 +1,1675 @@ +///=== This is the base class for the Kalman Combinatorial Filter track fit algorithm. + +///=== Written by: S. Summers, K. Uchida, M. Pesaresi + +#include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" +#include "L1Trigger/TrackFindingTMTT/interface/Utility.h" + +#include +#include "L1Trigger/TrackFindingTMTT/interface/TP.h" +#include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" +#include "L1Trigger/TrackFindingTMTT/interface/StubCluster.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "CommonTools/UtilAlgos/interface/TFileService.h" +#include "DataFormats/Math/interface/deltaPhi.h" + +#include +#include +#include +#include +#include +//#define CKF_DEBUG +// Enable debug printout to pair with that in Histos.cc enabled by recalc_debug. +//#define RECALC_DEBUG + +// Enable merging of nearby stubs. +//#define MERGE_STUBS + +namespace TMTT { + +unsigned LayerId[16] = { 1, 2, 3, 4, 5, 6, 11, 12, 13, 14, 15, 21, 22, 23, 24, 25 }; + +static bool orderStubsByLayer(const Stub* a, const Stub* b){ + return (a->layerId() < b->layerId()); +} + +#ifdef MERGE_STUBS +static bool orderStubsByZ(const Stub* a, const Stub* b){ + return (a->z() < b->z()); +} + +static bool orderStubsByR(const Stub* a, const Stub* b){ + return (a->r() < b->r()); +} +#endif + +void L1KalmanComb::printTPSummary( std::ostream &os, const TP *tp, bool addReturn) const { + + if( tp ){ + + os << "TP "; + // os << "addr=" << tp << " "; + os << "index=" << tp->index() << " "; + os << "qOverPt=" << tp->qOverPt() << " "; + os << "phi0=" << tp->phi0() << " "; + os << "z0=" << tp->z0() << " "; + os << "t=" << tp->tanLambda() << " "; + os << "d0=" << tp->d0(); + if( addReturn ) os << endl; + else os << " | "; + } +} + +void L1KalmanComb::printTP( std::ostream &os, const TP *tp ) const { + + std::map tpParams; + bool useForAlgEff(false); + if( tp ){ + useForAlgEff = tp->useForAlgEff(); + tpParams["qOverPt"] = tp->qOverPt(); + tpParams["phi0"] = tp->phi0(); + tpParams["z0"] = tp->z0(); + tpParams["t"] = tp->tanLambda(); + tpParams["d0"] = tp->d0(); + } + if( tp ){ + os << " TP index = " << tp->index() << " useForAlgEff = " << useForAlgEff << " "; + for( auto pair : tpParams ){ + os << pair.first << ":" << pair.second << ", "; + } + os << " inv2R = " << tp->qOverPt() * getSettings()->invPtToInvR() * 0.5; + } + else{ + os << " Fake"; + } + os << endl; +} + +void L1KalmanComb::printStubLayers( std::ostream &os, std::vector &stubs ) const { + + if( stubs.size() == 0 ) os << "stub layers = []" << endl; + else{ + os << "stub layers = [ "; + for( unsigned i=0; ilayerId() << ", "; + os << stubs.back()->layerId() << " ]" << endl; + } +} + +void L1KalmanComb::printStubCluster( std::ostream &os, const StubCluster * stubCluster, bool addReturn ) const { + os << "stub: "; + // os << "addr=" << stub << " "; + os << "index=" << stubCluster->stubs()[0]->index() << " "; + os << "layer=" << stubCluster->layerId() << " "; + os << "ring=" << stubCluster->endcapRing() << " "; + os << "r=" << stubCluster->r() << " "; + os << "phi=" << stubCluster->phi() << " "; + os << "z=" << stubCluster->z() << " "; + os << "sigmaX=" << stubCluster->sigmaX() << " "; + os << "sigmaZ=" << stubCluster->sigmaZ() << " "; + os << "dphi_dr=" << stubCluster->dphi_dr() << " "; + os << "#stubs= " << stubCluster->nStubs() << " "; + os << "TPids="; + std::set tps = stubCluster->assocTPs(); + for( auto tp : tps ) os << tp->index() << ","; + if( addReturn ) os << endl; + else os << " | "; +} + +void L1KalmanComb::printStubClusters( std::ostream &os, std::vector &stubClusters ) const { + + for( auto &stubcl : stubClusters ){ + printStubCluster( os, stubcl ); + } +} + +void L1KalmanComb::printStub( std::ostream &os, const Stub * stub, bool addReturn ) const { + os << "stub "; + // os << "addr=" << stub << " "; + os << "index=" << stub->index() << " "; + os << "layerId=" << stub->layerId() << " "; + os << "endcapRing=" << stub->endcapRing() << " "; + os << "r=" << stub->r() << " "; + os << "phi=" << stub->phi() << " "; + os << "z=" << stub->z() << " "; + os << "sigmaX=" << stub->sigmaX() << " "; + os << "sigmaZ=" << stub->sigmaZ() << " "; + os << "TPids="; + std::set tps = stub->assocTPs(); + for( auto tp : tps ) os << tp->index() << ","; + if( addReturn ) os << endl; + else os << " | "; + +} + +void L1KalmanComb::printStubs( std::ostream &os, std::vector &stubs ) const { + + for( auto &stub : stubs ){ + printStub( os, stub ); + } +} + + +//=== Get Kalman layer mapping (i.e. layer order in which stubs should be processed) + +unsigned int L1KalmanComb::getKalmanLayer(unsigned int iEtaReg, unsigned int layerIDreduced, bool barrel) const { + + // index across is GP encoded layer ID (where barrel layers=1,2,7,5,4,3 & endcap wheels=3,4,5,6,7 & 0 never occurs) + // index down is eta reg + // element is kalman layer, where 7 is invalid + + // If stub with given GP encoded layer ID can have different KF layer ID depending on whether it + // is barrel or endcap, then in layerMap, the the barrel case is assumed. + // The endcap case is fixed by hand later in this function. + + + const unsigned int nEta = 16; + const unsigned int nGPlayID = 7; + + if (nEta != numEtaRegions_) throw cms::Exception("ERROR L1KalmanComb::getKalmanLayer hardwired value of nEta differs from NumEtaRegions cfg param"); + + static const unsigned layerMap[nEta/2][nGPlayID+1] = + { + { 7, 0, 1, 5, 4, 3, 7, 2 }, + { 7, 0, 1, 5, 4, 3, 7, 2 }, + { 7, 0, 1, 5, 4, 3, 7, 2 }, + { 7, 0, 1, 5, 4, 3, 7, 2 }, + { 7, 0, 1, 5, 4, 3, 7, 2 }, + { 7, 0, 1, 3, 4, 2, 6, 2 }, + { 7, 0, 1, 1, 2, 3, 4, 5 }, + { 7, 0, 7, 1, 2, 3, 4, 5 }, + }; + + unsigned int kfEtaReg; // KF VHDL eta sector def: small in barrel & large in endcap. + if (iEtaReg < numEtaRegions_/2) { + kfEtaReg = numEtaRegions_/2 - 1 - iEtaReg; + } else { + kfEtaReg = iEtaReg - numEtaRegions_/2; + } + + unsigned int kalmanLayer = layerMap[kfEtaReg][layerIDreduced]; + + // Fixes to endcap stubs. + + if ( not barrel ) { + + switch ( kfEtaReg ) { + case 4: + if (layerIDreduced==3) kalmanLayer = 4; + if (layerIDreduced==4) kalmanLayer = 5; + if (layerIDreduced==5) kalmanLayer = 6; + break; + case 5: + if (layerIDreduced==5) kalmanLayer = 5; + if (layerIDreduced==7) kalmanLayer = 6; + break; + default: + break; + } + + } + + return kalmanLayer; + +} + + + +L1KalmanComb::L1KalmanComb(const Settings* settings, const uint nPar, const string &fitterName, const uint nMeas ) : TrackFitGeneric(settings, fitterName ){ + nPar_ = nPar; + nMeas_ = nMeas; + numEtaRegions_ = settings->numEtaRegions(); + + hymin = vector( nPar_, -1 ); + hymax = vector( nPar_, 1 ); + hymin[0] = -0.05; + hymax[0] = +0.05; + hymin[1] = -3.2; + hymax[1] = +3.2; + hymin[2] = -20; + hymax[2] = +20; + hymin[3] = -6; + hymax[3] = +6; + if (nPar_ == 5) { + hymin[4] = -5; + hymax[4] = +5; + } + + hxmin = vector( nPar_, -1 ); + hxmax = vector( nPar_, 1 ); + + hddMeasmin = vector( 2, -1e-3 ); + hddMeasmax = vector( 2, 1e-3 ); + + hresmin = vector( 2, -1e-2 ); + hresmax = vector( 2, 1e-2 ); + + hxaxtmin = vector( nPar_, -1 ); + hxaxtmax = vector( nPar_, 1 ); + + hdxmin = vector( nPar_, -1 ); + hdxmax = vector( nPar_, 1 ); + + hchi2min = 0; + hchi2max = 50; + + maxNfitForDump_ = 10; + dump_ = false; + + iLastPhiSec_ = 999; + iLastEtaReg_ = 999; +} + + +L1fittedTrack L1KalmanComb::fit(const L1track3D& l1track3D){ + + iLastPhiSec_ = iCurrentPhiSec_; + iLastEtaReg_ = iCurrentEtaReg_; + iCurrentPhiSec_ = l1track3D.iPhiSec(); + iCurrentEtaReg_ = l1track3D.iEtaReg(); + resetStates(); + deleteStubClusters(); + numUpdateCalls_ = 0; + + // Get cut on number of layers including variation due to dead sectors, pt dependence etc. + minStubLayersRed_ = Utility::numLayerCut("FIT", getSettings(), l1track3D.iPhiSec(), l1track3D.iEtaReg(), fabs(l1track3D.qOverPt()), l1track3D.eta()); + + //TP + const TP* tpa(0); + if( l1track3D.getMatchedTP() ){ + tpa = l1track3D.getMatchedTP(); + } + tpa_ = tpa; + + //dump flag + static unsigned nthFit(0); + nthFit++; + if( getSettings()->kalmanDebugLevel() >= 3 && nthFit <= maxNfitForDump_ ){ + if( tpa ) dump_ = true; + else dump_ = false; + } + else dump_ = false; + + //stub list from L1track3D, sorted in layer order - necessary for clustering only + std::vector stubs = l1track3D.getStubs(); + + sort(stubs.begin(), stubs.end(), orderStubsByLayer); // Unnecessary? + +#ifdef MERGE_STUBS + // Eliminate identical duplicate stubs. + for(unsigned i=0; i < stubs.size(); i++ ){ + const Stub *stub_a = stubs.at(i); + for(unsigned j=i+1; j < stubs.size(); j++ ){ + const Stub *stub_b = stubs.at(j); + if( stub_a->r() == stub_b->r() && stub_a->phi() == stub_b->phi() && stub_a->z() == stub_b->z() ){ + stubs.erase( stubs.begin() + j ); + if( getSettings()->kalmanFillInternalHists() ) + hndupStub_->Fill(1); + j--; + } + } + } +#endif + + std::vector stubcls; + + for( unsigned j_layer=0; j_layer < 16; j_layer++ ){ + + std::vector layer_stubs; + for(unsigned i=0; i < stubs.size(); i++ ){ + const Stub *stub = stubs.at(i); + if( stub->layerId() == LayerId[j_layer] ){ + layer_stubs.push_back( stub ); + } + } + +#ifdef MERGE_STUBS + if( LayerId[j_layer] < 10 ) + sort( layer_stubs.begin(), layer_stubs.end(), orderStubsByZ ); // barrel + else + sort( layer_stubs.begin(), layer_stubs.end(), orderStubsByR ); // endcap +#endif + + for(unsigned i=0; i < layer_stubs.size(); i++ ){ // Stubs in single layer, ordered by z or r. + + std::vector stubs_for_cls; + stubs_for_cls.push_back(layer_stubs.at(i)); + +#ifdef MERGE_STUBS + while( layer_stubs.at(i) != layer_stubs.back() ){ + if( isOverlap( layer_stubs.at(i), layer_stubs.at(i+1), TYPE_NORMAL ) ){ + stubs_for_cls.push_back( layer_stubs.at(i+1) ); + if( getSettings()->kalmanFillInternalHists() ) + hnmergeStub_->Fill(0); + i++; + } + else break; + } +#endif + + if( getSettings()->kalmanFillInternalHists() ) { + + if( tpa && tpa->useForAlgEff() ){ + + if( stubs_for_cls.size() > 1 ){ + + std::set s_tps = stubs_for_cls.at(0)->assocTPs(); + if( s_tps.find( tpa ) != s_tps.end() ){ + + const Stub *sa = stubs_for_cls.front(); + const Stub *sb = stubs_for_cls.back(); + + double drphi = fabs( sa->r() * reco::deltaPhi( sa->phi(), sectorPhi() ) - sb->r() * reco::deltaPhi( sb->phi(), sectorPhi() ) ); + double dz = fabs( sa->z() - sb->z() ); + double dr = fabs( sa->r() - sb->r() ); + TString hname; + if( LayerId[j_layer] < 10 ){ + + hname = Form( "hBarrelStubMaxDistanceLayer%02d", LayerId[j_layer] ); + + if( hBarrelStubMaxDistanceMap.find( hname ) == hBarrelStubMaxDistanceMap.end() ){ + cout << hname << " does not exist." << endl; + } + else{ + hBarrelStubMaxDistanceMap[hname]->Fill( drphi, dz ); + } + } + else{ + hname = Form( "hEndcapStubMaxDistanceRing%02d", sa->endcapRing() ); + + if( hEndcapStubMaxDistanceMap.find( hname ) == hEndcapStubMaxDistanceMap.end() ){ + cout << hname << " does not exist." << endl; + } + else{ + hEndcapStubMaxDistanceMap[hname]->Fill( drphi, dr ); + } + } + } + } + } + } + + // dl error now disabled + StubCluster *stbcl = new StubCluster( stubs_for_cls, sectorPhi(), 0 ); + stbcl_list_.push_back( stbcl ); + stubcls.push_back( stbcl ); + + if( getSettings()->kalmanFillInternalHists() ) { + if( !stbcl->barrel() ){ + TString hname = Form( "hphiErrorRatioRing%d", stbcl->endcapRing() ); + if( hphiErrorRatioMap.find(hname) == hphiErrorRatioMap.end() ){ + cout << hname << " does not exist." << endl; + } + else{ + hphiErrorRatioMap[hname]->Fill( fabs( stbcl->deltai() + 0.5 ), fabs( stbcl->dphi_dr() ) / stbcl->dphi_dl() ); + } + } + } + } + } + if( getSettings()->kalmanFillInternalHists() ){ + if( tpa && tpa->useForAlgEff() ){ + hTrackEta_->Fill( tpa->eta() ); + static set set_tp; + if( iCurrentPhiSec_ < iLastPhiSec_ && iCurrentEtaReg_ < iLastEtaReg_ ) set_tp.clear(); + if( set_tp.find( tpa ) == set_tp.end() ){ + hUniqueTrackEta_->Fill( tpa->eta() ); + } + set_tp.insert( tpa ); + } + } + + + //track information dump + if( getSettings()->kalmanDebugLevel() >= 1 ){ + + std::cout << "===============================================================================" << endl; + std::cout << "Input track cand: [phiSec,etaReg]=[" << l1track3D.iPhiSec() << "," << l1track3D.iEtaReg() << "]"; + std::cout <<" HT(m,c)=("<chi2rphi(), cand->chi2rz(), nPar_, true); + + bool consistentHLS = false; // No longer used + // if (this->isHLS()) { + // unsigned int mBinHelixHLS, cBinHelixHLS; + // cand->getHLSselect(mBinHelixHLS, cBinHelixHLS, consistentHLS); + // if( getSettings()->kalmanDebugLevel() >= 3 ){ + // // Check if (m,c) corresponding to helix params are correctly calculated by HLS code. + // bool HLS_OK = ((mBinHelixHLS == returnTrk.getCellLocationFit().first) && (cBinHelixHLS == returnTrk.getCellLocationFit().second)); + // if (not HLS_OK) std::cout<<"WARNING HLS mBinHelix disagrees with C++:" + // <<" (HLS,C++) m=("<isHLS() && nPar_ == 4) { + returnTrk.setInfoKF( cand->nSkippedLayers(), numUpdateCalls_, consistentHLS ); + } else { + returnTrk.setInfoKF( cand->nSkippedLayers(), numUpdateCalls_ ); + } + + // If doing 5 parameter fit, optionally also calculate helix params & chi2 with beam-spot constraint applied, + // and store inside L1fittedTrack object. + if (getSettings()->kalmanAddBeamConstr()) { + if (nPar_ == 5) { + double chi2rphi_bcon = 0.; + std::map trackParams_bcon = getTrackParams_BeamConstr(cand, chi2rphi_bcon); + returnTrk.setBeamConstr(trackParams_bcon["qOverPt"], trackParams_bcon["phi0"], chi2rphi_bcon); + } + } + + // Fitted track params must lie in same sector as HT originally found track in. + if (! getSettings()->hybrid() ) { // consistentSector() function not yet working for Hybrid. + + // Bodge to take into account digitisation in sector consistency check. + if (getSettings()->enableDigitize()) returnTrk.digitizeTrack("KF4ParamsComb"); + + if (! returnTrk.consistentSector()) { + L1fittedTrack failedTrk(getSettings(), l1track3D, cand->stubs(), cand->hitPattern(), trackParams["qOverPt"], trackParams["d0"], trackParams["phi0"], trackParams["z0"], trackParams["t"], cand->chi2rphi(), cand->chi2rz(), nPar_, false); + if(this->isHLS() && nPar_ == 4) { + failedTrk.setInfoKF( cand->nSkippedLayers(), numUpdateCalls_, consistentHLS ); + } else { + failedTrk.setInfoKF( cand->nSkippedLayers(), numUpdateCalls_ ); + } + if ( getSettings()->kalmanDebugLevel() >= 1 ) cout<<"Track rejected by sector consistency test"<kalmanDebugLevel() >= 3 ){ + cout << "------------------------------------" << endl; + if( tpa && tpa->useForAlgEff() ){ + cout << "TP for eff. : index " << tpa->index() << endl; + } + cout << "Candidate : " << endl; + if( tpa && tpa->useForAlgEff() && returnTrk.getPurity() != 1 ){ + cout << "The candidate is not pure" << endl; + } + cand->dump( cout, tpa, true ); + cout << "------------------------------------" << endl; + } + + //fill histograms for the selected state with TP for algEff + if( getSettings()->kalmanFillInternalHists() ) fillCandHists( *cand, tpa ); + + return returnTrk; + + } else { + + if (getSettings()->kalmanDebugLevel() >= 1) { + bool goodTrack = ( tpa && tpa->useForAlgEff() ); // Matches truth particle. + if(goodTrack) { + // Debug printout for Mark to understand why tracks are lost. + + int tpin=tpa->index(); + cout<<"TRACK LOST: eta="<index(); + cout<assocTPs().size()==0) cout<<" none"< trackParams = getTrackParams(state); + //L1fittedTrack returnTrk(getSettings(), l1track3D, state->stubs(), state->hitPattern(), trackParams["qOverPt"], trackParams["d0"], trackParams["phi0"], trackParams["z0"], trackParams["t"], state->chi2rphi(), state->chi2rz(), nPar_, true); + + + std::vector sstubs = state->stubs(); + for( auto stub : sstubs ){ + + for (const TP* tp_i : stub->assocTPs()) { + cout<index()<r()<<" "<z()<<" "<nStubLayers()<kalmanDebugLevel() >= 3 ){ + if( tpa && tpa->useForAlgEff() ){ + cout << "TP for eff. missed addr. index : " << tpa << " " << tpa->index() << endl; + printStubClusters( cout, stubcls ); + printStubs( cout, stubs ); + } + } + + L1fittedTrack returnTrk(getSettings(), l1track3D, l1track3D.getStubs(), 0, l1track3D.qOverPt(), 0, l1track3D.phi0(), l1track3D.z0(), l1track3D.tanLambda(), 9999, 9999, nPar_, false); + returnTrk.setInfoKF( 0, numUpdateCalls_ ); + return returnTrk; + } + +} + + +std::vector L1KalmanComb::doKF( const L1track3D& l1track3D, const std::vector &stubClusters, const TP *tpa ){ + +#ifdef RECALC_DEBUG + cout<<"FITTER new track: HT cell=("< finished_states; + + std::map > best_state_by_nstubs; // Best state (if any) for each viable no. of stubs on track value. + + // seed helix params & their covariance. + std::vector x0 = seedx(l1track3D); + TMatrixD pxx0 = seedP(l1track3D); + TMatrixD K( nPar_, 2 ); + TMatrixD dcov( 2, 2 ); + + const KalmanState *state0 = mkState( l1track3D, 0, 0, 0, nullptr, x0, pxx0, K, dcov, nullptr, 0, 0 ); + + if( getSettings()->kalmanFillInternalHists() ) fillSeedHists( state0, tpa ); + + + // internal containers - i.e. the state FIFO. Contains estimate of helix params in last/next layer, with multiple entries if there were multiple stubs, yielding multiple states. + std::vector new_states; + std::vector prev_states; + prev_states.push_back( state0 ); + + // arrange stubs into Kalman layers according to eta region + int etaReg = l1track3D.iEtaReg(); + std::map > layerStubs; + + // Get dead layers, if any. + // They are assumed to be idetnical to those defined in StubKiller.cc + bool remove2PSCut = getSettings()->kalmanRemove2PScut(); + set kalmanDeadLayers = getKalmanDeadLayers( remove2PSCut ); + + for( auto stubCluster : stubClusters ){ + + // Get Kalman encoded layer ID for this stub. + int kalmanLayer = this->getKalmanLayer(etaReg, stubCluster->layerIdReduced(), stubCluster->barrel()); + + if (kalmanLayer != 7) { + const_cast(stubCluster)->setLayerKF(kalmanLayer); // Ugly trick to store KF layer inside stub cluster. + if (layerStubs[kalmanLayer].size() < getSettings()->kalmanMaxStubsPerLayer()) { + layerStubs[kalmanLayer].push_back( stubCluster ); + } else { + // If too many stubs, FW keeps the last stub. + layerStubs[kalmanLayer].back() = stubCluster; + } + } + } + + // iterate using state->nextLayer() to determine next Kalman layer(s) to add stubs from + const unsigned int maxIterations = 6; // Increase if you want to allow 7 stubs per fitted track. + for( unsigned iteration = 0; iteration < maxIterations; iteration++ ){ + + int combinations_per_iteration = 0; + + bool easy = (l1track3D.getNumStubs() < getSettings()->kalmanMaxStubsEasy()); + unsigned int kalmanMaxSkipLayers = easy ? getSettings()->kalmanMaxSkipLayersEasy() : getSettings()->kalmanMaxSkipLayersHard(); + + // update each state from previous iteration (or seed) using stubs in next Kalman layer + std::vector::const_iterator i_state = prev_states.begin(); + for(; i_state != prev_states.end(); i_state++ ){ + + const KalmanState *the_state = *i_state; + + + unsigned int layer = the_state->nextLayer(); + unsigned skipped = the_state->nSkippedLayers(); + + // If this layer is known to be dead, skip to the next layer (layer+1) + // The next_states_skipped will then look at layer+2 + // However, if there are stubs in this layer, then don't skip (e.g. our phi/eta boundaries might not line up exactly with a dead region) + // Continue to skip until you reach a functioning layer (or a layer with stubs) + unsigned nSkippedDeadLayers = 0; + while ( kalmanDeadLayers.find(layer) != kalmanDeadLayers.end() && layerStubs[layer].size() == 0 ) { + layer += 1; + ++nSkippedDeadLayers; + } + + // containers for updated state+stub combinations + std::vector next_states; + std::vector next_states_skipped; + + // find stubs for this layer + std::vector stubs = layerStubs[layer]; // If layer > 6, this will return empty vector, so safe. + + // find stubs for next layer if we skip a layer, except when we are on the penultimate layer, + // or we have exceeded the max skipped layers + std::vector next_stubs ; + + // If the next layer (layer+1) is a dead layer, then proceed to the layer after next (layer+2), if possible + // Also note if we need to increase "skipped" by one more for these states + unsigned nSkippedDeadLayers_nextStubs = 0; + if ( skipped < kalmanMaxSkipLayers ) { + if ( kalmanDeadLayers.find(layer+1) != kalmanDeadLayers.end() && layerStubs[layer+1].size() == 0 ) { + next_stubs = layerStubs[layer+2]; + nSkippedDeadLayers_nextStubs += 1; + } else { + next_stubs = layerStubs[layer+1]; + } + } + + // If track was not rejected by isGoodState() is previous iteration, failure here usually means the tracker ran out of layers to explore. + // (Due to "kalmanLayer" not having unique ID for each layer within a given eta sector). + if ( getSettings()->kalmanDebugLevel() >= 2 && best_state_by_nstubs.size() == 0 && stubs.size() == 0 && next_stubs.size() == 0) cout<<"State is lost by start of iteration "< temp_stubs; + std::vector temp_nextstubs; + for (auto stub : stubs) { + if (stub->r()<60.0) temp_stubs.push_back(stub); + } + for (auto stub : next_stubs) { + if (stub->r()<60.0) temp_nextstubs.push_back(stub); + } + stubs = temp_stubs; + next_stubs = temp_nextstubs; + } + + + combinations_per_iteration += stubs.size() + next_stubs.size(); + + + // loop over each stub in this layer and check for compatibility with this state + for( unsigned i=0; i < stubs.size() ; i++ ){ + + const StubCluster * next_stubCluster = stubs[i]; + + // Update helix params by adding this stub. + const KalmanState * new_state = kalmanUpdate( skipped, layer+1, next_stubCluster, *the_state, tpa ); + + if( getSettings()->kalmanFillInternalHists() ) fillStepHists( tpa, iteration, new_state ); + + // Cut on track chi2, pt etc. + if(isGoodState( *new_state ) ) next_states.push_back( new_state ); + } + + // loop over each stub in next layer if we skip, and check for compatibility with this state + for( unsigned i=0; i < next_stubs.size() ; i++ ){ + + const StubCluster * next_stubCluster = next_stubs[i]; + + const KalmanState * new_state = kalmanUpdate( skipped+1+nSkippedDeadLayers_nextStubs, layer+2+nSkippedDeadLayers_nextStubs, next_stubCluster, *the_state, tpa ); + + if( getSettings()->kalmanFillInternalHists() ) fillStepHists( tpa, iteration, new_state ); + + if(isGoodState( *new_state ) ) next_states_skipped.push_back( new_state ); + } + + // post Kalman filter local sorting per state + sort( next_states.begin(), next_states.end(), KalmanState::orderChi2); + sort( next_states_skipped.begin(), next_states_skipped.end(), KalmanState::orderChi2); + + + int i, max_states, max_states_skip; + + // If layer contained several stubs, so several states now exist, select only the best ones. + // -- Disable this by setting to large values, as not used in latest KF firmware. + // (But not too big as this wastes CPU). + + switch ( iteration ) { + case 0: + max_states = 15; + max_states_skip = 15; + break; + case 1: + max_states = 15; + max_states_skip = 15; + break; + case 2: + max_states = 15; + max_states_skip = 15; + break; + case 3: + max_states = 15; + max_states_skip = 15; + break; + case 4: + max_states = 15; + max_states_skip = 15; + break; + case 5: + max_states = 15; + max_states_skip = 15; + break; + default: + max_states = 15; + max_states_skip = 15; + break; + } + + + i = 0; + for( auto state : next_states ){ + + if( i < max_states ){ + new_states.push_back( state ); + } else { + break; + } + i++; + + } + + i = 0; + for( auto state : next_states_skipped ){ + + if( i < max_states_skip ){ + new_states.push_back( state ); + } else { + break; + } + i++; + + } + + } //end of state loop + + + if( getSettings()->kalmanFillInternalHists() ) { + TString hname = Form( "hstubComb_itr%d", iteration ); + if( hstubCombMap.find(hname) == hstubCombMap.end() ){ + cout << hname << " does not exist." << endl; + } + else{ + hstubCombMap[hname]->Fill( combinations_per_iteration ); + } + } + + + // copy new_states into prev_states for next iteration or end if we are on + // last iteration by clearing all states and making final state selection + + sort( new_states.begin(), new_states.end(), KalmanState::orderMinSkipChi2); // Sort by chi2*(skippedLayers+1) + + unsigned int nStubs = iteration + 1; + // Success. We have at least one state that passes all cuts. Save best state found with this number of stubs. + if (nStubs >= getSettings()->kalmanMinNumStubs() && new_states.size() > 0) best_state_by_nstubs[nStubs] = new_states[0]; + + //if ( getSettings()->kalmanDebugLevel() >= 1 && best_state_by_nstubs.size() == 0 && new_states.size() == 0) cout<<"Track is lost by end iteration "<chi2rphi(), best_state->chi2rz(), nPar_, true); + if (returnTrk.getNumMatchedLayers()>=4) { + //temp_states.push_back(best_state); + if(i==0) found = true; + if (!found) cout<<"Lost this cand "<chi2()<<" "<reducedChi2()<<" "<path()<<" chose instead "<chi2()<<" "<reducedChi2()<<" "<path()<second; // First element has largest number of stubs. + finished_states.push_back(stateFinal); + if ( getSettings()->kalmanDebugLevel() >= 1 ) { + cout<<"Track found! final state selection: nLay="<nStubLayers()<<" hitPattern="<hitPattern()< y = getTrackParams( stateFinal ); + cout<<" q/pt="<chi2()<<"/"<nStubLayers(); + cout<kalmanDebugLevel() >= 1 ) { + cout<<"Track lost"<kalmanDebugLevel() >= 4 ){ + cout << "---------------" << endl; + cout << "kalmanUpdate" << endl; + cout << "---------------" << endl; + printStubCluster( cout, stubCluster ); + } + + numUpdateCalls_++; // For monitoring, count calls to updator per track. + + // Helix params & their covariance. + std::vector xa = state.xa(); + TMatrixD cov_xa = state.pxxa(); + if( state.barrel() && !stubCluster->barrel() ){ + if( getSettings()->kalmanDebugLevel() >= 4 ) { + cout << "STATE BARREL TO ENDCAP BEFORE " << endl; + cout << "state : " << xa.at(0) << " " << xa.at(1) << " " << xa.at(2) << " " << xa.at(3) << endl; + cout << "cov(x): " << endl; + cov_xa.Print(); + } + barrelToEndcap( state.r(), stubCluster, xa, cov_xa ); + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "STATE BARREL TO ENDCAP AFTER " << endl; + cout << "state : " << xa.at(0) << " " << xa.at(1) << " " << xa.at(2) << " " << xa.at(3) << endl; + cout << "cov(x): " << endl; + cov_xa.Print(); + } + } + // Matrix to propagate helix params from one layer to next (=identity matrix). + TMatrixD f = F(stubCluster, &state ); + TMatrixD ft(TMatrixD::kTransposed, f ); + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "f" << endl; + f.Print(); + cout << "ft" << endl; + ft.Print(); + } + + std::vector fx = Fx( f, xa ); // Multiply matrices to get helix params at next layer. + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "fx = ["; + for( unsigned i = 0; i < nPar_; i++ ) cout << fx.at(i) << ", "; + cout << "]" << endl; + } + + std::vector delta = residual(stubCluster, fx, state.candidate().qOverPt() ); + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "delta = " << delta[0] << ", " << delta[1] << endl; + } + + // Derivative of predicted (phi,z) intercept with layer w.r.t. helix params. + TMatrixD h = H(stubCluster); + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "h" << endl; + h.Print(); + } + + + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "previous state covariance" << endl; + cov_xa.Print(); + } + // Get contribution to helix parameter covariance from scattering (NOT USED). + TMatrixD pxxm = PxxModel( &state, stubCluster ); + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "model xcov" << endl; + pxxm.Print(); + } + // Get covariance on helix parameters. + TMatrixD pxcov = f * cov_xa * ft + pxxm; + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "forcast xcov + model xcov" << endl; + pxcov.Print(); + } + // Get hit position covariance matrix. + TMatrixD dcov = PddMeas( stubCluster, &state ); + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "dcov" << endl; + dcov.Print(); + } + // Calculate Kalman Gain matrix. + TMatrixD k = GetKalmanMatrix( h, pxcov, dcov ); + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "k" << endl; + k.Print(); + } + + std::vector new_xa(nPar_); + TMatrixD new_pxxa; + GetAdjustedState( k, pxcov, fx, stubCluster, delta, new_xa, new_pxxa ); + if( getSettings()->kalmanDebugLevel() >= 4 ){ + if( nPar_ == 4 ) + cout << "adjusted x = " << new_xa[0] << ", " << new_xa[1] << ", " << new_xa[2] << ", " << new_xa[3] << endl; + else if( nPar_ == 5 ) + cout << "adjusted x = " << new_xa[0] << ", " << new_xa[1] << ", " << new_xa[2] << ", " << new_xa[3] << ", " << new_xa[4] << endl; + cout << "adjusted covx " << endl; + new_pxxa.Print(); + } + + const KalmanState *new_state = mkState( state.candidate(), skipped, layer, stubCluster->layerId(), &state, new_xa, new_pxxa, k, dcov, stubCluster, 0, 0 ); + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "new state" << endl; + new_state->dump( cout, tpa ); + } + + + return new_state; +} + + +void L1KalmanComb::calcChi2( const KalmanState &state, double& chi2rphi, double& chi2rz )const{ + + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "calcChi2 " << endl; + } + double deltaChi2rphi(0), deltaChi2rz; + + if( state.last_state() ) { + + const StubCluster *stubCluster = state.stubCluster(); + +#ifdef RECALC_DEBUG + unsigned int ID = (stubCluster != nullptr) ? stubCluster->stubs()[0]->index() : 99999; +#endif + + if( stubCluster ){ + + std::vector delta = residual( stubCluster, state.last_state()->xa(), state.last_state()->candidate().qOverPt() ); + TMatrixD dcov = PddMeas( stubCluster, &state ); +#ifdef RECALC_DEBUG + cout<<" FITTER SIGMA: rphi="<<1000*sqrt(dcov(0,0))<<" rz="<pxxa().Print(); + } + TMatrixD h = H(stubCluster); + TMatrixD hxxh = HxxH( h, state.last_state()->pxxa() ); + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "h" << endl; + h.Print(); + cout << "hxcovh" << endl; + hxxh.Print(); + } + TMatrixD covR = dcov + hxxh; + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "covR" << endl; + covR.Print(); + cout << "---" << endl; + cout << scientific << "delta = " << delta[0] << ", " << delta[1] << endl; + } + this->getDeltaChi2( covR, delta, false, deltaChi2rphi, deltaChi2rz ); + + } + chi2rphi = state.last_state()->chi2rphi() + deltaChi2rphi; + chi2rz = state.last_state()->chi2rz() + deltaChi2rz; +#ifdef RECALC_DEBUG + cout<<" FITTER CHI2 UPDATE = "<<(chi2rphi+chi2rz)<<" delta chi2="<<(deltaChi2rphi+deltaChi2rz)<<" ID="< &delta, bool debug, + double& deltaChi2rphi, double& deltaChi2rz) const +{ + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "dcov" << endl; + dcov.Print(); + } + + if( dcov.Determinant() == 0 ) { + deltaChi2rphi = 999; + deltaChi2rz = 999; + return; + }; + + + TMatrixD dcovi( dcov ); + dcovi.Invert(); + + // Change in chi2 (with r-phi/r-z correlation term included in r-phi component) + deltaChi2rphi = delta.at(0) * delta.at(0) * dcovi(0,0) + 2 * delta.at(0) * delta.at(1) * dcovi(0,1); + deltaChi2rz = delta.at(1) * delta.at(1) * dcovi(1,1); + +#ifdef RECALC_DEBUG + cout<<" FITTER DELTA CHI2: rphi="< L1KalmanComb::getTrackParams( const L1KalmanComb *p, const KalmanState *state ) +{ + return p->getTrackParams( state ); +} + + +std::vector L1KalmanComb::Hx( const TMatrixD &pH, const std::vector &x )const +{ + std::vector m( (unsigned) pH.GetNrows(), 0 ); + if( pH.GetNcols() != (int) x.size() ) { cerr << "Hx() : H and x have different dimensions" << endl; } + else{ + + for( int i=0; i < pH.GetNcols(); i++ ){ + for( int j=0; j < pH.GetNrows(); j++ ){ + m.at(j) += pH(j,i) * x.at(i); + } + } + } + return m; +} + + +std::vector L1KalmanComb::Fx( const TMatrixD &pF, const std::vector &x )const +{ + return Hx( pF, x ); +} + + +TMatrixD L1KalmanComb::HxxH( const TMatrixD &pH, const TMatrixD &xx )const +{ + int nd = (unsigned) pH.GetNrows(); + TMatrixD tmp(nd,nPar_); + TMatrixD mHxxH(nd,nd); + if( pH.GetNcols() != xx.GetNcols() || pH.GetNcols() != xx.GetNrows() ) { cerr << "HxxH() : H and xx have different dimensions" << endl; } + else{ + + for( int i=0; i < pH.GetNrows(); i++ ){ + for( int j=0; j < xx.GetNrows(); j++ ){ + for( int k=0; k < xx.GetNcols(); k++ ){ + tmp(i,k) += pH(i,j) * xx(j,k); + } + } + } + for( int i=0; i < tmp.GetNrows(); i++ ){ + for( int j=0; j < pH.GetNcols(); j++ ){ + for( int k=0; k < pH.GetNrows(); k++ ){ + mHxxH(i,k) += tmp(i,j) * pH(k,j); + } + } + } + } + return mHxxH; + +} + + +TMatrixD L1KalmanComb::GetKalmanMatrix( const TMatrixD &h, const TMatrixD &pxcov, const TMatrixD &dcov )const +{ + + TMatrixD pxcovht(pxcov.GetNrows(),2); + for( int i=0; ikalmanDebugLevel() >= 4 ){ + cout << "pxcovht" << endl; + pxcovht.Print(); + } + + TMatrixD tmp(dcov.GetNrows(), dcov.GetNcols() ); + TMatrixD hxxh = HxxH( h, pxcov ); + tmp = dcov + hxxh; + + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "hxxh" << endl; + hxxh.Print(); + cout << "dcov + hxxh " << endl; + tmp.Print(); + } + + TMatrixD K( pxcovht.GetNrows(), tmp.GetNcols() ); + + if(tmp.Determinant() == 0 ) return K; + tmp.Invert(); + + for( int i=0; i &x, const StubCluster *stubCluster, + const std::vector& delta, + std::vector &new_x, TMatrixD &new_xcov )const +{ + TMatrixD h = H(stubCluster); + + for( int i=0; i < K.GetNrows(); i++ ){ + new_x.at(i) = x.at(i); + for( int j=0; j < K.GetNcols(); j++ ){ + new_x.at(i) += K(i,j) * delta.at(j); + } + } + + TMatrixD tmp(K.GetNrows(), h.GetNcols() ); + for( int i=0; i< K.GetNrows(); i++ ){ + tmp(i,i) = 1; + } + for( int i=0; i< K.GetNrows(); i++ ){ + for( int j=0; j< K.GetNcols(); j++ ){ + for( int k=0; k< h.GetNcols(); k++ ){ + tmp(i,k) += -1 * K(i,j) * h(j,k); + } + } + } + new_xcov.Clear(); + new_xcov.ResizeTo(pxcov.GetNrows(), pxcov.GetNcols()); + for( int i=0; i< tmp.GetNrows(); i++ ){ + for( int j=0; j< tmp.GetNcols(); j++ ){ + for( int k=0; k< pxcov.GetNcols(); k++ ){ + new_xcov(i,k) += tmp(i,j) * pxcov(j,k); + } + } + } +} + + +void L1KalmanComb::resetStates() +{ + for( unsigned int i=0; i < state_list_.size(); i++ ){ + + delete state_list_.at(i); + } + state_list_.clear(); +} + + +const KalmanState *L1KalmanComb::mkState( const L1track3D &candidate, unsigned skipped, unsigned layer, unsigned layerId, const KalmanState *last_state, + const std::vector &x, const TMatrixD &pxx, const TMatrixD &K, const TMatrixD &dcov, const StubCluster* stubCluster, double chi2rphi, double chi2rz ) +{ + + KalmanState *new_state = new KalmanState( candidate, skipped, layer, layerId, last_state, x, pxx, K, dcov, stubCluster, chi2rphi, chi2rz, this, &getTrackParams ); + + if( chi2rphi + chi2rz == 0 ){ + double new_state_chi2rphi = 0., new_state_chi2rz = 0.; + this->calcChi2( *new_state, new_state_chi2rphi, new_state_chi2rz ); + new_state->setChi2( new_state_chi2rphi, new_state_chi2rz ); + } + + state_list_.push_back( new_state ); + return new_state; +} + + +std::vector L1KalmanComb::residual(const StubCluster* stubCluster, const std::vector &x, double candQoverPt )const{ + + std::vector vd = d(stubCluster); // Get (phi relative to sector, z) of hit. + std::vector hx = Hx( H(stubCluster), x ); // Ditto for intercept of helix with layer, in linear approximation. + std::vector delta(2); + for( unsigned i=0; i<2; i++ ) delta.at(i) = vd.at(i) - hx.at(i); + + // Calculate higher order corrections to residuals. + + if (not getSettings()->kalmanHOdodgy()) { + + std::vector correction = {0.,0.}; + + float inv2R = (getSettings()->invPtToInvR()) * 0.5 * candQoverPt; // alternatively use x().at(0) + float tanL = x.at(2); + float z0 = x.at(3); + + float deltaS = 0.; + if (getSettings()->kalmanHOhelixExp()) { + // Higher order correction correction to circle expansion for improved accuracy at low Pt. + double corr = stubCluster->r() * inv2R; + + // N.B. In endcap 2S, this correction to correction[0] is exactly cancelled by the deltaS-dependent correction to it below. + correction[0] += (1./6.)*pow(corr, 3); + + deltaS = (1./6.)*(stubCluster->r())*pow(corr, 2); + correction[1] -= deltaS * tanL; + } + + if ( (not stubCluster->barrel()) && not (stubCluster->psModule())) { + // These corrections rely on inside --> outside tracking, so r-z track params in 2S modules known. + float rShift = (stubCluster->z() - z0)/tanL - stubCluster->r(); + + // The above calc of rShift is approximate, so optionally check it with MC truth. + // if (tpa_ != nullptr) rShift = (stubCluster->z() - tpa_->z0())/tpa_->tanLambda() - stubCluster->r(); + + if (getSettings()->kalmanHOhelixExp()) rShift -= deltaS; + + if (getSettings()->kalmanHOprojZcorr() == 1) { + // Add correlation term related to conversion of stub residuals from (r,phi) to (z,phi). + correction[0] += inv2R * rShift; + } + + if (getSettings()->kalmanHOalpha() == 1) { + // Add alpha correction for non-radial 2S endcap strips.. + correction[0] += stubCluster->alpha() * rShift; + } + + //cout<<"ENDCAP 2S STUB: (r,z)=("<r()<<","<z()<<") r*delta="<r() * correction[0]<<" r*alphaCorr="<r() * stubCluster->alpha() * rShift<<" rShift="<kalmanFillInternalHists() ) { + + edm::Service fs_; + string dirName; + if( fitterName_.compare("") == 0 ) dirName = "L1KalmanCombInternal"; + else dirName = fitterName_ + "Internal"; + + TFileDirectory inputDir = fs_->mkdir(dirName.c_str()); + + + TString hname; + hTrackEta_ = inputDir.make( "hTrackEta", "Track #eta; #eta", 50, -2.5, 2.5 ); + hUniqueTrackEta_ = inputDir.make( "hUniqueTrackEta", "Unique Track #eta; #eta", 50, -2.5, 2.5 ); + hndupStub_ = inputDir.make( "hndupStub", "# of duplicated stubs", 1, 0, 1 ); + hnmergeStub_ = inputDir.make( "hnmergeStub", "# of merged stubs", 1, 0, 1 ); + + + for( unsigned j_layer=0; j_layer < 6; j_layer++ ){ + hname = Form( "hBarrelStubMaxDistanceLayer%02d", LayerId[j_layer] ); + hBarrelStubMaxDistanceMap[hname] = inputDir.make( hname, Form( "max distance of stubs in barrel Layer %02d; dr#phi; dz", LayerId[j_layer] ), + 100, 0, 1., 100, 0, 10 ); + } + + for( unsigned j_ecring=1; j_ecring < 16; j_ecring++ ){ + hname = Form( "hEndcapStubMaxDistanceRing%02d", j_ecring ); + hEndcapStubMaxDistanceMap[hname] = inputDir.make( hname, Form( "max distance of stubs in endcap Ring %02d; dr#phi; dr", j_ecring ), + 100, 0, 1., 100, 0, 10 ); + hname = Form( "hphiErrorRatioRing%d", j_ecring ); + hphiErrorRatioMap[hname] = inputDir.make( hname, Form( "; fabs( strip id - 0.5 x nStrips + 0.5 ); #delta #phi_{r} / #delta #phi_{l}" ), 508, 0.0, 508.0 , 50, -0.5, 49.5 ); + } + + + + float nbins(2002); + for( unsigned i=0; i < nPar_; i++ ){ + hname = Form( "hyt_%d", i ); + hytMap[hname] = inputDir.make( hname, Form( "; true track parameter values %d", i ), nbins, hymin[i], hymax[i] ); + hname = Form( "hy0_%d", i ); + hy0Map[hname] = inputDir.make( hname, Form( "; after HT track parameter values %d", i ), nbins, hymin[i], hymax[i] ); + hname = Form( "hyf_%d", i ); + hyfMap[hname] = inputDir.make( hname, Form( "; after KF track parameter values %d", i ), nbins, hymin[i], hymax[i] ); + hname = Form( "hx_%d", i ); + hxMap[hname] = inputDir.make( hname, Form( "; x values %d", i ), nbins, hxmin[i], hxmax[i] ); + } + + + for( unsigned itr=0; itr<=5; itr++ ){ + + hname = Form( "hstubComb_itr%d", itr ); + hstubCombMap[hname] = inputDir.make( hname, Form( "; #state+stub combinations, iteration %d ", itr ), 100, 0., 100.); + + for( unsigned i=0; i < nPar_; i++ ){ + for( unsigned j=0; j <= i; j++ ){ + + hname = Form( "hxcov_itr%d_%d_%d", itr, i, j ); + hxcovMap[hname] = inputDir.make( hname, Form( "; state covariance adjusted values, iteration %d (%d,%d)", itr, i, j ), + nbins, -1 * hdxmin[i]*hdxmin[j], hdxmax[i]*hdxmax[j] ); + } + } + for( unsigned i=0; i < nPar_; i++ ){ + for( unsigned j=0; j < nMeas_; j++ ){ + hname = Form( "hk_itr%d_%d_%d", itr, i, j ); + hkMap[hname] = inputDir.make( hname, Form( "; K(%d,%d), Iteration %d", i, j, itr ), 200, -1., 1. ); + } + } + for( unsigned i=0; i < nMeas_; i++ ){ + hname = Form( "hres_itr%d_%d", itr, i ); + hresMap[hname] = inputDir.make( hname, Form( "; residual values, iteration %d (%d)", itr, i ), + nbins, hresmin[i], hresmax[i] ); + for( unsigned j=0; j <= i; j++ ){ + hname = Form( "hmcov_itr%d_%d_%d", itr, i, j ); + hmcovMap[hname] = inputDir.make( hname, Form( "; measurement covariance values, iteration %d (%d,%d)", itr, i, j ), + nbins, -1 * hddMeasmin[i]*hddMeasmin[i], hddMeasmax[i]*hddMeasmax[j] ); + } + } + } + } +} + + +void L1KalmanComb::fillCandHists( const KalmanState &state, const TP *tpa ) +{ + if( tpa && tpa->useForAlgEff() ){ + + const KalmanState *the_state = &state; + while( the_state ){ + if( the_state->stubCluster() ){ + std::vector x = the_state->xa(); + for( unsigned i=0; i < nPar_; i++ ){ + TString hname = Form( "hx_%d", i ); + if( hxMap.find(hname) == hxMap.end() ){ + cout << hname << " does not exist." << endl; + } + else hxMap[hname]->Fill(x.at(i)); + } + } + the_state = the_state->last_state(); + } + + + std::map mx = getTrackParams( &state ); + std::vector vx(nPar_); + vx[0] = mx["qOverPt"]; + vx[1] = mx["phi0"]; + vx[2] = mx["z0"]; + vx[3] = mx["t"]; + if( nPar_ == 5 ) vx[4] = mx["d0"]; + for( unsigned i=0; i < nPar_; i++ ){ + TString hname = Form( "hyf_%d", i ); + if( hyfMap.find(hname) == hyfMap.end() ){ + cout << hname << " does not exist." << endl; + } + else hyfMap[hname]->Fill(vx[i]); + } + } +} + + +void L1KalmanComb::fillSeedHists( const KalmanState *state, const TP *tpa ){ + + std::vector x0 = state->xa(); + TMatrixD pxx0 = state->pxxa(); + //Histogram Fill : seed pxxa + for( unsigned i=0; i < nPar_; i++ ){ + for( unsigned j=0; j <= i; j++ ){ + TString hname = Form( "hxcov_itr%d_%d_%d", 0, i, j ); + if( hxcovMap.find( hname ) == hxcovMap.end() ){ + cout << hname << " does not exist." << endl; + } + else hxcovMap[hname]->Fill( pxx0(i,j) ); + } + } + + if( tpa && tpa->useForAlgEff() ){ + std::vector tpParams(nPar_); + tpParams[0] = tpa->qOverPt(); + tpParams[1] = tpa->phi0(); + tpParams[2] = tpa->z0(); + tpParams[3] = tpa->tanLambda(); + if( nPar_ == 5 ) tpParams[4] = tpa->d0(); + for( unsigned i=0; i < nPar_; i++ ){ + TString hname = Form( "hyt_%d", i ); + if( hytMap.find(hname) == hytMap.end() ){ + cout << hname << " does not exist." << endl; + } + else hytMap[hname]->Fill(tpParams[i]); + } + //Histogram Fill : Seed state + std::map trackParams = getTrackParams( state ); + std::vector trackParVec(nPar_); + trackParVec[0] = trackParams["qOverPt"]; + trackParVec[1] = trackParams["phi0"]; + trackParVec[2] = trackParams["z0"]; + trackParVec[3] = trackParams["t"]; + if( nPar_ == 5 ) trackParVec[4] = trackParams["d0"]; + for( unsigned i=0; i < nPar_; i++ ){ + TString hname = Form( "hy0_%d", i ); + if( hy0Map.find(hname) == hy0Map.end() ){ + cout << hname << " does not exist." << endl; + } + else hy0Map[hname]->Fill(trackParVec[i]); + } + } +} + + +void L1KalmanComb::fillStepHists( const TP *tpa, unsigned nItr, const KalmanState *new_state ) +{ + unsigned path = 0; + + const std::vector &xa = new_state->xa(); + const StubCluster *stubCluster = new_state->stubCluster(); + const TMatrixD &pxxa = new_state->pxxa(); + + TString hname; + + for( unsigned i=0; i < nPar_; i++ ){ + + for( unsigned j=0; j <= i; j++ ){ + hname = Form( "hxcov_itr%d_%d_%d", nItr, i, j ); + if( hxcovMap.find( hname ) == hxcovMap.end() ){ + cout << hname << " does not exist." << endl; + } + else hxcovMap[hname]->Fill( pxxa(i,j) ); + } + } + for( unsigned i=0; i < nPar_; i++ ){ + for( int j=0; j < 2; j++ ){ + TString hname = Form( "hk_itr%d_%d_%d", nItr, i, j ); + if( hkMap.find( hname ) == hkMap.end() ){ + cout << hname << " does not exist." << endl; + } + else hkMap[hname]->Fill( new_state->K()(i,j) ); + } + } + std::vector delta_new = residual(stubCluster, xa, new_state->candidate().qOverPt() ); + for( unsigned int i=0; i < delta_new.size(); i++ ){ + TString hname = Form( "hres_itr%d_%d", nItr, i ); + if( hresMap.find(hname) == hresMap.end() ){ + cout << hname << " does not exist." << endl; + } + else hresMap[hname]->Fill( delta_new[i] ); + } + for( int i=0; i < 2; i++ ){ + for( int j=0; j < i; j++ ){ + TString hname = Form( "hmcov_itr%d_%d_%d", nItr, i, j ); + if( hmcovMap.find( hname ) == hmcovMap.end() ){ + cout << hname << " does not exist." << endl; + } + else hmcovMap[hname]->Fill( new_state->dcov()(i,j) ); + } + } +} + + +void L1KalmanComb::deleteStubClusters() +{ + for( unsigned int i=0; i < stbcl_list_.size(); i++ ){ + delete stbcl_list_.at(i); + } + stbcl_list_.clear(); +} + + +double L1KalmanComb::DeltaRphiForClustering( unsigned layerId, unsigned endcapRing ) +{ + static double barrel_drphi[6] = { 0.05, 0.04, 0.05, 0.12, 0.13, 0.19 }; + if( layerId < 10 ) return barrel_drphi[layerId - 1]; + + static double ec_drphi[16] = + { 0.04, 0.05, 0.04, 0.06, 0.06, 0.04, 0.06, 0.07, 0.15, 0.08, 0.27, 0.08, 0.27, 0.12, 0.09 }; + return ec_drphi[endcapRing - 1]; +}; + + +double L1KalmanComb::DeltaRForClustering( unsigned endcapRing ) +{ + static double ec_dr[16] = + { 0.52, 0.56, 0.59, 0.86, 0.66, 0.47, 0.55, 0.72, 1.53, 1.10, 2.72, 0.91, 2.69, 0.67, 0.09 }; + return ec_dr[endcapRing - 1]; + +} + + +bool L1KalmanComb::isOverlap( const Stub* a, const Stub*b, OVERLAP_TYPE type ){ + + std::set a_tps = a->assocTPs(); + std::set b_tps = b->assocTPs(); + double drphi = DeltaRphiForClustering( a->layerId(), a->endcapRing() ); + double dr(0); + switch ( type ){ + + case TYPE_NORMAL: + if( a->layerId() != b->layerId() ) return false; + + if( a->layerId() < 7 ){ + if( fabs( b->z() - a->z() ) > 0.5 * b->stripLength() || fabs( reco::deltaPhi( b->phi(), sectorPhi() ) * b->r() - reco::deltaPhi( a->phi(), sectorPhi() ) * a->r() ) > 0.5 * b->stripPitch() ) return false; + } + else{ + if( fabs( b->r() - a->r() ) > 0.5 * b->stripLength() || fabs( reco::deltaPhi( b->phi(), sectorPhi() ) * b->r() - reco::deltaPhi( a->phi(), sectorPhi() ) * a->r() ) > 0.5 * b->stripPitch() ) return false; + } + return true; + case TYPE_V2: + if( a->layerId() != b->layerId() ) return false; + + if( a->layerId() < 7 ){ + if( fabs( b->z() - a->z() ) > 0.5 * b->stripLength() || fabs( reco::deltaPhi( b->phi(), sectorPhi() ) * b->r() - reco::deltaPhi( a->phi(), sectorPhi() ) * a->r() ) > drphi ) return false; + } + else{ + dr = DeltaRForClustering( a->endcapRing() ); + if( fabs( b->r() - a->r() ) > dr || fabs( reco::deltaPhi( b->phi(), sectorPhi() ) * b->r() - reco::deltaPhi( a->phi(), sectorPhi() ) * a->r() ) > drphi ) return false; + } + return true; + + case TYPE_NOCLUSTERING: + return false; + + case TYPE_TP: + for( auto a_tp : a_tps ) + if( b_tps.find( a_tp ) != b_tps.end() ) return true; + return false; + default: + return false; + } +} + +set L1KalmanComb::getKalmanDeadLayers( bool& remove2PSCut ) const { + + // Kill scenarios described in https://github.com/EmyrClement/StubKiller/blob/master/README.md + + // By which Stress Test scenario (if any) are dead modules being emulated? + const unsigned int killScenario = getSettings()->killScenario(); + // Should TMTT tracking be modified to reduce efficiency loss due to dead modules? + const bool killRecover = getSettings()->killRecover(); + + set> deadLayers; // GP layer ID & boolean indicating if in barrel. + + if (killRecover) { + if ( killScenario == 1 ) { // barrel layer 5 + deadLayers.insert(pair(4,true)); + if ( iCurrentEtaReg_ < 5 || iCurrentEtaReg_ > 8 || iCurrentPhiSec_ < 8 || iCurrentPhiSec_ > 11 ) { + deadLayers.clear(); + } + + } + else if ( killScenario == 2 ) { // barrel layer 1 + deadLayers.insert(pair(1,true)); + if ( iCurrentEtaReg_ > 8 || iCurrentPhiSec_ < 8 || iCurrentPhiSec_ > 11 ) { + deadLayers.clear(); + } + remove2PSCut = true; + } + else if ( killScenario == 3 ) { // barrel layers 1 & 2 + deadLayers.insert(pair(1,true)); + deadLayers.insert(pair(2,true)); + if ( iCurrentEtaReg_ > 8 || iCurrentPhiSec_ < 8 || iCurrentPhiSec_ > 11 ) { + deadLayers.clear(); + } + else if ( iCurrentEtaReg_ < 1 ) { + deadLayers.insert(pair(0,true)); // What is this doing? + } + remove2PSCut = true; + } + else if ( killScenario == 4 ) { // barrel layer 1 & disk 1 + deadLayers.insert(pair(1,true)); + deadLayers.insert(pair(3,false)); + if ( iCurrentEtaReg_ > 8 || iCurrentPhiSec_ < 8 || iCurrentPhiSec_ > 11 ) { + deadLayers.clear(); + } + else if ( iCurrentEtaReg_ > 3 ) { + deadLayers.insert(pair(0,true)); + } + remove2PSCut = true; + } + } + + set kalmanDeadLayers; + for ( const auto& p : deadLayers ) { + unsigned int layer = p.first; + bool barrel = p.second; + unsigned int kalmanLayer = this->getKalmanLayer(iCurrentEtaReg_, layer, barrel); + kalmanDeadLayers.insert( kalmanLayer ); + } + + return kalmanDeadLayers; +} + +//=== Function to calculate approximation for tilted barrel modules (aka B) copied from Stub class. + +float L1KalmanComb::getApproxB(float z, float r) const { + return getSettings()->bApprox_gradient() * fabs(z)/r + getSettings()->bApprox_intercept(); +} + +} diff --git a/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc.beamConstraint b/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc.beamConstraint new file mode 100644 index 0000000000000..bce05f6468b71 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc.beamConstraint @@ -0,0 +1,1452 @@ +///=== This is the base class for the Kalman Combinatorial Filter track fit algorithm. + +///=== Written by: S. Summers, K. Uchida, M. Pesaresi + +#include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" +#include "L1Trigger/TrackFindingTMTT/interface/Utility.h" + +#include +#include "L1Trigger/TrackFindingTMTT/interface/TP.h" +#include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" +#include "L1Trigger/TrackFindingTMTT/interface/StubCluster.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "CommonTools/UtilAlgos/interface/TFileService.h" + +#include +#include +#include +#include +#include +//#define CKF_DEBUG + +namespace TMTT { + +unsigned LayerId[16] = { 1, 2, 3, 4, 5, 6, 11, 12, 13, 14, 15, 21, 22, 23, 24, 25 }; + + +static double wrapRadian( double t ){ + + if( t > 0 ){ + while( t > M_PI ) t-= 2*M_PI; + } + else{ + while( t < - M_PI ) t+= 2*M_PI; + } + return t; +} + +static bool orderStubsByLayer(const Stub* a, const Stub* b){ + return (a->layerId() < b->layerId()); +} + +static bool orderStubsByZ(const Stub* a, const Stub* b){ + return (a->z() < b->z()); +} + +static bool orderStubsByR(const Stub* a, const Stub* b){ + return (a->r() < b->r()); +} + +void printTPSummary( std::ostream &os, const TP *tp, bool addReturn=true ){ + + if( tp ){ + + os << "TP "; + // os << "addr=" << tp << " "; + os << "index=" << tp->index() << " "; + os << "qOverPt=" << tp->qOverPt() << " "; + os << "phi0=" << tp->phi0() << " "; + os << "z0=" << tp->z0() << " "; + os << "t=" << tp->tanLambda() << " "; + os << "d0=" << tp->d0(); + if( addReturn ) os << endl; + else os << " | "; + } +} + +void L1KalmanComb::printTP( std::ostream &os, const TP *tp )const{ + + std::map tp_x; + bool useForAlgEff(false); + if( tp ){ + useForAlgEff = tp->useForAlgEff(); + tp_x["qOverPt"] = tp->qOverPt(); + tp_x["phi0"] = tp->phi0(); + tp_x["z0"] = tp->z0(); + tp_x["t"] = tp->tanLambda(); + tp_x["d0"] = tp->d0(); + } + if( tp ){ + os << "\tTP index = " << tp->index() << " useForAlgEff = " << useForAlgEff << " "; + os << "\tpT, eta = " << tp->pt() << ", " << tp->eta() << " "; + os << "\tqOver2R0 = " << tp->qOverPt() * getSettings()->invPtToInvR() * 0.5 << " "; + for( auto pair : tp_x ){ + os << pair.first << ":" << pair.second << ", "; + } + } + else{ + os << "\tTP index = "; + } + os << endl; +} + +static void printStubLayers( std::ostream &os, std::vector &stubs ){ + + if( stubs.size() == 0 ) os << "stub layers = []" << endl; + else{ + os << "stub layers = [ "; + for( unsigned i=0; ilayerId() << ", "; + os << stubs.back()->layerId() << " ]" << endl; + } +} + +static void printStubCluster( std::ostream &os, const StubCluster * stubCluster, bool addReturn=true ){ + os << "stub cluster "; + // os << "addr=" << stub << " "; + os << "layerId=" << stubCluster->layerId() << " "; + os << "endcapRing=" << stubCluster->endcapRing() << " "; + os << "# of stubs= " << stubCluster->nStubs() << " "; + os << "r=" << stubCluster->r() << " "; + os << "phi=" << stubCluster->phi() << " "; + os << "z=" << stubCluster->z() << " "; + os << "sigmaX=" << stubCluster->sigmaX() << " "; + os << "sigmaZ=" << stubCluster->sigmaZ() << " "; + os << "dphi_dr=" << stubCluster->dphi_dr() << " "; + os << "TPids="; + std::set tps = stubCluster->assocTPs(); + for( auto tp : tps ) os << tp->index() << ","; + if( addReturn ) os << endl; + else os << " | "; + +} + +static void printStubClusters( std::ostream &os, std::vector &stubClusters ){ + + for( auto &stubcl : stubClusters ){ + printStubCluster( os, stubcl ); + } +} +static void printStub( std::ostream &os, const Stub * stub, bool addReturn=true ){ + os << "stub "; + // os << "addr=" << stub << " "; + os << "index=" << stub->index() << " "; + os << "layerId=" << stub->layerId() << " "; + os << "endcapRing=" << stub->endcapRing() << " "; + os << "r=" << stub->r() << " "; + os << "phi=" << stub->phi() << " "; + os << "z=" << stub->z() << " "; + os << "sigmaX=" << stub->sigmaX() << " "; + os << "sigmaZ=" << stub->sigmaZ() << " "; + os << "TPids="; + std::set tps = stub->assocTPs(); + for( auto tp : tps ) os << tp->index() << ","; + if( addReturn ) os << endl; + else os << " | "; + +} + +static void printStubs( std::ostream &os, std::vector &stubs ){ + + for( auto &stub : stubs ){ + printStub( os, stub ); + } +} + + + + +L1KalmanComb::L1KalmanComb(const Settings* settings, const uint nPar, const string &fitterName, const uint nMeas ) : TrackFitGeneric(settings, fitterName ){ + nPar_ = nPar; + nMeas_ = nMeas; + hymin = vector( nPar_, -1 ); + hymax = vector( nPar_, 1 ); + hymin[0] = -0.05; + hymax[0] = +0.05; + hymin[1] = -3.2; + hymax[1] = +3.2; + hymin[2] = -20; + hymax[2] = +20; + hymin[3] = -6; + hymax[3] = +6; + if (nPar_ == 5) { + hymin[4] = -5; + hymax[4] = +5; + } + + hxmin = vector( nPar_, -1 ); + hxmax = vector( nPar_, 1 ); + + hddMeasmin = vector( 2, -1e-3 ); + hddMeasmax = vector( 2, 1e-3 ); + + hresmin = vector( 2, -1e-2 ); + hresmax = vector( 2, 1e-2 ); + + hxaxtmin = vector( nPar_, -1 ); + hxaxtmax = vector( nPar_, 1 ); + + hdxmin = vector( nPar_, -1 ); + hdxmax = vector( nPar_, 1 ); + + hchi2min = 0; + hchi2max = 50; + + maxNfitForDump_ = 10; + dump_ = false; + + iLastPhiSec_ = 999; + iLastEtaReg_ = 999; +} + + +L1fittedTrack L1KalmanComb::fit(const L1track3D& l1track3D, unsigned int iPhiSec, unsigned int iEtaReg){ + + iLastPhiSec_ = iCurrentPhiSec_; + iLastEtaReg_ = iCurrentEtaReg_; + iCurrentPhiSec_ = iPhiSec; + iCurrentEtaReg_ = iEtaReg; + resetStates(); + deleteStubClusters(); + + // Get cut on number of layers including variation due to dead sectors, pt dependence etc. + minStubLayersRed_ = Utility::numLayerCut("FIT", getSettings(), iPhiSec, iEtaReg, fabs(l1track3D.qOverPt()), l1track3D.eta()); + + //TP + const TP* tpa(0); + if( l1track3D.getMatchedTP() ){ + tpa = l1track3D.getMatchedTP(); + } + + //dump flag + static unsigned nthFit(0); + nthFit++; + if( getSettings()->kalmanDebugLevel() > 2 && nthFit <= maxNfitForDump_ ){ + if( tpa ) dump_ = true; + else dump_ = false; + } + else dump_ = false; + + //stub list from L1track3D, sorted in layer order - necessary for clustering only + std::vector stubs = l1track3D.getStubs(); + + sort(stubs.begin(), stubs.end(), orderStubsByLayer); // Unnecessary? + + // Eliminate identical duplicate stubs. + for(unsigned i=0; i < stubs.size(); i++ ){ + const Stub *stub_a = stubs.at(i); + for(unsigned j=i+1; j < stubs.size(); j++ ){ + const Stub *stub_b = stubs.at(j); + if( stub_a->r() == stub_b->r() && stub_a->phi() == stub_b->phi() && stub_a->z() == stub_b->z() ){ + stubs.erase( stubs.begin() + j ); + if( getSettings()->kalmanFillInternalHists() ) + hndupStub_->Fill(1); + j--; + } + } + } + + std::vector stubcls; + + for( unsigned j_layer=0; j_layer < 16; j_layer++ ){ + + std::vector layer_stubs; + for(unsigned i=0; i < stubs.size(); i++ ){ + const Stub *stub = stubs.at(i); + if( stub->layerId() == LayerId[j_layer] ){ + layer_stubs.push_back( stub ); + } + } + + if( LayerId[j_layer] < 10 ) + sort( layer_stubs.begin(), layer_stubs.end(), orderStubsByZ ); // barrel + else + sort( layer_stubs.begin(), layer_stubs.end(), orderStubsByR ); // endcap + + for(unsigned i=0; i < layer_stubs.size(); i++ ){ // Stubs in single layer, ordered by z or r. + + std::vector stubs_for_cls; + stubs_for_cls.push_back(layer_stubs.at(i)); + + // disable clustering - each stub is its own cluster + /* + while( layer_stubs.at(i) != layer_stubs.back() ){ + if( isOverlap( layer_stubs.at(i), layer_stubs.at(i+1), TYPE_NORMAL ) ){ + stubs_for_cls.push_back( layer_stubs.at(i+1) ); + if( getSettings()->kalmanFillInternalHists() ) + hnmergeStub_->Fill(0); + i++; + } + else break; + } + */ + if( getSettings()->kalmanFillInternalHists() ) { + + if( tpa && tpa->useForAlgEff() ){ + + if( stubs_for_cls.size() > 1 ){ + + std::set s_tps = stubs_for_cls.at(0)->assocTPs(); + if( s_tps.find( tpa ) != s_tps.end() ){ + + const Stub *sa = stubs_for_cls.front(); + const Stub *sb = stubs_for_cls.back(); + + double drphi = fabs( sa->r() * wrapRadian( sa->phi() - sectorPhi() ) - sb->r() * wrapRadian( sb->phi() - sectorPhi() ) ); + double dz = fabs( sa->z() - sb->z() ); + double dr = fabs( sa->r() - sb->r() ); + TString hname; + if( LayerId[j_layer] < 10 ){ + + hname = Form( "hBarrelStubMaxDistanceLayer%02d", LayerId[j_layer] ); + + if( hBarrelStubMaxDistanceMap.find( hname ) == hBarrelStubMaxDistanceMap.end() ){ + cout << hname << " does not exist." << endl; + } + else{ + hBarrelStubMaxDistanceMap[hname]->Fill( drphi, dz ); + } + } + else{ + hname = Form( "hEndcapStubMaxDistanceRing%02d", sa->endcapRing() ); + + if( hEndcapStubMaxDistanceMap.find( hname ) == hEndcapStubMaxDistanceMap.end() ){ + cout << hname << " does not exist." << endl; + } + else{ + hEndcapStubMaxDistanceMap[hname]->Fill( drphi, dr ); + } + } + } + } + } + } + + // dl error now disabled + StubCluster *stbcl = new StubCluster( stubs_for_cls, sectorPhi(), 0 ); + stbcl_list_.push_back( stbcl ); + stubcls.push_back( stbcl ); + + if( getSettings()->kalmanFillInternalHists() ) { + if( !stbcl->barrel() ){ + TString hname = Form( "hphiErrorRatioRing%d", stbcl->endcapRing() ); + if( hphiErrorRatioMap.find(hname) == hphiErrorRatioMap.end() ){ + cout << hname << " does not exist." << endl; + } + else{ + hphiErrorRatioMap[hname]->Fill( fabs( stbcl->deltai() + 0.5 ), fabs( stbcl->dphi_dr() ) / stbcl->dphi_dl() ); + } + } + } + } + } + if( getSettings()->kalmanFillInternalHists() ){ + if( tpa && tpa->useForAlgEff() ){ + hTrackEta_->Fill( tpa->eta() ); + static set set_tp; + if( iCurrentPhiSec_ < iLastPhiSec_ && iCurrentEtaReg_ < iLastEtaReg_ ) set_tp.clear(); + if( set_tp.find( tpa ) == set_tp.end() ){ + hUniqueTrackEta_->Fill( tpa->eta() ); + } + set_tp.insert( tpa ); + } + } + + + //track information dump + if( getSettings()->kalmanDebugLevel() >= 1 ){ + + std::cout << "===============================================================================" << endl; + std::cout << "Track Finding candidate in [phi_sec, eta_reg] = [" << iPhiSec << ", " << iEtaReg << "]" << std::endl; + printTP( cout, tpa ); + printStubLayers( cout, stubs ); + printStubClusters( cout, stubcls ); + + } + + + + // debug for Mark + bool goodTrack = false; + if( tpa && tpa->useForAlgEff() ) { + if (l1track3D.getNumMatchedLayers()>=4) goodTrack=true; + } + + + //Kalman Filter + std::vector cands = doKF( l1track3D, stubcls, tpa ); + + + + //return L1fittedTrk for the selected state. + if( cands.size() ) { + + const KalmanState *cand = cands[0]; + + std::map tp = getTrackParams(cand); + + // IRT - beam spot constraint + float deltaChi2 = 0. ; + if (nPar_ == 5) { + TMatrixD cov_xa = cand->pxxa(); + deltaChi2 = tp["d0"]*tp["d0"] / cov_xa[4][4]; + tp["qOverPt"] -= tp["d0"] * (cov_xa[0][4] / cov_xa[4][4]); + tp["phi0"] -= tp["d0"] * (cov_xa[1][4] / cov_xa[4][4]); + tp["d0"] = 0.0; + } else { + deltaChi2 = 0.0; + } + + L1fittedTrack returnTrk(getSettings(), l1track3D, cand->stubs(), tp["qOverPt"], tp["d0"], tp["phi0"], tp["z0"], tp["t"], cand->chi2() + deltaChi2, nPar_, iPhiSec, iEtaReg, true); + + //L1fittedTrack returnTrk(getSettings(), l1track3D, cand->stubs(), tp["qOverPt"], tp["d0"], tp["phi0"], tp["z0"], tp["t"], cand->chi2(), nPar_, iPhiSec, iEtaReg, true); + + // for Tom - fitted track params must lie in same sector as HT originally found track in. + if (!returnTrk.consistentSector()) { + + L1fittedTrack failedTrk(getSettings(), l1track3D, cand->stubs(), tp["qOverPt"], tp["d0"], tp["phi0"], tp["z0"], tp["t"], cand->chi2(), nPar_, iPhiSec, iEtaReg, false); + return failedTrk; + } + + //candidate dump + if( getSettings()->kalmanDebugLevel() >= 1 ){ + + cout << "------------------------------------" << endl; + if( tpa && tpa->useForAlgEff() ){ + cout << "TP for eff. addr. index : " << tpa << " " << tpa->index() << endl; + } + cout << "Candidate : " << endl; + if( tpa && tpa->useForAlgEff() && returnTrk.getPurity() != 1 ){ + cout << "The candidate is not pure" << endl; + } + cand->dump( cout, tpa, true ); + cout << "------------------------------------" << endl; + } + + //fill histograms for the selected state with TP for algEff + if( getSettings()->kalmanFillInternalHists() ) fillCandHists( *cand, tpa ); + + return returnTrk; + + } else { + + if(goodTrack) { + + /* + int tpin=0; + if(l1track3D.getMatchedTP()) tpin=l1track3D.getMatchedTP()->index(); + + cout<r()<<" "<z()< stubs = stubCluster->stubs(); + for( auto stub : stubs ){ + for (const TP* tp_i : stub->assocTPs()) { + cout<index()<assocTPs().size()==0) cout<<"no associated TP"< tp = getTrackParams(state); + //L1fittedTrack returnTrk(getSettings(), l1track3D, state->stubs(), tp["qOverPt"], tp["d0"], tp["phi0"], tp["z0"], tp["t"], state->chi2(), nPar_, iPhiSec, iEtaReg, true); + + + std::vector sstubs = state->stubs(); + for( auto stub : sstubs ){ + + for (const TP* tp_i : stub->assocTPs()) { + cout<index()<r()<<" "<z()<<" "<nStubLayers()<kalmanDebugLevel() >= 1 ){ + if( tpa && tpa->useForAlgEff() ){ + cout << "TP for eff. missed addr. index : " << tpa << " " << tpa->index() << endl; + printStubClusters( cout, stubcls ); + printStubs( cout, stubs ); + } + } + + + L1fittedTrack returnTrk(getSettings(), l1track3D, l1track3D.getStubs(), l1track3D.qOverPt(), 0, l1track3D.phi0(), l1track3D.z0(), l1track3D.tanLambda(), 9999, nPar_, iPhiSec, iEtaReg, false); + return returnTrk; + } + +} + + +std::vector L1KalmanComb::doKF( const L1track3D& l1track3D, const std::vector &stubClusters, const TP *tpa ){ + + // output container + std::vector finished_states; + + // seed helix params & their covariance. + std::vector x0 = seedx(l1track3D); + TMatrixD pxx0 = seedP(l1track3D); + TMatrixD K( nPar_, 2 ); + TMatrixD dcov( 2, 2 ); + + const KalmanState *state0 = mkState( l1track3D, 0, 0, 0, 0, x0, pxx0, K, dcov, 0, 0 ); + + if( getSettings()->kalmanFillInternalHists() ) fillSeedHists( state0, tpa ); + + + // internal containers - i.e. the state FIFO. Contains estimate of helix params in last/next layer, with multiple entries if there were multiple stubs, yielding multiple states. + std::vector new_states; + std::vector prev_states; + prev_states.push_back( state0 ); + + + // === Layer Mapping (i.e. layer order in which stubs should be processed) === + + // index across is ian encoded layer id (where barrel layers=1,2,6,5,4,3 & endcap wheels=3,4,5,6,7 & 0 never occurs) + // index down is eta reg + // element is kalman layer where 7 is invalid + // assumes we are in barrel, endcap adjustments later + // should really be defined once in constructor + + unsigned layerMap[18][8] = + { + { 7, 0, 7, 1, 2, 3, 4, 5 }, + { 7, 0, 7, 1, 2, 3, 4, 5 }, + { 7, 0, 1, 2, 3, 4, 5, 5 }, + { 7, 0, 1, 2, 3, 4, 5, 2 }, + { 7, 0, 1, 3, 4, 3, 6, 2 }, + { 7, 0, 1, 5, 4, 3, 7, 2 }, + { 7, 0, 1, 5, 4, 3, 7, 2 }, + { 7, 0, 1, 5, 4, 3, 7, 2 }, + { 7, 0, 1, 5, 4, 3, 7, 2 }, + { 7, 0, 1, 5, 4, 3, 7, 2 }, + { 7, 0, 1, 5, 4, 3, 7, 2 }, + { 7, 0, 1, 5, 4, 3, 7, 2 }, + { 7, 0, 1, 5, 4, 3, 7, 2 }, + { 7, 0, 1, 3, 4, 3, 6, 2 }, + { 7, 0, 1, 2, 3, 4, 5, 2 }, + { 7, 0, 1, 2, 3, 4, 5, 5 }, + { 7, 0, 7, 1, 2, 3, 4, 5 }, + { 7, 0, 7, 1, 2, 3, 4, 5 }, + }; + + + + // arrange stubs into Kalman layers according to eta region + int etaReg = l1track3D.iEtaReg(); + std::map > layerStubs; + + + for( auto stubCluster : stubClusters ){ + + int kalmanLayer = layerMap[etaReg][stubCluster->layerIdReduced()]; + + if ( !stubCluster->barrel() ) { + + switch ( etaReg ) { + case 3: + case 14: + if (stubCluster->layerIdReduced()==7) kalmanLayer = 6; + break; + case 4: + case 13: + if (stubCluster->layerIdReduced()==5) kalmanLayer = 5; + break; + case 5: + case 12: + if (stubCluster->layerIdReduced()==4) kalmanLayer = 5; + break; + default: + break; + } + + } + + layerStubs[kalmanLayer].push_back( stubCluster ); + + } + + + + // iterate using state->nextLayer() to determine next Kalman layer(s) to add stubs from + for( unsigned iteration = 0; iteration < 6; iteration++ ){ + + int combinations_per_iteration = 0; + + // should be a defined in constructor/settings + unsigned int maxSkippedLayers = 2; + + + // update each state from previous iteration (or seed) using stubs in next Kalman layer + std::vector::const_iterator i_state = prev_states.begin(); + for(; i_state != prev_states.end(); i_state++ ){ + + + const KalmanState *the_state = *i_state; + + + unsigned layer = the_state->nextLayer(); + unsigned skipped = the_state->nSkippedLayers(); + + + // containers for updated state+stub combinations + std::vector next_states; + std::vector next_states_skipped; + + + // find stubs for this layer + std::vector stubs = layerStubs[layer]; + + + // find stubs for next layer if we skip a layer, except when we are on the penultimate layer, + // or we have exceeded the max skipped layers + std::vector next_stubs ; + if ( (layer<5) && (skipped temp_stubs; + std::vector temp_nextstubs; + for (auto stub : stubs) { + if (stub->r()<60.0) temp_stubs.push_back(stub); + } + for (auto stub : next_stubs) { + if (stub->r()<60.0) temp_nextstubs.push_back(stub); + } + stubs = temp_stubs; + next_stubs = temp_nextstubs; + } + + + combinations_per_iteration += stubs.size() + next_stubs.size(); + + + // loop over each stub in this layer and check for compatibility with this state + for( unsigned i=0; i < stubs.size() ; i++ ){ + + const StubCluster * next_stubCluster = stubs[i]; + + // Update helix params by adding this stub. + const KalmanState * new_state = kalmanUpdate( skipped, layer+1, next_stubCluster, *the_state, tpa ); + + if( getSettings()->kalmanFillInternalHists() ) fillStepHists( tpa, iteration, new_state ); + + // Cut on track chi2, pt etc. + if(isGoodState( *new_state ) ) next_states.push_back( new_state ); + + } + + // loop over each stub in next layer if we skip, and check for compatibility with this state + for( unsigned i=0; i < next_stubs.size() ; i++ ){ + + const StubCluster * next_stubCluster = next_stubs[i]; + + const KalmanState * new_state = kalmanUpdate( skipped+1, layer+2, next_stubCluster, *the_state, tpa ); + + if( getSettings()->kalmanFillInternalHists() ) fillStepHists( tpa, iteration, new_state ); + + if(isGoodState( *new_state ) ) next_states_skipped.push_back( new_state ); + + } + + + // post Kalman filter local sorting per state + sort( next_states.begin(), next_states.end(), KalmanState::orderChi2); + sort( next_states_skipped.begin(), next_states_skipped.end(), KalmanState::orderChi2); + + + int i, max_states, max_states_skip; + + // If layer contained several stubs, so several states now exist, select only the best ones. + + switch ( iteration ) { + case 0: + max_states = 4; + max_states_skip = 4; + break; + case 1: + max_states = 1; + max_states_skip = 1; + break; + case 2: + max_states = 1; + max_states_skip = 1; + break; + case 3: + max_states = 1; + max_states_skip = 1; + break; + case 4: + max_states = 1; + max_states_skip = 1; + break; + default: + max_states = 999; + max_states_skip = 999; + break; + } + + + i = 0; + for( auto state : next_states ){ + + if( i < max_states ){ + new_states.push_back( state ); + } else { + break; + } + i++; + + } + + i = 0; + for( auto state : next_states_skipped ){ + + if( i < max_states_skip ){ + new_states.push_back( state ); + } else { + break; + } + i++; + + } + + } //end of state loop + + + if( getSettings()->kalmanFillInternalHists() ) { + TString hname = Form( "hstubComb_itr%d", iteration ); + if( hstubCombMap.find(hname) == hstubCombMap.end() ){ + cout << hname << " does not exist." << endl; + } + else{ + hstubCombMap[hname]->Fill( combinations_per_iteration ); + } + } + + + // copy new_states into prev_states for next iteration or end if we are on + // iteration 4 by clearing all states and making final state selection + + sort( new_states.begin(), new_states.end(), KalmanState::orderMinSkipChi2); // Sort by chi2*(skippedLayers+1) + + if( iteration+1 == 4 ){ + + if(new_states.size()) finished_states.push_back(new_states[0]); + + prev_states.clear(); + new_states.clear(); + + } else { + + prev_states = new_states; + new_states.clear(); + + } + + + /* + int i = 0; + bool found = false; + for( auto best_state : best_states4 ){ + + if( tpa && tpa->useForAlgEff() ) { + std::map tp = getTrackParams(best_state); + L1fittedTrack returnTrk(getSettings(), l1track3D, best_state->stubs(), tp["qOverPt"], tp["d0"], tp["phi0"], tp["z0"], tp["t"], best_state->chi2(), nPar_, l1track3D.iPhiSec(), l1track3D.iEtaReg(), true); + if (returnTrk.getNumMatchedLayers()>=4) { + //temp_states.push_back(best_state); + if(i==0) found = true; + if (!found) cout<<"Lost this cand "<chi2()<<" "<reducedChi2()<<" "<path()<<" chose instead "<chi2()<<" "<reducedChi2()<<" "<path()<kalmanDebugLevel() >= 3 ){ + cout << "---------------" << endl; + cout << "kalmanUpdate" << endl; + cout << "---------------" << endl; + printStubCluster( cout, stubCluster ); + } + + + // Helix params & their covariance. + std::vector xa = state.xa(); + TMatrixD cov_xa = state.pxxa(); + if( state.barrel() && !stubCluster->barrel() ){ + if( getSettings()->kalmanDebugLevel() >= 3 ) { + cout << "STATE BARREL TO ENDCAP BEFORE " << endl; + cout << "state : " << xa.at(0) << " " << xa.at(1) << " " << xa.at(2) << " " << xa.at(3) << endl; + cout << "cov(x): " << endl; + cov_xa.Print(); + } + barrelToEndcap( state.r(), stubCluster, xa, cov_xa ); + if( getSettings()->kalmanDebugLevel() >= 3 ){ + cout << "STATE BARREL TO ENDCAP AFTER " << endl; + cout << "state : " << xa.at(0) << " " << xa.at(1) << " " << xa.at(2) << " " << xa.at(3) << endl; + cout << "cov(x): " << endl; + cov_xa.Print(); + } + } + // Matrix to propagate helix params from one layer to next (=identity matrix). + TMatrixD f = F(stubCluster, &state ); + TMatrixD ft(TMatrixD::kTransposed, f ); + if( getSettings()->kalmanDebugLevel() >= 3 ){ + cout << "f" << endl; + f.Print(); + cout << "ft" << endl; + ft.Print(); + } + + std::vector fx = Fx( f, xa ); // Multiply matrices to get helix params at next layer. + if( getSettings()->kalmanDebugLevel() >= 3 ){ + cout << "fx = ["; + for( unsigned i = 0; i < nPar_; i++ ) cout << fx.at(i) << ", "; + cout << "]" << endl; + } + + std::vector delta = residual(stubCluster, fx ); + if( getSettings()->kalmanDebugLevel() >= 3 ){ + cout << "delta = " << delta[0] << ", " << delta[1] << endl; + } + + // Derivative of predicted (phi,z) intercept with layer w.r.t. helix params. + TMatrixD h = H(stubCluster); + if( getSettings()->kalmanDebugLevel() >= 3 ){ + cout << "h" << endl; + h.Print(); + } + + + if( getSettings()->kalmanDebugLevel() >= 3 ){ + cout << "previous state covariance" << endl; + cov_xa.Print(); + } + // Get contribution to helix parameter covariance from scattering. + TMatrixD pxxm = PxxModel( &state, stubCluster ); + if( getSettings()->kalmanDebugLevel() >= 3 ){ + cout << "model xcov" << endl; + pxxm.Print(); + } + // Get covariance on helix parameters. + TMatrixD pxcov = f * cov_xa * ft + pxxm; + if( getSettings()->kalmanDebugLevel() >= 3 ){ + cout << "forcast xcov + model xcov" << endl; + pxcov.Print(); + } + // Get hit position covariance matrix. + TMatrixD dcov = PddMeas( stubCluster, &state ); + if( getSettings()->kalmanDebugLevel() >= 3 ){ + cout << "dcov" << endl; + dcov.Print(); + } + // Calculate Kalman Gain matrix. + TMatrixD k = GetKalmanMatrix( h, pxcov, dcov ); + if( getSettings()->kalmanDebugLevel() >= 3 ){ + cout << "k" << endl; + k.Print(); + } + + std::vector new_xa(nPar_); + TMatrixD new_pxxa; + GetAdjustedState( k, pxcov, fx, stubCluster, new_xa, new_pxxa ); + if( getSettings()->kalmanDebugLevel() >= 3 ){ + if( nPar_ == 4 ) + cout << "adjusted x = " << new_xa[0] << ", " << new_xa[1] << ", " << new_xa[2] << ", " << new_xa[3] << endl; + else if( nPar_ == 5 ) + cout << "adjusted x = " << new_xa[0] << ", " << new_xa[1] << ", " << new_xa[2] << ", " << new_xa[3] << ", " << new_xa[4] << endl; + cout << "adjusted covx " << endl; + new_pxxa.Print(); + } + + const KalmanState *new_state = mkState( state.candidate(), skipped, layer, stubCluster->layerId(), &state, new_xa, new_pxxa, k, dcov, stubCluster, 0 ); + if( getSettings()->kalmanDebugLevel() >= 3 ){ + cout << "new state" << endl; + new_state->dump( cout, tpa ); + } + + + return new_state; +} + + +double L1KalmanComb::calcChi2( const KalmanState &state )const{ + + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "calcChi2 " << endl; + } + double chi2(0), chi2_p(0); + + if( state.last_state() ) { + chi2 = state.last_state()->chi2(); + + const StubCluster *stubCluster = state.stubCluster(); + + if( stubCluster ){ + + std::vector delta = residual( stubCluster, state.last_state()->xa() ); + TMatrixD dcov = PddMeas( stubCluster, &state ); + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "dcov" << endl; + dcov.Print(); + cout << "xcov" << endl; + state.last_state()->pxxa().Print(); + } + TMatrixD h = H(stubCluster); + TMatrixD hxxh = HxxH( h, state.last_state()->pxxa() ); + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "h" << endl; + h.Print(); + cout << "hxcovh" << endl; + hxxh.Print(); + } + TMatrixD covR = dcov + hxxh; + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "covR" << endl; + covR.Print(); + cout << "---" << endl; + cout << scientific << "delta = " << delta[0] << ", " << delta[1] << endl; + } + chi2_p = Chi2( covR, delta ); + + } + chi2 += chi2_p; + } + + return chi2; +} + + +double L1KalmanComb::Chi2( const TMatrixD &dcov, const std::vector &delta, bool debug )const +{ + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "dcov" << endl; + dcov.Print(); + } + + if( dcov.Determinant() == 0 ) return 999; + + + TMatrixD dcovi( dcov ); + dcovi.Invert(); + + vector tmp(2,0); + for( int i=0; i < dcovi.GetNrows(); i++ ){ + for( int j=0; j < dcovi.GetNcols(); j++ ){ + tmp.at(j) += delta.at(i) * dcovi(i,j); + } + } + double chi2(0); + for( int j=0; j < 2; j++ ){ + chi2 += tmp.at(j) * delta.at(j); + } + + if( debug ){ + cout << "CHI SQUARE OUTPUT" << endl; + cout << "cov" << endl; + dcov.Print(); + cout << "cov inv" << endl; + dcovi.Print(); + for( unsigned i=0; i < delta.size(); i++ ) cout << delta.at(i) << " "; + cout << endl; + } + return chi2; +} + + +std::map L1KalmanComb::getTrackParams( const L1KalmanComb *p, const KalmanState *state ) +{ + return p->getTrackParams( state ); +} + + +std::vector L1KalmanComb::Hx( const TMatrixD &pH, const std::vector &x )const +{ + std::vector m( (unsigned) pH.GetNrows(), 0 ); + if( pH.GetNcols() != (int) x.size() ) { cerr << "Hx() : H and x have different dimensions" << endl; } + else{ + + for( int i=0; i < pH.GetNcols(); i++ ){ + for( int j=0; j < pH.GetNrows(); j++ ){ + m.at(j) += pH(j,i) * x.at(i); + } + } + } + return m; +} + + +std::vector L1KalmanComb::Fx( const TMatrixD &pF, const std::vector &x )const +{ + return Hx( pF, x ); +} + + +TMatrixD L1KalmanComb::HxxH( const TMatrixD &pH, const TMatrixD &xx )const +{ + int nd = (unsigned) pH.GetNrows(); + TMatrixD tmp(nd,nPar_); + TMatrixD mHxxH(nd,nd); + if( pH.GetNcols() != xx.GetNcols() || pH.GetNcols() != xx.GetNrows() ) { cerr << "HxxH() : H and xx have different dimensions" << endl; } + else{ + + for( int i=0; i < pH.GetNrows(); i++ ){ + for( int j=0; j < xx.GetNrows(); j++ ){ + for( int k=0; k < xx.GetNcols(); k++ ){ + tmp(i,k) += pH(i,j) * xx(j,k); + } + } + } + for( int i=0; i < tmp.GetNrows(); i++ ){ + for( int j=0; j < pH.GetNcols(); j++ ){ + for( int k=0; k < pH.GetNrows(); k++ ){ + mHxxH(i,k) += tmp(i,j) * pH(k,j); + } + } + } + } + return mHxxH; + +} + + +TMatrixD L1KalmanComb::GetKalmanMatrix( const TMatrixD &h, const TMatrixD &pxcov, const TMatrixD &dcov )const +{ + + TMatrixD pxcovht(pxcov.GetNrows(),2); + for( int i=0; ikalmanDebugLevel() >= 4 ){ + cout << "pxcovht" << endl; + pxcovht.Print(); + } + + TMatrixD tmp(dcov.GetNrows(), dcov.GetNcols() ); + TMatrixD hxxh = HxxH( h, pxcov ); + tmp = dcov + hxxh; + + if( getSettings()->kalmanDebugLevel() >= 4 ){ + cout << "hxxh" << endl; + hxxh.Print(); + cout << "dcov + hxxh " << endl; + tmp.Print(); + } + + TMatrixD K( pxcovht.GetNrows(), tmp.GetNcols() ); + + if(tmp.Determinant() == 0 ) return K; + tmp.Invert(); + + for( int i=0; i &x, const StubCluster *stubCluster, + std::vector &new_x, TMatrixD &new_xcov )const +{ + TMatrixD h = H(stubCluster); + std::vector m = d(stubCluster); + + for( unsigned i=0; i < new_x.size(); i++ ){ + new_x.at(i) = 0; + } + + std::vector tmpv(m.size(), 0 ); + for( int i=0; i < h.GetNrows(); i++ ){ + tmpv.at(i) += m.at(i); + for( int j=0; j < h.GetNcols(); j++ ){ + tmpv.at(i) += -1. * h(i,j) * x.at(j); + } + } + for( int i=0; i < K.GetNrows(); i++ ){ + new_x.at(i) += x.at(i); + for( int j=0; j < K.GetNcols(); j++ ){ + new_x.at(i) += K(i,j) * tmpv.at(j); + } + } + + TMatrixD tmp(K.GetNrows(), h.GetNcols() ); + for( int i=0; i< K.GetNrows(); i++ ){ + tmp(i,i) = 1; + } + for( int i=0; i< K.GetNrows(); i++ ){ + for( int j=0; j< K.GetNcols(); j++ ){ + for( int k=0; k< h.GetNcols(); k++ ){ + tmp(i,k) += -1 * K(i,j) * h(j,k); + } + } + } + new_xcov.Clear(); + new_xcov.ResizeTo(pxcov.GetNrows(), pxcov.GetNcols()); + for( int i=0; i< tmp.GetNrows(); i++ ){ + for( int j=0; j< tmp.GetNcols(); j++ ){ + for( int k=0; k< pxcov.GetNcols(); k++ ){ + new_xcov(i,k) += tmp(i,j) * pxcov(j,k); + } + } + } +} + + +void L1KalmanComb::resetStates() +{ + for( unsigned int i=0; i < state_list_.size(); i++ ){ + + delete state_list_.at(i); + } + state_list_.clear(); +} + + +const KalmanState *L1KalmanComb::mkState( const L1track3D &candidate, unsigned skipped, unsigned layer, unsigned layerId, const KalmanState *last_state, + const std::vector &x, const TMatrixD &pxx, const TMatrixD &K, const TMatrixD &dcov, const StubCluster* stubCluster, double chi2 ) +{ + + KalmanState *new_state = new KalmanState( candidate, skipped, layer, layerId, last_state, x, pxx, K, dcov, stubCluster, chi2, this, &getTrackParams ); + + if( chi2 == 0 ){ + double new_state_chi2 = calcChi2( *new_state ); + new_state->setChi2( new_state_chi2 ); + } + + state_list_.push_back( new_state ); + return new_state; +} + + +std::vector L1KalmanComb::residual(const StubCluster* stubCluster, const std::vector &x )const{ + + std::vector vd = d(stubCluster); // Get (phi relative to sector, z) of hit. + std::vector hx = Hx( H(stubCluster), x ); // Ditto for intercept of helix with layer, in linear approximation. + std::vector delta(2); + for( unsigned i=0; i<2; i++ ) delta.at(i) = vd.at(i) - hx.at(i); + delta.at(0) = wrapRadian(delta.at(0)); + return delta; +} + + + + + +void L1KalmanComb::bookHists(){ + + if ( getSettings()->kalmanFillInternalHists() ) { + + edm::Service fs_; + string dirName; + if( fitterName_.compare("") == 0 ) dirName = "L1KalmanCombInternal"; + else dirName = fitterName_ + "Internal"; + + TFileDirectory inputDir = fs_->mkdir(dirName.c_str()); + + + TString hname; + hTrackEta_ = inputDir.make( "hTrackEta", "Track #eta; #eta", 50, -2.5, 2.5 ); + hUniqueTrackEta_ = inputDir.make( "hUniqueTrackEta", "Unique Track #eta; #eta", 50, -2.5, 2.5 ); + hndupStub_ = inputDir.make( "hndupStub", "# of duplicated stubs", 1, 0, 1 ); + hnmergeStub_ = inputDir.make( "hnmergeStub", "# of merged stubs", 1, 0, 1 ); + + + for( unsigned j_layer=0; j_layer < 6; j_layer++ ){ + hname = Form( "hBarrelStubMaxDistanceLayer%02d", LayerId[j_layer] ); + hBarrelStubMaxDistanceMap[hname] = inputDir.make( hname, Form( "max distance of stubs in barrel Layer %02d; dr#phi; dz", LayerId[j_layer] ), + 100, 0, 1., 100, 0, 10 ); + } + + for( unsigned j_ecring=1; j_ecring < 16; j_ecring++ ){ + hname = Form( "hEndcapStubMaxDistanceRing%02d", j_ecring ); + hEndcapStubMaxDistanceMap[hname] = inputDir.make( hname, Form( "max distance of stubs in endcap Ring %02d; dr#phi; dr", j_ecring ), + 100, 0, 1., 100, 0, 10 ); + hname = Form( "hphiErrorRatioRing%d", j_ecring ); + hphiErrorRatioMap[hname] = inputDir.make( hname, Form( "; fabs( strip id - 0.5 x nStrips + 0.5 ); #delta #phi_{r} / #delta #phi_{l}" ), 508, 0.0, 508.0 , 50, -0.5, 49.5 ); + } + + + + float nbins(2002); + for( unsigned i=0; i < nPar_; i++ ){ + hname = Form( "hyt_%d", i ); + hytMap[hname] = inputDir.make( hname, Form( "; true track parameter values %d", i ), nbins, hymin[i], hymax[i] ); + hname = Form( "hy0_%d", i ); + hy0Map[hname] = inputDir.make( hname, Form( "; after HT track parameter values %d", i ), nbins, hymin[i], hymax[i] ); + hname = Form( "hyf_%d", i ); + hyfMap[hname] = inputDir.make( hname, Form( "; after KF track parameter values %d", i ), nbins, hymin[i], hymax[i] ); + hname = Form( "hx_%d", i ); + hxMap[hname] = inputDir.make( hname, Form( "; x values %d", i ), nbins, hxmin[i], hxmax[i] ); + } + + + for( unsigned itr=0; itr<=5; itr++ ){ + + hname = Form( "hstubComb_itr%d", itr ); + hstubCombMap[hname] = inputDir.make( hname, Form( "; #state+stub combinations, iteration %d ", itr ), 100, 0., 100.); + + for( unsigned i=0; i < nPar_; i++ ){ + for( unsigned j=0; j <= i; j++ ){ + + hname = Form( "hxcov_itr%d_%d_%d", itr, i, j ); + hxcovMap[hname] = inputDir.make( hname, Form( "; state covariance adjusted values, iteration %d (%d,%d)", itr, i, j ), + nbins, -1 * hdxmin[i]*hdxmin[j], hdxmax[i]*hdxmax[j] ); + } + } + for( unsigned i=0; i < nPar_; i++ ){ + for( unsigned j=0; j < nMeas_; j++ ){ + hname = Form( "hk_itr%d_%d_%d", itr, i, j ); + hkMap[hname] = inputDir.make( hname, Form( "; K(%d,%d), Iteration %d", i, j, itr ), 200, -1., 1. ); + } + } + for( unsigned i=0; i < nMeas_; i++ ){ + hname = Form( "hres_itr%d_%d", itr, i ); + hresMap[hname] = inputDir.make( hname, Form( "; residual values, iteration %d (%d)", itr, i ), + nbins, hresmin[i], hresmax[i] ); + for( unsigned j=0; j <= i; j++ ){ + hname = Form( "hmcov_itr%d_%d_%d", itr, i, j ); + hmcovMap[hname] = inputDir.make( hname, Form( "; measurement covariance values, iteration %d (%d,%d)", itr, i, j ), + nbins, -1 * hddMeasmin[i]*hddMeasmin[i], hddMeasmax[i]*hddMeasmax[j] ); + } + } + } + } +} + + +void L1KalmanComb::fillCandHists( const KalmanState &state, const TP *tpa ) +{ + if( tpa && tpa->useForAlgEff() ){ + + const KalmanState *the_state = &state; + while( the_state ){ + if( the_state->stubCluster() ){ + std::vector x = the_state->xa(); + for( unsigned i=0; i < nPar_; i++ ){ + TString hname = Form( "hx_%d", i ); + if( hxMap.find(hname) == hxMap.end() ){ + cout << hname << " does not exist." << endl; + } + else hxMap[hname]->Fill(x.at(i)); + } + } + the_state = the_state->last_state(); + } + + + std::map mx = getTrackParams( &state ); + std::vector vx(nPar_); + vx[0] = mx["qOverPt"]; + vx[1] = mx["phi0"]; + vx[2] = mx["z0"]; + vx[3] = mx["t"]; + if( nPar_ == 5 ) vx[4] = mx["d0"]; + for( unsigned i=0; i < nPar_; i++ ){ + TString hname = Form( "hyf_%d", i ); + if( hyfMap.find(hname) == hyfMap.end() ){ + cout << hname << " does not exist." << endl; + } + else hyfMap[hname]->Fill(vx[i]); + } + } +} + + +void L1KalmanComb::fillSeedHists( const KalmanState *state, const TP *tpa ){ + + std::vector x0 = state->xa(); + TMatrixD pxx0 = state->pxxa(); + //Histogram Fill : seed pxxa + for( unsigned i=0; i < nPar_; i++ ){ + for( unsigned j=0; j <= i; j++ ){ + TString hname = Form( "hxcov_itr%d_%d_%d", 0, i, j ); + if( hxcovMap.find( hname ) == hxcovMap.end() ){ + cout << hname << " does not exist." << endl; + } + else hxcovMap[hname]->Fill( pxx0(i,j) ); + } + } + + if( tpa && tpa->useForAlgEff() ){ + std::vector xt(nPar_); + xt[0] = tpa->qOverPt(); + xt[1] = tpa->phi0(); + xt[2] = tpa->z0(); + xt[3] = tpa->tanLambda(); + if( nPar_ == 5 ) xt[4] = tpa->d0(); + for( unsigned i=0; i < nPar_; i++ ){ + TString hname = Form( "hyt_%d", i ); + if( hytMap.find(hname) == hytMap.end() ){ + cout << hname << " does not exist." << endl; + } + else hytMap[hname]->Fill(xt[i]); + } + //Histogram Fill : Seed state + std::map mx0 = getTrackParams( state ); + std::vector vx0(nPar_); + vx0[0] = mx0["qOverPt"]; + vx0[1] = mx0["phi0"]; + vx0[2] = mx0["z0"]; + vx0[3] = mx0["t"]; + if( nPar_ == 5 ) vx0[4] = mx0["d0"]; + for( unsigned i=0; i < nPar_; i++ ){ + TString hname = Form( "hy0_%d", i ); + if( hy0Map.find(hname) == hy0Map.end() ){ + cout << hname << " does not exist." << endl; + } + else hy0Map[hname]->Fill(vx0[i]); + } + } +} + + +void L1KalmanComb::fillStepHists( const TP *tpa, unsigned nItr, const KalmanState *new_state ) +{ + unsigned path = 0; + + const std::vector &xa = new_state->xa(); + const StubCluster *stubCluster = new_state->stubCluster(); + const TMatrixD &pxxa = new_state->pxxa(); + + TString hname; + + for( unsigned i=0; i < nPar_; i++ ){ + + for( unsigned j=0; j <= i; j++ ){ + hname = Form( "hxcov_itr%d_%d_%d", nItr, i, j ); + if( hxcovMap.find( hname ) == hxcovMap.end() ){ + cout << hname << " does not exist." << endl; + } + else hxcovMap[hname]->Fill( pxxa(i,j) ); + } + } + for( unsigned i=0; i < nPar_; i++ ){ + for( int j=0; j < 2; j++ ){ + TString hname = Form( "hk_itr%d_%d_%d", nItr, i, j ); + if( hkMap.find( hname ) == hkMap.end() ){ + cout << hname << " does not exist." << endl; + } + else hkMap[hname]->Fill( new_state->K()(i,j) ); + } + } + std::vector delta_new = residual(stubCluster, xa ); + for( unsigned int i=0; i < delta_new.size(); i++ ){ + TString hname = Form( "hres_itr%d_%d", nItr, i ); + if( hresMap.find(hname) == hresMap.end() ){ + cout << hname << " does not exist." << endl; + } + else hresMap[hname]->Fill( delta_new[i] ); + } + for( int i=0; i < 2; i++ ){ + for( int j=0; j < i; j++ ){ + TString hname = Form( "hmcov_itr%d_%d_%d", nItr, i, j ); + if( hmcovMap.find( hname ) == hmcovMap.end() ){ + cout << hname << " does not exist." << endl; + } + else hmcovMap[hname]->Fill( new_state->dcov()(i,j) ); + } + } +} + + +void L1KalmanComb::deleteStubClusters() +{ + for( unsigned int i=0; i < stbcl_list_.size(); i++ ){ + delete stbcl_list_.at(i); + } + stbcl_list_.clear(); +} + + +double L1KalmanComb::DeltaRphiForClustering( unsigned layerId, unsigned endcapRing ) +{ + static double barrel_drphi[6] = { 0.05, 0.04, 0.05, 0.12, 0.13, 0.19 }; + if( layerId < 10 ) return barrel_drphi[layerId - 1]; + + static double ec_drphi[16] = + { 0.04, 0.05, 0.04, 0.06, 0.06, 0.04, 0.06, 0.07, 0.15, 0.08, 0.27, 0.08, 0.27, 0.12, 0.09 }; + return ec_drphi[endcapRing - 1]; +}; + + +double L1KalmanComb::DeltaRForClustering( unsigned endcapRing ) +{ + static double ec_dr[16] = + { 0.52, 0.56, 0.59, 0.86, 0.66, 0.47, 0.55, 0.72, 1.53, 1.10, 2.72, 0.91, 2.69, 0.67, 0.09 }; + return ec_dr[endcapRing - 1]; + +} + + +bool L1KalmanComb::isOverlap( const Stub* a, const Stub*b, OVERLAP_TYPE type ){ + + std::set a_tps = a->assocTPs(); + std::set b_tps = b->assocTPs(); + double drphi = DeltaRphiForClustering( a->layerId(), a->endcapRing() ); + double dr(0); + switch ( type ){ + + case TYPE_NORMAL: + if( a->layerId() != b->layerId() ) return false; + + if( a->layerId() < 7 ){ + if( fabs( b->z() - a->z() ) > 0.5 * b->stripLength() || fabs( wrapRadian( b->phi() - sectorPhi() ) * b->r() - wrapRadian( a->phi() - sectorPhi() ) * a->r() ) > 0.5 * b->stripPitch() ) return false; + } + else{ + dr = DeltaRForClustering( a->endcapRing() ); + if( fabs( b->r() - a->r() ) > 0.5 * b->stripLength() || fabs( wrapRadian( b->phi() - sectorPhi() ) * b->r() - wrapRadian( a->phi() - sectorPhi() ) * a->r() ) > 0.5 * b->stripPitch() ) return false; + } + return true; + case TYPE_V2: + if( a->layerId() != b->layerId() ) return false; + + if( a->layerId() < 7 ){ + if( fabs( b->z() - a->z() ) > 0.5 * b->stripLength() || fabs( wrapRadian( b->phi() - sectorPhi() ) * b->r() - wrapRadian( a->phi() - sectorPhi() ) * a->r() ) > drphi ) return false; + } + else{ + dr = DeltaRForClustering( a->endcapRing() ); + if( fabs( b->r() - a->r() ) > dr || fabs( wrapRadian( b->phi() - sectorPhi() ) * b->r() - wrapRadian( a->phi() - sectorPhi() ) * a->r() ) > drphi ) return false; + } + return true; + + case TYPE_NOCLUSTERING: + return false; + + case TYPE_TP: + for( auto a_tp : a_tps ) + if( b_tps.find( a_tp ) != b_tps.end() ) return true; + return false; + default: + return false; + } +} + +} diff --git a/L1Trigger/TrackFindingTMTT/src/L1fittedTrack.cc b/L1Trigger/TrackFindingTMTT/src/L1fittedTrack.cc new file mode 100644 index 0000000000000..5dbccbba490a4 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/L1fittedTrack.cc @@ -0,0 +1,62 @@ +#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" + +namespace TMTT { + +// Digitize track and degrade helix parameter resolution according to effect of digitisation. + +void L1fittedTrack::digitizeTrack(const string& fitterName){ + if (settings_->enableDigitize()) { + if (! digitizedTrack_ ) { + digitizedTrack_ = true; + + bool consistent = this->consistentHTcell(); + bool consistentSect = this->consistentSector(); + int mbinhelix = int(this->getCellLocationFit().first) - floor(settings_->houghNbinsPt()/2); + int cbinhelix = int(this->getCellLocationFit().second) - floor(settings_->houghNbinsPhi()/2); + int mBinHT = int(this->getCellLocationHT().first) - floor(settings_->houghNbinsPt()/2); + int cBinHT = int(this->getCellLocationHT().second) - floor(settings_->houghNbinsPhi()/2); + + if(matchedTP_ != nullptr){ + digitalTrack_.init(fitterName, nHelixParam_, + iPhiSec_, iEtaReg_, mBinHT, cBinHT, mbinhelix, cbinhelix, hitPattern_, + qOverPt_, d0_, phi0_,tanLambda_, z0_, chi2rphi_, chi2rz_, + qOverPt_bcon_, phi0_bcon_, chi2rphi_bcon_, + nLayers_, consistent, consistentSect, this->accepted(), + matchedTP_->qOverPt(), matchedTP_->d0(), matchedTP_->phi0(), matchedTP_->tanLambda(), matchedTP_->z0(), matchedTP_->eta(), + matchedTP_->index(), matchedTP_->useForAlgEff(), matchedTP_->useForEff(), matchedTP_->pdgId()); + } else { + digitalTrack_.init(fitterName, nHelixParam_, + iPhiSec_, iEtaReg_, mBinHT, cBinHT, mbinhelix, cbinhelix, hitPattern_, + qOverPt_, d0_, phi0_, tanLambda_, z0_, chi2rphi_, chi2rz_, + qOverPt_bcon_, phi0_bcon_, chi2rphi_bcon_, + nLayers_, consistent, consistentSect, this->accepted(), + 0, 0, 0, 0, 0, 0, + -1, 0, 0, 0); + } + + // Digitize track + digitalTrack_.makeDigitalTrack(); + + // Convert digitized track params back to floating point with degraded resolution. + qOverPt_ = digitalTrack_.qOverPt(); + if (nHelixParam_ == 5) d0_ = digitalTrack_.d0(); + phi0_ = digitalTrack_.phi0(); + z0_ = digitalTrack_.z0(); + tanLambda_ = digitalTrack_.tanLambda(); + chi2rphi_ = digitalTrack_.chisquaredRphi(); + chi2rz_ = digitalTrack_.chisquaredRz(); + + // Ditto for beam-spot constrained values. + if (nHelixParam_ == 5) { + qOverPt_bcon_ = digitalTrack_.qOverPt_bcon(); + phi0_bcon_ = digitalTrack_.phi0_bcon(); + chi2rphi_bcon_ = digitalTrack_.chisquaredRphi_bcon(); + } + + // Recalculate consistency flag using updated helix params. + this->setConsistentHTcell(); + } + } +} + +} diff --git a/L1Trigger/TrackFindingTMTT/src/Matrix.cc b/L1Trigger/TrackFindingTMTT/src/Matrix.cc new file mode 100644 index 0000000000000..4613fdba969e5 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/Matrix.cc @@ -0,0 +1,371 @@ +/* --- +* Matrix class supporting common operations such as multiplication, inverse, determinant. +* Derived from: https://www.cs.rochester.edu/~brown/Crypto/assts/projects/adj.html +* and https://www.quantstart.com/articles/Matrix-Classes-in-C-The-Source-File +* --- */ + +#include "L1Trigger/TrackFindingTMTT/interface/Matrix.h" +#include "FWCore/Utilities/interface/Exception.h" +#include +#include + +namespace TMTT { + +// Parameter Constructor +template +Matrix::Matrix(){ + mat.resize(0); + rows = 0; + cols = 0; +} +template +Matrix::Matrix(unsigned _rows, unsigned _cols, const T& _initial) { + mat.resize(_rows); + for (unsigned i=0; i +Matrix::Matrix(const Matrix& rhs) { + mat = rhs.mat; + rows = rhs.get_rows(); + cols = rhs.get_cols(); +} + +// (Virtual) Destructor +template +Matrix::~Matrix() {} + +// Assignment Operator +template +Matrix& Matrix::operator=(const Matrix& rhs) { + if (&rhs == this) + return *this; + + unsigned new_rows = rhs.get_rows(); + unsigned new_cols = rhs.get_cols(); + + mat.resize(new_rows); + for (unsigned i=0; i +Matrix Matrix::operator+(const Matrix& rhs) { + Matrix result(rows, cols, 0.0); + + for (unsigned i=0; imat[i][j] + rhs(i,j); + } + } + + return result; +} + +// Cumulative addition of this matrix and another +template +Matrix& Matrix::operator+=(const Matrix& rhs) { + unsigned rows = rhs.get_rows(); + unsigned cols = rhs.get_cols(); + + for (unsigned i=0; imat[i][j] += rhs(i,j); + } + } + + return *this; +} + +// Subtraction of this matrix and another +template +Matrix Matrix::operator-(const Matrix& rhs) { + unsigned rows = rhs.get_rows(); + unsigned cols = rhs.get_cols(); + Matrix result(rows, cols, 0.0); + + for (unsigned i=0; imat[i][j] - rhs(i,j); + } + } + + return result; +} + +// Cumulative subtraction of this matrix and another +template +Matrix& Matrix::operator-=(const Matrix& rhs) { + unsigned rows = rhs.get_rows(); + unsigned cols = rhs.get_cols(); + + for (unsigned i=0; imat[i][j] -= rhs(i,j); + } + } + + return *this; +} + +// Left multiplication of this matrix and another +template +Matrix Matrix::operator*(const Matrix& rhs) { + assert(this->cols == rhs.get_rows()); + unsigned rRows = rhs.get_rows(); + unsigned rCols = rhs.get_cols(); + unsigned lRows = this->rows; + unsigned lCols = this->cols; + Matrix result(lRows, rCols, 0.0); + for(unsigned i=0; i < lRows; i++){ + for(unsigned j = 0; j < rCols; j++){ + for(unsigned k = 0; k < lCols; k++){ + result(i,j) += this->mat[i][k] * rhs.mat[k][j]; + } + } + } + return result; +} + +// Cumulative left multiplication of this matrix and another +template +Matrix& Matrix::operator*=(const Matrix& rhs) { + Matrix result = (*this) * rhs; + (*this) = result; + return *this; +} + +// Calculate a transpose of this matrix +template +Matrix Matrix::transpose() { + Matrix result(cols, rows, 0.0); + + for (unsigned i=0; imat[j][i]; + } + } + + return result; +} + +// Recursively calculate the determinant +template +T Matrix::determinant(){ + T det = 0; + if(rows < 1){ + std::cerr << "Can't have determinant of matrix with " << rows << " rows." << std::endl; + } else if (rows == 1){ + det = this->mat[0][0]; + } else if (rows == 2){ + det = this->mat[0][0] * this->mat[1][1] - this->mat[1][0] * this->mat[0][1]; + }else{ + for(unsigned i = 0; i < rows; i++){ + Matrix m(rows-1, cols-1, 0); + for(unsigned j = 1; j < rows; j++){ + unsigned k = 0; + for(unsigned l =0; l < rows; l++){ + if(l == i) + continue; + m(j-1,k) = this->mat[j][l]; + k++; + } + } + T sign; + if ((i+2)%2 == 0) + sign = 1; + else + sign = -1; + det += sign * this->mat[0][i] * m.determinant(); + } + } + return(det); +} + +template +Matrix Matrix::cofactor(){ + Matrix result(rows, cols, 0); + Matrix c(rows-1, cols-1, 0); + if(rows != cols){ + std::cerr << "Can only compute cofactor of square matrix." << std::endl; + return result; + } + for(unsigned j = 0; j < rows; j++){ + for(unsigned i = 0; i < rows; i++){ + unsigned i1 = 0; + for(unsigned ii = 0; ii < rows; ii++){ + if(ii==i) + continue; + unsigned j1 = 0; + for(unsigned jj = 0; jj< rows; jj++){ + if(jj == j) + continue; + c(i1,j1) = this->mat[ii][jj]; + j1++; + } + i1++; + } + + T det = c.determinant(); + T sign; + if ((i+j+2)%2 == 0) + sign = 1; + else + sign = -1; + result(i,j) = sign * det; + } + } + return result; +} + +template +Matrix Matrix::inverse(){ + if(rows != cols){ + std::cerr << "Matrix: cannot invert matrix with " << rows << " rows and " << cols << "cols" << std::endl; + } + if(this->determinant() == 0) + std::cerr << "Matrix with 0 determinant has no inverse." << std::endl; + Matrix result = this->cofactor().transpose() / this->determinant(); + return result; +} + +// Matrix/scalar addition +template +Matrix Matrix::operator+(const T& rhs) { + Matrix result(rows, cols, 0.0); + + for (unsigned i=0; imat[i][j] + rhs; + } + } + + return result; +} + +// Matrix/scalar subtraction +template +Matrix Matrix::operator-(const T& rhs) { + Matrix result(rows, cols, 0.0); + + for (unsigned i=0; imat[i][j] - rhs; + } + } + + return result; +} + +// Matrix/scalar multiplication +template +Matrix Matrix::operator*(const T& rhs) { + Matrix result(rows, cols, 0.0); + + for (unsigned i=0; imat[i][j] * rhs; + } + } + + return result; +} + +// Matrix/scalar division +template +Matrix Matrix::operator/(const T& rhs) { + Matrix result(rows, cols, 0.0); + + if ( rhs == 0 ) throw cms::Exception("Matrix.cc: Trying to divide (matrix/scalar) by zero"); + + for (unsigned i=0; imat[i][j] / rhs; + } + } + + return result; +} + +// Multiply a matrix with a vector +template +std::vector Matrix::operator*(const std::vector& rhs) { + std::vector result(this->rows, 0.0); + + for (unsigned i=0; imat[i][j] * rhs[j]; + } + } + + return result; +} + +// Obtain a vector of the diagonal elements +template +std::vector Matrix::diag_vec() { + std::vector result(rows, 0.0); + + for (unsigned i=0; imat[i][i]; + } + + return result; +} + +// Access the individual elements +template +T& Matrix::operator()(const unsigned& row, const unsigned& col) { + return this->mat[row][col]; +} + +// Access the individual elements (const) +template +const T& Matrix::operator()(const unsigned& row, const unsigned& col) const { + return this->mat[row][col]; +} + +// Get the number of rows of the matrix +template +unsigned Matrix::get_rows() const { + return this->rows; +} + +// Get the number of columns of the matrix +template +unsigned Matrix::get_cols() const { + return this->cols; +} + +template +void Matrix::print(){ + for(unsigned i=0; i < this->rows; i++){ + for(unsigned j=0; j < this->cols; j++){ + std::cout << this->mat[i][j] << ", "; + } + std::cout << std::endl; + } +} + +template class Matrix; +template class Matrix; +template class Matrix; + +} diff --git a/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc b/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc new file mode 100644 index 0000000000000..5b1fb6b186851 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc @@ -0,0 +1,239 @@ +#include "L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" + +#include + +namespace TMTT { + +MiniHTstage::MiniHTstage( const Settings* settings ) : + settings_( settings ), + miniHTstage_( settings_->miniHTstage() ), + muxOutputsHT_( settings_->muxOutputsHT() ), + houghNbinsPt_( settings_->houghNbinsPt() ), + houghNbinsPhi_( settings_->houghNbinsPhi() ), + miniHoughLoadBalance_( settings_->miniHoughLoadBalance() ), + miniHoughNbinsPt_( settings_->miniHoughNbinsPt() ), + miniHoughNbinsPhi_( settings_->miniHoughNbinsPhi() ), + miniHoughMinPt_( settings_->miniHoughMinPt() ), + miniHoughDontKill_( settings_->miniHoughDontKill() ), + miniHoughDontKillMinPt_( settings_->miniHoughDontKillMinPt() ), + numSubSecsEta_( settings_->numSubSecsEta() ), + numPhiNonants_( settings_->numPhiNonants() ), + numPhiSecPerNon_( settings_->numPhiSectors() / numPhiNonants_ ), + numEtaRegions_( settings_->numEtaRegions() ), + busySectorKill_( settings_->busySectorKill() ), + busySectorNumStubs_( settings_->busySectorNumStubs()), + busySectorMbinRanges_( settings_->busySectorMbinRanges() ), + chosenRofPhi_( settings_->chosenRofPhi() ), +// Get size of 1st stage HT cells. + binSizeQoverPtAxis_( miniHoughNbinsPt_ * 2. / (float)settings->houghMinPt() / (float)houghNbinsPt_ ), + binSizePhiTrkAxis_( miniHoughNbinsPhi_ * 2. * M_PI / (float)settings->numPhiSectors() / (float)houghNbinsPhi_ ), + invPtToDphi_( settings_->invPtToDphi() ), + nHTlinksPerNonant_(0) +{ + nMiniHTcells_ = miniHoughNbinsPt_*miniHoughNbinsPhi_; + + if (miniHoughLoadBalance_ > 0) { + if (muxOutputsHT_ == 3) { + nHTlinksPerNonant_ = busySectorMbinRanges_.size() - 1; + } else if (muxOutputsHT_ == 2) { + nHTlinksPerNonant_ = (busySectorMbinRanges_.size() - 1) * numPhiSecPerNon_; + } else { + throw cms::Exception("MiniHTState: hard-wired MHT load balancing can't be enabled as assumes HT output MUX scheme >= 2"); + } + } +} + +void MiniHTstage::exec( matrix< HTrphi >& mHtRphis ) { + + for ( unsigned int iPhiNon = 0; iPhiNon < numPhiNonants_; iPhiNon++ ) { + map< pair, unsigned int> numStubsPerLinkStage1; // Indices are ([link ID, MHT cell], #stubs). + map< pair, unsigned int> numStubsPerLinkStage2; // Indices are ([link ID, MHT cell], #stubs). + map< unsigned int, unsigned int> numStubsPerLink; // Indices are ([link ID, MHT cell], #stubs). + for ( unsigned int iSecInNon = 0; iSecInNon < numPhiSecPerNon_; iSecInNon++ ) { + unsigned int iPhiSec = iPhiNon * numPhiSecPerNon_ + iSecInNon; + for ( unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++ ) { + + Sector sector; + sector.init( settings_, iPhiSec, iEtaReg ); + const float& phiCentre = sector.phiCentre(); + HTrphi& htRphi = mHtRphis( iPhiSec, iEtaReg ); + const vector< L1track2D >& roughTracks = htRphi.trackCands2D(); + vector< L1track2D > fineTracks; + + for (const L1track2D& roughTrk : roughTracks) { + + float roughTrkPhi = reco::deltaPhi( roughTrk.phi0() - chosenRofPhi_ * invPtToDphi_ * roughTrk.qOverPt() - phiCentre, 0. ); + const pair< unsigned int, unsigned int >& cell = roughTrk.getCellLocationHT(); + const vector< const Stub* >& stubs = roughTrk.getStubs(); + bool fineTrksFound = false; + bool storeCoarseTrack = false; + const unsigned int& link = roughTrk.optoLinkID(); + + if (fabs(roughTrk.qOverPt()) < 1./miniHoughMinPt_) { // Not worth using mini-HT at low Pt due to scattering. + + for ( unsigned int mBin = 0; mBin < miniHoughNbinsPt_; mBin++ ) { + float qOverPtBin = roughTrk.qOverPt() - binSizeQoverPtAxis_ / 2. + ( mBin + .5 ) * binSizeQoverPtAxis_ / settings_->miniHoughNbinsPt(); + for ( unsigned int cBin = 0; cBin < miniHoughNbinsPhi_; cBin++ ){ + float phiBin = reco::deltaPhi( roughTrkPhi - binSizePhiTrkAxis_ / 2. + ( cBin + .5 ) * binSizePhiTrkAxis_ / settings_->miniHoughNbinsPhi(), 0. ); + HTcell htCell; + const bool mergedCell = false; // This represents mini cell. + const bool miniHTcell = true; + htCell.init( settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), qOverPtBin, cell.first + mBin, mergedCell, miniHTcell ); + // Firmware doesn't use bend filter in MHT. + htCell.disableBendFilter(); + + for ( auto& stub: stubs ) { + // Ensure stubs are digitized with respect to the current phi sector. + if ( settings_->enableDigitize() ) + ( const_cast< Stub* >( stub ) )->digitizeForHTinput( iPhiSec ); + float phiStub = reco::deltaPhi( stub->phi() + invPtToDphi_ * qOverPtBin * ( stub->r() - chosenRofPhi_ ) - phiCentre, 0. ); + float dPhi = reco::deltaPhi( phiBin - phiStub, 0. ); + float dPhiMax = binSizePhiTrkAxis_ / miniHoughNbinsPhi_ / 2. + invPtToDphi_ * binSizeQoverPtAxis_ / (float)miniHoughNbinsPt_ * fabs( stub->r() - chosenRofPhi_ ) / 2.; + if ( fabs( dPhi ) <= fabs( reco::deltaPhi( dPhiMax, 0. ) ) ) htCell.store( stub, sector.insideEtaSubSecs( stub ) ); + } + htCell.end(); + if ( htCell.trackCandFound() ) { + + // Do load balancing. + unsigned int trueLinkID = linkIDLoadBalanced(link, mBin, cBin, htCell.numStubs(), numStubsPerLinkStage1, numStubsPerLinkStage2); + + pair< unsigned int, unsigned int > cellLocation( cell.first + mBin, cell.second + cBin ); + pair< float, float > helix2D( qOverPtBin, reco::deltaPhi( phiBin + chosenRofPhi_ * invPtToDphi_ * qOverPtBin + phiCentre, 0. ) ); + L1track2D fineTrk( settings_, htCell.stubs(), cellLocation, helix2D, iPhiSec, iEtaReg, trueLinkID, mergedCell ); + // Truncation due to output opto-link bandwidth. + bool keep( true ); + /* + pair encodedLink; + if (miniHoughLoadBalance_ > 0) { + encodedLink = pair(newererLink, mhtCell); + } else { + encodedLink = pair(newererLink, 0); + } + numStubsPerLink[ encodedLink ] += htCell.numStubs(); + if ( busySectorKill_ && numStubsPerLink[ encodedLink ] > busySectorNumStubs_ ) keep = false; + */ + numStubsPerLink[ trueLinkID ] += htCell.numStubs(); + if ( busySectorKill_ && numStubsPerLink[ trueLinkID ] > busySectorNumStubs_ ) keep = false; + if ( keep ) { + fineTracks.push_back( fineTrk ); + fineTrksFound = true; + } + } + } + } + + } else { + + // Keep rough track if below Pt threshold where mini-HT in use. + storeCoarseTrack = true; + + } + + if ( storeCoarseTrack || ( (not fineTrksFound) && miniHoughDontKill_ && fabs(roughTrk.qOverPt()) < 1./miniHoughDontKillMinPt_ ) ) { + // Keeping original track instead of mini-HTtracks. + // Invent dummy miniHT cells so as to be able to reuse load balancing, trying all combinations to identify the least used link. + pair bestCell = {0,0}; + unsigned int bestNumStubsPerLink = 999999; + for ( unsigned int mBin = 0; mBin < miniHoughNbinsPt_; mBin++ ) { + for ( unsigned int cBin = 0; cBin < miniHoughNbinsPhi_; cBin++ ){ + unsigned int testLinkID = linkIDLoadBalanced(link, mBin, cBin, roughTrk.getNumStubs(), numStubsPerLinkStage1, numStubsPerLinkStage2, true); + if (numStubsPerLink[ testLinkID ] < bestNumStubsPerLink) { + bestCell = {mBin, cBin}; + bestNumStubsPerLink = numStubsPerLink[ testLinkID ]; + } + } + } + + // Repeat for best link, this time incremementing stub counters. + unsigned int trueLinkID = linkIDLoadBalanced(link, bestCell.first, bestCell.second, roughTrk.getNumStubs(), numStubsPerLinkStage1, numStubsPerLinkStage2); + + bool keep( true ); + /* + pair encodedLink; + if (miniHoughLoadBalance_ > 0) { + encodedLink = pair(link/nMiniHTcells_, link%nMiniHTcells_); + } else { + encodedLink = pair(link, 0); + } + numStubsPerLink[ encodedLink ] += roughTrk.getNumStubs(); + if ( busySectorKill_ && numStubsPerLink[ encodedLink ] > busySectorNumStubs_ ) keep = false; + */ + numStubsPerLink[ trueLinkID ] += roughTrk.getNumStubs(); + if ( busySectorKill_ && numStubsPerLink[ trueLinkID ] > busySectorNumStubs_ ) keep = false; + if ( keep ) { + fineTracks.push_back( roughTrk ); + fineTracks.back().setOptoLinkID(trueLinkID); + } + } + } + // Replace all existing tracks inside HT array with new ones. + htRphi.replaceTrackCands2D( fineTracks ); + } + } + } +} + +//=== Do load balancing +//=== (numStubs is stubs on this track, "link" is link ID before load balancing, and return argument is link ID after load balancing). +//=== (numStubsPerLinkStage* are stub counters per link used to determine best balance. If test=true, then these counters are not to be incrememented). + +unsigned int MiniHTstage::linkIDLoadBalanced(unsigned int link, unsigned int mBin, unsigned int cBin, unsigned int numStubs, map< pair, unsigned int>& numStubsPerLinkStage1, map< pair, unsigned int>& numStubsPerLinkStage2, bool test) const { + + unsigned int mhtCell = miniHoughNbinsPhi_*mBin + cBin; // Send each mini-cell to a different output link + + // Number of output links after static load balancing roughly same as number of + // input links with this, with nSep per MHT cell. + unsigned int nSep = std::ceil(float(nHTlinksPerNonant_)/float(nMiniHTcells_)); + + unsigned int newLink, newerLink, newererLink; + + if (miniHoughLoadBalance_ >= 1) { + // Static load balancing, 4 -> 1, with each MHT cell sent to seperate output link. + newLink = link%nSep; // newLink in range 0 to nSep-1. + } else { + newLink = link; + } + + if (miniHoughLoadBalance_ >= 2) { + + // 2-stage dynamic load balancing amongst links corresponding to same MHT cell. + + // Dynamically mix pairs of neighbouring links. + unsigned int balancedLinkA = 2*(newLink/2); + unsigned int balancedLinkB = balancedLinkA + 1; + + pair encodedLinkA(balancedLinkA, mhtCell); // balancedLink* here in range 0 to nSep-1. + pair encodedLinkB(balancedLinkB, mhtCell); + if (numStubsPerLinkStage1[encodedLinkA] < numStubsPerLinkStage1[encodedLinkB]) { + newerLink = balancedLinkA; + } else { + newerLink = balancedLinkB; + } + pair encodedLinkAB(newerLink, mhtCell); + if (not test) numStubsPerLinkStage1[ encodedLinkAB ] += numStubs; + + // Dynamically mix pairs of next-to-neighbouring links. + unsigned int balancedLinkY = newerLink; + //unsigned int balancedLinkZ = (newerLink%4<=1) ? balancedLinkY + 2 : balancedLinkY - 2; + unsigned int balancedLinkZ = (newerLink+2)%nSep; + + pair encodedLinkY(balancedLinkY, mhtCell); + pair encodedLinkZ(balancedLinkZ, mhtCell); + if (numStubsPerLinkStage2[encodedLinkY] < numStubsPerLinkStage2[encodedLinkZ]) { + newererLink = balancedLinkY; + } else { + newererLink = balancedLinkZ; + } + pair encodedLinkYZ(newererLink, mhtCell); + if (not test) numStubsPerLinkStage2[ encodedLinkYZ ] += numStubs; + + } else { + newerLink = newLink; + newererLink = newLink; + } + unsigned int trueLinkID = (miniHoughLoadBalance_ > 0) ? nMiniHTcells_ * newererLink + mhtCell : newererLink; + return trueLinkID; +} + +} diff --git a/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc b/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc new file mode 100644 index 0000000000000..e746c7882c988 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc @@ -0,0 +1,190 @@ + +//--- Note that the word "link" appearing in the C++ or comments in this class actually corresponds +//--- to a pair of links in the hardware. + +#include "L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" + +#include "FWCore/Utilities/interface/Exception.h" + +namespace TMTT { + +//=== Initialize constants from configuration parameters. + +MuxHToutputs::MuxHToutputs(const Settings* settings) : + settings_(settings), + muxOutputsHT_( settings_->muxOutputsHT() ), + numPhiNonants_( settings_->numPhiNonants() ), + numPhiSectors_( settings_->numPhiSectors() ), + numPhiSecPerNon_( numPhiSectors_ / numPhiNonants_ ), + numEtaRegions_( settings_->numEtaRegions() ), + busySectorKill_( settings_->busySectorKill() ), // Kill excess tracks flowing out of HT? + busySectorNumStubs_( settings_->busySectorNumStubs()), // Max. num. of stubs that can be sent within TM period + busySectorMbinRanges_( settings_->busySectorMbinRanges() ), // Individual m bin (=q/Pt) ranges to be output to opto-links. + busySectorUseMbinRanges_( busySectorMbinRanges_.size() > 0) // m bin ranges option disabled if vector empty. +{ + // Implemented MUX algorithm relies on same number of sectors per nonant. + if (numPhiSectors_%numPhiNonants_ != 0) throw cms::Exception("MuxHToutputs: Number of phi sectors is not a multiple of number of nonants!"); + + if ( ! busySectorUseMbinRanges_) throw cms::Exception("MuxHToutputs: The implemented MUX algorithm requires you to be using the busySectorMbinRanges cfg option!"); + + // Check that the MUX algorithm implemented in linkID() is not obviously wrong. + this->sanityCheck(); + + bool static first = true; + if (first) { + first = false; + cout<<"=== The R-PHI HT output is multiplexed onto "<numLinksPerNonant()<<" pairs of opto-links per nonant."<& mHtRphis) const { + + // As this loops over sectors in order of increasing sector number, this MUX algorithm always transmits tracks + // from the lowest sector numbers on each link first. So the highest sector numbers are more likely to be + // truncated by the TM period. The algorithm assumes that two or more m-bin ranges from the same sector will never + // be transmitted down the same link, as if this happens, it does not predict the order in which they will be + // transmitted. + + for (unsigned int iPhiNon = 0; iPhiNon < numPhiNonants_; iPhiNon++) { + vector numStubsPerLink( this->numLinksPerNonant(), 0 ); + + for (unsigned int iSecInNon = 0; iSecInNon < numPhiSecPerNon_; iSecInNon++) { + unsigned int iPhiSec = iPhiNon * numPhiSecPerNon_ + iSecInNon; + + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + + HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); // Get a mutable version of the r-phi HT. + + vector keptTracks; + vector tracks = htRphi.trackCands2D(); + + for (L1track2D& trk : tracks) { + unsigned int nStubs = trk.getNumStubs(); // #stubs on this track. + unsigned int mBinRange = htRphi.getMbinRange(trk); // Which m bin range is this track in? + // Get the output optical link corresponding to this sector & m-bin range. + unsigned int link = this->linkID(iSecInNon, iEtaReg, mBinRange); + // Make a note of opto-link number inside track object. + trk.setOptoLinkID(link); + + numStubsPerLink[ link ] += nStubs; + // Check if this track can be output within the time-multiplexed period. + bool keep = ( (not busySectorKill_) || (numStubsPerLink[ link ] <= busySectorNumStubs_)); + // FIX: with 2 GeV threshold, this causes significant truncation. + // Consider using one output link for each phi sector in nonant + if (keep) keptTracks.push_back(&trk); + } + + // Replace the collection of 2D tracks in the r-phi HT with the subset of them surviving the TM cut. + htRphi.replaceTrackCands2D(keptTracks); + } + } + } +} + +//=== Define the number of (eta,phi) sectors that each output opto-link takes tracks from. (Depends on MUX scheme). + +unsigned int MuxHToutputs::muxFactor() const { + if (muxOutputsHT_ == 1) { + return 6; + } else if (muxOutputsHT_ == 2) { + return numEtaRegions_; + } else { + return numEtaRegions_*numPhiSecPerNon_; + } +} + +//=== Define the MUX algorithm by which tracks from the specified m-bin range in the HT for a given (phi,eta) +//=== sector within a phi nonant are multiplexed onto a single output optical link. + +unsigned int MuxHToutputs::linkID(unsigned int iSecInNon, unsigned int iEtaReg, unsigned int mBinRange) const { + unsigned int link; + + // This algorithm multiplexes tracks from different eta sectors onto the a single optical link. + + if (muxOutputsHT_ == 1) { + + //--- This is Mux used for the Dec. 2016 demonstrator. + + // Link 0 contains eta sectors 0, 3, 6, 9, 12 & 15, whilst Link 1 contains eta sectors 1, 4, 7, 10, 13 & 16 etc. + // The multiplexing is independent of the phi sector or m-bin range, except in that two tracks that + // differ in either of these quantities will always be sent to different Links. + + if (numEtaRegions_ == 18) { + link = iEtaReg%3; // In range 0 to 2 + link += 3*iSecInNon; // In range 0 to (3*numPhiSecPerNon - 1) + link += 3*numPhiSecPerNon_ * mBinRange; // In range 0 to (3*numPhiSecsPerNon*numMbinRanges - 1) + } else { + throw cms::Exception("MuxHToutputs: MUX algorithm only implemented for 18 eta sectors!"); + } + + } else if (muxOutputsHT_ == 2) { + + //--- This is the Mar. 2018 Mux for the transverse HT readout organised by m-bin. (Each phi sector & m bin range go to a different link). + + link = 0; + //link += iSecInNon; + //link += numPhiSecPerNon_ * mBinRange; + + // IRT - match firmware, taking into account that fw uses mBin = -mBin relative to sw. + // NOT NEEDED ANYMORE, AS NOW FW USES MBIN SAME SIGN AS Q/PT. + // unsigned int iCorr = (settings_->miniHTstage()) ? 1 : 0; + // Sign flip for FW using opposite + //link += (busySectorMbinRanges_.size() - iCorr) - mBinRange - 1; + link += mBinRange; + link += iSecInNon * (busySectorMbinRanges_.size() - 1); + + } else if (muxOutputsHT_ == 3) { + + //--- This is the Sept. 2019 Mux for the transverse HT readout organised by m-bin. (Each m bin in entire nonant goes to a different link). + + link = 0; + //link += iSecInNon; + //link += numPhiSecPerNon_ * mBinRange; + + // IRT - match firmware, taking into account that fw uses mBin = -mBin relative to sw. + // NOT NEEDED ANYMORE, AS NOW FW USES MBIN SAME SIGN AS Q/PT. + // unsigned int iCorr = (settings_->miniHTstage()) ? 1 : 0; + // Sign flip for FW using opposite + //link += (busySectorMbinRanges_.size() - iCorr) - mBinRange - 1; + link += mBinRange; + + } else { + + throw cms::Exception("MuxHToutputs: Unknown MuxOutputsHT configuration option!"); + + } + + if (link >= this->numLinksPerNonant() ) throw cms::Exception("MuxHToutputs: Calculated link ID exceeded expected number of links! ")<numLinksPerNonant()<muxFactor() != 0) throw cms::Exception("MuxHToutputs: Number of sectors per phi nonant is not a multiple of muxFactor()."); + + vector nObsElementsPerLink ( this->numLinksPerNonant(), 0 ); + for (unsigned int iSecInNon = 0; iSecInNon < numPhiSecPerNon_; iSecInNon++) { + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + // IRT + unsigned int iCorr = (settings_->miniHTstage()) ? 1 : 0; + for (unsigned int mBinRange = 0; mBinRange < busySectorMbinRanges_.size() - iCorr; mBinRange++) { + unsigned int link = this->linkID(iSecInNon, iEtaReg, mBinRange); + nObsElementsPerLink[ link ] += 1; + } + } + } + for (const unsigned int& n : nObsElementsPerLink) { + // Assume good algorithms will distribute sectors & m-bin ranges equally across links. + // IRT + // if (n != this->muxFactor()) throw cms::Exception("MuxHToutputs: MUX algorithm is not assigning equal numbers of elements per link! ")<muxFactor()<handleStripsPhiSec(); + handleStripsEtaSec_ = settings->handleStripsEtaSec(); + + //=== Characteristics of this eta region. + + iPhiSec_ = iPhiSec; + iEtaReg_ = iEtaReg; + // Using lines of specified rapidity drawn from centre of CMS, determine the z coords at which + // they cross the radius rChosenRofZ_. + etaMin_ = settings->etaRegions()[iEtaReg]; + etaMax_ = settings->etaRegions()[iEtaReg + 1]; + chosenRofZ_ = settings->chosenRofZ(); + // Get range in z of tracks covered by this sector at chosen radius from beam-line + zOuterMin_ = chosenRofZ_ / tan( 2. * atan(exp(-etaMin_)) ); + zOuterMax_ = chosenRofZ_ / tan( 2. * atan(exp(-etaMax_)) ); + beamWindowZ_ = settings->beamWindowZ(); // Assumed half-length of beam-spot + + // If rapidity line leaves tracker endcap before reaching r = rChosenOfZ_, try something different. + /* + trackerOuterRadius_ = settings->trackerOuterRadius(); + trackerInnerRadius_ = settings->trackerInnerRadius(); + trackerHalfLength_ = settings->trackerHalfLength(); + if (fabs(zOuterMin_) > trackerHalfLength_) { + float scale = trackerHalfLength_/fabs(zOuterMin_); + zOuterMin_ *= scale; + rOuterMin_ *= scale; + } + if (fabs(zOuterMax_) > trackerHalfLength_) { + float scale = trackerHalfLength_/fabs(zOuterMax_); + zOuterMax_ *= scale; + rOuterMax_ *= scale; + } + */ + + //=== Characteristics of this phi region. + unsigned int numPhiSecPerNonant = (settings->numPhiSectors()) / (settings->numPhiNonants()); + // Centre of phi (tracking) nonant zero must be along x-axis to be consistent with tracker cabling map. + // Define phi sector zero to start at lower end of phi range in nonant 0. + float phiCentreSec0 = -M_PI/float(settings->numPhiNonants()) + M_PI/float(settings->numPhiSectors()); + phiCentre_ = 2.*M_PI * float(iPhiSec) / float(settings->numPhiSectors()) + phiCentreSec0; // Centre of sector in phi + sectorHalfWidth_ = M_PI / float(settings->numPhiSectors()); // Sector half width excluding overlaps. + chosenRofPhi_ = settings->chosenRofPhi(); + useStubPhi_ = settings->useStubPhi(); + minPt_ = settings->houghMinPt(); // Min Pt covered by HT array. + useStubPhiTrk_ = settings->useStubPhiTrk(); + assumedPhiTrkRes_ = settings->assumedPhiTrkRes(); + calcPhiTrkRes_ = settings->calcPhiTrkRes(); + + //=== Check if subsectors in eta are being used within each sector. + numSubSecsEta_ = settings->numSubSecsEta(); + /* + // If subsectors have equal width in z50, do this. + float subSecWidth = (zOuterMax_ - zOuterMin_)/float(numSubSecsEta_); + for (unsigned int i = 0; i < numSubSecsEta_; i++) { + zOuterMinSub_.push_back( zOuterMin_ + i *subSecWidth); + zOuterMaxSub_.push_back( zOuterMin_ + (i + 1)*subSecWidth); + } + */ + // If subsectors have equal width in rapidity, do this. + float subSecWidth = (etaMax_ - etaMin_)/float(numSubSecsEta_); + for (unsigned int i = 0; i < numSubSecsEta_; i++) { + float subSecEtaMin = etaMin_ + i * subSecWidth; + float subSecEtaMax = subSecEtaMin + subSecWidth; + float subSecZmin = chosenRofZ_ / tan( 2. * atan(exp(-subSecEtaMin)) ); + float subSecZmax = chosenRofZ_ / tan( 2. * atan(exp(-subSecEtaMax)) ); + zOuterMinSub_.push_back( subSecZmin ); + zOuterMaxSub_.push_back( subSecZmax ); + } +} + +//=== Check if stub is inside this eta region. + +bool Sector::insideEta( const Stub* stub ) const { + // Lower edge of this eta region defined by line from (r,z) = (0,-beamWindowZ) to (chosenRofZ_, zOuterMin_). + // Upper edge of this eta region defined by line from (r,z) = (0, beamWindowZ) to (chosenRofZ_, zOuterMax_). + + bool inside = this->insideEtaRange(stub, zOuterMin_, zOuterMax_); + return inside; +} + + +//=== Check if stub is within subsectors in eta that sector may be divided into. + +vector Sector::insideEtaSubSecs( const Stub* stub) const { + + if (settings_->enableDigitize() && numSubSecsEta_ == 2) { + // Use (complicated) digitized firmware emulation + return subEtaFwCalc(stub->digitalStub().iDigi_Rt(), stub->digitalStub().iDigi_Z()); + + } else { + // Use (simpler) floating point calculation. + + vector insideVec; + + // Loop over subsectors. + for (unsigned int i = 0; i < numSubSecsEta_; i++) { + bool inside = this->insideEtaRange(stub, zOuterMinSub_[i], zOuterMaxSub_[i]); + insideVec.push_back(inside); + } + + return insideVec; + } +} + +//=== Check if stub is within eta sector or subsector that is delimated by specified zTrk range. + +bool Sector::insideEtaRange( const Stub* stub, float zRangeMin, float zRangeMax) const { + // Lower edge of this eta region defined by line from (r,z) = (0,-beamWindowZ) to (chosenRofZ_, zRangeMin). + // Upper edge of this eta region defined by line from (r,z) = (0, beamWindowZ) to (chosenRofZ_, zRangeMax). + + float zMin, zMax; + + bool inside; + + if ( ! handleStripsEtaSec_) { + //--- Don't modify algorithm to allow for uncertainty in stub (r,z) coordinates caused by 2S module strip length? + + // Calculate z coordinate of lower edge of this eta region, evaluated at radius of stub. + zMin = ( zRangeMin * stub->r() - beamWindowZ_ * fabs(stub->r() - chosenRofZ_) ) / chosenRofZ_; + // Calculate z coordinate of upper edge of this eta region, evaluated at radius of stub. + zMax = ( zRangeMax * stub->r() + beamWindowZ_ * fabs(stub->r() - chosenRofZ_) ) / chosenRofZ_; + + // zMin = ( zRangeMin * stub->r() - beamWindowZ_ * fabs(stub->r() - rOuterMin_) ) / rOuterMin_; + // zMax = ( zRangeMax * stub->r() + beamWindowZ_ * fabs(stub->r() - rOuterMax_) ) / rOuterMax_; + + inside = (stub->z() > zMin && stub->z() < zMax); + + } else { + //--- Do modify algorithm to allow for uncertainty in stub (r,z) coordinates caused by 2S module strip length? + + float stubMinR = stub->r() - stub->rErr(); + float stubMaxR = stub->r() + stub->rErr(); + float stubMinZ = stub->z() - stub->zErr(); + float stubMaxZ = stub->z() + stub->zErr(); + + // Calculate z coordinate of lower edge of this eta region, evaluated at radius of stub. + float rStubA = (zRangeMin + beamWindowZ_) >= 0 ? stubMinR : stubMaxR; // stub r coordinate uncertain (especially in endcap), so use one which gives most -ve zMin. + zMin = -beamWindowZ_ + (rStubA / chosenRofZ_) * (zRangeMin + beamWindowZ_); + + // Calculate z coordinate of upper edge of this eta region, evaluated at radius of stub. + float rStubB = (zRangeMax - beamWindowZ_) >= 0 ? stubMaxR : stubMinR; // stub r coordinate uncertain (especially in endcap), so use one which gives most +ve zMax. + zMax = beamWindowZ_ + (rStubB / chosenRofZ_) * (zRangeMax - beamWindowZ_); + + inside = (stubMaxZ > zMin && stubMinZ < zMax); + } + + return inside; +} + +//=== Check if stub is inside this phi region. + +bool Sector::insidePhi( const Stub* stub ) const { + + // N.B. The logic here for preventing a stub being assigned to > 2 sectors seems overly agressive. + // But attempts at improving it have failed ... + + bool okPhi = true; + bool okPhiTrk = true; + + if (useStubPhi_) { + float delPhi = reco::deltaPhi(stub->phi(), phiCentre_); // Phi difference between stub & sector in range -PI to +PI. + float tolerancePhi = stub->phiDiff(chosenRofPhi_, minPt_); // How much stub phi might differ from track phi because of track curvature. + float outsidePhi = fabs(delPhi) - sectorHalfWidth_ - tolerancePhi; // If > 0, then stub is not compatible with being inside this sector. + if (outsidePhi > 0) okPhi = false; + } + + if (useStubPhiTrk_) { + // Estimate either phi0 of track from stub info, or phi of the track at radius chosenRofPhi_. + float phiTrk = stub->trkPhiAtR( chosenRofPhi_ ).first; // N.B. This equals stub->beta() if chosenRofPhi_ = 0. + float delPhiTrk = reco::deltaPhi(phiTrk, phiCentre_); // Phi difference between stub & sector in range -PI to +PI. + float tolerancePhiTrk = assumedPhiTrkRes_ * (2*sectorHalfWidth_); // Set tolerance equal to nominal resolution assumed in phiTrk + if (calcPhiTrkRes_) { + // Calculate uncertainty in phiTrk due to poor resolution in stub bend + float phiTrkRes = stub->trkPhiAtRres( chosenRofPhi_ ); + // Reduce tolerance if this is smaller than the nominal assumed resolution. + tolerancePhiTrk = min(tolerancePhiTrk, phiTrkRes); + } + float outsidePhiTrk = fabs(delPhiTrk) - sectorHalfWidth_ - tolerancePhiTrk; // If > 0, then stub is not compatible with being inside this sector. + + // Modify algorithm to allow for uncertainty due to 2S module strip length, if requested. + if (handleStripsPhiSec_) { + float chosenStubPhiErr = stub->trkPhiAtR( chosenRofPhi_ ).second; // The "Err" here is uncertainty due to 2S strip length. + outsidePhiTrk -= chosenStubPhiErr; + } + + if (outsidePhiTrk > 0) okPhiTrk = false; + } + + return (okPhi && okPhiTrk); +} + +//=== For performance studies, note which stubs on given tracking particle are inside the sector. +//=== Returns two booleans for each stub, indicating if they are in phi & eta sectors respectively. +//=== AND them together to get (eta,phi) sector decision. + +unordered_map > Sector::stubsInside ( const TP& tp) const { + unordered_map > inside; + // Loop over stubs produced by tracking particle + const vector& assStubs= tp.assocStubs(); + for (const Stub* stub: assStubs) { + // Check if this stub is inside sector + inside[stub] = pair(this->insidePhi(stub), this->insideEta(stub)); + } + return inside; +} + +//=== Count number of stubs in given tracking particle which are inside this (phi,eta) sector; +//=== or inside it if only the eta cuts are applied; or inside it if only the phi cuts are applied. +//=== The results are returned as the 3 last arguments of the function. + +void Sector::numStubsInside( const TP& tp, + unsigned int& nStubsInsideEtaPhi, unsigned int& nStubsInsideEta, + unsigned int& nStubsInsidePhi) const +{ + nStubsInsideEtaPhi = 0; + nStubsInsideEta = 0; + nStubsInsidePhi = 0; + for (const auto& iter: this->stubsInside(tp) ) { + bool insidePhi = iter.second.first; + bool insideEta = iter.second.second; + if (insidePhi && insideEta) nStubsInsideEtaPhi++; + if (insideEta) nStubsInsideEta++; + if (insidePhi) nStubsInsidePhi++; + } +} + +// Digitize a floating point number to 2s complement integer, dropping anything after the decimal point. (Kristian Harder) + +Long64_t Sector::forceBitWidth( const float value, const UInt_t nBits) const { + + // slightly hand-waving treatment of 2s complement + Long64_t sign = 1; + if (value<0) sign = -1; + Long64_t iValue = Long64_t(fabs(value)); + Long64_t mask = (Long64_t(1)< 1) throw cms::Exception("Sector::forceBitWidth is messing by using too few bits to digitize number")<<" nBits="<etaRegions()[iEtaReg_] + settings_->etaRegions()[iEtaReg_ + 1]) / 2.0; + float tanlSecMid = 1.0 / tan(2.0*atan(exp(-etaSecMid))); + unsigned int nShiftB = 16; // Chosen by hand so that number digitized below when calculating "tanlSec_Mid" uses most of the nDSPa bits, without overflowing them. This is done assuming reference number of bits for rT and z mentioned above. + nShiftB += (rtBits - rtBitsRef) - (zBits - zBitsRef); // Guess from Ian & Luis to keep "tanlSec_Mid" in correct range (nDSPa) if number of digitsation bits are changed. + float tanlSecBase=1./(1<>nShiftA), nBitsRemainingA); + Long64_t tlsr=forceBitWidth(tanlSec_Mid*r, nDSPa + rBits); // Number of bits is sum of those in two numbers being multiplied. + const unsigned nBitsRemainingB = (nDSPa + rBits) - nShiftB; // Number of useful bits left of (nDSPa + rBits) assigned to "tlsr" after right-shifting by nShiftB bits. + Long64_t shift_tlsr = forceBitWidth((tlsr>>nShiftB), nBitsRemainingB); + + vector insideVec; + insideVec.push_back(z<=(shift_tlsr+shift_g)); + insideVec.push_back(z>=(shift_tlsr-shift_g)); + return insideVec; +} + +} diff --git a/L1Trigger/TrackFindingTMTT/src/Settings.cc b/L1Trigger/TrackFindingTMTT/src/Settings.cc new file mode 100644 index 0000000000000..02b9f5bbbdfc7 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/Settings.cc @@ -0,0 +1,459 @@ +#include +#include "FWCore/Utilities/interface/Exception.h" +#include +#include + +namespace TMTT { + +// Set config params for HYBRID TRACKING via hard-wired consts to allow use outside CMSSW. + +Settings::Settings() { + // + // TMTT related configuration parameters, including Kalman Filter. + // Meaning of these parameters explained in TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py + // + reduceLayerID_=true; + useLayerID_=true; + minFracMatchStubsOnReco_=-99; + minFracMatchStubsOnTP_=-99; + minNumMatchLayers_=4; + minNumMatchPSLayers_=0; + stubMatchStrict_=false; + minStubLayers_=4; + minPtToReduceLayers_=99999.; + deadReduceLayers_=false; + kalmanMinNumStubs_=4; + kalmanMaxNumStubs_=6; + numPhiNonants_=9; + numPhiSectors_=9; + 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}; // Used by KF + kalmanRemove2PScut_=true; + killScenario_=0; + kalmanMaxSkipLayersHard_=1; // On "hard" input tracks + kalmanMaxSkipLayersEasy_=2; // On "easy" input tracks + kalmanMaxStubsEasy_=10; // Max. #stubs an input track can have to be defined "easy" + kalmanMaxStubsPerLayer_=4; // To save resources, consider at most this many stubs per layer per track. + kalmanDebugLevel_=0; + //kalmanDebugLevel_=2; // Good for debugging + enableDigitize_=false; + houghMinPt_=2.0; + chosenRofPhi_=67.240; + chosenRofZ_=50.0; + houghNbinsPt_=48; // Mini HT bins in 2 GeV HT array + handleStripsPhiSec_=1; + useApproxB_=true; + kalmanHOtilted_=true; + kalmanHOhelixExp_=true; + kalmanHOalpha_=1; + kalmanHOdodgy_=false; + kalmanHOprojZcorr_=1; + bApprox_gradient_=0.886454; + bApprox_intercept_=0.504148; + handleStripsEtaSec_=false; + kalmanFillInternalHists_=false; + kalmanMultiScattTerm_=0.00075; + kalmanChi2RphiScale_ = 8; + // + // Cfg params & constants required only for HYBRID tracking (as taken from DB for TMTT). + // + hybrid_=true; + psStripPitch_=0.01; + psNStrips_=960; + psPixelLength_=0.1467; + ssStripPitch_=0.009; + ssNStrips_=1016; + ssStripLength_=5.0250; + zMaxNonTilted_[1] = 15.3; // max z at which non-tilted modules are found in inner 3 barrel layers. + zMaxNonTilted_[2] = 24.6; + zMaxNonTilted_[3] = 33.9; + + bField_=3.81120228767395; + + // Stub digitization params for hybrid (copied from TrackFindingTMTT/interface/HLS/KFconstants.h + double rMult_hybrid = 1. / 0.02929688; + double phiSMult_hybrid = 1. / (7.828293e-6 * 8); + double zMult_hybrid = rMult_hybrid / 2; // In KF VHDL, z/r mult = 1/2, whereas in HLS, they are identical. + // Number of bits copied from TrackFindingTMTT/interface/HLS/KFstub.h (BR1, BPHI, BZ) + rtBits_ = 12; + phiSBits_ = 14; + zBits_ = 14; + rtRange_ = pow(2,rtBits_)/rMult_hybrid; + phiSRange_ = pow(2,phiSBits_)/phiSMult_hybrid; + zRange_ = pow(2,zBits_)/zMult_hybrid; + + if (hybrid_) { + if (not useApproxB_) { + std::cout<<"TMTT Settings Error: module tilt angle unknown, so must set useApproxB = true"< ( "GenCuts" ) ), + stubCuts_ ( iConfig.getParameter< edm::ParameterSet > ( "StubCuts" ) ), + stubDigitize_ ( iConfig.getParameter< edm::ParameterSet > ( "StubDigitize" ) ), + geometricProc_ ( iConfig.getParameter< edm::ParameterSet > ( "GeometricProc" ) ), + phiSectors_ ( iConfig.getParameter< edm::ParameterSet > ( "PhiSectors" ) ), + etaSectors_ ( iConfig.getParameter< edm::ParameterSet > ( "EtaSectors" ) ), + htArraySpecRphi_ ( iConfig.getParameter< edm::ParameterSet > ( "HTArraySpecRphi" ) ), + htFillingRphi_ ( iConfig.getParameter< edm::ParameterSet > ( "HTFillingRphi" ) ), + rzFilterOpts_ ( iConfig.getParameter< edm::ParameterSet > ( "RZfilterOpts" ) ), + l1TrackDef_ ( iConfig.getParameter< edm::ParameterSet > ( "L1TrackDef" ) ), + dupTrkRemoval_ ( iConfig.getParameter< edm::ParameterSet > ( "DupTrkRemoval" ) ), + trackMatchDef_ ( iConfig.getParameter< edm::ParameterSet > ( "TrackMatchDef" ) ), + trackFitSettings_ ( iConfig.getParameter< edm::ParameterSet > ( "TrackFitSettings" ) ), + deadModuleOpts_ ( iConfig.getParameter< edm::ParameterSet > ( "DeadModuleOpts" ) ), + trackDigi_ ( iConfig.getParameter< edm::ParameterSet > ( "TrackDigi" ) ), + + //=== General settings + + enableMCtruth_ ( iConfig.getParameter ( "EnableMCtruth" ) ), + enableHistos_ ( iConfig.getParameter ( "EnableHistos" ) ), + + //=== Cuts on MC truth tracks used for tracking efficiency measurements. + + genMinPt_ ( genCuts_.getParameter ( "GenMinPt" ) ), + genMaxAbsEta_ ( genCuts_.getParameter ( "GenMaxAbsEta" ) ), + genMaxVertR_ ( genCuts_.getParameter ( "GenMaxVertR" ) ), + genMaxVertZ_ ( genCuts_.getParameter ( "GenMaxVertZ" ) ), + genMaxD0_ ( genCuts_.getParameter ( "GenMaxD0" ) ), + genMaxZ0_ ( genCuts_.getParameter ( "GenMaxZ0" ) ), + genMinStubLayers_ ( genCuts_.getParameter ( "GenMinStubLayers" ) ), + + //=== Cuts applied to stubs before arriving in L1 track finding board. + + degradeBendRes_ ( stubCuts_.getParameter ( "DegradeBendRes" ) ), + maxStubEta_ ( stubCuts_.getParameter ( "MaxStubEta" ) ), + killLowPtStubs_ ( stubCuts_.getParameter ( "KillLowPtStubs" ) ), + printStubWindows_ ( stubCuts_.getParameter ( "PrintStubWindows" ) ), + bendResolution_ ( stubCuts_.getParameter ( "BendResolution" ) ), + bendResolutionExtra_ ( stubCuts_.getParameter ( "BendResolutionExtra" ) ), + orderStubsByBend_ ( stubCuts_.getParameter ( "OrderStubsByBend" ) ), + + //=== Optional stub digitization. + + enableDigitize_ ( stubDigitize_.getParameter ( "EnableDigitize" ) ), + + //--- Parameters available in MP board. + phiSectorBits_ ( stubDigitize_.getParameter ( "PhiSectorBits" ) ), + phiSBits_ ( stubDigitize_.getParameter ( "PhiSBits" ) ), + phiSRange_ ( stubDigitize_.getParameter ( "PhiSRange" ) ), + rtBits_ ( stubDigitize_.getParameter ( "RtBits" ) ), + rtRange_ ( stubDigitize_.getParameter ( "RtRange" ) ), + zBits_ ( stubDigitize_.getParameter ( "ZBits" ) ), + zRange_ ( stubDigitize_.getParameter ( "ZRange" ) ), + //--- Parameters available in GP board (excluding any in common with MP specified above). + phiOBits_ ( stubDigitize_.getParameter ( "PhiOBits" ) ), + phiORange_ ( stubDigitize_.getParameter ( "PhiORange" ) ), + bendBits_ ( stubDigitize_.getParameter ( "BendBits" ) ), + + //=== Configuration of Geometric Processor. + useApproxB_ ( geometricProc_.getParameter ( "UseApproxB" ) ), + bApprox_gradient_ ( geometricProc_.getParameter ( "BApprox_gradient" ) ), + bApprox_intercept_ ( geometricProc_.getParameter ( "BApprox_intercept" ) ), + + //=== Division of Tracker into phi sectors. + numPhiNonants_ ( phiSectors_.getParameter ( "NumPhiNonants" ) ), + numPhiSectors_ ( phiSectors_.getParameter ( "NumPhiSectors" ) ), + chosenRofPhi_ ( phiSectors_.getParameter ( "ChosenRofPhi" ) ), + useStubPhi_ ( phiSectors_.getParameter ( "UseStubPhi" ) ), + useStubPhiTrk_ ( phiSectors_.getParameter ( "UseStubPhiTrk" ) ), + assumedPhiTrkRes_ ( phiSectors_.getParameter ( "AssumedPhiTrkRes" ) ), + calcPhiTrkRes_ ( phiSectors_.getParameter ( "CalcPhiTrkRes" ) ), + handleStripsPhiSec_ ( phiSectors_.getParameter ( "HandleStripsPhiSec" ) ), + + //=== Division of Tracker into eta sectors. + etaRegions_ ( etaSectors_.getParameter > ( "EtaRegions" ) ), + chosenRofZ_ ( etaSectors_.getParameter ( "ChosenRofZ" ) ), + beamWindowZ_ ( etaSectors_.getParameter ( "BeamWindowZ" ) ), + handleStripsEtaSec_ ( etaSectors_.getParameter ( "HandleStripsEtaSec" ) ), + allowOver2EtaSecs_ ( etaSectors_.getParameter ( "AllowOver2EtaSecs" ) ), + + //=== r-phi Hough transform array specifications. + houghMinPt_ ( htArraySpecRphi_.getParameter ( "HoughMinPt" ) ), + houghNbinsPt_ ( htArraySpecRphi_.getParameter ( "HoughNbinsPt" ) ), + houghNbinsPhi_ ( htArraySpecRphi_.getParameter ( "HoughNbinsPhi" ) ), + houghNcellsRphi_ ( htArraySpecRphi_.getParameter ( "HoughNcellsRphi" ) ), + enableMerge2x2_ ( htArraySpecRphi_.getParameter ( "EnableMerge2x2" ) ), + maxPtToMerge2x2_ ( htArraySpecRphi_.getParameter ( "MaxPtToMerge2x2" ) ), + numSubSecsEta_ ( htArraySpecRphi_.getParameter ( "NumSubSecsEta" ) ), + shape_ ( htArraySpecRphi_.getParameter ( "Shape" ) ), + miniHTstage_ ( htArraySpecRphi_.getParameter ( "MiniHTstage" ) ), + miniHoughNbinsPt_ ( htArraySpecRphi_.getParameter ( "MiniHoughNbinsPt" ) ), + miniHoughNbinsPhi_ ( htArraySpecRphi_.getParameter ( "MiniHoughNbinsPhi" ) ), + miniHoughMinPt_ ( htArraySpecRphi_.getParameter ( "MiniHoughMinPt" ) ), + miniHoughDontKill_ ( htArraySpecRphi_.getParameter ( "MiniHoughDontKill" ) ), + miniHoughDontKillMinPt_ ( htArraySpecRphi_.getParameter ( "MiniHoughDontKillMinPt" ) ), + miniHoughLoadBalance_ ( htArraySpecRphi_.getParameter ( "MiniHoughLoadBalance" ) ), + + //=== Rules governing how stubs are filled into the r-phi Hough Transform array. + handleStripsRphiHT_ ( htFillingRphi_.getParameter ( "HandleStripsRphiHT" ) ), + killSomeHTCellsRphi_ ( htFillingRphi_.getParameter ( "KillSomeHTCellsRphi" ) ), + useBendFilter_ ( htFillingRphi_.getParameter ( "UseBendFilter" ) ), + maxStubsInCell_ ( htFillingRphi_.getParameter ( "MaxStubsInCell" ) ), + maxStubsInCellMiniHough_( htFillingRphi_.getParameter ( "MaxStubsInCellMiniHough") ), + busySectorKill_ ( htFillingRphi_.getParameter ( "BusySectorKill" ) ), + busySectorNumStubs_ ( htFillingRphi_.getParameter ( "BusySectorNumStubs" ) ), + busySectorMbinRanges_ ( htFillingRphi_.getParameter> ( "BusySectorMbinRanges" ) ), + busySectorMbinOrder_ ( htFillingRphi_.getParameter> ( "BusySectorMbinOrder" ) ), + busyInputSectorKill_ ( htFillingRphi_.getParameter ( "BusyInputSectorKill" ) ), + busyInputSectorNumStubs_( htFillingRphi_.getParameter ( "BusyInputSectorNumStubs") ), + muxOutputsHT_ ( htFillingRphi_.getParameter ( "MuxOutputsHT" ) ), + etaRegWhitelist_ ( htFillingRphi_.getParameter< vector > ( "EtaRegWhitelist" ) ), + + //=== Options controlling r-z track filters (or any other track filters run after the Hough transform, as opposed to inside it). + + rzFilterName_ ( rzFilterOpts_.getParameter ( "RZFilterName" ) ), + seedResolution_ ( rzFilterOpts_.getParameter ( "SeedResolution" ) ), + keepAllSeed_ ( rzFilterOpts_.getParameter ( "KeepAllSeed" ) ), + maxSeedCombinations_ ( rzFilterOpts_.getParameter ( "MaxSeedCombinations" ) ), + maxGoodSeedCombinations_( rzFilterOpts_.getParameter ( "MaxGoodSeedCombinations") ), + maxSeedsPerStub_ ( rzFilterOpts_.getParameter ( "MaxSeedsPerStub" ) ), + zTrkSectorCheck_ ( rzFilterOpts_.getParameter ( "zTrkSectorCheck" ) ), + minFilterLayers_ ( rzFilterOpts_.getParameter ( "MinFilterLayers" ) ), + + //=== Rules for deciding when the track finding has found an L1 track candidate + + minStubLayers_ ( l1TrackDef_.getParameter ( "MinStubLayers" ) ), + minPtToReduceLayers_ ( l1TrackDef_.getParameter ( "MinPtToReduceLayers" ) ), + etaSecsReduceLayers_ ( l1TrackDef_.getParameter> ( "EtaSecsReduceLayers" ) ), + useLayerID_ ( l1TrackDef_.getParameter ( "UseLayerID" ) ), + reduceLayerID_ ( l1TrackDef_.getParameter ( "ReducedLayerID" ) ), + + //=== Specification of algorithm to eliminate duplicate tracks. + + dupTrkAlgRphi_ ( dupTrkRemoval_.getParameter ( "DupTrkAlgRphi" ) ), + dupTrkAlg3D_ ( dupTrkRemoval_.getParameter ( "DupTrkAlg3D" ) ), + dupTrkAlgFit_ ( dupTrkRemoval_.getParameter ( "DupTrkAlgFit" ) ), + dupTrkMinCommonHitsLayers_ ( dupTrkRemoval_.getParameter ( "DupTrkMinCommonHitsLayers" ) ), + + //=== Rules for deciding when a reconstructed L1 track matches a MC truth particle (i.e. tracking particle). + + minFracMatchStubsOnReco_( trackMatchDef_.getParameter ( "MinFracMatchStubsOnReco") ), + minFracMatchStubsOnTP_ ( trackMatchDef_.getParameter ( "MinFracMatchStubsOnTP" ) ), + minNumMatchLayers_ ( trackMatchDef_.getParameter ( "MinNumMatchLayers" ) ), + minNumMatchPSLayers_ ( trackMatchDef_.getParameter ( "MinNumMatchPSLayers" ) ), + stubMatchStrict_ ( trackMatchDef_.getParameter ( "StubMatchStrict" ) ), + + //=== Track Fitting Settings + + trackFitters_ ( trackFitSettings_.getParameter> ( "TrackFitters" ) ), + useRZfilter_ ( trackFitSettings_.getParameter> ( "UseRZfilter" ) ), + detailedFitOutput_ ( trackFitSettings_.getParameter < bool > ( "DetailedFitOutput" ) ), + trackFitCheat_ ( trackFitSettings_.getParameter < bool > ( "TrackFitCheat" ) ), + // + numTrackFitIterations_ ( trackFitSettings_.getParameter ( "NumTrackFitIterations" ) ), + killTrackFitWorstHit_ ( trackFitSettings_.getParameter ( "KillTrackFitWorstHit" ) ), + generalResidualCut_ ( trackFitSettings_.getParameter ( "GeneralResidualCut" ) ), + killingResidualCut_ ( trackFitSettings_.getParameter ( "KillingResidualCut" ) ), + maxIterationsLR_ ( trackFitSettings_.getParameter ( "MaxIterationsLR" ) ), + LRFillInternalHists_ ( trackFitSettings_.getParameter ( "LRFillInternalHists" ) ), + combineResiduals_ ( trackFitSettings_.getParameter< bool > ( "CombineResiduals" ) ), + lineariseStubPosition_ ( trackFitSettings_.getParameter< bool > ( "LineariseStubPosition" ) ), + checkSectorConsistency_ ( trackFitSettings_.getParameter< bool > ( "CheckSectorConsistency" ) ), + checkHTCellConsistency_ ( trackFitSettings_.getParameter< bool > ( "CheckHTCellConsistency" ) ), + minPSLayers_ ( trackFitSettings_.getParameter< unsigned int > ( "MinPSLayers" ) ), + digitizeLR_ ( trackFitSettings_.getParameter< bool > ( "DigitizeLR" ) ), + PhiPrecision_ ( trackFitSettings_.getParameter< double > ( "PhiPrecision" ) ), + RPrecision_ ( trackFitSettings_.getParameter< double > ( "RPrecision" ) ), + ZPrecision_ ( trackFitSettings_.getParameter< double > ( "ZPrecision" ) ), + ZSlopeWidth_ ( trackFitSettings_.getParameter< unsigned int > ( "ZSlopeWidth" ) ), + ZInterceptWidth_ ( trackFitSettings_.getParameter< unsigned int > ( "ZInterceptWidth" ) ), + // + digitizeSLR_ ( trackFitSettings_.getParameter ( "DigitizeSLR" ) ), + dividerBitsHelix_ ( trackFitSettings_.getParameter ( "DividerBitsHelix" ) ), + dividerBitsHelixZ_ ( trackFitSettings_.getParameter ( "DividerBitsHelixZ" ) ), + ShiftingBitsDenRPhi_ ( trackFitSettings_.getParameter ( "ShiftingBitsDenRPhi" ) ), + ShiftingBitsDenRZ_ ( trackFitSettings_.getParameter ( "ShiftingBitsDenRZ" ) ), + ShiftingBitsPt_ ( trackFitSettings_.getParameter ( "ShiftingBitsPt" ) ), + ShiftingBitsPhi_ ( trackFitSettings_.getParameter ( "ShiftingBitsPhi" ) ), + + ShiftingBitsLambda_ ( trackFitSettings_.getParameter ( "ShiftingBitsLambda" ) ), + ShiftingBitsZ0_ ( trackFitSettings_.getParameter ( "ShiftingBitsZ0" ) ), + slr_chi2cut_ ( trackFitSettings_.getParameter ( "SLR_chi2cut" ) ), + residualCut_ ( trackFitSettings_.getParameter ( "ResidualCut" ) ), + // + kalmanDebugLevel_ ( trackFitSettings_.getParameter ( "KalmanDebugLevel" ) ), + kalmanFillInternalHists_ ( trackFitSettings_.getParameter ( "KalmanFillInternalHists") ), + kalmanMinNumStubs_ ( trackFitSettings_.getParameter ( "KalmanMinNumStubs" ) ), + kalmanMaxNumStubs_ ( trackFitSettings_.getParameter ( "KalmanMaxNumStubs" ) ), + kalmanAddBeamConstr_ ( trackFitSettings_.getParameter ( "KalmanAddBeamConstr" ) ), + kalmanRemove2PScut_ ( trackFitSettings_.getParameter ( "KalmanRemove2PScut" ) ), + kalmanMaxSkipLayersHard_ ( trackFitSettings_.getParameter ( "KalmanMaxSkipLayersHard") ), + kalmanMaxSkipLayersEasy_ ( trackFitSettings_.getParameter ( "KalmanMaxSkipLayersEasy") ), + kalmanMaxStubsEasy_ ( trackFitSettings_.getParameter ( "KalmanMaxStubsEasy" ) ), + kalmanMaxStubsPerLayer_ ( trackFitSettings_.getParameter ( "KalmanMaxStubsPerLayer" ) ), + kalmanMultiScattTerm_ ( trackFitSettings_.getParameter ( "KalmanMultiScattTerm" ) ), + kalmanChi2RphiScale_ ( trackFitSettings_.getParameter ( "KalmanChi2RphiScale" ) ), + kalmanHOtilted_ ( trackFitSettings_.getParameter ( "KalmanHOtilted" ) ), + kalmanHOhelixExp_ ( trackFitSettings_.getParameter ( "KalmanHOhelixExp" ) ), + kalmanHOalpha_ ( trackFitSettings_.getParameter ( "KalmanHOalpha" ) ), + kalmanHOprojZcorr_ ( trackFitSettings_.getParameter ( "KalmanHOprojZcorr" ) ), + kalmanHOdodgy_ ( trackFitSettings_.getParameter ( "KalmanHOdodgy" ) ), + + //=== Treatment of dead modules. + + deadReduceLayers_ (deadModuleOpts_.getParameter ( "DeadReduceLayers" ) ), + deadSimulateFrac_ (deadModuleOpts_.getParameter ( "DeadSimulateFrac" ) ), + killScenario_ (deadModuleOpts_.getParameter ( "KillScenario" ) ), + killRecover_ (deadModuleOpts_.getParameter ( "KillRecover" ) ), + + //=== Track digitisation configuration for various track fitters + + slr_skipTrackDigi_ (trackDigi_.getParameter ( "SLR_skipTrackDigi" ) ), + slr_oneOver2rBits_ (trackDigi_.getParameter ( "SLR_oneOver2rBits" ) ), + slr_oneOver2rRange_ (trackDigi_.getParameter ( "SLR_oneOver2rRange" ) ), + slr_d0Bits_ (trackDigi_.getParameter ( "SLR_d0Bits" ) ), + slr_d0Range_ (trackDigi_.getParameter ( "SLR_d0Range" ) ), + slr_phi0Bits_ (trackDigi_.getParameter ( "SLR_phi0Bits" ) ), + slr_phi0Range_ (trackDigi_.getParameter ( "SLR_phi0Range" ) ), + slr_z0Bits_ (trackDigi_.getParameter ( "SLR_z0Bits" ) ), + slr_z0Range_ (trackDigi_.getParameter ( "SLR_z0Range" ) ), + slr_tanlambdaBits_ (trackDigi_.getParameter ( "SLR_tanlambdaBits" ) ), + slr_tanlambdaRange_ (trackDigi_.getParameter ( "SLR_tanlambdaRange" ) ), + slr_chisquaredBits_ (trackDigi_.getParameter ( "SLR_chisquaredBits" ) ), + slr_chisquaredRange_ (trackDigi_.getParameter ( "SLR_chisquaredRange" ) ), + // + kf_skipTrackDigi_ (trackDigi_.getParameter ( "KF_skipTrackDigi" ) ), + kf_oneOver2rBits_ (trackDigi_.getParameter ( "KF_oneOver2rBits" ) ), + kf_oneOver2rRange_ (trackDigi_.getParameter ( "KF_oneOver2rRange" ) ), + kf_d0Bits_ (trackDigi_.getParameter ( "KF_d0Bits" ) ), + kf_d0Range_ (trackDigi_.getParameter ( "KF_d0Range" ) ), + kf_phi0Bits_ (trackDigi_.getParameter ( "KF_phi0Bits" ) ), + kf_phi0Range_ (trackDigi_.getParameter ( "KF_phi0Range" ) ), + kf_z0Bits_ (trackDigi_.getParameter ( "KF_z0Bits" ) ), + kf_z0Range_ (trackDigi_.getParameter ( "KF_z0Range" ) ), + kf_tanlambdaBits_ (trackDigi_.getParameter ( "KF_tanlambdaBits" ) ), + kf_tanlambdaRange_ (trackDigi_.getParameter ( "KF_tanlambdaRange" ) ), + kf_chisquaredBits_ (trackDigi_.getParameter ( "KF_chisquaredBits" ) ), + kf_chisquaredRange_ (trackDigi_.getParameter ( "KF_chisquaredRange" ) ), + kf_chisquaredBinEdges_ (trackDigi_.getParameter > ( "KF_chisquaredBinEdges" ) ), + // + other_skipTrackDigi_ (trackDigi_.getParameter ( "Other_skipTrackDigi" ) ), + + // Debug printout + debug_ ( iConfig.getParameter ( "Debug" ) ), + resPlotOpt_ ( iConfig.getParameter ( "ResPlotOpt" ) ), + iPhiPlot_ ( iConfig.getParameter ( "iPhiPlot" ) ), + iEtaPlot_ ( iConfig.getParameter ( "iEtaPlot" ) ), + + // Name of output EDM file if any. + // N.B. This parameter does not appear inside TMTrackProducer_Defaults_cfi.py . It is created inside + // tmtt_tf_analysis_cfg.py . + writeOutEdmFile_ ( iConfig.getUntrackedParameter ( "WriteOutEdmFile", true) ), + + // Bfield in Tesla. (Unknown at job initiation. Set to true value for each event + bField_ (0.), + + // Hybrid tracking + hybrid_ ( iConfig.getParameter ( "Hybrid" ) ), + psStripPitch_ (0.), + psNStrips_ (0.), + psPixelLength_ (0.), + ssStripPitch_ (0.), + ssNStrips_ (0.), + ssStripLength_ (0.) +{ + // If user didn't specify any PDG codes, use e,mu,pi,K,p, to avoid picking up unstable particles like Xi-. + vector genPdgIdsUnsigned( genCuts_.getParameter > ( "GenPdgIds" ) ); + if (genPdgIdsUnsigned.empty()) { + genPdgIdsUnsigned = {11, 13, 211, 321, 2212}; + } + + // For simplicity, user need not distinguish particles from antiparticles in configuration file. + // But here we must store both explicitely in Settings, since TrackingParticleSelector expects them. + for (unsigned int i = 0; i < genPdgIdsUnsigned.size(); i++) { + genPdgIds_.push_back( genPdgIdsUnsigned[i] ); + genPdgIds_.push_back( -genPdgIdsUnsigned[i] ); + } + + // Clean up list of fitters that require the r-z track filter to be run before them, + // by removing those fitters that are not to be run. + vector useRZfilterTmp; + for (const string& name : useRZfilter_) { + if (std::count(trackFitters_.begin(), trackFitters_.end(), name) > 0) useRZfilterTmp.push_back(name); + } + useRZfilter_ = useRZfilterTmp; + + //--- Sanity checks + + if ( ! (useStubPhi_ || useStubPhiTrk_) ) throw cms::Exception("Settings.cc: Invalid cfg parameters - You cant set both UseStubPhi & useStubPhiTrk to false."); + + if (minNumMatchLayers_ > minStubLayers_) throw cms::Exception("Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type A."); + if (genMinStubLayers_ > minStubLayers_) throw cms::Exception("Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type B."); + if (minNumMatchLayers_ > genMinStubLayers_) throw cms::Exception("Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type C."); + + // If reducing number of required layers for high Pt tracks, then above checks must be redone. + bool doReduceLayers = (minPtToReduceLayers_ < 10000. || etaSecsReduceLayers_.size() > 0) ; + if (doReduceLayers && minStubLayers_ > 4) { + if (minNumMatchLayers_ > minStubLayers_ - 1) throw cms::Exception("Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type D."); + if (genMinStubLayers_ > minStubLayers_ - 1) throw cms::Exception("Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type E."); + } + + for (const unsigned int& iEtaReg : etaSecsReduceLayers_) { + if (iEtaReg >= etaRegions_.size()) throw cms::Exception("Settings.cc: You specified an eta sector number in EtaSecsReduceLayers which exceeds the total number of eta sectors!")< mOrderCheck; + for (const unsigned int& m : busySectorMbinOrder_) { + mOrderCheck.insert(m); + } + if (mOrderCheck.size() != houghNbinsPt_) throw cms::Exception("Settings.cc: Invalid cfg parameters - BusySectorMbinOrder used by HT MUX contains duplicate elements."); + unsigned int sum_nr = 0; + for (unsigned int nr : busySectorMbinRanges_) { + sum_nr += nr; + } + if (sum_nr != houghNbinsPt_) throw cms::Exception("Settings.cc: Invalid cfg parameters - Sum of entries in BusySectorMbinRanges is incorrect."); + } + + if (miniHTstage_) { + if (enableMerge2x2_) throw cms::Exception("Settings.cc: it is not allowed to enable both MiniHTstage & EnableMerge2x2 options."); + // Options for 2nd stage mini HT + if (shape_ != 0) throw cms::Exception("Settings.cc: Invalid cfg parameters - 2nd stage mini HT only allowed for square-shaped cells."); + if (miniHoughNbinsPt_ != 2 || miniHoughNbinsPhi_ != 2) throw cms::Exception("Settings.cc: 2nd mini HT has so dar only been implemented in C++ for 2x2."); + } + + if (enableMerge2x2_) { + if (miniHTstage_) throw cms::Exception("Settings.cc: it is not allowed to enable both MiniHTstage & EnableMerge2x2 options."); + // Merging of HT cells has not yet been implemented for diamond or hexagonal HT cell shape. + if (enableMerge2x2_ && shape_ != 0) throw cms::Exception("Settings.cc: Invalid cfg parameters - merging only allowed for square-shaped cells."); + } + + // Do not use our private dead module emulation together with the communal Tracklet/TMTT dead module emulation + // developed for the Stress Test. + if (deadSimulateFrac_ > 0. && killScenario_ > 0) throw cms::Exception("Settings.cc: Invalid cfg parameters - don't enable both DeadSimulateFrac and KillScenario"); + + // Check Kalman fit params. + if (kalmanMaxNumStubs_ < kalmanMinNumStubs_) throw cms::Exception("Settings.cc: Invalid cfg parameters - KalmanMaxNumStubs is less than KalmanMaxNumStubs."); +} + + +bool Settings::isHTRPhiEtaRegWhitelisted(unsigned const iEtaReg) const +{ + bool whitelisted = true; + + bool const whitelist_enabled = ( ! etaRegWhitelist_.empty() ); + if (whitelist_enabled) { + whitelisted = (std::count(etaRegWhitelist_.begin(), etaRegWhitelist_.end(), iEtaReg) > 0); + } + + return whitelisted; +} + +} diff --git a/L1Trigger/TrackFindingTMTT/src/SimpleLR.cc b/L1Trigger/TrackFindingTMTT/src/SimpleLR.cc new file mode 100644 index 0000000000000..dd55c34a890ff --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/SimpleLR.cc @@ -0,0 +1,464 @@ +///=== This is the global Linear Regression for 4 helix parameters track fit algorithm. + +///=== Written by: Davide Cieri + +#include "L1Trigger/TrackFindingTMTT/interface/SimpleLR.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" + +#include "DataFormats/Math/interface/deltaPhi.h" +#include +#include +#include +#include + +using namespace TMTT; + +static bool pair_compare( std::pair a, std::pair b) +{ + return ( a.second < b.second); +} + +// Initialize some parameters +void SimpleLR::initRun(){ + phiMult_ = pow(2., settings_->phiSBits())/settings_->phiSRange(); + rTMult_ = pow(2., settings_->rtBits())/settings_->rtRange(); + zMult_ = pow(2., settings_->zBits())/settings_->zRange(); + z0Mult_ = pow(2., settings_->slr_z0Bits())/settings_->slr_z0Range(); + phiTMult_ = pow(2., settings_->slr_phi0Bits())/settings_->slr_phi0Range(); + + qOverPtMult_ = pow(2.,settings_->slr_oneOver2rBits())/settings_->slr_oneOver2rRange(); + tanLambdaMult_ = pow(2.,settings_->slr_tanlambdaBits())/settings_->slr_tanlambdaRange(); + chi2Mult_ = pow(2.,settings_->slr_chisquaredBits())/settings_->slr_chisquaredRange(); + + numeratorPtMult_ = rTMult_*phiMult_; + numeratorPhiMult_ = rTMult_*rTMult_*phiMult_; + numeratorZ0Mult_ = rTMult_*rTMult_*z0Mult_; + numeratorLambdaMult_ = rTMult_*z0Mult_; + denominatorMult_ = rTMult_*rTMult_; + resMult_ = rTMult_*qOverPtMult_; + + digitize_ = settings_->digitizeSLR() and settings_->enableDigitize(); + dividerBitsHelix_ = settings_->dividerBitsHelix(); + dividerBitsHelixZ_ = settings_->dividerBitsHelixZ(); + shiftingBitsDenRPhi_ = settings_->ShiftingBitsDenRPhi(); + shiftingBitsDenRZ_ = settings_->ShiftingBitsDenRZ(); + + shiftingBitsPhi_ = settings_->ShiftingBitsPhi(); + shiftingBitsz0_ = settings_->ShiftingBitsZ0(); + shiftingBitsPt_ = settings_->ShiftingBitsPt(); + shiftingBitsLambda_ = settings_->ShiftingBitsLambda(); + + phiSectorWidth_ = 2.*M_PI / float(settings_->numPhiSectors()); + phiNonantWidth_ = 2.*M_PI / float(settings_->numPhiNonants()); + + chi2cut_ = settings_->slr_chi2cut(); + invPtToDPhi_ = - settings_->invPtToDphi(); + chosenRofPhi_ = settings_->chosenRofPhi(); + if(digitize_) chosenRofPhi_ = floor(chosenRofPhi_*rTMult_)/rTMult_; + +} + + +L1fittedTrack SimpleLR::fit( const L1track3D& l1track3D) { + if(settings_->debug()==6) cout << "=============== FITTING TRACK ====================" << endl; + + double phiCentreSec0 = -0.5*phiNonantWidth_ + 0.5*phiSectorWidth_; + phiSectorCentre_ = phiSectorWidth_ * double(l1track3D.iPhiSec()) - phiCentreSec0; + + if(digitize_) phiSectorCentre_ = floor(phiSectorCentre_*phiTMult_)/phiTMult_; + + // Inizialise track fit parameters + double qOverPt = 0.; + double phiT = 0.; + double phi0 = 0.; + double z0 = 0.; + double zT = 0.; + double tanLambda = 0.; + + // Inizialise Sums + double SumRPhi = 0.; + double SumR = 0.; + double SumPhi = 0.; + double SumR2 = 0.; + double SumRZ = 0.; + double SumZ = 0.; + + unsigned int numStubs = 0; + // Calc helix parameters on Rphi Plane (STEP 1) + // This loop calculates the sums needed to calculate the numerators and the denominator to compute the helix parameters in the R-Phi plane (q/pT, phiT) + for(const Stub* stub : l1track3D.getStubs()){ + // if((const_cast(stub))->psModule()){ + numStubs++; + + if(digitize_){ + (const_cast(stub))->digitizeForHTinput(l1track3D.iPhiSec()); + (const_cast(stub))->digitizeForSFinput(); + const DigitalStub digiStub = (const_cast(stub))->digitalStub(); + + SumRPhi = SumRPhi + digiStub.rt()*digiStub.phiS(); + SumR = SumR + digiStub.rt(); + SumPhi = SumPhi + digiStub.phiS(); + SumR2 = SumR2 + digiStub.rt()*digiStub.rt(); + if(settings_->debug() == 6) cout << "phiS " << digiStub.iDigi_PhiS() << " rT " << digiStub.iDigi_Rt() << " z "<< digiStub.iDigi_Z()<< endl; + } else{ + float phi = 0; + if(l1track3D.iPhiSec() == 0 and (const_cast(stub))->phi() > 0){ + phi = (const_cast(stub))->phi() - 2*M_PI; + } else if(l1track3D.iPhiSec() == settings_->numPhiSectors() and (const_cast(stub))->phi() < 0){ + phi = (const_cast(stub))->phi() + 2*M_PI; + } else{ + phi = (const_cast(stub))->phi(); + } + SumRPhi = SumRPhi + (const_cast(stub))->r()*phi; + SumR = SumR + (const_cast(stub))->r(); + SumPhi = SumPhi + phi; + SumR2 = SumR2 + (const_cast(stub))->r()*(const_cast(stub))->r(); + if(settings_->debug() == 6) cout << "phi " << phi << " r " << (const_cast(stub))->r() << " z "<< (const_cast(stub))->z()<< endl; + } + // } + } + + double numeratorPt, digiNumeratorPt; + double denominator, digiDenominator; + double numeratorPhi, digiNumeratorPhi; + double reciprocal, digiReciprocal; + double numeratorZ0, digiNumeratorZ0 ; + double numeratorLambda, digiNumeratorLambda ; + + digiNumeratorPt = (numStubs*SumRPhi - SumR*SumPhi); + digiDenominator = (numStubs*SumR2 - SumR*SumR); + digiNumeratorPhi = ( SumR2 * SumPhi - SumR*SumRPhi); + + if(!digitize_){ + qOverPt = (numStubs*SumRPhi - SumR*SumPhi)/(numStubs*SumR2 - SumR*SumR); + phi0 = ( SumR2 * SumPhi - SumR*SumRPhi )/(numStubs*SumR2 - SumR*SumR); + } else{ + digiNumeratorPt /= pow(2., shiftingBitsPt_); + digiNumeratorPt = floor(digiNumeratorPt*numeratorPtMult_); + numeratorPt = digiNumeratorPt/numeratorPtMult_; + + digiNumeratorPhi /= pow(2., shiftingBitsPhi_); + digiNumeratorPhi = floor(digiNumeratorPhi*numeratorPhiMult_); + numeratorPhi = digiNumeratorPhi/numeratorPhiMult_; + + digiDenominator /= pow(2., shiftingBitsDenRPhi_) ; + digiDenominator = (floor(digiDenominator*denominatorMult_)+0.5); + denominator = digiDenominator/denominatorMult_; + digiReciprocal = (pow(2.,dividerBitsHelix_)-1)/(denominator); // To be moved + digiReciprocal = floor(digiReciprocal/denominatorMult_); + reciprocal = digiReciprocal*denominatorMult_; + + + qOverPt = numeratorPt*reciprocal/pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPt_); + phiT = numeratorPhi*reciprocal/pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPhi_); + + qOverPt = floor(qOverPt*qOverPtMult_)/(qOverPtMult_); + phiT = floor(phiT*phiTMult_)/phiTMult_; + } + + if(settings_->debug() == 6 and digitize_) cout << setw(10) << "First Helix parameters: qOverPt = "<< qOverPt << " ("<< floor(qOverPt*qOverPtMult_) << "), phiT = "<< phiT <<" ("<< floor(phiT*phiTMult_)<<") "<< endl; + + if(settings_->debug() == 6 and !digitize_) cout << "First Helix Parameters: qOverPt = "<< qOverPt << " phi0 "<< phi0 << endl; + + + // ================== RESIDUAL CALCULATION ON RPHI ======================== + std::vector > vRes; + unsigned int psStubs = 0; + for(const Stub* stub : l1track3D.getStubs()){ + if((const_cast(stub))->psModule()) psStubs++; + double ResPhi; + + + if(digitize_){ + (const_cast(stub))->digitizeForHTinput(l1track3D.iPhiSec()); + (const_cast(stub))->digitizeForSFinput(); + const DigitalStub digiStub = (const_cast(stub))->digitalStub(); + + ResPhi = digiStub.iDigi_PhiS()*pow(2., shiftingBitsDenRPhi_- shiftingBitsPt_) - floor(phiT*phiTMult_)*pow(2., shiftingBitsDenRPhi_- shiftingBitsPt_ - settings_->slr_phi0Bits() + settings_->phiSBits() ) - floor(qOverPt*qOverPtMult_)*digiStub.iDigi_Rt(); + + + if(settings_->debug() == 6) { + // cout << "floor(phiT*phiTMult_) " << floor(phiT*phiTMult_) << endl; + // cout << "dsp_PhiSPhiT "<< digiStub.iDigi_PhiS() - floor(phiT*phiTMult_) << " shift_right(dsp_QoverPt_Rt,divider_shift- divider_pt) "<< floor(qOverPt*qOverPtMult_)*digiStub.iDigi_Rt()/(pow(2., ShiftingBits_- shiftingBitsPt_ ) )<< " settings_->rtRange() "<< settings_->rtRange() << endl; + cout << "DIGI RESIDUAL "<< ResPhi << endl;} + ResPhi = floor(ResPhi)/resMult_; + } + + else{ + ResPhi = reco::deltaPhi((const_cast(stub))->phi(), phi0 + qOverPt*(const_cast(stub))->r()); + } + + double Res = fabs(ResPhi) ; + // if(digitize_) Res = floor(Res*phiMult_)/phiMult_; + + std::pair< const Stub*, double > ResStubPair (stub, Res); + vRes.push_back(ResStubPair); + if(settings_->debug()==6){ + if(const_cast(stub)->assocTP()!= nullptr) cout << " Stub Residual " << Res << " TP " << const_cast(stub)->assocTP()->index() << endl; + else cout << " Stub Residual " << Res << " TP nullptr" << endl; + } + } + + double LargResidual = 9999.; + // Find largest residuals + while(vRes.size() > 4 and LargResidual > settings_->ResidualCut() ){ + std::vector >::iterator maxResIt = max_element(vRes.begin(), vRes.end(), pair_compare ); + LargResidual = (*maxResIt).second; + if(settings_->debug() == 6) cout << "Largest Residual "<< LargResidual << endl; + + if(LargResidual > settings_->ResidualCut()){ + if((*maxResIt).first->psModule()){ + if(psStubs > 2){ + if(settings_->debug() == 6) cout << "removing PS residual "<< (*maxResIt).second << endl; + vRes.erase(maxResIt); + psStubs--; + } else{ + if(settings_->debug() == 6) cout << "residual "<< (*maxResIt).second << " set to -1. "<< endl; + (*maxResIt).second = -1.; + + } + } else{ + vRes.erase(maxResIt); + if(settings_->debug() == 6) cout << "removing residual "<< (*maxResIt).second << endl; + } + } + + + } + + + + std::vector fitStubs; + for( std::pair< const Stub*, double > ResStubPair : vRes ){ + fitStubs.push_back(ResStubPair.first); + } + + phiT = 0.; + zT = 0.; + + SumRPhi = 0.; + SumR = 0.; + SumPhi = 0.; + SumR2 = 0.; + SumRZ = 0.; + SumZ = 0.; + double SumR_ps = 0.; + double SumR2_ps = 0.; + + numStubs = 0; + psStubs = 0; + + for(const Stub* stub : fitStubs){ + if((const_cast(stub))->psModule()) + psStubs++; + + numStubs++; + if(digitize_){ + (const_cast(stub))->digitizeForHTinput(l1track3D.iPhiSec()); + // (const_cast(stub))->digitizeForSFinput(); + const DigitalStub digiStub = (const_cast(stub))->digitalStub(); + SumRPhi += digiStub.rt()*digiStub.phiS(); + SumR += digiStub.rt(); + SumPhi += digiStub.phiS(); + SumR2 += digiStub.rt()*digiStub.rt(); + if((const_cast(stub))->psModule() ){ + SumRZ += digiStub.rt()*digiStub.z(); + SumZ += digiStub.z(); + SumR_ps += digiStub.rt(); + SumR2_ps += digiStub.rt()*digiStub.rt(); + } + if(settings_->debug() == 6) { + cout << "phiS " << digiStub.iDigi_PhiS() << " rT " << digiStub.iDigi_Rt() << " z "<< digiStub.iDigi_Z()<< endl; + } + } else{ + + float phi = 0; + if(l1track3D.iPhiSec() == 0 and (const_cast(stub))->phi() > 0){ + phi = (const_cast(stub))->phi() - 2*M_PI; + } else if(l1track3D.iPhiSec() == settings_->numPhiSectors() and (const_cast(stub))->phi() < 0){ + phi = (const_cast(stub))->phi() + 2*M_PI; + } else{ + phi = (const_cast(stub))->phi(); + } + + SumRPhi += (const_cast(stub))->r()*phi; + SumR += (const_cast(stub))->r(); + SumPhi += phi; + SumR2 += (const_cast(stub))->r()*(const_cast(stub))->r(); + if((const_cast(stub))->psModule() ){ + SumRZ += (const_cast(stub))->r()*(const_cast(stub))->z(); + SumZ += (const_cast(stub))->z(); + SumR_ps += (const_cast(stub))->r(); + SumR2_ps += (const_cast(stub))->r()*(const_cast(stub))->r(); + + } + if(settings_->debug() == 6) cout << "phi " << phi << " r " << (const_cast(stub))->r() << " z "<< (const_cast(stub))->z()<< endl; } + + // } + } + + numeratorZ0 = (SumR2_ps * SumZ - SumR_ps*SumRZ); + numeratorLambda = (psStubs*SumRZ - SumR_ps*SumZ); + numeratorPt = (numStubs*SumRPhi - SumR*SumPhi); + denominator = (numStubs*SumR2 - SumR*SumR); + double denominatorZ = (psStubs*SumR2_ps - SumR_ps*SumR_ps); + numeratorPhi = ( SumR2 * SumPhi - SumR*SumRPhi ); + double reciprocalZ ; + if(!digitize_){ + z0 = numeratorZ0/denominatorZ; + tanLambda = numeratorLambda/denominatorZ; + qOverPt = (numStubs*SumRPhi - SumR*SumPhi)/(numStubs*SumR2 - SumR*SumR); + phi0 = ( SumR2 * SumPhi - SumR*SumRPhi )/(numStubs*SumR2 - SumR*SumR); + } else{ + numeratorPt /= pow(2., shiftingBitsPt_); + numeratorPt = floor(numeratorPt*numeratorPtMult_)/numeratorPtMult_; + + numeratorPhi /= pow(2., shiftingBitsPhi_); + numeratorPhi = floor(numeratorPhi*numeratorPhiMult_)/numeratorPhiMult_; + + numeratorLambda /= pow(2., shiftingBitsLambda_); + numeratorLambda = floor(numeratorLambda*numeratorLambdaMult_)/numeratorLambdaMult_; + + numeratorZ0 /= pow(2., shiftingBitsz0_); + numeratorZ0 = floor(numeratorZ0*numeratorZ0Mult_)/numeratorZ0Mult_; + + denominator /= pow(2., shiftingBitsDenRPhi_); + denominator = (floor(denominator*denominatorMult_)+0.5)/denominatorMult_; + reciprocal = (pow(2.,dividerBitsHelix_)-1)/(denominator); + reciprocal = floor(reciprocal/denominatorMult_)*denominatorMult_; + + denominatorZ /= pow(2., shiftingBitsDenRZ_); + denominatorZ = (floor(denominatorZ*denominatorMult_)+0.5)/denominatorMult_; + reciprocalZ = (pow(2.,dividerBitsHelixZ_)-1)/(denominatorZ); + reciprocalZ = floor(reciprocalZ/denominatorMult_)*denominatorMult_; + + qOverPt = numeratorPt*reciprocal/pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPt_); + phiT = numeratorPhi*reciprocal/pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPhi_); + + tanLambda = numeratorLambda*reciprocalZ/pow(2., dividerBitsHelixZ_ + shiftingBitsDenRZ_ - shiftingBitsLambda_); + zT = numeratorZ0*reciprocalZ/pow(2., dividerBitsHelixZ_ + shiftingBitsDenRZ_ - shiftingBitsz0_); + + phi0 = phiSectorCentre_ + phiT - qOverPt*settings_->chosenRofPhi(); + z0 = zT - tanLambda*settings_->chosenRofPhi(); + + qOverPt = floor(qOverPt*qOverPtMult_)/qOverPtMult_; + phiT = floor(phiT*phiTMult_)/phiTMult_; + } + + // cout << "z0" + + // qOverPt /= -invPtToDPhi_; + + + if(settings_->debug() == 6 and digitize_) { + cout << "HT mbin "<< int(l1track3D.getCellLocationHT().first) - 16 << " cbin "<< int(l1track3D.getCellLocationHT().second) - 32 << " iPhi "<< l1track3D.iPhiSec() << " iEta "<< l1track3D.iEtaReg() << endl; + cout << "Second Helix variables: numeratorPt = "<< numeratorPt << ", numeratorPhi = "<< numeratorPhi <<", numeratorZ0 = " << numeratorZ0 <<" numeratorLambda = " << numeratorLambda << " denominator = "<< denominator <<" reciprocal = "<< reciprocal << " denominatorZ = "<< denominatorZ <<" reciprocalZ = "<< reciprocalZ << endl; + cout << setw(10) << "Final Helix parameters: qOverPt = "<< qOverPt << " ("<< floor(qOverPt*qOverPtMult_) << "), phiT = "<< phiT <<" ("<< floor(phiT*phiTMult_)<<"), zT = "<< zT << " ("<debug() == 6 ){ + cout << setw(10) << "Final Helix parameters: qOverPt = "<< qOverPt <<", phi0 = "<< phi0 <<", z0 = "<< z0 << ", tanLambda = "<(stub))->digitizeForHTinput(l1track3D.iPhiSec()); + (const_cast(stub))->digitizeForSFinput(); + const DigitalStub digiStub = (const_cast(stub))->digitalStub(); + ResPhi = digiStub.phiS() - phiT - qOverPt*digiStub.rt(); + ResZ = digiStub.z() - zT - tanLambda*digiStub.rt(); + // ResZ = digiStub.z() - z0 - tanLambda*digiStub.r(); + } else{ + ResPhi = reco::deltaPhi((const_cast(stub))->phi(), phi0 + qOverPt*(const_cast(stub))->r()); + ResZ = (const_cast(stub))->z() - z0 - tanLambda*(const_cast(stub))->r(); + } + + double RPhiSigma = 0.0002; + float RZSigma = (const_cast(stub))->zErr() + fabs(tanLambda)*(const_cast(stub))->rErr(); + + if ( not (const_cast(stub))->barrel() ) + RPhiSigma = 0.0004; + + if(digitize_){ + RPhiSigma = floor(RPhiSigma*phiMult_)/phiMult_; + } + + // if(!(const_cast(stub))->psModule()) RZSigma = 5; + + ResPhi /= RPhiSigma; + // cout << "zT "<< zT << " tanLambda "<< t<< RZSigma << endl; + ResZ /= RZSigma; + + chi2_phi += fabs(ResPhi*ResPhi); + chi2_z += fabs(ResZ*ResZ); + if(settings_->debug()==6 ){ + cout << "Stub ResPhi "<< ResPhi*RPhiSigma << " ResSigma " << RPhiSigma << " Res "<< ResPhi << " chi2 "<< chi2_phi << endl; + cout << "Stub ResZ "<< ResZ*RZSigma << " ResSigma " << RZSigma << " Res "<< ResZ << " chi2 "<< chi2_z << endl; + } + + } + qOverPt /= invPtToDPhi_; + + bool accepted = false; + // double chi2 = (chi2_phi + chi2_z)/2.; + // double chi2 = sqrt(chi2_phi*chi2_phi + chi2_z*chi2_z)/2; + + double chi2 = chi2_phi; // Ignore r-z residuals due to poor 2S resolution? + if(digitize_) chi2 = floor(chi2*chi2Mult_)/chi2Mult_; + + + + // cout << "chi2 "<< chi2 << " phi "<< chi2_phi << " z "<< chi2_z << endl; + float dof = 2*fitStubs.size() - 4; + float chi2dof = chi2/dof; + if(chi2 < chi2cut_) accepted = true; + + if(settings_->debug()==6) cout << "qOverPt "<< qOverPt << " phiT "<< phiT << endl; + + // This condition can only happen if cfg param TrackFitCheat = True. + if (fitStubs.size() < 4) accepted = false; + + // Kinematic cuts -- NOT YET IN FIRMWARE!!! + const float tolerance = 0.1; + if (fabs(qOverPt) > 1./(settings_->houghMinPt() - 0.1)) accepted = false; + if (fabs(z0) > 20.) accepted = false; + + + // Create the L1fittedTrack object + const unsigned int hitPattern = 0; // FIX: Needs setting + L1fittedTrack fitTrk(settings_, l1track3D, fitStubs, hitPattern, + qOverPt, 0., phi0, z0, tanLambda, + chi2_phi, chi2_z, 4, accepted); + + if(settings_->enableDigitize()) fitTrk.digitizeTrack("SimpleLR"); + + if(settings_->debug() == 6 and digitize_) { + cout << "Digitized parameters "<< endl; + cout << "HT mbin "<< int(l1track3D.getCellLocationHT().first) - 16 << " cbin "<< int(l1track3D.getCellLocationHT().second) - 32 << " iPhi "<< l1track3D.iPhiSec() << " iEta "<< l1track3D.iEtaReg() << endl; + cout << setw(10) << "First Helix parameters: qOverPt = "<< fitTrk.qOverPt() << " oneOver2r "<< fitTrk.digitaltrack().oneOver2r() <<" ("<< floor(fitTrk.digitaltrack().oneOver2r()*qOverPtMult_) << "), phi0 = "<< fitTrk.digitaltrack().phi0() <<" ("<< fitTrk.digitaltrack().iDigi_phi0rel() <<"), zT = "<< zT << " ("<debug()==6){ + cout << "FitTrack helix parameters "<< int(fitTrk.getCellLocationFit().first)-16 << ", "<< int(fitTrk.getCellLocationFit().second)-32 << " HT parameters "<< int(fitTrk.getCellLocationHT().first)-16 << ", " <qOverPt() << " phi0 "<< fitTrk.getMatchedTP()->phi0() << endl; + if(!accepted) cout << "BAD CHI2 "<< chi2 << " chi2/ndof " << chi2dof << endl; + } + else{ + cout << "FAKE TRACK!!! " << chi2 << " chi2/ndof "<< chi2dof << endl; + if(l1track3D.getMatchedTP() != nullptr) cout << "was good"<< endl; + } + cout << "layers in track "<< fitTrk.getNumLayers() << endl; + } + + return fitTrk; +} + diff --git a/L1Trigger/TrackFindingTMTT/src/Stub.cc b/L1Trigger/TrackFindingTMTT/src/Stub.cc new file mode 100644 index 0000000000000..ee0475163db80 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/Stub.cc @@ -0,0 +1,728 @@ +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "Geometry/CommonTopologies/interface/PixelGeomDetUnit.h" +#include "Geometry/CommonTopologies/interface/PixelTopology.h" + +//#include "SimTracker/TrackTriggerAssociation/interface/TTStubAssociationMap.h" +#include "DataFormats/Math/interface/deltaPhi.h" +#include "FWCore/Utilities/interface/Exception.h" +#include "TRandom.h" + +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/TP.h" +#include "L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h" + +#include + +using namespace std; + +namespace TMTT { + +// Static variables + +thread_local string Stub::trackerGeometryVersion_ = "UNKNOWN"; + +bool Stub::stubKillerInit_ = false; +StubKiller Stub::stubKiller_; + +//=== Store useful info about the stub (for use with HYBRID code), with hard-wired constants to allow use outside CMSSW. + +Stub::Stub(double phi, double r, double z, double bend, int layerid, bool psModule, bool barrel, unsigned int iphi, double alpha, const Settings* settings, const TrackerTopology* trackerTopology, unsigned int ID, unsigned int iPhiSec) : + phi_(phi), r_(r), z_(z), bend_(bend), iphi_(iphi), alpha_(alpha), psModule_(psModule), layerId_(layerid), endcapRing_(0), barrel_(barrel), + digitalStub_(settings, r, phi, z, iPhiSec), stubWindowSuggest_(settings) +{ //work in progress on better constructor for new hybrid + if (psModule && barrel) { + double zMax[4]; + settings->get_zMaxNonTilted(zMax); + tiltedBarrel_ = (fabs(z) > zMax[layerid]); + } else { + tiltedBarrel_ = false; + } + if (!psModule) { + stripPitch_ = settings->ssStripPitch(); nStrips_=settings->ssNStrips(); sigmaPar_=settings->ssStripLength()/std::sqrt(12.0); + } else { + stripPitch_ = settings->psStripPitch(); nStrips_=settings->psNStrips(); sigmaPar_=settings->psPixelLength()/std::sqrt(12.0); + } + sigmaPerp_ = stripPitch_/std::sqrt(12.0); + index_in_vStubs_ = ID; // A unique ID to label the stub. +} + +//=== Store useful info about stub (for use with TMTT tracking). + +Stub::Stub(const TTStubRef& ttStubRef, unsigned int index_in_vStubs, const Settings* settings, + const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology) : + TTStubRef(ttStubRef), + settings_(settings), + index_in_vStubs_(index_in_vStubs), + assocTP_(nullptr), // Initialize in case job is using no MC truth info. + digitalStub_(settings), + digitizedForGPinput_(false), // notes that stub has not yet been digitized for GP input. + digitizedForHTinput_(false), // notes that stub has not yet been digitized for HT input. + digitizedForSForTFinput_(""), // notes that stub has not yet been digitized for seed filter or track fitter input. + digitizeWarningsOn_(true), + stubWindowSuggest_(settings, trackerTopology), // TMTT recommendations for stub window sizes to CMS. + degradeBend_(trackerTopology) // Used to degrade stub bend information. +{ + // Determine tracker geometry version (T3, T4, T5 ...) + this->setTrackerGeometryVersion(trackerGeometry, trackerTopology); + + // Initialize tool to optionally emulate dead modules. + + if (not stubKillerInit_) { + stubKillerInit_ = true; + stubKiller_.initialise(settings->killScenario(), trackerTopology, trackerGeometry); + } + + + // Get coordinates of stub. + const TTStub *ttStubP = ttStubRef.get(); + + // The stub gives access to the DetId of the stacked module, but we want the DetId of the lower of + // the two sensors in the module. + + /* + // This the way CMS usually does this conversion, but it uses huge amounts of CPU. + DetId geoDetId; + for (const GeomDet* gd : trackerGeometry->dets()) { + DetId detid = gd->geographicalId(); + if (detid.subdetId() != StripSubdetector::TOB && detid.subdetId() != StripSubdetector::TID) continue; // Phase 2 Outer Tracker uses TOB for entire barrel & TID for entire endcap. + if ( trackerTopology->isLower(detid) ) { // Select only lower of the two sensors in a module. + DetId stackDetid = trackerTopology->stack(detid); // Det ID of stacked module containing stub. + if ( ttStubRef->getDetId() == stackDetid ) { + geoDetId = detid; // Note Det ID of lower sensor in stacked module containing stub. + break; + } + } + } + if (geoDetId.null()) throw cms::Exception("Stub: Det ID corresponding to Stub not found"); + */ + + // This is a faster way we found of doing the conversion. It seems to work ... + DetId stackDetid = ttStubRef->getDetId(); + DetId geoDetId(stackDetid.rawId() + 1); + if ( not (trackerTopology->isLower(geoDetId) && trackerTopology->stack(geoDetId) == stackDetid) ) throw cms::Exception("Stub: determination of detId went wrong"); + + const GeomDetUnit* det0 = trackerGeometry->idToDetUnit( geoDetId ); + // To get other module, can do this + // const GeomDetUnit* det1 = trackerGeometry->idToDetUnit( trackerTopology->partnerDetId( geoDetId ) ); + + const PixelGeomDetUnit* theGeomDet = dynamic_cast< const PixelGeomDetUnit* >( det0 ); + const PixelTopology* topol = dynamic_cast< const PixelTopology* >( &(theGeomDet->specificTopology()) ); + MeasurementPoint measurementPoint = ttStubRef->clusterRef(0)->findAverageLocalCoordinatesCentered(); + LocalPoint clustlp = topol->localPosition(measurementPoint); + GlobalPoint pos = theGeomDet->surface().toGlobal(clustlp); + + phi_ = pos.phi(); + r_ = pos.perp(); + z_ = pos.z(); + + if (r_ < settings_->trackerInnerRadius() || r_ > settings_->trackerOuterRadius() || fabs(z_) > settings_->trackerHalfLength()) { + throw cms::Exception("Stub: Stub found outside assumed tracker volume. Please update tracker dimensions specified in Settings.h!")<<" r="<getDetId().subdetId()<setModuleInfo(trackerGeometry, trackerTopology, geoDetId); + // Uncertainty in stub coordinates due to strip or pixel length in r-z. + if (barrel_) { + rErr_ = 0.; + zErr_ = 0.5*stripLength_; + } else { + rErr_ = 0.5*stripLength_; + zErr_ = 0.; + } + + // Get the coordinates of the two clusters that make up this stub, measured in units of strip pitch, and measured + // in the local frame of the sensor. They have a granularity of 0.5*pitch. + for (unsigned int iClus = 0; iClus <= 1; iClus++) { // Loop over two clusters in stub. + localU_cluster_[iClus] = ttStubP->clusterRef(iClus)->findAverageLocalCoordinatesCentered().x(); + localV_cluster_[iClus] = ttStubP->clusterRef(iClus)->findAverageLocalCoordinatesCentered().y(); + } + + // Get location of stub in module in units of strip number (or pixel number along finest granularity axis). + // Range from 0 to (nStrips - 1) inclusive. + // N.B. Since iphi is integer, this degrades the granularity by a factor 2. This seems silly, but track fit wants it. + iphi_ = localU_cluster_[0]; // granularity 1*strip (unclear why we want to degrade it ...) + + // Determine alpha correction for non-radial strips in endcap 2S modules. + // (If true hit at larger r than stub r by deltaR, then stub phi needs correcting by +alpha*deltaR). + alpha_ = 0.; + if ((not barrel_) && (not psModule_)) { + float fracPosInModule = (float(iphi_) - 0.5*float(nStrips_)) / float(nStrips_); + float phiRelToModule = sensorWidth_ * fracPosInModule / r_; + if (z_ < 0) phiRelToModule *= -1; + if (outerModuleAtSmallerR_) phiRelToModule *= -1; // Module flipped. + // If true hit at larger r than stub r by deltaR, then stub phi needs correcting by +alpha*deltaR. + alpha_ = -phiRelToModule /r_ ; + } + + // Calculate constants used to interpret bend information. + + // float sensorSpacing = barrel_ ? (moduleMaxR_ - moduleMinR_) : (moduleMaxZ_ - moduleMinZ_); + // EJC Above not true for tilted modules + float sensorSpacing = sqrt( (moduleMaxR_ - moduleMinR_) * (moduleMaxR_ - moduleMinR_) + (moduleMaxZ_ - moduleMinZ_) * (moduleMaxZ_ - moduleMinZ_) ); + + pitchOverSep_ = stripPitch_/sensorSpacing; + // IRT - use stub (r,z) instead of module (r,z). Logically correct but has negligable effect on results. + // This old equation was valid for flat geom, where all modules are parallel or perpendicular to beam. + //dphiOverBend_ = barrel_ ? pitchOverSep_ : pitchOverSep_*fabs(z_)/r_; + // EJC - This new equation is valid in general case, so works for both flat and tilted geom. + dphiOverBendCorrection_ = fabs( cos( this->theta() - moduleTilt_ ) / sin( this->theta() ) ); + dphiOverBendCorrection_approx_ = getApproxB(); + if ( settings->useApproxB() ) { + dphiOverBend_ = pitchOverSep_ * dphiOverBendCorrection_approx_; + } + else{ + dphiOverBend_ = pitchOverSep_ * dphiOverBendCorrection_; + } + + // Get stub bend that is available in front-end electronics, where bend is displacement between + // two hits in stubs in units of strip pitch. + bendInFrontend_ = ttStubRef->bendFE(); + if ((not barrel_) && pos.z() > 0) bendInFrontend_ *= -1; + // EJC Bend in barrel seems to be flipped in tilted geom. + if (barrel_) bendInFrontend_ *= -1; + + // Get stub bend that is available in off-detector electronics, allowing for degredation of + // bend resolution due to bit encoding by FE chip if required. + bool rejectStub = false; // indicates if bend is outside window assumed in DegradeBend.h + numMergedBend_ = 1; // Number of bend values merged into single degraded one. + if (settings->degradeBendRes() == 2) { + float degradedBend; // degraded bend + this->degradeResolution(bendInFrontend_, + degradedBend, rejectStub, numMergedBend_); // sets value of last 3 arguments. + bend_ = degradedBend; + } else if (settings->degradeBendRes() == 1) { + bend_ = ttStubRef->bendBE(); // Degraded bend from official CMS recipe. + if ((not barrel_) && pos.z() > 0) bend_ *= -1; + if (barrel_) bend_ *= -1; + } else { + bend_ = bendInFrontend_; + } + + // Fill frontendPass_ flag, indicating if frontend readout electronics will output this stub. + this->setFrontend(rejectStub); + + // Calculate bin range along q/Pt axis of r-phi Hough transform array consistent with bend of this stub. + this->calcQoverPtrange(); + + // Initialize class used to produce digital version of stub, with original stub parameters pre-digitization. + digitalStub_.init(phi_, r_, z_, min_qOverPt_bin_, max_qOverPt_bin_, layerId_, this->layerIdReduced(), bend_, stripPitch_, sensorSpacing, rErr_, zErr_, barrel_, tiltedBarrel_, psModule_); + + // Update recommended stub window sizes that TMTT recommends that CMS should use in FE electronics. + if (settings_->printStubWindows()) stubWindowSuggest_.process(this); + + // Initialize truth info to false in case job is using no MC truth info. + for (unsigned int iClus = 0; iClus <= 1; iClus++) { + assocTPofCluster_[iClus] = nullptr; + } +} + +//=== Calculate bin range along q/Pt axis of r-phi Hough transform array consistent with bend of this stub. + +void Stub::calcQoverPtrange() { + // First determine bin range along q/Pt axis of HT array + const int nbinsPt = (int) settings_->houghNbinsPt(); // Use "int" as nasty things happen if multiply "int" and "unsigned int". + const int min_array_bin = 0; + const int max_array_bin = nbinsPt - 1; + // Now calculate range of q/Pt bins allowed by bend filter. + float qOverPtMin = this->qOverPtOverBend() * (this->bend() - this->bendRes()); + float qOverPtMax = this->qOverPtOverBend() * (this->bend() + this->bendRes()); + int houghNbinsPt = settings_->houghNbinsPt(); + const float houghMaxInvPt = 1./settings_->houghMinPt(); + float qOverPtBinSize = (2. * houghMaxInvPt)/houghNbinsPt; + if ( settings_->shape() == 2 || settings_->shape() == 1 || settings_->shape() == 3 ) // Non-square HT cells. + qOverPtBinSize = 2. * houghMaxInvPt / ( houghNbinsPt - 1 ); + // Convert to bin number along q/Pt axis of HT array. + // N.B. For square HT cells, setting "tmp = -0.5" causeas cell to be accepted if q/Pt at its centre is consistent + // with the stub bend. Instead using "tmp = 0.0" accepts cells if q/Pt at any point in cell is consistent with bend. + // So if you use change from -0.5 to 0.0, you have to tighten the bend cut (by ~0.05) to get similar performance. + // Decision to set tmp = 0.0 taken in softare & GP firmware on 9th August 2016. + //float tmp = ( settings_->shape() == 2 || settings_->shape() == 1 || settings_->shape() == 3 ) ? 1. : -0.5; + + float tmp = ( settings_->shape() == 2 || settings_->shape() == 1 || settings_->shape() == 3 ) ? 1. : 0.; + int min_bin = std::floor(-tmp + (qOverPtMin + houghMaxInvPt)/qOverPtBinSize); + int max_bin = std::floor( tmp + (qOverPtMax + houghMaxInvPt)/qOverPtBinSize); + + // Limit it to range of HT array. + min_bin = max(min_bin, min_array_bin); + max_bin = min(max_bin, max_array_bin); + // If min_bin > max_bin at this stage, it means that the Pt estimated from the bend is below the cutoff for track-finding. + // Keep min_bin > max_bin, so such stubs can be rejected, but set both variables to values inside the HT bin range. + if (min_bin > max_bin) { + min_bin = max_array_bin; + max_bin = min_array_bin; + //if (frontendPass_) throw cms::Exception("Stub: m bin calculation found low Pt stub not killed by FE electronics cuts")<enableDigitize()) { + + // Save CPU by not redoing digitization if stub was already digitized for this phi sector. + if ( ! (digitizedForGPinput_ && digitalStub_.iGetNonant(iPhiSec) == digitalStub_.iDigi_Nonant()) ) { + + // Digitize + digitalStub_.makeGPinput(iPhiSec); + + // Replace stub coordinates with those degraded by digitization process. + phi_ = digitalStub_.phi(); + r_ = digitalStub_.r(); + z_ = digitalStub_.z(); + bend_ = digitalStub_.bend(); + + // If the Stub class contains any data members that are not input to the GP, but are derived from variables that + // are, then be sure to update these here too, unless Stub.h uses the check*() functions to declare them invalid. + dphiOverBendCorrection_ = fabs( cos( this->theta() - moduleTilt_ ) / sin( this->theta() ) ); + dphiOverBend_ = pitchOverSep_ * dphiOverBendCorrection_; + + // Note that stub has been digitized for GP input + digitizedForGPinput_ = true; + } + digitizedForHTinput_ = false; + } +} + +//=== Digitize stub for input to Hough transform, with digitized phi coord. measured relative to specified phi sector. + +void Stub::digitizeForHTinput(unsigned int iPhiSec) { + + if (settings_->enableDigitize()) { + + // Save CPU by not redoing digitization if stub was already digitized for this phi sector. + if ( ! (digitizedForHTinput_ && iPhiSec == digitalStub_.iDigi_PhiSec()) ) { + + // Call digitization for GP in case not already done. (Needed for variables that are common to GP & HT). + this->digitizeForGPinput(iPhiSec); + + // Digitize + digitalStub_.makeHTinput(iPhiSec); + + // Since GP and HT use same digitisation in r and z, don't bother updating their values. + // (Actually, the phi digitisation boundaries also match, except for systolic array, so could skip updating phi too). + + // Replace stub coordinates and bend with those degraded by digitization process. (Don't bother with r & z, as already done by GP digitisation). + phi_ = digitalStub_.phi(); + + // Recalculate bin range along q/Pt axis of r-phi Hough transform array + // consistent with bend of this stub, since it depends on r & z which have now been digitized. + // (This recalculation should really be done in DigitalStub::makeHTinput(), but too lazy to move it there ...). + this->calcQoverPtrange(); + + // If the Stub class contains any data members that are not input to the HT, but are derived from variables that + // are, then be sure to update these here too, unless Stub.h uses the check*() functions to declare them invalid. + // - currently none. + + // Note that stub has been digitized. + digitizedForHTinput_ = true; + } + } +} + +//=== Digitize stub for input to r-z Seed Filter or Track Fitter. +//=== Argument is "SeedFilter" or name of Track Fitter. + +void Stub::digitizeForSForTFinput(string SForTF) { + if (settings_->enableDigitize()) { + + if ( digitizedForSForTFinput_ != SForTF) { + // Digitize variables specific to seed filter or track fittr if not already done. + digitalStub_.makeSForTFinput(SForTF); + + // Replace stub (r,z) uncertainties, estimated from half-pixel/strip-length, by those degraded by the digitization process. + rErr_ = digitalStub_.rErr(); + zErr_ = digitalStub_.zErr(); + // Must also replace stub r coordinate, as seed filter & fitters work with digitized r instead of digitized rT. + r_ = digitalStub_.r(); + // And KF may also redigitize z. + z_ = digitalStub_.z(); + + digitizedForSForTFinput_ = SForTF; + } + } +} + +//=== Digitize stub for input to r-z Seed Filter. + +void Stub::digitizeForDRinput(unsigned int stubId) { + if (settings_->enableDigitize()) { + + // Digitize variables specific to seed filter if not already done. + digitalStub_.makeDRinput(stubId); + // digitizedForDRinput_ = true; + + } +} + +//=== Restore stub to pre-digitized state. i.e. Undo what function digitize() did. + +void Stub::reset_digitize() { + if (settings_->enableDigitize()) { + // Save CPU by not undoing digitization if stub was not already digitized. + if (digitizedForGPinput_ || digitizedForHTinput_) { + + // Replace stub coordinates and bend with original coordinates stored prior to any digitization. + phi_ = digitalStub_.orig_phi(); + r_ = digitalStub_.orig_r(); + z_ = digitalStub_.orig_z(); + bend_ = digitalStub_.orig_bend(); + + // Also restore original uncertainties in stub coordinates (estimated from strip or pixel half-length). + rErr_ = digitalStub_.orig_rErr(); + zErr_ = digitalStub_.orig_zErr(); + + // Note that stub is (no longer) digitized. + digitizedForGPinput_ = false; + digitizedForHTinput_ = false; + digitizedForSForTFinput_ = ""; + + // If the Stub class contains any data members that are not input to the GP or HT, but are derived from + // variables that are, then be sure to update these here too. + dphiOverBendCorrection_ = fabs( cos( this->theta() - moduleTilt_ ) / sin( this->theta() ) ); + dphiOverBend_ = pitchOverSep_ * dphiOverBendCorrection_; + } + } +} + +//=== Degrade assumed stub bend resolution. +//=== Also return boolean indicating if stub bend was outside assumed window, so stub should be rejected +//=== and return an integer indicating how many values of bend are merged into this single one. + +void Stub::degradeResolution(float bend, + float& degradedBend, bool& reject, unsigned int& num) const { + + // If TMTT code is tightening official CMS FE stub window cuts, then calculate TMTT stub windows. + float windowFE; + if (settings_->killLowPtStubs()) { + // Window size corresponding to Pt cut used for tracking. + float invPtMax = 1./(settings_->houghMinPt()); + windowFE = invPtMax/fabs(this->qOverPtOverBend()); + // Increase half-indow size to allow for resolution in bend. + windowFE += this->bendResInFrontend(); + } else { + windowFE = 99999.; // TMTT is not tightening windows. + } + + static bool firstErr = true; + if (trackerGeometryVersion_ != "T5") { // Tilted geometry + if (firstErr) { + cout<<"Stub: WARNING - Stub windows in DegradeBend class have not been tuned for this tracker geometry, so may need retuning "<eta()) > settings_->maxStubEta() ) frontendPass_ = false; + // Don't use stubs whose Pt is significantly below the Pt cut used in the L1 tracking, allowing for uncertainty in q/Pt due to stub bend resolution. + if (settings_->killLowPtStubs()) { + const float qOverPtCut = 1./settings_->houghMinPt(); + // Apply this cut in the front-end electronics. + if (fabs(this->bendInFrontend()) - this->bendResInFrontend() > qOverPtCut/this->qOverPtOverBend()) frontendPass_ = false; + // Reapply the same cut using the degraded bend information available in the off-detector electronics. + // The reason is that the bend degredation can move the Pt below the Pt cut, making the stub useless to the off-detector electronics. + if (fabs(this->bend()) - this->bendRes() > qOverPtCut/this->qOverPtOverBend()) frontendPass_ = false; + } + // Don't use stubs whose bend is outside the window encoded into DegradeBend.h + if (rejectStub) { + if (frontendPass_) stubFailedDegradeWindow_ = true; + frontendPass_ = false; + } + + // Emulate stubs in dead tracker regions using private TMTT emulation. + if (settings_->deadSimulateFrac() > 0.) { // Is option to emulate dead modules enabled? + const DeadModuleDB dead; + if (dead.killStub(this)) { + static TRandom randomGenerator; + if (randomGenerator.Rndm() < settings_->deadSimulateFrac()) frontendPass_ = false; + } + } + + // Or emulate stubs in dead tracker regions using communal emulation shared with Tracklet. + if (settings_->killScenario() > 0) { + TTStubRef ttStubRef(*this); // Cast to base class + bool kill = stubKiller_.killStub(ttStubRef.get()); + if (kill) frontendPass_ = false; + } +} + +//=== Function to calculate approximation for dphiOverBendCorrection aka B +double Stub::getApproxB() { + if ( tiltedBarrel_ ) { + return settings_->bApprox_gradient() * fabs(z_)/r_ + settings_->bApprox_intercept(); + } + else { + return barrel_ ? 1 : fabs(z_)/r_; + } +} + +//=== Note which tracking particle(s), if any, produced this stub. +//=== The 1st argument is a map relating TrackingParticles to TP. + +void Stub::fillTruth(const map, const TP* >& translateTP, const edm::Handle& mcTruthTTStubHandle, const edm::Handle& mcTruthTTClusterHandle){ + + TTStubRef ttStubRef(*this); // Cast to base class + + //--- Fill assocTP_ info. If both clusters in this stub were produced by the same single tracking particle, find out which one it was. + + bool genuine = mcTruthTTStubHandle->isGenuine(ttStubRef); // Same TP contributed to both clusters? + assocTP_ = nullptr; + + // Require same TP contributed to both clusters. + if ( genuine ) { + edm::Ptr< TrackingParticle > tpPtr = mcTruthTTStubHandle->findTrackingParticlePtr(ttStubRef); + if (translateTP.find(tpPtr) != translateTP.end()) { + assocTP_ = translateTP.at(tpPtr); + // N.B. Since not all tracking particles are stored in InputData::vTPs_, sometimes no match will be found. + } + } + + // Fill assocTPs_ info. + + if (settings_->stubMatchStrict()) { + + // We consider only stubs in which this TP contributed to both clusters. + if (assocTP_ != nullptr) assocTPs_.insert(assocTP_); + + } else { + + // We consider stubs in which this TP contributed to either cluster. + + for (unsigned int iClus = 0; iClus <= 1; iClus++) { // Loop over both clusters that make up stub. + const TTClusterRef& ttClusterRef = ttStubRef->clusterRef(iClus); + + // Now identify all TP's contributing to either cluster in stub. + vector< edm::Ptr< TrackingParticle > > vecTpPtr = mcTruthTTClusterHandle->findTrackingParticlePtrs(ttClusterRef); + + for (edm::Ptr< TrackingParticle> tpPtr : vecTpPtr) { + if (translateTP.find(tpPtr) != translateTP.end()) { + assocTPs_.insert( translateTP.at(tpPtr) ); + // N.B. Since not all tracking particles are stored in InputData::vTPs_, sometimes no match will be found. + } + } + } + } + + //--- Also note which tracking particles produced the two clusters that make up the stub + + for (unsigned int iClus = 0; iClus <= 1; iClus++) { // Loop over both clusters that make up stub. + const TTClusterRef& ttClusterRef = ttStubRef->clusterRef(iClus); + + bool genuineCluster = mcTruthTTClusterHandle->isGenuine(ttClusterRef); // Only 1 TP made cluster? + assocTPofCluster_[iClus] = nullptr; + + // Only consider clusters produced by just one TP. + if ( genuineCluster ) { + edm::Ptr< TrackingParticle > tpPtr = mcTruthTTClusterHandle->findTrackingParticlePtr(ttClusterRef); + + if (translateTP.find(tpPtr) != translateTP.end()) { + assocTPofCluster_[iClus] = translateTP.at(tpPtr); + // N.B. Since not all tracking particles are stored in InputData::vTPs_, sometimes no match will be found. + } + } + } + + // Sanity check - is truth info of stub consistent with that of its clusters? + // Commented this out, as it throws errors for unknown reason with iErr=1. Apparently, "genuine" stubs can be composed of two clusters that are + // not "genuine", providing that one of the TP that contributed to each cluster was the same. + /* + unsigned int iErr = 0; + if (this->genuine()) { // Stub matches truth particle + if ( ! ( this->genuineCluster()[0] && (this->assocTPofCluster()[0] == this->assocTPofCluster()[1]) ) ) iErr = 1; + } else { + if ( ! ( ! this->genuineCluster()[0] || (this->assocTPofCluster()[0] != this->assocTPofCluster()[1]) ) ) iErr = 2; + } + if (iErr > 0) { + cout<<" DEBUGA "<<(this->assocTP() == nullptr)<assocTPofCluster()[0] == nullptr)<<" "<<(this->assocTPofCluster()[1] == nullptr)<genuineCluster()[0]<<" "<genuineCluster()[1]<assocTPofCluster()[0] != nullptr) cout<<" DEBUGD "<assocTPofCluster()[0]->index()<assocTPofCluster()[1] != nullptr) cout<<" DEBUGE "<assocTPofCluster()[1]->index()< Stub::trkPhiAtR(float rad) const { + float rStubMax = r_ + rErr_; // Uncertainty in radial stub coordinate due to strip length. + float rStubMin = r_ - rErr_; + float trkPhi1 = (phi_ + dphi()*(1. - rad/rStubMin)); + float trkPhi2 = (phi_ + dphi()*(1. - rad/rStubMax)); + float trkPhi = 0.5* (trkPhi1 + trkPhi2); + float errTrkPhi = 0.5*fabs(trkPhi1 - trkPhi2); + return pair(trkPhi, errTrkPhi); +} + + +//=== Note if stub is a crazy distance from the tracking particle trajectory that produced it. +//=== If so, it was probably produced by a delta ray. + +bool Stub::crazyStub() const { + + bool crazy; + if (assocTP_ == nullptr) { + crazy = false; // Stub is fake, but this is not crazy. It happens ... + } else { + // Stub was produced by TP. Check it lies not too far from TP trajectory. + crazy = fabs( reco::deltaPhi(phi_, assocTP_->trkPhiAtStub( this )) ) > settings_->crazyStubCut(); + } + return crazy; +} + +//=== Get reduced layer ID (in range 1-7), which can be packed into 3 bits so simplifying the firmware). + +unsigned int Stub::layerIdReduced() const { + // Don't bother distinguishing two endcaps, as no track can have stubs in both. + unsigned int lay = (layerId_ < 20) ? layerId_ : layerId_ - 10; + + // No genuine track can have stubs in both barrel layer 6 and endcap disk 11 etc., so merge their layer IDs. + // WARNING: This is tracker geometry dependent, so may need changing in future ... + if (lay == 6) lay = 11; + if (lay == 5) lay = 12; + if (lay == 4) lay = 13; + if (lay == 3) lay = 15; + // At this point, the reduced layer ID can have values of 1, 2, 11, 12, 13, 14, 15. So correct to put in range 1-7. + if (lay > 10) lay -= 8; + + if (lay < 1 || lay > 7) throw cms::Exception("Stub: Reduced layer ID out of expected range"); + + return lay; +} + + +//=== Set info about the module that this stub is in. + +void Stub::setModuleInfo(const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology, const DetId& detId) { + + idDet_ = detId; + + // Note if module is PS or 2S, and whether in barrel or endcap. + psModule_ = trackerGeometry->getDetectorType( detId ) == TrackerGeometry::ModuleType::Ph2PSP; // From https://github.com/cms-sw/cmssw/blob/CMSSW_8_1_X/Geometry/TrackerGeometryBuilder/README.md + barrel_ = detId.subdetId()==StripSubdetector::TOB || detId.subdetId()==StripSubdetector::TIB; + + // Get min & max (r,phi,z) coordinates of the centre of the two sensors containing this stub. + const GeomDetUnit* det0 = trackerGeometry->idToDetUnit( detId ); + const GeomDetUnit* det1 = trackerGeometry->idToDetUnit( trackerTopology->partnerDetId( detId ) ); + + float R0 = det0->position().perp(); + float R1 = det1->position().perp(); + float PHI0 = det0->position().phi(); + float PHI1 = det1->position().phi(); + float Z0 = det0->position().z(); + float Z1 = det1->position().z(); + moduleMinR_ = std::min(R0,R1); + moduleMaxR_ = std::max(R0,R1); + moduleMinPhi_ = std::min(PHI0,PHI1); + moduleMaxPhi_ = std::max(PHI0,PHI1); + moduleMinZ_ = std::min(Z0,Z1); + moduleMaxZ_ = std::max(Z0,Z1); + + // Note if tilted barrel module & get title angle (in range 0 to PI). + tiltedBarrel_ = barrel_ && (trackerTopology->tobSide(detId) != 3); + float deltaR = fabs(R1 - R0); + float deltaZ = (R1 - R0 > 0) ? (Z1 - Z0) : - (Z1 - Z0); + moduleTilt_ = atan2( deltaR, deltaZ); + if (moduleTilt_ > M_PI/2.) moduleTilt_ -= M_PI; // Put in range -PI/2 to +PI/2. + if (moduleTilt_ < -M_PI/2.) moduleTilt_ += M_PI; // + + // cout<<"DEBUG STUB "<layer( detId ); // barrel layer 1-6 encoded as 1-6 + } else { + // layerId_ = 10*detId.iSide() + detId.iDisk(); // endcap layer 1-5 encoded as 11-15 (endcap A) or 21-25 (endcapB) + // EJC This seems to give the same encoding as what we had in CMSSW6 + layerId_ = 10*trackerTopology->side( detId ) + trackerTopology->tidWheel( detId ); + } + + // Note module ring in endcap + endcapRing_ = barrel_ ? 0 : trackerTopology->tidRing( detId ); + + if (trackerGeometryVersion_ == "T5") { + if ( ! barrel_) { + // Apply bodge, since Topology class annoyingly starts ring count at 1, even in endcap wheels where + // inner rings are absent. + unsigned int iWheel = trackerTopology->tidWheel( detId ); + if (iWheel >= 3 && iWheel <=5) endcapRing_ += 3; + } + } + + // Get sensor strip or pixel pitch using innermost sensor of pair. + + const PixelGeomDetUnit* unit = reinterpret_cast( det0 ); + const PixelTopology& topo = unit->specificTopology(); + const Bounds& bounds = det0->surface().bounds(); + + std::pair pitch = topo.pitch(); + stripPitch_ = pitch.first; // Strip pitch (or pixel pitch along shortest axis) + stripLength_ = pitch.second; // Strip length (or pixel pitch along longest axis) + nStrips_ = topo.nrows(); // No. of strips in sensor + sensorWidth_ = bounds.width(); // Width of sensitive region of sensor (= stripPitch * nStrips). + + // Note if modules are flipped back-to-front. + outerModuleAtSmallerR_ = ( det0->position().mag() > det1->position().mag() ); + /* + if ( barrel_ && det0->position().perp() > det1->position().perp() ) { + outerModuleAtSmallerR_ = true; + } + */ + + sigmaPerp_ = stripPitch_/sqrt(12.); // resolution perpendicular to strip (or to longest pixel axis) + sigmaPar_ = stripLength_/sqrt(12.); // resolution parallel to strip (or to longest pixel axis) +} + +//=== Determine tracker geometry version by counting modules. + +void Stub::setTrackerGeometryVersion(const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology) { + + // N.B. The relationship between Tracker geometry name (T3, T4, T5 ...) and CMS geometry name + // (D13, D17 ...) is documented in + // https://github.com/cms-sw/cmssw/blob/CMSSW_9_1_X/Configuration/Geometry/README.md . + + if (trackerGeometryVersion_ == "UNKNOWN") { + unsigned int numDet = 0; + for (const GeomDet* gd : trackerGeometry->dets()) { + DetId detid = gd->geographicalId(); + if (detid.subdetId() != StripSubdetector::TOB || detid.subdetId() != StripSubdetector::TID) { // Phase 2 Outer Tracker uses TOB for entire barrel & TID for entire endcap. + if ( trackerTopology->isLower(detid) ) { // Select only lower of the two sensors in a module. + numDet++; + } + } + } + + if (numDet == 13296) { + trackerGeometryVersion_ = "T5"; // Tilted geometry + } else if (numDet == 13556) { + trackerGeometryVersion_ = "T3"; // Older tilted geometry + } else if (numDet == 14850) { + trackerGeometryVersion_ = "T4"; // Flat geometry + } else { + trackerGeometryVersion_ = "UNRECOGNISED"; + cout<<"Stub: WARNING -- The tracker geometry you are using is yet not known to the stub class. Please update Stub::degradeResolution() & Stub::setTrackerGeometryVersion(). Number of tracker modules = "< stubs, double SectorPhi, int lres_dr ) : layerKF_(999) +{ + r_=0; phi_=0; z_=0; eta_=0; + sigmaX_=0; sigmaZ_=0; + layerId_=0; endcapRing_=0; barrel_=false; tiltedBarrel_=false; psModule_=false; + nstubs_ = stubs.size(); + stubs_ = stubs; + dphi_dl_ = 0; + dphi_dr_ = 0; + dphi_ = 0; + deltai_ = 0; + alpha_ = 0; + moduleTilt_ = 0.; + + layerIdReduced_ = stubs.at(0)->layerIdReduced(); + layerId_ = stubs.at(0)->layerId(); + endcapRing_ = stubs.at(0)->endcapRing(); + barrel_ = stubs.at(0)->barrel(); + tiltedBarrel_ = stubs.at(0)->tiltedBarrel(); + psModule_ = stubs.at(0)->psModule(); + moduleTilt_ += stubs.at(0)->moduleTilt(); + + if(nstubs_ == 0 ) return; + + double sum_r2(0), sum_z2(0), sum_phi2(0), sum_sigmaZ2(0), sum_dphi2_dr(0), sum_dphi2_dl(0); + int lsign(0); + + for( auto stub : stubs ){ + r_ += stub->r(); + z_ += stub->z(); + eta_ += stub->eta(); + phi_ += reco::deltaPhi( stub->phi(), SectorPhi ); + std::set assocTPs = stub->assocTPs(); + if( assocTPs.size() ){ + assocTPs_.insert( assocTPs.begin(), assocTPs.end() ); + } + sum_z2 += ( stub->z() * stub->z() ); + sum_r2 += ( stub->r() * stub->r() ); + sum_phi2 += ( reco::deltaPhi( stub->phi(), SectorPhi ) * reco::deltaPhi( stub->phi(), SectorPhi ) ); + + double dphi_dl = stub->sigmaX() / stub->r(); + sum_dphi2_dl += ( dphi_dl * dphi_dl ); + + int delta_i(0); + double delta_l(0); + if( 0 < lres_dr && lres_dr < (int)stub->nStrips() / 3 ) { + delta_i = ( stub->iphi() - 0.5 * stub->nStrips() ) / lres_dr; + delta_l = ( delta_i + 0.5 ) * stub->stripPitch() * lres_dr; + } + else if( lres_dr == 0 ){ + delta_i = 0; + delta_l = 0; + } + else{ + delta_i = ( stub->iphi() - 0.5 * stub->nStrips() ); + delta_i = delta_i > 0 ? 0.5 * stub->nStrips() - 1 : -0.5 * stub->nStrips(); + delta_l = ( delta_i + 0.5 ) * stub->stripPitch(); + } + + deltai_ += delta_i; + deltal_ += delta_l; + lsign += ( delta_i > 0 ? +1 : -1 ); + + if( !stub->barrel() ){ + double dphiOverdr = delta_l / ( stub->r() * stub->r() ); + double dphi_dr = dphiOverdr * stub->sigmaZ(); + sum_dphi2_dr += ( dphi_dr * dphi_dr ); + } + sum_sigmaZ2 += ( stub->sigmaZ() * stub->sigmaZ() ); + + alpha_ += stub->alpha(); + } + + r_ /= nstubs_; + z_ /= nstubs_; + eta_ /= nstubs_; + phi_ /= nstubs_; + deltal_ /= nstubs_; + deltai_ /= nstubs_; + + dphi_dr_ = sqrt( sum_dphi2_dr ) / nstubs_; + dphi_dl_ = sqrt( sum_dphi2_dl ) / nstubs_; + if( lsign < 0 ){//if this sign is opposite, 1% eff. reduction is observed. + dphi_dr_ = -1. * dphi_dr_; + } + + double vZ(0); + if( nstubs_ == 1 ){ + sigmaX_ = stubs.front()->sigmaX(); + sigmaZ_ = stubs.front()->sigmaZ(); + dphi_ = sqrt( dphi_dr_ * dphi_dr_ + dphi_dl_ * dphi_dl_ ); + } + else{ + double vphi = ( sum_phi2 - nstubs_ * phi_ * phi_ ) / ( nstubs_ - 1 ); + dphi_ = sqrt( dphi_dr_ * dphi_dr_ + dphi_dl_ * dphi_dl_ + vphi ); + + sigmaX_ = r_ * dphi_; + + if( stubs.front()->barrel() ){ + + vZ = ( sum_z2 - nstubs_ * z_ * z_ ) / ( nstubs_ - 1 ); + + } + else{ + vZ = ( sum_r2 - nstubs_ * r_ * r_ ) / ( nstubs_ - 1 ); + } + sigmaZ_ = sqrt( vZ * vZ + sum_sigmaZ2 / nstubs_ ); + } + + phi_ = reco::deltaPhi( phi_ + SectorPhi, 0. ); + + alpha_ /= nstubs_; +} + +} diff --git a/L1Trigger/TrackFindingTMTT/src/StubKiller.cc b/L1Trigger/TrackFindingTMTT/src/StubKiller.cc new file mode 100644 index 0000000000000..602f4ca605056 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/StubKiller.cc @@ -0,0 +1,241 @@ +// Copied from https://raw.githubusercontent.com/EmyrClement/StubKiller/master/StubKiller.cc +// on 9th May 2018. + +// Changed to point to location we put it. +//#include "StubKiller.h" +#include "L1Trigger/TrackFindingTMTT/interface/StubKiller.h" + +using namespace std; + +StubKiller::StubKiller() : + killScenario_(0), + trackerTopology_(0), + trackerGeometry_(0), + layersToKill_(vector()), + minPhiToKill_(0), + maxPhiToKill_(0), + minZToKill_(0), + maxZToKill_(0), + minRToKill_(0), + maxRToKill_(0), + fractionOfStubsToKillInLayers_(0), + fractionOfStubsToKillEverywhere_(0), + fractionOfModulesToKillEverywhere_(0) +{ +} + +void StubKiller::initialise(unsigned int killScenario, const TrackerTopology* trackerTopology, const TrackerGeometry* trackerGeometry) +{ + killScenario_ = killScenario; + trackerTopology_ = trackerTopology; + trackerGeometry_ = trackerGeometry; + + // These sceanrios correspond to slide 12 of https://indico.cern.ch/event/719985/contributions/2970687/attachments/1634587/2607365/StressTestTF-Acosta-Apr18.pdf + // Sceanrio 1 + // kill layer 5 in one quadrant +5 % random module loss to connect to what was done before + if ( killScenario_ == 1 ) { + layersToKill_ = {5}; + minPhiToKill_ = 0; + maxPhiToKill_ = TMath::PiOver2(); + minZToKill_ = -1000; + maxZToKill_ = 0; + minRToKill_ = 0; + maxRToKill_ = 1000; + fractionOfStubsToKillInLayers_ = 1; + fractionOfStubsToKillEverywhere_ = 0; + fractionOfModulesToKillEverywhere_ = 0.05; + } + // Sceanrio 2 + // kill layer 1 in one quadrant +5 % random module loss + else if ( killScenario_ == 2 ) { + layersToKill_ = {1}; + minPhiToKill_ = 0; + maxPhiToKill_ = TMath::PiOver2(); + minZToKill_ = -1000; + maxZToKill_ = 0; + minRToKill_ = 0; + maxRToKill_ = 1000; + fractionOfStubsToKillInLayers_ = 1; + fractionOfStubsToKillEverywhere_ = 0; + fractionOfModulesToKillEverywhere_ = 0.05; + } + // Scenario 3 + // kill layer 1 + layer 2, both in same quadrant + else if ( killScenario_ == 3 ) { + layersToKill_ = {1, 2}; + minPhiToKill_ = 0; + maxPhiToKill_ = TMath::PiOver2(); + minZToKill_ = -1000; + maxZToKill_ = 0; + minRToKill_ = 0; + maxRToKill_ = 1000; + fractionOfStubsToKillInLayers_ = 1; + fractionOfStubsToKillEverywhere_ = 0; + fractionOfModulesToKillEverywhere_ = 0; + } + // Scenario 4 + // kill layer 1 and disk 1, both in same quadrant + else if ( killScenario_ == 4 ) { + layersToKill_ = {1, 11}; + minPhiToKill_ = 0; + maxPhiToKill_ = TMath::PiOver2(); + minZToKill_ = -1000; + maxZToKill_ = 0; + minRToKill_ = 0; + maxRToKill_ = 66.5; + fractionOfStubsToKillInLayers_ = 1; + fractionOfStubsToKillEverywhere_ = 0; + fractionOfModulesToKillEverywhere_ = 0; + } + // An extra scenario not listed in the slides + // 5% random module loss throughout tracker + else if ( killScenario_ == 5 ) { + layersToKill_ = {}; + fractionOfStubsToKillInLayers_ = 0; + fractionOfStubsToKillEverywhere_ = 0.; + fractionOfModulesToKillEverywhere_ = 0.05; + } + + deadModules_.clear(); + if ( fractionOfModulesToKillEverywhere_ > 0 ) { + this->chooseModulesToKill(); + } + this->addDeadLayerModulesToDeadModuleList(); +} + +void StubKiller::chooseModulesToKill() { + TRandom randomGenerator; + for (const GeomDetUnit* gd : trackerGeometry_->detUnits()) { + if ( !trackerTopology_->isLower( gd->geographicalId() ) ) continue; + if ( randomGenerator.Rndm() < fractionOfModulesToKillEverywhere_ ) { + deadModules_[ gd->geographicalId() ] = 1; + } + } +} + +void StubKiller::addDeadLayerModulesToDeadModuleList() { + for (const GeomDetUnit* gd : trackerGeometry_->detUnits()) { + float moduleR = gd->position().perp(); + float moduleZ = gd->position().z(); + float modulePhi = gd->position().phi(); + DetId geoDetId = gd->geographicalId(); + bool isInBarrel = geoDetId.subdetId()==StripSubdetector::TOB || geoDetId.subdetId()==StripSubdetector::TIB; + + int layerID = 0; + if (isInBarrel) { + layerID = trackerTopology_->layer( geoDetId ); + } else { + layerID = 10*trackerTopology_->side( geoDetId ) + trackerTopology_->tidWheel( geoDetId ); + } + if ( find(layersToKill_.begin(), layersToKill_.end(), layerID ) != layersToKill_.end() ) { + if ( modulePhi < -1.0 * TMath::Pi() ) modulePhi += 2.0 * TMath::Pi(); + else if ( modulePhi > TMath::Pi() ) modulePhi -= 2.0 * TMath::Pi(); + + if ( modulePhi > minPhiToKill_ && modulePhi < maxPhiToKill_ && + moduleZ > minZToKill_ && moduleZ < maxZToKill_ && + moduleR > minRToKill_ && moduleR < maxRToKill_ ) { + + if ( deadModules_.find( gd->geographicalId() ) == deadModules_.end() ) { + deadModules_[ gd->geographicalId() ] = fractionOfStubsToKillInLayers_; + } + } + } + } +} + +bool StubKiller::killStub( const TTStub* stub ) { + if ( killScenario_ == 0 ) return false; + else { + bool killStubRandomly = killStub( stub, layersToKill_, minPhiToKill_, maxPhiToKill_, + minZToKill_, maxZToKill_, minRToKill_, maxRToKill_, + fractionOfStubsToKillInLayers_, fractionOfStubsToKillEverywhere_ ); + bool killStubInDeadModules = killStubInDeadModule( stub ); + return killStubRandomly || killStubInDeadModules; + } +} + +// layersToKill - a vector stating the layers we are killing stubs in. Can be an empty vector. +// Barrel layers are encoded as 1-6. The endcap layers are encoded as 11-15 (-z) and 21-25 (+z) +// min/max Phi/Z/R - stubs within the region specified by these boundaries and layersToKill are flagged for killing +// fractionOfStubsToKillInLayers - The fraction of stubs to kill in the specified layers/region. +// fractionOfStubsToKillEverywhere - The fraction of stubs to kill throughout the tracker + +bool StubKiller::killStub( const TTStub* stub, + const vector layersToKill, + const int minPhiToKill, + const int maxPhiToKill, + const int minZToKill, + const int maxZToKill, + const int minRToKill, + const int maxRToKill, + const double fractionOfStubsToKillInLayers, + const double fractionOfStubsToKillEverywhere + ) { + + // Only kill stubs in specified layers + if ( layersToKill.size() > 0 ) { + // Get the layer the stub is in, and check if it's in the layer you want to kill + DetId stackDetid = stub->getDetId(); + DetId geoDetId(stackDetid.rawId() + 1); + + bool isInBarrel = geoDetId.subdetId()==StripSubdetector::TOB || geoDetId.subdetId()==StripSubdetector::TIB; + + int layerID = 0; + if (isInBarrel) { + layerID = trackerTopology_->layer( geoDetId ); + } else { + layerID = 10*trackerTopology_->side( geoDetId ) + trackerTopology_->tidWheel( geoDetId ); + } + + if ( find(layersToKill.begin(), layersToKill.end(), layerID ) != layersToKill.end() ) { + // Get the phi and z of stub, and check if it's in the region you want to kill + const GeomDetUnit* det0 = trackerGeometry_->idToDetUnit( geoDetId ); + const PixelGeomDetUnit* theGeomDet = dynamic_cast< const PixelGeomDetUnit* >( det0 ); + const PixelTopology* topol = dynamic_cast< const PixelTopology* >( &(theGeomDet->specificTopology()) ); + MeasurementPoint measurementPoint = stub->clusterRef(0)->findAverageLocalCoordinatesCentered(); + LocalPoint clustlp = topol->localPosition(measurementPoint); + GlobalPoint pos = theGeomDet->surface().toGlobal(clustlp); + + // Just in case phi is outside of -pi -> pi + double stubPhi = pos.phi(); + if ( stubPhi < -1.0 * TMath::Pi() ) stubPhi += 2.0 * TMath::Pi(); + else if ( stubPhi > TMath::Pi() ) stubPhi -= 2.0 * TMath::Pi(); + + if ( stubPhi > minPhiToKill && stubPhi < maxPhiToKill && + pos.z() > minZToKill && pos.z() < maxZToKill && + pos.perp() > minRToKill && pos.perp() < maxRToKill ) { + + // Kill fraction of stubs + if ( fractionOfStubsToKillInLayers == 1 ) { + return true; + } + else { + static TRandom randomGenerator; + if ( randomGenerator.Rndm() < fractionOfStubsToKillInLayers ) { + return true; + } + } + } + } + } + + // Kill fraction of stubs throughout tracker + if ( fractionOfStubsToKillEverywhere > 0 ) { + static TRandom randomGenerator; + if ( randomGenerator.Rndm() < fractionOfStubsToKillEverywhere ) { + return true; + } + } + + return false; +} + +bool StubKiller::killStubInDeadModule( const TTStub* stub ) { + if ( deadModules_.size() > 0 ) { + DetId stackDetid = stub->getDetId(); + DetId geoDetId(stackDetid.rawId() + 1); + if ( deadModules_.find( geoDetId ) != deadModules_.end() ) return true; + } + + return false; +} diff --git a/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc b/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc new file mode 100644 index 0000000000000..6122724fa7f7c --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc @@ -0,0 +1,133 @@ +#include "L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" + +#include "DataFormats/DetId/interface/DetId.h" +#include "FWCore/Utilities/interface/Exception.h" + +namespace TMTT { + +std::vector< double > StubWindowSuggest::barrelCut_; +std::vector< std::vector< double > > StubWindowSuggest::ringCut_; +std::vector< std::vector< double > > StubWindowSuggest::tiltedCut_; +std::vector< double > StubWindowSuggest::barrelNTilt_; + +//=== Analyse stub window required for this stub. + +void StubWindowSuggest::process(const Stub* stub) { + + // Half-size of FE chip bend window corresponding to Pt range in which tracks are to be found. + const double invPtMax = 1/ptMin_; + double bendHalfWind = invPtMax/fabs(stub->qOverPtOverBend()); + // Increase half-indow size to allow for resolution in bend. + bendHalfWind += stub->bendResInFrontend(); + // Stub bend is measured here in half-integer values. + bendHalfWind = int(2*bendHalfWind)/2.; + + // Compare with half-size of FE bend window stored in arrays. + this->updateStoredWindow(stub, bendHalfWind); +} + +//=== Update stored stub window size with this stub. + +void StubWindowSuggest::updateStoredWindow(const Stub* stub, double bendHalfWind) { + + // Values set according to L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py + // parameter NTiltedRings for whichever tracker geometry (T3, T4, T5 ...) is used.. + const vector barrelNTilt_T5_init = {0., 12., 12., 12., 0., 0., 0.}; + if (stub->trackerGeometryVersion() == "T5") { + barrelNTilt_ = barrelNTilt_T5_init; + } else { + throw cms::Exception("StubWindowSuggest: the tracker geometry you are using is not yet known to StubWindowSuggest. Please update constant barrelNTilt_T*_init inside it.")<<" Geometry="<trackerGeometryVersion()<idDet()); + + // Modified by TMTT group, so we can update the numbers in the window size arrays. + //int window = 0; + + if (stDetId.subdetId()==StripSubdetector::TOB) + { + unsigned int layer = theTrackerTopo_->layer(stDetId); + unsigned int ladder = theTrackerTopo_->tobRod(stDetId); + int type = 2*theTrackerTopo_->tobSide(stDetId)-3; // -1 for tilted-, 1 for tilted+, 3 for flat + double corr=0; + + if (type<3) // Only for tilted modules + { + corr = (barrelNTilt_.at(layer)+1)/2.; + ladder = corr-(corr-ladder)*type; // Corrected ring number, bet 0 and barrelNTilt.at(layer), in ascending |z| + // Modified by TMTT group, to expland arrays if necessary, divide by 2, & update the stored window sizes. + if (tiltedCut_.size() < (layer+1)) tiltedCut_.resize(layer+1); + if (tiltedCut_.at(layer).size() < (ladder+1)) tiltedCut_.at(layer).resize(ladder+1, 0.); + double& storedHalfWindow = (tiltedCut_.at(layer)).at(ladder); + if (storedHalfWindow < bendHalfWind) storedHalfWindow = bendHalfWind; + } + else // Classic barrel window otherwise + { + // Modified by TMTT group, to expland arrays if necessary, divide by 2, & update the stored window sizes. + if (barrelCut_.size() < (layer+1)) barrelCut_.resize(layer+1, 0.); + double& storedHalfWindow = barrelCut_.at( layer ); + if (storedHalfWindow < bendHalfWind) storedHalfWindow = bendHalfWind; + } + + } + else if (stDetId.subdetId()==StripSubdetector::TID) + { + // Modified by TMTT group, to expland arrays if necessary, divide by 2, & update the stored window sizes + unsigned int wheel = theTrackerTopo_->tidWheel(stDetId); + unsigned int ring = theTrackerTopo_->tidRing(stDetId); + if (ringCut_.size() < (wheel+1)) ringCut_.resize(wheel+1); + if (ringCut_.at(wheel).size() < (ring+1)) ringCut_.at(wheel).resize(ring+1, 0.); + double& storedHalfWindow = ringCut_.at(wheel).at(ring); + if (storedHalfWindow < bendHalfWind) storedHalfWindow = bendHalfWind; + } +} + +//=== Print results (should be done in endJob(); + +void StubWindowSuggest::printResults() { + + cout<<"=============================================================================="<pdgId()), + charge_(tpPtr->charge()), + mass_(tpPtr->mass()), + pt_(tpPtr->pt()), + eta_(tpPtr->eta()), + theta_(tpPtr->theta()), + tanLambda_(1./tan(theta_)), + phi0_(tpPtr->phi()), + vx_(tpPtr->vertex().x()), + vy_(tpPtr->vertex().y()), + vz_(tpPtr->vertex().z()), + d0_(vx_*sin(phi0_) - vy_*cos(phi0_)), // Copied from CMSSW class TrackBase::d0(). + z0_(vz_ - (vx_*cos(phi0_) + vy_*sin(phi0_))*tanLambda_) // Copied from CMSSW class TrackBase::dz(). +{ + const vector &vst = tpPtr->g4Tracks(); + EncodedEventId eid = vst.at(0).eventId(); + inTimeBx_ = (eid.bunchCrossing() == 0); // TP from in-time or out-of-time Bx. + physicsCollision_ = (eid.event() == 0); // TP from physics collision or from pileup. + + this->fillUse(); // Fill use_ flag, indicating if TP is worth keeping. + this->fillUseForEff(); // Fill useForEff_ flag, indicating if TP is good for tracking efficiency measurement. +} + +//=== Fill truth info with association from tracking particle to stubs. + +void TP::fillTruth(const vector& vStubs) { + + for (const Stub& s : vStubs) { + for (const TP* tp_i : s.assocTPs()) { + if (tp_i -> index() == this->index()) assocStubs_.push_back(&s); + } + } + + this->fillUseForAlgEff(); // Fill useForAlgEff_ flag. + + this->calcNumLayers(); // Calculate number of tracker layers this TP has stubs in. +} + +//=== Check if this tracking particle is worth keeping. +//=== (i.e. If there is the slightest chance of reconstructing it, so as to measure fake rate). + +void TP::fillUse() { + + const bool useOnlyInTimeParticles = false; + const bool useOnlyTPfromPhysicsCollisionFalse = false; + // Use looser cuts here those those used for tracking efficiency measurement. + // Keep only those TP that have a chance (allowing for finite track resolution) of being reconstructed as L1 tracks. L1 tracks not matching these TP will be defined as fake. + + const vector genPdgIdsAllUnsigned = {11, 13, 211, 321, 2212}; // Include all possible particle types here, as if some are left out, L1 tracks matching one of missing types will be declared fake. + vector genPdgIdsAll; + for (unsigned int i = 0; i < genPdgIdsAllUnsigned.size(); i++) { + genPdgIdsAll.push_back( genPdgIdsAllUnsigned[i] ); + genPdgIdsAll.push_back( -genPdgIdsAllUnsigned[i] ); + } + + // Range big enough to include all TP needed to measure tracking efficiency + // and big enough to include any TP that might be reconstructed for fake rate measurement. + const float ptMin = min(settings_->genMinPt(), 0.7*settings_->houghMinPt()); + const float etaMax = max(settings_->genMaxAbsEta(), 0.2 + fabs(settings_->etaRegions()[0])); + + static TrackingParticleSelector trackingParticleSelector(ptMin, + 9999999999, + -etaMax, + etaMax, + max(10.0, settings_->genMaxVertR()), + max(35.0, settings_->genMaxVertZ()), + 0, + useOnlyTPfromPhysicsCollisionFalse, + useOnlyInTimeParticles, + true, + false, + genPdgIdsAll); + + const TrackingParticlePtr tp_ptr(*this); // cast to base class. + use_ = trackingParticleSelector(*tp_ptr); +} + +//=== Check if this tracking particle can be used to measure the L1 tracking efficiency. + +void TP::fillUseForEff() { + + useForEff_ = false; + if (use_) { + const bool useOnlyInTimeParticles = true; + const bool useOnlyTPfromPhysicsCollision = true; + static TrackingParticleSelector trackingParticleSelector( + settings_->genMinPt(), + 9999999999, + -settings_->genMaxAbsEta(), + settings_->genMaxAbsEta(), + settings_->genMaxVertR(), + settings_->genMaxVertZ(), + 0, + useOnlyTPfromPhysicsCollision, + useOnlyInTimeParticles, + true, + false, + settings_->genPdgIds()); + + const TrackingParticlePtr tp_ptr(*this); // cast to base class. + useForEff_ = trackingParticleSelector(*tp_ptr); + + // Add additional cut on particle transverse impact parameter. + if (fabs(d0_) > settings_->genMaxD0()) useForEff_ = false; + if (fabs(z0_) > settings_->genMaxZ0()) useForEff_ = false; + } +} + +//=== Check if this tracking particle can be used to measure the L1 tracking algorithmic efficiency (makes stubs in enough layers). + +void TP::fillUseForAlgEff() { + useForAlgEff_ = false; + if (useForEff_) { + useForAlgEff_ = (Utility::countLayers(settings_, assocStubs_, true) >= settings_->genMinStubLayers()); + } +} + +//== Estimated phi angle at which TP trajectory crosses the module containing the stub. + +float TP::trkPhiAtStub(const Stub* stub) const { + float trkPhi = phi0_ - this->dphi(this->trkRAtStub(stub)); + return trkPhi; +} + +//== Estimated r coord. at which TP trajectory crosses the module containing the given stub. +//== Only works for modules orientated parallel or perpendicular to beam-axis, +//== and makes the approximation that tracks are straight-lines in r-z plane. + +float TP::trkRAtStub(const Stub* stub) const { + float rTrk = (stub->barrel()) ? stub->r() : (stub->z() - z0_)/tanLambda_; + return rTrk; +} + +//== Estimated z coord. at which TP trajectory crosses the module containing the given stub. +//== Only works for modules orientated parallel or perpendicular to beam-axis, +//== and makes the approximation that tracks are straight-lines in r-z plane. + +float TP::trkZAtStub(const Stub* stub) const { + float zTrk = (stub->barrel()) ? z0_ + tanLambda_ * stub->r() : stub->z(); + return zTrk; +} + +void TP::fillNearestJetInfo( const reco::GenJetCollection* genJets ) { + + double minDR = 999; + double ptOfNearestJet = -1; + + reco::GenJetCollection::const_iterator iterGenJet; + for ( iterGenJet = genJets->begin(); iterGenJet != genJets->end(); ++iterGenJet ) { + + reco::GenJet myJet = reco::GenJet(*iterGenJet); + + if (myJet.pt() < 30.0) continue; + if (fabs(myJet.eta()) > 2.5) continue; + + double deltaR = reco::deltaR(this->eta(), this->phi0(), myJet.eta(), myJet.phi()); + + if (deltaR < 0.4 && deltaR < minDR ) { + minDR = deltaR; + ptOfNearestJet = myJet.pt(); + } + } + + tpInJet_ = (minDR < 0.4) ? true : false; + nearestJetPt_ = ptOfNearestJet; +} + + +} diff --git a/L1Trigger/TrackFindingTMTT/src/TrackFitGeneric.cc b/L1Trigger/TrackFindingTMTT/src/TrackFitGeneric.cc new file mode 100644 index 0000000000000..450b5f8763cfa --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/TrackFitGeneric.cc @@ -0,0 +1,53 @@ +///=== This is the base class for all the track fit algorithms + +///=== Written by: Alexander D. Morton and Sioni Summers + +#include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/Utility.h" +#include "L1Trigger/TrackFindingTMTT/interface/ChiSquared4ParamsApprox.h" +#include "L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h" +#include "L1Trigger/TrackFindingTMTT/interface/SimpleLR.h" +#ifdef USE_HLS +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFParamsCombCallHLS.h" +#endif +#include "FWCore/Utilities/interface/Exception.h" +#include +#include + +namespace TMTT { + +//=== Set configuration parameters. + +TrackFitGeneric::TrackFitGeneric( const Settings* settings, const string &fitterName ) : settings_(settings), fitterName_(fitterName), nDupStubs_(0) { +} + + +//=== Fit a track candidate obtained from the Hough Transform. +//=== Specify which phi sector and eta region it is in. + +L1fittedTrack TrackFitGeneric::fit(const L1track3D& l1track3D) { + return L1fittedTrack (settings_, l1track3D, l1track3D.getStubs(), 0, 0, 0, 0, 0, 0, 0, 999999., 0); +} + +TrackFitGeneric* TrackFitGeneric::create(std::string fitter, const Settings* settings) { + if (fitter.compare("ChiSquared4ParamsApprox")==0) { + return new ChiSquared4ParamsApprox(settings, 4); + } else if (fitter.compare("KF4ParamsComb")==0) { + return new KFParamsComb(settings, 4, fitter ); + } else if (fitter.compare("KF5ParamsComb")==0) { + return new KFParamsComb(settings, 5, fitter ); + } else if (fitter.compare("SimpleLR")==0) { + return new SimpleLR(settings); +#ifdef USE_HLS + } else if (fitter.compare("KF4ParamsCombHLS")==0){ + return new KFParamsCombCallHLS(settings, 4, fitter ); + } else if (fitter.compare("KF5ParamsCombHLS")==0){ + return new KFParamsCombCallHLS(settings, 5, fitter ); +#endif + } else { + throw cms::Exception("TrackFitGeneric: ERROR you requested unknown track fitter")< +#include + +namespace TMTT { + +TrackerGeometryInfo::TrackerGeometryInfo(): + barrelNTiltedModules_(12), + barrelNLayersWithTiltedModules_(3), + moduleZoR_(), + moduleB_() + { + + } + +void TrackerGeometryInfo::getTiltedModuleInfo(const Settings* settings, const TrackerTopology* theTrackerTopo, const TrackerGeometry* theTrackerGeom) { + + for (const GeomDetUnit* gd : theTrackerGeom->detUnits()) { + float R0 = gd->position().perp(); + float Z0 = fabs(gd->position().z()); + DetId detId = gd->geographicalId(); + + bool barrel = detId.subdetId()==StripSubdetector::TOB || detId.subdetId()==StripSubdetector::TIB; + bool tiltedBarrel = barrel && (theTrackerTopo->tobSide(detId) != 3); + bool isLower = theTrackerTopo->isLower(detId); + + // Calculate and store r, z, B at centre of titled modules + // Only do this for the "lower" sensor + if ( tiltedBarrel && isLower ) { + + // int type = 2*theTrackerTopo->tobSide(detId)-3; // -1 for tilted-, 1 for tilted+, 3 for flat + // double corr = (barrelNTiltedModules_+1)/2.; + + double minZOfThisModule = fabs(gd->surface().zSpan().first); + double maxZOfThisModule = fabs(gd->surface().zSpan().second); + double minROfThisModule = gd->surface().rSpan().first; + double maxROfThisModule = gd->surface().rSpan().second; + + // Calculate module tilt and B at centre of module + double moduleTilt = atan( fabs(maxZOfThisModule - minZOfThisModule) / ( maxROfThisModule - minROfThisModule ) ); + double moduleTheta = atan(R0 / Z0); + double BCorrection = fabs( cos( fabs(moduleTheta) - moduleTilt ) / sin( moduleTheta ) ); + + // Only store if this value of B has not been stored already + bool storeThisBCorrection = true; + for (unsigned int iCorr = 0; iCorr < moduleB_.size(); ++iCorr ) { + if ( fabs( BCorrection - moduleB_[iCorr] ) < 0.0001 ) { + storeThisBCorrection = false; + break; + } + } + + if ( storeThisBCorrection ) { + moduleZoR_.push_back( Z0 / R0 ); + moduleB_.push_back( BCorrection ); + } + } + } + +} + +} diff --git a/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc b/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc new file mode 100644 index 0000000000000..66694fa5f926c --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc @@ -0,0 +1,338 @@ +#include "FWCore/Utilities/interface/Exception.h" + +#include "L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" + +namespace TMTT { + +//=== Initialize configuration parameters, and note eta range covered by sector and phi coordinate of its centre. + +void TrkRZfilter::init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, + float etaMinSector, float etaMaxSector, float phiCentreSector) { + + // Configuration parameters. + settings_ = settings; + + // Sector number. + iPhiSec_ = iPhiSec; + iEtaReg_ = iEtaReg; + + // Eta range of sector & phi coord of its centre. + etaMinSector_ = etaMinSector; + etaMaxSector_ = etaMaxSector; + phiCentreSector_ = phiCentreSector; + + // Note that no estimate of the r-z helix params yet exists. + rzHelix_set_ = false; // No valid estimate yet. + + // Calculate z coordinate a track would have at given radius if on eta sector boundary. + chosenRofZ_ = settings->chosenRofZ(); + zTrkMinSector_ = chosenRofZ_/ tan( 2. * atan(exp(-etaMinSector_)) ); + zTrkMaxSector_ = chosenRofZ_/ tan( 2. * atan(exp(-etaMaxSector_)) ); + unsigned int zbits = settings->zBits(); + unsigned int rtbits = settings_->rtBits(); + float zrange = settings_->zRange(); + float rtRange = settings_->rtRange(); + float zMultiplier = pow(2.,zbits)/zrange; + float rMultiplier = pow(2.,rtbits)/rtRange; + + if(settings_->enableDigitize()){ + zTrkMinSector_ = floor(zTrkMinSector_*zMultiplier)/zMultiplier; + zTrkMaxSector_ = floor(zTrkMaxSector_*zMultiplier)/zMultiplier; + chosenRofZ_ = floor(chosenRofZ_*rMultiplier)/rMultiplier; + } + + // Assumed length of beam-spot in z. + beamWindowZ_ = settings->beamWindowZ(); + + // Name of r-z track filter algorithm to run. + rzFilterName_ = settings->rzFilterName(); + + // --- Options for Seed filter. + //Added resolution for a tracklet-like filter algorithm, beyond that estimated from hit resolution. + seedResolution_ = settings->seedResolution(); + // Keep stubs compatible with all possible good seed. + keepAllSeed_ = settings->keepAllSeed(); + // Maximum number of seed combinations to bother checking per track candidate. + maxSeedCombinations_ = settings->maxSeedCombinations(); + // Maximum number of seed combinations consistent with sector (z0,eta) constraints to bother checking per track candidate. + maxGoodSeedCombinations_ = settings->maxGoodSeedCombinations(); + // Maximum number of seeds that a single stub can be included in. + maxSeedsPerStub_ = settings->maxSeedsPerStub(); + // Reject tracks whose estimated rapidity from seed filter is inconsistent range of with eta sector. (Kills some duplicate tracks). + zTrkSectorCheck_ = settings->zTrkSectorCheck(); + + // For debugging + minNumMatchLayers_ = settings->minNumMatchLayers(); + + //--- Option for duplicate track removal on collection of L1track3D produced after running all r-z filter. + unsigned int dupTrkAlg3D = settings->dupTrkAlg3D(); + killDupTrks_.init(settings, dupTrkAlg3D); +} + +//=== Filters track candidates (found by the r-phi Hough transform), removing inconsistent stubs from the tracks, +//=== also killing some of the tracks altogether if they are left with too few stubs. +//=== Also adds an estimate of r-z helix parameters to the selected track objects, if the filters used provide this. + +vector TrkRZfilter::filterTracks(const vector& tracks) { + + vector filteredTracks; + + for (const L1track2D& trkIN : tracks) { + + const vector& stubs = trkIN.getStubs(); // stubs assigned to track + + // Declare this to be worth keeping (for now). + bool trackAccepted = true; + + // Note that no estimate of the r-z helix params of this track yet exists. + rzHelix_set_ = false; // No valid estimate yet. + + // Digitize stubs for r-z filter if required. + if (settings_->enableDigitize()) { + for (const Stub* s: stubs) { + (const_cast(s))->digitizeForSFinput(); + } + } + + //--- Filter stubs assigned to track, checking they are consistent with requested criteria. + + // Get debug printout for specific regions. + bool print = false; + // unsigned int mbin = trkIN.getCellLocationHT().first; + // unsigned int cbin = trkIN.getCellLocationHT().second; + // if(mbin == 0 && cbin == 45 && trkIN.iEtaReg() == 14 && trkIN.iPhiSec() == 6) print = true; + // cout << "track in region "< filteredStubs = stubs; + if (rzFilterName_ == "SeedFilter") { + filteredStubs = this->seedFilter(filteredStubs, trkIN.qOverPt(), print ); + } else { + throw cms::Exception("TrkRzFilter: ERROR unknown r-z track filter requested")<minFilterLayers()) trackAccepted = false; + //if (numLayersAfterFilters < Utility::numLayerCut("SEED", settings_, iPhiSec_, iEtaReg_, fabs(trkIN.qOverPt()))) trackAccepted = false; + + if (trackAccepted) { + // Estimate r-z helix parameters from centre of eta-sector if no estimate provided by r-z filter. + if ( ! rzHelix_set_ ) this->estRZhelix(); + + pair helixRZ(rzHelix_z0_, rzHelix_tanL_); + + // Create copy of original track, except now using its filtered stubs, to be added to filteredTrack collection. + L1track3D trkOUT(settings_, filteredStubs, trkIN.getCellLocationHT(), trkIN.getHelix2D(), helixRZ, + trkIN.iPhiSec(), trkIN.iEtaReg(), trkIN.optoLinkID(), trkIN.mergedHTcell()); + + filteredTracks.push_back(trkOUT); + } + } + + // Optionally run duplicate track removal on all the 3D tracks found in this sector & store final 3D track collection. + filteredTracks = killDupTrks_.filter( filteredTracks ); + + return filteredTracks; +} + +//=== Use Seed Filter to produce a filtered collection of stubs on this track candidate that are consistent with a straight line +//=== in r-z using tracklet algo. + +vector TrkRZfilter::seedFilter(const std::vector& stubs, float trkQoverPt, bool print) { + unsigned int numLayers; //Num of Layers in the cell after that filter has been applied + std::vector filtStubs = stubs; // Copy stubs vector in filtStubs + bool FirstSeed = true; + const int FirstSeedLayers[] = {1,2,11,21,3,12,22,4}; //Allowed layers for the first seeding stubs + const int SecondSeedLayers[] = {1,2,11,3,21,22,12,23,13,4};//Allowed layers for the second seeding stubs + set uniqueFilteredStubs; + + unsigned int numSeedCombinations = 0; // Counter for number of seed combinations considered. + unsigned int numGoodSeedCombinations = 0; // Counter for number of seed combinations considered with z0 within beam spot length. + vector filteredStubs; // Filter Stubs vector to be returned + + unsigned int oldNumLay = 0; //Number of Layers counter, used to keep the seed with more layers + + std::sort(filtStubs.begin(), filtStubs.end(), SortStubsInLayer()); + + // Loop over stubs in the HT Cell + for(const Stub* s0: filtStubs){ + // Select the first available seeding stub (r<70) + if(s0->psModule() && std::find(std::begin(FirstSeedLayers), std::end(FirstSeedLayers), s0->layerId()) != std::end(FirstSeedLayers)) { + unsigned int numSeedsPerStub = 0; + + for(const Stub* s1: filtStubs){ + if (numGoodSeedCombinations < maxGoodSeedCombinations_ && numSeedCombinations < maxSeedCombinations_ && numSeedsPerStub < maxSeedsPerStub_) { + // Select the second seeding stub (r<90) + if(s1->psModule() && s1->layerId() > s0->layerId() && std::find(std::begin(SecondSeedLayers), std::end(SecondSeedLayers), s1->layerId()) != std::end(SecondSeedLayers) ){ + numSeedsPerStub++; + numSeedCombinations++; //Increase filter cycles counter + if(print) cout << "s0: "<< "z: "<< s0->z() << ", r: "<< s0->r() << ", id:" << s0->layerId() << " ****** s1: "<< "z: "<< s1->z() << ", r: "<< s1->r() << ", id:" << s1->layerId() << endl; + double sumSeedDist = 0., oldSumSeedDist = 1000000.; //Define variable used to estimate the quality of seeds + vector tempStubs; //Create a temporary container for stubs + tempStubs.push_back(s0); //Store the first seeding stub in the temporary container + tempStubs.push_back(s1); //Store the second seeding stub in the temporary container + + double z0 = s1->z() + (-s1->z()+s0->z())*s1->r()/(s1->r()-s0->r()); // Estimate a value of z at the beam spot using the two seeding stubs + //double z0err = s1->zErr() + ( s1->zErr() + s0->zErr() )*s1->r()/fabs(s1->r()-s0->r()) + fabs(-s1->z()+s0->z())*(s1->rErr()*fabs(s1->r()-s0->r()) + s1->r()*(s1->rErr() + s0->rErr()) )/((s1->r()-s0->r())*(s1->r()-s0->r())); + float zTrk = s1->z() + (-s1->z()+s0->z())*(s1->r()-chosenRofZ_)/(s1->r()-s0->r()); // Estimate a value of z at a chosen Radius using the two seeding stubs + // float zTrkErr = s1->zErr() + ( s1->zErr() + s0->zErr() )*fabs(s1->r()-chosenRofZ_)/fabs(s1->r()-s0->r()) + fabs(-s1->z()+s0->z())*(s1->rErr()*fabs(s1->r()-s0->r()) + fabs(s1->r()-chosenRofZ_)*(s1->rErr() + s0->rErr()) )/((s1->r()-s0->r())*(s1->r()-s0->r())); + float leftZtrk = zTrk*fabs(s1->r()-s0->r()); + float rightZmin = zTrkMinSector_*fabs(s1->r()-s0->r()); + float rightZmax = zTrkMaxSector_*fabs(s1->r()-s0->r()); + + // If z0 is within the beamspot range loop over the other stubs in the cell + //if (fabs(z0)<=beamWindowZ_+z0err) { + if (fabs(z0)<=beamWindowZ_) { + // Check track r-z helix parameters are consistent with it being assigned to current rapidity sector (kills duplicates due to overlapping sectors). + // if ( (! zTrkSectorCheck_) || (zTrk > zTrkMinSector_ - zTrkErr && zTrk < zTrkMaxSector_ + zTrkErr) ) { + if ( (! zTrkSectorCheck_) || (leftZtrk > rightZmin && leftZtrk < rightZmax ) ) { + numGoodSeedCombinations++; + unsigned int LiD = 0; //Store the layerId of the stub (KEEP JUST ONE STUB PER LAYER) +// double oldseed = 1000.; //Store the seed value of the current stub (KEEP JUST ONE STUB PER LAYER) + + // Loop over stubs in vector different from the seeding stubs + for(const Stub* s: filtStubs){ + // if(s!= s0 && s!= s1){ + // Calculate the seed and its tolerance + double seedDist = (s->z() - s1->z())*(s1->r()-s0->r()) - (s->r() - s1->r())*(s1->z() - s0->z()); + double seedDistRes = (s->zErr()+ s1->zErr() )*fabs(s1->r()-s0->r()) + (s->rErr()+s1->rErr())*fabs(s1->z() - s0->z()) + (s0->zErr()+s1->zErr())*fabs(s->r() - s1->r()) + (s0->rErr()+s1->rErr())*fabs(s->z() - s1->z()); + seedDistRes += seedResolution_; // Add extra configurable contribution to assumed resolution. + //If seed is lower than the tolerance push back the stub (KEEP JUST ONE STUB PER LAYER, NOT ENABLED BY DEFAULT) + if(fabs(seedDist) <= seedDistRes){ + // if(s->layerId()==LiD){ + //if(fabs(seedDist)layerId(); + // sumSeedDist = sumSeedDist + fabs(seedDist) - fabs(oldseed); + // oldseed = seedDist; + //} + // } else { + if(s->layerId() != LiD and s->layerId() != s0->layerId() and s->layerId() != s1->layerId()){ + tempStubs.push_back(s); + LiD = s->layerId(); + // oldseed = seedDist; + //sumSeedDist = sumSeedDist + fabs(seedDist); + } + } + + //If stub lies on the seeding line, store it in the tempstubs vector + // if(fabs(seedDist) <= seedDistRes){ + // tempStubs.push_back(s); + // sumSeedDist = sumSeedDist + fabs(seedDist); //Increase the seed quality variable + // } + // } + } + } + } + + numLayers = Utility::countLayers(settings_, tempStubs); // Count the number of layers in the temporary stubs container + //sumSeedDist = sumSeedDist/(tempStubs.size()); //Measure the average seed quality per stub for the current seed + + // Check if the current seed has more layers then the previous one (Keep the best seed) + if(keepAllSeed_ == false){ + if(numLayers > oldNumLay ){ + // Check if the current seed has better quality than the previous one + //if(sumSeedDist < oldSumSeedDist){ + filteredStubs = tempStubs; //Copy the temporary stubs vector in the filteredStubs vector, which will be returned + // oldSumSeedDist = sumSeedDist; //Update value of oldSumSeedDist + oldNumLay = numLayers; //Update value of oldNumLay + rzHelix_z0_ = z0; //Store estimated z0 + rzHelix_tanL_ = (s1->z() -s0->z())/(s1->r()-s0->r()); // Store estimated tanLambda + rzHelix_set_ = true; + } + //} + } else { + // Check if the current seed satisfies the minimum layers requirement (Keep all seed algorithm) + if (numLayers >= Utility::numLayerCut("SEED", settings_, iPhiSec_, iEtaReg_, fabs(trkQoverPt))) { + uniqueFilteredStubs.insert(tempStubs.begin(), tempStubs.end()); //Insert the uniqueStub set + + // If these are the first seeding stubs store the values of z0 and tanLambda + if(FirstSeed){ + FirstSeed = false; + rzHelix_z0_ = z0; //Store estimated z0 + rzHelix_tanL_ = (s1->z() -s0->z())/(s1->r()-s0->r()); // Store estimated tanLambda + rzHelix_set_ = true; + } + } + } + } + } + } + } + } + + // Copy stubs from the uniqueFilteredStubs set to the filteredStubs vector (Keep all seed algorithm) + if(keepAllSeed_ == true){ + for (const Stub* stub : uniqueFilteredStubs) { + filteredStubs.push_back(stub); + } + } + + + // EJC Commented out, as nMatchedLayersBest is never set, so CLANG complains + // EJC Leave code in case it is useful for whoever is reading this in the future + // Print Missing Track information if debug variable is set to 4 + // if((settings_->debug()==4 or print) and settings_->enableDigitize()){ + // std::vector matchedStubs; + // unsigned int nMatchedLayersBest; + + // std::vector matchedFiltStubs; + // unsigned int nMatchedFiltLayersBest; + + // if(nMatchedLayersBest >= minNumMatchLayers_ && Utility::countLayers(settings_, filteredStubs) < Utility::numLayerCut("SEED", settings_, iPhiSec_, iEtaReg_, fabs(trkQoverPt))) { + // cout << " ******* NOT ENOUGH LAYERS *******" << endl; + // cout << " ====== TP stubs ====== " << endl; + // for(const Stub* st: matchedStubs){ + // cout << "z: "<< st->z() << ", r: "<< st->r() << ", id:" << st->layerId() << endl; + // } + // cout << "num layers "<< oldNumLay << endl; + // cout << " ====== Matched TP stubs ====== " << endl; + // for(const Stub* st: filteredStubs){ + // cout << "z: "<< st->z() << ", r: "<< st->r() << ", id:" << st->layerId() << endl; + // } + // } else if(nMatchedLayersBest >= minNumMatchLayers_ && nMatchedFiltLayersBest < minNumMatchLayers_){ + // cout << " ******* NOT ENOUGH MATCHED LAYERS *******" << endl; + // cout << " ====== TP stubs ====== " << endl; + // for(const Stub* st: matchedStubs){ + // cout << "z: "<< st->z() << ", r: "<< st->r() << ", id:" << st->layerId() << endl; + // } + // cout << " ====== Matched TP stubs ====== " << endl; + // for(const Stub* st: filteredStubs){ + // cout << "z: "<< st->z() << ", r: "<< st->r() << ", id:" << st->layerId() << endl; + // } + // } else if(nMatchedLayersBest >= minNumMatchLayers_ && nMatchedFiltLayersBest >= minNumMatchLayers_ ){ + // cout << " ******* Track Found *******" << endl; + // cout << " ====== Cell Stubs ====== " << endl; + // for(const Stub* st: stubs){ + // cout << "z: "<< st->digitalStub().iDigi_Z() << ", rT: "<< st->digitalStub().iDigi_Rt() << ", id:" << st->layerId() << endl; + // } + // cout << " ====== Matched TP stubs ====== " << endl; + // for(const Stub* st: filteredStubs){ + // cout << "z: "<< st->digitalStub().iDigi_Z() << ", rT: "<< st->digitalStub().iDigi_Rt() << ", id:" << st->layerId() << endl; + // } + // } + // } + + // Note number of seed combinations used for this track. + numSeedCombsPerTrk_.push_back(numSeedCombinations); + numGoodSeedCombsPerTrk_.push_back(numGoodSeedCombinations); + + return filteredStubs; // Return the filteredStubs vector +} + +// Estimate r-z helix parameters from centre of eta-sector if no better estimate provided by r-z filter. + +void TrkRZfilter::estRZhelix() { + rzHelix_z0_ = 0.; + // float etaCentreSector = 0.5*(etaMinSector_ + etaMaxSector_); + // float theta = 2. * atan(exp(-etaCentreSector)); + // rzHelix_tanL_ = 1./tan(theta); + rzHelix_tanL_ = 0.5*(1/tan(2*atan(exp(-etaMinSector_))) + 1/tan(2*atan(exp(-etaMaxSector_)))); + rzHelix_set_ = true; +} + +} diff --git a/L1Trigger/TrackFindingTMTT/src/Utility.cc b/L1Trigger/TrackFindingTMTT/src/Utility.cc new file mode 100644 index 0000000000000..8aa3a1c04f283 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/Utility.cc @@ -0,0 +1,184 @@ +#include "L1Trigger/TrackFindingTMTT/interface/Utility.h" +#include "L1Trigger/TrackFindingTMTT/interface/TP.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h" + +#include "FWCore/Utilities/interface/Exception.h" + +namespace TMTT { + +//=== Count number of tracker layers a given list of stubs are in. +//=== By default, consider both PS+2S modules, but optionally consider only the PS ones. + +unsigned int Utility::countLayers(const Settings* settings, const vector& vstubs, bool disableReducedLayerID, bool onlyPS) { + + //=== Unpack configuration parameters + + // Note if using reduced layer ID, so tracker layer can be encoded in 3 bits. + static bool reduceLayerID = settings->reduceLayerID(); + // Define layers using layer ID (true) or by bins in radius of 5 cm width (false). + static bool useLayerID = settings->useLayerID(); + // When counting stubs in layers, actually histogram stubs in distance from beam-line with this bin size. + static float layerIDfromRadiusBin = settings->layerIDfromRadiusBin(); + // Inner radius of tracker. + static float trackerInnerRadius = settings->trackerInnerRadius(); + + // Disable use of reduced layer ID if requested, otherwise take from cfg. + bool reduce = (disableReducedLayerID) ? false : reduceLayerID; + + const int maxLayerID(30); + vector foundLayers(maxLayerID, false); + + if (useLayerID) { + // Count layers using CMSSW layer ID. + for (const Stub* stub: vstubs) { + if ( (! onlyPS) || stub->psModule()) { // Consider only stubs in PS modules if that option specified. + // Use either normal or reduced layer ID depending on request. + int layerID = reduce ? stub->layerIdReduced() : stub->layerId(); + if (layerID >= 0 && layerID < maxLayerID) { + foundLayers[layerID] = true; + } else { + throw cms::Exception("Utility::invalid layer ID"); + } + } + } + + } else { + // Count layers by binning stub distance from beam line. + for (const Stub* stub: vstubs) { + if ( (! onlyPS) || stub->psModule()) { // Consider only stubs in PS modules if that option specified. + // N.B. In this case, no concept of "reduced" layer ID has been defined yet, so don't depend on "reduce"; + int layerID = (int) ( (stub->r() - trackerInnerRadius) / layerIDfromRadiusBin ); + if (layerID >= 0 && layerID < maxLayerID) { + foundLayers[layerID] = true; + } else { + throw cms::Exception("Utility::invalid layer ID"); + } + } + } + } + + unsigned int ncount = 0; + for (const bool& found: foundLayers) { + if (found) ncount++; + } + + return ncount; +} + +//=== Given a set of stubs (presumably on a reconstructed track candidate) +//=== return the best matching Tracking Particle (if any), +//=== the number of tracker layers in which one of the stubs matched one from this tracking particle, +//=== and the list of the subset of the stubs which match those on the tracking particle. + +const TP* Utility::matchingTP(const Settings* settings, const vector& vstubs, + unsigned int& nMatchedLayersBest, vector& matchedStubsBest) +{ + // Get matching criteria + const double minFracMatchStubsOnReco = settings->minFracMatchStubsOnReco(); + const double minFracMatchStubsOnTP = settings->minFracMatchStubsOnTP(); + const unsigned int minNumMatchLayers = settings->minNumMatchLayers(); + const unsigned int minNumMatchPSLayers = settings->minNumMatchPSLayers(); + + // Loop over the given stubs, looking at the TP that produced each one. + + map > tpsToStubs; + map > tpsToStubsStrict; + + for (const Stub* s : vstubs) { + // If this stub was produced by one or more TPs, store a link from the TPs to the stub. + // (The assocated TPs here are influenced by config param "StubMatchStrict"). + for (const TP* tp_i : s->assocTPs()) { + tpsToStubs[ tp_i ].push_back( s ); + } + // To resolve tie-break situations, do the same, but now only considering strictly associated TP, where the TP contributed + // to both clusters making up stub. + if (s->assocTP() != nullptr) { + tpsToStubsStrict[ s->assocTP() ].push_back( s ); + } + } + + // Loop over all the TP that matched the given stubs, looking for the best matching TP. + + nMatchedLayersBest = 0; // initialize + unsigned int nMatchedLayersStrictBest = 0; // initialize + matchedStubsBest.clear(); // initialize + const TP* tpBest = nullptr; // initialize + + for (const auto& iter: tpsToStubs) { + const TP* tp = iter.first; + const vector matchedStubsFromTP = iter.second; + + const vector matchedStubsStrictFromTP = tpsToStubsStrict[tp]; // Empty vector, if this TP didnt produce both clusters in stub. + + // Count number of the given stubs that came from this TP. + unsigned int nMatchedStubs = matchedStubsFromTP.size(); + // Count number of tracker layers in which the given stubs came from this TP. + unsigned int nMatchedLayers = Utility::countLayers( settings, matchedStubsFromTP, true ); + unsigned int nMatchedPSLayers = Utility::countLayers( settings, matchedStubsFromTP, true, true ); + + // For tie-breaks, count number of tracker layers in which both clusters of the given stubs came from this TP. + unsigned int nMatchedLayersStrict = Utility::countLayers( settings, matchedStubsStrictFromTP, true ); + + // If enough layers matched, then accept this tracking particle. + // Of the three criteria used here, usually only one is used, with the cuts on the other two set ultra loose. + + if (nMatchedStubs >= minFracMatchStubsOnReco * vstubs.size() && // Fraction of matched stubs relative to number of given stubs + nMatchedStubs >= minFracMatchStubsOnTP * tp->numAssocStubs() && // Fraction of matched stubs relative to number of stubs on TP. + nMatchedLayers >= minNumMatchLayers && nMatchedPSLayers >= minNumMatchPSLayers) { // Number of matched layers + // In case more than one matching TP found in this cell, note best match based on number of matching layers. + // In tie-break situation, count layers in which both clusters in stub came from same TP. + if (nMatchedLayersBest < nMatchedLayers || (nMatchedLayersBest == nMatchedLayers && nMatchedLayersStrictBest < nMatchedLayersStrict)) { + // Store data for this TP match. + nMatchedLayersBest = nMatchedLayers; + matchedStubsBest = matchedStubsFromTP; + tpBest = tp; + } + } + } + + return tpBest; +} + +//=== Determine the minimum number of layers a track candidate must have stubs in to be defined as a track. +//=== The first argument indicates from what type of algorithm this function is called: "HT", "SEED", "DUP" or "FIT". + +unsigned int Utility::numLayerCut(string algo, const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, float invPt, float eta) { + if (algo == "HT" || algo == "SEED" || algo == "DUP" || algo == "FIT") { + + unsigned int nLayCut = settings->minStubLayers(); + + //--- Check if should reduce cut on number of layers by 1 for any reason. + + bool reduce = false; + + // e.g. To increase efficiency for high Pt tracks. + bool applyMinPt = (settings->minPtToReduceLayers() < 10000.); + if (applyMinPt && fabs(invPt) < 1/settings->minPtToReduceLayers()) reduce = true; + + // e.g. Or to increase efficiency in the barrel-endcap transition or very forward regions. + const vector etaSecsRed = settings->etaSecsReduceLayers(); + if (std::count(etaSecsRed.begin(), etaSecsRed.end(), iEtaReg) != 0) reduce = true; + + // e.g. Or to increase efficiency in sectors containing dead modules. + if (settings->deadReduceLayers()) { + const DeadModuleDB dead; + if (dead.reduceLayerCut(iPhiSec, iEtaReg)) reduce = true; + } + + if (reduce) nLayCut--; + + // Avoid minimum number of layers going below 4. + if (nLayCut < 4) nLayCut = 4; + + // Seed Filter & Track Fitters require only 4 layers. + if (algo == "SEED" || algo == "FIT") nLayCut = 4; + + return nLayCut; + } else { + throw cms::Exception("Utility::numLayerCut() called with invalid algo argument!")<= 4 stubs + TP_minNStub = cms.int32(4), # require TP to have >= X number of stubs associated with it + TP_minNStubLayer = cms.int32(4), # require TP to have stubs in >= X layers/disks + TP_minPt = cms.double(2.0), # only save TPs with pt > X GeV + TP_maxEta = cms.double(2.4), # only save TPs with |eta| < X + TP_maxZ0 = cms.double(30.0), # only save TPs with |z0| < X cm + L1TrackInputTag = cms.InputTag("TMTrackProducer", "TML1TracksKF4ParamsComb"), ## TTTrack input + MCTruthTrackInputTag = cms.InputTag("TTAssociatorTMTT", "TML1TracksKF4ParamsComb"), ## MCTruth input + # other input collections + L1StubInputTag = cms.InputTag("TTStubsFromPhase2TrackerDigis","StubAccepted"), + MCTruthClusterInputTag = cms.InputTag("TTClusterAssociatorFromPixelDigis", "ClusterAccepted"), + MCTruthStubInputTag = cms.InputTag("TTStubAssociatorFromPixelDigis", "StubAccepted"), + TrackingParticleInputTag = cms.InputTag("mix", "MergedTrackTruth"), + TrackingVertexInputTag = cms.InputTag("mix", "MergedTrackTruth"), + ## tracking in jets stuff (--> requires AK4 genjet collection present!) + TrackingInJets = cms.bool(True), + GenJetInputTag = cms.InputTag("ak4GenJets", ""), + ) + +#--- Run TMTT track production +#--- Also run the ntuple production for each tracking algorithm +process.load('SimTracker.TrackTriggerAssociation.TrackTriggerAssociator_cff') + +process.TMTrackProducer.TrackFitSettings.TrackFitters = cms.vstring() +#--- TMTT tracks : KF4ParamsComb +if 'KF4ParamsComb' in options.trkFitAlgo: + process.TMTrackProducer.TrackFitSettings.TrackFitters.append("KF4ParamsComb") + + process.TTAssociatorTMTTKF4ParamsComb = process.TTTrackAssociatorFromPixelDigis.clone( + TTTracks = cms.VInputTag(cms.InputTag("TMTrackProducer", 'TML1TracksKF4ParamsComb')) + ) + process.L1TrackNtuple_TMTT_KF4ParamsComb = process.L1TrackNtuple.clone( + L1TrackInputTag = cms.InputTag("TMTrackProducer", 'TML1TracksKF4ParamsComb'), + MCTruthTrackInputTag = cms.InputTag("TTAssociatorTMTTKF4ParamsComb", 'TML1TracksKF4ParamsComb'), + ) + process.p_TMTT_KF4ParamsComb = cms.Path( process.TMTrackProducer*process.TTAssociatorTMTTKF4ParamsComb*process.L1TrackNtuple_TMTT_KF4ParamsComb ) + +if 'KF5ParamsComb' in options.trkFitAlgo: + process.TMTrackProducer.TrackFitSettings.TrackFitters.append("KF5ParamsComb") + + process.TTAssociatorTMTTKF5ParamsComb = process.TTTrackAssociatorFromPixelDigis.clone( + TTTracks = cms.VInputTag(cms.InputTag("TMTrackProducer", 'TML1TracksKF5ParamsComb')) + ) + process.L1TrackNtuple_TMTT_KF5ParamsComb = process.L1TrackNtuple.clone( + L1TrackInputTag = cms.InputTag("TMTrackProducer", 'TML1TracksKF5ParamsComb'), + MCTruthTrackInputTag = cms.InputTag("TTAssociatorTMTTKF5ParamsComb", 'TML1TracksKF5ParamsComb'), + L1Tk_nPar = cms.int32(5), + ) + process.p_TMTT_KF5ParamsComb = cms.Path( process.TMTrackProducer*process.TTAssociatorTMTTKF5ParamsComb*process.L1TrackNtuple_TMTT_KF5ParamsComb ) + + +#--- TMTT tracks : SimpleLR +if 'SimpleLR' in options.trkFitAlgo: + process.TMTrackProducer.TrackFitSettings.TrackFitters.append("SimpleLR") + + process.TTAssociatorTMTTSimpleLR = process.TTTrackAssociatorFromPixelDigis.clone( + TTTracks = cms.VInputTag(cms.InputTag("TMTrackProducer", 'TML1TracksSimpleLR')) + ) + process.L1TrackNtuple_TMTT_SimpleLR = process.L1TrackNtuple.clone( + L1TrackInputTag = cms.InputTag("TMTrackProducer", 'TML1TracksSimpleLR'), + MCTruthTrackInputTag = cms.InputTag("TTAssociatorTMTTSimpleLR", 'TML1TracksSimpleLR'), + ) + process.p_TMTT_SimpleLR = cms.Path( process.TMTrackProducer*process.TTAssociatorTMTTSimpleLR*process.L1TrackNtuple_TMTT_SimpleLR ) + + +#--- Tracklet tracks +if 'Tracklet' in options.trkFitAlgo: + process.load("L1Trigger.TrackFindingTracklet.L1TrackletTracks_cff") + process.TTAssociatorTracklet = process.TTTrackAssociatorFromPixelDigis.clone( + TTTracks = cms.VInputTag(cms.InputTag("TTTracksFromTracklet", "Level1TTTracks")) + ) + process.L1TrackNtuple_Tracklet = process.L1TrackNtuple.clone( + L1TrackInputTag = cms.InputTag("TTTracksFromTracklet", 'Level1TTTracks'), + MCTruthTrackInputTag = cms.InputTag("TTAssociatorTracklet", 'Level1TTTracks'), + ) + process.TrackletPath = cms.Path(process.offlineBeamSpot*process.TTTracksFromTracklet*process.TTAssociatorTracklet*process.L1TrackNtuple_Tracklet) + + + +# Optionally reproduce the stubs +if options.makeStubs == 1: + process.load('L1Trigger.TrackTrigger.TrackTrigger_cff') + process.load('SimTracker.TrackTriggerAssociation.TrackTriggerAssociator_cff') + process.TTClusterAssociatorFromPixelDigis.digiSimLinks = cms.InputTag("simSiPixelDigis","Tracker") + process.p = cms.Path(process.TrackTriggerClustersStubs * process.TrackTriggerAssociatorClustersStubs * process.TMTrackProducer) + + +from FWCore.ParameterSet.Utilities import convertToUnscheduled +process=convertToUnscheduled(process) diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/README b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/README new file mode 100644 index 0000000000000..a2b8874452572 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/README @@ -0,0 +1,7 @@ +RelVal/ contains CMSSW 10.4.0 RelVal samples requested by the P2 L1 trigger group. + +They use the D21 = T6 geometry. + +They are made with the stub window sizes that you can find in L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py . + +Typical dataset name /RelVal*/CMSSW_10_4_0*upgrade2023*D21*/GEN-SIM-DIGI-RAW diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/DisplacedSingleMuPt1p5to8/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/DisplacedSingleMuPt1p5to8/PU0.txt new file mode 100644 index 0000000000000..808895461d5f3 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/DisplacedSingleMuPt1p5to8/PU0.txt @@ -0,0 +1,50 @@ +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/2B08B59B-FC39-A346-B6DA-60BE26BE27F7.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/2AC16628-2562-5444-A0D4-46549E0BF56A.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/276ED465-CE58-EA4C-8232-B3FC5158A133.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/24016857-D22C-7F4D-86DF-30BD658D0D1D.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/1DC78EEB-2867-C24E-9EE4-478F8939CAA6.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/1A66E81D-DDE1-284F-B710-9C78FD2992E7.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/1A322DDA-8177-BA41-8CAD-E7408B09BB29.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/194E9152-3126-D149-90A4-97A018D38EC3.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/117CCFF9-DA1E-374B-8626-35C89D91C4E7.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/0F10EEAA-3978-7540-A6DB-6ADCAC483246.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/0C9655CC-AF30-2E46-AA50-F44E964092CD.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/071EB771-3316-DE4C-8AF7-B41BDDD2EC6C.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/06E525ED-38A8-FD47-A176-E44DF738A763.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/03D7D282-2ADC-6141-B376-74B24DF2FF61.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/FB90FEA7-43C8-C449-B5B7-1BE31F6E6CFA.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F5BCC588-7F2D-3142-8B71-22BE4C009EA6.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F221C75F-F6FF-9344-9D04-107DDDDBEBA7.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/ED8191DC-4AEA-8647-8EB8-876A3C9611ED.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E9836F0C-0D3C-1B41-A552-5CFF0E31A801.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E687135B-D7E4-1B42-BB7B-BC41DDD4E1A2.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E3B687CA-16F0-914F-A583-448FFBD18594.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E31DF841-5F8B-7943-ADEC-9D770E69B940.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/DB5207A7-ADE2-5245-B041-A3CBB651C2D5.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D3EB0073-CCED-194E-99CA-2C66F07F0E91.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/CCA116FB-DFD7-CE49-BCA2-FF3827AD6B19.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/CA78BFFC-1C8F-0D4C-8703-6E55F29E8DC7.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C58335C7-D9EB-7041-B10B-266522D3A437.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C33CC523-7E13-A24B-8521-15AEB143F510.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C1376A68-2852-B242-9F77-45230B930A4A.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/BB503F31-E202-DE4D-A402-8EC014BE1159.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B4E0E143-18BF-2544-9E2A-E38578A08765.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9D7BA410-6E16-C14E-9A02-EB0AE03FC467.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9BD540DA-132F-F148-815E-7456D2830AF8.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9B2A9F05-9643-9E48-95A0-790CCCAF7E5D.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9764E8CB-DF3F-5F4C-B2DA-1FBAA69194BE.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/867F04B7-8177-1444-BD08-5171AA14D107.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/85A3147E-8BF6-704B-AAD4-240A8B620A1A.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/701C3870-971D-7B4F-8641-1B0C112F6FD4.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/67A0F05F-8A20-B14D-A4B5-F7A516C7A44E.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/61F0D562-D5D6-D042-BD08-E42AAA50066D.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/615E9805-679F-6344-BD7B-E851CEA6CA04.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/558C789D-BE9B-9542-9B38-088335FF396C.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/547976A6-3516-034D-B293-87D23F49E319.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/5460216E-590D-5A42-BECD-06F5B7F9BC19.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/524E3C86-908A-7C43-ADBF-B720E7D18500.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/514FF9C7-8FE4-FD40-A8A0-B7112A5EF9B0.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4E403DEC-13DD-5E47-BDCC-A9E834F0F053.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/45512F39-AF56-6645-BF02-47232A3CEDE0.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/3F27EFB7-4F56-6042-8B83-C07FA2BA2806.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/3A56DA1B-3872-FF42-94C6-3212ABBA050F.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/DisplacedSingleMuPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/DisplacedSingleMuPt2to100/PU0.txt new file mode 100644 index 0000000000000..c14936ee34820 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/DisplacedSingleMuPt2to100/PU0.txt @@ -0,0 +1,50 @@ +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/FC59ABB5-7DBC-BD49-8813-8DD86B6AABD5.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F94D7475-4B54-174D-B9B8-DB97A4493253.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F808C825-C981-664F-8537-866DF1EA1D4F.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/ECFEC7F5-C7FE-364F-A850-11F391FA8FFC.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E65D1521-485C-2749-A27C-37FF540DA463.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E5282659-D069-A446-BE74-47536E1F58DC.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E2E44FEA-CF82-244C-B7F5-51A33EA508A1.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/DF6F3639-6143-0040-BA9F-5D666F2B3E4C.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/DA158699-D050-9D4D-BA1E-D30C14C7E53E.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D4F43B02-86D4-5E47-B061-470FDE5B73AD.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D11319E6-D54E-3848-8B31-CDABEE4964E7.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/CB84F507-3E9C-C34D-A416-900C372FF1E1.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C478852A-ACFC-8046-BE10-45F547A72E98.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/BB7941FE-C1AB-C14C-B008-AADD69878221.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B9E890F6-EF98-234D-A47C-24FD3B21E28B.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B70EAA2D-80D3-944D-9768-76DC6E4A6985.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B49E0617-D553-9941-8520-FC5609566DDE.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/ADF1B820-DC36-4B4A-A955-92223799B6D9.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A2A802D4-1A8C-CA4C-8B22-8283C4CA0EBC.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A08D4FE1-9572-7740-A13D-7A34E2D08FFC.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A0222C3F-E741-B44A-8F77-C7F0CF770D9A.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9D7DDF14-B94A-F446-B2BE-111A71FC791A.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/94993B71-ACB5-A24E-98F2-30F8C4AA5EAF.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/913DE5AD-A490-C040-9502-F08E939C30F6.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/85A124BA-3971-A340-8500-652DA0C5546C.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/8469B740-E051-F445-97D6-133166CFB609.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7CA41071-A8D7-2143-B41D-397552D887B3.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6DA18E7E-FF2F-D945-9564-112F6A073977.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6C7ACAB1-837E-6149-8287-37ED1D5B4AC5.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6BA0D84C-0BF7-2445-A100-2A75904EDBA0.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/64EB6154-E55F-A042-84D4-AC40B69F212B.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/63783F66-75A7-A24F-A8E3-22DB2CF25E97.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/5CAB253D-8597-494E-81ED-AE2CBE65567B.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/5A7B98AB-BDA0-EF40-89DA-11A750387DF7.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/567AF1B0-8B01-0741-83CE-4D7351617F1C.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/54FE95A7-FD15-E040-B65A-0670C859FE6D.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/536C7147-0495-5549-B483-4E781486AB1D.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4EB4A7A1-EED4-7848-AD0D-8FB7143C7D9C.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4097BE1B-FF65-DE47-80E0-01D281E0B91E.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/363FB61A-3F7C-9249-8032-D92B0D6EAD4D.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/31AB927B-8D9C-094C-9294-1069E3D19D43.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/2CA8B429-3122-F449-ABFB-A654C01A4279.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/2C346C63-F6AC-6448-8559-E0487F7CB7F9.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/2B11DAA7-EDCB-FB4B-960F-37993BB99517.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/1F46406F-D4BE-4C48-B6CE-096941EBED1F.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/11681F63-E923-1D43-8C1D-699E8F56F950.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/088F004F-158D-DB45-93EF-7F1881D5FD32.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/0669219C-FD1C-714C-BC12-DD206FAFB677.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/061949E5-0B4F-E54A-8CB7-B5496676D8E6.root +/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/043E854F-870C-304E-B630-809A36D64306.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/OnlyPU/PU200.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/OnlyPU/PU200.txt new file mode 100644 index 0000000000000..aab9aa0c2d7f4 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/OnlyPU/PU200.txt @@ -0,0 +1,179 @@ +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5726AB33-943F-4347-988B-FC7639CF95FF.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/56854661-7D4B-EA4B-9FB2-41515A8B86BC.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/54B95020-149F-BF47-A593-0DF78B2CEFB2.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5491C7F6-73FB-6F40-B4C8-05A4257199D9.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5412760D-2A44-CF4A-9CB4-F6232834068E.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/52CFC734-F836-BE42-AE61-2B917CFD9DC3.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/522A896D-DAF9-C140-8E1E-B240D3FAA792.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/51E83C0D-B5D8-7545-B2C8-D7E2DB5E3F92.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/4FB19C80-D7DC-CD4E-AB7E-0509963DE19A.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/4C775694-58D7-194A-9EE8-D77F57774AF8.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/481FDEA2-FA46-B04A-8E44-2798433C0BBC.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/47233DAD-EAAE-444B-82AE-4E73CBE04E5E.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/4664A420-3C31-DC45-A437-E0F5E8A4C109.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/43A52F06-67B5-2A4E-848D-0ABD2D7C02B9.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/42C73522-74A3-8648-A137-570E2D98D4EF.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/41030220-4832-674A-ADEA-E89BD7D7DEEB.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/3E41F06B-F8C3-3C45-AA9D-8A289294107C.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/3DDE3DE5-682E-2D49-B1C7-4A569A5C10C5.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/3C1B5618-1A46-3C4A-BD75-2232C78AC23E.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/3AF6EEA7-4245-C347-AACC-9D65686BFCAA.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/34E20553-DB93-E740-974D-13F9BD73D58C.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/349B02BA-5BBB-E248-97B6-454C668FB43E.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/3432BE05-459C-6743-B559-887CB2BE9650.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/318620BF-E9A8-5C42-B81F-3EFA3A1922F1.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/315BD2DF-EC0F-6040-BA98-A15385150F44.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/2ECB34E4-FDD4-B245-A2A8-7799B109EFF9.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/2DE0237D-8299-1A40-B840-A8D29073AFC3.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/2CBA376C-06F0-0F4A-8A12-F197E5FCE709.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/2B0A7FD8-2915-C846-A148-A86F1A3A7F93.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/29DFAF60-8942-DC43-90A8-D4C9C1A2CD06.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/28F839A1-A8DF-CD40-B727-DCAF9E5F34D9.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/283E5EAC-166D-9844-9D1A-A3B412BCD706.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/27D40F9C-8C30-2F47-85E4-AE53CE428909.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/24C4C5F7-59FF-274D-B02B-60B53D484C4F.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/22167B8B-B98F-4742-A2C7-90F043CE5E37.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/21808F47-5D2A-DC46-8BEC-3D5634315230.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/209FEAA6-7ED3-FD40-BE90-332219CCB14D.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1FB01AD5-E2BB-AB45-8AAC-7EAAF868A390.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1F06D25D-E70B-0146-A582-613423D3FB42.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1EB8E2CE-B139-BE4E-800A-98EDFD0C5ECA.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/FFED59B0-EE4A-1F45-8811-CC7EA23B1C61.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/FEFA9E9E-6E23-5B4A-B1DD-C48AF7AD76DA.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/F777C2BB-D4D0-C342-9AA1-F49632F71BA8.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/F674F7E8-C34F-4F4C-B199-CEF90B187A9D.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/F5A80FC4-6744-514E-B587-A6138E4DC3F1.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/F44A2095-45EB-1E4E-8DD4-2B53B14938B3.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/F2D8D0A6-DFC8-E24F-9416-357E50E2D201.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/F09B3AD5-5F32-8C4E-AEFB-0C0ACBAFF8A8.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/EFBA0033-F1C6-E34C-947A-D290B3ADCCD4.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/EEC19556-2AB0-6B4A-9CB9-F20665E67099.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/EC9A9B76-F8A9-5449-A336-F3B843BE6320.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/EB8456B9-88CA-4346-B312-3DA2CD830552.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/EB604DBF-939A-0C44-92A0-73702A0CDACE.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/EB13B700-2929-374F-9076-E7B4C4F6C756.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/E4D69ED8-9DF2-864B-8064-DB35990DE75A.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/E4AEB845-77A8-274A-A849-CEE9945C2752.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/E3F1D6E7-C55B-754A-A895-50AE1386EDEE.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/E305A6C9-C5F1-4F4B-AF87-8A9FFDFC4589.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1DEA046F-5B58-044C-B1FA-5CACBDB90701.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1DAE1F5B-4619-934B-8AE5-7FF420C8C079.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1D00A049-FBE1-8B4D-A8DC-8B4F9DC35E7E.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1C972148-85D0-2146-A307-F7A65C7AB0C4.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1BBAE93E-C68D-FB4C-A310-91C7EBA46A86.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1B5F2D9B-D37D-8A4A-A6C8-E9B5CB4F1E5A.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1A5A7440-9338-7542-BAB6-D63EFB6AA402.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/178C8BFD-FCF3-B449-A7EC-1900A483D799.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/161A7EB7-FCDA-AC47-B01F-D4FB58941E5F.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/150EAFC9-E9F1-454E-8E8C-6043FC460100.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/150DCCF8-0ECA-F843-A40C-0318718D3C89.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/13BAEB21-524D-D441-8C5A-70DC0976343D.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/121590ED-995A-844B-B9C4-2BFC75D08FDB.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/11386F3A-41B1-A34B-83D3-5EEA81EB145E.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/10A7D496-25AF-1B4C-B294-992FED90A4F4.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0F3C1AA8-C098-334A-9620-C7AB7201C139.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0D3DB4C9-32F4-AF42-8517-24EED61F83EE.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0A614D06-EC19-8843-9BC3-FD5A602CD9F0.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0A5D1CA3-690C-CC40-B0BB-196F7A946DCA.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/07B5C463-E76E-A54E-BA6C-01F7B06C1841.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/04906F11-2AAC-F44C-B1EE-14973E7BC7B0.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/03BEDD2A-EF7D-4E4A-9CB7-620A80C58C7F.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/01FAC2BC-95CE-6647-A889-05595CE317A5.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/005FA6D6-05C9-3244-9B46-DCA48630E32F.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5B541F71-9452-C443-90A0-7504761F4141.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/58B8BA39-05B0-A54C-80DA-AA62784B5AB8.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/58915962-42FC-1B48-843D-A876B4C935C2.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/586E7477-C9F2-0F4E-ABBA-7949247E05EE.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5855D838-D99C-BD4D-A862-3448F181F4BB.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/58187043-581D-9F42-A883-8F9278FC6B63.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5C1E4149-C7FB-3942-8523-16A9BE4ABE11.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5B66A6F0-6133-334E-BF6C-0B9371653E32.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/E05F9A21-D32F-8A40-A20D-FDC4F82CAF18.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/DFD4A9AB-5327-1E4D-8E4A-503D0152C57B.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/DE805FF0-922F-0745-9DAA-89371985E887.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/DE23B3C2-877B-DB41-9CCA-9234767FC9CD.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/DCEFF0AF-FBC2-0647-B045-50715733599B.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/DC3C6143-F994-394D-98BE-69DC1F653F24.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/DA932F03-BBB2-1745-8D09-0B50745D66B1.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/D8CB0406-31A2-A542-A3CB-485FD5D15BF2.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/D8799812-7275-1647-ACD8-5457D74F997B.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/D72E61AB-89F2-6A41-92F9-278EE5DD973D.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/D566B71C-5258-1F4F-A5F2-FB4A1A116297.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/D0AE34B5-9B54-3E43-AB9D-408C115D4646.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CF11170A-C40E-9E49-971B-79E085A9510A.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CE46463E-2CAE-9A49-B6BC-3B2CDD6068F9.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CDEBDF93-8C63-A34E-8C95-C3FFBCD4EFE0.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CDCABBE3-A468-A749-A866-B40D60470373.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CD01E2C0-2503-E841-AA9D-48B1CB05DD72.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CA60C2F6-D7FD-4047-A3E7-E43C722EDDCC.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C5A3A198-CE16-474D-81CC-509328D76976.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C34A917C-2BA2-CD43-B2A5-43D7973FC78E.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C2A92EA2-DA6E-CB4A-8975-B0151AFCC8B6.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C2898E3F-F469-C545-8CB5-9E047CF52390.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C022A8EE-0873-8449-A8E2-1EB5915CCB8E.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/BFFFC3CD-A623-CD48-845D-DA9A479568F3.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/BFF15079-AB46-9540-B4EC-00624D1A9E54.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/BFABA9A6-67A4-5943-99CA-B4F7579AECD8.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/BF8ABFE4-8D5D-0948-8EF5-F806FE55DECC.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/BD0F7BB4-EC86-BD4F-A84A-528A0A9F866C.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/BB3102C3-43F8-8844-86BD-EEE8FBCBFCB8.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B9B666D4-91D8-C342-927C-7D426E3C05EE.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B53B3350-1022-E945-9AE0-3D8C365D6245.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B4D02C4E-8EC9-0446-9908-42F1455046B0.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B3F4C6B1-26FD-C944-B578-C0B40BF9922C.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B2CB6E13-78B9-3145-BB85-25AE2215DEF0.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B245FC4A-5B7E-E043-AC77-5FF65B0FF1A9.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B13125C2-498C-C84D-92F3-BD6B138D7163.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/AC0D16F9-4A35-7A41-9181-30AC2A4A1343.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/A695CB87-A694-DF44-B40B-07BB8F242EF1.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/A4A698ED-AEC1-9241-B57D-6D195FAD23EB.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/A3CF060F-E92B-9C46-A1DD-01155011617B.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/A30CE693-1AF3-154E-9ADA-B7DE22C26B58.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/A2160289-E780-4044-86BD-0CC2DFCDBF9A.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9FD2652A-F6F2-F34A-A528-EC45F7927E28.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9D7A3398-293F-4643-A590-7185FBF31912.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9D078A8A-815B-8147-BF51-54E185413DE2.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9A91C278-E4B6-4E4D-8D49-D3E0F3D2E246.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/98C35E02-9129-9042-A624-DB2CFE53E394.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/97DB3A19-6D18-5C49-8905-0A0E93747ADC.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9400A38C-05BF-8248-B34D-2B5E48A03779.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9087C285-0186-BF4F-895F-E6B272A1CA9A.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8FEE0CD6-B45D-0949-B117-09728E2FD16F.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8F511B11-B53B-9F42-9372-B2AB1B0DD867.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8EF1466D-B2EA-A649-B058-5E20755AE0AC.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8CD00BF0-5572-154A-9420-FD7917F4C6C7.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8CCF881E-F3DE-7947-9703-743EB58C57B7.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8AE3C14F-EB99-F345-BD0E-99E1686EEC77.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8916F82D-1A95-DE42-A11B-9A41701BC57C.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/88CCCF45-5C51-704C-AF8D-54D77073D6CC.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/86375387-6DF5-8249-9B91-5B4E9061268A.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/85BD9000-5CD4-5B40-A1DB-4C20C06ACCC1.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/842F1E88-17FB-FD45-86CC-228F1AFD78ED.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8178B21A-F5DA-7343-89B0-F96ABE6C7D14.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/816B607F-C682-0D4A-89E0-33DD84AC1359.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/7FEF1B0E-CF1B-6D4F-9592-8832C6C0215E.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/7F79ECE9-511E-5844-B5F2-1592AD6E6CEC.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/7F2180CE-4BEB-2C4E-A450-452E646FCEB4.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/7E1E4B7A-2DB6-4F42-8C7E-38BC13B11C51.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/7D12C55E-3847-2A47-A3E5-C3A2E68EAC67.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/7BC72C74-EA82-6343-A437-C2C54E675B20.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/7B9E6B8D-07BD-F540-9CEC-35318E927781.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/79E20705-1C9B-084F-A713-94819704940C.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/71A9D6FC-02EA-5341-82A1-9B823C9BD0D2.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/706A3002-4E25-D743-A1FA-50621E8317FA.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/6F3A5B45-7A43-BD41-B1B4-D7C1C186B7DD.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/6EEACEC3-5B02-C840-8709-00920B87C451.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/6C4F4F3E-0729-8843-A95F-9E0BACAEF1C8.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/6C3842D2-F6E3-AF49-A962-2EB5AA45A06F.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/693CAFC2-F071-9E4D-A769-7B398128AA5C.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/691E641A-4589-8443-B34A-7DC1ED4384CC.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/66E089C6-D478-474C-A501-1D1595BD6ED1.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/66D5F7AD-954B-CB4F-A62D-F66D495B3E31.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/659FAC2C-128F-6F4B-9E18-012E905DFB8F.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/64A557FD-9C57-9444-9D33-B30B86B55F5E.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/6466B79C-1421-734A-B68F-4F944618B168.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/641DDCE6-199F-EB4B-A19D-76694DC7AC4C.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/634D1027-37EE-5A4B-83F5-3539928AA83C.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/621F3777-3823-CB43-B612-1FEDBC14AF90.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/62136985-CCD8-F84C-B904-0F4FD43A9AEB.root +/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/61F57B0D-106D-4A44-8274-40B260962F77.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleElPt1p5to8/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleElPt1p5to8/PU0.txt new file mode 100644 index 0000000000000..cab9105087b20 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleElPt1p5to8/PU0.txt @@ -0,0 +1,50 @@ +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/FF23CE0A-A8CB-484F-9C45-107877940D7A.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F3CE70E8-EE88-CB40-B21A-FDFD2D51CAB2.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/EED29E4A-CD26-1F4E-80AB-A978F70E218E.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/EB3056C0-2A69-4848-8C5D-46ECB46B6A57.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E73297F9-DCE6-1441-92A8-78E7DC99FA04.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E67DEBC7-4165-1B4E-9B24-C5FE74BEA2FC.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E3BC8F02-D202-2C4C-8698-D047DAF82324.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E106AAC5-E8A7-0846-ADFA-DB1D90A9D4E6.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D65A11B7-DDDF-2345-8010-317ADCDE3267.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D5AF2769-BDCE-1D4F-BC33-0FD0B95A5592.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D49E01C0-172D-C94F-9367-44A81D074262.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D3BF4E57-3307-2B45-8270-9FA42B549FC3.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D06D43C8-4990-8A4E-9FE5-4A2255F32354.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/CE88A14C-ED3E-4F4F-8AF5-956C9040E674.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/BE1CB7AC-DFA2-BE43-B7B1-90A610A4C455.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B9ADBEE8-26FF-0D46-8849-54B1BD8A1B22.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B0960191-6981-7D41-BD30-DF9EA73958E1.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/ADE0C7D9-3F5E-0D48-AB86-580D9C5C1D5F.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/ADA18496-FE4C-404B-B907-8DB399C9868C.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A51FA22D-A7D8-B649-9F94-3A7AABF5FE05.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A06E76A0-C647-BB45-8AFE-28E51D876FC3.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9EE1BE3A-78A6-5141-8698-5776F4C046D6.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9E029F9D-BA42-AE42-8F1D-C022D428F973.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9C92083A-2C1F-6F4D-B494-17894C660F11.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9B411875-9980-0E44-929A-303D57185514.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/98CEBB64-7796-0A43-9382-75F558E8A350.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/8C480006-716B-904F-8D67-853DF4AC095E.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/8B6305A2-DB81-0D43-BCFB-7E83CDC5D1B5.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7E7A8D78-759F-CB4E-9D8F-0D3C3571235C.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6E799B38-81D1-EB4C-8F78-AF6F9B57350B.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/66DBD232-EC86-F141-B3BF-530AD4E8B601.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/5B8DB4CF-2D1A-AB47-89B9-0CFF5DB55EE5.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/588BF029-B523-6347-BEAA-7341ED8A0F23.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/5494DE4F-7866-C841-828A-3BCBC5FEE41A.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/527EB167-3978-F84A-8C41-CA8D26851D1D.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4B45FA32-8584-6A47-9C0D-405B2B4CE6D5.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4AE884DB-DD88-2E41-87CA-E4B04A8959FF.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/49EAA391-85C9-634D-8574-3F013719E445.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/400AC460-6369-B348-9E15-A1548EA8A446.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/32618055-4962-CE4E-A54D-51FDE05DEEBF.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/29B088CB-66E1-0940-852C-704035E50E1A.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/29713F58-A988-2140-9B57-F02B80F8DA55.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/27A37DF6-700C-F249-BD02-FA83986EAE97.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/24D95E45-F45C-AE46-81F7-8745341C581B.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/1E392580-6458-9942-AD63-4E66F7E64390.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/17D8D917-7252-9A46-AB8E-C28D6329C5C4.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/152BC653-B777-694D-B381-22FEEC2A9E65.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/128E6289-4477-CB4B-93F7-AFD7B0D46387.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/0B9C2424-26E2-234A-9A79-44491EFE8852.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/07FE3B0A-D207-3942-85FD-64D716DD5349.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleElPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleElPt2to100/PU0.txt new file mode 100644 index 0000000000000..51eacf2c476a5 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleElPt2to100/PU0.txt @@ -0,0 +1,50 @@ +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E74D908F-341D-D045-8230-4DA125F3DF60.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E159A7AC-AA55-4B4A-AD4F-F043D0603E5E.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D977A710-5047-614D-96FC-3BA790A80642.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D8EBED2C-9BE8-AB42-A645-B8A6B9AABD19.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D2ED5DEE-32E1-D743-A993-47FAE7E18E9F.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D2BDBC69-C30A-C34D-BBBD-FFE6C52FA06D.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/CDAF63CB-C479-F341-A84E-14717A4060BA.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/CB62733E-EA40-7046-A3A0-0E764CC0BAFB.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C47BE861-6C71-0844-9026-4B0202D30969.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A9578EF6-81F4-9741-921A-C2F8EE525244.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A713DAF9-B1B4-A24F-AF19-C470DB007873.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A2C89E69-90C9-4C49-A35F-9939D5469EDA.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9AF2F8D5-D5B9-3748-B69B-6FF1A11DD52D.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/983C7840-F3D6-954A-AC03-6970514B58F1.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/93281C0B-8091-0E4F-B2CF-290FF58BC659.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/8E7FE8C1-D286-6648-88AB-77F0DF21F747.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/8E0CF731-E93A-5A49-8E54-63A6828D2624.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/8CA0C3B5-CF1C-B94F-8A6D-7296FFCA5B82.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7ECFD3B9-EF16-E245-B501-2FE5CA157801.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7C941C09-B737-B64D-A939-07C6E23772ED.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/779658D6-3D7C-F840-8E3D-94DD20C3D229.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/75175BBE-E402-A840-AF07-17A43D91A377.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/74CC06CA-1D57-754B-A4FA-8655C1F1FE0F.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/73BF8C3B-9585-A747-85DC-933E4F6F71A5.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6CDCE71F-2964-1C46-B7A2-EC8D938843F1.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/67F685E2-53DC-A04B-A91D-E88776B7A4A5.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/656072F2-4FB5-F341-BDE1-A151C5BBAB3A.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/5AF3AF28-1D32-0A43-BA3D-6375AB9AFFAF.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/58A85389-ACA2-D949-8EEC-66D5D8B599EB.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/56883A4C-9593-1840-B99D-BFCBA2BE526B.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/56845E7B-275A-4D4F-8C97-F49357074C1F.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4EBD0D2C-AA57-7F49-A3DE-581092E583E3.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4DD7D6DB-84AF-9E44-A59A-BC35E36A546F.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4D87C4E5-BAB8-FD42-8FCB-A0956AB8EB54.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/44C01871-205B-B146-8EB8-8E04DDA18D1A.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/3C5B50EC-C740-D94F-ACD2-4D6CDC6563DC.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/3AF241D2-B10F-7649-BED3-CEFF37EE32AF.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/381B122D-6D40-9443-884A-3D4743EF8E3B.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/357FE33A-0220-D04B-B97F-5A974DF417F7.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/28023E33-754B-3A4A-BD7D-7FC6AA04C83B.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/26FEE637-7F47-DD4A-A29C-1567891BCFB7.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/24EB9B79-8287-5245-ADCA-21DBA813B4A6.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/218FE274-DABF-B94F-90FD-A0DF62781DE4.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/1EA344D5-682D-6948-9176-17DD983DFF17.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/1C72EC02-027C-6648-BD14-2B3AD1B132E1.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/1C582BF6-C971-9545-AD6D-FE3EDACBE01E.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/14272B85-9529-BD4E-900A-64BBAFE90F3E.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/10E37E23-2A36-3543-B7FE-2758D3C52EBF.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/101D5EF7-DC82-7840-823B-50423B87CB09.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/0F242BBD-BCB6-AB45-923B-8441084D09B6.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleMuPt1p5to8/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleMuPt1p5to8/PU0.txt new file mode 100644 index 0000000000000..3bee75324d52e --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleMuPt1p5to8/PU0.txt @@ -0,0 +1,49 @@ +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C99C22DC-A99D-2F4D-A2DE-7D715AD90334.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C487BF8E-BFA1-054C-849A-F17041A627FB.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C4285491-3B36-9A47-98B1-56E75FFEDA3F.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/FC3DFBB1-0A9B-824A-A089-B004701DDC3B.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F7351A58-9712-6548-85A7-CBA07872D217.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F67161F0-3196-D243-BC2E-A890DFB65D49.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F3BEA7F1-9922-074B-9A1E-0246BDDFABBA.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E1F857E8-34BD-9D46-A315-2BA9E7DB00E1.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/DCD07F0A-2101-F344-A8BD-3DDB58E722FD.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D88A8C96-ECD9-A34B-A724-8DAC64656936.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D7FCF1A0-5592-7142-B340-F3CB1ABA99CD.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D406ED16-1615-A84E-8888-74AD4A02BA54.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/CC05732F-B6AA-9E42-92CE-F9EBD36E8CB7.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C9A1F00B-644D-6D42-AA3D-598C52ECA126.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/BEAD6CAE-A0F2-7146-A4E3-B777C4D9F697.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/AE84A70B-D374-CC49-8728-AB4B3FC6252E.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A889571D-0A96-BB42-AAB0-40941A809C5C.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9C9F9E38-EE32-F04A-90D5-E31B839838D7.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9B395B92-FC9D-2445-8177-712BF285AAD8.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9391FBB6-1055-B147-AC05-8475C48459B0.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/8BE77E4F-AD85-2543-8950-375079638269.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/844EDC67-9F16-3B45-9A4D-FED64635DCFD.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7FFD52A2-23DD-1543-AB88-AAED0C867B66.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7F7EB615-E164-E646-97A3-C8FFA397AF67.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7901D98A-9C1A-144D-9792-4D3902C1874D.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/77636D1A-958F-7D41-A821-A90A12C82AEE.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7644599C-D2F9-B645-96ED-AC732133BDE7.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/74915F90-85A7-3C4E-AAB1-CE1572A4CF4F.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6CC76FE8-FD34-474E-B609-02BB06103A71.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6BD0CDEB-286B-5C4B-8097-345739AE58D9.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6AFDFC7C-72CE-F840-8899-B573A971C83D.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/65269365-8527-6D45-A624-88D1C2F7915F.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/64E77683-9277-824D-BEB4-A23DDFF16446.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6469C46B-E431-E649-8DD9-E58FF87C79D4.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/5D39863D-CF05-794E-A29D-B60AC4A3550E.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4D52BE07-2F17-0C46-AED4-81CB30528FE9.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4A354BB2-93B6-FA4C-A7E6-FF48A75F52D4.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/462DDEF1-A474-3044-BCAC-CD9338EF6999.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/3E64CB51-92E4-E347-A3B5-847C863942DE.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/3939006A-106C-644E-BFA0-8A51C2B67A7F.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/369C2A4C-D38A-244E-A8C8-2B33C152ED98.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/328DEC4B-5304-B84F-AB36-0D9562B7B4DA.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/27DF1F49-FC6B-2D49-AE56-3E8D76C113AC.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/15376223-7F75-5045-AE64-5B044327A87F.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/145A8851-FE9A-FC4E-B04E-34FB795D4D62.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/0ED390FD-A6B2-E74F-AEE1-100A2A6781E1.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/0DF2AACB-7F6F-B247-9284-B8A6CCC78B51.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/09EEFAE6-3EDC-0244-A18D-1C7FE07960F4.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/09EA8447-1670-AE4E-8276-0527592EB0C4.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleMuPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleMuPt2to100/PU0.txt new file mode 100644 index 0000000000000..4b9b23fd3b5c6 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleMuPt2to100/PU0.txt @@ -0,0 +1,50 @@ +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6BB95FD4-2B38-9245-BBB8-5D76A0E6AB6B.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/5FE8CE65-FA4A-824B-8852-76C04676AE53.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/543B4107-583C-D245-9C8B-A5644B26AB26.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4F8D3DE8-448E-B94C-A635-09197280D261.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4BF6262D-ACAC-C543-8719-8FA9D70E18BB.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/493394A9-1DA6-514A-9054-5DE877917D1B.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/46CB545D-5975-A647-B3FC-F4FE397B9E5D.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/396FB378-B9C7-F646-899E-1231A9A4DB6D.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/31FDDDBD-C419-9A47-B492-FA403FCD4EB4.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/3174178B-5378-FA49-A404-2444A45365A8.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/30113279-D463-3445-97B7-A0834F3434DD.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/1B53821B-1CD6-8B43-902F-D58F9A9652F8.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/15DEC5F2-9BCA-824F-9EB6-A71A4E8239CA.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/153DBC42-A731-B34A-8C03-69E822B9CEDA.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/14A95434-E01B-3D49-B44E-6EE173EB1426.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/125DD012-C1C6-F64B-96CD-C0A31D5CAB48.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/0079450D-7F19-6645-A973-0400C5FB3653.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F951C5C9-DC85-DD4C-907B-5BD6B7DB53FA.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F609E3E8-5479-0B48-873C-C3E7308FC91F.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F0B41247-EBB0-CC4D-A314-1E19405CE431.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/EDC109CB-8B8C-9C46-9ADE-8EA7FDC75167.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E71B9ADD-38FB-CC42-8457-9F8C7B3BE9FE.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D3B2AC00-844C-4E49-83B8-8461EB5FC9A0.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D2C2184E-8F61-0B4F-BB54-E6F0A5468BAB.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D2B74CF2-F340-6B43-954A-00CBA64C7605.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/CA71A8D9-666F-AD40-BBCF-FFE8397C933F.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C5C52CE3-6B12-2846-8526-0CCFF2EE9DCF.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/BFFEAE20-8F08-4F41-B677-0874FE9DF3B8.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/BFAF9542-577F-4F41-BA73-6A1EE9D533A1.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/BDB8F793-74D1-974D-822B-F7517748556E.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B8C47596-E822-BC49-A82E-ABF4922EA824.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B8C326E3-C5AB-2C47-906A-5918594E7687.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/AFA4FF45-10BD-0347-B577-7ED1F8406B89.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/AE178B20-DA06-BF42-A063-5F6AAB69DC68.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/AD0EE31B-7758-3147-921D-0D4A79E48BF4.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/ABF2EC74-7D16-5848-B177-DF7DA71D86AE.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A2DE5FE9-368F-C742-BA2D-1402A5CA82B0.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A0AD2A89-7B15-ED4D-82C1-E2585F0A067E.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A051B36B-E6BE-174C-A208-F3B9981E63F8.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/94CF42E8-074E-A64D-8B39-BFB23BB9D547.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/93A6A2D1-CA59-B148-9AA6-795E041893CA.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/8CF6DC58-A03F-3944-BD6A-09806CF20A49.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/8BDBF37C-26A1-F24A-A784-A5DF8B1D6F6E.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/867CEAE5-F444-1B48-B65B-57E366633168.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7FCC0E10-4A9A-DA41-8A53-3D4C0F5A2CCE.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7D0FD4AD-2515-7F4A-9C3D-755407F02429.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/79544F1C-BEBF-184B-8909-A1B4DC70201A.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6FDE5AAF-DE84-BF4C-8061-0A31DAC060FD.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6F9F4650-99E8-3349-9A3C-926CA701D487.root +/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/FB6F50C4-27E3-8542-929F-6147CFEDA674.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU0.txt new file mode 100644 index 0000000000000..9286cb83f8d7a --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU0.txt @@ -0,0 +1,11 @@ +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D4976A2C-6287-6B43-948B-EFCA226B0030.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D31CED47-9185-5F41-84D7-8F22BC54679C.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B7556252-BCF3-994D-9927-8C0365F469AE.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B68B5687-64FC-9640-A876-7B84E9DF422B.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B5BBB440-866D-7C46-B702-33FD28B2D52F.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B20C6005-6E34-D241-AF06-9B7BFD9E3304.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/97188193-A9F7-1847-8EC9-89C0C1E6EE56.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/411C6B05-D1F4-9D48-B216-1D7879D6F43B.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/324CC7DF-DB96-7841-9571-9D469D9012C9.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/27474029-9A6E-2E47-968B-149D731EE756.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/00523659-104D-6A48-ABA7-684FD55BC687.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU140.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU140.txt new file mode 100644 index 0000000000000..88a0179fec29c --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU140.txt @@ -0,0 +1,90 @@ +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/FF21F618-AFD0-6D41-8193-5B8BCCBAA9CB.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/FEE861AB-BF4D-BD4F-9B98-F92EA94B116C.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/FE611A97-4C60-B144-9B93-A2CD3A93AF7B.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/F63E3699-50B7-F54E-BD97-9F8BD6D90B65.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/F4944734-C238-E542-BC39-41EAE29148BC.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/F3752C09-372E-9E4C-AB91-83362C695D97.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/ECD67B2F-DD21-CF4C-9E04-9BF1CBC33CD3.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/E9F0C365-1A18-F044-95F7-0118D3493F13.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/E60503E4-B210-9349-A8C6-1D429D7A2EF1.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/E354A2B7-EAC7-6347-B4C1-89E3E752D569.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/E1CC2776-2072-F74A-872D-0D373308E77E.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/E0937032-0B61-7B4A-8F34-FEC2F5C36A59.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/DFCD9592-38F2-FA43-950E-CC4D039A7422.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/DC1E79AC-CF93-F948-B897-698C549E4636.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/D9D87418-4120-6F4F-B474-0A99ADFCAFE1.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/D0FC8BA4-BDE3-A44A-ADE9-ABB65C9AC3CA.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/CE3599F4-56C5-5145-86E9-03107259BAB4.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/CD98BB58-631B-5746-8A00-6C0B52125356.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/CA86875E-A8FB-2E42-873A-891DE750DAE9.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/C7407AD2-A1A4-0D49-9403-8C6929B4152F.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/C5072604-4744-7B4B-804E-A5F3F8F8F94C.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/C385BC3B-865C-3041-86FE-9EC1C83E406C.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/BCF9EAD9-D265-1341-882D-C050E4F1129D.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/BAB2A7D5-4346-004A-A884-5944756CB35B.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/B636298B-73F7-AF4A-B870-870FF6CD3185.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/B42872E0-B880-8A48-89F1-AD43FAC7727B.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/AC6411FF-89FF-A348-9584-D5145ABD08CF.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/AB8256FD-1228-B84E-ADC8-7B90E28B3207.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/A57C424A-2CAE-FF48-ACF6-F01C86BA6939.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/A4E144FF-9315-C54D-94D2-D0D08957CC3E.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/A2731D2B-CE88-9649-A2EB-AE9E66D1CB80.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/A1F23AD0-A79B-D24E-AC58-EE75B7B2120B.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/A1CF3EF9-D7B2-4B4B-BD84-14E33ACBF35A.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/A160FEFF-21A3-A440-AD84-B92B7812060D.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/9FD3811F-75EA-8648-8360-FD0946FCF910.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/9D138AB5-EB0A-8440-8BA3-2449AB28E099.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/92E0412F-1B60-F440-9F1F-AEC12746CEFF.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/8FE1FEFF-2730-0640-A2D6-16FE41D84718.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/8F2B0C3F-832C-DB4A-9718-76C2170C8EAF.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/89FA0ECD-4AC9-6F4E-B01E-6677DEE6413B.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/88DEDE59-CA12-794E-B6CE-0C6FB36E31DB.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/887CB1A7-A991-0148-9788-65A4D48149F2.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/8829C678-1075-4E4D-B270-A700D2750778.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/8723D711-BE7C-5442-AF7E-0C65C8A2BE44.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/83D20BB8-BF03-6E4A-B414-8F864225E535.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/82AEFFED-6439-9849-822D-A2ECF8DF7943.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/8053937A-003F-B94C-8393-BA102FE64141.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/7FF9207E-733B-154E-9FD4-5F55264E96DD.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/7721593E-97AA-AB4E-B6F0-2F07B95BA755.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/74F23629-3826-0447-AE4B-AEDB875ED1A5.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/73C64AB5-D8BA-7F46-AFD8-347261F3C9F2.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/69382ECE-B511-DE43-8340-DFCC0CEE8F38.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/68B2C174-9EDC-BC45-BB61-4664A5920FA3.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/67F59671-CF46-DD47-8005-E9E827E0E223.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/675D86F0-804B-1B48-AD9F-E2EA983790DA.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/5FF6C452-44AB-454C-BF57-2895073DD91F.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/5E492B75-43CB-7E40-B0C1-AF249DEF3E7E.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/5DB2BEC6-2E18-3F4E-874D-3C7ED394997E.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/5C85BA58-60FC-A245-83CF-3FE0670CCABA.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/56D6FBA2-23A4-3B45-9F40-E1EE2A0D6A30.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/551D955E-A18E-B84D-A221-67697805CED7.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/503A4B86-724B-6D4C-B482-4C17EAB6ADD6.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/4C771CB8-3C41-6344-AE0D-53E13505107E.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/479DB8C6-8621-5D40-B037-1D6582D5E64D.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/478482F6-A9E6-E74A-A177-0B90126F8BA8.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/4573F524-0097-9548-8CBE-39FF59DA7DA3.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/41FEE026-01BC-8B42-A2FC-2BF6C2399879.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/3FAFE455-BFAB-E743-A4B7-73F79D3A6C3D.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/3BA03DA7-7EE2-6448-ADE7-1266D1649A63.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/3A8D64CB-BBFF-FE4E-9AE6-452E759E66CA.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/332D9330-0438-F041-B12E-F4CECDEE85E2.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/32E95390-3619-2148-884B-FA449B29AF39.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/31C245D9-AFD2-E54F-A9FF-EF0B0097012B.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/31ADD9C9-57F1-AF4E-BFD4-980237E63F85.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/316252FB-9A2E-FA45-ACD3-C793AE0714C8.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/315F0018-3349-A145-BE61-79008170E0D2.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/2EAD2D38-F6CB-7441-BFE9-EF65A72927FE.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/27A7C30E-98EA-574D-822E-5FD56A4DA9C1.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/26CD26ED-D8CC-4C43-A690-108812E3381C.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/2613EB93-538D-8E44-8865-6ED97AA8B8D8.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/1DBBB085-C228-614F-99E2-52B92369F487.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/19555149-D84B-2548-99A8-7E4696F565CA.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/16F10172-B595-DC45-A1BA-DBC6CC8CE5F7.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/16DF8B29-E3C5-1944-BE3E-7A501DDE78E9.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/13B79F69-5504-7443-81E5-DAA02AC4F2F9.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/12334DC9-83E2-9A48-9D3D-3F2151636A29.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/0BB9B151-9BB1-FD47-9CB6-73B95FAF9606.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/07F1D46F-E668-9640-8905-9D58C263046A.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/06249713-8798-2A4C-B1B6-8863427E19DC.root +/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/021BE312-AED3-0749-A0A2-73ABC8AD706C.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU200.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU200.txt new file mode 100644 index 0000000000000..73b20d8301b30 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU200.txt @@ -0,0 +1,100 @@ +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/FFF48AB4-E5E6-3842-8A5B-20E2B7E497BC.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/FFB04F2D-0C40-2040-94CD-587D1F5AC4A7.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/FEDE3D03-2B54-BF4C-8D63-0C8C4DBAC6F0.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/FE522E6A-09E8-6B4B-B111-C5F6322B71D1.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/FD5A1B6D-C998-C149-8277-B278047E0011.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/FBBA43FA-9AAB-D349-BE35-18F74BEBA975.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/F7A323B1-9683-9846-9139-358A93E6E5AD.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/F70A7F1D-EDF4-7A47-8A13-0710A5964D03.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/F6FCF82F-C6A7-F744-99C2-CBCEA15FF124.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/EED79AA9-1E2A-7A4B-8A74-507CBA91E250.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/EE163EAC-1441-ED42-91ED-98105E9CD167.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/E0BB0A7E-6C19-2141-8484-65EFA337DDBB.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/E03B287C-6571-534A-9566-27FAB7402CEC.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/DAF5ACF1-BC4D-B640-8C1D-B21F4FBCDDB6.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/D53E3C85-F44C-894B-B57A-0D93309B4DD9.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CD195B20-F5F1-504A-BF57-48500AE83D5A.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CCFEF3EC-6BB3-414F-96ED-0EF066356853.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CB8C9032-3904-3445-BB99-12F7D2406CA0.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CAD74EE2-7F73-4A48-9D36-FEFE17D7481F.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CA33E7AB-505C-854F-AAD0-DB30EA18D790.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C8A93F52-0747-1C48-99F6-79BF703FD7E1.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C71A158A-5FEC-D84F-9350-051E4D248C33.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C5ADA496-13D3-BA47-B909-CD4FBF2036DF.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C49CB14E-3D97-6A42-A71B-6F165470E260.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C246E3F7-4787-2646-BDEF-661B0ED88BAD.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C106AF77-A5EC-464A-8506-827EF1E5BEA6.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/BB8C2AD5-77BF-CC47-80F5-33976F9BA74C.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B729066B-1239-F448-AF19-355E2913A52E.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B43F8A0D-9A17-0349-880C-718068EE64AE.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B4210BFC-C3B7-3F49-B8DB-FA43AF360273.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B3806C39-CE2D-F940-971C-311908D55F55.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/AE03B501-4052-184C-B0CF-8FDC15A86C87.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/A7F3240B-CED2-0749-8F78-993164F05E04.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/A5031D0A-8146-4F44-95BC-A2569A462C6A.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/A34D2C04-BBC5-6741-BA38-42803727F55E.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/A1877834-C5E4-AA40-9FD4-1C4474715822.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9983008B-882E-EB4B-B973-F86BC15119D0.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/99503DCA-B083-5942-B794-6E33D0958F18.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9932CAD0-F96D-4F4E-A546-242C8973E76A.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9919AA81-1206-1244-806F-948C1C22945B.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9569319E-61B5-5D4A-B9E2-6482D1176082.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/91832920-CBD3-BD4F-8F37-3412EE3647BF.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/90B4F2B2-94BB-7A47-A6F7-D284609F3D44.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8F0C0860-A859-7C4B-9C44-40BD5285B8DC.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8D9CD7C6-F7C7-F847-9557-2498D6F9BA99.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8D0BC8DA-A788-F042-9AD3-CEEE6CAED0DD.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/87996916-F41A-474C-ACBE-7A8DFD4084F3.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/877D2A16-FC05-0F49-AC5C-1F8365B9773A.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/84EB7B63-38B7-FB4E-8572-CFB618B0AF70.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/81F8166A-D58E-B543-AF0E-4FF65FD7193E.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/7F861947-2FF5-664E-80A4-66B61AE83F6F.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/7A3A4427-F224-4F40-A6E8-EA000C2651DE.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/77D247BD-F584-DC4F-B68A-F70FDBBCC5D1.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/77A6EF0F-092C-9345-B4E7-8DF75E3BC03F.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/77559AFC-FE3F-E347-B044-C5C676D37301.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/72D471FF-FF77-EE4E-B0A3-5E423DAF7C92.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/6FE74EE9-68B4-7D45-BC6A-A57684C4EF07.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/6BD05BDE-3C24-D04A-9FBF-A4DFC6151D44.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/6883D9AF-D5B1-5749-B1B7-457B843236EE.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/66D7811C-5831-BD4B-B7B3-3B2B90CEF69A.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/663CFFF6-A7FF-B841-AD1E-E856B500FF09.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/632E5E94-0F9A-A74A-8080-E9D82C269654.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/60E850D6-A8AC-EF42-9D28-41B5FB553E05.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/60A26A55-A37D-1348-AF9F-ED98F86F1274.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5EBDA0C0-44C2-E646-B3B3-05E21FB54F73.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5E61D730-A4B7-0A49-BDD4-281910DD8374.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5CDBB937-2C90-4144-8735-485199F8D771.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5CAC6671-5050-A04E-B495-F9D6791B4E48.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/526F7BFE-E04D-2543-8441-9EA45D0952AB.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/4DD590E1-2FE2-6E4D-A34D-4D83FE976EAF.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/49E94AB3-4EDE-6B40-BD87-4FA47FDA1BCD.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/4725E564-4DEA-FB4F-B9FE-834999AFDC4D.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/45C4B37D-7CD2-0541-B399-181CB2C7633A.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/456BF325-22AC-8D4E-A21C-8EB53E89AE14.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/445584F5-57DA-6F4D-814C-B4A1A9C17981.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/42A97B14-003B-1A4A-8D86-215DD230F088.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/3FD7A367-96FD-D249-A362-E0DBD4D03E27.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/37B90FE4-88D4-294D-B2EC-8CF002337A65.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/379D9981-C7E6-CA48-8722-E5E022A35D15.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/345B6106-BD75-8944-A9E7-3C6893C0317B.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/31206441-CE60-FE4B-B43D-3DC3D0056C55.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/2A15F681-31B2-E643-9F84-582DCF72F29A.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/2918DEA9-A524-4048-B476-A9C8E0D6A656.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/253798E3-79AA-C74F-B101-5346964A67E1.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/20613A9F-46D7-6C4B-A802-6DDE71910DED.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1EC4F661-B020-BC4A-A944-586C908442A8.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1D4CF55F-EF5C-0144-895B-AF10A54527EB.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/15BD19C9-FBDD-5842-BE89-050FCB7632DE.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/140C3389-F042-6944-9CAA-058FFE0F5B61.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/11215630-7229-EE48-9186-AFEFFAF79248.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0F7BA59D-8BC3-0047-BFB8-05A3966893DA.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0CC21F77-4AF0-FE48-8F60-4AACACD9FA02.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0C676FDD-0C94-1D47-A357-67A55173AA8B.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0B98A8C1-324D-6340-AF17-E5C8C4B2E835.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0B8A7D7C-01F1-6648-B9C3-C8957E06A4AC.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/081C2919-AE72-164B-9E25-E0C32EE59F3C.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/068C6CC5-6862-4B4C-88DE-3E4E39305BD2.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/037866BE-74BD-E04E-8095-9B6BD251AF53.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0259ED4B-00BC-1C4D-971F-D8E4192BE9CA.root +/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0131EB32-5AEA-B445-906D-7A8639AFA24E.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/localRAL/PU200.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/localRAL/PU200.txt new file mode 100644 index 0000000000000..d266d5c679942 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/localRAL/PU200.txt @@ -0,0 +1,74 @@ +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/45C4B37D-7CD2-0541-B399-181CB2C7633A.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/4725E564-4DEA-FB4F-B9FE-834999AFDC4D.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/49E94AB3-4EDE-6B40-BD87-4FA47FDA1BCD.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/4DD590E1-2FE2-6E4D-A34D-4D83FE976EAF.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/526F7BFE-E04D-2543-8441-9EA45D0952AB.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/5CAC6671-5050-A04E-B495-F9D6791B4E48.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/5CDBB937-2C90-4144-8735-485199F8D771.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/5E61D730-A4B7-0A49-BDD4-281910DD8374.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/5EBDA0C0-44C2-E646-B3B3-05E21FB54F73.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/60A26A55-A37D-1348-AF9F-ED98F86F1274.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/60E850D6-A8AC-EF42-9D28-41B5FB553E05.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/632E5E94-0F9A-A74A-8080-E9D82C269654.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/663CFFF6-A7FF-B841-AD1E-E856B500FF09.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/66D7811C-5831-BD4B-B7B3-3B2B90CEF69A.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/6883D9AF-D5B1-5749-B1B7-457B843236EE.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/6BD05BDE-3C24-D04A-9FBF-A4DFC6151D44.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/6FE74EE9-68B4-7D45-BC6A-A57684C4EF07.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/72D471FF-FF77-EE4E-B0A3-5E423DAF7C92.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/77559AFC-FE3F-E347-B044-C5C676D37301.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/77A6EF0F-092C-9345-B4E7-8DF75E3BC03F.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/77D247BD-F584-DC4F-B68A-F70FDBBCC5D1.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/7A3A4427-F224-4F40-A6E8-EA000C2651DE.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/7F861947-2FF5-664E-80A4-66B61AE83F6F.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/81F8166A-D58E-B543-AF0E-4FF65FD7193E.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/84EB7B63-38B7-FB4E-8572-CFB618B0AF70.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/877D2A16-FC05-0F49-AC5C-1F8365B9773A.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/87996916-F41A-474C-ACBE-7A8DFD4084F3.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/8D0BC8DA-A788-F042-9AD3-CEEE6CAED0DD.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/8D9CD7C6-F7C7-F847-9557-2498D6F9BA99.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/8F0C0860-A859-7C4B-9C44-40BD5285B8DC.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/90B4F2B2-94BB-7A47-A6F7-D284609F3D44.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/91832920-CBD3-BD4F-8F37-3412EE3647BF.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/9569319E-61B5-5D4A-B9E2-6482D1176082.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/9919AA81-1206-1244-806F-948C1C22945B.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/9932CAD0-F96D-4F4E-A546-242C8973E76A.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/99503DCA-B083-5942-B794-6E33D0958F18.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/9983008B-882E-EB4B-B973-F86BC15119D0.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/A1877834-C5E4-AA40-9FD4-1C4474715822.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/A34D2C04-BBC5-6741-BA38-42803727F55E.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/A5031D0A-8146-4F44-95BC-A2569A462C6A.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/A7F3240B-CED2-0749-8F78-993164F05E04.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/AE03B501-4052-184C-B0CF-8FDC15A86C87.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/B3806C39-CE2D-F940-971C-311908D55F55.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/B4210BFC-C3B7-3F49-B8DB-FA43AF360273.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/B43F8A0D-9A17-0349-880C-718068EE64AE.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/B729066B-1239-F448-AF19-355E2913A52E.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/BB8C2AD5-77BF-CC47-80F5-33976F9BA74C.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/C106AF77-A5EC-464A-8506-827EF1E5BEA6.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/C246E3F7-4787-2646-BDEF-661B0ED88BAD.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/C49CB14E-3D97-6A42-A71B-6F165470E260.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/C5ADA496-13D3-BA47-B909-CD4FBF2036DF.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/C71A158A-5FEC-D84F-9350-051E4D248C33.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/C8A93F52-0747-1C48-99F6-79BF703FD7E1.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/CA33E7AB-505C-854F-AAD0-DB30EA18D790.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/CAD74EE2-7F73-4A48-9D36-FEFE17D7481F.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/CB8C9032-3904-3445-BB99-12F7D2406CA0.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/CCFEF3EC-6BB3-414F-96ED-0EF066356853.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/CD195B20-F5F1-504A-BF57-48500AE83D5A.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/D53E3C85-F44C-894B-B57A-0D93309B4DD9.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/DAF5ACF1-BC4D-B640-8C1D-B21F4FBCDDB6.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/E03B287C-6571-534A-9566-27FAB7402CEC.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/E0BB0A7E-6C19-2141-8484-65EFA337DDBB.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/EE163EAC-1441-ED42-91ED-98105E9CD167.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/EED79AA9-1E2A-7A4B-8A74-507CBA91E250.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/F6FCF82F-C6A7-F744-99C2-CBCEA15FF124.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/F70A7F1D-EDF4-7A47-8A13-0710A5964D03.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/F7A323B1-9683-9846-9139-358A93E6E5AD.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/FBBA43FA-9AAB-D349-BE35-18F74BEBA975.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/FD5A1B6D-C998-C149-8277-B278047E0011.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/FE522E6A-09E8-6B4B-B111-C5F6322B71D1.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/FEDE3D03-2B54-BF4C-8D63-0C8C4DBAC6F0.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/FFB04F2D-0C40-2040-94CD-587D1F5AC4A7.root +file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/FFF48AB4-E5E6-3842-8A5B-20E2B7E497BC.root + diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/README b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/README new file mode 100644 index 0000000000000..083b8997d929d --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/README @@ -0,0 +1,7 @@ +RelVal/ contains CMSSW 10.6.0 RelVal samples. + +They use the D41 = T14 geometry. + +They are made with the stub window sizes that you can find in L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py . + +Typical dataset name /RelVal*/CMSSW_10_6_0*upgrade2023*D41*/GEN-SIM-DIGI-RAW diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleElPt1p5to8/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleElPt1p5to8/PU0.txt new file mode 100644 index 0000000000000..4503377464d0b --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleElPt1p5to8/PU0.txt @@ -0,0 +1,4 @@ +/store/relval/CMSSW_10_6_0_patch2/RelValElGunPt1p5To8/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/E0B7C6FC-8939-7443-B18B-AC92BC33C3C8.root +/store/relval/CMSSW_10_6_0_patch2/RelValElGunPt1p5To8/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/A44D8B46-9AAB-A843-9ED3-C7A9C249A398.root +/store/relval/CMSSW_10_6_0_patch2/RelValElGunPt1p5To8/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/99CC9FE6-AE7E-0047-8AFF-2529AEC89C6B.root +/store/relval/CMSSW_10_6_0_patch2/RelValElGunPt1p5To8/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/4D9F7DCF-60F7-2945-BFF5-9ACD23F8EF5D.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleElPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleElPt2to100/PU0.txt new file mode 100644 index 0000000000000..6fa396354f3c9 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleElPt2to100/PU0.txt @@ -0,0 +1,5 @@ +/store/relval/CMSSW_10_6_0_patch2/RelValElGunPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/FBF986BD-259D-8444-A4CE-F089D37778FE.root +/store/relval/CMSSW_10_6_0_patch2/RelValElGunPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/F5D7A215-FFB2-E64B-A9F0-F57992B9D21C.root +/store/relval/CMSSW_10_6_0_patch2/RelValElGunPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/CDB15E2D-6245-3749-9900-ECD1B35C84E1.root +/store/relval/CMSSW_10_6_0_patch2/RelValElGunPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/B3E7813D-79B2-8E42-92C6-D14A0F487A06.root +/store/relval/CMSSW_10_6_0_patch2/RelValElGunPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/78F491FA-DBE2-EA40-B0D1-42759BF28A70.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleMuPt1p5to8/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleMuPt1p5to8/PU0.txt new file mode 100644 index 0000000000000..644331cbc93d0 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleMuPt1p5to8/PU0.txt @@ -0,0 +1,4 @@ +/store/relval/CMSSW_10_6_0_patch2/RelValMuGunPt1p5To8/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/AEF0CB71-AF86-A04A-BCCC-A5DB546B8F69.root +/store/relval/CMSSW_10_6_0_patch2/RelValMuGunPt1p5To8/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/A66EB478-1472-214C-9171-F4F507977634.root +/store/relval/CMSSW_10_6_0_patch2/RelValMuGunPt1p5To8/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/8671A47A-F5D5-2247-9C5C-A9A50A4046DB.root +/store/relval/CMSSW_10_6_0_patch2/RelValMuGunPt1p5To8/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/2018BB4D-696D-6649-BC75-727E3CB128AC.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleMuPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleMuPt2to100/PU0.txt new file mode 100644 index 0000000000000..458f4d7d76ba6 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleMuPt2to100/PU0.txt @@ -0,0 +1,4 @@ +/store/relval/CMSSW_10_6_0_patch2/RelValMuGunPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/B84451BE-B56C-7B46-AE91-012D666D112B.root +/store/relval/CMSSW_10_6_0_patch2/RelValMuGunPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/9DE71496-F96E-0248-86F3-F4FCE05C7CCB.root +/store/relval/CMSSW_10_6_0_patch2/RelValMuGunPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/8926E0A6-ED88-A54F-9B08-EFE07AE22096.root +/store/relval/CMSSW_10_6_0_patch2/RelValMuGunPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/2F504839-999B-E048-B6BF-15B65D294E96.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU0.txt new file mode 100644 index 0000000000000..2ce81a3c1397b --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU0.txt @@ -0,0 +1,10 @@ +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/E2F72EC8-69CC-8F4D-A4A6-2B2C29CEAE5E.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/DF12CFDD-8F7C-4441-B5A7-2C49901BD192.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/C5952C0A-AAEA-A44E-B281-9E0F17470A0C.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/BBD5032A-0A1B-6540-8646-D7A5F8CD2639.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/AE123CAA-16FA-084E-94D5-201DE5883E17.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/A3EFC6A7-CC31-9A43-BBEE-C0A45F0F5939.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/9D8FA670-3A86-F94A-AB8A-B6A7D5F9BD49.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/7E72D7D3-4CB3-E948-81F6-A43690271BF3.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/6BFE95C4-65BE-F84F-8743-6F7527B0BE23.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/0F5AB5DB-4432-F84B-B223-B65987042BE4.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU140.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU140.txt new file mode 100644 index 0000000000000..3a40216b20045 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU140.txt @@ -0,0 +1,90 @@ +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/03459CCC-4D78-524B-ADBC-3027F1365979.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/02AD7480-ABFC-A14E-BE82-D571AB61BFEB.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/02996200-F77A-E44C-97CC-F8A11164FA4C.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/01FA3727-8D35-874D-AEAB-64114FB06A31.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/01D81891-2F79-904E-8AFF-84AF90561F9E.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/2102FFA8-CD13-A248-B5F8-5AB92F95025A.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/1C7B8603-3DDB-234B-9F14-01AD201DC439.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/0AAAC338-359C-5C43-B028-E94643B14663.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/FC48882E-8586-1E40-A5D4-68D7B51BD76B.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/F9715757-A164-2D40-ABA6-F297CB03753F.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/F5329F04-16FF-B04B-AEF7-3BF6AF57BD59.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/F1EA4AD0-6EA9-5842-B9AA-84E95DA17C99.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/F0B6E845-D388-5E4C-AF0C-ECD22F35B6C8.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/F041E07A-5AA8-384C-880D-9F6DC0153120.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/EEE777B8-58FE-8447-94C6-CD602A6F516C.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/EC28C5B8-616C-B84F-811B-44E079A43F01.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/EB1AAAD3-D00F-1643-A9D3-0C6E00A61A3A.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/E65750D9-48E1-6940-8B34-0B03DA43DEC9.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/E4A0E064-BD7B-6441-BD26-6BF8B1683CF6.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/E3D316DA-1117-0746-A779-A4D9042B2B74.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/E322E074-852C-9247-BC8A-C62FB5D2BF34.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/E095D647-912A-EA45-A5DC-2F68E4DEA4D1.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/DD7AC741-4DEC-D545-8D1D-E8CD028D96DA.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/D9E7BFFB-2EED-0344-B69D-07A76BDB6CE7.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/D77D1B52-7304-C147-A7E7-CA14D276E747.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/D50B2983-3D15-074E-85F6-02D844C6710B.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/D47F3ABE-1203-CB47-9664-C9C215A7F056.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/CDCE7498-AD5F-3F44-A8A2-A36064F10CB4.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/CC4B9051-A311-4541-BF5B-D0710FA58956.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/CC099005-CE88-EE40-8C0C-F73C7A5211CC.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/C7433043-809D-8946-B54A-D090420336B4.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/BC938DC2-49DB-FA4E-A94E-204AA7AFF1B6.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/BA6EE7DD-AC59-7749-B8D5-6CEB292EBAC0.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/B79750E5-E21E-7F48-A4C5-F356E4065BAF.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/AEEFB0A8-FCAB-9B4E-91EC-66216ED6F58C.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/AD197398-B349-8848-B87A-8B09CD9CCA5A.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/AA4AC109-3AD7-6B4B-88CA-242000946BB6.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/A56AC9EC-BEFE-5B43-9FCC-5AF73216916A.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/9EFD84D1-8633-2141-9434-9C7AB3941F0F.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/9BF3B9BD-2603-3347-A329-63FCF1D3C824.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/9B41BDBA-A193-8145-8788-FB11991178FA.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/9A6982BB-FA4E-DB4D-9427-A3D92CD79B55.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/9A0BE40B-EB39-BF46-83B3-9722FBA03519.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/95C637F0-3577-1641-954C-EB274783E5B8.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/957844F8-0E5C-D246-97D7-AD40F9DDCBA3.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/8D3FC16A-93D5-184F-8ECF-083420344A1D.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/8CFF8859-4AE9-DE4A-BF29-CF9BA46303F3.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/8C59E2B1-A854-FC4F-BC48-2F5583CF6F74.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/8AB142E0-0A63-A448-B4C6-72D938B695FD.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/89AA627D-CB3F-974F-9B8C-DF7E242C1B6C.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/8980FC5D-994F-7C4D-8FBC-7D21515C8DE3.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/88FFADBF-2F6C-7941-90BE-0F42BFED7406.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/87A62194-0331-A74C-AC0C-C85C1EC0446E.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/812CB093-D4F4-3042-8798-BA02CE2AB64A.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/8074B02D-6A41-6141-8FB3-C91BD9FB1433.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/801E33D2-7FA3-7F4E-9B4D-5D68031B4258.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/7F6DCF4C-FCC4-7C40-8E88-383ED9783FE7.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/7F3D342D-423E-204A-96E8-FB48F78314D5.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/780D306E-A613-2C48-9222-129896CA5A43.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/7719E974-70C2-E44B-ABB5-A72E14C40F1F.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/7586ECBB-FFF7-6943-8100-3DE1BB275E24.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/7292CF81-9CA9-004B-BBB1-5B33C6E368B7.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/7279A983-6D80-7245-904E-10C34051A693.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/6FE92499-92D3-3649-BCA7-678E3BBBFD8E.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/6C550167-A2CC-824F-8598-5049430ECF96.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/6BB2315B-3ADF-144E-BF5C-73FD68FE1C92.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/660A4728-0C1B-8442-A916-DC2A9BB3EFAC.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/653BFD49-9DA4-2A40-8DF1-B141C1B5157E.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/631807CC-E971-654A-B4F5-6EB0010FC8DB.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/5F06B207-ECBE-5E43-807C-2346A29F01C2.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/5B4FDFE8-94C1-0B40-8DFF-9D0FA98C581C.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/554E1E09-345F-714B-B4D8-913AEEA7AAB3.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/516AFA48-EF14-8940-B94C-110E5FC3FB62.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/509BCECB-8B86-3B4C-BC46-836EE3ED9046.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/4B096BDB-53AE-5C49-A3C5-B596B05ED293.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/4A4B5340-25DA-3640-ABB8-43BC09C66AB0.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/45B01182-1D96-F646-9671-A5A267E7ED5F.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/455C0770-9FA3-B14A-AC70-B6EBA4E06ED2.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/444522CE-E832-3840-B851-835D341457AB.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/42FAB3B4-0C11-3B44-83A1-F684C6E8D33D.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/4153CCC5-F6C7-1144-ABFC-8970731208DA.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/343BED09-5DFC-3E4C-A735-F17C87DDF3C7.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/33EAFF56-2C3B-E440-9D34-506B38E3366D.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/337928B3-2DEA-A14F-B93C-8D475676E708.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/2F258742-DF09-9B46-BA97-7B92C389BE5E.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/2E63A474-E392-2C4B-B2C8-8F42E1C51DA4.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/2DD8E1D5-4EEC-1544-BB40-613E1A16458A.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/2B5B585E-676F-4747-B15A-61B5BCCB0D77.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/2883AFB9-C3E6-DC4E-93D8-626C5C1D892C.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/258123D3-6021-4747-9433-6A4E714B8645.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU200.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU200.txt new file mode 100644 index 0000000000000..97abc2fd0c35f --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU200.txt @@ -0,0 +1,90 @@ +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/C906CFA0-7CF2-9E43-B885-99C07840187D.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/C88F950F-6C9A-5E43-90F9-6721E6C14AD2.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/C5DCAD1C-D06D-6943-80A3-EB64267FA87E.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/C18EE4ED-3A5E-A94D-A21A-78AE6A788187.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/C0BDCDDA-F6B3-8A46-A38D-F5F2CBA57A58.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/BE81E27D-2FBB-7846-AE97-B2728551AF64.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/BDA233B3-6FB3-784B-9D26-F48DCD588607.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/BCBC02BE-D8B7-104F-B581-DF07D8A07FCD.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/B7C077BA-C8A2-474E-BA61-C54ABE60D113.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/B79507AE-6352-CD45-9ACE-0EADF07FD8B4.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/B6E10C6B-C4AE-BF4B-ADD3-24A91FB2BD2E.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/B6E073B2-FBFD-C94E-A36C-73873E5B835F.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/B122788C-AFE8-4247-833B-CC051B58FD91.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/B0D9E8A6-5E4A-FA48-88AB-132BE9A20645.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/ACF1E328-A8AB-3548-8D0A-A23D6CA4546B.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/AAD7FED3-E5D4-774A-91C3-22C1B8F290E7.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/A78719AE-BC28-684F-903A-CF398FC7F7AB.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/9FEBEB22-69A9-B248-875D-A95D9B088592.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/9DD929C2-4722-8A46-B50A-455AF4D8BEC7.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/98AEFA7E-DE9C-894C-8058-9668F1CBD53C.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/980C5430-AD47-B241-BE6F-B4CA8012EAC0.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/93EF8D76-ECC7-5748-92B7-C31FCCE85F8B.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/8FADD102-E3BD-CD47-ADC8-4ECC10A362EA.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/8F4060C4-91EC-9842-B90B-DF2C9C343868.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/8CBC504C-DAD1-8045-AE3A-53F67429F955.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/8912C48E-5FBC-1543-8B17-8103BF8B09CE.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/8437FA7C-6CE5-ED42-A10F-4B59E01AC570.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/83E908EB-A425-744B-BC3A-9B54BB250A31.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/7F844821-1FA7-0643-A1D2-28E8F0D3F239.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/7F34DCD1-F982-5448-B967-6C92382D24E8.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/7F317FFA-0945-894F-BC84-78275E5CE47E.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/7EFDA8E1-5E80-7B4A-9112-3D2F2BCBDFEE.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/7BDCA836-43E3-1E48-B486-492CCC620A07.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/7823FE0C-F450-4B4D-BD0C-756EADAFF28B.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/77D43DB6-3EB9-DA44-B2D0-0AE1353F179E.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/773D2A47-687E-2F4C-812F-0D872DF33922.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/75232632-B74C-EB4E-B4CA-552E09BE4FEF.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/73D77317-C2AF-D54D-9D9C-B254B9BFD5B0.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/72F865A5-AD86-C44F-A859-C4350FA6B429.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/72EA4B20-6647-3346-8458-CE9319A16210.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/7114C578-865A-DE4B-B5BC-C02DD42F2F5B.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/700B6B94-79F2-9943-8169-71789E700E30.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/6EECB5B6-6769-E84D-BDD0-0225F6399194.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/6D961583-4B8A-B448-BD6F-4B949AD2B6AF.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/6BB4F352-7CD9-3D45-9DA8-5DCC79B2E9C6.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/6909B878-FD76-EF42-A58F-3E1FB9FE7845.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/65BE140D-F421-E746-A807-BE9C8E832B92.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/649EB2BA-70E1-CD4C-889E-561C5CABC985.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/5C6AE70C-5E51-8648-9961-34A9B9BD41EB.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/5A9282FF-6D4B-8D47-8F94-EFA142C6EC7C.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/559D941E-E79A-DB43-BB98-63B21AC99357.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/4F71712D-222A-BC4B-BB27-A1F660810152.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/4E2F6D0A-B8AA-BF4E-AF51-F6E2667FDFD1.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/4D634270-8D78-AC4E-8D32-373BC89A041E.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/4AFB11A8-2146-494D-A1F6-5B17A02F7552.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/41883BEC-19FA-2A45-B376-03DBABB58E8F.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/4116D11D-3F44-4E4A-971E-3AE6FA403DCF.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/3FF756A0-3797-A244-8C73-5B36CC7F5AF6.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/3E6AFEB9-95B1-0946-8208-4472BD5B5D26.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/3D61C2CA-E884-D745-93FF-A2BD8BC59527.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/3CE5B00E-483D-934A-9B4E-76A8DC5B2FF9.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/3802C2FB-F9A8-8D4F-83A7-1EB52A8854F1.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/30B0DAC9-314F-0D40-BE02-E860AA5A2A21.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/2A9AA172-AB51-244E-A329-227376BC7739.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/29A58C35-A772-EF45-B4E9-A398C039D1F0.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/24DC7EF4-836C-E44B-93B8-64CF0063D3E2.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/1C91C721-BF6F-E44D-8F92-17F2324E2B2B.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/1ACE2DDA-DA17-764B-920B-60DECF1D2231.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/163C8914-4B40-E940-B42E-295EF0D774BA.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/142F1FC8-7AB8-AD4B-BBE8-C2BC7711817E.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/1329D48C-21B3-E54A-8076-964D21D4E738.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/12D39295-56F5-B741-B7E1-0A7ED8BE2BC5.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/12018ABC-07D5-2F4F-BF34-56F9B8C47C01.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/08131F03-5E21-9649-832C-271E1E2D8E9C.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/07F23F56-359A-4A48-91E4-A51BC9A49DAD.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/07CD784C-59AA-3E44-98E6-274135902C2F.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/0566AA0A-F92E-7247-A02A-097F92C5AF7B.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/036E06AD-D5BB-E349-B579-DEF0D67CD196.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/F987D6F6-A97E-E740-BA7A-0FDF4302B9AE.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/EAC994DC-AF24-C64B-B5DB-28E93F26642C.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/E068E283-A40A-DB42-8D59-773F74DE5222.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/E0102A95-34EF-E545-9107-F48FBA8F3594.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/D94399B8-283D-F048-BDB5-3263EB2682F2.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/D4FC84D1-5D6E-CF46-87D0-7E9FFED7A273.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/D2FD315A-3D54-3245-B69E-93D05BE43332.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/D110A15A-9EE8-5044-8F6F-7262FD626FDE.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/CAFC912B-5BB6-FA46-B23D-91573056055B.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/FE5D64CC-FF6A-FB4C-BCA9-0190CCC8B309.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/FDA5EF86-3D8D-564C-B8B1-428B0EBC1968.root +/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/FBA972C5-FEEB-2D48-B71C-56BDD84DA660.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/README b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/README new file mode 100644 index 0000000000000..c09a41310efcd --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/README @@ -0,0 +1,7 @@ +RelVal/ contains CMSSW 11.1.0.pre2 RelVal samples. + +They use the D49 = T15 geometry. + +They are made with the stub window sizes that you can find in L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py . + +Typical dataset name /RelVal*/CMSSW_11_1_0_pre2*mcRun4_realistic*D49*/GEN-SIM-DIGI-RAW diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/DisplacedSingleMuPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/DisplacedSingleMuPt2to100/PU0.txt new file mode 100644 index 0000000000000..94478d8b06a87 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/DisplacedSingleMuPt2to100/PU0.txt @@ -0,0 +1,50 @@ +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/FF5B9429-29EC-CD4A-9586-0917716E7521.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/F3B79FB2-66CE-5442-85CA-05C1BAB4B7C0.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/FA8B1500-9452-3E43-A54B-9B24A49BCD4E.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/F270BB36-3A73-264F-996A-C0DFCAD2E0D1.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/F3585EE2-95E1-8949-B807-0B74A19AAB49.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/F1675394-EE2E-DE4B-A42C-1A2BEEE37164.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/F18E211D-6345-6941-8F36-807B3EE98B37.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/E045381A-0D1D-9C42-94E5-5045FAA4D1D2.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/EE59DF00-D74D-C54D-94A9-45C24535A236.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/C95FAB84-C478-734D-ABA6-A86E7DC50805.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/D6F69404-B5AC-B643-94F3-2EA7016BCA52.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/C4128A99-5267-2842-B173-4CA7B9005869.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/C62EA1A0-19A5-9E4D-BEF3-280D5894CEB2.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/B5E4BB3E-B810-5047-AAF4-29D85BBB03E1.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/BC122AB2-B70B-0C40-AF04-43749410CDC8.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/B19BF47A-04BC-6249-9F45-C343C50145D9.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/B48A852A-7A47-AE45-94CE-15C2A6CEC7E5.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/A8C9EA46-CF6F-7D49-B74A-C4288C80A257.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/AC5B1F4F-ED89-9D4F-B299-D3163E2310D5.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/97FB1E8D-6A85-C440-86FD-272B0DEA1A9E.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/A843A8FF-8BFC-AC43-99DE-1764802E54A3.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/95D7B44B-5549-0F44-B66C-0865086522A6.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/9674279E-8E87-5B40-B757-5537E158E6F5.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/8645B672-1C46-BC4D-B405-79E489D9E158.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/875C14F2-D33D-0A45-8316-198DE4DFD015.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/78D954C5-D27B-9649-B0C2-DC198C86707E.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/7CBBE9AE-94FB-F64C-A5ED-9271EED0F205.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/71BB23DA-1E13-B74A-AFCD-7A0742C551F6.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/73E4F776-FB93-1049-8734-F586F9DC5E9D.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/6DBF0748-7D5A-3C41-B6CD-E44AA09E3CF9.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/6F59F28D-9016-4649-AC4B-827E4B6F60A0.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/668D4571-ED9C-DE47-BA5B-9FA389F4699C.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/6B1E55CB-F3FD-CE46-8255-7E75E818E024.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/650FCF43-E541-4545-A9C3-454298F0A3ED.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/659CABEA-E6C1-CE4D-8195-56848D1E8A55.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/60108B81-B938-CA44-A088-91C5FAEE1A1D.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/60EB40D0-3FD0-B049-80C5-9C4BCD30FBB5.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/54633563-17AB-4049-A0AD-D9B927A7F167.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/5BD31D22-FD6E-D64A-980A-E2B7640BC897.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/5109CE50-0C41-7249-8C2B-F2C25CB20DEB.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/5336ABED-07D1-4949-890F-C278D6CD1ED7.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/36672A75-9C2B-614D-9FFE-67C34DE1F3C0.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/3CEC9433-5E13-4D40-83FE-17554F62245E.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/22878518-B853-724A-8C7B-AD0D03EC639D.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/2F608FFF-43A6-8E4B-B09F-4E1B4770ADDA.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/0AB53AAC-E236-9A4A-A6F0-361EC3F3AA92.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/0D52DC44-250C-4941-9436-70323A9C6C6F.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/08201211-53A4-6046-92C3-F0561738E343.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/0993B06C-0946-8442-B405-5646CC72487B.root +/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/055AC571-ED6A-CB46-8A94-86C2CBF2A331.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleElPt1p5to8/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleElPt1p5to8/PU0.txt new file mode 100644 index 0000000000000..affadffa2b97b --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleElPt1p5to8/PU0.txt @@ -0,0 +1,50 @@ +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/F57DA310-DFC2-E943-999F-3BA11BC2D4FA.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/F18BA5AE-4FFA-3D4A-B556-A39DC44F098A.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/F508911C-301C-1040-B531-2643F5096C6C.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/EAA6F3E0-9D75-2449-AFC6-74A4928ADE2E.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/ECA39377-0177-FA4F-BBA2-EECC1363F12F.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D4D17D1F-3B29-9345-AB19-43036484A456.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/E8F98948-223A-3741-B1FD-DB5DD681F2F8.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/CF43B4E9-412B-9A48-81BD-3F4665F0BBC4.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D0DA0E35-E0B9-B349-84A4-289EA0BEABA6.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C684E80C-5D36-CC4E-9D57-537F454BF057.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C6C29F27-28B0-FF4F-92BF-1282CA775B46.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/BB6EE695-ECFF-E94F-A706-022E9900E9ED.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/BDE874DB-3EB1-4E46-8C35-AA25ACD6234B.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/B7B22FDD-6D6D-9C4D-A206-63F4576CDA98.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/BB660ACA-479C-4147-A5AF-E4AA43730A45.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/AB14BA9B-01DD-894C-9920-03BBB1D288E3.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/B35C7930-4F1C-D14B-BD66-BA6ED5DB43C9.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A6573A9C-F648-4048-8291-6E4372843E6B.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A97F40AD-BBCA-1848-80C4-C51D6FB6FF9C.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A4262F29-5133-A14B-A132-D68DFDB4FD4B.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A6088BA1-8C2E-8347-BEC5-8B774EF1C565.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/94C1BF23-3E76-3749-ADA8-5C3F5EC83A3B.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/9E6C24EC-31DD-C242-8065-F6E426345F2A.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/90FDF0CD-8237-7E46-8DE6-1CCB0B688CB0.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/91B6FFA3-5BBE-B848-BFA2-A61973E8CEDD.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/8F335803-B82A-2E4F-9F75-8C6AF873AE7C.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/90A7CA82-84A1-D648-978B-2A7B32525DF2.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/70587E35-7CF4-E647-A744-79199DEF242A.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/7C9FA114-5022-0F43-8C90-50988BB0629A.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6DD828CF-CDCC-8D47-83DB-BFF459BFF931.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6EC6F5AA-8A73-FD4B-9C6B-DC7A06219565.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/662314BB-FAA9-2E4E-BCF8-B4FA73296A90.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6A947024-E346-3247-A4EE-DA22FD93C399.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/5A74AFCC-301D-2247-86BC-47561C1933B3.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/5AB84838-20BF-9341-8A6F-3B42A0CDAEAA.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/52D65D3C-554F-3440-8A44-004344DA3A9C.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/559AE4D6-F89C-A544-9948-B84C847F63A4.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/4878B3C1-84F0-D74F-AFDE-679C4EBD3427.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/503B5EA3-D245-8846-AA0B-E24C0B97CDD1.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/46880BCC-391E-CD40-9E38-30F1FEE58AEB.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/4767A5A7-9483-E849-BC48-C90A486B8C60.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/3E8990D3-1FE0-CF4E-ABE8-E443CD4FA146.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/4347C013-40E7-9147-966E-8D940EB24427.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/3CD1D65D-375D-7441-97B1-473AA273AB33.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/3DBD82A7-6881-3649-B960-F21FC3F80626.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/2E90F28B-41F5-DA45-AA0C-90DFA3176FB8.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/3421D134-AAED-444F-9180-5549F75288B0.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/067F7B0C-66D0-6A41-B6D3-A694DF1106B4.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/08F9223B-93C2-0F40-9453-A4BAF5EF175B.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/05557BB4-78D3-194A-A24A-96266FB9ADA2.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleElPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleElPt2to100/PU0.txt new file mode 100644 index 0000000000000..2f8f95a59b47c --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleElPt2to100/PU0.txt @@ -0,0 +1,51 @@ +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/FEFC256A-A20B-C24F-A2D8-923178B9C666.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/E8D52160-7E21-7843-97A8-3D07DF178A1A.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/EAAEA1C3-8403-FF46-A35C-A097591AC473.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/E1A05D32-8450-284B-9AE5-701C14D14A78.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/E4C03E6C-5CAC-8448-8440-551C5D89C325.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D901712A-A249-BA4A-836B-C686F0928765.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/DA7BE535-0D49-164A-A2F8-B6F0DB934336.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D1F7A03D-B1F7-664E-9FDC-D44EEC81211B.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D6F2B027-6C37-734B-A6BC-51C9E84D40E5.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/CCE4532E-B841-CF44-94D2-A67A3BB2C8C3.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D07ED56A-6079-0B46-97BE-2668A2D73914.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C69526BE-4F68-1441-82A5-D0073FE866D3.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/CA3435C2-38E1-124A-A2CA-9EA2AA546296.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C438031E-3350-6A48-B7D7-7953BE22AEF2.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C533F28B-786E-2645-96BD-7EE092BFA48C.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C38DE343-CA56-9346-8218-DE65C07E4003.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C3A50426-D4C2-C84A-AC9E-B7251984DF12.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/BFFCFAAC-27C9-7A42-9A45-1F486B37484A.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C08F71B3-8F06-D446-A3C4-FF20A5ECFEA6.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/B8D05768-00B9-6148-90A6-CB282ED03B52.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/BF98E513-307D-4C46-AF5C-3B95A7A2D4D2.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/B3771023-E32A-4947-A4DD-4903BD070E92.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/B43B51A3-2068-474E-812E-A184BDA19986.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A8915DC1-F327-5048-BEDD-4841D63CC13E.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/AC0A02D5-6D16-C04D-8A10-FD1C50F2D0E0.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A607A4ED-DD85-E94C-8FD2-8C32BFB94188.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A7CF2B8E-5C92-2B4C-9C93-CAA5C49DDC57.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/9324BDD7-C0B0-304A-8F9E-A4D85B2E492A.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/99434B33-7554-C644-93EE-D67F9151CE9F.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/8914183F-3CA7-2947-856B-43849D4301D3.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/8D440807-81CB-D245-9BD8-8E54E523CAA7.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/7C98A1E8-F103-864D-A78A-6100AAB86C98.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/85FD682D-98AC-EF47-95E6-DA66A476F77E.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6A298091-931F-864F-A4D0-1FBA18985DB0.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6E77CE4C-E3D6-7B4A-82DA-06023879352D.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/627A8A0E-BBED-0F48-89ED-34D256336644.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/64EA553E-2FA5-6D45-AB52-D6A120D132C8.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/5616F374-DAA8-7B40-B5FC-9829EE31F6FE.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/5FBB13DB-5E66-084D-818B-74ECA5133C54.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/5245A3C2-296D-8B44-A9AF-4C751FEA1C75.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/52B02872-D82A-4C4B-AF8F-E67DE7EA6809.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/3ED17E43-2A16-B744-91D7-AE786F061356.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/4E4FB4B4-4156-4E4B-9BA5-0B657FBCC35E.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/351D9699-6E0D-E049-8E7B-EF8CF2FDD32E.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/363EDCC6-FE8D-4A46-BFB5-D42D42262BB8.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/24D52702-0648-BF40-86EA-FCA14F645E6D.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/2A0F3624-5540-4F45-B769-301EB2645DAC.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/1C5CCD51-86ED-4E48-90A0-F9650EE76A9F.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/21B172D4-4542-DF40-8B8A-6F5D26FD9994.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/0155DF53-DE7A-144E-96BC-C7FE967D24D7.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/0517AC4E-F3B0-7F4E-8ADE-4360D853CF77.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleMuPt1p5to8/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleMuPt1p5to8/PU0.txt new file mode 100644 index 0000000000000..b98306766fd5f --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleMuPt1p5to8/PU0.txt @@ -0,0 +1,50 @@ +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/F751FB56-51DC-0A4E-B7E4-311F47D3D68F.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/EA96AA1B-33FE-E840-8745-3F866373DC68.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/EC89CA05-F93D-0C41-AAD7-36045D8F11A5.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/DD328472-DB4A-ED4E-BD6E-1FD6B7A3C0BE.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/E86449F0-9D91-9F42-96C5-97C3A84642B2.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D03F5F4C-8975-5747-82E8-1659482C247A.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D1B4EA28-5BA9-7B4B-982A-B67AE72E3601.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C73A6999-7546-E14B-830F-5805CA3BB76A.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C836FB27-7F81-3146-AED9-C860B93B26A9.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/BA23EB9A-7078-A944-8243-DB51BD8806A3.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C5C705D5-0B4D-514E-9849-47A56D4CCC42.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/B0C962FA-DA23-874E-A238-0E4927D06FDC.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/B2F28CAE-8FAD-404C-B6B2-71BCA0152C80.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A6F63CC2-D50A-EB41-BF42-64798BF9FDA4.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A91B4FDF-F606-8E41-A56F-ED7A3931ADB9.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A1F8EFB0-BF55-4340-AA4E-493E65564E60.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A527BF86-35B1-864F-B0F8-99C31117272E.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/97B43937-B131-6E4E-9D78-F36C813D82AB.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/9AE9BCC7-3031-AA48-B53C-5795FD7DFEFE.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/8B37C3EC-3BE5-8042-B215-D55DCAD3FF42.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/977FA15C-6D74-D54C-B490-96E24B706060.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/8176CC78-0BC4-384A-B36A-E33A976DFEA6.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/8A09474E-D43C-B742-B4E3-63BF22578261.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6C52A883-8F62-664D-B578-DA26C3C72555.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/72934908-0B40-EF44-836D-EC8E7477EADC.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/67B585C4-D26A-0A45-BEFA-C99E997DD026.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6A003F9C-5CA9-1C45-8822-05F49DC002F6.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/59E96F12-169A-1748-BC1B-75CDFF6BF553.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/64445E23-4334-DD4A-B87B-D5C63ECD3BD2.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/57C1C795-B52E-6740-B38F-0083EC43892F.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/588E290D-AF50-FE46-BFD9-C58A8A094509.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/51100FED-9D99-F442-957B-3694A1559B49.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/518FEF44-D0DC-4046-BAAE-116C5BB83C70.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/50780A39-AB78-8041-8E42-70F570B7C789.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/507CF4F2-F7B8-DF4B-B4F4-B74CA7881AB0.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/3D664658-E863-B44A-B032-E2185391B3DC.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/4AD503E1-13D4-D341-97AB-5D134A58B435.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/27A6EF0C-4D95-3246-85D4-5000075A1911.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/2E1CF017-0087-5D4F-8BEE-1E8B292FE60A.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/26E5F589-B492-8547-98D9-BA6705277905.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/26FB54CA-CB91-374A-B26A-FA9F15DFDF01.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/1B7C4498-ECF9-0943-8150-09CD192A94F6.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/25F4532A-DA89-1C4B-A835-2432682C3808.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/1518AA47-340F-8A45-BBCC-4F0D6A0718D9.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/1B54A0E1-A4C4-6D43-8DE3-AF474B25B37D.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/13288A85-FDDE-6042-9060-DE1B84B34DA9.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/145EEB15-A2EC-9C43-9B6C-65D800388118.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/0A4FED94-E53A-7F4B-9E60-0CCC99F4AB5A.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/0D09289A-35F9-034B-9F7B-02FEA25584F2.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/038341FA-0E1F-DF41-A407-1F8CAD954B62.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleMuPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleMuPt2to100/PU0.txt new file mode 100644 index 0000000000000..8a1079df028fb --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleMuPt2to100/PU0.txt @@ -0,0 +1,50 @@ +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/FDFAED78-D3CA-A44D-9BDC-E9FB3133EBD2.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/F9EE8F78-1EB2-D647-99D3-D361CD62FADE.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/FDA937D1-BB09-B244-8076-B973DA0B77B3.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/F4B3E089-2089-3842-9B2D-FCD081D5F51D.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/F93D5E93-439D-C645-BF61-9D12B644A663.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/E6B6976D-70AC-634C-8B18-2AFE85DD1C30.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/F403A759-446D-F64E-BE4E-430993C4636B.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/DAB315AE-9565-F546-9774-2FBC2E58B10C.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/DEE2C072-2B14-C544-B366-6DC9F98245C3.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D95C1470-EA43-7C40-97CF-D158846BB556.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D9A589CE-E011-774A-991A-CF1DB8BC0BAF.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/CA9DB597-30A3-5B4A-9E4F-E1DB216D4339.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D87BE0BE-D8F8-5D4E-B61C-1F53445B0F6D.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/BA35600C-C21B-C34D-BFF4-6E1CF79B60D1.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C0A8E214-A9F1-D34E-A972-C608A4C3F8C0.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/B0FAF141-EE41-B44B-9BFF-78DF6E95A9FD.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/B91047A7-6B4C-7D4D-910F-422316D05EA5.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/9EBF9B1B-295D-DE4D-85A5-E0F00CE3F9CB.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A4676075-9E5F-8540-9528-840B250671DC.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/99142434-7472-DC4E-ABCD-92B1A2444EBD.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/9A251258-5523-6A42-A9D3-0383D74CB057.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/984DB0E0-43D6-4F42-9439-B2B1B0B27F82.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/99071470-A67B-CF49-A30F-477D92CAC1B0.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/9289990F-BEA4-6B44-A704-85F778601D7E.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/96596EBC-912E-4B48-8719-7031F0EE1117.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/8A1D92C4-65D3-EA41-92B0-C67AB6B79CD7.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/91AB272A-9444-DE41-A285-78C15A7E2EA4.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/7CA60F55-6EF6-7345-B524-779154AC2785.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/7E1B4ADD-CCFB-7146-AA2D-503EDBF168CF.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/7176ABAC-4284-624D-BFB3-E5A7B2EFCB05.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/75398907-A200-D24D-A8CA-9D912B56C489.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6F66A0E2-9937-1342-B9F2-04BA3B5BE0EA.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/709B1224-9A19-CE4E-B0EE-98696F6D14DC.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6AB44314-E551-7747-936B-AF931AAD8AEF.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6BE6B86F-D3F6-834A-A6FB-9D92AF8BAEC1.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/5D42CCB2-1662-EF4E-B315-DBB6AF76B818.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/697CC3BE-4712-0342-BD17-085A914DA193.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/4334F931-B1DC-AC4D-A40D-FA8ABA6E8DB7.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/5163CD63-3B10-B54E-AF4E-FE93E83DBFB0.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/318A3D3F-7EA7-0046-85DE-D759BBD45301.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/386D7F7B-D120-0D4A-91A0-FB5BD0BB963D.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/306E7B67-F05F-0548-A12D-9D5CBBFBE08E.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/30D4FF72-5E46-8E4D-BA28-5798EAF22119.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/218997EF-E88F-7440-A5A0-6A858281B45D.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/2FE64AA8-D671-D642-8C52-089E587CE2B3.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/1D02C496-3CCC-C644-8AB6-8E566997D750.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/2175819C-84A1-604F-AF0D-6B0A2CD167B4.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/0CB3D988-066D-5A44-994C-F6BA65F9A17F.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/15FEF07B-0E1B-4D46-B6D9-22CB09734BA1.root +/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/03C3A272-54BF-3341-92FD-C8484DFCBB3F.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/TTbar/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/TTbar/PU0.txt new file mode 100644 index 0000000000000..c83ca139acdb0 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/TTbar/PU0.txt @@ -0,0 +1,10 @@ +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/E69DE8B3-6117-A94F-A5A9-84A481F15013.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/D5E4A5FE-993C-1848-8EC5-B61134EC23D8.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/AEF88B74-5FA6-CD4A-AB7F-4017FB7388E7.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/98728AF9-B10F-964B-AA44-746FE1B4E9E4.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/96AEEF21-E8CC-2341-8AC6-F9816BFA0915.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/8AC03800-3995-4943-8DD8-0A2DF92148D7.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/7C9D3EE5-1DE8-BE44-A481-C6AA6167F06E.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/4FC41F00-C32F-CF4E-B171-B15C72E195B6.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/4A5CAF82-FBA2-C545-B253-A7A7CD7846D0.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/13492D88-2B80-1F44-8F5D-2BFF035C594E.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/TTbar/PU200.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/TTbar/PU200.txt new file mode 100644 index 0000000000000..009ed708369aa --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/TTbar/PU200.txt @@ -0,0 +1,100 @@ +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/F7BF4AED-51F1-9D47-B86D-6C3DDA134AB9.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/F70AFCD2-89B3-2343-8ADA-D2101F96943B.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/F33F8D29-C834-B34C-AC6A-4C96BCC9A626.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/EFC9D9D3-09DC-304D-80E1-3A14B9E8CDDD.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/EEF2AE4F-EAF2-5645-B18F-99261DE20003.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/EDDFE6B7-2090-454D-AC74-6383EF7BAC4E.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/ED1C5441-CA4C-A141-8357-21C0B53B0107.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/EAAFC2A1-1B42-E646-9BF9-97044C55DEF2.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/EA9FB146-B4C3-3C43-8659-85C6B10FC102.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/E7C703EB-C0A4-3444-ABB9-238C073B6F30.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/E4B9F995-B581-A745-B146-2266946D269B.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/E38860B8-5CAA-8E40-A173-15A491C48A46.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/E076979E-F794-6340-9BD8-9C80481932C2.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/DD2840D0-C847-CF45-910F-96F7234A4AB9.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/DA54D201-326E-FD42-8699-F6CA199478E5.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/D903A49C-8165-FD42-9BD6-0D7CEFB0E59B.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/D752C9B8-89AC-3649-92D5-2FACDB833DA2.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/D73F6913-CED3-394F-B0D1-E69021C5940D.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/D5AD94EF-A51F-BC46-BFFC-55CE950C5DA8.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/D127EC6A-24A3-CF4C-8B26-F236DF38B418.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/D0436FCF-E73E-5047-8CC1-B791848B33E8.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/CDC8A949-25CC-3645-A617-5888DC969ACC.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/CC8648C6-9020-4049-8989-1BE3E1045F52.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/C6D01D89-518D-C34C-AC6C-82C2EEB25704.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/C1A6E047-C20B-4346-B847-D59F44DB8C1C.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/BEB07086-4E62-7545-B0EA-EE306EF92A57.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/BCCF6391-B91C-ED4E-BEA3-E6D1BAEA6525.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/B71CD44D-7699-EE47-8EC6-7B98ED5F0D37.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/B71175A4-6640-264E-96A1-EA60A71E687E.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/B68E4FF0-2F65-A745-9B16-49B291679529.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/B6353549-F404-E343-93D8-698C63493460.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/B4570A24-6039-3849-B5AA-9CC98C722DB8.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/B3EB6DEF-07BC-1143-88E8-AD6CEA05F715.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/B1839A4F-F4FE-D843-B6C1-8BA2D8195A68.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/AFC3379F-D527-6A4A-905F-102190D1F075.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/ADFDD787-F9A5-F646-B627-58D5C1A34721.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/A517206D-00A2-CF40-A354-5B553A5573C1.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/A17BCA6E-D522-164F-9248-8F601F2207B0.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/9E73DD8E-C0B8-AC4F-A53D-81FB5FF4D922.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/982FA6CD-1981-2B4A-B2F9-94A94D6E7954.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/958D174C-B205-4248-BD39-322615577DC5.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/9413EFAC-E403-0B4F-94ED-A4FA03B43671.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/938709BA-9908-B54C-95A5-94A199AC27D8.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/92C9BD7D-8AD3-7C4C-97A0-94514F29BA07.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/908BA86F-B138-F841-86D1-58F5E0F8F121.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/8DF72AEC-169D-D14C-8EE6-E6A6622F3822.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/8BC0C5A2-B50D-354C-A1FB-94F195FE467D.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/81E3120B-EAED-6F4C-99C3-2B3083239EE5.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/7F8D9344-621E-8749-BB29-FC3CB2B1142A.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/788F43AF-569B-3748-93D6-27AB2946C6E3.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/7697ABFB-53DE-FC4A-AE37-11218470D07F.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/757AACFA-5A51-DB4D-A684-787AB07CFEB4.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/718AC8A2-8216-AB45-9F10-BD00572655F8.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/6E43C4E5-2B01-474A-B513-8F8324D932E6.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/6C9CC922-4951-BB47-B80D-21A3EAB8AD15.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/69338A51-59F6-EF4F-9C0A-077704617D76.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/66B8F718-404C-FA4F-BF85-5D3948E26942.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/6490C99E-2941-8142-BC26-432E09E3A3D5.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/634006F2-1387-1744-92C3-51ED13493A62.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/61C06970-5F68-6041-B55A-1007E2ED5481.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/5C1CC8BB-45D0-CA4F-AC74-59325A4E7DE9.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/5AC85DC4-D7B4-5244-AE50-E764FC3E4F86.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/59C43C41-2C92-0643-BB04-F21C05CFF574.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/58EB68DB-8D00-A84D-B988-936113E7BC92.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/57153022-7C25-1640-AE8C-9709EADCCF36.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/510FCEF9-0932-5143-822B-6378FE079BAB.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/50177436-CB29-BC4C-98D0-BDA85BEEB08E.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/4D57281D-3A89-1E42-9AB2-DB80BB399FC0.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/4CFAFEFE-C788-2E48-9BF6-B1676E82A62E.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/4A507D16-B591-E84E-9B90-0C729F0318B5.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/47E643B6-15AD-1F49-A574-E9562F5DC995.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/43CD9DCA-43CE-0C40-95BC-8FD95EC8700C.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/41F50E4D-5B5D-1A43-BD24-31D610D4A0E0.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/3F8518A0-5ADB-C240-A40B-C02D1123A8FB.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/3EF5B3E6-9690-6746-9E5B-0B263F6961CE.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/3E81E27A-6471-2B42-BFC3-2042187A43B6.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/3DE1B87A-8B3B-5740-B53F-6666A93CAED6.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/3BFAC80B-14E8-894A-823F-12B4E01767B2.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/3B3E10DA-177D-F342-AC2F-A6135B12B38F.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/3696DF04-0EC1-144D-8B60-654C92D5F54A.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/362DBABD-40F9-B04E-9870-CE0E77E87EB3.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/337BCFC8-2EDA-EC41-9757-5C305ADB9106.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/313C02BA-692A-F147-8607-9FAB44E693B7.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/2E42F494-7EF1-6848-8165-4E43D4E45E83.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/2D153BE5-611B-3E40-B3D1-E1D5A35A53E6.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/2C3F5156-3A3C-074D-9F89-462EC5E6E058.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/2B390F84-395E-D44B-8E4E-4ACB9F526817.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/26321D7B-7A96-E442-B644-C4BED07AA807.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/25D90FC3-49EF-7448-89F6-935F8D4BB8AC.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/20A54E94-A2D2-FA4A-B5F7-DFF768ACC6F5.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/1F59B52D-BD93-CA4A-BB59-64E00A436EEF.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/1D2905A5-5CB9-BB41-8C59-64427CEE7082.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/19678708-B88E-A547-884E-CD1D924B2D3C.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/1818154D-11CB-9841-932A-A48845A430B6.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/176B2AC1-57AA-DE46-85FC-D375D25C4C2A.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/11564303-DE2D-474D-99ED-F4CB2793C5FB.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/09C2F689-B97E-6C44-94D2-C76445A4D703.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/07EEAB60-C58E-6146-804B-6BA1B8E14875.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/075DCEC8-A2E9-7E48-A630-E1CBF89370A9.root +/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/01816581-F04F-B849-83AA-38A348F9320B.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/README b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/README new file mode 100644 index 0000000000000..35e346522a0e5 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/README @@ -0,0 +1,7 @@ +RelVal/ contains CMSSW 9.3.7 RelVal samples requested by the P2 L1 trigger group. +They are made with Seb Viret's Dec. 2017 stub window sizes, +which you can find in CMSSW 9.3.7 in file L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py . +They are slightly looser than the 9.3.2 samples. +The MC was made with the D17 (=T5) tilted tracker geometry. + +Typical dataset name /RelVal*/CMSSW_9_3_7-*upgrade2023*/GEN-SIM-DIGI-RAW diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/OnlyPU/PU200.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/OnlyPU/PU200.txt new file mode 100644 index 0000000000000..c2bf9623feb89 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/OnlyPU/PU200.txt @@ -0,0 +1,255 @@ +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/004A0CD1-112D-E811-920E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/00CFFD4F-172D-E811-B95B-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/00EB7027-1A2D-E811-914D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/00F26841-1A2D-E811-9D15-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/020C1E68-0E2D-E811-81B0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/021AA3E0-112D-E811-A48C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0226F031-0D2D-E811-AF84-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0248687C-0F2D-E811-8329-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/02901C68-0E2D-E811-BDEE-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/02F951DA-112D-E811-9F62-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0450346F-192D-E811-83F3-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/04AAF20F-152D-E811-BD9D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/04C3334A-172D-E811-8831-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/04EB0170-0A2D-E811-AB55-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/062F18CD-142D-E811-9B5A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/083B705D-192D-E811-AFFA-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/087FF21A-182D-E811-8E03-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0895404B-1A2D-E811-9CF2-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/089AB08F-102D-E811-8911-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/08B7C261-192D-E811-BE98-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0A16B83F-172D-E811-B040-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0AA1034D-1A2D-E811-B8A3-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0AE7331A-182D-E811-89AE-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0AF1C266-0A2D-E811-A8CC-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0EA28FD0-142D-E811-BC43-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0ED12B6A-192D-E811-9622-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/100CC233-182D-E811-B84C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/102431CE-142D-E811-980D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/10646866-0A2D-E811-9B71-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/12B6F031-0D2D-E811-8F60-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/12C68550-172D-E811-9F51-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/14ECED28-132D-E811-A5E5-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1600844F-0E2D-E811-91C6-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/160B7B46-1A2D-E811-83A0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/16A4884D-172D-E811-A3A9-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1802046B-192D-E811-8100-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/184C394D-172D-E811-A86C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/18502219-182D-E811-B85E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/18B77F13-182D-E811-AA5B-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/18ED3DD3-182D-E811-8FD1-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1A1C0F27-182D-E811-870C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1A39DFD1-112D-E811-B854-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1ACCF333-122D-E811-ABE3-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1AFE0FCA-142D-E811-8F4C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1C0DD329-132D-E811-BE04-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1C22CB21-182D-E811-908C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1C8C6B4E-0E2D-E811-9FBD-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1CCACC4F-0E2D-E811-B7BB-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1CCF4472-192D-E811-86BE-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1CD14574-192D-E811-9634-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1E27E929-182D-E811-9BE9-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1E46D09F-192D-E811-9745-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1E74A9DC-112D-E811-9966-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/206367FD-142D-E811-8092-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/20731343-092D-E811-B5C4-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/20D27A4B-172D-E811-B827-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/20E391D0-142D-E811-810A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/20E7E95B-192D-E811-B310-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2216A33C-0D2D-E811-80A2-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2293B93F-172D-E811-B33A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/22C2FA4C-172D-E811-B991-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/22D24E48-172D-E811-9B7F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/244D4366-192D-E811-BB53-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/24A21720-182D-E811-9AE9-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/24A7F251-1A2D-E811-ABD6-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/24ADF942-172D-E811-9964-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/24EFC529-182D-E811-9073-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/26058B48-172D-E811-BEEB-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2674BFF9-172D-E811-826B-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2679DB4C-172D-E811-A5FE-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/268D01E3-142D-E811-BF79-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/26E95840-132D-E811-8802-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2801B228-0D2D-E811-A671-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2822DA39-172D-E811-96E8-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2A4BA246-0D2D-E811-890A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2A7EAD49-172D-E811-93C8-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2AF9AF2A-182D-E811-B065-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2C2D4D53-172D-E811-AB48-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2C379C47-1A2D-E811-81D9-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2E26EA49-1A2D-E811-87D0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2E2D376F-192D-E811-9BBB-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2E4FD73B-172D-E811-BFEF-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2EAE274B-172D-E811-AEC2-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2EC45A6E-0F2D-E811-A3FF-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3084FD0E-142D-E811-AE5C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/30AF356F-192D-E811-B985-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/30F1120A-192D-E811-8D0D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3206F148-172D-E811-84FA-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/32445E29-182D-E811-8DDD-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/32A5E5A2-102D-E811-B95B-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/34E6133A-172D-E811-ACBF-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/361EA749-172D-E811-BFF5-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/36A73914-182D-E811-A330-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/36E744B1-162D-E811-AEE1-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3849F429-0D2D-E811-BAFB-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3A4DEE5E-192D-E811-AAF9-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3ADA3C3A-172D-E811-A9A0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3ADCF646-0D2D-E811-8A9A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3ADDAE60-172D-E811-9FE1-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3C5F9020-152D-E811-843D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3C7D3044-1A2D-E811-85DF-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3C83B23E-1A2D-E811-9D5C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3CBBF557-172D-E811-93C6-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3E0A0F39-172D-E811-AA40-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3E1AD1CF-172D-E811-A55F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3E27A2E3-112D-E811-BEAA-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3ECAFCE2-142D-E811-A220-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4008353B-172D-E811-BC3C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/402AD2E7-142D-E811-B030-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4051BFDB-112D-E811-900C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/40631ED9-112D-E811-962C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/40BD3F50-1A2D-E811-AD0B-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/40E2B10A-142D-E811-A757-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/42215043-1A2D-E811-B746-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/425FF3DF-142D-E811-9E27-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/44644515-182D-E811-97BD-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/44674FCF-142D-E811-9948-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/447D4114-182D-E811-9137-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/449DCAE3-172D-E811-AD96-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/44C3B028-0D2D-E811-9371-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4608803F-172D-E811-B577-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4632C327-122D-E811-8E2E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4652B1BF-112D-E811-8627-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/46D7F71A-182D-E811-9836-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/480973A6-192D-E811-92A2-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4861F429-0D2D-E811-BAC0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4A05F433-122D-E811-9264-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4A657E2A-182D-E811-B10B-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4C057041-092D-E811-8131-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4CC3C180-192D-E811-BA01-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4E213A30-192D-E811-83FD-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/509ED54D-092D-E811-BB58-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/50F18EB8-0F2D-E811-A81E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/522D7339-172D-E811-9234-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5239B120-182D-E811-9F3B-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/524D6BD5-172D-E811-82BD-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/525A0870-0A2D-E811-8FB0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5275EBA4-132D-E811-B523-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/529C663D-1A2D-E811-A3C3-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/52A7666A-192D-E811-A6FB-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5409F529-0D2D-E811-9D26-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5495CA3B-0D2D-E811-9F98-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/54AA703F-172D-E811-929D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5697C56C-192D-E811-9560-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/58273B50-1A2D-E811-8AED-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5A18F35C-122D-E811-90CC-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5A1D4167-0A2D-E811-B4C7-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5A6C3F50-1A2D-E811-B3E0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5ACFCA2B-192D-E811-90AB-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5AFCBA7C-0F2D-E811-BCB5-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5C0E363A-132D-E811-9B84-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5C655A41-092D-E811-8D7A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5C7DE3A2-102D-E811-A7FF-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5C8E9964-0A2D-E811-9BBB-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5C93E3A5-102D-E811-9AFB-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5CEAD031-132D-E811-A861-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5E18623A-0D2D-E811-8970-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5E59E63F-1A2D-E811-82D2-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5EAE9863-172D-E811-9EFB-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5EF15CCB-112D-E811-8F79-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5EF410F0-172D-E811-89E8-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/600B5231-182D-E811-908C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6014945D-192D-E811-B327-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6040E29C-192D-E811-A0B3-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/60491517-182D-E811-AE94-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6212C84B-1A2D-E811-A2CE-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/62408C3D-182D-E811-8AB4-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/62B3D273-192D-E811-82F4-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/62BC762B-142D-E811-808B-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/643EAC31-182D-E811-A08C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/644ECF66-0A2D-E811-92CD-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/64F5EE3F-1A2D-E811-BFE8-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6693E320-182D-E811-B2BD-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/66F4E94B-172D-E811-B661-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6849DA4C-1A2D-E811-A4D0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/684AEACD-142D-E811-95CC-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/687A7E3E-172D-E811-A5B7-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/68BF4AAD-0F2D-E811-A80F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/68EF5DC9-142D-E811-A603-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6A035175-192D-E811-924B-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6A08AA31-182D-E811-BDB8-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6A19584B-172D-E811-8CAC-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6A8D4C2D-182D-E811-854A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6A8D8ED0-142D-E811-BFA1-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6C3F234E-172D-E811-B71F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6E3BB27D-0F2D-E811-BDF9-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6E79C035-1A2D-E811-BA60-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7006F41A-182D-E811-ADD4-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7013C23B-0D2D-E811-84D3-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/702DC130-182D-E811-9E7D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/70490E36-182D-E811-B311-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/705A7972-192D-E811-960C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7067DC17-182D-E811-AB2E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7074E7B8-132D-E811-A38B-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/70D59C3F-172D-E811-B2EC-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/70DBD46D-0A2D-E811-8216-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/72044E2A-182D-E811-B8B0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/721AD514-182D-E811-B175-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/722857DA-172D-E811-AA20-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/723A1343-092D-E811-9D0C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/729850CE-142D-E811-9E3A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/72BFD825-182D-E811-96C8-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/72CB3F66-0A2D-E811-99AF-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/72F6904F-0E2D-E811-AE05-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/74201E28-182D-E811-81B8-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7459394D-172D-E811-A47B-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/749A1B39-172D-E811-9D92-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/74C1C427-122D-E811-948F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7664FD6F-0A2D-E811-9F89-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/76B8F2DF-142D-E811-AEDC-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7843F411-182D-E811-AC82-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/78D2A428-0D2D-E811-A19C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7A334039-172D-E811-9F99-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7AE3D94D-092D-E811-9915-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7C278F0F-1A2D-E811-9360-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7C958633-182D-E811-AEFC-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7CB13914-182D-E811-9338-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7CDDB02A-182D-E811-8C29-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7CE19D53-172D-E811-BAD2-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7E8861CE-112D-E811-9D12-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7EAFFA2F-132D-E811-A57F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7EF82CCF-112D-E811-A876-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/808C3C32-182D-E811-93E7-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/820B376F-192D-E811-BC2D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/82F21518-142D-E811-A94F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/84151A09-182D-E811-8FEC-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/84509244-1A2D-E811-B8F7-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/845EDCDB-112D-E811-B698-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/864B8F64-0A2D-E811-8B5A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/86DB343B-172D-E811-B0D2-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/86E6482A-132D-E811-8C45-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/880D5378-192D-E811-88C7-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/88932485-192D-E811-9A1A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/88EE04D1-142D-E811-8FEE-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8C035FEF-142D-E811-95F2-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8C0B7563-192D-E811-B678-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8C0E9E9A-102D-E811-AF3E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8C3CDE43-0D2D-E811-9CE3-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8C4AAC79-192D-E811-823D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8C775373-192D-E811-AEC3-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8EBE2147-1A2D-E811-A81D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/90A16EB9-112D-E811-A2A6-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/90C9261E-182D-E811-842E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/92590328-182D-E811-8D81-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/925EF031-0D2D-E811-B4AE-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/946AAF76-192D-E811-A820-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/94854872-192D-E811-AB9A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/94C63914-182D-E811-8B28-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/96123D2C-182D-E811-AA27-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/96A08019-182D-E811-9962-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/983D40CD-142D-E811-947D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/98B3EC29-182D-E811-A384-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/9A190450-0E2D-E811-8C73-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/9A8051AD-102D-E811-8995-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/9C17A749-172D-E811-B53F-0242AC130002.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleElPt1p5to8/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleElPt1p5to8/PU0.txt new file mode 100644 index 0000000000000..92a67fc7ecb17 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleElPt1p5to8/PU0.txt @@ -0,0 +1,50 @@ +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/00336161-6E52-E811-92F4-0CC47A4D7618.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/0414E3B8-6952-E811-A8C8-0025905B8606.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/04D3D1BA-6952-E811-9E87-0025905A606A.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/0A146427-6A52-E811-9309-0CC47A4C8E2E.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/0CE1F0A4-6852-E811-8C87-0CC47A4D7698.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/16C8B740-6A52-E811-BDF6-0025905B859E.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/16FD4E3A-6852-E811-8117-0025905A608E.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/22A78AB0-6952-E811-A05B-0025905B85EC.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/2AEA1827-6A52-E811-9372-0CC47A7C34D0.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/2C6AB2C0-6952-E811-8A9B-0025905A605E.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/2E9B2443-6A52-E811-83C9-0025905A6090.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/38ACBF0D-6752-E811-893B-0CC47A7C3430.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/4267E529-6A52-E811-B0B3-0CC47A78A408.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/4EE31D32-6A52-E811-B1E3-0CC47A4D7658.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/527BAD42-6A52-E811-995E-0025905A6104.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/52D50725-6A52-E811-8FEE-0CC47A4D7632.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/589A1D2D-6852-E811-B3B8-0CC47A4C8EC6.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/5E62FC23-6A52-E811-8DAE-0CC47A78A2F6.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/629ED0AB-6952-E811-84A5-0CC47A4D7678.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/66C79E34-6852-E811-AC2D-0025905A6118.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6C32E86D-6A52-E811-A388-0CC47A78A45A.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/703C51B1-6952-E811-9D89-0025905B85B6.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/764FD04F-6A52-E811-AE28-0025905B85BC.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/76C26521-6852-E811-A96B-0CC47A4C8F10.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7A6E89A1-6952-E811-BAC9-0CC47A7C3412.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7CD701B5-6852-E811-ABF5-003048FFCC16.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8672FD28-6852-E811-B1C5-0CC47A4D760A.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8A6F9FAC-6952-E811-8E6C-0CC47A7C3572.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8E3FEBAA-6952-E811-8260-0CC47A78A3F4.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8E5081BD-6952-E811-AA4C-0025905A60CA.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/92C2B19F-6852-E811-80C7-0CC47A4D76A0.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/9453EF36-6A52-E811-9F73-0025905B8610.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/964C49B5-6952-E811-BC63-0025905A6084.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A21C4169-6E52-E811-84F0-0CC47A4C8E66.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A226222D-6A52-E811-AEC8-0CC47A4D768C.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/AA697728-6A52-E811-A900-0CC47A4D7618.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/C600C928-6A52-E811-BCBF-0CC47A4D767A.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/C69FC0A7-6852-E811-9EF6-0CC47A78A408.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/CAB6ED0B-6752-E811-80C2-0CC47A7C35D8.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/CC891600-6B52-E811-89A6-0025905A607E.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D86412B0-6952-E811-B77C-0CC47A4C8E66.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E03A9D37-6A52-E811-9A58-0025905B860E.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E2B73F3E-6A52-E811-BB67-0025905A48E4.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E6C4541F-6852-E811-B93E-0CC47A7C35B2.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/EE672D2D-6852-E811-B4D7-0CC47A4C8EC6.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/EEB78D25-6A52-E811-AE15-0CC47A4D75F6.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F8A5EC41-6A52-E811-80C0-0025905B8572.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/FA2D17B6-6952-E811-9BDC-003048FFD7A4.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/FA85CE3C-6A52-E811-80E2-0025905B85AE.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/FCFB2F40-6A52-E811-B8B7-0025905A605E.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleElPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleElPt2to100/PU0.txt new file mode 100644 index 0000000000000..e029eeed1ca07 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleElPt2to100/PU0.txt @@ -0,0 +1,100 @@ +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/0C3D349F-6F52-E811-9B6E-0CC47A7C3444.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1000C104-6B52-E811-90EA-0CC47A7C347A.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1256DBA6-6F52-E811-A6B7-0CC47A78A456.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/127E5873-6C52-E811-8879-0CC47A74525A.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/12A80FA1-6C52-E811-B49F-0CC47A78A360.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/144B6EEF-6A52-E811-B9E6-0CC47A7C3434.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/14E8805C-6C52-E811-8E00-0025905B855C.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1608059D-6C52-E811-B71E-0025905A60B2.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/162DB4BB-6F52-E811-A8C9-0CC47A4D7638.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/16B1720F-6B52-E811-A9DD-0CC47A7C3432.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1888ED9B-6C52-E811-B9FD-0CC47A7C35C8.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1A871AE3-6A52-E811-AEAE-0CC47A7C357A.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1E092FF3-6A52-E811-B1B2-0CC47A4C8ECE.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1E4661A2-6A52-E811-AA03-0CC47A4C8E20.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1EC9CE25-6A52-E811-BB7C-0CC47A4D768E.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/206B337F-6C52-E811-817E-0CC47A78A456.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/22370253-6A52-E811-B285-0CC47A4D76AA.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/28A97427-6A52-E811-83F5-0CC47A4D7674.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/28CEA5EE-6A52-E811-95C1-0CC47A78A33E.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/2A09D9C4-6A52-E811-B1EE-0CC47A4D769A.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/2C4C7CB2-6C52-E811-B2EA-0CC47A4D76B2.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/2C709192-6C52-E811-A5E7-0CC47A4D76B6.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/2E3E92EB-6A52-E811-BD61-0CC47A4C8E70.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/36B3B743-6B52-E811-80ED-0CC47A7452D0.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/38773942-6B52-E811-850E-0CC47A7C345E.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/3AB66F92-6C52-E811-B767-0CC47A4D7692.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/3AE576A9-6A52-E811-BEBD-0CC47A4D7640.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/4452EBA7-6C52-E811-9CB8-0025905B85D0.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/46353D18-6B52-E811-87B7-0CC47A4D769A.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/4AA14FAD-6C52-E811-90CF-0CC47A4D75F2.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/4C579A06-6B52-E811-A74A-0CC47A4C8F10.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/50C5DAEE-6B52-E811-B9F8-0CC47A4C8F0C.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/523681C7-6A52-E811-AFC5-0CC47A4D75F8.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/52744EB2-6F52-E811-A703-0CC47A7C3430.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/52BAB2BC-6F52-E811-B78E-0CC47A7C3410.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/5469014F-6A52-E811-8317-0CC47A4C8E1E.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/5A30DB1E-7152-E811-90AB-0025905B85C6.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/5AED78E8-6A52-E811-842B-0CC47A78A418.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/5E8DA40E-6B52-E811-8E03-0CC47A7C340E.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/5EBE9DA8-6F52-E811-8A47-0CC47A4D76B2.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/620E51AB-6F52-E811-B5D9-0CC47A4C8E2E.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6212B416-7052-E811-ACB4-0CC47A4D75EC.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/66FF2C57-6B52-E811-B5CB-0025905A6138.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/68499F7E-6C52-E811-AD28-0CC47A7C345C.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6AC84C0B-7052-E811-BB59-0CC47A4D7646.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6C8A8B04-7E52-E811-96B4-0025905B860C.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6CAD7ADD-6A52-E811-A603-0CC47A4D769A.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7021CDB3-6A52-E811-810B-0CC47A7C35F4.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7C099B5E-6C52-E811-8AB6-0CC47A4D7694.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7C9372DB-6A52-E811-B580-0CC47A4D769A.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7CA97C87-6C52-E811-9009-0CC47A4D75F6.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7CBE8DE0-6A52-E811-A2C2-0CC47A4C8EB6.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8242BDFE-6A52-E811-9AB0-0CC47A7C34EE.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8E0A49B3-6F52-E811-B4C1-0CC47A4D760C.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8E13A6D9-6A52-E811-8451-0CC47A4C8E38.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/92141E99-6A52-E811-A08B-0CC47A7C34E6.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/92C44BDE-6A52-E811-BE4A-0CC47A4C8E20.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/9444C0AE-6C52-E811-B599-0CC47A4D7602.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/94A74875-6A52-E811-BE0E-0CC47A4D7650.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/94E0F325-6C52-E811-B08F-0CC47A4D7640.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/984E9F3A-6C52-E811-8729-0CC47A4D7628.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/9A0F1EC8-6A52-E811-91A7-0CC47A7C340E.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A0D3787B-6A52-E811-8B0A-0CC47A4C8EBA.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A27617FB-6A52-E811-AD58-0CC47A7C3424.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A4DFBFAE-6C52-E811-9929-0CC47A4D75F2.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A6F4F6F8-6A52-E811-B2F1-0CC47A4C8F06.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/B460B226-6C52-E811-805A-0CC47A7C35C8.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/B8B8F1BE-6F52-E811-813E-0CC47A4C8E26.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/B8F569C8-6A52-E811-B790-0CC47A4D7628.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/BCE848E3-6A52-E811-9C59-0025905A60AA.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/C068039B-6A52-E811-8563-0CC47A4C8F0C.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/C0780312-6B52-E811-BCF7-0CC47A4D7604.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/C0FDE1C2-6A52-E811-ACF0-0CC47A7C3432.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/C81F207E-6A52-E811-8DA5-0CC47A4D7630.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/CC052205-6B52-E811-90F1-0CC47A4D7668.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D065A0B9-6F52-E811-ACF9-0CC47A4C8EE2.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D0886A4D-6C52-E811-A397-0CC47A4C8EB6.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D0BA6589-6C52-E811-B130-0CC47A4D76B6.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D25280C7-6A52-E811-B16E-0CC47A4D75F8.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D46EA5E8-6A52-E811-B36E-0CC47A78A33E.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D6105C7D-6C52-E811-8DEA-0CC47A7C35D8.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D645D7FF-6B52-E811-98B3-0CC47A4C8F30.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E00A760B-7052-E811-B11E-0CC47A4C8E46.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E0E3118D-6A52-E811-9847-0CC47A4D7634.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E24C0971-6A52-E811-9E8B-0CC47A7C35A4.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E282984F-6C52-E811-96CB-0025905B8580.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E2EC3257-6A52-E811-B910-0CC47A4D76B2.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E4B89184-6A52-E811-9B3B-0CC47A4C8F18.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E4D61F97-6A52-E811-8581-0CC47A4C8E1E.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E4DB1C36-6A52-E811-8A0E-0CC47A4C8E2E.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E6799F62-6B52-E811-B4E0-0025905A60FE.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/EA3AEA3E-6B52-E811-8227-0CC47A4D7650.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/EC5E949F-6C52-E811-9DED-003048FFD722.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F0CDC3A9-6F52-E811-9EFB-0CC47A4C8F18.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F2B553A8-6F52-E811-9398-0CC47A4C8E1E.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F4066326-6C52-E811-8B66-0CC47A4D767C.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F406A615-6C52-E811-BBF6-0025905B85EC.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F6BD280D-6B52-E811-BA3D-0CC47A7C354A.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F8B31C68-6A52-E811-ADFB-0CC47A7C3628.root +/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/FC250EBA-6A52-E811-89E5-0CC47A7C35B2.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleMuPt1p5to8/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleMuPt1p5to8/PU0.txt new file mode 100644 index 0000000000000..467b74f455c46 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleMuPt1p5to8/PU0.txt @@ -0,0 +1,50 @@ +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/FEBA9927-7152-E811-9B7A-0025905B8568.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/FE373C8B-7052-E811-93A7-0025905A48F2.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F696B871-7052-E811-BE34-0CC47A7C34B0.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F4FE6E22-7152-E811-8AC9-0025905B85EC.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E83A3F08-7252-E811-A594-0025905B8604.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E661D430-7152-E811-8BF8-0025905A60D2.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E649CC04-7252-E811-880A-0025905A6092.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E4DBB901-7052-E811-9610-0025905B859E.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E21B050F-7552-E811-BBBB-0025905A6080.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D4C0040F-7552-E811-88FF-0025905A6080.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D0BA8CFF-7452-E811-B466-0CC47A78A4B0.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/CEC8390F-7552-E811-8838-0025905A6080.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/CABCCD1C-7552-E811-9CE2-0025905A60BE.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/CA0A8985-7652-E811-B79C-0025905B8586.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/BEE7EEFF-7452-E811-B3E5-0CC47A78A4B0.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/BCD6FC86-7052-E811-A91C-0025905AA9CC.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A4B7BD89-7052-E811-B6A4-0025905A48D0.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A4ADF40A-7252-E811-8EA2-0025905A60CA.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/9605527E-7052-E811-94AC-0CC47A7C357E.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/94DE3C99-7552-E811-849F-0025905A60B8.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/909F2D96-7052-E811-AADD-0025905A6056.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8EB0C6EE-6F52-E811-AC25-0CC47A78A3EC.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8A0B7371-7652-E811-BD76-0CC47A745294.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8859F41C-7152-E811-BF0A-0025905A6068.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8856F320-7152-E811-BCB5-0025905A608C.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/884710FB-6F52-E811-8DEC-0025905B85B6.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/84FA4F07-7052-E811-9072-0025905A60F2.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7C21FC50-7452-E811-A432-0025905A48EC.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7A9A278F-7052-E811-B292-0025905B85CA.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/745AB60A-7052-E811-B55E-0025905B859A.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/744B5304-7052-E811-B9DF-0025905A6056.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/72777912-7152-E811-86C4-0CC47A4D769C.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/70BD8FFF-7452-E811-876A-0CC47A78A4B0.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/708FDF17-7252-E811-AEE6-0025905A60D6.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6E4ABB38-7152-E811-A9F9-0025905A6122.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/66E0EFD6-8352-E811-B3EA-0CC47A7C3610.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/4E5AC476-7652-E811-B7DA-0025905B85D0.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/4A0A040F-7552-E811-95BE-0025905A6080.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/426FD099-7552-E811-8EC3-0025905A60A8.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/3C5C3A99-7552-E811-B355-0025905A60B8.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/3A1FD122-7152-E811-918C-0025905B856C.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/243C6212-7152-E811-9121-0CC47A7C3572.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1AAD96FF-7452-E811-B349-0CC47A78A4B0.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1A57289B-7052-E811-9CCE-0025905A60D2.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/16B41C8A-7052-E811-B46A-0025905A60BC.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/14A80923-7152-E811-BA26-0025905B856C.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1214D970-7652-E811-BBB7-0CC47A745294.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/10D5FB2F-7152-E811-9E76-0025905A60DA.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/0CCD938B-7052-E811-A5E6-0025905AA9F0.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/0C1BAE0E-7152-E811-936E-0CC47A7C3422.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleMuPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleMuPt2to100/PU0.txt new file mode 100644 index 0000000000000..a61f0d4d491db --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleMuPt2to100/PU0.txt @@ -0,0 +1,52 @@ +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F6D3B679-6E52-E811-8C70-0CC47A7C340C.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F68DDB96-6D52-E811-8513-0025905A612E.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F68123B9-6452-E811-B081-002618FDA287.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F4F37A93-6D52-E811-9F50-0025905B85CC.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E63A6F9D-7252-E811-82F7-0025905B85C6.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E2FB8A8C-6E52-E811-ACBD-0025905A610C.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E0BE5BA6-7252-E811-BB28-0025905B85D6.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/DEA4E795-6D52-E811-9638-0025905A6104.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/DC2B7506-6D52-E811-98DD-0CC47A4D765E.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/DC12E17A-6E52-E811-9674-0CC47A7C34B0.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D4810B8B-6D52-E811-9A66-0CC47A4D7658.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D471BD89-6D52-E811-A145-003048FFD7AA.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D26DB583-6D52-E811-867C-0CC47A7C35E0.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/CAED0EF4-6C52-E811-B25A-0CC47A78A2F6.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/CABC829C-7252-E811-B76D-0025905B8564.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/BEC05905-7252-E811-9AA6-0CC47A4C8EE8.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/BEBE5AFF-6452-E811-AF4F-002618FDA26D.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/BE1FC391-7252-E811-B4FE-0CC47A7C349C.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/BADEC899-7252-E811-B420-003048FFD772.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/BA2C647E-6D52-E811-9C26-0CC47A78A33E.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/BA125E99-7252-E811-ADD9-0CC47A7C3612.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/B4FF1280-6D52-E811-9260-0CC47A7C356A.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/AE8245A3-6D52-E811-A826-0025905A60BE.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A45128E8-7152-E811-8888-0CC47A7C34B0.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A2FB1DA4-6D52-E811-A4C5-0025905B859A.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8ED1A8B0-6452-E811-812E-003048FFCBB2.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/86D757B9-7252-E811-A5CF-0025905A6060.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7AEED198-6D52-E811-999B-0025905B85AE.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7815B08F-6E52-E811-B7A8-0025905A60CA.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/725DE17C-6D52-E811-92BF-0CC47A4D7626.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6EB0E596-6E52-E811-86B4-0025905A60D6.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6E80DEA1-6D52-E811-B5D9-0025905A609A.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6CBB91F7-6C52-E811-8B5B-0CC47A7C34B0.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6A63A97F-6D52-E811-BA93-0CC47A4D7618.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/5435E6EB-7152-E811-A496-0CC47A4D76D6.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/4C5AA39A-7552-E811-8719-0025905A60A8.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/46733D82-6D52-E811-8FD9-0CC47A4C8E26.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/3EBF2AFC-7152-E811-B41B-0CC47A7C3450.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/3A6209A1-7252-E811-8FFC-0025905B8604.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/386C3B94-6D52-E811-AA4C-0025905B85E8.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/381C859A-6D52-E811-A826-0025905A605E.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/36D3ECA5-7252-E811-A4CD-0025905A48C0.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/36B6B9FE-6452-E811-A5FB-003048FFD75A.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/2ADE08A9-7252-E811-957D-0025905B860E.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/28C4258A-6D52-E811-9E89-0025905B860E.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1A4AD28D-6D52-E811-9EC4-0CC47A4D76D6.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/12BDE8A2-7252-E811-A2BA-0025905A60BC.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/129F0580-6E52-E811-9243-0CC47A4D7678.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/0884E09C-6E52-E811-859E-0025905A48E4.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/080BCD98-7252-E811-BA0D-0CC47A4D7678.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/062E8EA2-6D52-E811-B8CD-0025905B85BC.root +/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/046366A6-7252-E811-A27A-0025905B855C.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU0.txt new file mode 100644 index 0000000000000..41d9cd7edb5f1 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU0.txt @@ -0,0 +1,10 @@ +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/0E1785F0-762C-E811-9192-0CC47A78A4BA.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/7EB68679-782C-E811-A2C9-0CC47A4D7690.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/7EC7DD7F-782C-E811-B469-0CC47A4D76A0.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/886F551E-7E2C-E811-9D10-0025905A608C.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/A05308F4-762C-E811-ACC0-0CC47A78A360.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/AC64F3F2-8D2C-E811-AEA8-0025905A611E.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/B0D7BD76-782C-E811-AED2-0CC47A7C35F4.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/CE1930F1-762C-E811-B9F4-0CC47A78A468.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/D86D2DA6-752C-E811-8E90-0025905B856C.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/EEFED097-752C-E811-B621-0CC47A4C8E22.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU140.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU140.txt new file mode 100644 index 0000000000000..df8fdfdf6accd --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU140.txt @@ -0,0 +1,90 @@ +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/00E0EA0C-0552-E811-B526-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/00E74E32-0652-E811-B314-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/02B4E45C-FE51-E811-A1D5-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/047CAE45-FF51-E811-A30C-0242AC130006.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/0A5AB1BB-0152-E811-A750-0242AC130003.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/0A6E39D1-2752-E811-94BE-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/1619B013-FE51-E811-8F5E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/18FED4E8-FE51-E811-802F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/1A2F1DC1-0552-E811-97A1-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/1A340846-FF51-E811-8817-0242AC130006.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/1ABE32AC-0252-E811-9523-0242AC130005.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/1C18F569-FE51-E811-B6BD-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/1C5E0946-FF51-E811-9F6F-0242AC130006.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/22D73BF7-0552-E811-AAA6-0242AC130003.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/243E0846-FF51-E811-A742-0242AC130006.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/262C5578-FE51-E811-993D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/26E2EFE9-FF51-E811-91BD-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/28107BA5-0652-E811-A11C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/2AA3B4E2-2752-E811-B83E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/2CC5536B-0452-E811-ACCE-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/2E030364-FE51-E811-A450-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/2ED3E2E9-0452-E811-8DC9-0242AC130005.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/2ED5AA00-0652-E811-A84C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/2EECFFA7-0652-E811-B712-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/340B6BFA-0552-E811-9228-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/36EE0946-FF51-E811-97B1-0242AC130006.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/3A733CF7-0552-E811-B617-0242AC130003.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/441A0C46-FF51-E811-9D36-0242AC130006.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/44987660-0652-E811-9200-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/44E7DE67-0152-E811-8E7A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/4C073CF7-0552-E811-8E6E-0242AC130003.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/524D142C-FD51-E811-BD24-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/5290A49D-FE51-E811-B833-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/54792320-FE51-E811-949D-0242AC130003.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/5E51B145-FF51-E811-8654-0242AC130006.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/626AB89E-0452-E811-8289-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/706B34DB-0052-E811-A9C6-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/7A2821E3-FE51-E811-91E3-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/7C6841F7-0552-E811-9EC1-0242AC130003.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/7E2FE277-FD51-E811-9A3B-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/82790A46-FF51-E811-97D4-0242AC130006.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/844527E3-FE51-E811-9DBA-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/84AB41F7-0552-E811-AECE-0242AC130003.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/84C0D9E8-0252-E811-9F82-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/84EAF8EF-0252-E811-8612-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/8818BC70-0052-E811-9B0F-0242AC130003.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/887BA339-0652-E811-8620-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/8AA90946-FF51-E811-9152-0242AC130006.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/8AF82AEB-0252-E811-86B9-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/8E670AA4-0152-E811-9A9D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/9091F3AB-0252-E811-903D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/90D18C2D-FD51-E811-9E88-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/94A38A1C-FE51-E811-A63D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/94AFFA2D-FD51-E811-9921-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/94F26173-FE51-E811-AEAC-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/96652A62-FF51-E811-B7A7-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/96D9FCD4-2752-E811-96F1-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/98FD29A2-0252-E811-9DD0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/9E7C4D32-0652-E811-96AE-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/A2ACD82B-FD51-E811-A143-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/AA50DBAA-0652-E811-989C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/AA7BD997-FF51-E811-8EA8-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/AC510846-FF51-E811-804B-0242AC130006.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/ACFA7F2B-FE51-E811-84AB-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/B207F7E0-2752-E811-916D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/B69E641D-0152-E811-BCEA-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/B8E3589E-FE51-E811-99B9-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/C066CF3A-0652-E811-9008-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/C418B7C9-0652-E811-8633-0242AC130003.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/C8C78232-0652-E811-811F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/CC31A4F3-0552-E811-9AF1-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/CE66C2DA-0052-E811-A572-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/D094D66B-FE51-E811-B9D5-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/DA54C127-0152-E811-AE2E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/DADB0268-0252-E811-A9C4-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/DC0EE9F0-0352-E811-810E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/DC2DA9C6-FE51-E811-84CC-0242AC130003.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/E24D42EA-0252-E811-A7B6-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/E4169768-0552-E811-82CB-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/E8343CB8-0252-E811-B78C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/EA77863D-FD51-E811-824C-0242AC130003.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/EED8FE18-FE51-E811-8744-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/F07D0892-0152-E811-A455-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/F275265B-FD51-E811-AE7F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/F4360846-FF51-E811-86A6-0242AC130006.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/F64B8101-0452-E811-B224-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/F8283CF7-0552-E811-8ECD-0242AC130003.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/F83125B8-0252-E811-96B2-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/F8C93BF7-0552-E811-B7B1-0242AC130003.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/FCA0DF5E-0652-E811-A0D4-0242AC130003.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU200.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU200.txt new file mode 100644 index 0000000000000..334266836482a --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU200.txt @@ -0,0 +1,90 @@ +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0A52EE7F-1E2D-E811-86EB-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0A89BB2B-2D2D-E811-8C80-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0C08D3DD-1E2D-E811-8669-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0C12617F-212D-E811-8695-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0E91FECC-1E2D-E811-BF1C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0EA17A2E-3B2D-E811-89B8-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1055768C-212D-E811-9EC0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/143BBE19-212D-E811-A48D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/14956BF1-1E2D-E811-A63F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/16458099-1E2D-E811-897C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/164D2029-2D2D-E811-A3EB-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/18AAA884-212D-E811-AAFA-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1CAB0C7B-212D-E811-84B9-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1ED10C85-212D-E811-B2FD-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/20598276-212D-E811-AF79-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/20A2B881-1E2D-E811-934E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2217D914-212D-E811-A4C7-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/22460785-212D-E811-9351-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/22AD2684-1E2D-E811-BE8F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/240F7C77-212D-E811-B318-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2691B4FC-202D-E811-82D9-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2A8005FF-202D-E811-8B27-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2AC9B97E-212D-E811-A693-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2E186E77-212D-E811-9C2D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/30536F7F-212D-E811-B7E1-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3629CC78-212D-E811-84A7-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4AC37B84-212D-E811-8953-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4C30D282-212D-E811-9526-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4E1B1F7B-212D-E811-989A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/52ADC48A-212D-E811-BA57-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/52B6387F-1E2D-E811-91BD-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/546B727F-1E2D-E811-9D5D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/56BC6747-3B2D-E811-BA80-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5A8CFF7F-1E2D-E811-A7B0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5AE4727F-212D-E811-A96D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/621ED1D8-312D-E811-82F6-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/62419A8C-1E2D-E811-BE46-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6410FC29-212D-E811-9CD0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6C9C2E7F-1E2D-E811-A8A9-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/723FD030-3B2D-E811-8459-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7601CB82-1E2D-E811-8B9C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/76D59D38-212D-E811-A3A5-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/782AE72D-3B2D-E811-AE9A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7A7C8276-212D-E811-AD5F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7AC76980-212D-E811-BE96-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7C93C87B-212D-E811-9BE4-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7E9B1E85-212D-E811-B4F1-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/80402401-212D-E811-B274-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8048B779-212D-E811-860F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8083A080-1E2D-E811-8591-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/843BCB78-212D-E811-83A9-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/84A6C1F2-312D-E811-BF38-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/861EEE11-212D-E811-A51E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/865C4C11-212D-E811-BE0E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8699AF75-212D-E811-9BA0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8A9F019A-1E2D-E811-8323-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8CE6F291-1E2D-E811-A3B6-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8E9E89CC-332D-E811-802E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/90AD2B7F-1E2D-E811-A227-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/9424CEA7-1E2D-E811-8CC4-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/96C39087-212D-E811-900A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/98AA5384-1E2D-E811-905F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/9CD02E8B-212D-E811-BD53-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/9E334E14-2D2D-E811-A15F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/9E95E182-1E2D-E811-999B-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/A6B42037-3B2D-E811-B12D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/AAADA982-1E2D-E811-9626-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/ACCD9684-212D-E811-A1C3-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/B0AACD8D-1E2D-E811-823E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/B6DE2D8A-1E2D-E811-81FF-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/B8E3B57F-212D-E811-B3A4-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/BA504282-1E2D-E811-8D49-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/BCA0562D-212D-E811-83DE-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/C2F99780-1E2D-E811-B893-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/C4EB77A2-1E2D-E811-9483-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/C61D1B8A-1E2D-E811-ABC7-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/C8640B92-1E2D-E811-9346-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/C8BA571F-212D-E811-B843-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/D2630080-1E2D-E811-AABA-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/DA82FEDC-1E2D-E811-8EF0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/DE73359D-1E2D-E811-8838-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/E048E112-212D-E811-BC7C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/E0E3B67E-212D-E811-896C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/E4FA8779-212D-E811-8D7A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/E8CA3EEA-2A2D-E811-9A8C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/EA1EEF10-212D-E811-96F6-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/EA79DD97-1E2D-E811-92CC-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/EC5C713F-212D-E811-9874-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/F0EA6A84-1E2D-E811-B0D1-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/FCC765BD-332D-E811-A1F2-0242AC130002.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU250.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU250.txt new file mode 100644 index 0000000000000..46a050a063567 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU250.txt @@ -0,0 +1,90 @@ +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/002B1F49-CB52-E811-81A3-24BE05C63741.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/02E85497-C952-E811-B6C7-EC0D9A822636.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/0628C23A-CA52-E811-BD61-00000086FE80.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/08813486-CA52-E811-A93A-E0071B6C9DE0.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/08FCDDD8-CB52-E811-9FBC-E0071B691B81.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/10ED0B4F-CA52-E811-8209-24BE05CE3EA1.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/1488B538-CA52-E811-AB11-EC0D9A8222DE.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/1AFBC13A-CA52-E811-96BB-00000086FE80.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/1CFCDDD8-CB52-E811-B3C5-E0071B691B81.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/1EBD109F-C952-E811-AB57-24BE05C63681.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/22D1EB97-C952-E811-8420-24BE05CE1E01.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/2400F95D-CA52-E811-A562-4C79BA320D0D.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/242457DC-C952-E811-A9B3-24BE05C6E7E1.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/26689D9B-C952-E811-B7EB-9CDC714A4A10.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/2A8CEC97-C952-E811-80C9-24BE05CE1E01.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/2AF0F85D-CA52-E811-A066-4C79BA320D0D.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/2EEFB047-CB52-E811-A04E-24BE05C63651.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/32A97B4B-CB52-E811-93EB-24BE05C4D851.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/32BF390E-CB52-E811-84C3-E0071B73C610.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/384A5139-CA52-E811-A44E-24BE05CEEDE1.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/3A16D69B-C952-E811-B82A-5065F381B211.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/3C19563E-CA52-E811-9C0D-EC0D9A82264E.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/400F64D7-C952-E811-A645-5065F3815221.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/4034B538-CA52-E811-9909-EC0D9A8222DE.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/4057C23A-CA52-E811-AD8B-00000086FE80.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/4C743486-CA52-E811-9AC4-E0071B6C9DE0.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/5027BADC-D752-E811-91C7-EC0D9A8221D6.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/52AF3D0E-CB52-E811-B394-E0071B73C610.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/54A52E3A-CA52-E811-AE1E-E0071B7A8560.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/566BCA9A-C952-E811-841A-00000086FE80.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/5815DED8-CB52-E811-88B5-E0071B691B81.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/5AFADDD8-CB52-E811-9334-E0071B691B81.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/5CAA0C4F-CA52-E811-9FD1-24BE05CE3EA1.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/5E9B64D7-C952-E811-9F0A-5065F3815221.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/5EA8F85D-CA52-E811-851C-4C79BA320D0D.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/60010C4F-CA52-E811-B5D5-24BE05CE3EA1.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/662357DC-C952-E811-8CA6-24BE05C6E7E1.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/6636B538-CA52-E811-AE84-EC0D9A8222DE.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/6A64CD51-CB52-E811-AA26-24BE05CECBD1.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/6A9C414B-CB52-E811-894F-24BE05CE4D91.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/6E9D4A39-CA52-E811-B60C-24BE05CEEDE1.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/72BE109F-C952-E811-B7F9-24BE05C63681.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/7457CA9A-C952-E811-8C67-00000086FE80.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/74594EE6-CA52-E811-B240-EC0D9A822636.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/7460D6D9-CA52-E811-AEF3-4C79BA181349.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/760BA23E-CA52-E811-945F-E0071B73B6B0.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/7A49CB82-CA52-E811-80B7-EC0D9A8221EE.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/7CA7C900-CB52-E811-B60E-5065F381C251.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/7E193586-CA52-E811-8F57-E0071B6C9DE0.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/7E37B538-CA52-E811-AF0A-EC0D9A8222DE.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/8216EB4B-CB52-E811-AAAC-24BE05C33C81.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/8233C23A-CA52-E811-B68C-00000086FE80.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/84B1B8BD-CB52-E811-B94D-5065F3819241.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/8A142A3A-CA52-E811-B0B7-E0071B7A8560.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/8AE7DA9D-C952-E811-8892-5065F3813282.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/8E05CB9A-C952-E811-8B15-00000086FE80.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/8EC4054F-CB52-E811-9356-24BE05C3FBB1.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/92737C3C-E152-E811-A54C-E0071B73C640.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/9E3D0488-C952-E811-B670-E0071B74EC20.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/A05CD6D9-CA52-E811-8F96-4C79BA181349.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/A416703C-CA52-E811-B371-EC0D9A8221EE.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/ACFBC264-CB52-E811-AA77-4C79BA181215.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/B2097CD4-CA52-E811-B983-24BE05C63651.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/B2E1CA9A-C952-E811-838A-00000086FE80.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/B40BC23A-CA52-E811-BB93-00000086FE80.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/B80CC23A-CA52-E811-AAED-00000086FE80.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/B8A09DBF-CB52-E811-A52E-EC0D9A8221EE.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/BA7E3486-CA52-E811-A28B-E0071B6C9DE0.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/BCEBC264-CB52-E811-AFC2-4C79BA181215.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/C0E70B4F-CA52-E811-B5FC-24BE05CE3EA1.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/C2B1C900-CB52-E811-A6E6-5065F381C251.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/C487C900-CB52-E811-A386-5065F381C251.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/C495A13E-CA52-E811-A4C9-E0071B73B6B0.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/C655CA9A-C952-E811-9033-00000086FE80.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/C880CA9A-C952-E811-8A41-00000086FE80.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/CA9AC900-CB52-E811-95A8-5065F381C251.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/CAA0F85D-CA52-E811-AACF-4C79BA320D0D.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/D04FC364-CB52-E811-8BAD-4C79BA181215.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/D431B538-CA52-E811-A2ED-EC0D9A8222DE.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/D6951997-C952-E811-97AA-EC0D9A822616.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/D8C2BEC5-CB52-E811-BF08-E0071B74AC00.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/D8E4B8BD-CB52-E811-BDA1-5065F3819241.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/D8F54DE6-CA52-E811-A1E4-EC0D9A822636.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/DC33B538-CA52-E811-89A8-EC0D9A8222DE.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/DC42403A-CA52-E811-B7F5-E0071B7A8560.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/DCB0273A-CA52-E811-9B2E-E0071B7A8560.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/E215E4DA-CA52-E811-8799-24BE05C676F2.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/E6619B89-C952-E811-B43D-E0071B74EC20.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/F4686ED2-CA52-E811-9B9F-EC0D9A82264E.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/FC1664D7-C952-E811-885C-5065F3815221.root \ No newline at end of file diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU300.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU300.txt new file mode 100644 index 0000000000000..722faf9669da1 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU300.txt @@ -0,0 +1,90 @@ +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/0056D47E-7457-E811-832B-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/007F97CE-7457-E811-819C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/00DB1768-7757-E811-ACFE-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/022BC179-7457-E811-A9AD-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/04833C5D-7A57-E811-B168-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/0831FF7A-7957-E811-B2F3-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/0A3508D0-7457-E811-9F49-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/0ECDDBB5-7957-E811-ADDA-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/100D6F5D-7A57-E811-B457-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/10CE7FD2-7457-E811-B174-0242AC130003.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/125C7787-7457-E811-94B5-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/12CB823A-7957-E811-9EFA-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/1496ECFF-7757-E811-B006-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/16D26E6F-7A57-E811-BB70-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/1A060465-7657-E811-83D2-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/1AFFD973-7A57-E811-AFE8-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/2609E310-7857-E811-B439-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/2800B03D-7657-E811-8094-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/288F7022-7457-E811-8B0B-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/28AE0875-7457-E811-B06E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/2C0607B6-7957-E811-A6C4-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/2CFA94BB-7457-E811-A70B-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/3646156C-7A57-E811-98F8-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/3882003F-7957-E811-B034-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/42DF101F-7757-E811-8CF0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/443D9F5D-7757-E811-A97A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/46102A74-7457-E811-B7B1-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/46A8AE65-7A57-E811-863F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/48037822-7457-E811-868F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/4ADAF7FF-7457-E811-99FB-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/4C10564D-7857-E811-A75A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/4CA394BB-7457-E811-A772-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/500F88D0-7457-E811-85CC-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/525196CE-7457-E811-800C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/567E2270-7A57-E811-9746-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/56C9904A-7857-E811-BBF3-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/589BFAF0-7557-E811-A6FC-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/5A88F0FF-7757-E811-8ED5-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/5E5792BB-7457-E811-B4EB-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/6010F1AD-7757-E811-AFB8-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/60897A22-7457-E811-B463-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/60C06F4C-7857-E811-99A7-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/66297F6C-7A57-E811-B204-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/6A0F7722-7457-E811-ACD7-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/6E716C3A-7957-E811-B30C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/72A3AC72-7A57-E811-8EA9-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/7423256E-7A57-E811-B75D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/76C6EB3E-7557-E811-B6B3-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/7C6B4E05-7957-E811-80D5-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/80B1BD0B-7857-E811-A0F0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/845DF078-7857-E811-B894-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/860292BB-7457-E811-A5DD-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/88848E7C-7457-E811-B6FA-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/8A84BB65-7A57-E811-9A82-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/8E5ED167-7A57-E811-A66D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/90AC2042-7457-E811-A06A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/9254AC65-7A57-E811-B712-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/963392BB-7457-E811-A843-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/96D5EEFF-7757-E811-9D65-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/982C3CA7-7557-E811-A637-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/989CEF34-7457-E811-B921-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/A01A92BB-7457-E811-A0E0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/A225F414-7557-E811-BDA6-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/A40BC8B9-7857-E811-8D2E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/A40C0C12-7757-E811-A9D3-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/A4D2D783-7857-E811-808E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/A60266B8-7957-E811-9CE6-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/A60FB246-7957-E811-8ED3-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/AA1DFAE6-7957-E811-BD2D-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/AE57405D-7A57-E811-B42E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/B04C9641-7657-E811-985E-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/B2111976-7A57-E811-9BB2-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/B42AABB5-7457-E811-ADB3-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/B611A76B-7A57-E811-A0D2-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/B68F36A8-7657-E811-BE13-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/CA283C3F-7857-E811-B8CD-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/D0660E32-7957-E811-BCE3-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/D0BDEFFF-7757-E811-B29F-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/D667D9B4-7957-E811-A575-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/DE5BA34E-7457-E811-BFB2-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/E2A0AF3D-7657-E811-81D0-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/EA42F071-7A57-E811-A969-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/EA8C4C67-7A57-E811-8DDF-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/F0AA26C5-7857-E811-883A-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/F214DACF-7657-E811-815C-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/F254D969-7A57-E811-B8FE-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/F6069FAD-7957-E811-98F5-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/F80392BB-7457-E811-AFCE-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/F8FE9F4E-7457-E811-BEE7-0242AC130002.root +/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/FADEB8FF-7757-E811-8C4D-0242AC130002.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/localRAL/PU200.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/localRAL/PU200.txt new file mode 100644 index 0000000000000..2c22a08a8ec09 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/localRAL/PU200.txt @@ -0,0 +1,44 @@ +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/0A52EE7F-1E2D-E811-86EB-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/0A89BB2B-2D2D-E811-8C80-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/0C08D3DD-1E2D-E811-8669-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/0C12617F-212D-E811-8695-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/0E91FECC-1E2D-E811-BF1C-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/0EA17A2E-3B2D-E811-89B8-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/1055768C-212D-E811-9EC0-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/143BBE19-212D-E811-A48D-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/14956BF1-1E2D-E811-A63F-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/16458099-1E2D-E811-897C-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/164D2029-2D2D-E811-A3EB-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/18AAA884-212D-E811-AAFA-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/1CAB0C7B-212D-E811-84B9-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/1ED10C85-212D-E811-B2FD-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/20598276-212D-E811-AF79-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/20A2B881-1E2D-E811-934E-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/2217D914-212D-E811-A4C7-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/22460785-212D-E811-9351-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/22AD2684-1E2D-E811-BE8F-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/240F7C77-212D-E811-B318-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/2691B4FC-202D-E811-82D9-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/2A8005FF-202D-E811-8B27-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/2AC9B97E-212D-E811-A693-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/2E186E77-212D-E811-9C2D-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/30536F7F-212D-E811-B7E1-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/3629CC78-212D-E811-84A7-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/4AC37B84-212D-E811-8953-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/4C30D282-212D-E811-9526-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/4E1B1F7B-212D-E811-989A-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/52ADC48A-212D-E811-BA57-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/52B6387F-1E2D-E811-91BD-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/546B727F-1E2D-E811-9D5D-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/56BC6747-3B2D-E811-BA80-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/5A8CFF7F-1E2D-E811-A7B0-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/5AE4727F-212D-E811-A96D-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/621ED1D8-312D-E811-82F6-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/62419A8C-1E2D-E811-BE46-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/6410FC29-212D-E811-9CD0-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/6C9C2E7F-1E2D-E811-A8A9-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/723FD030-3B2D-E811-8459-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/7601CB82-1E2D-E811-8B9C-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/76D59D38-212D-E811-A3A5-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/782AE72D-3B2D-E811-AE9A-0242AC130002.root +file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/7A7C8276-212D-E811-AD5F-0242AC130002.root diff --git a/L1Trigger/TrackFindingTMTT/test/PlotEtaSectors.C b/L1Trigger/TrackFindingTMTT/test/PlotEtaSectors.C new file mode 100644 index 0000000000000..039b9a1257ef3 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/PlotEtaSectors.C @@ -0,0 +1,183 @@ +{ + //=== Draw rapidity sector boundaries on picture of tracker in r-z view. + + // WARNING: this script only works on machines where the line: + // OpenGL.CanvasPreferGL: 1 + // appears in $ROOTSYS/etc/system.rootrc (not at RAL). + // Required for semi-transparent plotting. + + // In unnamed scripts, variables not forgotten at end, so must delete them before rerunning script, so ... + gROOT->Reset(); + + // Adjust these to line up histogram hisTracker with underlying image of CMS Tracker. + // Then when aligned, comment out line trackerBorder.Draw() below. + const float leftMargin = 23; + const float rightMargin = 33; + const float topMargin = 13; + const float bottomMargin = 14; + + gStyle->SetOptTitle(0); + gStyle->SetOptStat(""); + gStyle->SetPadGridX(false); + gStyle->SetPadGridY(false); + + const float trkInRad = 20; + const float trkOutRad = 110; + const float trkLength = 270; + const float beamLen = 15; + + const unsigned int nSec = 9; + const float chosenR = 50; + const unsigned int nSecEdges = nSec + 1; + // Standard eta sectors + const float eta[nSecEdges] = {0,0.31,0.61,0.89,1.16,1.43,1.7,1.95,2.16,2.4}; + // Sectors optimised by Ben Gayther to balance GP output data rate (at expense of increased HT tracks). + //const float eta[nSecEdges] = {0.0, 0.19, 0.38, 0.57, 0.77, 1.01, 1.31, 1.66, 2.03, 2.40}; + const unsigned int nSubSec = 2; + const unsigned int nSubSecEdges = nSubSec + 1; + + // Optionally draw a stub with the given digitized (r,z) coordinates. + const bool drawStub = true; + const int iDigi_RT = 492; + const int iDigi_Z = -1403; + + TCanvas d1("d1","d1",1000,800); + + // Open picture of CMS tracker + // http://ghugo.web.cern.ch/ghugo/layouts/cabling/OT614_200_IT404_layer2_10G/layout.html + // Adjust the range of trackerBorder below to correspond to the coordinate range shown in this picture. + TImage *img = TImage::Open("TrackerLayout.png"); + img->Draw("x"); + d1.Update(); + + //Create a transparent pad filling the full canvas + TPad p("p","p",0,0,1,1); + p.Range(-beamLen-leftMargin, -1-bottomMargin, trkLength+30+rightMargin, trkOutRad+15+topMargin); + p.SetFillStyle(4000); + p.SetFrameFillStyle(4000); + p.Draw(); + p.cd(); + + TPolyLine trackerBorder; + + trackerBorder.SetNextPoint(0.,0.); + trackerBorder.SetNextPoint(295.,0.); + trackerBorder.SetNextPoint(295.,123.); + trackerBorder.SetNextPoint(0.,123.); + trackerBorder.SetNextPoint(0.,0.); + //trackerBorder.Draw(); + + /* + TPolyLine subsecBoundary[nSec][nSubSecEdges]; + + // Draw sub-sector boundaries. + for (unsigned int i = 0; i < nSec; i++) { + float subsecWidth = (eta[i+1] - eta[i])/float(nSubSec); + for (unsigned int j = 0; j < nSubSecEdges; j++) { + float subsecEtaEdge = eta[i] + subsecWidth * j; + // z at r = chosenR; + float z = chosenR/tan(2 * atan(exp(-subsecEtaEdge))); + // Calculate (r,z) at periphery of Tracker from two ends of beam spot. + // Start by assuming exit through barrel. + float rPeriphNeg = trkOutRad; + float rPeriphPos = trkOutRad; + float zPeriphNeg = -beamLen + (z + beamLen)*(rPeriphNeg/chosenR); + float zPeriphPos = beamLen + (z - beamLen)*(rPeriphNeg/chosenR); + // Now check if actual exit through endcap. + if (fabs(zPeriphNeg) > trkLength) { + int whichEndcap = (zPeriphNeg + beamLen > 0) ? 1 : -1; + zPeriphNeg = whichEndcap*trkLength; + rPeriphNeg = chosenR*(zPeriphNeg + beamLen)/(z + beamLen); + } + if (fabs(zPeriphPos) > trkLength) { + int whichEndcap = (zPeriphPos - beamLen > 0) ? 1 : -1; + zPeriphPos = whichEndcap*trkLength; + rPeriphPos = chosenR*(zPeriphPos - beamLen)/(z - beamLen); + } + subsecBoundary[i][j].SetNextPoint(-beamLen,0); + subsecBoundary[i][j].SetNextPoint(zPeriphNeg, rPeriphNeg); + subsecBoundary[i][j].SetNextPoint(zPeriphPos, rPeriphPos); + subsecBoundary[i][j].SetNextPoint(beamLen,0); + subsecBoundary[i][j].SetNextPoint(-beamLen,0); + subsecBoundary[i][j].SetFillColor(kYellow); + unsigned int iHash = 3405+k*10; + subsecBoundary[i][j].SetFillStyle(iHash); + subsecBoundary[i][j].Draw("f"); + d1.Update(); + } + } + */ + + TPolyLine secBoundary[nSecEdges]; + + // Draw sector boundaries + for (unsigned int k = 0; k < nSecEdges; k++) { + // z at r = chosenR; + float z = chosenR/tan(2.0 * atan(exp(-eta[k]))); + // Calculate (r,z) at periphery of Tracker from two ends of beam spot. + // Start by assuming exit through barrel. + float rPeriphNeg = trkOutRad; + float rPeriphPos = trkOutRad; + float zPeriphNeg = -beamLen + (z + beamLen)*(rPeriphNeg/chosenR); + float zPeriphPos = beamLen + (z - beamLen)*(rPeriphNeg/chosenR); + // Now check if actual exit through endcap. + if (fabs(zPeriphNeg) > trkLength) { + int whichEndcap = (zPeriphNeg + beamLen > 0) ? 1 : -1; + zPeriphNeg = whichEndcap*trkLength; + rPeriphNeg = chosenR*(zPeriphNeg + beamLen)/(z + beamLen); + } + if (fabs(zPeriphPos) > trkLength) { + int whichEndcap = (zPeriphPos - beamLen > 0) ? 1 : -1; + zPeriphPos = whichEndcap*trkLength; + rPeriphPos = chosenR*(zPeriphPos - beamLen)/(z - beamLen); + } + secBoundary[k].SetNextPoint(-beamLen,0); + secBoundary[k].SetNextPoint(zPeriphNeg, rPeriphNeg); + secBoundary[k].SetNextPoint(zPeriphPos, rPeriphPos); + secBoundary[k].SetNextPoint(beamLen,0); + secBoundary[k].SetNextPoint(-beamLen,0); + secBoundary[k].SetFillColor(kGreen-2); + //cout<9Rqhd9qP_%!!3Y)Z%c{d*IJhv_Sq#xAqMFXXKvfvwh_GHSvU@%6Qg6!SLE{Tgn%28>}Wx~$}VwSXI&Q=yYvPY6< z+ncKxJ-JBmN&X{x^{u7)Sw9v8t;Xj_^1F;pb$1o#g8J7s5mjuM>YlDASBPP*@^99# zLl?H9K5EeSsNMNA=(~CfSN;t6_HMfz8YQG$SR>=o5)|0iG_iPosk3)pJ<(cnb@}FK zygr=g{(Z@cdbv zRY9!LQl6E`D{lJ%vGyBhW;vm^qq5TLs!m0S>?b5Lj`!#A*{`qmDAJ345(f_1q?1L4 ztDAZbjw+oQ2JXdYDnz}|Bp+7#Zk52&Qoq$Dq`ZsDY5~vXCfm`R?c+Py4dL*r#feqETdj@xjsan2dBTMDmB_faLv^Mf2e=S60ab;T4W|-EK5% zRvfhc@%jknL*$R)W@>F{!XCQLGo-f3Tcv~}L5tdRVu&=7MIpv$df95!_YtYf^Tp-D z{$fO=^h5YNE!D=A!mRmG)ep-Hv%@&3!9gv?zU{sXaV|HS6)Fy7aeq*s8zBvS-fw?t z^+$%_ZgLnZBE)4u)=z9!BJ@xrr!IE*_RYI+xD|TaWHUd6xKn3m^3rFG-F8>Tm89he zTYte}A!TPnfs;@C&0379<6jsZeym+2Uo%`GvUTCbpVffxL=NjJI`<28EIHxds9qeR z7$!*)8{72fwn7(K(Wn>Fi8U%p&wG{+?YH$;YNehHD!x-+qjfj8g~mpYgHzts_rx)^ zM@Tt7bL>lgRdgexAD3hd?PGM&5&D9$W?#{lvhGLoytCT*UQQ}p7l>gwwHt-T^YB2GFMxfYv7o$)pFTZMzM-)v2pWgvdo7NqlyDs zDvy%>0i7T2%Vj1{T<-6D>2<~h%e`t<^4apl;YL;2$FCITHm?R667hSq?yA^K-`LQS zy6~QnvLbi6*KlS`aBSm*XGrVon}r#7n-5_3vn~6~IB+fa&fHJlF%f$}0U~9Hhu#TBMzX+>3EW znn^Rtz2B_FHePusG+-1eR~i!e@L1IAghipXz%o7)iOe)>Em$ln*(bJEZn@R1?4T3e!XeV(a0j#en98`{SEPA@?K+)Nxf**^m4w%HCrB{ z8nfFsOk(cx5EQXoncCEzgk|=eBUl|gAW6)8w9XX9pR{h-vej6+H$u)x5_;D5zGOjC zRBtOI!{}htLYTe1|G7;(`7`uE#(ES#y$Rn)MK1IlPm+#Ul{@jDZ#5Cx^G*XX7;2QK`HA;`n`?#Blr8bIFr~q5TXh zEjg~a5Ay z*IU`Ok|H(i_0o6p#j+UfRJvMjrEHec4|q=oZbbH1BM+NiUI4O7bjK7bNXH;L;N2Fw z@e*F=cGxlo)E`WNIrG(*UB-LK{m+F*1twk`s$RMg8Swlq=-z=tdeXLUB zFSL8|uc+qU02^o5mj0&6j8LNDZAnDFa6hF%@}FM-y??JqZnhw549tPHrD9uBu%KO ze#5M9rWtGIFRvnm1oVcjDI2kTLMBJB!OHU=DQ59OR7bs1IxldbXC*!-i$kv*{hxK0 z<*r=YULNH|BB?`OZiuV)eq#?7QtlP<%zgC*iL9!#zrNT;2NfB;t%7*#5AYI~m?G}` zOtUB!lnIL^s(_2keb~AfQU#0S-Qp;85g|=E-Tu;J_%8`0Iwf~uZeDF?6sq8jN@dOa zx4KkJ{Go@=IY^{ge1s*dYK>{L&;h^cI$4UO2aPpjm#UxcGG8-3)Jt23b;3q%1J0xR zaV7qeA!{AZeXbX=#8uMlhl?lKxeLo#DMa5a1Q*HadzK=M2J7!asBZL+3VrCb>+_hY zB`2j`A%+5HoVP3r&xcoq+6saK0{(1_IpYz}v1Jj9`Pqcqy@iUvH2PXBf^>5g8GhwS zIfZx6N#HPCWgQJD4}7bshiQ zY0umJ^^U6`!wxO<3TvV`<%deK znO8ypN6sxdwH4&#F2sE@Es2~pyNKyijNQ7P(D}f7x(3-uq;1yEvfPABDs7XwnvJ}} zd?VWyR;ZeiKn8bbJx9%$t3Y85>futJa2;ftNvF(e{GjQ3;)eU6ZgUU39FP{!0KL8% z_LjHpD!EDW025MIitd>%!q!k%L-&|T6lnOWsWG%@2kR3n$hN#u1#7jTnjzKnTXHYL z`nE@mkrmo$hY&Z#q>8erN@l$<%AvDt8>-Y+k$EHV!Q)UOFh0^U+SbV}kkb>&r>3uWZ$&a8(=5hFUq!;^ zrM&@o0lPo;B;?<+v=ro6p@o!jyyk;2^-wsh>wVLDC;74v>mp>m#YuaTf!QKSA3WAF zWK%E}Z*_9ACL2D7Y0YFtH>M4_$v~s^)x5G-R|hn3XEH|-^H-e;6y}gbZTOelovk`4awdL#xUn)UvHMQVt%XEcP_j1^b>0^&;p!*w zvTIVvElj8J=8g~}<;1d_$`j?{KjkZ41ZFmfN-7A+kj?DY^WA#+=7E82V*{T63|7z7 z=;3=y!vmv?N@ycR(+=gJQQW${chT_if5RIyK+t=Ewpbj(2d}^wdDyC2q#-vZ@xWO- z+}#$sd5>*Guf64ld|SbTDA{hz=(?Pbo5fKZMOF)Cof{r2m9(K%+5dPoyh1EL7m2K; zkW(XA9u4B>{u454_?iNC@$gtHils&Bq;j|!hhXJp*az0El~(bz!H}mcC9lD{DMWp< zDtD$JT0A~EuF9ilI7Vq`Tb|&3*|b1#Ak_q9!ORFv2-b{(mOSRc-u!}`mo!@;!XPNI zTV4(9x+47`r{hlR z!Ppft;glC8yLyM0D%GsfBz}#`@C7R+*yN+{|NCtH2Xyw=Kh=2NEA)986^r#!^Yf9& z;MDh}Ch-6vlFLPAnkCKLa1J}!_zR{6|5z7`mc!v!x4GH`6rwT#URUk~Zg3u2>a>Pv zu!BlO?N1_tw+*`>&1@AfKR5gP0Y<*PjX?RmPo@z@nkVRpfU=R* z5!o+QoSr)UV~8~AcUHLaads!2!$Z*C3VhltRE*|sD*!Gb9RB{{h;r^ox$_Kw#NeSf zonOXGo#npD?)Ff|(w_H!g|dr`?Xh0jl!Qj!HNfQ#o5RauZf(=6j#mdjoF?F_K2cj^%*+zL^X$zHlPlRAcVrY>i^ zum4%ui9@gKxc3UB7zm;4BWI0I=aS8JmgkS*e?isQbsIHBoGhIzUp%n8)<1^SM#fWkc4!=nZijv~XJiW*yMmV|Y|f_oLFe+PYNK$d2fc z$V*{6&e;oYe1_0GmgMB#dQ9o&=F@!ygk-$4Ciyi3K+L~fUPl)q!KXH6bzpf8024Jb zCOJYaY0mw8nOn=8RaZdS>X(})t!*-Sb&vOthOCRfJ{D4liatl)ShYPtDDv3&GMv2Dm zF^PH(FnN47fab9zen#A3h5jpX&Fm|G4g37njlJmK>tKNDj*71p4fakRbgZ% zX>Pc3Q3{l~V_qOG!&T{k82O|0Gvoq{YbDuh#(MJH>z$HDmAAdlMoHa^4L5q`nnftn z4K^c;V|-rM_8b!`V054?pPMOZ>5RSI{y*&}ZjI^UMSIlo;%<#m^uEO)@v`3FbVuIf=y+_%AEGIAe-+uHF8_}G`rn<$L`d$kGtBlo>VVs%E`gcE3wZKz z%!B7a1EbMcMe-lL&i~o+;Q-{gh91m}l+w8N5Aabxhk08(>=+LD;ZiBpb9bb$&xcHA9_#c@+?ARe~ zO7dMuxyp6-2%(E)gJv$Dv4;H-O9FJ681-or`uL;B!Qw1_ z8{*WFq2V=Dq;<_e)U1?yCtWMIWp-ah#vYke$^7!hJ~d}x-bp|*0p{WQi2x8Cy%fXJqVZ=?NZIASW{mx|$=!c|0v&o- zzK?D3tAGctw$~W=el*>5ichS(u@P#_`#iGKsLkUVWUbo@7MtSD;#n00`T|xX0CA(R z*?UmP_y~iG^v+nJSyda7G-IwS08gl1X1|!6Fe8mqUW5^=)-M2R)1WI(`WbapmkO>z zlh0%FN%}NscJsY!gf>c99o)R|du`-TIR;)Xkz^JHo&FU`;rdU1J%28)9Aq?$f@Vyw z+($*(om7k>fssFg!{Y%bV65p>HKNOtHtCe=uEyV*KH`Ng$B{YSb6%l8Y-NWq4^=WS z(LOb$KDIFo@{YFGR;X#@>+oS7DL2TzEbJR`00*lWZMAyOhI_o;Iqs;h;mi`)W##ASXmkjrdxb*=^J+a}$+7PZEI%g}(5 z3TP6xXs=4Ko5%VeGWfQh^OZri2Yk4U`Fa<7dh%6{05Lbx=cq#_mo%dvkURYt^GZPK z+1cwdLO^;1B@IK{F_2CnYBLoTaH-48H7VA}wR}igZ@-J|a{(vD+w-`A+Bhh&E)KAP zEFds=u|}FPMmqh(QbrP|rrKnzFVzym;n)gQoe2Nf)goA^`bzQif;&}tyEcME;@|HY zK2GJ{LsZ4i;(^GXWn*s}p z22Lwv+aiLURCmQu2i#!u9yeNFSRnuUbUL>NV;%hNKfcm>?$KO$ij>%~ex}ELsd9pE z2m4OtTU9^`Qv4%gpgo?LfVWO?C6r#K>f1(2yWnI3u^I3xh!2RDKVrnr+u}-SBhOEF za=Gq9GHcP_yqD=n?NBwXKu+SJ1s-KSpZ2wFL%iLG7omu#n3^3(n-)4QFc2C-|F{b^ z;Jt$@Z`l7XFvdu;-%;aFwdzyICQ+I}a*5U9Bu-zMEt#1hm z-%NqjySIfpKlS$ro9(CSmyCHnklCST0#L48;0Y}8z24?3WYc_0***j|9<^jA!e5aCOcULpN2+xZfEaV|hbRLklIR;sRp z-C_ahMHsC8|3bCeiemUbSakx>JInI9b?}?_Vk3Dq;-v%tW7tySaQ!D| zc)oDneOto+8lTF~&omQu!5snY9q41V0Pv?E9}C(?aJaHmIudy-vo0PRVO=+_1dSp; z^i<2EHlRom8t@)bFSzKxAUPKSwuoYZ*jp{K2H*f9+xoAcDq}ysZ(MCW7YToT1PYIf zlJJwM)I~zIPi5VN?-eop622)~*p-v0qkxO5)XQ{$(rMN&ARtrY9k5BZK6aou)vx@%944_buY)%9HDmL?TA}9x@~>c3s>kOx z{yGWyr*63TSFo#Eye>}c__25YARBKe*8Nmg(+r{&{#T!#<1gyTrZiHwgiECea~56t zlr8^>CNW!{BZ+CAIE2ZK9OKfX(k{2`QYP~AhZ4YGCf&OCk_1nO>gCV!?b;QI8#V0z z#>iB!DM;r5mKKt{sm;2F3bQu>T@3!aC1sQ%4vA#_jiZS?7KLT6lRdk?TV}>^i{;|! zdxDYdzQ={m7|$MKnac33ohwq}<9 zG5p=O_)LOpQWgZU;xk>7!oQO^QCdQi0LuldNX!Um?klT%3dO{|r)2{=gc4{u* zLT&uR4OcDh8o?Cdk%K%52N1>k9UmSUX)diDH55{@}Y1ptmb4hpdlm7Rr{3BMu*6i6kFj zZt&Np>a1jvKi_2ly~#Pa9qmtqu~tQ~$7@gbn{@4kF_ydfflv22Tqa|U=N!tth?le9 zBHW3dye8u5f^a>If{9YXJO90UtPRlrLdsbT0)jgpn*8z0R-HDO5v@R0F~(>oxwds3 z?e}`8!fI6vQdPDfkZ3p?>(m*iD77)2!uk_Z;W=Xy?{v8E3aM&lnL4y@b4(^3`M@o&jT(3gv$kNF0N`_<{Wv%PhD<%uRGu@3Xwx~yd-5` z+o_W>yFpZ=cOCdxi_Aclfp|^Z%v`#Ns#NkJbdei3Wb)%^D=>@4EDnCQpQXdIULkuY zLom7l|2u`Cw{qD{Du|1jLqveYm`nlMNlMv4(>!S=1-Y4W!OI^Sn#MzRBlkdUYy zv^Rn{IBZ?KYGehpkkw?L0hm)D1EmFzbHC~f{QwcJG8%dnza#(vhYXZ0vHKf_575caV3iTns{SX+A{MN| zYj_O5+82u|u)MuS;4CH-gy20@6UwD|LVkc<)kyy=6WuAGW#mfR zEO_{BBQf#y!>z)MCD&N2_eM@)+=Z&rH+`=-LSZg9WamJ0T4Vbt!9LG|kg_B__QviL z3eVSbtM#gUmqHa!c5f&|9gKL%5Bzqs%I#k?Ub3;r9X0etDXR`-P(Fw0@wz6VKArn8 zeDC^P45V+o2mAxMJNx=9>?@2#EWCVW(!CD9*Vuerxx6D`oj8P>I{!fT8{N5>o4YS| zF4?}!y|g|4+jrthsKE6jKugVN>3DW9pM2s)|FgNk&TX6BZMP7r7A^Gsvdgl+;wnwW zE&>||8J7d+?PW>)S(Jn}AB|4>_pRUBd4nClM~+F*0~P|7EN^YE&B>F%P4-ilC_w^D z#^FLe2p-|@RGlowGRXh>+eqHaz_0tgTgZ(fsqxK}Yo(5N9`BG2R0s?Hescz9D~syY zf9Lh#y&lM+kn#L*{(WGmV3~mz>MBDl! z*0KZGp5AF^HF)Scdlgsy)fr#B-%XDSW38-I5*XOLEgT#X2O;NUKObL0=WYF%nD0T| z8Y>9Y87{34x9um? zof2GLOCB_C@v=d`(8K*IfL;{2`n&8lbJw?zZzwUoJI) zar90%;f+%3d>A=qu9^B>RV#zvOA}jgba{r>=peP5GBa3}LF9F6_rUFousbaE9|;t7 z$os$j%&O--d6G$U*(uGY?BVi|K$(%2`{xelrWawkh^}LiEW1M8vC;>Q8B!_4!jqas{44BHrv5raK2e*o+sAa zLq#lvpwsx5t61MTYh9*;Ck#c4jhio>^FjlQ46Da~nyj@0G^p*q_SS~4@m)>!9L1aa z)1FOTVIiAicLrxS(ug9%B#Rko=)}ec?pQ^H$%~~R+N>YYioAAR=yu9MHD$r6hC^&q zu^dRnE}lGx@jB-vNV9j4khTkfg3FRs7dVNNtnD&-sqvEW63 zm|ZsIg<(M*y@8Xt?Jthu^VEsiZw@~WHk9voN%!yi4AEPdtm*0(&i|lWIJ1L{_%ISs z(aLmL$wN7N%)q@ua@T;_D6>HLzC`bUDbdfD;uW#xf_5#8AE2a>XTrfc z;sZLo9K(pBU8XndB)_TJX#TSx~SbUBhFzO-yTALkzE7GdE+(0AM zlZHRXhF*qY-(W$Nt@e#(xf2{jKU^3=5G`0ulC0&&3T0Ueao3=Q{NA>~`!{r_Z-Sekz#yin$$t^$x!~aYJE$oG>^7AIlI~H{VobEuiM>D02vNM z0xZ228{f35`IG^s5pMozEBoSESV;+p4`Yn|EkODIM{lIU<1z5-fj6RC5zC@rfMp`M zGT4Jz6biWT_okPefH78xdQhLH9~8S9fdxlG$7q@)?^81C4z5faHirbzER|FR-FKPz zmgqqylx9rJi-=YzxDP)0-T-iAJrHawcyV}~g4#-l!`~U1NgrK2jb&W$BXFpUh>?_1 zES(iT4P%@I&@Gn$1PVy6egt+;|0qKom64jD257kaPr$Hr{sCbmUKmMurdjQ?2aY=7 zOC-lj*3uwKfG+Yqb0g#tmal`1WO^#E4JCM>8MBjIz-57cGBkVfv}5m)$Q~gph?GA# zIu;mjFUYA<&A$3Uqd6(#G%bb7H7Vc$@GW9{$7HU5x-h#l4#C^%8epE@i4RFQ+5U|i zfPm*E|I}p?H{4Ty;!MgD2Lvazxg3LWM?ipyW|3(>C6;@Dkqh3sS*Zl#+saXsh^hda zwt^o+)@Jd2jvr=R;qaBr&mIr3p^=gK)b=8)87WS#a)ifm50Ca0fJZBR7%1PJx zd&U^LESDjEK6CgSn34P(;@0lR`Bo43+z8RK~=7y(FT4(GB zT^!bgi_I`Kbg>j@2qQbi150guiTcM(*mkc1mobr~Iob&D%^FA7b9Mzv-aC;X9I8g@ zj+J}gPnT1H&`Z(^Nm<6hu+!cb=YHL#u{PB$VrA~A%UlB$HOBq80#B^4mE(+O#Sw`- z3|Lq#Bs~PKDee9DMF$TV_624=G}KtrKl^lp9I&)LDESg(WfUrG^2R-6_yYF$c5kkY zJS5Ijw1|uVnHv-BT<2@@;0kTKY1Ill4BRfpbTfi1XS> zAv+9 zGOSVkk|5`THu1M09!ex?|5NfR?Y#bn`*!F(m9DY6BdGfz{E3Qe8!a3BV9Nm5&N{<# ztv8n-qCD(b(#&99?e^-H?DF8rqdL7a+ne@LOJV-+7|zF&mV1g9B5IZ;iVyp?<$jMW zE@zkj5pewFOT-%P-VjOJ6vl=t=3wm}NVG#pjYLRi60mW3B(EhN@F^=bhdYf&WBjBToWyOyla=dr|hXcSE{!Y zwKh1S)NzTy(j<&yCV_6&XhN%V{Hf4>50f3bvd+=PClv%*3?gP+HBu1!^g&1PxrH*K zmmLlLX~Us_j+7pU=xX}kAoS4Zcs(^`@tYMo-(;sLI970Nu%|8G4)IZxEz_g82S``) z)R%&8qwtdLy9`8Yb`uwgBBvVS&?>jI0}jZ-&caB1|3%|UMppa%GAbLA_SY6EMHCY0 z#^`MlNJ}`CteM`IW8nODu*3Obqv?_pKU+>Bm1$=v$4Ici%(uOo_WiHz25XiMVU5nB zU2ToU+JR=%jfC}aQ*_M5OJdpqZ0yt*FdhbA+skrwdDgBtx!hN&EB3u1@HOYB1ingI zdDY4Q1M|KZS7qp~iNUNqfu{=}+jtzqId1gt_M;K=eDt0xDu|&&q_3GdY{l;55b^Kt zQZ8Lf_AN6Lxkn2qk%6}r7tP;*sp}fJ{_>-43NJDX-4aTeHZ~L@SSy(K3Sz2T(&wDk zp1!9@27DDfukP4UM=Cnczok;W{5v4s!^Kgbk@4&(MCrLmjeG~8IEljJDM_29lP7bt zvi=jy4dDs!C(G)!r8Yy^sok+ePkmiWh*Td6U4m6_OMjVde=J0$Nja^*M%f2=CpE2O zIsdzcYW)L}0X%eY5w|X1Ywb_Bs{{kssg;>$hYLYZAGXKVmp@kea_{Ct%i-JClBg-x z`huL``HXq@*$Ry+FLO%Z2zKyrduCr;qQA1t|NBeBrnY?RIE1d=aK5IRE#J{!BJx`r zQtOdArq+7;;&@2BF3Ipj0cB%loM7XaXE9S6xf0-(b0kMSGIhrn=R>LIU9IDI8%N`j zq)ozYmZW6~Xl?3U6@dDFqO-Zzw{#c8>NP%b zT-XsuSebZqWR%T6bnFwW=dSFOKXw3F4SNp>1kXCH)Wy)v_TMIqc~kl8@jBAMAx~I0MhkIL zE>&Fk7}6^Hfffux55c||Gv_1jAH#e39N5ZLMwGq&?Dpf(TK#qoI?vDFmlsyFwDLQ? z+O@@QrH_28f{KDIwLtf{d$t_APCIntQLz2S%=bUUV*LfF#1DAzgh#Iiu_*Mgx$gu{ z;mMEbO}G0ekNouc!aXp(srI z9M8>uNyylJEUbULy5EHli`}AilT3Jzk21rRA9IO0sxE45s>=ACc*5iqx!r%j@?-E- zREwoU;c9W3>EL_HbyE3fsVzKKDMNU~;o56SKGP+*udv2D(}{CSj$L0b zSUI_>hkl{{=Bdgm&inMcp~*C~>xo{1^@f#$IB~s&udL0l?P95}N}MorYrDrE=4g4s z{~;4FF?D`7HG9d0N)6j3uVWF-ar=Rw#dRwV|zKV~h!$C+Jo?MW}K@%8$t8qF9VHU)!LIxPuK0 zF2{mwL~K+x$mJjDG-sH`e~hd^$l;fea-bNSdgp3dS#F(-v>$bWS|2Nxqk;SVu{RL* zL>Gbd71v=a*SL%VvQrY~BP6s3TA4O{)Cg>#mAn4i87O=n2oZpQfI2zen35m9DIEHG zhvcGaM4=Ow3Q1c@X)i4In$_5w(c2%)qc?(|vNY--EcwPGip5dKE5gx<*hB&w9jT5& z0;3|(R=}bF(v*@Y@?;(UGDT1c_`YphH(v@O6dklIhlQe_!2yMzVQ-Ec7VnXU8*nT` zK%7HKD5n)f`rYxAxZfFx7X9og{70A-8wmEeAsYu`8u|xqM$z<6xTQ#tdUV>eJMT}D z0Q0|Z8PBTRi%CG;29Xj=f?DPK{t~n4S#Hzl%N~aFs5H)}8`-EOr_@H6+VvKV>(2ArZYR38k9cnd+y#@N#MJdqNz{x{h@pD$7FxcxG=;YFi7r!X5)@!yXXNTIt83ex#5b~H^V2fDku1zm(h#_#|;*X zC_RABJ&wgXM&*6>>coJ!QowdKzyT(mo#G!qv`k}+NVn2K0$8hK#~$wOBhCE-a$$@4 zgVMblH_O}948%5N8B+IO(Es;Q=>l+^Rqb3%OBW(pcUy_La2luWzNW8U^k*9UAJc3G zBgOg3k3!PVoz^0h!&ct9L@$g3y9r zqP@ukM9O%Urj*5JOwt&N^W`5ImU9d6dnD{li*=fhtaTX{muYQ%-1s|7otxzz?TjFn z5(J>*l?|qG0=bX92LYa~1z^2m(nnr{!MMAUqC^L0W4XD8f7V-%q+k3y9Mc+BA}vT(_O9?NU0q>KNV)Yb*Fxm#P!bSml*8z*UD5$FHy8S+2FdDF z{p!2;p(%FK?f8cbu9>9RRRKlc`v(gCVfmJ4h5i~Kq)ciq*YRP*AC$MaZR;V5@{9z6 z+S(yMB48qYB#Oir{Yv_@q0@u}IG@ko-%OryWj`UfnXV88Q2G)$jyLfBP}{B23hmL{ zS5cJ&QXyA{aGdggvenseeleJ>d!K9L8>V{V@QFOe+}t2wH4SyqHUk=3eF|Hn$C3=& zwXxmhsjx`rm5j6heRG{`$wii4afk5#!C7R{+{Mz7umjqBS-ph%!s_)TMV=GBOX2iyZaon# zQN|Auy7}Z}*Jy1*5!&x~Xo|2mbRwMCNj}j@kkBzf1G%pAAb=8z%gm0_iOD<>XL7!(OW(1}l)?~=V|vJdzBG|$1G zib2)J4GA=~8N5lUwJvS~>{wBiqC9j|*%qsO0b26L^HD2_iQQQUMM9IIA3Gucyr2AZ zfl6vucB6pugCzmqT&`n3a98T&z^<4wnEcoA4~q<~MJxN6%8F&;lD3yP#MGz@e;4*2 zFu8r|?ei+(}qew{jsOpjxFHxIINe2>gEc^cC{wL#wfEn!Sb^?Hz} zNlk(;6m_qT1<8#dV4qU~J%?$(dNzK}6w>U+F$G+}3fQ##3zLD#b~z}@T@XiQg@67D zoh!g3X=_vA0H!U9MKi{q9i*)sSqi16>IZ<_LFwO8g*ukcVvPE0+a9g>W4Zukb!$_7 z#gCho2{H{-tSiOeO2@DlzrF5zozw&ntk*&YiS~nsFMn?6fW(XVyZ4pq9CnZUeZwz_ z&eao<1~~mQ%fBJk0F!n^D&{A;PAo#OB*g-SAoaL0rxkJ)KqM68F;BGB@Hwo09qJ^0 zE=dlJQw8uFd?3iBx$3B+x+wfN+_+oaFKoXPql3#?w{wxO4jLr%-i|n_wm*1#=P`s_Dl2qprmA5f_ z9Ll#%;96RD4ukP*9cU(Lj_khi`gYGTmqJ8qVfwZ@i*6`3v*2E_Q{`oAy#dbyWxoBy z;20ySq8(x;8l6^ZkDTy4{| zz>C?zV&c`;nP$-0Ww*$8ANDt9O<0rqboYUMfci1qHT3LT0{S=u(JESjRDY^!E_`%a zjPEIhwy|c>Pmk@rsbumr-3V+6V~{m{Y`$=kd9iGKtb5HYckW;PXm|ms!x?{gvNUuzCRMTc;zO6u#txrVC!4DyUmdwOO^yUU<+?;7 zBS)aOBG3I+b|c-9pd*~ob}Hj07RHWFNaId1DEEd|iv1BFxMSjMOMk?9x~QJum~?Sl z0c|G@A=75tdvdRU^dEoeW(sLal?z9Edvhl5xBIm@m-Ftl7GjG<0H{H(@-`2t$XUi5 zOE<&w6mt$?+d69xWVGt^Z;{GXAVvqJ(8Amb z_Zq!Uj&>F&4mVIzH{h~7EV_TN8BN05(l7RWMykAstH`_)d-H54paRuImZX}wlKl2g zyD|9xOR&eFo1s zKv9?mE2U8oa9W-|nR*E@WtGxXt~DZTxNZis=6w|m9#l?I!(Lqz1YPQZa~!KTp$@`!$!pllBgd}FMMpE&MX6iT zY8vlyad61JzHY=`XQH6MA;85ULnW!Cs2HiQK-IdcsjePOpw#;CH7Y7f{e{LAoR6P7 zGZxB7q{ll;32&GFdc@ArF@K%TE@q1Acw#s!olH?N<=^~ynI9!^=-BMnc`JmZcFQfS z7#Q2K+bit(fnxcSf2}>JO7&?t+2z{%VzE@vCdaZoxY5HXEAl?xA`pI5_;H)Y<>-pN1O6 z*42J0x#R}M4607cgrQegH4Qg+$JPADxVm?#-RHl#Ntz5bua9`0eDJ&z3*{Yo(>mxl zmuiDkofkj8; zgPAZeLv{y_(zr)+8*8*9?D82v32Y1it^w?IXG%l}eDW8ShqOnSGB8Vxb99B~;rbGB zvN5F+a{f_0|9)71$4kpW3C;qA-?}&RQ#B2xFC6dELD@3}s;ga`>>4yn?-i@;q6c-M zo2@Llqod{j(-L6TW?ZkvR2Rj!^FxH`TQZ!JQs=`>`O<}9^LK5CljEZxgMyohn@M=r zGajm6`d|Ju=co7oQ8N3$S_P7#ohyWI2!8hEgER`?!bznLbOEdGJD-+iTk)L18ca9L zdxIoY0A*ges3P*xrZ^zH(8+AIZ0fZ~Rq{=7-EVvkX;6dT2``!~brf@LCUw&cWYFAu z+V7}F24+#~H{gR(a~B4WfY71SkVs{7Kj)4&HfgM01L(De9-2z?(HjP;orr}aMBl1M zf5mnZ9qOKPZbi$Z!_bOVwMpYm<6`=v;%=Jf!XBPOXp_APU*~9%*jCY3E@MSSRx-Fc z{YQs~WX`!!WIH)X&Sff8Nk7YEp3Tr$W2V`D$i6>GZvTR`O%q*kY9K>1PpneP-d@qb zK(8d|eL`jsO@LT^aS-ZQakUB4v+e^@>APU4F4)G4YB3 z^_48=R~!cel?ltYCy}|Y%l1$kAx1dUKEtC zQsQ%CwnFzgRz%n}iu~x7=M`V47`acsy=@vWMuT!_2trTRQCS*0uv=^n?HssnYt$}k z!E&riD;Vf!dxl>uj0IY48dqWFZJ3Gjh=)S=cBBh)U2Poh4i9|g%Jz#~sduBp(kovB z?sZ5d7Lct7l>2Uw4Lm<#l{f$uiYEOO{>_B=G`9C`YWvN;b)s68!EcX=5a&^r}6yx1)5PE+yf=t}5%>|EsSrsZ2j{^16l3;JMq zGu<(RpPBCvy|!pKv#}$W4&0ddUF13c$gex$u%c^N-UjsVe(CM&3?Sdu3H(fjdoqgr zxQFufap8?}wjgtrk=sO8c7Fj1FVpvMJ(6_t8xyn0xW!iHDPe7aGQu4}Q!+(&sW#7A5v`3*E;heAjyj3dtZ}vs;aQGRXL`?Z^~<7o zKiguHIBajLV2?qooSs@uJpE0PTc_!Mwzo0x1~%$|!8Wk!IV^DW?!~4V!?I2@<^Nj+ z-o%%@fNA=f+)V!t@Ve-mQ0ulDMw*Q@jyfXBg;T0INJZgRiKbQ@tHQkh%Ad*w7M<40D)?$pj z36Ku(7HTUV{and-V5CW;nqd<^ZC47C9nW|F8OrdX@r5p&99kUQ-GI7o>IC^>OxQ>7v0|qpDKXuUA+1Pm0E*C@Gz~|uFc9x%g1^ZhrtHJMs z%e)E2u&8#_?4^$hx@d&w{Bvx2=BOx>-@+Ei!+bPTCG!M3^WxyQ9bDvgO?XSrYwm3= zLB1|*Ak2koAEX@Mrs+LaX|2RAjmxvpdjZn8ojE4=6e)<#f!9XuTMKd)+z$5AjWoeg zN5`Q?so0AAMoe_$?*dDHUMS->v9>;(7~sgloXS|e3$0edhk?o?)feH|PIx?IP_}k5 t%Utqe209Nqs{>PMqQ)%K|6MXVPhd5(+hK(s$0(?vf}DzMuC$)d{{aW!qH+KL literal 0 HcmV?d00001 diff --git a/L1Trigger/TrackFindingTMTT/test/chi2dof_cut.C b/L1Trigger/TrackFindingTMTT/test/chi2dof_cut.C new file mode 100644 index 0000000000000..ca6ce9b0c421d --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/chi2dof_cut.C @@ -0,0 +1,112 @@ +// Plot fraction of good & bad tracks surviving as function of chi2 cut. +// Does so for subset of tracks with nSkip skipped layers (or if nSkip=-1 for all tracks). + +void chi2dof_cut(int nSkip) { + //=== Optimise chi2 cut applied to fitted tracks. + + // In unnamed scripts, variables not forgotten at end, so must delete them before rerunning script, so ... + gROOT->Reset("a"); + gStyle->SetOptTitle(0); + gStyle->SetOptStat(""); + //gStyle->SetOptStat("emr"); + // gStyle->SetOptStat("euom"); + gStyle->SetStatFontSize(0.035); + gStyle->SetHistFillColor(kBlue); + gStyle->SetHistFillStyle(1001); + gStyle->SetMarkerSize(1.2); + + gStyle->SetStatFormat("5.3f"); + gStyle->SetStatFontSize(0.04); + gStyle->SetOptFit(0111); + gStyle->SetStatW(0.30); + gStyle->SetStatH(0.02); + gStyle->SetStatX(0.9); + gStyle->SetStatY(0.9); + gStyle->SetPadLeftMargin(0.20); + gStyle->SetTitleYOffset(1.6); + gStyle->SetTitleSize(0.05, "XYZ"); + + gStyle->SetLabelSize(.04,"x"); + gStyle->SetLabelSize(.04,"y"); + + gStyle->SetCanvasDefH(600); + gStyle->SetCanvasDefW(600); + + TCanvas d1("d1"); + + TH1F* hisMatchTot; + TH1F* hisUnmatchTot; + TH1F* hisMatch; + TH1F* hisUnmatch; + + //TFile file1("out_ttbar_ultimate_20180831_182908/Hist.root"); + //TFile file1("out_ttbar_ultimate_offall_20180831_183257/Hist.root"); + TFile file1("Hist.root"); + + TLegend leg(0.25,0.15,0.55,0.30); + file1.GetObject("TMTrackProducer/KF4ParamsComb/FitChi2DofMatched_KF4ParamsComb", hisMatchTot); + file1.GetObject("TMTrackProducer/KF4ParamsComb/FitChi2DofUnmatched_KF4ParamsComb", hisUnmatchTot); + if (nSkip == 0) { + file1.GetObject("TMTrackProducer/KF4ParamsComb/KalmanChi2DofSkipLay0Matched_KF4ParamsComb", hisMatch); + file1.GetObject("TMTrackProducer/KF4ParamsComb/KalmanChi2DofSkipLay0Unmatched_KF4ParamsComb", hisUnmatch); + } else if (nSkip == 1) { + file1.GetObject("TMTrackProducer/KF4ParamsComb/KalmanChi2DofSkipLay1Matched_KF4ParamsComb", hisMatch); + file1.GetObject("TMTrackProducer/KF4ParamsComb/KalmanChi2DofSkipLay1Unmatched_KF4ParamsComb", hisUnmatch); + } else if (nSkip == 2) { + file1.GetObject("TMTrackProducer/KF4ParamsComb/KalmanChi2DofSkipLay2Matched_KF4ParamsComb", hisMatch); + file1.GetObject("TMTrackProducer/KF4ParamsComb/KalmanChi2DofSkipLay2Unmatched_KF4ParamsComb", hisUnmatch); + } else if (nSkip == -1) { + file1.GetObject("TMTrackProducer/KF4ParamsComb/FitChi2DofMatched_KF4ParamsComb", hisMatch); + file1.GetObject("TMTrackProducer/KF4ParamsComb/FitChi2DofUnmatched_KF4ParamsComb", hisUnmatch); + } + //file1.GetObject("TMTrackProducer/KF4ParamsComb/FitBeamChi2DofMatched_KF4ParamsComb", hisMatch); + //file1.GetObject("TMTrackProducer/KF4ParamsComb/FitBeamChi2DofUnmatched_KF4ParamsComb", hisUnmatch); + + TH1* hisMatchCum = hisMatch->GetCumulative(false); + TH1* hisUnmatchCum = hisUnmatch->GetCumulative(false); + unsigned int nBins = hisMatchCum->GetNbinsX(); + + // TH1::GetCumulative() ignores overflow bins, so add them by hand. + float overMatch = hisMatchCum->GetBinContent(nBins+1); + float overUnmatch = hisUnmatchCum->GetBinContent(nBins+1); + float lastMatch = hisMatchCum->GetBinContent(nBins); + float lastUnmatch = hisUnmatchCum->GetBinContent(nBins); + hisMatchCum->SetBinContent(nBins, lastMatch + overMatch); + hisUnmatchCum->SetBinContent(nBins, lastUnmatch + overUnmatch); + + hisMatchCum->Scale(1./hisMatchTot->GetEntries()); + hisUnmatchCum->Scale(1./hisUnmatchTot->GetEntries()); + hisMatchCum->SetMarkerStyle(20); + hisUnmatchCum->SetMarkerStyle(24); + hisMatchCum->SetAxisRange(0.9, 35, "X"); // dangerous. don't make lower cut too big. + hisMatchCum->SetTitle("; chi2/dof; efficiency loss"); + d1.SetLogx(1); + d1.SetLogy(1); + float ymax = max(hisMatchCum->GetMaximum(), hisUnmatchCum->GetMaximum()); + hisMatchCum->SetMaximum(2*ymax); + hisMatchCum->SetMarkerStyle(20); + hisMatchCum->Draw("P"); + leg.AddEntry(hisMatchCum,"match","P"); + hisUnmatchCum->SetMarkerStyle(24); + hisUnmatchCum->Draw("P SAME"); + leg.AddEntry(hisUnmatchCum,"unmatch","P"); + leg.Draw(); + + d1.Update(); + cin.get(); + + TGraph graph_killed(nBins); + graph_killed.SetTitle("; Good tracks killed; Fake tracks killed"); + for (unsigned int i = 1; i <= nBins + 1; i++) { + float fracMatch = hisMatchCum->GetBinContent(i); + float fracUnmatch = hisUnmatchCum->GetBinContent(i); + graph_killed.SetPoint(i-1, fracMatch, fracUnmatch); + } + graph_killed.Draw("AP"); + + d1.Update(); + d1.Print("plot.pdf"); + cin.get(); + + file1.Close(); +} diff --git a/L1Trigger/TrackFindingTMTT/test/make_stubs.py b/L1Trigger/TrackFindingTMTT/test/make_stubs.py new file mode 100644 index 0000000000000..6c6f49a192a50 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/make_stubs.py @@ -0,0 +1,61 @@ +import FWCore.ParameterSet.Config as cms +import FWCore.Utilities.FileUtils as FileUtils +import FWCore.ParameterSet.VarParsing as VarParsing + +process = cms.Process("STUBS") + +process.load('Configuration.Geometry.GeometryExtended2023D17Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2023D17_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgradePLS3', '') + +process.load("FWCore.MessageLogger.MessageLogger_cfi") + +options = VarParsing.VarParsing ('analysis') + +#--- Specify input MC +options.register('inputMC', '../../../Samples91X/930pre3/TTbar/PU200.txt', VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "Files to be processed") + +#--- Specify number of events to process. +options.register('Events',1000,VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.int,"Number of Events to analyze") + +options.parseArguments() + +#--- input and output +list = FileUtils.loadListFromFile(options.inputMC) +readFiles = cms.untracked.vstring(*list) + + +process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(False) ) +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.Events) ) + +process.source = cms.Source ("PoolSource", + fileNames = readFiles, + ) + +process.Timing = cms.Service("Timing", summaryOnly = cms.untracked.bool(True)) + +process.RAWSIMoutput = cms.OutputModule("PoolOutputModule", + splitLevel = cms.untracked.int32(0), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + outputCommands = process.RAWSIMEventContent.outputCommands, + fileName = cms.untracked.string('output_PU200.root'), ## ADAPT IT ## + dataset = cms.untracked.PSet( + filterName = cms.untracked.string(''), + dataTier = cms.untracked.string('GEN-SIM') + ) +) +process.RAWSIMoutput.outputCommands.append('keep *_*_ClusterAccepted_*') +process.RAWSIMoutput.outputCommands.append('keep *_*_StubAccepted_*') +process.RAWSIMoutput.outputCommands.append('keep *_*_MergedTrackTruth_*') +process.RAWSIMoutput_step = cms.EndPath(process.RAWSIMoutput) + + +process.load('L1Trigger.TrackTrigger.TrackTrigger_cff') +process.load('SimTracker.TrackTriggerAssociation.TrackTriggerAssociator_cff') +process.TTClusterAssociatorFromPixelDigis.digiSimLinks = cms.InputTag("simSiPixelDigis","Tracker") +process.p = cms.Path(process.TrackTriggerClustersStubs * process.TrackTriggerAssociatorClustersStubs) + diff --git a/L1Trigger/TrackFindingTMTT/test/plot.C b/L1Trigger/TrackFindingTMTT/test/plot.C new file mode 100644 index 0000000000000..7151153dfa1d1 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/plot.C @@ -0,0 +1,131 @@ +{ + // In unnamed scripts, variables not forgotten at end, so must delete them before rerunning script, so ... + gROOT->Reset("a"); + gStyle->SetOptTitle(0); + gStyle->SetOptStat(""); + //gStyle->SetOptStat("emr"); + // gStyle->SetOptStat("euom"); + gStyle->SetStatFontSize(0.035); + gStyle->SetHistFillColor(kBlue); + gStyle->SetHistFillStyle(1001); + gStyle->SetMarkerSize(2.0); + + gStyle->SetStatFormat("5.3f"); + gStyle->SetStatFontSize(0.04); + gStyle->SetOptFit(0111); + gStyle->SetStatW(0.30); + gStyle->SetStatH(0.02); + gStyle->SetStatX(0.9); + gStyle->SetStatY(0.9); + gStyle->SetPadLeftMargin(0.15); + gStyle->SetTitleYOffset(1.3); + gStyle->SetTitleSize(0.05, "XYZ"); + + gStyle->SetLabelSize(.04,"x"); + gStyle->SetLabelSize(.04,"y"); + + gStyle->SetCanvasDefH(500); + gStyle->SetCanvasDefW(800); + + TCanvas d1("d1"); + + TFile *file[7]; + + /* + file[1] = new TFile("out_ttbar_ultimate_off1_20180831_183411/Hist.root"); // Corr 1 off + file[2] = new TFile("out_ttbar_ultimate_off2_20180831_183030/Hist.root"); // Corr 2 off + file[3] = new TFile("out_ttbar_ultimate_off3_20180831_183117/Hist.root"); // Corr 3 off + file[4] = new TFile("out_ttbar_ultimate_off4_20180831_183220/Hist.root"); // Corr 4 off + file[5] = new TFile("out_ttbar_ultimate_20180831_182908/Hist.root"); // All on + file[6] = new TFile("out_ttbar_ultimate_offall_20180831_183257/Hist.root"); // All off + TLegend leg(0.7,0.15,0.9,0.45); + */ + + // Testing variants + /* + file[1] = new TFile("out_ttbar_ultimate_option1_20180831_183601/Hist.root"); // All on + file[2] = new TFile("out_ttbar_ultimate_approxB_20180831_183534/Hist.root"); // All on + file[3] = new TFile("out_ttbar_ultimate_dsbydr1_20180901_230848/Hist.root"); // Corr 3 off + // file[4] = new TFile("out_ttbar_ultimate_option1_deltaS0_way1_20180901_231217/Hist.root"); // Corr 4 off - worse resolution near eta = 1.5 + file[4] = new TFile("out_ttbar_ultimate_option1_deltaS0_way2_20180901_231405//Hist.root"); // Corr 4 off - Even worse resolution near eta = 1.5 - 1.7 + file[5] = new TFile("out_ttbar_ultimate_20180831_182908/Hist.root"); // All on + file[6] = new TFile("out_ttbar_ultimate_offall_20180831_183257/Hist.root"); // All off + TLegend leg(0.7,0.15,0.9,0.45); + */ + + /* + // Different particle types + file[1] = new TFile("out_ttbar_ultimate_onlyE_20180903_115714/Hist.root"); + file[2] = new TFile("out_ttbar_ultimate_noE_20180903_115836/Hist.root"); + file[3] = new TFile("out_ttbar_ultimate_20180831_182908/Hist.root"); + d1.SetLogy(1); + TLegend leg(0.7,0.15,0.9,0.45); + */ + + file[1] = new TFile("out_muon_ultimate_off1_20180903_145832/Hist.root"); // Corr 1 off + file[2] = new TFile("out_muon_ultimate_off2_20180903_145511/Hist.root"); // Corr 2 off + file[3] = new TFile("out_muon_ultimate_off3_20180903_145549/Hist.root"); // Corr 3 off + file[4] = new TFile("out_muon_ultimate_off4_20180903_145621/Hist.root"); // Corr 4 off + file[5] = new TFile("out_muon_ultimate_20180903_145432/Hist.root"); // All on + file[6] = new TFile("out_muon_ultimate_offall_20180903_145655/Hist.root"); // All off + TLegend leg(0.2,0.6,0.4,0.9); + + TString name[7] = {"", "Corr. 1 off", "Corr. 2 off", "Corr. 3 off", "Corr. 4 off", "All on", "All off"}; + //TString name[7] = {"", "e", "#mu, #pi, K, p", "e, #mu, #pi, K, p", "Corr. 4 off", "All on", "All off"}; + unsigned int icol[7] = {0, 1, 2, 3, 6, 8, 9}; + + TH1F* his; + TH2F* his2D; + TProfile *prof[7]; + TEfficiency *teffi1, *teffi2, *teffi3; + + float ymax = 0.; + + bool first = true; + for (unsigned int i = 1; i <= 6; i++) { + + //if (i > 3) continue; + + file[i]->GetObject("TMTrackProducer/KF4ParamsComb/QoverPtResVsTrueEta_KF4ParamsComb", prof[i]); + //file[i]->GetObject("TMTrackProducer/KF4ParamsComb/QoverPtResVsTrueInvPt_KF4ParamsComb", prof[i]); + //file[i]->GetObject("TMTrackProducer/KF4ParamsComb/Z0ResVsTrueEta_KF4ParamsComb", prof[i]); + //file[i]->GetObject("TMTrackProducer/KF4ParamsComb/FitChi2DofVsInvPtMatched_KF4ParamsComb", prof[i]); + //file[i]->GetObject("TMTrackProducer/KF4ParamsComb/FitChi2DofVsInvPtUnmatched_KF4ParamsComb", prof[i]); + //file[i]->GetObject("TMTrackProducer/KF4ParamsComb/FitChi2DofVsEtaMatched_KF4ParamsComb", prof[i]); + //file[i]->GetObject("TMTrackProducer/KF4ParamsComb/FitChi2DofVsEtaUnmatched_KF4ParamsComb", prof[i]); + + float ym = prof[i]->GetMaximum(); + if (ymax < ym) ymax = ym; + prof[i]->SetMaximum(1.8*ymax); + //prof[i]->SetMaximum(0.02); + prof[i]->SetMinimum(0.0); + + if (prof[i] == nullptr) { + cout<<"ERROR: Input histogram missing "<SetMarkerStyle(20 + i); + prof[i]->SetMarkerColor(icol[i]); + if (first) { + first = false; + prof[i]->Draw("P "); + } else { + prof[i]->Draw("P SAME"); + } + leg.AddEntry(prof[i], name[i], "P"); + leg.Draw(); + d1.Draw(); d1.Update(); + } + + //prof1->SetTitle(";1/Pt (1/GeV); #phi_{0} resolution"); + + d1.Print("plot.pdf"); + cin.get(); + + for (unsigned int i = 1; i <= 6; i++) { + file[i]->Close(); + delete file[i]; + } +} diff --git a/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py b/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py new file mode 100644 index 0000000000000..7572f1fb4ea1b --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py @@ -0,0 +1,214 @@ +################################################################################################ +# To run execute do +# cmsRun tmtt_tf_analysis_cfg.py Events=50 inputMC=Samples/Muons/PU0.txt histFile=outputHistFile.root +# where the arguments take default values if you don't specify them. You can change defaults below. +################################################################################################# + +import FWCore.ParameterSet.Config as cms +import FWCore.Utilities.FileUtils as FileUtils +import FWCore.ParameterSet.VarParsing as VarParsing +import os + +process = cms.Process("Demo") + +GEOMETRY = "D21" + +if GEOMETRY == "D17": + process.load('Configuration.Geometry.GeometryExtended2023D17Reco_cff') + process.load('Configuration.Geometry.GeometryExtended2023D17_cff') +elif GEOMETRY == "D21": + process.load('Configuration.Geometry.GeometryExtended2023D21Reco_cff') + process.load('Configuration.Geometry.GeometryExtended2023D21_cff') +elif GEOMETRY == "D41": + process.load('Configuration.Geometry.GeometryExtended2023D41Reco_cff') + process.load('Configuration.Geometry.GeometryExtended2023D41_cff') +elif GEOMETRY == "D49": + process.load('Configuration.Geometry.GeometryExtended2023D49Reco_cff') + process.load('Configuration.Geometry.GeometryExtended2023D49_cff') + +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '') + +process.load("FWCore.MessageLogger.MessageLogger_cfi") + +options = VarParsing.VarParsing ('analysis') + +def getTxtFile(txtFileName): + return os.environ['CMSSW_BASE']+'/src/L1Trigger/TrackFindingTMTT/test/'+txtFileName + +#--- Specify input MC +if GEOMETRY == "D17": + inputMCtxt = getTxtFile('MCsamples/937/RelVal/TTbar/PU200.txt') +elif GEOMETRY == "D21": + inputMCtxt = getTxtFile('MCsamples/1040/RelVal/TTbar/PU200.txt') +elif GEOMETRY == "D41": + inputMCtxt = getTxtFile('MCsamples/1060/RelVal/TTbar/PU200.txt') +elif GEOMETRY == "D49": + inputMCtxt = getTxtFile('MCsamples/1110/RelVal/TTbar/PU200.txt') + +# Fastest to use a local copy ... +#inputMCtxt = getTxtFile('MCsamples/1040/RelVal/TTbar/localRAL/PU200.txt') + +options.register('inputMC', inputMCtxt, VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "Files to be processed") + +#--- Specify number of events to process. +options.register('Events',100,VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.int,"Number of Events to analyze") + +#--- Specify name of output histogram file. (If name = '', then no histogram file will be produced). +options.register('histFile','Hist.root',VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string,"Name of output histogram file") + +#--- Specify if stubs need to be (re)made, e.g. because they are not available in the input file +options.register('makeStubs',0,VarParsing.VarParsing.multiplicity.singleton,VarParsing.VarParsing.varType.int,"Make stubs, and truth association, on the fly") + +#--- Specify whether to output a GEN-SIM-DIGI-RAW dataset containing the TMTT L1 tracks & associators. +# (Warning: you may need to edit the associator python below to specify which track fitter you are using). +options.register('outputDataset',0,VarParsing.VarParsing.multiplicity.singleton,VarParsing.VarParsing.varType.int,"Create GEN-SIM-DIGI-RAW dataset containing TMTT L1 tracks") + +options.parseArguments() + +#--- input and output + +list = FileUtils.loadListFromFile(options.inputMC) +readFiles = cms.untracked.vstring(*list) +secFiles = cms.untracked.vstring() + +# Override input dataset. +#readFiles = cms.untracked.vstring('/store/user/abhijith/DisplacedMuPlus.root') + +outputHistFile = options.histFile + +process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(False) ) + +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.Events) ) + +if outputHistFile != "": + process.TFileService = cms.Service("TFileService", fileName = cms.string(outputHistFile)) + +process.source = cms.Source ("PoolSource", + fileNames = readFiles, + secondaryFileNames = secFiles, + duplicateCheckMode = cms.untracked.string('noDuplicateCheck'), + # Following needed to read CMSSW 9 datasets with CMSSW 10 + inputCommands = cms.untracked.vstring( + 'keep *_*_*_*', + 'drop l1tEMTFHit2016*_*_*_*', + 'drop l1tEMTFTrack2016*_*_*_*' + ) + ) + +process.Timing = cms.Service("Timing", summaryOnly = cms.untracked.bool(True)) + +#--- Load code that produces our L1 tracks and makes corresponding histograms. +#process.load('L1Trigger.TrackFindingTMTT.TMTrackProducer_cff') + +#--- Alternative cfg including improvements not yet in the firmware. Aimed at L1 trigger studies. +process.load('L1Trigger.TrackFindingTMTT.TMTrackProducer_Ultimate_cff') +# +#--- Optionally override default configuration parameters here (example given of how). + +#process.TMTrackProducer.TrackFitSettings.TrackFitters = cms.vstring( +# "KF5ParamsComb", +# "KF4ParamsComb", +# "KF4ParamsCombHLS" +# ) + +# If the input samples contain stubs and the truth association, then you can just use the following path +process.p = cms.Path(process.TMTrackProducer) + +# Optionally (re)make the stubs on the fly +if options.makeStubs == 1: + process.load('L1Trigger.TrackTrigger.TrackTrigger_cff') + process.load('SimTracker.TrackTriggerAssociation.TrackTriggerAssociator_cff') + process.TTClusterAssociatorFromPixelDigis.digiSimLinks = cms.InputTag("simSiPixelDigis","Tracker") + + LOOSE_STUBS = False + + if (LOOSE_STUBS): + # S.Viret's loose Dec. 2017 stub windows from commented out part of + # L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py in CMSSW 9.3.7 + # Optimised for electrons. + + process.TTStubAlgorithm_official_Phase2TrackerDigi_ = cms.ESProducer("TTStubAlgorithm_official_Phase2TrackerDigi_", + zMatchingPS = cms.bool(True), + zMatching2S = cms.bool(True), + #Number of tilted rings per side in barrel layers (for tilted geom only) + NTiltedRings = cms.vdouble( 0., 12., 12., 12., 0., 0., 0.), + BarrelCut = cms.vdouble( 0, 2.0, 3, 4.5, 6, 6.5, 7.0), + TiltedBarrelCutSet = cms.VPSet( + cms.PSet( TiltedCut = cms.vdouble( 0 ) ), + cms.PSet( TiltedCut = cms.vdouble( 0, 3, 3., 2.5, 3., 3., 2.5, 2.5, 2., 1.5, 1.5, 1, 1) ), + cms.PSet( TiltedCut = cms.vdouble( 0, 4., 4, 4, 4, 4., 4., 4.5, 5, 4., 3.5, 3.5, 3) ), + cms.PSet( TiltedCut = cms.vdouble( 0, 5, 5, 5, 5, 5, 5, 5.5, 5, 5, 5.5, 5.5, 5.5) ), + ), + EndcapCutSet = cms.VPSet( + cms.PSet( EndcapCut = cms.vdouble( 0 ) ), + cms.PSet( EndcapCut = cms.vdouble( 0, 1., 2.5, 2.5, 3.5, 5.5, 5.5, 6, 6.5, 6.5, 6.5, 6.5, 6.5, 6.5, 7, 7) ), + cms.PSet( EndcapCut = cms.vdouble( 0, 0.5, 2.5, 2.5, 3, 5, 6, 6, 6.5, 6.5, 6.5, 6.5, 6.5, 6.5, 7, 7) ), + cms.PSet( EndcapCut = cms.vdouble( 0, 1, 3., 4.5, 6., 6.5, 6.5, 6.5, 7, 7, 7, 7, 7) ), + cms.PSet( EndcapCut = cms.vdouble( 0, 1., 2.5, 3.5, 6., 6.5, 6.5, 6.5, 6.5, 7, 7, 7, 7) ), + cms.PSet( EndcapCut = cms.vdouble( 0, 0.5, 1.5, 3., 4.5, 6.5, 6.5, 7, 7, 7, 7, 7, 7) ), + ) + ) + + else: + # S.Viret's July 2017 stub windows (tight) from commented out part of + # L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py in CMSSW 9.3.2 + + process.TTStubAlgorithm_official_Phase2TrackerDigi_ = cms.ESProducer("TTStubAlgorithm_official_Phase2TrackerDigi_", + zMatchingPS = cms.bool(True), + zMatching2S = cms.bool(True), + #Number of tilted rings per side in barrel layers (for tilted geom only) + NTiltedRings = cms.vdouble( 0., 12., 12., 12., 0., 0., 0.), + BarrelCut = cms.vdouble( 0, 2.0, 2.0, 3.5, 4.5, 5.5, 6.5), #Use 0 as dummy to have direct access using DetId to the correct element + + TiltedBarrelCutSet = cms.VPSet( + cms.PSet( TiltedCut = cms.vdouble( 0 ) ), + cms.PSet( TiltedCut = cms.vdouble( 0, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2., 2., 1.5, 1.5, 1., 1.) ), + cms.PSet( TiltedCut = cms.vdouble( 0, 3., 3., 3., 3., 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2, 2) ), + cms.PSet( TiltedCut = cms.vdouble( 0, 4.5, 4.5, 4, 4, 4, 4, 3.5, 3.5, 3.5, 3, 3, 3) ), + ), + EndcapCutSet = cms.VPSet( + cms.PSet( EndcapCut = cms.vdouble( 0 ) ), + cms.PSet( EndcapCut = cms.vdouble( 0, 1, 1.5, 1.5, 2, 2, 2.5, 3, 3, 3.5, 4, 2.5, 3, 3.5, 4.5, 5.5) ), + cms.PSet( EndcapCut = cms.vdouble( 0, 1, 1.5, 1.5, 2, 2, 2, 2.5, 3, 3, 3, 2, 3, 4, 5, 5.5) ), + cms.PSet( EndcapCut = cms.vdouble( 0, 1.5, 1.5, 2, 2, 2.5, 2.5, 2.5, 3.5, 2.5, 5, 5.5, 6) ), + cms.PSet( EndcapCut = cms.vdouble( 0, 1.0, 1.5, 1.5, 2, 2, 2, 2, 3, 3, 6, 6, 6.5) ), + cms.PSet( EndcapCut = cms.vdouble( 0, 1.0, 1.5, 1.5, 1.5, 2, 2, 2, 3, 3, 6, 6, 6.5) ), + ) + ) + + process.p = cms.Path(process.TrackTriggerClustersStubs * process.TrackTriggerAssociatorClustersStubs * process.TMTrackProducer) + +# Optionally create output GEN-SIM-DIGI-RAW dataset containing TMTT L1 tracks & associators. +if options.outputDataset == 1: + + # Associate TMTT L1 tracks to truth particles + process.load('SimTracker.TrackTriggerAssociation.TrackTriggerAssociator_cff') + process.TTAssociatorTMTT = process.TTTrackAssociatorFromPixelDigis.clone( +# Edit to specify which input L1 track collection to run associator on. + TTTracks = cms.VInputTag(cms.InputTag("TMTrackProducer", 'TML1TracksKF4ParamsComb')) +# TTTracks = cms.VInputTag(cms.InputTag("TMTrackProducer", 'TML1TracksglobalLinearRegression')) + ) + process.pa = cms.Path(process.TTAssociatorTMTT) + + # Write output dataset + process.load('Configuration.EventContent.EventContent_cff') + + process.writeDataset = cms.OutputModule("PoolOutputModule", + splitLevel = cms.untracked.int32(0), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + outputCommands = process.RAWSIMEventContent.outputCommands, + fileName = cms.untracked.string('output_dataset.root'), ## ADAPT IT ## + dataset = cms.untracked.PSet( + filterName = cms.untracked.string(''), + dataTier = cms.untracked.string('GEN-SIM') + ) + ) + # Include TMTT L1 tracks & associators + stubs. + process.writeDataset.outputCommands.append('keep *TTTrack*_*_*_*') + process.writeDataset.outputCommands.append('keep *TTStub*_*_*_*') + + process.pd = cms.EndPath(process.writeDataset) + process.schedule = cms.Schedule(process.p, process.pa, process.pd) From bcbd2e78737c04b358292596c182ddee1056154b Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Thu, 2 Apr 2020 09:45:13 +0100 Subject: [PATCH 02/22] Improved KF efficiency at high eta --- L1Trigger/TrackFindingTMTT/README.md | 2 + .../TrackFindingTMTT/README_SimpleCode.txt | 92 ++--------- .../interface/HLS/KFpragmaOpts.h | 4 +- .../TrackFindingTMTT/interface/L1KalmanComb.h | 5 +- .../TrackFindingTMTT/src/L1KalmanComb.cc | 152 ++++++++++++++---- .../test/tmtt_tf_analysis_cfg.py | 30 ++-- 6 files changed, 149 insertions(+), 136 deletions(-) diff --git a/L1Trigger/TrackFindingTMTT/README.md b/L1Trigger/TrackFindingTMTT/README.md index 797c6d969588b..07bdfc65c96a4 100644 --- a/L1Trigger/TrackFindingTMTT/README.md +++ b/L1Trigger/TrackFindingTMTT/README.md @@ -1,3 +1,5 @@ +# N.B. THE GIT INSTRUCTIONS HERE APPLY TO THE ORIGINAL TMTT GIT REPO, SO SHOULD BE IGNORED IF USING THE HYBRID REPO. + # Setup instructions to just run To checkout and run, or if your modifications won't need to be put into the central repository, do (on an SL7 machine): diff --git a/L1Trigger/TrackFindingTMTT/README_SimpleCode.txt b/L1Trigger/TrackFindingTMTT/README_SimpleCode.txt index e6ebb5003b182..b06551be476fc 100644 --- a/L1Trigger/TrackFindingTMTT/README_SimpleCode.txt +++ b/L1Trigger/TrackFindingTMTT/README_SimpleCode.txt @@ -1,3 +1,5 @@ +# N.B. THE GIT INSTRUCTIONS HERE APPLY TO THE ORIGINAL TMTT GIT REPO, SO SHOULD BE IGNORED IF USING THE HYBRID REPO. THE CODE DOCUMENTATION HERE IS VALID. + ------------------------------------------------------------------------------------- * How to setup the framework and how to run our analysis code: @@ -153,9 +155,6 @@ that produced it, also to the stubs on the track and the associated truth partic It inherits from the pure virutal L1trackBase, ensuring it has some common classes with L1track3D and L1track2D. -12) Class "L1fittedTrk4and5" contains a pair of L1fittedTrack objects, containg the result of doing -either a 4 or 5 parameter helix fit to the track, where the former assumes d0 = 0. - 13) Class "DegradeBend" -- This is used by class "Stub" to degrade the resolution on the stub bend information to that expected in the electronics, as opposed to that currently in CMSSW. @@ -207,84 +206,11 @@ TMTrackProducer.EnableHistos = cms.bool(False) === To run Louise Skinnari's official CMS L1 track performance analysis code === -i) This runs on the TTTrack objects produced by our TMTrackProducer. As the Tracklet group also -produce TTTracks, this performance code can be used by all groups. (N.B. When not comparing our -results with another group, our own tmtt_tf_analysis_cfg.py analysis software described -above is usually more convenient). - -ii) To include the official analysis code in your setup, follow this recipe: - -cmsrel CMSSW_9_3_8 -cd CMSSW_9_3_8/src -cmsenv - -# Checkout the directory containing the ntuple maker analysis code from git. -git cms-merge-topic skinnari:Tracklet_932 - -# Checkout the analysis and plotting scripts from gitlab -git clone https://gitlab.cern.ch/cms-tracker-phase2-backend-development/BE_software/L1TrackTools.git - -# Checkout our private analysis code from git as explained previously. -(see above) - -# Compile -scramv1 b -j8 - -iii) To run it, do: - - cd L1Trigger/TrackFindingTMTT/test/ - cmsRun L1TrackNtupleMaker_cfg.py trkFitAlgo=All - -This runs our TMTrackProducer code, exactly as before, and configured with the same python files. -This will also run the tracklet track finding code. - -The argument trkFitAlgo specifies which track finding algorithms to run. -Possible options are KF4ParamsComb, SimpleLR, Tracklet, All - -KF4ParamsComb : TMTT chain with KF4ParamsComb track fitter (HT+KF+DR) -SimpleLR : TMTT chain with seed filter and SimpleLR track fitter (HT+SF+LR+DR) -Tracklet : Runs the default tracklet tracking from skinnari:Tracklet_93X -All : Runs all three - -Note that you can run KF4ParamsComb chain without the SF and SimpleLR with the SF in the same job. -You can also specify a comma separated list e.g. if you just wanted to run two of the fitters, you -can specify trkFitAlgo=SimpleLR,Tracklet - -It then runs CMS-agreed code to produce an ntuple from these tracks: - - L1Trigger/TrackFindingTracklet/test/L1TrackNtupleMaker.cc - -iv) When the job has finished, you will see a Hist.root file containing all the histograms produced -by our standard analysis TMTrackProducer, plus in addition the ntuples. -There will be one ntuple corresponding to the tracks produced by each track fitter you ran with, -and one ntuple for the tracklet tracks. - -v) To make .png files containing histograms of tracking efficiency, resolution etc., start root & type -the two commands: - .L ../../../L1TrackTools/L1TrackNtuplePlot.C++ - L1TrackNtuplePlot("Hist","_TMTT_KF4ParamsComb") - -Altenartively, you can copy/move your output Hist.root file to the L1TrackTools directory: - mv Hist.root ../../../L1TrackTools/ - cd ../../../L1TrackTools/ - .L L1TrackNtuplePlot.C++ - L1TrackNtuplePlot("Hist","_TMTT_KF4ParamsComb") - -After running, the histograms will be in a root file called "output_Hist_TMTT_KF4ParamsComb.root", -and also saved as pdf/png in the TrkPlots directory (if this directory doesn't exist, you will need -to create it and rerun). - -The arguments of the macro are explained around line 45, and here are some usage examples: - -To produce plots for muons (from the primary interaction), for the KF4ParamsComb fitter: - .L L1TrackNtuplePlot.C++ - L1TrackNtuplePlot("Hist", "_TMTT_KF4ParamsComb", 0, 13 ) - -To produce plots for all TP in jets with pt>100 GeV: - .L L1TrackNtuplePlot.C++ - L1TrackNtuplePlot("Hist", "_TMTT_KF4ParamsComb", 2, 0 ) +(This is an alternative way of running the code, useful for comparing with the Tracklet & Hybrid + L1 track algos, since it guarantees identical tracking performance definitions, but providing + no histograms of performance inside the TMTT chain). -Note that by default the efficiency is defined for TPs with pt>2GeV. To consider pt>3GeV, you need to specify a few more arguments. -e.g. to produce plots for TP with pt>3GeV in jets with pt>100 GeV: - .L L1TrackNtuplePlot.C++ - L1TrackNtuplePlot("Hist", "_TMTT_KF4ParamsComb", 2, 0, 0, false, false, 3 ) +a) cd L1Trigger/TrackFindingTracklet/test/ +b) Edit L1TrackNtupleMaker_cfg.py, changing: L1TRKALGO = 'TMTT' +b) cmsRun L1TrackNtupleMaker_cfg.py +c) ./makeHists.csh (prints tracking performance & adds plots to TrkPlots/ diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h b/L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h index a84dc20441636..bf3f3793bf50a 100644 --- a/L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h +++ b/L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h @@ -9,9 +9,9 @@ // OPTION 1: // If defined, HLS KF will cope with tracking down to 2 GeV Pt instead of 3 GeV. -#define PT_2GEV +//#define PT_2GEV // If defined, HLS assumes hybrid (=tracklet) input format & digitisation multipliers. -#define HYBRID_FORMAT +//#define HYBRID_FORMAT #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h b/L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h index f9ca23561067e..aca1d633c427f 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h @@ -87,13 +87,14 @@ class L1KalmanComb : public TrackFitGeneric{ virtual void calcChi2( const KalmanState &state, double& chi2rphi, double& chi2rz ) const; virtual double getRofState( unsigned layerId, const vector &xa )const{ return 0;} - virtual unsigned int getKalmanLayer(unsigned int iEtaReg, unsigned int layerIDreduced, bool barrel)const; + virtual unsigned int getKalmanLayer(unsigned int iEtaReg, unsigned int layerIDreduced, bool barrel, float r, float z) const; + virtual bool getKalmanAmbiguousLayer(unsigned int iEtaReg, unsigned int kfLayer); std::vector doKF( const L1track3D &l1track3D, const std::vector &stubClusters, const TP *tpa ); void printTPSummary( std::ostream &os, const TP *tp, bool addReturn=true ) const; void printTP( std::ostream &os, const TP *tp ) const; - void printStubLayers( std::ostream &os, std::vector &stubs ) const; + void printStubLayers( std::ostream &os, std::vector &stubs, unsigned int iEtaReg ) const; void printStubCluster( std::ostream &os, const StubCluster * stubCluster, bool addReturn=true ) const; void printStubClusters( std::ostream &os, std::vector &stubClusters ) const; void printStub( std::ostream &os, const Stub * stub, bool addReturn=true ) const; diff --git a/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc b/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc index f3f879e508ef7..56cd7bd154560 100644 --- a/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc +++ b/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc @@ -1,6 +1,6 @@ ///=== This is the base class for the Kalman Combinatorial Filter track fit algorithm. -///=== Written by: S. Summers, K. Uchida, M. Pesaresi +///=== Written by: S. Summers, K. Uchida, M. Pesaresi, I.Tomalin #include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" #include "L1Trigger/TrackFindingTMTT/interface/Utility.h" @@ -85,13 +85,24 @@ void L1KalmanComb::printTP( std::ostream &os, const TP *tp ) const { os << endl; } -void L1KalmanComb::printStubLayers( std::ostream &os, std::vector &stubs ) const { +void L1KalmanComb::printStubLayers( std::ostream &os, std::vector &stubs, unsigned int iEtaReg ) const { if( stubs.size() == 0 ) os << "stub layers = []" << endl; else{ os << "stub layers = [ "; - for( unsigned i=0; ilayerId() << ", "; - os << stubs.back()->layerId() << " ]" << endl; + for( unsigned i=0; ilayerId(); + if (i != stubs.size() - 1) os << ", "; + } + os << " ] "; + os << "KF stub layers = [ "; + for( unsigned j=0; jgetKalmanLayer(iEtaReg, stubs[j]->layerIdReduced(), stubs[j]->barrel(), stubs[j]->r(), stubs[j]->z()); + os << kalmanLayer; + if (j != stubs.size() - 1) os << ", "; + } + os << " ]" << endl; + } } @@ -148,10 +159,9 @@ void L1KalmanComb::printStubs( std::ostream &os, std::vector &stub } } - //=== Get Kalman layer mapping (i.e. layer order in which stubs should be processed) -unsigned int L1KalmanComb::getKalmanLayer(unsigned int iEtaReg, unsigned int layerIDreduced, bool barrel) const { +unsigned int L1KalmanComb::getKalmanLayer(unsigned int iEtaReg, unsigned int layerIDreduced, bool barrel, float r, float z) const { // index across is GP encoded layer ID (where barrel layers=1,2,7,5,4,3 & endcap wheels=3,4,5,6,7 & 0 never occurs) // index down is eta reg @@ -167,16 +177,23 @@ unsigned int L1KalmanComb::getKalmanLayer(unsigned int iEtaReg, unsigned int lay if (nEta != numEtaRegions_) throw cms::Exception("ERROR L1KalmanComb::getKalmanLayer hardwired value of nEta differs from NumEtaRegions cfg param"); + // In cases where identical GP encoded layer ID present in this sector from both barrel & endcap, this array filled considering barrel. The endcap is fixed by subsequent code. + static const unsigned layerMap[nEta/2][nGPlayID+1] = { - { 7, 0, 1, 5, 4, 3, 7, 2 }, - { 7, 0, 1, 5, 4, 3, 7, 2 }, - { 7, 0, 1, 5, 4, 3, 7, 2 }, - { 7, 0, 1, 5, 4, 3, 7, 2 }, - { 7, 0, 1, 5, 4, 3, 7, 2 }, - { 7, 0, 1, 3, 4, 2, 6, 2 }, - { 7, 0, 1, 1, 2, 3, 4, 5 }, - { 7, 0, 7, 1, 2, 3, 4, 5 }, + { 7, 0, 1, 5, 4, 3, 7, 2 }, // B1 B2 B3 B4 B5 B6 + { 7, 0, 1, 5, 4, 3, 7, 2 }, // B1 B2 B3 B4 B5 B6 + { 7, 0, 1, 5, 4, 3, 7, 2 }, // B1 B2 B3 B4 B5 B6 + { 7, 0, 1, 5, 4, 3, 7, 2 }, // B1 B2 B3 B4 B5 B6 + { 7, 0, 1, 5, 4, 3, 7, 2 }, // B1 B2 B3 B4(/D3) B5(/D2) B6(/D1) + + { 7, 0, 1, 3, 4, 2, 6, 2 }, // B1 B2 B3(/D5)+B4(/D3) D1 D2 X D4 -- current FW + //{ 7, 0, 1, 3, 4, 3, 6, 2 }, // B1 B2 B3(/D5) D1+B4(/D3) D2 X D4 -- for use with "Fix cases" below. + + { 7, 0, 1, 1, 2, 3, 4, 5 }, // B1 B2+D1 D2 D3 D5 D6 + + //{ 7, 0, 7, 1, 2, 3, 4, 5 }, // B1 D1 D2 D3 D4 D5 = current FW (or when Ambiguous function used) + { 7, 0, 7, 0, 1, 2, 3, 4 }, // Avoid effi loss for eta > 2.3 when Ambiguous function not used. }; unsigned int kfEtaReg; // KF VHDL eta sector def: small in barrel & large in endcap. @@ -188,31 +205,97 @@ unsigned int L1KalmanComb::getKalmanLayer(unsigned int iEtaReg, unsigned int lay unsigned int kalmanLayer = layerMap[kfEtaReg][layerIDreduced]; - // Fixes to endcap stubs. + // Fixes to endcap stubs, for cases where identical GP encoded layer ID present in this sector from both barrel & endcap. if ( not barrel ) { switch ( kfEtaReg ) { - case 4: + case 4: // B1 B2 B3 B4 B5/D1 B6/D2 D3 if (layerIDreduced==3) kalmanLayer = 4; if (layerIDreduced==4) kalmanLayer = 5; if (layerIDreduced==5) kalmanLayer = 6; break; - case 5: + //case 5: // B1 B2 B3+B4 D1 D2 D3 D4/D5 + case 5: // B1 B2 B3 D1+B4 D2 D3 D4/D5 if (layerIDreduced==5) kalmanLayer = 5; if (layerIDreduced==7) kalmanLayer = 6; break; default: break; - } - + } } + /* + // Fix cases where a barrel layer only partially crosses the eta sector. + // (Logically should work, but actually reduces efficiency). + + const float barrelHalfLength = 120.; + const float barrel4Radius = 68.8; + const float barrel5Radius = 86.1; + + if ( not barrel) { + switch ( kfEtaReg ) { + case 4: + if (layerIDreduced==3) { // D1 + float disk1_rCut = barrel5Radius*(fabs(z)/barrelHalfLength); + if (r > disk1_rCut) kalmanLayer++; + } + break; + case 5: + if (layerIDreduced==3) { // D1 + float disk1_rCut = barrel4Radius*(fabs(z)/barrelHalfLength); + if (r > disk1_rCut) kalmanLayer++; + } + if (layerIDreduced==4) { // D2 + float disk2_rCut = barrel4Radius*(fabs(z)/barrelHalfLength); + if (r > disk2_rCut) kalmanLayer++; + } + break; + default: + break; + } + } + */ + return kalmanLayer; } +//=== Check if particles in given eta sector are uncertain to go through the given KF layer. +//=== (If so, count layer for numbers of hit layers, but not for number of skipped layers). + +bool L1KalmanComb::getKalmanAmbiguousLayer(unsigned int iEtaReg, unsigned int kfLayer) { + + // Only helps in extreme forward sector, and there not significantly. + + /* + const unsigned int nEta = 16; + const unsigned int nKFlayer = 7; + static const bool ambiguityMap[nEta/2][nKFlayer] = + { + {false, false, false, false, false, false, false}, + {false, false, false, false, false, false, false}, + {false, false, false, false, false, false, false}, + {false, false, false, false, false, false, false}, + {false, false, false, false, false, false, false}, + {false, false, false, false, false, false, false}, + {false, false, false, false, false, false, false}, + {true , false, false, false, false, false, false}, + }; + + unsigned int kfEtaReg; // KF VHDL eta sector def: small in barrel & large in endcap. + if (iEtaReg < numEtaRegions_/2) { + kfEtaReg = numEtaRegions_/2 - 1 - iEtaReg; + } else { + kfEtaReg = iEtaReg - numEtaRegions_/2; + } + + bool ambiguous = ambiguityMap[kfEtaReg][kfLayer]; + */ + bool ambiguous = false; + return ambiguous; +} L1KalmanComb::L1KalmanComb(const Settings* settings, const uint nPar, const string &fitterName, const uint nMeas ) : TrackFitGeneric(settings, fitterName ){ nPar_ = nPar; @@ -430,7 +513,7 @@ L1fittedTrack L1KalmanComb::fit(const L1track3D& l1track3D){ <<" nStubs="<index(); @@ -620,7 +704,7 @@ std::vector L1KalmanComb::doKF( const L1track3D& l1track3D, for( auto stubCluster : stubClusters ){ // Get Kalman encoded layer ID for this stub. - int kalmanLayer = this->getKalmanLayer(etaReg, stubCluster->layerIdReduced(), stubCluster->barrel()); + int kalmanLayer = this->getKalmanLayer(etaReg, stubCluster->layerIdReduced(), stubCluster->barrel(), stubCluster->r(), stubCluster->z()); if (kalmanLayer != 7) { const_cast(stubCluster)->setLayerKF(kalmanLayer); // Ugly trick to store KF layer inside stub cluster. @@ -648,7 +732,6 @@ std::vector L1KalmanComb::doKF( const L1track3D& l1track3D, const KalmanState *the_state = *i_state; - unsigned int layer = the_state->nextLayer(); unsigned skipped = the_state->nSkippedLayers(); @@ -657,10 +740,15 @@ std::vector L1KalmanComb::doKF( const L1track3D& l1track3D, // However, if there are stubs in this layer, then don't skip (e.g. our phi/eta boundaries might not line up exactly with a dead region) // Continue to skip until you reach a functioning layer (or a layer with stubs) unsigned nSkippedDeadLayers = 0; + unsigned nSkippedAmbiguousLayers = 0; while ( kalmanDeadLayers.find(layer) != kalmanDeadLayers.end() && layerStubs[layer].size() == 0 ) { layer += 1; ++nSkippedDeadLayers; } + while ( this->getKalmanAmbiguousLayer(etaReg, layer) && layerStubs[layer].size() == 0 ) { + layer += 1; + ++nSkippedAmbiguousLayers; + } // containers for updated state+stub combinations std::vector next_states; @@ -676,12 +764,16 @@ std::vector L1KalmanComb::doKF( const L1track3D& l1track3D, // If the next layer (layer+1) is a dead layer, then proceed to the layer after next (layer+2), if possible // Also note if we need to increase "skipped" by one more for these states unsigned nSkippedDeadLayers_nextStubs = 0; + unsigned nSkippedAmbiguousLayers_nextStubs = 0; if ( skipped < kalmanMaxSkipLayers ) { if ( kalmanDeadLayers.find(layer+1) != kalmanDeadLayers.end() && layerStubs[layer+1].size() == 0 ) { next_stubs = layerStubs[layer+2]; - nSkippedDeadLayers_nextStubs += 1; - } else { - next_stubs = layerStubs[layer+1]; + nSkippedDeadLayers_nextStubs++; + } else if ( this->getKalmanAmbiguousLayer(etaReg, layer) && layerStubs[layer+1].size() == 0 ) { + next_stubs = layerStubs[layer+2]; + nSkippedAmbiguousLayers_nextStubs++; + } else { + next_stubs = layerStubs[layer+1]; } } @@ -691,6 +783,7 @@ std::vector L1KalmanComb::doKF( const L1track3D& l1track3D, // If we skipped over a dead layer, only increment "skipped" after the stubs in next+1 layer have been obtained skipped += nSkippedDeadLayers; + skipped += nSkippedAmbiguousLayers; // check to guarantee no fewer than 2PS hits per state at iteration 1 (r<60cm) // iteration 0 will always include a PS hit, but iteration 1 could use 2S hits unless we include this @@ -706,7 +799,6 @@ std::vector L1KalmanComb::doKF( const L1track3D& l1track3D, stubs = temp_stubs; next_stubs = temp_nextstubs; } - combinations_per_iteration += stubs.size() + next_stubs.size(); @@ -730,7 +822,7 @@ std::vector L1KalmanComb::doKF( const L1track3D& l1track3D, const StubCluster * next_stubCluster = next_stubs[i]; - const KalmanState * new_state = kalmanUpdate( skipped+1+nSkippedDeadLayers_nextStubs, layer+2+nSkippedDeadLayers_nextStubs, next_stubCluster, *the_state, tpa ); + const KalmanState * new_state = kalmanUpdate( skipped+1+nSkippedDeadLayers_nextStubs+nSkippedAmbiguousLayers_nextStubs, layer+2+nSkippedDeadLayers_nextStubs+nSkippedAmbiguousLayers_nextStubs, next_stubCluster, *the_state, tpa ); if( getSettings()->kalmanFillInternalHists() ) fillStepHists( tpa, iteration, new_state ); @@ -1659,7 +1751,9 @@ set L1KalmanComb::getKalmanDeadLayers( bool& remove2PSCut ) const { for ( const auto& p : deadLayers ) { unsigned int layer = p.first; bool barrel = p.second; - unsigned int kalmanLayer = this->getKalmanLayer(iCurrentEtaReg_, layer, barrel); + float r = 0.; // This fails for r-dependent parts of getKalmanLayer(). FIX + float z = 999.; + unsigned int kalmanLayer = this->getKalmanLayer(iCurrentEtaReg_, layer, barrel, r, z); kalmanDeadLayers.insert( kalmanLayer ); } diff --git a/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py b/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py index 7572f1fb4ea1b..f72ce0ac5941b 100644 --- a/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py +++ b/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py @@ -11,20 +11,14 @@ process = cms.Process("Demo") -GEOMETRY = "D21" - -if GEOMETRY == "D17": - process.load('Configuration.Geometry.GeometryExtended2023D17Reco_cff') - process.load('Configuration.Geometry.GeometryExtended2023D17_cff') -elif GEOMETRY == "D21": - process.load('Configuration.Geometry.GeometryExtended2023D21Reco_cff') - process.load('Configuration.Geometry.GeometryExtended2023D21_cff') -elif GEOMETRY == "D41": - process.load('Configuration.Geometry.GeometryExtended2023D41Reco_cff') - process.load('Configuration.Geometry.GeometryExtended2023D41_cff') +GEOMETRY = "D49" + +if GEOMETRY == "D41": + process.load('Configuration.Geometry.GeometryExtended2026D41Reco_cff') + process.load('Configuration.Geometry.GeometryExtended2026D41_cff') elif GEOMETRY == "D49": - process.load('Configuration.Geometry.GeometryExtended2023D49Reco_cff') - process.load('Configuration.Geometry.GeometryExtended2023D49_cff') + process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff') + process.load('Configuration.Geometry.GeometryExtended2026D49_cff') process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') @@ -36,20 +30,16 @@ options = VarParsing.VarParsing ('analysis') def getTxtFile(txtFileName): - return os.environ['CMSSW_BASE']+'/src/L1Trigger/TrackFindingTMTT/test/'+txtFileName + return os.environ['CMSSW_BASE']+'/src/L1Trigger/TrackFindingTMTT/data/'+txtFileName #--- Specify input MC -if GEOMETRY == "D17": - inputMCtxt = getTxtFile('MCsamples/937/RelVal/TTbar/PU200.txt') -elif GEOMETRY == "D21": - inputMCtxt = getTxtFile('MCsamples/1040/RelVal/TTbar/PU200.txt') -elif GEOMETRY == "D41": +if GEOMETRY == "D41": inputMCtxt = getTxtFile('MCsamples/1060/RelVal/TTbar/PU200.txt') elif GEOMETRY == "D49": inputMCtxt = getTxtFile('MCsamples/1110/RelVal/TTbar/PU200.txt') # Fastest to use a local copy ... -#inputMCtxt = getTxtFile('MCsamples/1040/RelVal/TTbar/localRAL/PU200.txt') +#inputMCtxt = getTxtFile('MCsamples/1110/RelVal/TTbar/localRAL/PU200.txt') options.register('inputMC', inputMCtxt, VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "Files to be processed") From c126c171d18a37886b304fa488945146c9f4ab86 Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Thu, 2 Apr 2020 09:46:03 +0100 Subject: [PATCH 03/22] Moved MC data files to cms-data --- .../test/MCsamples/1040/README | 7 - .../RelVal/DisplacedSingleMuPt1p5to8/PU0.txt | 50 ---- .../RelVal/DisplacedSingleMuPt2to100/PU0.txt | 50 ---- .../MCsamples/1040/RelVal/OnlyPU/PU200.txt | 179 ------------ .../1040/RelVal/SingleElPt1p5to8/PU0.txt | 50 ---- .../1040/RelVal/SingleElPt2to100/PU0.txt | 50 ---- .../1040/RelVal/SingleMuPt1p5to8/PU0.txt | 49 ---- .../1040/RelVal/SingleMuPt2to100/PU0.txt | 50 ---- .../test/MCsamples/1040/RelVal/TTbar/PU0.txt | 11 - .../MCsamples/1040/RelVal/TTbar/PU140.txt | 90 ------- .../MCsamples/1040/RelVal/TTbar/PU200.txt | 100 ------- .../1040/RelVal/TTbar/localRAL/PU200.txt | 74 ----- .../test/MCsamples/1060/README | 7 - .../1060/RelVal/SingleElPt1p5to8/PU0.txt | 4 - .../1060/RelVal/SingleElPt2to100/PU0.txt | 5 - .../1060/RelVal/SingleMuPt1p5to8/PU0.txt | 4 - .../1060/RelVal/SingleMuPt2to100/PU0.txt | 4 - .../test/MCsamples/1060/RelVal/TTbar/PU0.txt | 10 - .../MCsamples/1060/RelVal/TTbar/PU140.txt | 90 ------- .../MCsamples/1060/RelVal/TTbar/PU200.txt | 90 ------- .../test/MCsamples/1110/README | 7 - .../RelVal/DisplacedSingleMuPt2to100/PU0.txt | 50 ---- .../1110/RelVal/SingleElPt1p5to8/PU0.txt | 50 ---- .../1110/RelVal/SingleElPt2to100/PU0.txt | 51 ---- .../1110/RelVal/SingleMuPt1p5to8/PU0.txt | 50 ---- .../1110/RelVal/SingleMuPt2to100/PU0.txt | 50 ---- .../test/MCsamples/1110/RelVal/TTbar/PU0.txt | 10 - .../MCsamples/1110/RelVal/TTbar/PU200.txt | 100 ------- .../test/MCsamples/937/README | 7 - .../MCsamples/937/RelVal/OnlyPU/PU200.txt | 255 ------------------ .../937/RelVal/SingleElPt1p5to8/PU0.txt | 50 ---- .../937/RelVal/SingleElPt2to100/PU0.txt | 100 ------- .../937/RelVal/SingleMuPt1p5to8/PU0.txt | 50 ---- .../937/RelVal/SingleMuPt2to100/PU0.txt | 52 ---- .../test/MCsamples/937/RelVal/TTbar/PU0.txt | 10 - .../test/MCsamples/937/RelVal/TTbar/PU140.txt | 90 ------- .../test/MCsamples/937/RelVal/TTbar/PU200.txt | 90 ------- .../test/MCsamples/937/RelVal/TTbar/PU250.txt | 90 ------- .../test/MCsamples/937/RelVal/TTbar/PU300.txt | 90 ------- .../937/RelVal/TTbar/localRAL/PU200.txt | 44 --- 40 files changed, 2270 deletions(-) delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/README delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/DisplacedSingleMuPt1p5to8/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/DisplacedSingleMuPt2to100/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/OnlyPU/PU200.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleElPt1p5to8/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleElPt2to100/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleMuPt1p5to8/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleMuPt2to100/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU140.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU200.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/localRAL/PU200.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1060/README delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleElPt1p5to8/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleElPt2to100/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleMuPt1p5to8/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleMuPt2to100/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU140.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU200.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1110/README delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/DisplacedSingleMuPt2to100/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleElPt1p5to8/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleElPt2to100/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleMuPt1p5to8/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleMuPt2to100/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/TTbar/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/TTbar/PU200.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/README delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/OnlyPU/PU200.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleElPt1p5to8/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleElPt2to100/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleMuPt1p5to8/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleMuPt2to100/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU0.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU140.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU200.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU250.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU300.txt delete mode 100644 L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/localRAL/PU200.txt diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/README b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/README deleted file mode 100644 index a2b8874452572..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/README +++ /dev/null @@ -1,7 +0,0 @@ -RelVal/ contains CMSSW 10.4.0 RelVal samples requested by the P2 L1 trigger group. - -They use the D21 = T6 geometry. - -They are made with the stub window sizes that you can find in L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py . - -Typical dataset name /RelVal*/CMSSW_10_4_0*upgrade2023*D21*/GEN-SIM-DIGI-RAW diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/DisplacedSingleMuPt1p5to8/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/DisplacedSingleMuPt1p5to8/PU0.txt deleted file mode 100644 index 808895461d5f3..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/DisplacedSingleMuPt1p5to8/PU0.txt +++ /dev/null @@ -1,50 +0,0 @@ -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/2B08B59B-FC39-A346-B6DA-60BE26BE27F7.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/2AC16628-2562-5444-A0D4-46549E0BF56A.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/276ED465-CE58-EA4C-8232-B3FC5158A133.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/24016857-D22C-7F4D-86DF-30BD658D0D1D.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/1DC78EEB-2867-C24E-9EE4-478F8939CAA6.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/1A66E81D-DDE1-284F-B710-9C78FD2992E7.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/1A322DDA-8177-BA41-8CAD-E7408B09BB29.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/194E9152-3126-D149-90A4-97A018D38EC3.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/117CCFF9-DA1E-374B-8626-35C89D91C4E7.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/0F10EEAA-3978-7540-A6DB-6ADCAC483246.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/0C9655CC-AF30-2E46-AA50-F44E964092CD.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/071EB771-3316-DE4C-8AF7-B41BDDD2EC6C.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/06E525ED-38A8-FD47-A176-E44DF738A763.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/03D7D282-2ADC-6141-B376-74B24DF2FF61.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/FB90FEA7-43C8-C449-B5B7-1BE31F6E6CFA.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F5BCC588-7F2D-3142-8B71-22BE4C009EA6.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F221C75F-F6FF-9344-9D04-107DDDDBEBA7.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/ED8191DC-4AEA-8647-8EB8-876A3C9611ED.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E9836F0C-0D3C-1B41-A552-5CFF0E31A801.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E687135B-D7E4-1B42-BB7B-BC41DDD4E1A2.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E3B687CA-16F0-914F-A583-448FFBD18594.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E31DF841-5F8B-7943-ADEC-9D770E69B940.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/DB5207A7-ADE2-5245-B041-A3CBB651C2D5.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D3EB0073-CCED-194E-99CA-2C66F07F0E91.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/CCA116FB-DFD7-CE49-BCA2-FF3827AD6B19.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/CA78BFFC-1C8F-0D4C-8703-6E55F29E8DC7.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C58335C7-D9EB-7041-B10B-266522D3A437.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C33CC523-7E13-A24B-8521-15AEB143F510.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C1376A68-2852-B242-9F77-45230B930A4A.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/BB503F31-E202-DE4D-A402-8EC014BE1159.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B4E0E143-18BF-2544-9E2A-E38578A08765.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9D7BA410-6E16-C14E-9A02-EB0AE03FC467.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9BD540DA-132F-F148-815E-7456D2830AF8.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9B2A9F05-9643-9E48-95A0-790CCCAF7E5D.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9764E8CB-DF3F-5F4C-B2DA-1FBAA69194BE.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/867F04B7-8177-1444-BD08-5171AA14D107.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/85A3147E-8BF6-704B-AAD4-240A8B620A1A.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/701C3870-971D-7B4F-8641-1B0C112F6FD4.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/67A0F05F-8A20-B14D-A4B5-F7A516C7A44E.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/61F0D562-D5D6-D042-BD08-E42AAA50066D.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/615E9805-679F-6344-BD7B-E851CEA6CA04.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/558C789D-BE9B-9542-9B38-088335FF396C.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/547976A6-3516-034D-B293-87D23F49E319.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/5460216E-590D-5A42-BECD-06F5B7F9BC19.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/524E3C86-908A-7C43-ADBF-B720E7D18500.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/514FF9C7-8FE4-FD40-A8A0-B7112A5EF9B0.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4E403DEC-13DD-5E47-BDCC-A9E834F0F053.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/45512F39-AF56-6645-BF02-47232A3CEDE0.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/3F27EFB7-4F56-6042-8B83-C07FA2BA2806.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_1p5to8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/3A56DA1B-3872-FF42-94C6-3212ABBA050F.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/DisplacedSingleMuPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/DisplacedSingleMuPt2to100/PU0.txt deleted file mode 100644 index c14936ee34820..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/DisplacedSingleMuPt2to100/PU0.txt +++ /dev/null @@ -1,50 +0,0 @@ -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/FC59ABB5-7DBC-BD49-8813-8DD86B6AABD5.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F94D7475-4B54-174D-B9B8-DB97A4493253.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F808C825-C981-664F-8537-866DF1EA1D4F.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/ECFEC7F5-C7FE-364F-A850-11F391FA8FFC.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E65D1521-485C-2749-A27C-37FF540DA463.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E5282659-D069-A446-BE74-47536E1F58DC.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E2E44FEA-CF82-244C-B7F5-51A33EA508A1.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/DF6F3639-6143-0040-BA9F-5D666F2B3E4C.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/DA158699-D050-9D4D-BA1E-D30C14C7E53E.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D4F43B02-86D4-5E47-B061-470FDE5B73AD.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D11319E6-D54E-3848-8B31-CDABEE4964E7.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/CB84F507-3E9C-C34D-A416-900C372FF1E1.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C478852A-ACFC-8046-BE10-45F547A72E98.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/BB7941FE-C1AB-C14C-B008-AADD69878221.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B9E890F6-EF98-234D-A47C-24FD3B21E28B.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B70EAA2D-80D3-944D-9768-76DC6E4A6985.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B49E0617-D553-9941-8520-FC5609566DDE.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/ADF1B820-DC36-4B4A-A955-92223799B6D9.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A2A802D4-1A8C-CA4C-8B22-8283C4CA0EBC.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A08D4FE1-9572-7740-A13D-7A34E2D08FFC.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A0222C3F-E741-B44A-8F77-C7F0CF770D9A.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9D7DDF14-B94A-F446-B2BE-111A71FC791A.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/94993B71-ACB5-A24E-98F2-30F8C4AA5EAF.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/913DE5AD-A490-C040-9502-F08E939C30F6.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/85A124BA-3971-A340-8500-652DA0C5546C.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/8469B740-E051-F445-97D6-133166CFB609.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7CA41071-A8D7-2143-B41D-397552D887B3.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6DA18E7E-FF2F-D945-9564-112F6A073977.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6C7ACAB1-837E-6149-8287-37ED1D5B4AC5.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6BA0D84C-0BF7-2445-A100-2A75904EDBA0.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/64EB6154-E55F-A042-84D4-AC40B69F212B.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/63783F66-75A7-A24F-A8E3-22DB2CF25E97.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/5CAB253D-8597-494E-81ED-AE2CBE65567B.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/5A7B98AB-BDA0-EF40-89DA-11A750387DF7.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/567AF1B0-8B01-0741-83CE-4D7351617F1C.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/54FE95A7-FD15-E040-B65A-0670C859FE6D.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/536C7147-0495-5549-B483-4E781486AB1D.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4EB4A7A1-EED4-7848-AD0D-8FB7143C7D9C.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4097BE1B-FF65-DE47-80E0-01D281E0B91E.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/363FB61A-3F7C-9249-8032-D92B0D6EAD4D.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/31AB927B-8D9C-094C-9294-1069E3D19D43.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/2CA8B429-3122-F449-ABFB-A654C01A4279.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/2C346C63-F6AC-6448-8559-E0487F7CB7F9.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/2B11DAA7-EDCB-FB4B-960F-37993BB99517.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/1F46406F-D4BE-4C48-B6CE-096941EBED1F.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/11681F63-E923-1D43-8C1D-699E8F56F950.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/088F004F-158D-DB45-93EF-7F1881D5FD32.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/0669219C-FD1C-714C-BC12-DD206FAFB677.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/061949E5-0B4F-E54A-8CB7-B5496676D8E6.root -/store/relval/CMSSW_10_4_0_pre2/RelValDisplacedMu_Pt_2to100/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/043E854F-870C-304E-B630-809A36D64306.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/OnlyPU/PU200.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/OnlyPU/PU200.txt deleted file mode 100644 index aab9aa0c2d7f4..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/OnlyPU/PU200.txt +++ /dev/null @@ -1,179 +0,0 @@ -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5726AB33-943F-4347-988B-FC7639CF95FF.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/56854661-7D4B-EA4B-9FB2-41515A8B86BC.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/54B95020-149F-BF47-A593-0DF78B2CEFB2.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5491C7F6-73FB-6F40-B4C8-05A4257199D9.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5412760D-2A44-CF4A-9CB4-F6232834068E.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/52CFC734-F836-BE42-AE61-2B917CFD9DC3.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/522A896D-DAF9-C140-8E1E-B240D3FAA792.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/51E83C0D-B5D8-7545-B2C8-D7E2DB5E3F92.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/4FB19C80-D7DC-CD4E-AB7E-0509963DE19A.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/4C775694-58D7-194A-9EE8-D77F57774AF8.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/481FDEA2-FA46-B04A-8E44-2798433C0BBC.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/47233DAD-EAAE-444B-82AE-4E73CBE04E5E.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/4664A420-3C31-DC45-A437-E0F5E8A4C109.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/43A52F06-67B5-2A4E-848D-0ABD2D7C02B9.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/42C73522-74A3-8648-A137-570E2D98D4EF.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/41030220-4832-674A-ADEA-E89BD7D7DEEB.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/3E41F06B-F8C3-3C45-AA9D-8A289294107C.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/3DDE3DE5-682E-2D49-B1C7-4A569A5C10C5.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/3C1B5618-1A46-3C4A-BD75-2232C78AC23E.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/3AF6EEA7-4245-C347-AACC-9D65686BFCAA.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/34E20553-DB93-E740-974D-13F9BD73D58C.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/349B02BA-5BBB-E248-97B6-454C668FB43E.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/3432BE05-459C-6743-B559-887CB2BE9650.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/318620BF-E9A8-5C42-B81F-3EFA3A1922F1.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/315BD2DF-EC0F-6040-BA98-A15385150F44.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/2ECB34E4-FDD4-B245-A2A8-7799B109EFF9.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/2DE0237D-8299-1A40-B840-A8D29073AFC3.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/2CBA376C-06F0-0F4A-8A12-F197E5FCE709.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/2B0A7FD8-2915-C846-A148-A86F1A3A7F93.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/29DFAF60-8942-DC43-90A8-D4C9C1A2CD06.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/28F839A1-A8DF-CD40-B727-DCAF9E5F34D9.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/283E5EAC-166D-9844-9D1A-A3B412BCD706.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/27D40F9C-8C30-2F47-85E4-AE53CE428909.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/24C4C5F7-59FF-274D-B02B-60B53D484C4F.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/22167B8B-B98F-4742-A2C7-90F043CE5E37.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/21808F47-5D2A-DC46-8BEC-3D5634315230.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/209FEAA6-7ED3-FD40-BE90-332219CCB14D.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1FB01AD5-E2BB-AB45-8AAC-7EAAF868A390.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1F06D25D-E70B-0146-A582-613423D3FB42.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1EB8E2CE-B139-BE4E-800A-98EDFD0C5ECA.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/FFED59B0-EE4A-1F45-8811-CC7EA23B1C61.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/FEFA9E9E-6E23-5B4A-B1DD-C48AF7AD76DA.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/F777C2BB-D4D0-C342-9AA1-F49632F71BA8.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/F674F7E8-C34F-4F4C-B199-CEF90B187A9D.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/F5A80FC4-6744-514E-B587-A6138E4DC3F1.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/F44A2095-45EB-1E4E-8DD4-2B53B14938B3.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/F2D8D0A6-DFC8-E24F-9416-357E50E2D201.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/F09B3AD5-5F32-8C4E-AEFB-0C0ACBAFF8A8.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/EFBA0033-F1C6-E34C-947A-D290B3ADCCD4.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/EEC19556-2AB0-6B4A-9CB9-F20665E67099.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/EC9A9B76-F8A9-5449-A336-F3B843BE6320.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/EB8456B9-88CA-4346-B312-3DA2CD830552.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/EB604DBF-939A-0C44-92A0-73702A0CDACE.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/EB13B700-2929-374F-9076-E7B4C4F6C756.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/E4D69ED8-9DF2-864B-8064-DB35990DE75A.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/E4AEB845-77A8-274A-A849-CEE9945C2752.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/E3F1D6E7-C55B-754A-A895-50AE1386EDEE.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/E305A6C9-C5F1-4F4B-AF87-8A9FFDFC4589.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1DEA046F-5B58-044C-B1FA-5CACBDB90701.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1DAE1F5B-4619-934B-8AE5-7FF420C8C079.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1D00A049-FBE1-8B4D-A8DC-8B4F9DC35E7E.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1C972148-85D0-2146-A307-F7A65C7AB0C4.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1BBAE93E-C68D-FB4C-A310-91C7EBA46A86.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1B5F2D9B-D37D-8A4A-A6C8-E9B5CB4F1E5A.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1A5A7440-9338-7542-BAB6-D63EFB6AA402.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/178C8BFD-FCF3-B449-A7EC-1900A483D799.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/161A7EB7-FCDA-AC47-B01F-D4FB58941E5F.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/150EAFC9-E9F1-454E-8E8C-6043FC460100.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/150DCCF8-0ECA-F843-A40C-0318718D3C89.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/13BAEB21-524D-D441-8C5A-70DC0976343D.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/121590ED-995A-844B-B9C4-2BFC75D08FDB.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/11386F3A-41B1-A34B-83D3-5EEA81EB145E.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/10A7D496-25AF-1B4C-B294-992FED90A4F4.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0F3C1AA8-C098-334A-9620-C7AB7201C139.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0D3DB4C9-32F4-AF42-8517-24EED61F83EE.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0A614D06-EC19-8843-9BC3-FD5A602CD9F0.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0A5D1CA3-690C-CC40-B0BB-196F7A946DCA.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/07B5C463-E76E-A54E-BA6C-01F7B06C1841.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/04906F11-2AAC-F44C-B1EE-14973E7BC7B0.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/03BEDD2A-EF7D-4E4A-9CB7-620A80C58C7F.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/01FAC2BC-95CE-6647-A889-05595CE317A5.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/005FA6D6-05C9-3244-9B46-DCA48630E32F.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5B541F71-9452-C443-90A0-7504761F4141.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/58B8BA39-05B0-A54C-80DA-AA62784B5AB8.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/58915962-42FC-1B48-843D-A876B4C935C2.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/586E7477-C9F2-0F4E-ABBA-7949247E05EE.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5855D838-D99C-BD4D-A862-3448F181F4BB.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/58187043-581D-9F42-A883-8F9278FC6B63.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5C1E4149-C7FB-3942-8523-16A9BE4ABE11.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5B66A6F0-6133-334E-BF6C-0B9371653E32.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/E05F9A21-D32F-8A40-A20D-FDC4F82CAF18.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/DFD4A9AB-5327-1E4D-8E4A-503D0152C57B.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/DE805FF0-922F-0745-9DAA-89371985E887.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/DE23B3C2-877B-DB41-9CCA-9234767FC9CD.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/DCEFF0AF-FBC2-0647-B045-50715733599B.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/DC3C6143-F994-394D-98BE-69DC1F653F24.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/DA932F03-BBB2-1745-8D09-0B50745D66B1.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/D8CB0406-31A2-A542-A3CB-485FD5D15BF2.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/D8799812-7275-1647-ACD8-5457D74F997B.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/D72E61AB-89F2-6A41-92F9-278EE5DD973D.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/D566B71C-5258-1F4F-A5F2-FB4A1A116297.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/D0AE34B5-9B54-3E43-AB9D-408C115D4646.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CF11170A-C40E-9E49-971B-79E085A9510A.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CE46463E-2CAE-9A49-B6BC-3B2CDD6068F9.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CDEBDF93-8C63-A34E-8C95-C3FFBCD4EFE0.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CDCABBE3-A468-A749-A866-B40D60470373.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CD01E2C0-2503-E841-AA9D-48B1CB05DD72.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CA60C2F6-D7FD-4047-A3E7-E43C722EDDCC.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C5A3A198-CE16-474D-81CC-509328D76976.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C34A917C-2BA2-CD43-B2A5-43D7973FC78E.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C2A92EA2-DA6E-CB4A-8975-B0151AFCC8B6.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C2898E3F-F469-C545-8CB5-9E047CF52390.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C022A8EE-0873-8449-A8E2-1EB5915CCB8E.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/BFFFC3CD-A623-CD48-845D-DA9A479568F3.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/BFF15079-AB46-9540-B4EC-00624D1A9E54.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/BFABA9A6-67A4-5943-99CA-B4F7579AECD8.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/BF8ABFE4-8D5D-0948-8EF5-F806FE55DECC.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/BD0F7BB4-EC86-BD4F-A84A-528A0A9F866C.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/BB3102C3-43F8-8844-86BD-EEE8FBCBFCB8.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B9B666D4-91D8-C342-927C-7D426E3C05EE.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B53B3350-1022-E945-9AE0-3D8C365D6245.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B4D02C4E-8EC9-0446-9908-42F1455046B0.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B3F4C6B1-26FD-C944-B578-C0B40BF9922C.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B2CB6E13-78B9-3145-BB85-25AE2215DEF0.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B245FC4A-5B7E-E043-AC77-5FF65B0FF1A9.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B13125C2-498C-C84D-92F3-BD6B138D7163.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/AC0D16F9-4A35-7A41-9181-30AC2A4A1343.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/A695CB87-A694-DF44-B40B-07BB8F242EF1.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/A4A698ED-AEC1-9241-B57D-6D195FAD23EB.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/A3CF060F-E92B-9C46-A1DD-01155011617B.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/A30CE693-1AF3-154E-9ADA-B7DE22C26B58.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/A2160289-E780-4044-86BD-0CC2DFCDBF9A.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9FD2652A-F6F2-F34A-A528-EC45F7927E28.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9D7A3398-293F-4643-A590-7185FBF31912.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9D078A8A-815B-8147-BF51-54E185413DE2.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9A91C278-E4B6-4E4D-8D49-D3E0F3D2E246.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/98C35E02-9129-9042-A624-DB2CFE53E394.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/97DB3A19-6D18-5C49-8905-0A0E93747ADC.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9400A38C-05BF-8248-B34D-2B5E48A03779.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9087C285-0186-BF4F-895F-E6B272A1CA9A.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8FEE0CD6-B45D-0949-B117-09728E2FD16F.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8F511B11-B53B-9F42-9372-B2AB1B0DD867.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8EF1466D-B2EA-A649-B058-5E20755AE0AC.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8CD00BF0-5572-154A-9420-FD7917F4C6C7.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8CCF881E-F3DE-7947-9703-743EB58C57B7.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8AE3C14F-EB99-F345-BD0E-99E1686EEC77.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8916F82D-1A95-DE42-A11B-9A41701BC57C.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/88CCCF45-5C51-704C-AF8D-54D77073D6CC.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/86375387-6DF5-8249-9B91-5B4E9061268A.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/85BD9000-5CD4-5B40-A1DB-4C20C06ACCC1.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/842F1E88-17FB-FD45-86CC-228F1AFD78ED.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8178B21A-F5DA-7343-89B0-F96ABE6C7D14.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/816B607F-C682-0D4A-89E0-33DD84AC1359.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/7FEF1B0E-CF1B-6D4F-9592-8832C6C0215E.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/7F79ECE9-511E-5844-B5F2-1592AD6E6CEC.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/7F2180CE-4BEB-2C4E-A450-452E646FCEB4.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/7E1E4B7A-2DB6-4F42-8C7E-38BC13B11C51.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/7D12C55E-3847-2A47-A3E5-C3A2E68EAC67.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/7BC72C74-EA82-6343-A437-C2C54E675B20.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/7B9E6B8D-07BD-F540-9CEC-35318E927781.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/79E20705-1C9B-084F-A713-94819704940C.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/71A9D6FC-02EA-5341-82A1-9B823C9BD0D2.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/706A3002-4E25-D743-A1FA-50621E8317FA.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/6F3A5B45-7A43-BD41-B1B4-D7C1C186B7DD.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/6EEACEC3-5B02-C840-8709-00920B87C451.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/6C4F4F3E-0729-8843-A95F-9E0BACAEF1C8.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/6C3842D2-F6E3-AF49-A962-2EB5AA45A06F.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/693CAFC2-F071-9E4D-A769-7B398128AA5C.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/691E641A-4589-8443-B34A-7DC1ED4384CC.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/66E089C6-D478-474C-A501-1D1595BD6ED1.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/66D5F7AD-954B-CB4F-A62D-F66D495B3E31.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/659FAC2C-128F-6F4B-9E18-012E905DFB8F.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/64A557FD-9C57-9444-9D33-B30B86B55F5E.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/6466B79C-1421-734A-B68F-4F944618B168.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/641DDCE6-199F-EB4B-A19D-76694DC7AC4C.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/634D1027-37EE-5A4B-83F5-3539928AA83C.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/621F3777-3823-CB43-B612-1FEDBC14AF90.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/62136985-CCD8-F84C-B904-0F4FD43A9AEB.root -/store/relval/CMSSW_10_4_0_pre2/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/61F57B0D-106D-4A44-8274-40B260962F77.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleElPt1p5to8/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleElPt1p5to8/PU0.txt deleted file mode 100644 index cab9105087b20..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleElPt1p5to8/PU0.txt +++ /dev/null @@ -1,50 +0,0 @@ -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/FF23CE0A-A8CB-484F-9C45-107877940D7A.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F3CE70E8-EE88-CB40-B21A-FDFD2D51CAB2.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/EED29E4A-CD26-1F4E-80AB-A978F70E218E.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/EB3056C0-2A69-4848-8C5D-46ECB46B6A57.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E73297F9-DCE6-1441-92A8-78E7DC99FA04.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E67DEBC7-4165-1B4E-9B24-C5FE74BEA2FC.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E3BC8F02-D202-2C4C-8698-D047DAF82324.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E106AAC5-E8A7-0846-ADFA-DB1D90A9D4E6.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D65A11B7-DDDF-2345-8010-317ADCDE3267.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D5AF2769-BDCE-1D4F-BC33-0FD0B95A5592.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D49E01C0-172D-C94F-9367-44A81D074262.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D3BF4E57-3307-2B45-8270-9FA42B549FC3.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D06D43C8-4990-8A4E-9FE5-4A2255F32354.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/CE88A14C-ED3E-4F4F-8AF5-956C9040E674.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/BE1CB7AC-DFA2-BE43-B7B1-90A610A4C455.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B9ADBEE8-26FF-0D46-8849-54B1BD8A1B22.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B0960191-6981-7D41-BD30-DF9EA73958E1.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/ADE0C7D9-3F5E-0D48-AB86-580D9C5C1D5F.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/ADA18496-FE4C-404B-B907-8DB399C9868C.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A51FA22D-A7D8-B649-9F94-3A7AABF5FE05.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A06E76A0-C647-BB45-8AFE-28E51D876FC3.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9EE1BE3A-78A6-5141-8698-5776F4C046D6.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9E029F9D-BA42-AE42-8F1D-C022D428F973.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9C92083A-2C1F-6F4D-B494-17894C660F11.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9B411875-9980-0E44-929A-303D57185514.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/98CEBB64-7796-0A43-9382-75F558E8A350.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/8C480006-716B-904F-8D67-853DF4AC095E.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/8B6305A2-DB81-0D43-BCFB-7E83CDC5D1B5.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7E7A8D78-759F-CB4E-9D8F-0D3C3571235C.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6E799B38-81D1-EB4C-8F78-AF6F9B57350B.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/66DBD232-EC86-F141-B3BF-530AD4E8B601.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/5B8DB4CF-2D1A-AB47-89B9-0CFF5DB55EE5.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/588BF029-B523-6347-BEAA-7341ED8A0F23.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/5494DE4F-7866-C841-828A-3BCBC5FEE41A.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/527EB167-3978-F84A-8C41-CA8D26851D1D.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4B45FA32-8584-6A47-9C0D-405B2B4CE6D5.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4AE884DB-DD88-2E41-87CA-E4B04A8959FF.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/49EAA391-85C9-634D-8574-3F013719E445.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/400AC460-6369-B348-9E15-A1548EA8A446.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/32618055-4962-CE4E-A54D-51FDE05DEEBF.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/29B088CB-66E1-0940-852C-704035E50E1A.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/29713F58-A988-2140-9B57-F02B80F8DA55.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/27A37DF6-700C-F249-BD02-FA83986EAE97.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/24D95E45-F45C-AE46-81F7-8745341C581B.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/1E392580-6458-9942-AD63-4E66F7E64390.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/17D8D917-7252-9A46-AB8E-C28D6329C5C4.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/152BC653-B777-694D-B381-22FEEC2A9E65.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/128E6289-4477-CB4B-93F7-AFD7B0D46387.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/0B9C2424-26E2-234A-9A79-44491EFE8852.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/07FE3B0A-D207-3942-85FD-64D716DD5349.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleElPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleElPt2to100/PU0.txt deleted file mode 100644 index 51eacf2c476a5..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleElPt2to100/PU0.txt +++ /dev/null @@ -1,50 +0,0 @@ -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E74D908F-341D-D045-8230-4DA125F3DF60.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E159A7AC-AA55-4B4A-AD4F-F043D0603E5E.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D977A710-5047-614D-96FC-3BA790A80642.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D8EBED2C-9BE8-AB42-A645-B8A6B9AABD19.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D2ED5DEE-32E1-D743-A993-47FAE7E18E9F.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D2BDBC69-C30A-C34D-BBBD-FFE6C52FA06D.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/CDAF63CB-C479-F341-A84E-14717A4060BA.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/CB62733E-EA40-7046-A3A0-0E764CC0BAFB.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C47BE861-6C71-0844-9026-4B0202D30969.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A9578EF6-81F4-9741-921A-C2F8EE525244.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A713DAF9-B1B4-A24F-AF19-C470DB007873.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A2C89E69-90C9-4C49-A35F-9939D5469EDA.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9AF2F8D5-D5B9-3748-B69B-6FF1A11DD52D.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/983C7840-F3D6-954A-AC03-6970514B58F1.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/93281C0B-8091-0E4F-B2CF-290FF58BC659.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/8E7FE8C1-D286-6648-88AB-77F0DF21F747.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/8E0CF731-E93A-5A49-8E54-63A6828D2624.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/8CA0C3B5-CF1C-B94F-8A6D-7296FFCA5B82.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7ECFD3B9-EF16-E245-B501-2FE5CA157801.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7C941C09-B737-B64D-A939-07C6E23772ED.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/779658D6-3D7C-F840-8E3D-94DD20C3D229.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/75175BBE-E402-A840-AF07-17A43D91A377.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/74CC06CA-1D57-754B-A4FA-8655C1F1FE0F.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/73BF8C3B-9585-A747-85DC-933E4F6F71A5.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6CDCE71F-2964-1C46-B7A2-EC8D938843F1.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/67F685E2-53DC-A04B-A91D-E88776B7A4A5.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/656072F2-4FB5-F341-BDE1-A151C5BBAB3A.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/5AF3AF28-1D32-0A43-BA3D-6375AB9AFFAF.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/58A85389-ACA2-D949-8EEC-66D5D8B599EB.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/56883A4C-9593-1840-B99D-BFCBA2BE526B.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/56845E7B-275A-4D4F-8C97-F49357074C1F.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4EBD0D2C-AA57-7F49-A3DE-581092E583E3.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4DD7D6DB-84AF-9E44-A59A-BC35E36A546F.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4D87C4E5-BAB8-FD42-8FCB-A0956AB8EB54.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/44C01871-205B-B146-8EB8-8E04DDA18D1A.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/3C5B50EC-C740-D94F-ACD2-4D6CDC6563DC.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/3AF241D2-B10F-7649-BED3-CEFF37EE32AF.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/381B122D-6D40-9443-884A-3D4743EF8E3B.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/357FE33A-0220-D04B-B97F-5A974DF417F7.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/28023E33-754B-3A4A-BD7D-7FC6AA04C83B.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/26FEE637-7F47-DD4A-A29C-1567891BCFB7.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/24EB9B79-8287-5245-ADCA-21DBA813B4A6.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/218FE274-DABF-B94F-90FD-A0DF62781DE4.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/1EA344D5-682D-6948-9176-17DD983DFF17.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/1C72EC02-027C-6648-BD14-2B3AD1B132E1.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/1C582BF6-C971-9545-AD6D-FE3EDACBE01E.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/14272B85-9529-BD4E-900A-64BBAFE90F3E.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/10E37E23-2A36-3543-B7FE-2758D3C52EBF.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/101D5EF7-DC82-7840-823B-50423B87CB09.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleElPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/0F242BBD-BCB6-AB45-923B-8441084D09B6.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleMuPt1p5to8/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleMuPt1p5to8/PU0.txt deleted file mode 100644 index 3bee75324d52e..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleMuPt1p5to8/PU0.txt +++ /dev/null @@ -1,49 +0,0 @@ -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C99C22DC-A99D-2F4D-A2DE-7D715AD90334.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C487BF8E-BFA1-054C-849A-F17041A627FB.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C4285491-3B36-9A47-98B1-56E75FFEDA3F.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/FC3DFBB1-0A9B-824A-A089-B004701DDC3B.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F7351A58-9712-6548-85A7-CBA07872D217.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F67161F0-3196-D243-BC2E-A890DFB65D49.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F3BEA7F1-9922-074B-9A1E-0246BDDFABBA.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E1F857E8-34BD-9D46-A315-2BA9E7DB00E1.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/DCD07F0A-2101-F344-A8BD-3DDB58E722FD.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D88A8C96-ECD9-A34B-A724-8DAC64656936.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D7FCF1A0-5592-7142-B340-F3CB1ABA99CD.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D406ED16-1615-A84E-8888-74AD4A02BA54.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/CC05732F-B6AA-9E42-92CE-F9EBD36E8CB7.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C9A1F00B-644D-6D42-AA3D-598C52ECA126.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/BEAD6CAE-A0F2-7146-A4E3-B777C4D9F697.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/AE84A70B-D374-CC49-8728-AB4B3FC6252E.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A889571D-0A96-BB42-AAB0-40941A809C5C.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9C9F9E38-EE32-F04A-90D5-E31B839838D7.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9B395B92-FC9D-2445-8177-712BF285AAD8.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/9391FBB6-1055-B147-AC05-8475C48459B0.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/8BE77E4F-AD85-2543-8950-375079638269.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/844EDC67-9F16-3B45-9A4D-FED64635DCFD.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7FFD52A2-23DD-1543-AB88-AAED0C867B66.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7F7EB615-E164-E646-97A3-C8FFA397AF67.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7901D98A-9C1A-144D-9792-4D3902C1874D.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/77636D1A-958F-7D41-A821-A90A12C82AEE.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7644599C-D2F9-B645-96ED-AC732133BDE7.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/74915F90-85A7-3C4E-AAB1-CE1572A4CF4F.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6CC76FE8-FD34-474E-B609-02BB06103A71.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6BD0CDEB-286B-5C4B-8097-345739AE58D9.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6AFDFC7C-72CE-F840-8899-B573A971C83D.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/65269365-8527-6D45-A624-88D1C2F7915F.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/64E77683-9277-824D-BEB4-A23DDFF16446.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6469C46B-E431-E649-8DD9-E58FF87C79D4.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/5D39863D-CF05-794E-A29D-B60AC4A3550E.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4D52BE07-2F17-0C46-AED4-81CB30528FE9.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4A354BB2-93B6-FA4C-A7E6-FF48A75F52D4.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/462DDEF1-A474-3044-BCAC-CD9338EF6999.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/3E64CB51-92E4-E347-A3B5-847C863942DE.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/3939006A-106C-644E-BFA0-8A51C2B67A7F.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/369C2A4C-D38A-244E-A8C8-2B33C152ED98.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/328DEC4B-5304-B84F-AB36-0D9562B7B4DA.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/27DF1F49-FC6B-2D49-AE56-3E8D76C113AC.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/15376223-7F75-5045-AE64-5B044327A87F.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/145A8851-FE9A-FC4E-B04E-34FB795D4D62.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/0ED390FD-A6B2-E74F-AEE1-100A2A6781E1.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/0DF2AACB-7F6F-B247-9284-B8A6CCC78B51.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/09EEFAE6-3EDC-0244-A18D-1C7FE07960F4.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/09EA8447-1670-AE4E-8276-0527592EB0C4.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleMuPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleMuPt2to100/PU0.txt deleted file mode 100644 index 4b9b23fd3b5c6..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/SingleMuPt2to100/PU0.txt +++ /dev/null @@ -1,50 +0,0 @@ -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6BB95FD4-2B38-9245-BBB8-5D76A0E6AB6B.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/5FE8CE65-FA4A-824B-8852-76C04676AE53.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/543B4107-583C-D245-9C8B-A5644B26AB26.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4F8D3DE8-448E-B94C-A635-09197280D261.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/4BF6262D-ACAC-C543-8719-8FA9D70E18BB.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/493394A9-1DA6-514A-9054-5DE877917D1B.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/46CB545D-5975-A647-B3FC-F4FE397B9E5D.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/396FB378-B9C7-F646-899E-1231A9A4DB6D.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/31FDDDBD-C419-9A47-B492-FA403FCD4EB4.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/3174178B-5378-FA49-A404-2444A45365A8.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/30113279-D463-3445-97B7-A0834F3434DD.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/1B53821B-1CD6-8B43-902F-D58F9A9652F8.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/15DEC5F2-9BCA-824F-9EB6-A71A4E8239CA.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/153DBC42-A731-B34A-8C03-69E822B9CEDA.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/14A95434-E01B-3D49-B44E-6EE173EB1426.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/125DD012-C1C6-F64B-96CD-C0A31D5CAB48.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/0079450D-7F19-6645-A973-0400C5FB3653.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F951C5C9-DC85-DD4C-907B-5BD6B7DB53FA.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F609E3E8-5479-0B48-873C-C3E7308FC91F.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/F0B41247-EBB0-CC4D-A314-1E19405CE431.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/EDC109CB-8B8C-9C46-9ADE-8EA7FDC75167.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/E71B9ADD-38FB-CC42-8457-9F8C7B3BE9FE.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D3B2AC00-844C-4E49-83B8-8461EB5FC9A0.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D2C2184E-8F61-0B4F-BB54-E6F0A5468BAB.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D2B74CF2-F340-6B43-954A-00CBA64C7605.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/CA71A8D9-666F-AD40-BBCF-FFE8397C933F.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/C5C52CE3-6B12-2846-8526-0CCFF2EE9DCF.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/BFFEAE20-8F08-4F41-B677-0874FE9DF3B8.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/BFAF9542-577F-4F41-BA73-6A1EE9D533A1.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/BDB8F793-74D1-974D-822B-F7517748556E.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B8C47596-E822-BC49-A82E-ABF4922EA824.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B8C326E3-C5AB-2C47-906A-5918594E7687.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/AFA4FF45-10BD-0347-B577-7ED1F8406B89.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/AE178B20-DA06-BF42-A063-5F6AAB69DC68.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/AD0EE31B-7758-3147-921D-0D4A79E48BF4.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/ABF2EC74-7D16-5848-B177-DF7DA71D86AE.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A2DE5FE9-368F-C742-BA2D-1402A5CA82B0.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A0AD2A89-7B15-ED4D-82C1-E2585F0A067E.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/A051B36B-E6BE-174C-A208-F3B9981E63F8.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/94CF42E8-074E-A64D-8B39-BFB23BB9D547.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/93A6A2D1-CA59-B148-9AA6-795E041893CA.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/8CF6DC58-A03F-3944-BD6A-09806CF20A49.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/8BDBF37C-26A1-F24A-A784-A5DF8B1D6F6E.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/867CEAE5-F444-1B48-B65B-57E366633168.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7FCC0E10-4A9A-DA41-8A53-3D4C0F5A2CCE.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/7D0FD4AD-2515-7F4A-9C3D-755407F02429.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/79544F1C-BEBF-184B-8909-A1B4DC70201A.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6FDE5AAF-DE84-BF4C-8061-0A31DAC060FD.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/6F9F4650-99E8-3349-9A3C-926CA701D487.root -/store/relval/CMSSW_10_4_0_pre2/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/FB6F50C4-27E3-8542-929F-6147CFEDA674.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU0.txt deleted file mode 100644 index 9286cb83f8d7a..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU0.txt +++ /dev/null @@ -1,11 +0,0 @@ -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D4976A2C-6287-6B43-948B-EFCA226B0030.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/D31CED47-9185-5F41-84D7-8F22BC54679C.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B7556252-BCF3-994D-9927-8C0365F469AE.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B68B5687-64FC-9640-A876-7B84E9DF422B.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B5BBB440-866D-7C46-B702-33FD28B2D52F.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/B20C6005-6E34-D241-AF06-9B7BFD9E3304.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/97188193-A9F7-1847-8EC9-89C0C1E6EE56.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/411C6B05-D1F4-9D48-B216-1D7879D6F43B.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/324CC7DF-DB96-7841-9571-9D469D9012C9.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/27474029-9A6E-2E47-968B-149D731EE756.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/103X_upgrade2023_realistic_v2_2023D21noPU-v1/20000/00523659-104D-6A48-ABA7-684FD55BC687.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU140.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU140.txt deleted file mode 100644 index 88a0179fec29c..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU140.txt +++ /dev/null @@ -1,90 +0,0 @@ -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/FF21F618-AFD0-6D41-8193-5B8BCCBAA9CB.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/FEE861AB-BF4D-BD4F-9B98-F92EA94B116C.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/FE611A97-4C60-B144-9B93-A2CD3A93AF7B.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/F63E3699-50B7-F54E-BD97-9F8BD6D90B65.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/F4944734-C238-E542-BC39-41EAE29148BC.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/F3752C09-372E-9E4C-AB91-83362C695D97.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/ECD67B2F-DD21-CF4C-9E04-9BF1CBC33CD3.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/E9F0C365-1A18-F044-95F7-0118D3493F13.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/E60503E4-B210-9349-A8C6-1D429D7A2EF1.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/E354A2B7-EAC7-6347-B4C1-89E3E752D569.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/E1CC2776-2072-F74A-872D-0D373308E77E.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/E0937032-0B61-7B4A-8F34-FEC2F5C36A59.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/DFCD9592-38F2-FA43-950E-CC4D039A7422.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/DC1E79AC-CF93-F948-B897-698C549E4636.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/D9D87418-4120-6F4F-B474-0A99ADFCAFE1.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/D0FC8BA4-BDE3-A44A-ADE9-ABB65C9AC3CA.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/CE3599F4-56C5-5145-86E9-03107259BAB4.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/CD98BB58-631B-5746-8A00-6C0B52125356.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/CA86875E-A8FB-2E42-873A-891DE750DAE9.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/C7407AD2-A1A4-0D49-9403-8C6929B4152F.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/C5072604-4744-7B4B-804E-A5F3F8F8F94C.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/C385BC3B-865C-3041-86FE-9EC1C83E406C.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/BCF9EAD9-D265-1341-882D-C050E4F1129D.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/BAB2A7D5-4346-004A-A884-5944756CB35B.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/B636298B-73F7-AF4A-B870-870FF6CD3185.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/B42872E0-B880-8A48-89F1-AD43FAC7727B.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/AC6411FF-89FF-A348-9584-D5145ABD08CF.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/AB8256FD-1228-B84E-ADC8-7B90E28B3207.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/A57C424A-2CAE-FF48-ACF6-F01C86BA6939.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/A4E144FF-9315-C54D-94D2-D0D08957CC3E.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/A2731D2B-CE88-9649-A2EB-AE9E66D1CB80.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/A1F23AD0-A79B-D24E-AC58-EE75B7B2120B.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/A1CF3EF9-D7B2-4B4B-BD84-14E33ACBF35A.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/A160FEFF-21A3-A440-AD84-B92B7812060D.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/9FD3811F-75EA-8648-8360-FD0946FCF910.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/9D138AB5-EB0A-8440-8BA3-2449AB28E099.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/92E0412F-1B60-F440-9F1F-AEC12746CEFF.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/8FE1FEFF-2730-0640-A2D6-16FE41D84718.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/8F2B0C3F-832C-DB4A-9718-76C2170C8EAF.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/89FA0ECD-4AC9-6F4E-B01E-6677DEE6413B.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/88DEDE59-CA12-794E-B6CE-0C6FB36E31DB.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/887CB1A7-A991-0148-9788-65A4D48149F2.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/8829C678-1075-4E4D-B270-A700D2750778.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/8723D711-BE7C-5442-AF7E-0C65C8A2BE44.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/83D20BB8-BF03-6E4A-B414-8F864225E535.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/82AEFFED-6439-9849-822D-A2ECF8DF7943.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/8053937A-003F-B94C-8393-BA102FE64141.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/7FF9207E-733B-154E-9FD4-5F55264E96DD.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/7721593E-97AA-AB4E-B6F0-2F07B95BA755.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/74F23629-3826-0447-AE4B-AEDB875ED1A5.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/73C64AB5-D8BA-7F46-AFD8-347261F3C9F2.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/69382ECE-B511-DE43-8340-DFCC0CEE8F38.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/68B2C174-9EDC-BC45-BB61-4664A5920FA3.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/67F59671-CF46-DD47-8005-E9E827E0E223.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/675D86F0-804B-1B48-AD9F-E2EA983790DA.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/5FF6C452-44AB-454C-BF57-2895073DD91F.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/5E492B75-43CB-7E40-B0C1-AF249DEF3E7E.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/5DB2BEC6-2E18-3F4E-874D-3C7ED394997E.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/5C85BA58-60FC-A245-83CF-3FE0670CCABA.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/56D6FBA2-23A4-3B45-9F40-E1EE2A0D6A30.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/551D955E-A18E-B84D-A221-67697805CED7.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/503A4B86-724B-6D4C-B482-4C17EAB6ADD6.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/4C771CB8-3C41-6344-AE0D-53E13505107E.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/479DB8C6-8621-5D40-B037-1D6582D5E64D.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/478482F6-A9E6-E74A-A177-0B90126F8BA8.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/4573F524-0097-9548-8CBE-39FF59DA7DA3.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/41FEE026-01BC-8B42-A2FC-2BF6C2399879.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/3FAFE455-BFAB-E743-A4B7-73F79D3A6C3D.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/3BA03DA7-7EE2-6448-ADE7-1266D1649A63.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/3A8D64CB-BBFF-FE4E-9AE6-452E759E66CA.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/332D9330-0438-F041-B12E-F4CECDEE85E2.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/32E95390-3619-2148-884B-FA449B29AF39.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/31C245D9-AFD2-E54F-A9FF-EF0B0097012B.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/31ADD9C9-57F1-AF4E-BFD4-980237E63F85.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/316252FB-9A2E-FA45-ACD3-C793AE0714C8.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/315F0018-3349-A145-BE61-79008170E0D2.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/2EAD2D38-F6CB-7441-BFE9-EF65A72927FE.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/27A7C30E-98EA-574D-822E-5FD56A4DA9C1.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/26CD26ED-D8CC-4C43-A690-108812E3381C.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/2613EB93-538D-8E44-8865-6ED97AA8B8D8.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/1DBBB085-C228-614F-99E2-52B92369F487.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/19555149-D84B-2548-99A8-7E4696F565CA.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/16F10172-B595-DC45-A1BA-DBC6CC8CE5F7.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/16DF8B29-E3C5-1944-BE3E-7A501DDE78E9.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/13B79F69-5504-7443-81E5-DAA02AC4F2F9.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/12334DC9-83E2-9A48-9D3D-3F2151636A29.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/0BB9B151-9BB1-FD47-9CB6-73B95FAF9606.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/07F1D46F-E668-9640-8905-9D58C263046A.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/06249713-8798-2A4C-B1B6-8863427E19DC.root -/store/relval/CMSSW_10_4_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU140-v1/20000/021BE312-AED3-0749-A0A2-73ABC8AD706C.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU200.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU200.txt deleted file mode 100644 index 73b20d8301b30..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/PU200.txt +++ /dev/null @@ -1,100 +0,0 @@ -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/FFF48AB4-E5E6-3842-8A5B-20E2B7E497BC.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/FFB04F2D-0C40-2040-94CD-587D1F5AC4A7.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/FEDE3D03-2B54-BF4C-8D63-0C8C4DBAC6F0.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/FE522E6A-09E8-6B4B-B111-C5F6322B71D1.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/FD5A1B6D-C998-C149-8277-B278047E0011.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/FBBA43FA-9AAB-D349-BE35-18F74BEBA975.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/F7A323B1-9683-9846-9139-358A93E6E5AD.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/F70A7F1D-EDF4-7A47-8A13-0710A5964D03.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/F6FCF82F-C6A7-F744-99C2-CBCEA15FF124.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/EED79AA9-1E2A-7A4B-8A74-507CBA91E250.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/EE163EAC-1441-ED42-91ED-98105E9CD167.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/E0BB0A7E-6C19-2141-8484-65EFA337DDBB.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/E03B287C-6571-534A-9566-27FAB7402CEC.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/DAF5ACF1-BC4D-B640-8C1D-B21F4FBCDDB6.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/D53E3C85-F44C-894B-B57A-0D93309B4DD9.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CD195B20-F5F1-504A-BF57-48500AE83D5A.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CCFEF3EC-6BB3-414F-96ED-0EF066356853.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CB8C9032-3904-3445-BB99-12F7D2406CA0.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CAD74EE2-7F73-4A48-9D36-FEFE17D7481F.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/CA33E7AB-505C-854F-AAD0-DB30EA18D790.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C8A93F52-0747-1C48-99F6-79BF703FD7E1.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C71A158A-5FEC-D84F-9350-051E4D248C33.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C5ADA496-13D3-BA47-B909-CD4FBF2036DF.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C49CB14E-3D97-6A42-A71B-6F165470E260.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C246E3F7-4787-2646-BDEF-661B0ED88BAD.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/C106AF77-A5EC-464A-8506-827EF1E5BEA6.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/BB8C2AD5-77BF-CC47-80F5-33976F9BA74C.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B729066B-1239-F448-AF19-355E2913A52E.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B43F8A0D-9A17-0349-880C-718068EE64AE.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B4210BFC-C3B7-3F49-B8DB-FA43AF360273.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/B3806C39-CE2D-F940-971C-311908D55F55.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/AE03B501-4052-184C-B0CF-8FDC15A86C87.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/A7F3240B-CED2-0749-8F78-993164F05E04.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/A5031D0A-8146-4F44-95BC-A2569A462C6A.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/A34D2C04-BBC5-6741-BA38-42803727F55E.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/A1877834-C5E4-AA40-9FD4-1C4474715822.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9983008B-882E-EB4B-B973-F86BC15119D0.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/99503DCA-B083-5942-B794-6E33D0958F18.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9932CAD0-F96D-4F4E-A546-242C8973E76A.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9919AA81-1206-1244-806F-948C1C22945B.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/9569319E-61B5-5D4A-B9E2-6482D1176082.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/91832920-CBD3-BD4F-8F37-3412EE3647BF.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/90B4F2B2-94BB-7A47-A6F7-D284609F3D44.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8F0C0860-A859-7C4B-9C44-40BD5285B8DC.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8D9CD7C6-F7C7-F847-9557-2498D6F9BA99.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/8D0BC8DA-A788-F042-9AD3-CEEE6CAED0DD.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/87996916-F41A-474C-ACBE-7A8DFD4084F3.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/877D2A16-FC05-0F49-AC5C-1F8365B9773A.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/84EB7B63-38B7-FB4E-8572-CFB618B0AF70.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/81F8166A-D58E-B543-AF0E-4FF65FD7193E.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/7F861947-2FF5-664E-80A4-66B61AE83F6F.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/7A3A4427-F224-4F40-A6E8-EA000C2651DE.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/77D247BD-F584-DC4F-B68A-F70FDBBCC5D1.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/77A6EF0F-092C-9345-B4E7-8DF75E3BC03F.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/77559AFC-FE3F-E347-B044-C5C676D37301.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/72D471FF-FF77-EE4E-B0A3-5E423DAF7C92.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/6FE74EE9-68B4-7D45-BC6A-A57684C4EF07.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/6BD05BDE-3C24-D04A-9FBF-A4DFC6151D44.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/6883D9AF-D5B1-5749-B1B7-457B843236EE.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/66D7811C-5831-BD4B-B7B3-3B2B90CEF69A.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/663CFFF6-A7FF-B841-AD1E-E856B500FF09.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/632E5E94-0F9A-A74A-8080-E9D82C269654.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/60E850D6-A8AC-EF42-9D28-41B5FB553E05.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/60A26A55-A37D-1348-AF9F-ED98F86F1274.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5EBDA0C0-44C2-E646-B3B3-05E21FB54F73.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5E61D730-A4B7-0A49-BDD4-281910DD8374.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5CDBB937-2C90-4144-8735-485199F8D771.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/5CAC6671-5050-A04E-B495-F9D6791B4E48.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/526F7BFE-E04D-2543-8441-9EA45D0952AB.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/4DD590E1-2FE2-6E4D-A34D-4D83FE976EAF.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/49E94AB3-4EDE-6B40-BD87-4FA47FDA1BCD.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/4725E564-4DEA-FB4F-B9FE-834999AFDC4D.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/45C4B37D-7CD2-0541-B399-181CB2C7633A.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/456BF325-22AC-8D4E-A21C-8EB53E89AE14.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/445584F5-57DA-6F4D-814C-B4A1A9C17981.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/42A97B14-003B-1A4A-8D86-215DD230F088.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/3FD7A367-96FD-D249-A362-E0DBD4D03E27.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/37B90FE4-88D4-294D-B2EC-8CF002337A65.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/379D9981-C7E6-CA48-8722-E5E022A35D15.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/345B6106-BD75-8944-A9E7-3C6893C0317B.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/31206441-CE60-FE4B-B43D-3DC3D0056C55.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/2A15F681-31B2-E643-9F84-582DCF72F29A.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/2918DEA9-A524-4048-B476-A9C8E0D6A656.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/253798E3-79AA-C74F-B101-5346964A67E1.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/20613A9F-46D7-6C4B-A802-6DDE71910DED.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1EC4F661-B020-BC4A-A944-586C908442A8.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/1D4CF55F-EF5C-0144-895B-AF10A54527EB.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/15BD19C9-FBDD-5842-BE89-050FCB7632DE.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/140C3389-F042-6944-9CAA-058FFE0F5B61.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/11215630-7229-EE48-9186-AFEFFAF79248.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0F7BA59D-8BC3-0047-BFB8-05A3966893DA.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0CC21F77-4AF0-FE48-8F60-4AACACD9FA02.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0C676FDD-0C94-1D47-A357-67A55173AA8B.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0B98A8C1-324D-6340-AF17-E5C8C4B2E835.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0B8A7D7C-01F1-6648-B9C3-C8957E06A4AC.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/081C2919-AE72-164B-9E25-E0C32EE59F3C.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/068C6CC5-6862-4B4C-88DE-3E4E39305BD2.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/037866BE-74BD-E04E-8095-9B6BD251AF53.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0259ED4B-00BC-1C4D-971F-D8E4192BE9CA.root -/store/relval/CMSSW_10_4_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_103X_upgrade2023_realistic_v2_2023D21PU200-v1/20000/0131EB32-5AEA-B445-906D-7A8639AFA24E.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/localRAL/PU200.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/localRAL/PU200.txt deleted file mode 100644 index d266d5c679942..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1040/RelVal/TTbar/localRAL/PU200.txt +++ /dev/null @@ -1,74 +0,0 @@ -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/45C4B37D-7CD2-0541-B399-181CB2C7633A.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/4725E564-4DEA-FB4F-B9FE-834999AFDC4D.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/49E94AB3-4EDE-6B40-BD87-4FA47FDA1BCD.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/4DD590E1-2FE2-6E4D-A34D-4D83FE976EAF.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/526F7BFE-E04D-2543-8441-9EA45D0952AB.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/5CAC6671-5050-A04E-B495-F9D6791B4E48.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/5CDBB937-2C90-4144-8735-485199F8D771.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/5E61D730-A4B7-0A49-BDD4-281910DD8374.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/5EBDA0C0-44C2-E646-B3B3-05E21FB54F73.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/60A26A55-A37D-1348-AF9F-ED98F86F1274.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/60E850D6-A8AC-EF42-9D28-41B5FB553E05.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/632E5E94-0F9A-A74A-8080-E9D82C269654.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/663CFFF6-A7FF-B841-AD1E-E856B500FF09.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/66D7811C-5831-BD4B-B7B3-3B2B90CEF69A.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/6883D9AF-D5B1-5749-B1B7-457B843236EE.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/6BD05BDE-3C24-D04A-9FBF-A4DFC6151D44.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/6FE74EE9-68B4-7D45-BC6A-A57684C4EF07.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/72D471FF-FF77-EE4E-B0A3-5E423DAF7C92.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/77559AFC-FE3F-E347-B044-C5C676D37301.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/77A6EF0F-092C-9345-B4E7-8DF75E3BC03F.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/77D247BD-F584-DC4F-B68A-F70FDBBCC5D1.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/7A3A4427-F224-4F40-A6E8-EA000C2651DE.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/7F861947-2FF5-664E-80A4-66B61AE83F6F.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/81F8166A-D58E-B543-AF0E-4FF65FD7193E.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/84EB7B63-38B7-FB4E-8572-CFB618B0AF70.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/877D2A16-FC05-0F49-AC5C-1F8365B9773A.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/87996916-F41A-474C-ACBE-7A8DFD4084F3.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/8D0BC8DA-A788-F042-9AD3-CEEE6CAED0DD.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/8D9CD7C6-F7C7-F847-9557-2498D6F9BA99.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/8F0C0860-A859-7C4B-9C44-40BD5285B8DC.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/90B4F2B2-94BB-7A47-A6F7-D284609F3D44.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/91832920-CBD3-BD4F-8F37-3412EE3647BF.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/9569319E-61B5-5D4A-B9E2-6482D1176082.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/9919AA81-1206-1244-806F-948C1C22945B.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/9932CAD0-F96D-4F4E-A546-242C8973E76A.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/99503DCA-B083-5942-B794-6E33D0958F18.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/9983008B-882E-EB4B-B973-F86BC15119D0.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/A1877834-C5E4-AA40-9FD4-1C4474715822.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/A34D2C04-BBC5-6741-BA38-42803727F55E.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/A5031D0A-8146-4F44-95BC-A2569A462C6A.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/A7F3240B-CED2-0749-8F78-993164F05E04.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/AE03B501-4052-184C-B0CF-8FDC15A86C87.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/B3806C39-CE2D-F940-971C-311908D55F55.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/B4210BFC-C3B7-3F49-B8DB-FA43AF360273.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/B43F8A0D-9A17-0349-880C-718068EE64AE.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/B729066B-1239-F448-AF19-355E2913A52E.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/BB8C2AD5-77BF-CC47-80F5-33976F9BA74C.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/C106AF77-A5EC-464A-8506-827EF1E5BEA6.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/C246E3F7-4787-2646-BDEF-661B0ED88BAD.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/C49CB14E-3D97-6A42-A71B-6F165470E260.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/C5ADA496-13D3-BA47-B909-CD4FBF2036DF.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/C71A158A-5FEC-D84F-9350-051E4D248C33.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/C8A93F52-0747-1C48-99F6-79BF703FD7E1.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/CA33E7AB-505C-854F-AAD0-DB30EA18D790.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/CAD74EE2-7F73-4A48-9D36-FEFE17D7481F.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/CB8C9032-3904-3445-BB99-12F7D2406CA0.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/CCFEF3EC-6BB3-414F-96ED-0EF066356853.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/CD195B20-F5F1-504A-BF57-48500AE83D5A.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/D53E3C85-F44C-894B-B57A-0D93309B4DD9.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/DAF5ACF1-BC4D-B640-8C1D-B21F4FBCDDB6.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/E03B287C-6571-534A-9566-27FAB7402CEC.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/E0BB0A7E-6C19-2141-8484-65EFA337DDBB.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/EE163EAC-1441-ED42-91ED-98105E9CD167.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/EED79AA9-1E2A-7A4B-8A74-507CBA91E250.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/F6FCF82F-C6A7-F744-99C2-CBCEA15FF124.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/F70A7F1D-EDF4-7A47-8A13-0710A5964D03.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/F7A323B1-9683-9846-9139-358A93E6E5AD.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/FBBA43FA-9AAB-D349-BE35-18F74BEBA975.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/FD5A1B6D-C998-C149-8277-B278047E0011.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/FE522E6A-09E8-6B4B-B111-C5F6322B71D1.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/FEDE3D03-2B54-BF4C-8D63-0C8C4DBAC6F0.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/FFB04F2D-0C40-2040-94CD-587D1F5AC4A7.root -file:/opt/ppd/scratch/tmp//MCsamples1040/RelVal/TTbar/PU200/FFF48AB4-E5E6-3842-8A5B-20E2B7E497BC.root - diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/README b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/README deleted file mode 100644 index 083b8997d929d..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/README +++ /dev/null @@ -1,7 +0,0 @@ -RelVal/ contains CMSSW 10.6.0 RelVal samples. - -They use the D41 = T14 geometry. - -They are made with the stub window sizes that you can find in L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py . - -Typical dataset name /RelVal*/CMSSW_10_6_0*upgrade2023*D41*/GEN-SIM-DIGI-RAW diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleElPt1p5to8/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleElPt1p5to8/PU0.txt deleted file mode 100644 index 4503377464d0b..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleElPt1p5to8/PU0.txt +++ /dev/null @@ -1,4 +0,0 @@ -/store/relval/CMSSW_10_6_0_patch2/RelValElGunPt1p5To8/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/E0B7C6FC-8939-7443-B18B-AC92BC33C3C8.root -/store/relval/CMSSW_10_6_0_patch2/RelValElGunPt1p5To8/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/A44D8B46-9AAB-A843-9ED3-C7A9C249A398.root -/store/relval/CMSSW_10_6_0_patch2/RelValElGunPt1p5To8/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/99CC9FE6-AE7E-0047-8AFF-2529AEC89C6B.root -/store/relval/CMSSW_10_6_0_patch2/RelValElGunPt1p5To8/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/4D9F7DCF-60F7-2945-BFF5-9ACD23F8EF5D.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleElPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleElPt2to100/PU0.txt deleted file mode 100644 index 6fa396354f3c9..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleElPt2to100/PU0.txt +++ /dev/null @@ -1,5 +0,0 @@ -/store/relval/CMSSW_10_6_0_patch2/RelValElGunPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/FBF986BD-259D-8444-A4CE-F089D37778FE.root -/store/relval/CMSSW_10_6_0_patch2/RelValElGunPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/F5D7A215-FFB2-E64B-A9F0-F57992B9D21C.root -/store/relval/CMSSW_10_6_0_patch2/RelValElGunPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/CDB15E2D-6245-3749-9900-ECD1B35C84E1.root -/store/relval/CMSSW_10_6_0_patch2/RelValElGunPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/B3E7813D-79B2-8E42-92C6-D14A0F487A06.root -/store/relval/CMSSW_10_6_0_patch2/RelValElGunPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/78F491FA-DBE2-EA40-B0D1-42759BF28A70.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleMuPt1p5to8/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleMuPt1p5to8/PU0.txt deleted file mode 100644 index 644331cbc93d0..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleMuPt1p5to8/PU0.txt +++ /dev/null @@ -1,4 +0,0 @@ -/store/relval/CMSSW_10_6_0_patch2/RelValMuGunPt1p5To8/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/AEF0CB71-AF86-A04A-BCCC-A5DB546B8F69.root -/store/relval/CMSSW_10_6_0_patch2/RelValMuGunPt1p5To8/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/A66EB478-1472-214C-9171-F4F507977634.root -/store/relval/CMSSW_10_6_0_patch2/RelValMuGunPt1p5To8/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/8671A47A-F5D5-2247-9C5C-A9A50A4046DB.root -/store/relval/CMSSW_10_6_0_patch2/RelValMuGunPt1p5To8/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/2018BB4D-696D-6649-BC75-727E3CB128AC.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleMuPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleMuPt2to100/PU0.txt deleted file mode 100644 index 458f4d7d76ba6..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/SingleMuPt2to100/PU0.txt +++ /dev/null @@ -1,4 +0,0 @@ -/store/relval/CMSSW_10_6_0_patch2/RelValMuGunPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/B84451BE-B56C-7B46-AE91-012D666D112B.root -/store/relval/CMSSW_10_6_0_patch2/RelValMuGunPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/9DE71496-F96E-0248-86F3-F4FCE05C7CCB.root -/store/relval/CMSSW_10_6_0_patch2/RelValMuGunPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/8926E0A6-ED88-A54F-9B08-EFE07AE22096.root -/store/relval/CMSSW_10_6_0_patch2/RelValMuGunPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/2F504839-999B-E048-B6BF-15B65D294E96.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU0.txt deleted file mode 100644 index 2ce81a3c1397b..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU0.txt +++ /dev/null @@ -1,10 +0,0 @@ -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/E2F72EC8-69CC-8F4D-A4A6-2B2C29CEAE5E.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/DF12CFDD-8F7C-4441-B5A7-2C49901BD192.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/C5952C0A-AAEA-A44E-B281-9E0F17470A0C.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/BBD5032A-0A1B-6540-8646-D7A5F8CD2639.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/AE123CAA-16FA-084E-94D5-201DE5883E17.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/A3EFC6A7-CC31-9A43-BBEE-C0A45F0F5939.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/9D8FA670-3A86-F94A-AB8A-B6A7D5F9BD49.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/7E72D7D3-4CB3-E948-81F6-A43690271BF3.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/6BFE95C4-65BE-F84F-8743-6F7527B0BE23.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPUnoAgeing-v1/10000/0F5AB5DB-4432-F84B-B223-B65987042BE4.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU140.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU140.txt deleted file mode 100644 index 3a40216b20045..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU140.txt +++ /dev/null @@ -1,90 +0,0 @@ -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/03459CCC-4D78-524B-ADBC-3027F1365979.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/02AD7480-ABFC-A14E-BE82-D571AB61BFEB.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/02996200-F77A-E44C-97CC-F8A11164FA4C.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/01FA3727-8D35-874D-AEAB-64114FB06A31.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/01D81891-2F79-904E-8AFF-84AF90561F9E.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/2102FFA8-CD13-A248-B5F8-5AB92F95025A.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/1C7B8603-3DDB-234B-9F14-01AD201DC439.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/0AAAC338-359C-5C43-B028-E94643B14663.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/FC48882E-8586-1E40-A5D4-68D7B51BD76B.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/F9715757-A164-2D40-ABA6-F297CB03753F.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/F5329F04-16FF-B04B-AEF7-3BF6AF57BD59.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/F1EA4AD0-6EA9-5842-B9AA-84E95DA17C99.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/F0B6E845-D388-5E4C-AF0C-ECD22F35B6C8.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/F041E07A-5AA8-384C-880D-9F6DC0153120.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/EEE777B8-58FE-8447-94C6-CD602A6F516C.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/EC28C5B8-616C-B84F-811B-44E079A43F01.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/EB1AAAD3-D00F-1643-A9D3-0C6E00A61A3A.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/E65750D9-48E1-6940-8B34-0B03DA43DEC9.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/E4A0E064-BD7B-6441-BD26-6BF8B1683CF6.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/E3D316DA-1117-0746-A779-A4D9042B2B74.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/E322E074-852C-9247-BC8A-C62FB5D2BF34.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/E095D647-912A-EA45-A5DC-2F68E4DEA4D1.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/DD7AC741-4DEC-D545-8D1D-E8CD028D96DA.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/D9E7BFFB-2EED-0344-B69D-07A76BDB6CE7.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/D77D1B52-7304-C147-A7E7-CA14D276E747.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/D50B2983-3D15-074E-85F6-02D844C6710B.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/D47F3ABE-1203-CB47-9664-C9C215A7F056.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/CDCE7498-AD5F-3F44-A8A2-A36064F10CB4.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/CC4B9051-A311-4541-BF5B-D0710FA58956.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/CC099005-CE88-EE40-8C0C-F73C7A5211CC.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/C7433043-809D-8946-B54A-D090420336B4.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/BC938DC2-49DB-FA4E-A94E-204AA7AFF1B6.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/BA6EE7DD-AC59-7749-B8D5-6CEB292EBAC0.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/B79750E5-E21E-7F48-A4C5-F356E4065BAF.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/AEEFB0A8-FCAB-9B4E-91EC-66216ED6F58C.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/AD197398-B349-8848-B87A-8B09CD9CCA5A.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/AA4AC109-3AD7-6B4B-88CA-242000946BB6.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/A56AC9EC-BEFE-5B43-9FCC-5AF73216916A.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/9EFD84D1-8633-2141-9434-9C7AB3941F0F.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/9BF3B9BD-2603-3347-A329-63FCF1D3C824.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/9B41BDBA-A193-8145-8788-FB11991178FA.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/9A6982BB-FA4E-DB4D-9427-A3D92CD79B55.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/9A0BE40B-EB39-BF46-83B3-9722FBA03519.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/95C637F0-3577-1641-954C-EB274783E5B8.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/957844F8-0E5C-D246-97D7-AD40F9DDCBA3.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/8D3FC16A-93D5-184F-8ECF-083420344A1D.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/8CFF8859-4AE9-DE4A-BF29-CF9BA46303F3.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/8C59E2B1-A854-FC4F-BC48-2F5583CF6F74.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/8AB142E0-0A63-A448-B4C6-72D938B695FD.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/89AA627D-CB3F-974F-9B8C-DF7E242C1B6C.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/8980FC5D-994F-7C4D-8FBC-7D21515C8DE3.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/88FFADBF-2F6C-7941-90BE-0F42BFED7406.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/87A62194-0331-A74C-AC0C-C85C1EC0446E.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/812CB093-D4F4-3042-8798-BA02CE2AB64A.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/8074B02D-6A41-6141-8FB3-C91BD9FB1433.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/801E33D2-7FA3-7F4E-9B4D-5D68031B4258.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/7F6DCF4C-FCC4-7C40-8E88-383ED9783FE7.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/7F3D342D-423E-204A-96E8-FB48F78314D5.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/780D306E-A613-2C48-9222-129896CA5A43.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/7719E974-70C2-E44B-ABB5-A72E14C40F1F.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/7586ECBB-FFF7-6943-8100-3DE1BB275E24.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/7292CF81-9CA9-004B-BBB1-5B33C6E368B7.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/7279A983-6D80-7245-904E-10C34051A693.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/6FE92499-92D3-3649-BCA7-678E3BBBFD8E.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/6C550167-A2CC-824F-8598-5049430ECF96.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/6BB2315B-3ADF-144E-BF5C-73FD68FE1C92.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/660A4728-0C1B-8442-A916-DC2A9BB3EFAC.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/653BFD49-9DA4-2A40-8DF1-B141C1B5157E.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/631807CC-E971-654A-B4F5-6EB0010FC8DB.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/5F06B207-ECBE-5E43-807C-2346A29F01C2.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/5B4FDFE8-94C1-0B40-8DFF-9D0FA98C581C.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/554E1E09-345F-714B-B4D8-913AEEA7AAB3.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/516AFA48-EF14-8940-B94C-110E5FC3FB62.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/509BCECB-8B86-3B4C-BC46-836EE3ED9046.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/4B096BDB-53AE-5C49-A3C5-B596B05ED293.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/4A4B5340-25DA-3640-ABB8-43BC09C66AB0.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/45B01182-1D96-F646-9671-A5A267E7ED5F.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/455C0770-9FA3-B14A-AC70-B6EBA4E06ED2.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/444522CE-E832-3840-B851-835D341457AB.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/42FAB3B4-0C11-3B44-83A1-F684C6E8D33D.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/4153CCC5-F6C7-1144-ABFC-8970731208DA.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/343BED09-5DFC-3E4C-A735-F17C87DDF3C7.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/33EAFF56-2C3B-E440-9D34-506B38E3366D.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/337928B3-2DEA-A14F-B93C-8D475676E708.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/2F258742-DF09-9B46-BA97-7B92C389BE5E.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/2E63A474-E392-2C4B-B2C8-8F42E1C51DA4.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/2DD8E1D5-4EEC-1544-BB40-613E1A16458A.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/2B5B585E-676F-4747-B15A-61B5BCCB0D77.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/2883AFB9-C3E6-DC4E-93D8-626C5C1D892C.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU140noAging-v1/10000/258123D3-6021-4747-9433-6A4E714B8645.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU200.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU200.txt deleted file mode 100644 index 97abc2fd0c35f..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1060/RelVal/TTbar/PU200.txt +++ /dev/null @@ -1,90 +0,0 @@ -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/C906CFA0-7CF2-9E43-B885-99C07840187D.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/C88F950F-6C9A-5E43-90F9-6721E6C14AD2.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/C5DCAD1C-D06D-6943-80A3-EB64267FA87E.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/C18EE4ED-3A5E-A94D-A21A-78AE6A788187.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/C0BDCDDA-F6B3-8A46-A38D-F5F2CBA57A58.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/BE81E27D-2FBB-7846-AE97-B2728551AF64.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/BDA233B3-6FB3-784B-9D26-F48DCD588607.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/BCBC02BE-D8B7-104F-B581-DF07D8A07FCD.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/B7C077BA-C8A2-474E-BA61-C54ABE60D113.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/B79507AE-6352-CD45-9ACE-0EADF07FD8B4.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/B6E10C6B-C4AE-BF4B-ADD3-24A91FB2BD2E.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/B6E073B2-FBFD-C94E-A36C-73873E5B835F.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/B122788C-AFE8-4247-833B-CC051B58FD91.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/B0D9E8A6-5E4A-FA48-88AB-132BE9A20645.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/ACF1E328-A8AB-3548-8D0A-A23D6CA4546B.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/AAD7FED3-E5D4-774A-91C3-22C1B8F290E7.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/A78719AE-BC28-684F-903A-CF398FC7F7AB.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/9FEBEB22-69A9-B248-875D-A95D9B088592.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/9DD929C2-4722-8A46-B50A-455AF4D8BEC7.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/98AEFA7E-DE9C-894C-8058-9668F1CBD53C.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/980C5430-AD47-B241-BE6F-B4CA8012EAC0.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/93EF8D76-ECC7-5748-92B7-C31FCCE85F8B.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/8FADD102-E3BD-CD47-ADC8-4ECC10A362EA.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/8F4060C4-91EC-9842-B90B-DF2C9C343868.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/8CBC504C-DAD1-8045-AE3A-53F67429F955.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/8912C48E-5FBC-1543-8B17-8103BF8B09CE.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/8437FA7C-6CE5-ED42-A10F-4B59E01AC570.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/83E908EB-A425-744B-BC3A-9B54BB250A31.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/7F844821-1FA7-0643-A1D2-28E8F0D3F239.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/7F34DCD1-F982-5448-B967-6C92382D24E8.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/7F317FFA-0945-894F-BC84-78275E5CE47E.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/7EFDA8E1-5E80-7B4A-9112-3D2F2BCBDFEE.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/7BDCA836-43E3-1E48-B486-492CCC620A07.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/7823FE0C-F450-4B4D-BD0C-756EADAFF28B.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/77D43DB6-3EB9-DA44-B2D0-0AE1353F179E.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/773D2A47-687E-2F4C-812F-0D872DF33922.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/75232632-B74C-EB4E-B4CA-552E09BE4FEF.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/73D77317-C2AF-D54D-9D9C-B254B9BFD5B0.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/72F865A5-AD86-C44F-A859-C4350FA6B429.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/72EA4B20-6647-3346-8458-CE9319A16210.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/7114C578-865A-DE4B-B5BC-C02DD42F2F5B.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/700B6B94-79F2-9943-8169-71789E700E30.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/6EECB5B6-6769-E84D-BDD0-0225F6399194.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/6D961583-4B8A-B448-BD6F-4B949AD2B6AF.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/6BB4F352-7CD9-3D45-9DA8-5DCC79B2E9C6.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/6909B878-FD76-EF42-A58F-3E1FB9FE7845.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/65BE140D-F421-E746-A807-BE9C8E832B92.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/649EB2BA-70E1-CD4C-889E-561C5CABC985.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/5C6AE70C-5E51-8648-9961-34A9B9BD41EB.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/5A9282FF-6D4B-8D47-8F94-EFA142C6EC7C.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/559D941E-E79A-DB43-BB98-63B21AC99357.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/4F71712D-222A-BC4B-BB27-A1F660810152.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/4E2F6D0A-B8AA-BF4E-AF51-F6E2667FDFD1.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/4D634270-8D78-AC4E-8D32-373BC89A041E.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/4AFB11A8-2146-494D-A1F6-5B17A02F7552.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/41883BEC-19FA-2A45-B376-03DBABB58E8F.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/4116D11D-3F44-4E4A-971E-3AE6FA403DCF.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/3FF756A0-3797-A244-8C73-5B36CC7F5AF6.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/3E6AFEB9-95B1-0946-8208-4472BD5B5D26.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/3D61C2CA-E884-D745-93FF-A2BD8BC59527.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/3CE5B00E-483D-934A-9B4E-76A8DC5B2FF9.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/3802C2FB-F9A8-8D4F-83A7-1EB52A8854F1.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/30B0DAC9-314F-0D40-BE02-E860AA5A2A21.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/2A9AA172-AB51-244E-A329-227376BC7739.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/29A58C35-A772-EF45-B4E9-A398C039D1F0.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/24DC7EF4-836C-E44B-93B8-64CF0063D3E2.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/1C91C721-BF6F-E44D-8F92-17F2324E2B2B.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/1ACE2DDA-DA17-764B-920B-60DECF1D2231.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/163C8914-4B40-E940-B42E-295EF0D774BA.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/142F1FC8-7AB8-AD4B-BBE8-C2BC7711817E.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/1329D48C-21B3-E54A-8076-964D21D4E738.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/12D39295-56F5-B741-B7E1-0A7ED8BE2BC5.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/12018ABC-07D5-2F4F-BF34-56F9B8C47C01.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/08131F03-5E21-9649-832C-271E1E2D8E9C.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/07F23F56-359A-4A48-91E4-A51BC9A49DAD.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/07CD784C-59AA-3E44-98E6-274135902C2F.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/0566AA0A-F92E-7247-A02A-097F92C5AF7B.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/036E06AD-D5BB-E349-B579-DEF0D67CD196.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/F987D6F6-A97E-E740-BA7A-0FDF4302B9AE.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/EAC994DC-AF24-C64B-B5DB-28E93F26642C.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/E068E283-A40A-DB42-8D59-773F74DE5222.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/E0102A95-34EF-E545-9107-F48FBA8F3594.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/D94399B8-283D-F048-BDB5-3263EB2682F2.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/D4FC84D1-5D6E-CF46-87D0-7E9FFED7A273.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/D2FD315A-3D54-3245-B69E-93D05BE43332.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/D110A15A-9EE8-5044-8F6F-7262FD626FDE.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/CAFC912B-5BB6-FA46-B23D-91573056055B.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/FE5D64CC-FF6A-FB4C-BCA9-0190CCC8B309.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/FDA5EF86-3D8D-564C-B8B1-428B0EBC1968.root -/store/relval/CMSSW_10_6_0_patch2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_106X_upgrade2023_realistic_v3_2023D41PU200noAging-v1/10000/FBA972C5-FEEB-2D48-B71C-56BDD84DA660.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/README b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/README deleted file mode 100644 index c09a41310efcd..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/README +++ /dev/null @@ -1,7 +0,0 @@ -RelVal/ contains CMSSW 11.1.0.pre2 RelVal samples. - -They use the D49 = T15 geometry. - -They are made with the stub window sizes that you can find in L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py . - -Typical dataset name /RelVal*/CMSSW_11_1_0_pre2*mcRun4_realistic*D49*/GEN-SIM-DIGI-RAW diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/DisplacedSingleMuPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/DisplacedSingleMuPt2to100/PU0.txt deleted file mode 100644 index 94478d8b06a87..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/DisplacedSingleMuPt2to100/PU0.txt +++ /dev/null @@ -1,50 +0,0 @@ -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/FF5B9429-29EC-CD4A-9586-0917716E7521.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/F3B79FB2-66CE-5442-85CA-05C1BAB4B7C0.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/FA8B1500-9452-3E43-A54B-9B24A49BCD4E.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/F270BB36-3A73-264F-996A-C0DFCAD2E0D1.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/F3585EE2-95E1-8949-B807-0B74A19AAB49.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/F1675394-EE2E-DE4B-A42C-1A2BEEE37164.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/F18E211D-6345-6941-8F36-807B3EE98B37.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/E045381A-0D1D-9C42-94E5-5045FAA4D1D2.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/EE59DF00-D74D-C54D-94A9-45C24535A236.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/C95FAB84-C478-734D-ABA6-A86E7DC50805.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/D6F69404-B5AC-B643-94F3-2EA7016BCA52.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/C4128A99-5267-2842-B173-4CA7B9005869.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/C62EA1A0-19A5-9E4D-BEF3-280D5894CEB2.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/B5E4BB3E-B810-5047-AAF4-29D85BBB03E1.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/BC122AB2-B70B-0C40-AF04-43749410CDC8.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/B19BF47A-04BC-6249-9F45-C343C50145D9.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/B48A852A-7A47-AE45-94CE-15C2A6CEC7E5.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/A8C9EA46-CF6F-7D49-B74A-C4288C80A257.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/AC5B1F4F-ED89-9D4F-B299-D3163E2310D5.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/97FB1E8D-6A85-C440-86FD-272B0DEA1A9E.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/A843A8FF-8BFC-AC43-99DE-1764802E54A3.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/95D7B44B-5549-0F44-B66C-0865086522A6.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/9674279E-8E87-5B40-B757-5537E158E6F5.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/8645B672-1C46-BC4D-B405-79E489D9E158.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/875C14F2-D33D-0A45-8316-198DE4DFD015.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/78D954C5-D27B-9649-B0C2-DC198C86707E.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/7CBBE9AE-94FB-F64C-A5ED-9271EED0F205.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/71BB23DA-1E13-B74A-AFCD-7A0742C551F6.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/73E4F776-FB93-1049-8734-F586F9DC5E9D.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/6DBF0748-7D5A-3C41-B6CD-E44AA09E3CF9.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/6F59F28D-9016-4649-AC4B-827E4B6F60A0.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/668D4571-ED9C-DE47-BA5B-9FA389F4699C.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/6B1E55CB-F3FD-CE46-8255-7E75E818E024.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/650FCF43-E541-4545-A9C3-454298F0A3ED.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/659CABEA-E6C1-CE4D-8195-56848D1E8A55.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/60108B81-B938-CA44-A088-91C5FAEE1A1D.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/60EB40D0-3FD0-B049-80C5-9C4BCD30FBB5.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/54633563-17AB-4049-A0AD-D9B927A7F167.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/5BD31D22-FD6E-D64A-980A-E2B7640BC897.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/5109CE50-0C41-7249-8C2B-F2C25CB20DEB.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/5336ABED-07D1-4949-890F-C278D6CD1ED7.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/36672A75-9C2B-614D-9FFE-67C34DE1F3C0.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/3CEC9433-5E13-4D40-83FE-17554F62245E.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/22878518-B853-724A-8C7B-AD0D03EC639D.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/2F608FFF-43A6-8E4B-B09F-4E1B4770ADDA.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/0AB53AAC-E236-9A4A-A6F0-361EC3F3AA92.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/0D52DC44-250C-4941-9436-70323A9C6C6F.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/08201211-53A4-6046-92C3-F0561738E343.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/0993B06C-0946-8442-B405-5646CC72487B.root -/store/relval/CMSSW_10_6_0_patch2/RelValDisplacedMuPt2To100/GEN-SIM-DIGI-RAW/106X_upgrade2023_realistic_v3_2023D41noPU-v1/20000/055AC571-ED6A-CB46-8A94-86C2CBF2A331.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleElPt1p5to8/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleElPt1p5to8/PU0.txt deleted file mode 100644 index affadffa2b97b..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleElPt1p5to8/PU0.txt +++ /dev/null @@ -1,50 +0,0 @@ -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/F57DA310-DFC2-E943-999F-3BA11BC2D4FA.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/F18BA5AE-4FFA-3D4A-B556-A39DC44F098A.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/F508911C-301C-1040-B531-2643F5096C6C.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/EAA6F3E0-9D75-2449-AFC6-74A4928ADE2E.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/ECA39377-0177-FA4F-BBA2-EECC1363F12F.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D4D17D1F-3B29-9345-AB19-43036484A456.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/E8F98948-223A-3741-B1FD-DB5DD681F2F8.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/CF43B4E9-412B-9A48-81BD-3F4665F0BBC4.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D0DA0E35-E0B9-B349-84A4-289EA0BEABA6.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C684E80C-5D36-CC4E-9D57-537F454BF057.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C6C29F27-28B0-FF4F-92BF-1282CA775B46.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/BB6EE695-ECFF-E94F-A706-022E9900E9ED.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/BDE874DB-3EB1-4E46-8C35-AA25ACD6234B.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/B7B22FDD-6D6D-9C4D-A206-63F4576CDA98.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/BB660ACA-479C-4147-A5AF-E4AA43730A45.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/AB14BA9B-01DD-894C-9920-03BBB1D288E3.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/B35C7930-4F1C-D14B-BD66-BA6ED5DB43C9.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A6573A9C-F648-4048-8291-6E4372843E6B.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A97F40AD-BBCA-1848-80C4-C51D6FB6FF9C.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A4262F29-5133-A14B-A132-D68DFDB4FD4B.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A6088BA1-8C2E-8347-BEC5-8B774EF1C565.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/94C1BF23-3E76-3749-ADA8-5C3F5EC83A3B.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/9E6C24EC-31DD-C242-8065-F6E426345F2A.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/90FDF0CD-8237-7E46-8DE6-1CCB0B688CB0.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/91B6FFA3-5BBE-B848-BFA2-A61973E8CEDD.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/8F335803-B82A-2E4F-9F75-8C6AF873AE7C.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/90A7CA82-84A1-D648-978B-2A7B32525DF2.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/70587E35-7CF4-E647-A744-79199DEF242A.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/7C9FA114-5022-0F43-8C90-50988BB0629A.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6DD828CF-CDCC-8D47-83DB-BFF459BFF931.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6EC6F5AA-8A73-FD4B-9C6B-DC7A06219565.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/662314BB-FAA9-2E4E-BCF8-B4FA73296A90.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6A947024-E346-3247-A4EE-DA22FD93C399.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/5A74AFCC-301D-2247-86BC-47561C1933B3.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/5AB84838-20BF-9341-8A6F-3B42A0CDAEAA.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/52D65D3C-554F-3440-8A44-004344DA3A9C.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/559AE4D6-F89C-A544-9948-B84C847F63A4.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/4878B3C1-84F0-D74F-AFDE-679C4EBD3427.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/503B5EA3-D245-8846-AA0B-E24C0B97CDD1.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/46880BCC-391E-CD40-9E38-30F1FEE58AEB.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/4767A5A7-9483-E849-BC48-C90A486B8C60.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/3E8990D3-1FE0-CF4E-ABE8-E443CD4FA146.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/4347C013-40E7-9147-966E-8D940EB24427.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/3CD1D65D-375D-7441-97B1-473AA273AB33.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/3DBD82A7-6881-3649-B960-F21FC3F80626.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/2E90F28B-41F5-DA45-AA0C-90DFA3176FB8.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/3421D134-AAED-444F-9180-5549F75288B0.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/067F7B0C-66D0-6A41-B6D3-A694DF1106B4.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/08F9223B-93C2-0F40-9453-A4BAF5EF175B.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/05557BB4-78D3-194A-A24A-96266FB9ADA2.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleElPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleElPt2to100/PU0.txt deleted file mode 100644 index 2f8f95a59b47c..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleElPt2to100/PU0.txt +++ /dev/null @@ -1,51 +0,0 @@ -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/FEFC256A-A20B-C24F-A2D8-923178B9C666.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/E8D52160-7E21-7843-97A8-3D07DF178A1A.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/EAAEA1C3-8403-FF46-A35C-A097591AC473.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/E1A05D32-8450-284B-9AE5-701C14D14A78.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/E4C03E6C-5CAC-8448-8440-551C5D89C325.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D901712A-A249-BA4A-836B-C686F0928765.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/DA7BE535-0D49-164A-A2F8-B6F0DB934336.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D1F7A03D-B1F7-664E-9FDC-D44EEC81211B.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D6F2B027-6C37-734B-A6BC-51C9E84D40E5.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/CCE4532E-B841-CF44-94D2-A67A3BB2C8C3.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D07ED56A-6079-0B46-97BE-2668A2D73914.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C69526BE-4F68-1441-82A5-D0073FE866D3.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/CA3435C2-38E1-124A-A2CA-9EA2AA546296.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C438031E-3350-6A48-B7D7-7953BE22AEF2.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C533F28B-786E-2645-96BD-7EE092BFA48C.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C38DE343-CA56-9346-8218-DE65C07E4003.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C3A50426-D4C2-C84A-AC9E-B7251984DF12.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/BFFCFAAC-27C9-7A42-9A45-1F486B37484A.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C08F71B3-8F06-D446-A3C4-FF20A5ECFEA6.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/B8D05768-00B9-6148-90A6-CB282ED03B52.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/BF98E513-307D-4C46-AF5C-3B95A7A2D4D2.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/B3771023-E32A-4947-A4DD-4903BD070E92.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/B43B51A3-2068-474E-812E-A184BDA19986.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A8915DC1-F327-5048-BEDD-4841D63CC13E.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/AC0A02D5-6D16-C04D-8A10-FD1C50F2D0E0.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A607A4ED-DD85-E94C-8FD2-8C32BFB94188.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A7CF2B8E-5C92-2B4C-9C93-CAA5C49DDC57.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/9324BDD7-C0B0-304A-8F9E-A4D85B2E492A.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/99434B33-7554-C644-93EE-D67F9151CE9F.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/8914183F-3CA7-2947-856B-43849D4301D3.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/8D440807-81CB-D245-9BD8-8E54E523CAA7.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/7C98A1E8-F103-864D-A78A-6100AAB86C98.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/85FD682D-98AC-EF47-95E6-DA66A476F77E.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6A298091-931F-864F-A4D0-1FBA18985DB0.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6E77CE4C-E3D6-7B4A-82DA-06023879352D.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/627A8A0E-BBED-0F48-89ED-34D256336644.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/64EA553E-2FA5-6D45-AB52-D6A120D132C8.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/5616F374-DAA8-7B40-B5FC-9829EE31F6FE.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/5FBB13DB-5E66-084D-818B-74ECA5133C54.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/5245A3C2-296D-8B44-A9AF-4C751FEA1C75.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/52B02872-D82A-4C4B-AF8F-E67DE7EA6809.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/3ED17E43-2A16-B744-91D7-AE786F061356.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/4E4FB4B4-4156-4E4B-9BA5-0B657FBCC35E.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/351D9699-6E0D-E049-8E7B-EF8CF2FDD32E.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/363EDCC6-FE8D-4A46-BFB5-D42D42262BB8.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/24D52702-0648-BF40-86EA-FCA14F645E6D.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/2A0F3624-5540-4F45-B769-301EB2645DAC.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/1C5CCD51-86ED-4E48-90A0-F9650EE76A9F.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/21B172D4-4542-DF40-8B8A-6F5D26FD9994.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/0155DF53-DE7A-144E-96BC-C7FE967D24D7.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleEFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/0517AC4E-F3B0-7F4E-8ADE-4360D853CF77.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleMuPt1p5to8/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleMuPt1p5to8/PU0.txt deleted file mode 100644 index b98306766fd5f..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleMuPt1p5to8/PU0.txt +++ /dev/null @@ -1,50 +0,0 @@ -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/F751FB56-51DC-0A4E-B7E4-311F47D3D68F.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/EA96AA1B-33FE-E840-8745-3F866373DC68.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/EC89CA05-F93D-0C41-AAD7-36045D8F11A5.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/DD328472-DB4A-ED4E-BD6E-1FD6B7A3C0BE.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/E86449F0-9D91-9F42-96C5-97C3A84642B2.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D03F5F4C-8975-5747-82E8-1659482C247A.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D1B4EA28-5BA9-7B4B-982A-B67AE72E3601.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C73A6999-7546-E14B-830F-5805CA3BB76A.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C836FB27-7F81-3146-AED9-C860B93B26A9.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/BA23EB9A-7078-A944-8243-DB51BD8806A3.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C5C705D5-0B4D-514E-9849-47A56D4CCC42.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/B0C962FA-DA23-874E-A238-0E4927D06FDC.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/B2F28CAE-8FAD-404C-B6B2-71BCA0152C80.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A6F63CC2-D50A-EB41-BF42-64798BF9FDA4.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A91B4FDF-F606-8E41-A56F-ED7A3931ADB9.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A1F8EFB0-BF55-4340-AA4E-493E65564E60.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A527BF86-35B1-864F-B0F8-99C31117272E.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/97B43937-B131-6E4E-9D78-F36C813D82AB.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/9AE9BCC7-3031-AA48-B53C-5795FD7DFEFE.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/8B37C3EC-3BE5-8042-B215-D55DCAD3FF42.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/977FA15C-6D74-D54C-B490-96E24B706060.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/8176CC78-0BC4-384A-B36A-E33A976DFEA6.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/8A09474E-D43C-B742-B4E3-63BF22578261.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6C52A883-8F62-664D-B578-DA26C3C72555.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/72934908-0B40-EF44-836D-EC8E7477EADC.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/67B585C4-D26A-0A45-BEFA-C99E997DD026.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6A003F9C-5CA9-1C45-8822-05F49DC002F6.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/59E96F12-169A-1748-BC1B-75CDFF6BF553.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/64445E23-4334-DD4A-B87B-D5C63ECD3BD2.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/57C1C795-B52E-6740-B38F-0083EC43892F.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/588E290D-AF50-FE46-BFD9-C58A8A094509.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/51100FED-9D99-F442-957B-3694A1559B49.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/518FEF44-D0DC-4046-BAAE-116C5BB83C70.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/50780A39-AB78-8041-8E42-70F570B7C789.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/507CF4F2-F7B8-DF4B-B4F4-B74CA7881AB0.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/3D664658-E863-B44A-B032-E2185391B3DC.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/4AD503E1-13D4-D341-97AB-5D134A58B435.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/27A6EF0C-4D95-3246-85D4-5000075A1911.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/2E1CF017-0087-5D4F-8BEE-1E8B292FE60A.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/26E5F589-B492-8547-98D9-BA6705277905.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/26FB54CA-CB91-374A-B26A-FA9F15DFDF01.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/1B7C4498-ECF9-0943-8150-09CD192A94F6.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/25F4532A-DA89-1C4B-A835-2432682C3808.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/1518AA47-340F-8A45-BBCC-4F0D6A0718D9.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/1B54A0E1-A4C4-6D43-8DE3-AF474B25B37D.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/13288A85-FDDE-6042-9060-DE1B84B34DA9.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/145EEB15-A2EC-9C43-9B6C-65D800388118.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/0A4FED94-E53A-7F4B-9E60-0CCC99F4AB5A.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/0D09289A-35F9-034B-9F7B-02FEA25584F2.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt1p5To8/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/038341FA-0E1F-DF41-A407-1F8CAD954B62.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleMuPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleMuPt2to100/PU0.txt deleted file mode 100644 index 8a1079df028fb..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/SingleMuPt2to100/PU0.txt +++ /dev/null @@ -1,50 +0,0 @@ -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/FDFAED78-D3CA-A44D-9BDC-E9FB3133EBD2.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/F9EE8F78-1EB2-D647-99D3-D361CD62FADE.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/FDA937D1-BB09-B244-8076-B973DA0B77B3.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/F4B3E089-2089-3842-9B2D-FCD081D5F51D.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/F93D5E93-439D-C645-BF61-9D12B644A663.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/E6B6976D-70AC-634C-8B18-2AFE85DD1C30.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/F403A759-446D-F64E-BE4E-430993C4636B.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/DAB315AE-9565-F546-9774-2FBC2E58B10C.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/DEE2C072-2B14-C544-B366-6DC9F98245C3.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D95C1470-EA43-7C40-97CF-D158846BB556.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D9A589CE-E011-774A-991A-CF1DB8BC0BAF.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/CA9DB597-30A3-5B4A-9E4F-E1DB216D4339.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/D87BE0BE-D8F8-5D4E-B61C-1F53445B0F6D.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/BA35600C-C21B-C34D-BFF4-6E1CF79B60D1.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/C0A8E214-A9F1-D34E-A972-C608A4C3F8C0.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/B0FAF141-EE41-B44B-9BFF-78DF6E95A9FD.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/B91047A7-6B4C-7D4D-910F-422316D05EA5.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/9EBF9B1B-295D-DE4D-85A5-E0F00CE3F9CB.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/A4676075-9E5F-8540-9528-840B250671DC.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/99142434-7472-DC4E-ABCD-92B1A2444EBD.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/9A251258-5523-6A42-A9D3-0383D74CB057.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/984DB0E0-43D6-4F42-9439-B2B1B0B27F82.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/99071470-A67B-CF49-A30F-477D92CAC1B0.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/9289990F-BEA4-6B44-A704-85F778601D7E.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/96596EBC-912E-4B48-8719-7031F0EE1117.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/8A1D92C4-65D3-EA41-92B0-C67AB6B79CD7.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/91AB272A-9444-DE41-A285-78C15A7E2EA4.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/7CA60F55-6EF6-7345-B524-779154AC2785.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/7E1B4ADD-CCFB-7146-AA2D-503EDBF168CF.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/7176ABAC-4284-624D-BFB3-E5A7B2EFCB05.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/75398907-A200-D24D-A8CA-9D912B56C489.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6F66A0E2-9937-1342-B9F2-04BA3B5BE0EA.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/709B1224-9A19-CE4E-B0EE-98696F6D14DC.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6AB44314-E551-7747-936B-AF931AAD8AEF.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/6BE6B86F-D3F6-834A-A6FB-9D92AF8BAEC1.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/5D42CCB2-1662-EF4E-B315-DBB6AF76B818.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/697CC3BE-4712-0342-BD17-085A914DA193.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/4334F931-B1DC-AC4D-A40D-FA8ABA6E8DB7.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/5163CD63-3B10-B54E-AF4E-FE93E83DBFB0.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/318A3D3F-7EA7-0046-85DE-D759BBD45301.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/386D7F7B-D120-0D4A-91A0-FB5BD0BB963D.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/306E7B67-F05F-0548-A12D-9D5CBBFBE08E.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/30D4FF72-5E46-8E4D-BA28-5798EAF22119.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/218997EF-E88F-7440-A5A0-6A858281B45D.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/2FE64AA8-D671-D642-8C52-089E587CE2B3.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/1D02C496-3CCC-C644-8AB6-8E566997D750.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/2175819C-84A1-604F-AF0D-6B0A2CD167B4.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/0CB3D988-066D-5A44-994C-F6BA65F9A17F.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/15FEF07B-0E1B-4D46-B6D9-22CB09734BA1.root -/store/relval/CMSSW_11_1_0_pre2/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_HS_2026D49noPU-v1/10000/03C3A272-54BF-3341-92FD-C8484DFCBB3F.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/TTbar/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/TTbar/PU0.txt deleted file mode 100644 index c83ca139acdb0..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/TTbar/PU0.txt +++ /dev/null @@ -1,10 +0,0 @@ -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/E69DE8B3-6117-A94F-A5A9-84A481F15013.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/D5E4A5FE-993C-1848-8EC5-B61134EC23D8.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/AEF88B74-5FA6-CD4A-AB7F-4017FB7388E7.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/98728AF9-B10F-964B-AA44-746FE1B4E9E4.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/96AEEF21-E8CC-2341-8AC6-F9816BFA0915.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/8AC03800-3995-4943-8DD8-0A2DF92148D7.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/7C9D3EE5-1DE8-BE44-A481-C6AA6167F06E.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/4FC41F00-C32F-CF4E-B171-B15C72E195B6.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/4A5CAF82-FBA2-C545-B253-A7A7CD7846D0.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/13492D88-2B80-1F44-8F5D-2BFF035C594E.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/TTbar/PU200.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/TTbar/PU200.txt deleted file mode 100644 index 009ed708369aa..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/TTbar/PU200.txt +++ /dev/null @@ -1,100 +0,0 @@ -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/F7BF4AED-51F1-9D47-B86D-6C3DDA134AB9.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/F70AFCD2-89B3-2343-8ADA-D2101F96943B.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/F33F8D29-C834-B34C-AC6A-4C96BCC9A626.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/EFC9D9D3-09DC-304D-80E1-3A14B9E8CDDD.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/EEF2AE4F-EAF2-5645-B18F-99261DE20003.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/EDDFE6B7-2090-454D-AC74-6383EF7BAC4E.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/ED1C5441-CA4C-A141-8357-21C0B53B0107.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/EAAFC2A1-1B42-E646-9BF9-97044C55DEF2.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/EA9FB146-B4C3-3C43-8659-85C6B10FC102.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/E7C703EB-C0A4-3444-ABB9-238C073B6F30.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/E4B9F995-B581-A745-B146-2266946D269B.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/E38860B8-5CAA-8E40-A173-15A491C48A46.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/E076979E-F794-6340-9BD8-9C80481932C2.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/DD2840D0-C847-CF45-910F-96F7234A4AB9.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/DA54D201-326E-FD42-8699-F6CA199478E5.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/D903A49C-8165-FD42-9BD6-0D7CEFB0E59B.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/D752C9B8-89AC-3649-92D5-2FACDB833DA2.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/D73F6913-CED3-394F-B0D1-E69021C5940D.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/D5AD94EF-A51F-BC46-BFFC-55CE950C5DA8.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/D127EC6A-24A3-CF4C-8B26-F236DF38B418.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/D0436FCF-E73E-5047-8CC1-B791848B33E8.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/CDC8A949-25CC-3645-A617-5888DC969ACC.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/CC8648C6-9020-4049-8989-1BE3E1045F52.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/C6D01D89-518D-C34C-AC6C-82C2EEB25704.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/C1A6E047-C20B-4346-B847-D59F44DB8C1C.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/BEB07086-4E62-7545-B0EA-EE306EF92A57.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/BCCF6391-B91C-ED4E-BEA3-E6D1BAEA6525.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/B71CD44D-7699-EE47-8EC6-7B98ED5F0D37.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/B71175A4-6640-264E-96A1-EA60A71E687E.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/B68E4FF0-2F65-A745-9B16-49B291679529.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/B6353549-F404-E343-93D8-698C63493460.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/B4570A24-6039-3849-B5AA-9CC98C722DB8.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/B3EB6DEF-07BC-1143-88E8-AD6CEA05F715.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/B1839A4F-F4FE-D843-B6C1-8BA2D8195A68.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/AFC3379F-D527-6A4A-905F-102190D1F075.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/ADFDD787-F9A5-F646-B627-58D5C1A34721.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/A517206D-00A2-CF40-A354-5B553A5573C1.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/A17BCA6E-D522-164F-9248-8F601F2207B0.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/9E73DD8E-C0B8-AC4F-A53D-81FB5FF4D922.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/982FA6CD-1981-2B4A-B2F9-94A94D6E7954.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/958D174C-B205-4248-BD39-322615577DC5.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/9413EFAC-E403-0B4F-94ED-A4FA03B43671.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/938709BA-9908-B54C-95A5-94A199AC27D8.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/92C9BD7D-8AD3-7C4C-97A0-94514F29BA07.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/908BA86F-B138-F841-86D1-58F5E0F8F121.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/8DF72AEC-169D-D14C-8EE6-E6A6622F3822.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/8BC0C5A2-B50D-354C-A1FB-94F195FE467D.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/81E3120B-EAED-6F4C-99C3-2B3083239EE5.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/7F8D9344-621E-8749-BB29-FC3CB2B1142A.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/788F43AF-569B-3748-93D6-27AB2946C6E3.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/7697ABFB-53DE-FC4A-AE37-11218470D07F.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/757AACFA-5A51-DB4D-A684-787AB07CFEB4.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/718AC8A2-8216-AB45-9F10-BD00572655F8.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/6E43C4E5-2B01-474A-B513-8F8324D932E6.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/6C9CC922-4951-BB47-B80D-21A3EAB8AD15.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/69338A51-59F6-EF4F-9C0A-077704617D76.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/66B8F718-404C-FA4F-BF85-5D3948E26942.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/6490C99E-2941-8142-BC26-432E09E3A3D5.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/634006F2-1387-1744-92C3-51ED13493A62.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/61C06970-5F68-6041-B55A-1007E2ED5481.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/5C1CC8BB-45D0-CA4F-AC74-59325A4E7DE9.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/5AC85DC4-D7B4-5244-AE50-E764FC3E4F86.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/59C43C41-2C92-0643-BB04-F21C05CFF574.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/58EB68DB-8D00-A84D-B988-936113E7BC92.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/57153022-7C25-1640-AE8C-9709EADCCF36.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/510FCEF9-0932-5143-822B-6378FE079BAB.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/50177436-CB29-BC4C-98D0-BDA85BEEB08E.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/4D57281D-3A89-1E42-9AB2-DB80BB399FC0.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/4CFAFEFE-C788-2E48-9BF6-B1676E82A62E.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/4A507D16-B591-E84E-9B90-0C729F0318B5.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/47E643B6-15AD-1F49-A574-E9562F5DC995.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/43CD9DCA-43CE-0C40-95BC-8FD95EC8700C.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/41F50E4D-5B5D-1A43-BD24-31D610D4A0E0.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/3F8518A0-5ADB-C240-A40B-C02D1123A8FB.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/3EF5B3E6-9690-6746-9E5B-0B263F6961CE.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/3E81E27A-6471-2B42-BFC3-2042187A43B6.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/3DE1B87A-8B3B-5740-B53F-6666A93CAED6.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/3BFAC80B-14E8-894A-823F-12B4E01767B2.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/3B3E10DA-177D-F342-AC2F-A6135B12B38F.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/3696DF04-0EC1-144D-8B60-654C92D5F54A.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/362DBABD-40F9-B04E-9870-CE0E77E87EB3.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/337BCFC8-2EDA-EC41-9757-5C305ADB9106.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/313C02BA-692A-F147-8607-9FAB44E693B7.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/2E42F494-7EF1-6848-8165-4E43D4E45E83.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/2D153BE5-611B-3E40-B3D1-E1D5A35A53E6.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/2C3F5156-3A3C-074D-9F89-462EC5E6E058.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/2B390F84-395E-D44B-8E4E-4ACB9F526817.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/26321D7B-7A96-E442-B644-C4BED07AA807.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/25D90FC3-49EF-7448-89F6-935F8D4BB8AC.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/20A54E94-A2D2-FA4A-B5F7-DFF768ACC6F5.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/1F59B52D-BD93-CA4A-BB59-64E00A436EEF.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/1D2905A5-5CB9-BB41-8C59-64427CEE7082.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/19678708-B88E-A547-884E-CD1D924B2D3C.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/1818154D-11CB-9841-932A-A48845A430B6.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/176B2AC1-57AA-DE46-85FC-D375D25C4C2A.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/11564303-DE2D-474D-99ED-F4CB2793C5FB.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/09C2F689-B97E-6C44-94D2-C76445A4D703.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/07EEAB60-C58E-6146-804B-6BA1B8E14875.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/075DCEC8-A2E9-7E48-A630-E1CBF89370A9.root -/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/01816581-F04F-B849-83AA-38A348F9320B.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/README b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/README deleted file mode 100644 index 35e346522a0e5..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/README +++ /dev/null @@ -1,7 +0,0 @@ -RelVal/ contains CMSSW 9.3.7 RelVal samples requested by the P2 L1 trigger group. -They are made with Seb Viret's Dec. 2017 stub window sizes, -which you can find in CMSSW 9.3.7 in file L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py . -They are slightly looser than the 9.3.2 samples. -The MC was made with the D17 (=T5) tilted tracker geometry. - -Typical dataset name /RelVal*/CMSSW_9_3_7-*upgrade2023*/GEN-SIM-DIGI-RAW diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/OnlyPU/PU200.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/OnlyPU/PU200.txt deleted file mode 100644 index c2bf9623feb89..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/OnlyPU/PU200.txt +++ /dev/null @@ -1,255 +0,0 @@ -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/004A0CD1-112D-E811-920E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/00CFFD4F-172D-E811-B95B-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/00EB7027-1A2D-E811-914D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/00F26841-1A2D-E811-9D15-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/020C1E68-0E2D-E811-81B0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/021AA3E0-112D-E811-A48C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0226F031-0D2D-E811-AF84-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0248687C-0F2D-E811-8329-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/02901C68-0E2D-E811-BDEE-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/02F951DA-112D-E811-9F62-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0450346F-192D-E811-83F3-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/04AAF20F-152D-E811-BD9D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/04C3334A-172D-E811-8831-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/04EB0170-0A2D-E811-AB55-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/062F18CD-142D-E811-9B5A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/083B705D-192D-E811-AFFA-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/087FF21A-182D-E811-8E03-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0895404B-1A2D-E811-9CF2-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/089AB08F-102D-E811-8911-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/08B7C261-192D-E811-BE98-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0A16B83F-172D-E811-B040-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0AA1034D-1A2D-E811-B8A3-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0AE7331A-182D-E811-89AE-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0AF1C266-0A2D-E811-A8CC-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0EA28FD0-142D-E811-BC43-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0ED12B6A-192D-E811-9622-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/100CC233-182D-E811-B84C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/102431CE-142D-E811-980D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/10646866-0A2D-E811-9B71-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/12B6F031-0D2D-E811-8F60-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/12C68550-172D-E811-9F51-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/14ECED28-132D-E811-A5E5-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1600844F-0E2D-E811-91C6-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/160B7B46-1A2D-E811-83A0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/16A4884D-172D-E811-A3A9-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1802046B-192D-E811-8100-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/184C394D-172D-E811-A86C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/18502219-182D-E811-B85E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/18B77F13-182D-E811-AA5B-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/18ED3DD3-182D-E811-8FD1-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1A1C0F27-182D-E811-870C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1A39DFD1-112D-E811-B854-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1ACCF333-122D-E811-ABE3-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1AFE0FCA-142D-E811-8F4C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1C0DD329-132D-E811-BE04-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1C22CB21-182D-E811-908C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1C8C6B4E-0E2D-E811-9FBD-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1CCACC4F-0E2D-E811-B7BB-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1CCF4472-192D-E811-86BE-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1CD14574-192D-E811-9634-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1E27E929-182D-E811-9BE9-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1E46D09F-192D-E811-9745-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1E74A9DC-112D-E811-9966-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/206367FD-142D-E811-8092-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/20731343-092D-E811-B5C4-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/20D27A4B-172D-E811-B827-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/20E391D0-142D-E811-810A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/20E7E95B-192D-E811-B310-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2216A33C-0D2D-E811-80A2-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2293B93F-172D-E811-B33A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/22C2FA4C-172D-E811-B991-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/22D24E48-172D-E811-9B7F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/244D4366-192D-E811-BB53-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/24A21720-182D-E811-9AE9-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/24A7F251-1A2D-E811-ABD6-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/24ADF942-172D-E811-9964-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/24EFC529-182D-E811-9073-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/26058B48-172D-E811-BEEB-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2674BFF9-172D-E811-826B-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2679DB4C-172D-E811-A5FE-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/268D01E3-142D-E811-BF79-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/26E95840-132D-E811-8802-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2801B228-0D2D-E811-A671-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2822DA39-172D-E811-96E8-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2A4BA246-0D2D-E811-890A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2A7EAD49-172D-E811-93C8-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2AF9AF2A-182D-E811-B065-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2C2D4D53-172D-E811-AB48-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2C379C47-1A2D-E811-81D9-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2E26EA49-1A2D-E811-87D0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2E2D376F-192D-E811-9BBB-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2E4FD73B-172D-E811-BFEF-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2EAE274B-172D-E811-AEC2-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2EC45A6E-0F2D-E811-A3FF-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3084FD0E-142D-E811-AE5C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/30AF356F-192D-E811-B985-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/30F1120A-192D-E811-8D0D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3206F148-172D-E811-84FA-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/32445E29-182D-E811-8DDD-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/32A5E5A2-102D-E811-B95B-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/34E6133A-172D-E811-ACBF-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/361EA749-172D-E811-BFF5-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/36A73914-182D-E811-A330-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/36E744B1-162D-E811-AEE1-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3849F429-0D2D-E811-BAFB-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3A4DEE5E-192D-E811-AAF9-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3ADA3C3A-172D-E811-A9A0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3ADCF646-0D2D-E811-8A9A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3ADDAE60-172D-E811-9FE1-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3C5F9020-152D-E811-843D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3C7D3044-1A2D-E811-85DF-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3C83B23E-1A2D-E811-9D5C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3CBBF557-172D-E811-93C6-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3E0A0F39-172D-E811-AA40-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3E1AD1CF-172D-E811-A55F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3E27A2E3-112D-E811-BEAA-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3ECAFCE2-142D-E811-A220-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4008353B-172D-E811-BC3C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/402AD2E7-142D-E811-B030-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4051BFDB-112D-E811-900C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/40631ED9-112D-E811-962C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/40BD3F50-1A2D-E811-AD0B-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/40E2B10A-142D-E811-A757-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/42215043-1A2D-E811-B746-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/425FF3DF-142D-E811-9E27-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/44644515-182D-E811-97BD-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/44674FCF-142D-E811-9948-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/447D4114-182D-E811-9137-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/449DCAE3-172D-E811-AD96-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/44C3B028-0D2D-E811-9371-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4608803F-172D-E811-B577-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4632C327-122D-E811-8E2E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4652B1BF-112D-E811-8627-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/46D7F71A-182D-E811-9836-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/480973A6-192D-E811-92A2-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4861F429-0D2D-E811-BAC0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4A05F433-122D-E811-9264-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4A657E2A-182D-E811-B10B-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4C057041-092D-E811-8131-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4CC3C180-192D-E811-BA01-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4E213A30-192D-E811-83FD-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/509ED54D-092D-E811-BB58-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/50F18EB8-0F2D-E811-A81E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/522D7339-172D-E811-9234-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5239B120-182D-E811-9F3B-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/524D6BD5-172D-E811-82BD-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/525A0870-0A2D-E811-8FB0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5275EBA4-132D-E811-B523-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/529C663D-1A2D-E811-A3C3-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/52A7666A-192D-E811-A6FB-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5409F529-0D2D-E811-9D26-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5495CA3B-0D2D-E811-9F98-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/54AA703F-172D-E811-929D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5697C56C-192D-E811-9560-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/58273B50-1A2D-E811-8AED-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5A18F35C-122D-E811-90CC-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5A1D4167-0A2D-E811-B4C7-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5A6C3F50-1A2D-E811-B3E0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5ACFCA2B-192D-E811-90AB-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5AFCBA7C-0F2D-E811-BCB5-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5C0E363A-132D-E811-9B84-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5C655A41-092D-E811-8D7A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5C7DE3A2-102D-E811-A7FF-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5C8E9964-0A2D-E811-9BBB-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5C93E3A5-102D-E811-9AFB-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5CEAD031-132D-E811-A861-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5E18623A-0D2D-E811-8970-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5E59E63F-1A2D-E811-82D2-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5EAE9863-172D-E811-9EFB-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5EF15CCB-112D-E811-8F79-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5EF410F0-172D-E811-89E8-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/600B5231-182D-E811-908C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6014945D-192D-E811-B327-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6040E29C-192D-E811-A0B3-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/60491517-182D-E811-AE94-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6212C84B-1A2D-E811-A2CE-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/62408C3D-182D-E811-8AB4-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/62B3D273-192D-E811-82F4-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/62BC762B-142D-E811-808B-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/643EAC31-182D-E811-A08C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/644ECF66-0A2D-E811-92CD-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/64F5EE3F-1A2D-E811-BFE8-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6693E320-182D-E811-B2BD-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/66F4E94B-172D-E811-B661-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6849DA4C-1A2D-E811-A4D0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/684AEACD-142D-E811-95CC-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/687A7E3E-172D-E811-A5B7-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/68BF4AAD-0F2D-E811-A80F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/68EF5DC9-142D-E811-A603-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6A035175-192D-E811-924B-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6A08AA31-182D-E811-BDB8-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6A19584B-172D-E811-8CAC-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6A8D4C2D-182D-E811-854A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6A8D8ED0-142D-E811-BFA1-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6C3F234E-172D-E811-B71F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6E3BB27D-0F2D-E811-BDF9-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6E79C035-1A2D-E811-BA60-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7006F41A-182D-E811-ADD4-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7013C23B-0D2D-E811-84D3-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/702DC130-182D-E811-9E7D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/70490E36-182D-E811-B311-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/705A7972-192D-E811-960C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7067DC17-182D-E811-AB2E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7074E7B8-132D-E811-A38B-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/70D59C3F-172D-E811-B2EC-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/70DBD46D-0A2D-E811-8216-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/72044E2A-182D-E811-B8B0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/721AD514-182D-E811-B175-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/722857DA-172D-E811-AA20-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/723A1343-092D-E811-9D0C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/729850CE-142D-E811-9E3A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/72BFD825-182D-E811-96C8-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/72CB3F66-0A2D-E811-99AF-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/72F6904F-0E2D-E811-AE05-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/74201E28-182D-E811-81B8-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7459394D-172D-E811-A47B-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/749A1B39-172D-E811-9D92-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/74C1C427-122D-E811-948F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7664FD6F-0A2D-E811-9F89-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/76B8F2DF-142D-E811-AEDC-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7843F411-182D-E811-AC82-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/78D2A428-0D2D-E811-A19C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7A334039-172D-E811-9F99-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7AE3D94D-092D-E811-9915-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7C278F0F-1A2D-E811-9360-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7C958633-182D-E811-AEFC-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7CB13914-182D-E811-9338-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7CDDB02A-182D-E811-8C29-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7CE19D53-172D-E811-BAD2-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7E8861CE-112D-E811-9D12-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7EAFFA2F-132D-E811-A57F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7EF82CCF-112D-E811-A876-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/808C3C32-182D-E811-93E7-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/820B376F-192D-E811-BC2D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/82F21518-142D-E811-A94F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/84151A09-182D-E811-8FEC-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/84509244-1A2D-E811-B8F7-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/845EDCDB-112D-E811-B698-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/864B8F64-0A2D-E811-8B5A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/86DB343B-172D-E811-B0D2-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/86E6482A-132D-E811-8C45-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/880D5378-192D-E811-88C7-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/88932485-192D-E811-9A1A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/88EE04D1-142D-E811-8FEE-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8C035FEF-142D-E811-95F2-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8C0B7563-192D-E811-B678-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8C0E9E9A-102D-E811-AF3E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8C3CDE43-0D2D-E811-9CE3-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8C4AAC79-192D-E811-823D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8C775373-192D-E811-AEC3-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8EBE2147-1A2D-E811-A81D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/90A16EB9-112D-E811-A2A6-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/90C9261E-182D-E811-842E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/92590328-182D-E811-8D81-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/925EF031-0D2D-E811-B4AE-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/946AAF76-192D-E811-A820-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/94854872-192D-E811-AB9A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/94C63914-182D-E811-8B28-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/96123D2C-182D-E811-AA27-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/96A08019-182D-E811-9962-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/983D40CD-142D-E811-947D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/98B3EC29-182D-E811-A384-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/9A190450-0E2D-E811-8C73-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/9A8051AD-102D-E811-8995-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValNuGun/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/9C17A749-172D-E811-B53F-0242AC130002.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleElPt1p5to8/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleElPt1p5to8/PU0.txt deleted file mode 100644 index 92a67fc7ecb17..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleElPt1p5to8/PU0.txt +++ /dev/null @@ -1,50 +0,0 @@ -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/00336161-6E52-E811-92F4-0CC47A4D7618.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/0414E3B8-6952-E811-A8C8-0025905B8606.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/04D3D1BA-6952-E811-9E87-0025905A606A.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/0A146427-6A52-E811-9309-0CC47A4C8E2E.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/0CE1F0A4-6852-E811-8C87-0CC47A4D7698.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/16C8B740-6A52-E811-BDF6-0025905B859E.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/16FD4E3A-6852-E811-8117-0025905A608E.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/22A78AB0-6952-E811-A05B-0025905B85EC.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/2AEA1827-6A52-E811-9372-0CC47A7C34D0.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/2C6AB2C0-6952-E811-8A9B-0025905A605E.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/2E9B2443-6A52-E811-83C9-0025905A6090.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/38ACBF0D-6752-E811-893B-0CC47A7C3430.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/4267E529-6A52-E811-B0B3-0CC47A78A408.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/4EE31D32-6A52-E811-B1E3-0CC47A4D7658.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/527BAD42-6A52-E811-995E-0025905A6104.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/52D50725-6A52-E811-8FEE-0CC47A4D7632.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/589A1D2D-6852-E811-B3B8-0CC47A4C8EC6.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/5E62FC23-6A52-E811-8DAE-0CC47A78A2F6.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/629ED0AB-6952-E811-84A5-0CC47A4D7678.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/66C79E34-6852-E811-AC2D-0025905A6118.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6C32E86D-6A52-E811-A388-0CC47A78A45A.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/703C51B1-6952-E811-9D89-0025905B85B6.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/764FD04F-6A52-E811-AE28-0025905B85BC.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/76C26521-6852-E811-A96B-0CC47A4C8F10.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7A6E89A1-6952-E811-BAC9-0CC47A7C3412.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7CD701B5-6852-E811-ABF5-003048FFCC16.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8672FD28-6852-E811-B1C5-0CC47A4D760A.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8A6F9FAC-6952-E811-8E6C-0CC47A7C3572.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8E3FEBAA-6952-E811-8260-0CC47A78A3F4.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8E5081BD-6952-E811-AA4C-0025905A60CA.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/92C2B19F-6852-E811-80C7-0CC47A4D76A0.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/9453EF36-6A52-E811-9F73-0025905B8610.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/964C49B5-6952-E811-BC63-0025905A6084.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A21C4169-6E52-E811-84F0-0CC47A4C8E66.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A226222D-6A52-E811-AEC8-0CC47A4D768C.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/AA697728-6A52-E811-A900-0CC47A4D7618.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/C600C928-6A52-E811-BCBF-0CC47A4D767A.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/C69FC0A7-6852-E811-9EF6-0CC47A78A408.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/CAB6ED0B-6752-E811-80C2-0CC47A7C35D8.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/CC891600-6B52-E811-89A6-0025905A607E.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D86412B0-6952-E811-B77C-0CC47A4C8E66.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E03A9D37-6A52-E811-9A58-0025905B860E.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E2B73F3E-6A52-E811-BB67-0025905A48E4.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E6C4541F-6852-E811-B93E-0CC47A7C35B2.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/EE672D2D-6852-E811-B4D7-0CC47A4C8EC6.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/EEB78D25-6A52-E811-AE15-0CC47A4D75F6.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F8A5EC41-6A52-E811-80C0-0025905B8572.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/FA2D17B6-6952-E811-9BDC-003048FFD7A4.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/FA85CE3C-6A52-E811-80E2-0025905B85AE.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/FCFB2F40-6A52-E811-B8B7-0025905A605E.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleElPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleElPt2to100/PU0.txt deleted file mode 100644 index e029eeed1ca07..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleElPt2to100/PU0.txt +++ /dev/null @@ -1,100 +0,0 @@ -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/0C3D349F-6F52-E811-9B6E-0CC47A7C3444.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1000C104-6B52-E811-90EA-0CC47A7C347A.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1256DBA6-6F52-E811-A6B7-0CC47A78A456.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/127E5873-6C52-E811-8879-0CC47A74525A.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/12A80FA1-6C52-E811-B49F-0CC47A78A360.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/144B6EEF-6A52-E811-B9E6-0CC47A7C3434.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/14E8805C-6C52-E811-8E00-0025905B855C.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1608059D-6C52-E811-B71E-0025905A60B2.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/162DB4BB-6F52-E811-A8C9-0CC47A4D7638.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/16B1720F-6B52-E811-A9DD-0CC47A7C3432.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1888ED9B-6C52-E811-B9FD-0CC47A7C35C8.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1A871AE3-6A52-E811-AEAE-0CC47A7C357A.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1E092FF3-6A52-E811-B1B2-0CC47A4C8ECE.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1E4661A2-6A52-E811-AA03-0CC47A4C8E20.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1EC9CE25-6A52-E811-BB7C-0CC47A4D768E.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/206B337F-6C52-E811-817E-0CC47A78A456.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/22370253-6A52-E811-B285-0CC47A4D76AA.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/28A97427-6A52-E811-83F5-0CC47A4D7674.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/28CEA5EE-6A52-E811-95C1-0CC47A78A33E.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/2A09D9C4-6A52-E811-B1EE-0CC47A4D769A.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/2C4C7CB2-6C52-E811-B2EA-0CC47A4D76B2.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/2C709192-6C52-E811-A5E7-0CC47A4D76B6.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/2E3E92EB-6A52-E811-BD61-0CC47A4C8E70.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/36B3B743-6B52-E811-80ED-0CC47A7452D0.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/38773942-6B52-E811-850E-0CC47A7C345E.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/3AB66F92-6C52-E811-B767-0CC47A4D7692.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/3AE576A9-6A52-E811-BEBD-0CC47A4D7640.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/4452EBA7-6C52-E811-9CB8-0025905B85D0.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/46353D18-6B52-E811-87B7-0CC47A4D769A.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/4AA14FAD-6C52-E811-90CF-0CC47A4D75F2.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/4C579A06-6B52-E811-A74A-0CC47A4C8F10.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/50C5DAEE-6B52-E811-B9F8-0CC47A4C8F0C.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/523681C7-6A52-E811-AFC5-0CC47A4D75F8.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/52744EB2-6F52-E811-A703-0CC47A7C3430.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/52BAB2BC-6F52-E811-B78E-0CC47A7C3410.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/5469014F-6A52-E811-8317-0CC47A4C8E1E.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/5A30DB1E-7152-E811-90AB-0025905B85C6.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/5AED78E8-6A52-E811-842B-0CC47A78A418.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/5E8DA40E-6B52-E811-8E03-0CC47A7C340E.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/5EBE9DA8-6F52-E811-8A47-0CC47A4D76B2.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/620E51AB-6F52-E811-B5D9-0CC47A4C8E2E.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6212B416-7052-E811-ACB4-0CC47A4D75EC.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/66FF2C57-6B52-E811-B5CB-0025905A6138.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/68499F7E-6C52-E811-AD28-0CC47A7C345C.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6AC84C0B-7052-E811-BB59-0CC47A4D7646.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6C8A8B04-7E52-E811-96B4-0025905B860C.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6CAD7ADD-6A52-E811-A603-0CC47A4D769A.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7021CDB3-6A52-E811-810B-0CC47A7C35F4.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7C099B5E-6C52-E811-8AB6-0CC47A4D7694.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7C9372DB-6A52-E811-B580-0CC47A4D769A.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7CA97C87-6C52-E811-9009-0CC47A4D75F6.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7CBE8DE0-6A52-E811-A2C2-0CC47A4C8EB6.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8242BDFE-6A52-E811-9AB0-0CC47A7C34EE.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8E0A49B3-6F52-E811-B4C1-0CC47A4D760C.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8E13A6D9-6A52-E811-8451-0CC47A4C8E38.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/92141E99-6A52-E811-A08B-0CC47A7C34E6.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/92C44BDE-6A52-E811-BE4A-0CC47A4C8E20.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/9444C0AE-6C52-E811-B599-0CC47A4D7602.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/94A74875-6A52-E811-BE0E-0CC47A4D7650.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/94E0F325-6C52-E811-B08F-0CC47A4D7640.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/984E9F3A-6C52-E811-8729-0CC47A4D7628.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/9A0F1EC8-6A52-E811-91A7-0CC47A7C340E.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A0D3787B-6A52-E811-8B0A-0CC47A4C8EBA.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A27617FB-6A52-E811-AD58-0CC47A7C3424.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A4DFBFAE-6C52-E811-9929-0CC47A4D75F2.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A6F4F6F8-6A52-E811-B2F1-0CC47A4C8F06.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/B460B226-6C52-E811-805A-0CC47A7C35C8.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/B8B8F1BE-6F52-E811-813E-0CC47A4C8E26.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/B8F569C8-6A52-E811-B790-0CC47A4D7628.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/BCE848E3-6A52-E811-9C59-0025905A60AA.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/C068039B-6A52-E811-8563-0CC47A4C8F0C.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/C0780312-6B52-E811-BCF7-0CC47A4D7604.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/C0FDE1C2-6A52-E811-ACF0-0CC47A7C3432.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/C81F207E-6A52-E811-8DA5-0CC47A4D7630.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/CC052205-6B52-E811-90F1-0CC47A4D7668.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D065A0B9-6F52-E811-ACF9-0CC47A4C8EE2.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D0886A4D-6C52-E811-A397-0CC47A4C8EB6.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D0BA6589-6C52-E811-B130-0CC47A4D76B6.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D25280C7-6A52-E811-B16E-0CC47A4D75F8.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D46EA5E8-6A52-E811-B36E-0CC47A78A33E.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D6105C7D-6C52-E811-8DEA-0CC47A7C35D8.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D645D7FF-6B52-E811-98B3-0CC47A4C8F30.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E00A760B-7052-E811-B11E-0CC47A4C8E46.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E0E3118D-6A52-E811-9847-0CC47A4D7634.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E24C0971-6A52-E811-9E8B-0CC47A7C35A4.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E282984F-6C52-E811-96CB-0025905B8580.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E2EC3257-6A52-E811-B910-0CC47A4D76B2.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E4B89184-6A52-E811-9B3B-0CC47A4C8F18.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E4D61F97-6A52-E811-8581-0CC47A4C8E1E.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E4DB1C36-6A52-E811-8A0E-0CC47A4C8E2E.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E6799F62-6B52-E811-B4E0-0025905A60FE.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/EA3AEA3E-6B52-E811-8227-0CC47A4D7650.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/EC5E949F-6C52-E811-9DED-003048FFD722.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F0CDC3A9-6F52-E811-9EFB-0CC47A4C8F18.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F2B553A8-6F52-E811-9398-0CC47A4C8E1E.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F4066326-6C52-E811-8B66-0CC47A4D767C.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F406A615-6C52-E811-BBF6-0025905B85EC.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F6BD280D-6B52-E811-BA3D-0CC47A7C354A.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F8B31C68-6A52-E811-ADFB-0CC47A7C3628.root -/store/relval/CMSSW_9_3_7/RelValSingleElPt2to100_pythia8_cfi/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/FC250EBA-6A52-E811-89E5-0CC47A7C35B2.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleMuPt1p5to8/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleMuPt1p5to8/PU0.txt deleted file mode 100644 index 467b74f455c46..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleMuPt1p5to8/PU0.txt +++ /dev/null @@ -1,50 +0,0 @@ -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/FEBA9927-7152-E811-9B7A-0025905B8568.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/FE373C8B-7052-E811-93A7-0025905A48F2.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F696B871-7052-E811-BE34-0CC47A7C34B0.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F4FE6E22-7152-E811-8AC9-0025905B85EC.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E83A3F08-7252-E811-A594-0025905B8604.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E661D430-7152-E811-8BF8-0025905A60D2.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E649CC04-7252-E811-880A-0025905A6092.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E4DBB901-7052-E811-9610-0025905B859E.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E21B050F-7552-E811-BBBB-0025905A6080.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D4C0040F-7552-E811-88FF-0025905A6080.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D0BA8CFF-7452-E811-B466-0CC47A78A4B0.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/CEC8390F-7552-E811-8838-0025905A6080.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/CABCCD1C-7552-E811-9CE2-0025905A60BE.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/CA0A8985-7652-E811-B79C-0025905B8586.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/BEE7EEFF-7452-E811-B3E5-0CC47A78A4B0.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/BCD6FC86-7052-E811-A91C-0025905AA9CC.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A4B7BD89-7052-E811-B6A4-0025905A48D0.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A4ADF40A-7252-E811-8EA2-0025905A60CA.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/9605527E-7052-E811-94AC-0CC47A7C357E.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/94DE3C99-7552-E811-849F-0025905A60B8.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/909F2D96-7052-E811-AADD-0025905A6056.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8EB0C6EE-6F52-E811-AC25-0CC47A78A3EC.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8A0B7371-7652-E811-BD76-0CC47A745294.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8859F41C-7152-E811-BF0A-0025905A6068.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8856F320-7152-E811-BCB5-0025905A608C.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/884710FB-6F52-E811-8DEC-0025905B85B6.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/84FA4F07-7052-E811-9072-0025905A60F2.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7C21FC50-7452-E811-A432-0025905A48EC.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7A9A278F-7052-E811-B292-0025905B85CA.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/745AB60A-7052-E811-B55E-0025905B859A.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/744B5304-7052-E811-B9DF-0025905A6056.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/72777912-7152-E811-86C4-0CC47A4D769C.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/70BD8FFF-7452-E811-876A-0CC47A78A4B0.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/708FDF17-7252-E811-AEE6-0025905A60D6.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6E4ABB38-7152-E811-A9F9-0025905A6122.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/66E0EFD6-8352-E811-B3EA-0CC47A7C3610.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/4E5AC476-7652-E811-B7DA-0025905B85D0.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/4A0A040F-7552-E811-95BE-0025905A6080.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/426FD099-7552-E811-8EC3-0025905A60A8.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/3C5C3A99-7552-E811-B355-0025905A60B8.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/3A1FD122-7152-E811-918C-0025905B856C.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/243C6212-7152-E811-9121-0CC47A7C3572.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1AAD96FF-7452-E811-B349-0CC47A78A4B0.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1A57289B-7052-E811-9CCE-0025905A60D2.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/16B41C8A-7052-E811-B46A-0025905A60BC.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/14A80923-7152-E811-BA26-0025905B856C.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1214D970-7652-E811-BBB7-0CC47A745294.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/10D5FB2F-7152-E811-9E76-0025905A60DA.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/0CCD938B-7052-E811-A5E6-0025905AA9F0.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt1p5to8_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/0C1BAE0E-7152-E811-936E-0CC47A7C3422.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleMuPt2to100/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleMuPt2to100/PU0.txt deleted file mode 100644 index a61f0d4d491db..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/SingleMuPt2to100/PU0.txt +++ /dev/null @@ -1,52 +0,0 @@ -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F6D3B679-6E52-E811-8C70-0CC47A7C340C.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F68DDB96-6D52-E811-8513-0025905A612E.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F68123B9-6452-E811-B081-002618FDA287.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/F4F37A93-6D52-E811-9F50-0025905B85CC.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E63A6F9D-7252-E811-82F7-0025905B85C6.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E2FB8A8C-6E52-E811-ACBD-0025905A610C.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/E0BE5BA6-7252-E811-BB28-0025905B85D6.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/DEA4E795-6D52-E811-9638-0025905A6104.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/DC2B7506-6D52-E811-98DD-0CC47A4D765E.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/DC12E17A-6E52-E811-9674-0CC47A7C34B0.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D4810B8B-6D52-E811-9A66-0CC47A4D7658.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D471BD89-6D52-E811-A145-003048FFD7AA.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/D26DB583-6D52-E811-867C-0CC47A7C35E0.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/CAED0EF4-6C52-E811-B25A-0CC47A78A2F6.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/CABC829C-7252-E811-B76D-0025905B8564.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/BEC05905-7252-E811-9AA6-0CC47A4C8EE8.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/BEBE5AFF-6452-E811-AF4F-002618FDA26D.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/BE1FC391-7252-E811-B4FE-0CC47A7C349C.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/BADEC899-7252-E811-B420-003048FFD772.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/BA2C647E-6D52-E811-9C26-0CC47A78A33E.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/BA125E99-7252-E811-ADD9-0CC47A7C3612.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/B4FF1280-6D52-E811-9260-0CC47A7C356A.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/AE8245A3-6D52-E811-A826-0025905A60BE.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A45128E8-7152-E811-8888-0CC47A7C34B0.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/A2FB1DA4-6D52-E811-A4C5-0025905B859A.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/8ED1A8B0-6452-E811-812E-003048FFCBB2.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/86D757B9-7252-E811-A5CF-0025905A6060.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7AEED198-6D52-E811-999B-0025905B85AE.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/7815B08F-6E52-E811-B7A8-0025905A60CA.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/725DE17C-6D52-E811-92BF-0CC47A4D7626.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6EB0E596-6E52-E811-86B4-0025905A60D6.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6E80DEA1-6D52-E811-B5D9-0025905A609A.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6CBB91F7-6C52-E811-8B5B-0CC47A7C34B0.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/6A63A97F-6D52-E811-BA93-0CC47A4D7618.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/5435E6EB-7152-E811-A496-0CC47A4D76D6.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/4C5AA39A-7552-E811-8719-0025905A60A8.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/46733D82-6D52-E811-8FD9-0CC47A4C8E26.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/3EBF2AFC-7152-E811-B41B-0CC47A7C3450.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/3A6209A1-7252-E811-8FFC-0025905B8604.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/386C3B94-6D52-E811-AA4C-0025905B85E8.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/381C859A-6D52-E811-A826-0025905A605E.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/36D3ECA5-7252-E811-A4CD-0025905A48C0.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/36B6B9FE-6452-E811-A5FB-003048FFD75A.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/2ADE08A9-7252-E811-957D-0025905B860E.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/28C4258A-6D52-E811-9E89-0025905B860E.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/1A4AD28D-6D52-E811-9EC4-0CC47A4D76D6.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/12BDE8A2-7252-E811-A2BA-0025905A60BC.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/129F0580-6E52-E811-9243-0CC47A4D7678.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/0884E09C-6E52-E811-859E-0025905A48E4.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/080BCD98-7252-E811-BA0D-0CC47A4D7678.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/062E8EA2-6D52-E811-B8CD-0025905B85BC.root -/store/relval/CMSSW_9_3_7/RelValSingleMuPt2to100_pythia8/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v1/20000/046366A6-7252-E811-A27A-0025905B855C.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU0.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU0.txt deleted file mode 100644 index 41d9cd7edb5f1..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU0.txt +++ /dev/null @@ -1,10 +0,0 @@ -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/0E1785F0-762C-E811-9192-0CC47A78A4BA.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/7EB68679-782C-E811-A2C9-0CC47A4D7690.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/7EC7DD7F-782C-E811-B469-0CC47A4D76A0.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/886F551E-7E2C-E811-9D10-0025905A608C.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/A05308F4-762C-E811-ACC0-0CC47A78A360.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/AC64F3F2-8D2C-E811-AEA8-0025905A611E.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/B0D7BD76-782C-E811-AED2-0CC47A7C35F4.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/CE1930F1-762C-E811-B9F4-0CC47A78A468.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/D86D2DA6-752C-E811-8E90-0025905B856C.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/93X_upgrade2023_realistic_v5_2023D17noPU-v2/10000/EEFED097-752C-E811-B621-0CC47A4C8E22.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU140.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU140.txt deleted file mode 100644 index df8fdfdf6accd..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU140.txt +++ /dev/null @@ -1,90 +0,0 @@ -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/00E0EA0C-0552-E811-B526-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/00E74E32-0652-E811-B314-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/02B4E45C-FE51-E811-A1D5-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/047CAE45-FF51-E811-A30C-0242AC130006.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/0A5AB1BB-0152-E811-A750-0242AC130003.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/0A6E39D1-2752-E811-94BE-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/1619B013-FE51-E811-8F5E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/18FED4E8-FE51-E811-802F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/1A2F1DC1-0552-E811-97A1-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/1A340846-FF51-E811-8817-0242AC130006.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/1ABE32AC-0252-E811-9523-0242AC130005.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/1C18F569-FE51-E811-B6BD-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/1C5E0946-FF51-E811-9F6F-0242AC130006.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/22D73BF7-0552-E811-AAA6-0242AC130003.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/243E0846-FF51-E811-A742-0242AC130006.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/262C5578-FE51-E811-993D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/26E2EFE9-FF51-E811-91BD-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/28107BA5-0652-E811-A11C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/2AA3B4E2-2752-E811-B83E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/2CC5536B-0452-E811-ACCE-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/2E030364-FE51-E811-A450-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/2ED3E2E9-0452-E811-8DC9-0242AC130005.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/2ED5AA00-0652-E811-A84C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/2EECFFA7-0652-E811-B712-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/340B6BFA-0552-E811-9228-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/36EE0946-FF51-E811-97B1-0242AC130006.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/3A733CF7-0552-E811-B617-0242AC130003.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/441A0C46-FF51-E811-9D36-0242AC130006.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/44987660-0652-E811-9200-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/44E7DE67-0152-E811-8E7A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/4C073CF7-0552-E811-8E6E-0242AC130003.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/524D142C-FD51-E811-BD24-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/5290A49D-FE51-E811-B833-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/54792320-FE51-E811-949D-0242AC130003.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/5E51B145-FF51-E811-8654-0242AC130006.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/626AB89E-0452-E811-8289-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/706B34DB-0052-E811-A9C6-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/7A2821E3-FE51-E811-91E3-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/7C6841F7-0552-E811-9EC1-0242AC130003.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/7E2FE277-FD51-E811-9A3B-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/82790A46-FF51-E811-97D4-0242AC130006.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/844527E3-FE51-E811-9DBA-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/84AB41F7-0552-E811-AECE-0242AC130003.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/84C0D9E8-0252-E811-9F82-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/84EAF8EF-0252-E811-8612-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/8818BC70-0052-E811-9B0F-0242AC130003.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/887BA339-0652-E811-8620-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/8AA90946-FF51-E811-9152-0242AC130006.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/8AF82AEB-0252-E811-86B9-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/8E670AA4-0152-E811-9A9D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/9091F3AB-0252-E811-903D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/90D18C2D-FD51-E811-9E88-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/94A38A1C-FE51-E811-A63D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/94AFFA2D-FD51-E811-9921-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/94F26173-FE51-E811-AEAC-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/96652A62-FF51-E811-B7A7-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/96D9FCD4-2752-E811-96F1-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/98FD29A2-0252-E811-9DD0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/9E7C4D32-0652-E811-96AE-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/A2ACD82B-FD51-E811-A143-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/AA50DBAA-0652-E811-989C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/AA7BD997-FF51-E811-8EA8-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/AC510846-FF51-E811-804B-0242AC130006.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/ACFA7F2B-FE51-E811-84AB-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/B207F7E0-2752-E811-916D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/B69E641D-0152-E811-BCEA-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/B8E3589E-FE51-E811-99B9-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/C066CF3A-0652-E811-9008-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/C418B7C9-0652-E811-8633-0242AC130003.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/C8C78232-0652-E811-811F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/CC31A4F3-0552-E811-9AF1-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/CE66C2DA-0052-E811-A572-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/D094D66B-FE51-E811-B9D5-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/DA54C127-0152-E811-AE2E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/DADB0268-0252-E811-A9C4-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/DC0EE9F0-0352-E811-810E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/DC2DA9C6-FE51-E811-84CC-0242AC130003.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/E24D42EA-0252-E811-A7B6-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/E4169768-0552-E811-82CB-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/E8343CB8-0252-E811-B78C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/EA77863D-FD51-E811-824C-0242AC130003.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/EED8FE18-FE51-E811-8744-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/F07D0892-0152-E811-A455-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/F275265B-FD51-E811-AE7F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/F4360846-FF51-E811-86A6-0242AC130006.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/F64B8101-0452-E811-B224-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/F8283CF7-0552-E811-8ECD-0242AC130003.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/F83125B8-0252-E811-96B2-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/F8C93BF7-0552-E811-B7B1-0242AC130003.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU140-v1/20000/FCA0DF5E-0652-E811-A0D4-0242AC130003.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU200.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU200.txt deleted file mode 100644 index 334266836482a..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU200.txt +++ /dev/null @@ -1,90 +0,0 @@ -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0A52EE7F-1E2D-E811-86EB-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0A89BB2B-2D2D-E811-8C80-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0C08D3DD-1E2D-E811-8669-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0C12617F-212D-E811-8695-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0E91FECC-1E2D-E811-BF1C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/0EA17A2E-3B2D-E811-89B8-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1055768C-212D-E811-9EC0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/143BBE19-212D-E811-A48D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/14956BF1-1E2D-E811-A63F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/16458099-1E2D-E811-897C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/164D2029-2D2D-E811-A3EB-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/18AAA884-212D-E811-AAFA-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1CAB0C7B-212D-E811-84B9-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/1ED10C85-212D-E811-B2FD-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/20598276-212D-E811-AF79-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/20A2B881-1E2D-E811-934E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2217D914-212D-E811-A4C7-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/22460785-212D-E811-9351-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/22AD2684-1E2D-E811-BE8F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/240F7C77-212D-E811-B318-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2691B4FC-202D-E811-82D9-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2A8005FF-202D-E811-8B27-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2AC9B97E-212D-E811-A693-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/2E186E77-212D-E811-9C2D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/30536F7F-212D-E811-B7E1-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/3629CC78-212D-E811-84A7-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4AC37B84-212D-E811-8953-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4C30D282-212D-E811-9526-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/4E1B1F7B-212D-E811-989A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/52ADC48A-212D-E811-BA57-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/52B6387F-1E2D-E811-91BD-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/546B727F-1E2D-E811-9D5D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/56BC6747-3B2D-E811-BA80-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5A8CFF7F-1E2D-E811-A7B0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/5AE4727F-212D-E811-A96D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/621ED1D8-312D-E811-82F6-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/62419A8C-1E2D-E811-BE46-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6410FC29-212D-E811-9CD0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/6C9C2E7F-1E2D-E811-A8A9-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/723FD030-3B2D-E811-8459-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7601CB82-1E2D-E811-8B9C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/76D59D38-212D-E811-A3A5-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/782AE72D-3B2D-E811-AE9A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7A7C8276-212D-E811-AD5F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7AC76980-212D-E811-BE96-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7C93C87B-212D-E811-9BE4-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/7E9B1E85-212D-E811-B4F1-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/80402401-212D-E811-B274-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8048B779-212D-E811-860F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8083A080-1E2D-E811-8591-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/843BCB78-212D-E811-83A9-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/84A6C1F2-312D-E811-BF38-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/861EEE11-212D-E811-A51E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/865C4C11-212D-E811-BE0E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8699AF75-212D-E811-9BA0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8A9F019A-1E2D-E811-8323-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8CE6F291-1E2D-E811-A3B6-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/8E9E89CC-332D-E811-802E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/90AD2B7F-1E2D-E811-A227-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/9424CEA7-1E2D-E811-8CC4-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/96C39087-212D-E811-900A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/98AA5384-1E2D-E811-905F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/9CD02E8B-212D-E811-BD53-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/9E334E14-2D2D-E811-A15F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/9E95E182-1E2D-E811-999B-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/A6B42037-3B2D-E811-B12D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/AAADA982-1E2D-E811-9626-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/ACCD9684-212D-E811-A1C3-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/B0AACD8D-1E2D-E811-823E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/B6DE2D8A-1E2D-E811-81FF-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/B8E3B57F-212D-E811-B3A4-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/BA504282-1E2D-E811-8D49-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/BCA0562D-212D-E811-83DE-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/C2F99780-1E2D-E811-B893-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/C4EB77A2-1E2D-E811-9483-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/C61D1B8A-1E2D-E811-ABC7-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/C8640B92-1E2D-E811-9346-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/C8BA571F-212D-E811-B843-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/D2630080-1E2D-E811-AABA-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/DA82FEDC-1E2D-E811-8EF0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/DE73359D-1E2D-E811-8838-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/E048E112-212D-E811-BC7C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/E0E3B67E-212D-E811-896C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/E4FA8779-212D-E811-8D7A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/E8CA3EEA-2A2D-E811-9A8C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/EA1EEF10-212D-E811-96F6-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/EA79DD97-1E2D-E811-92CC-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/EC5C713F-212D-E811-9874-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/F0EA6A84-1E2D-E811-B0D1-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU200-v1/10000/FCC765BD-332D-E811-A1F2-0242AC130002.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU250.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU250.txt deleted file mode 100644 index 46a050a063567..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU250.txt +++ /dev/null @@ -1,90 +0,0 @@ -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/002B1F49-CB52-E811-81A3-24BE05C63741.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/02E85497-C952-E811-B6C7-EC0D9A822636.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/0628C23A-CA52-E811-BD61-00000086FE80.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/08813486-CA52-E811-A93A-E0071B6C9DE0.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/08FCDDD8-CB52-E811-9FBC-E0071B691B81.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/10ED0B4F-CA52-E811-8209-24BE05CE3EA1.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/1488B538-CA52-E811-AB11-EC0D9A8222DE.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/1AFBC13A-CA52-E811-96BB-00000086FE80.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/1CFCDDD8-CB52-E811-B3C5-E0071B691B81.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/1EBD109F-C952-E811-AB57-24BE05C63681.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/22D1EB97-C952-E811-8420-24BE05CE1E01.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/2400F95D-CA52-E811-A562-4C79BA320D0D.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/242457DC-C952-E811-A9B3-24BE05C6E7E1.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/26689D9B-C952-E811-B7EB-9CDC714A4A10.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/2A8CEC97-C952-E811-80C9-24BE05CE1E01.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/2AF0F85D-CA52-E811-A066-4C79BA320D0D.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/2EEFB047-CB52-E811-A04E-24BE05C63651.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/32A97B4B-CB52-E811-93EB-24BE05C4D851.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/32BF390E-CB52-E811-84C3-E0071B73C610.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/384A5139-CA52-E811-A44E-24BE05CEEDE1.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/3A16D69B-C952-E811-B82A-5065F381B211.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/3C19563E-CA52-E811-9C0D-EC0D9A82264E.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/400F64D7-C952-E811-A645-5065F3815221.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/4034B538-CA52-E811-9909-EC0D9A8222DE.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/4057C23A-CA52-E811-AD8B-00000086FE80.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/4C743486-CA52-E811-9AC4-E0071B6C9DE0.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/5027BADC-D752-E811-91C7-EC0D9A8221D6.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/52AF3D0E-CB52-E811-B394-E0071B73C610.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/54A52E3A-CA52-E811-AE1E-E0071B7A8560.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/566BCA9A-C952-E811-841A-00000086FE80.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/5815DED8-CB52-E811-88B5-E0071B691B81.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/5AFADDD8-CB52-E811-9334-E0071B691B81.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/5CAA0C4F-CA52-E811-9FD1-24BE05CE3EA1.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/5E9B64D7-C952-E811-9F0A-5065F3815221.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/5EA8F85D-CA52-E811-851C-4C79BA320D0D.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/60010C4F-CA52-E811-B5D5-24BE05CE3EA1.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/662357DC-C952-E811-8CA6-24BE05C6E7E1.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/6636B538-CA52-E811-AE84-EC0D9A8222DE.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/6A64CD51-CB52-E811-AA26-24BE05CECBD1.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/6A9C414B-CB52-E811-894F-24BE05CE4D91.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/6E9D4A39-CA52-E811-B60C-24BE05CEEDE1.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/72BE109F-C952-E811-B7F9-24BE05C63681.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/7457CA9A-C952-E811-8C67-00000086FE80.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/74594EE6-CA52-E811-B240-EC0D9A822636.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/7460D6D9-CA52-E811-AEF3-4C79BA181349.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/760BA23E-CA52-E811-945F-E0071B73B6B0.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/7A49CB82-CA52-E811-80B7-EC0D9A8221EE.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/7CA7C900-CB52-E811-B60E-5065F381C251.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/7E193586-CA52-E811-8F57-E0071B6C9DE0.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/7E37B538-CA52-E811-AF0A-EC0D9A8222DE.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/8216EB4B-CB52-E811-AAAC-24BE05C33C81.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/8233C23A-CA52-E811-B68C-00000086FE80.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/84B1B8BD-CB52-E811-B94D-5065F3819241.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/8A142A3A-CA52-E811-B0B7-E0071B7A8560.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/8AE7DA9D-C952-E811-8892-5065F3813282.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/8E05CB9A-C952-E811-8B15-00000086FE80.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/8EC4054F-CB52-E811-9356-24BE05C3FBB1.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/92737C3C-E152-E811-A54C-E0071B73C640.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/9E3D0488-C952-E811-B670-E0071B74EC20.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/A05CD6D9-CA52-E811-8F96-4C79BA181349.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/A416703C-CA52-E811-B371-EC0D9A8221EE.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/ACFBC264-CB52-E811-AA77-4C79BA181215.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/B2097CD4-CA52-E811-B983-24BE05C63651.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/B2E1CA9A-C952-E811-838A-00000086FE80.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/B40BC23A-CA52-E811-BB93-00000086FE80.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/B80CC23A-CA52-E811-AAED-00000086FE80.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/B8A09DBF-CB52-E811-A52E-EC0D9A8221EE.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/BA7E3486-CA52-E811-A28B-E0071B6C9DE0.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/BCEBC264-CB52-E811-AFC2-4C79BA181215.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/C0E70B4F-CA52-E811-B5FC-24BE05CE3EA1.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/C2B1C900-CB52-E811-A6E6-5065F381C251.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/C487C900-CB52-E811-A386-5065F381C251.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/C495A13E-CA52-E811-A4C9-E0071B73B6B0.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/C655CA9A-C952-E811-9033-00000086FE80.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/C880CA9A-C952-E811-8A41-00000086FE80.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/CA9AC900-CB52-E811-95A8-5065F381C251.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/CAA0F85D-CA52-E811-AACF-4C79BA320D0D.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/D04FC364-CB52-E811-8BAD-4C79BA181215.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/D431B538-CA52-E811-A2ED-EC0D9A8222DE.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/D6951997-C952-E811-97AA-EC0D9A822616.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/D8C2BEC5-CB52-E811-BF08-E0071B74AC00.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/D8E4B8BD-CB52-E811-BDA1-5065F3819241.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/D8F54DE6-CA52-E811-A1E4-EC0D9A822636.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/DC33B538-CA52-E811-89A8-EC0D9A8222DE.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/DC42403A-CA52-E811-B7F5-E0071B7A8560.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/DCB0273A-CA52-E811-9B2E-E0071B7A8560.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/E215E4DA-CA52-E811-8799-24BE05C676F2.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/E6619B89-C952-E811-B43D-E0071B74EC20.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/F4686ED2-CA52-E811-9B9F-EC0D9A82264E.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU250-v1/20000/FC1664D7-C952-E811-885C-5065F3815221.root \ No newline at end of file diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU300.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU300.txt deleted file mode 100644 index 722faf9669da1..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/PU300.txt +++ /dev/null @@ -1,90 +0,0 @@ -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/0056D47E-7457-E811-832B-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/007F97CE-7457-E811-819C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/00DB1768-7757-E811-ACFE-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/022BC179-7457-E811-A9AD-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/04833C5D-7A57-E811-B168-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/0831FF7A-7957-E811-B2F3-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/0A3508D0-7457-E811-9F49-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/0ECDDBB5-7957-E811-ADDA-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/100D6F5D-7A57-E811-B457-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/10CE7FD2-7457-E811-B174-0242AC130003.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/125C7787-7457-E811-94B5-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/12CB823A-7957-E811-9EFA-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/1496ECFF-7757-E811-B006-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/16D26E6F-7A57-E811-BB70-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/1A060465-7657-E811-83D2-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/1AFFD973-7A57-E811-AFE8-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/2609E310-7857-E811-B439-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/2800B03D-7657-E811-8094-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/288F7022-7457-E811-8B0B-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/28AE0875-7457-E811-B06E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/2C0607B6-7957-E811-A6C4-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/2CFA94BB-7457-E811-A70B-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/3646156C-7A57-E811-98F8-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/3882003F-7957-E811-B034-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/42DF101F-7757-E811-8CF0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/443D9F5D-7757-E811-A97A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/46102A74-7457-E811-B7B1-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/46A8AE65-7A57-E811-863F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/48037822-7457-E811-868F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/4ADAF7FF-7457-E811-99FB-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/4C10564D-7857-E811-A75A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/4CA394BB-7457-E811-A772-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/500F88D0-7457-E811-85CC-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/525196CE-7457-E811-800C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/567E2270-7A57-E811-9746-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/56C9904A-7857-E811-BBF3-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/589BFAF0-7557-E811-A6FC-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/5A88F0FF-7757-E811-8ED5-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/5E5792BB-7457-E811-B4EB-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/6010F1AD-7757-E811-AFB8-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/60897A22-7457-E811-B463-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/60C06F4C-7857-E811-99A7-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/66297F6C-7A57-E811-B204-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/6A0F7722-7457-E811-ACD7-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/6E716C3A-7957-E811-B30C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/72A3AC72-7A57-E811-8EA9-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/7423256E-7A57-E811-B75D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/76C6EB3E-7557-E811-B6B3-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/7C6B4E05-7957-E811-80D5-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/80B1BD0B-7857-E811-A0F0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/845DF078-7857-E811-B894-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/860292BB-7457-E811-A5DD-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/88848E7C-7457-E811-B6FA-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/8A84BB65-7A57-E811-9A82-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/8E5ED167-7A57-E811-A66D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/90AC2042-7457-E811-A06A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/9254AC65-7A57-E811-B712-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/963392BB-7457-E811-A843-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/96D5EEFF-7757-E811-9D65-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/982C3CA7-7557-E811-A637-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/989CEF34-7457-E811-B921-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/A01A92BB-7457-E811-A0E0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/A225F414-7557-E811-BDA6-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/A40BC8B9-7857-E811-8D2E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/A40C0C12-7757-E811-A9D3-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/A4D2D783-7857-E811-808E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/A60266B8-7957-E811-9CE6-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/A60FB246-7957-E811-8ED3-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/AA1DFAE6-7957-E811-BD2D-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/AE57405D-7A57-E811-B42E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/B04C9641-7657-E811-985E-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/B2111976-7A57-E811-9BB2-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/B42AABB5-7457-E811-ADB3-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/B611A76B-7A57-E811-A0D2-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/B68F36A8-7657-E811-BE13-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/CA283C3F-7857-E811-B8CD-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/D0660E32-7957-E811-BCE3-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/D0BDEFFF-7757-E811-B29F-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/D667D9B4-7957-E811-A575-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/DE5BA34E-7457-E811-BFB2-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/E2A0AF3D-7657-E811-81D0-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/EA42F071-7A57-E811-A969-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/EA8C4C67-7A57-E811-8DDF-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/F0AA26C5-7857-E811-883A-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/F214DACF-7657-E811-815C-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/F254D969-7A57-E811-B8FE-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/F6069FAD-7957-E811-98F5-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/F80392BB-7457-E811-AFCE-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/F8FE9F4E-7457-E811-BEE7-0242AC130002.root -/store/relval/CMSSW_9_3_7/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_93X_upgrade2023_realistic_v5_2023D17PU300-v1/20000/FADEB8FF-7757-E811-8C4D-0242AC130002.root diff --git a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/localRAL/PU200.txt b/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/localRAL/PU200.txt deleted file mode 100644 index 2c22a08a8ec09..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/TTbar/localRAL/PU200.txt +++ /dev/null @@ -1,44 +0,0 @@ -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/0A52EE7F-1E2D-E811-86EB-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/0A89BB2B-2D2D-E811-8C80-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/0C08D3DD-1E2D-E811-8669-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/0C12617F-212D-E811-8695-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/0E91FECC-1E2D-E811-BF1C-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/0EA17A2E-3B2D-E811-89B8-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/1055768C-212D-E811-9EC0-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/143BBE19-212D-E811-A48D-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/14956BF1-1E2D-E811-A63F-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/16458099-1E2D-E811-897C-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/164D2029-2D2D-E811-A3EB-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/18AAA884-212D-E811-AAFA-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/1CAB0C7B-212D-E811-84B9-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/1ED10C85-212D-E811-B2FD-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/20598276-212D-E811-AF79-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/20A2B881-1E2D-E811-934E-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/2217D914-212D-E811-A4C7-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/22460785-212D-E811-9351-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/22AD2684-1E2D-E811-BE8F-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/240F7C77-212D-E811-B318-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/2691B4FC-202D-E811-82D9-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/2A8005FF-202D-E811-8B27-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/2AC9B97E-212D-E811-A693-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/2E186E77-212D-E811-9C2D-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/30536F7F-212D-E811-B7E1-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/3629CC78-212D-E811-84A7-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/4AC37B84-212D-E811-8953-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/4C30D282-212D-E811-9526-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/4E1B1F7B-212D-E811-989A-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/52ADC48A-212D-E811-BA57-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/52B6387F-1E2D-E811-91BD-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/546B727F-1E2D-E811-9D5D-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/56BC6747-3B2D-E811-BA80-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/5A8CFF7F-1E2D-E811-A7B0-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/5AE4727F-212D-E811-A96D-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/621ED1D8-312D-E811-82F6-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/62419A8C-1E2D-E811-BE46-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/6410FC29-212D-E811-9CD0-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/6C9C2E7F-1E2D-E811-A8A9-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/723FD030-3B2D-E811-8459-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/7601CB82-1E2D-E811-8B9C-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/76D59D38-212D-E811-A3A5-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/782AE72D-3B2D-E811-AE9A-0242AC130002.root -file:/opt/ppd/scratch/tmp/MCsamples937/RelVal/TTbar/PU200/7A7C8276-212D-E811-AD5F-0242AC130002.root From e9c0eed0596c5d3fd0abde512b3de0fc7ae0d676 Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Thu, 2 Apr 2020 09:47:05 +0100 Subject: [PATCH 04/22] Removed old file --- .../test/L1TrackNtupleMaker_cfg.py | 199 ------------------ 1 file changed, 199 deletions(-) delete mode 100644 L1Trigger/TrackFindingTMTT/test/L1TrackNtupleMaker_cfg.py diff --git a/L1Trigger/TrackFindingTMTT/test/L1TrackNtupleMaker_cfg.py b/L1Trigger/TrackFindingTMTT/test/L1TrackNtupleMaker_cfg.py deleted file mode 100644 index 34b8b27649e7b..0000000000000 --- a/L1Trigger/TrackFindingTMTT/test/L1TrackNtupleMaker_cfg.py +++ /dev/null @@ -1,199 +0,0 @@ -################################################################################################ -# To run execute do -# cmsRun tmtt_tf_analysis_cfg.py Events=50 inputMC=Samples/Muons/PU0.txt histFile=outputHistFile.root trkFitAlgo=All -# where the arguments take default values if you don't specify them. You can change defaults below. -# (To run a subset of track fitters, specify, for example: trackFitAlgo=SimpleLR,Tracklet ). -################################################################################################# - -import FWCore.ParameterSet.Config as cms -import FWCore.Utilities.FileUtils as FileUtils -import FWCore.ParameterSet.VarParsing as VarParsing - -process = cms.Process("Demo") - -process.load('Configuration.Geometry.GeometryExtended2023D17Reco_cff') -process.load('Configuration.Geometry.GeometryExtended2023D17_cff') -process.load('Configuration.StandardSequences.MagneticField_cff') -process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgradePLS3', '') - -process.load("FWCore.MessageLogger.MessageLogger_cfi") - -options = VarParsing.VarParsing ('analysis') - -#--- Specify input MC -# options.register('inputMC', 'MCsamples/932/RelVal/eclementMC/TTbar/PU200.txt', -options.register('inputMC', 'MCsamples/937/RelVal/TTbar/PU200.txt', - -# Fastest to use a local copy ... -#options.register('inputMC', 'MCsamples/932/RelVal/eclementMC/TTbar/localRAL/PU200.txt', - -VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "Files to be processed") - -#--- Specify number of events to process. -options.register('Events',100,VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.int,"Number of Events to analyze") - -#--- Specify name of output histogram file. -options.register('histFile','Hist.root',VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string,"Name of output histogram file") - -#--- Specify which track finding algorithms -#--- Options are KF4ParamsComb, SimpleLR, Tracklet, All -#--- Can provide comma separated list -options.register('trkFitAlgo','KF4ParamsComb',VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string,"Name of track helix fit algorithm") - -#--- Specify if stubs need to be produced i.e. they are not available in the input file -options.register('makeStubs',0,VarParsing.VarParsing.multiplicity.singleton,VarParsing.VarParsing.varType.int,"Make stubs, and truth association, on the fly") - -options.parseArguments() - -options.trkFitAlgo = options.trkFitAlgo.split(',') -if 'All' in options.trkFitAlgo: - options.trkFitAlgo = ['KF4ParamsComb', 'KF5ParamsComb', 'Tracklet', 'SimpleLR'] - -#--- input and output - -list = FileUtils.loadListFromFile(options.inputMC) -readFiles = cms.untracked.vstring(*list) -# readFiles = cms.untracked.vstring() -secFiles = cms.untracked.vstring() - -outputFileName = options.histFile - -process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(False) ) - -process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.Events) ) - -process.TFileService = cms.Service("TFileService", - fileName = cms.string(outputFileName) -) - -process.source = cms.Source ("PoolSource", - fileNames = readFiles, - secondaryFileNames = secFiles, - duplicateCheckMode = cms.untracked.string('noDuplicateCheck'), - # Following needed to read CMSSW 9 datasets with CMSSW 10 - inputCommands = cms.untracked.vstring( - 'keep *_*_*_*', - 'drop l1tEMTFHit2016*_*_*_*', - 'drop l1tEMTFTrack2016*_*_*_*' - ) - ) - -process.Timing = cms.Service("Timing", summaryOnly = cms.untracked.bool(True)) - -#--- Load code that produces our L1 tracks and makes corresponding histograms. -process.load('L1Trigger.TrackFindingTMTT.TMTrackProducer_cff') - -#--- Alternative cfg including improvements not yet in the firmware. Aimed at L1 trigger studies. -# process.load('L1Trigger.TrackFindingTMTT.TMTrackProducer_Ultimate_cff') -# -#--- Optionally override default configuration parameters here (example given of how). -#process.TMTrackProducer.TrackFitSettings.TrackFitters = cms.vstring() - - -############################################################ -# Define the track ntuple process, MyProcess is the (unsigned) PDGID corresponding to the process which is run -# e.g. single electron/positron = 11 -# single pion+/pion- = 211 -# single muon+/muon- = 13 -# pions in jets = 6 -# taus = 15 -# all TPs = 1 -############################################################ - -process.L1TrackNtuple = cms.EDAnalyzer('L1TrackNtupleMaker', - MyProcess = cms.int32(1), - DebugMode = cms.bool(False), # printout lots of debug statements - SaveAllTracks = cms.bool(True), # save *all* L1 tracks, not just truth matched to primary particle - SaveStubs = cms.bool(False), # save some info for *all* stubs - L1Tk_nPar = cms.int32(4), # use 4 or 5-parameter L1 track fit ?? - L1Tk_minNStub = cms.int32(4), # L1 tracks with >= 4 stubs - TP_minNStub = cms.int32(4), # require TP to have >= X number of stubs associated with it - TP_minNStubLayer = cms.int32(4), # require TP to have stubs in >= X layers/disks - TP_minPt = cms.double(2.0), # only save TPs with pt > X GeV - TP_maxEta = cms.double(2.4), # only save TPs with |eta| < X - TP_maxZ0 = cms.double(30.0), # only save TPs with |z0| < X cm - L1TrackInputTag = cms.InputTag("TMTrackProducer", "TML1TracksKF4ParamsComb"), ## TTTrack input - MCTruthTrackInputTag = cms.InputTag("TTAssociatorTMTT", "TML1TracksKF4ParamsComb"), ## MCTruth input - # other input collections - L1StubInputTag = cms.InputTag("TTStubsFromPhase2TrackerDigis","StubAccepted"), - MCTruthClusterInputTag = cms.InputTag("TTClusterAssociatorFromPixelDigis", "ClusterAccepted"), - MCTruthStubInputTag = cms.InputTag("TTStubAssociatorFromPixelDigis", "StubAccepted"), - TrackingParticleInputTag = cms.InputTag("mix", "MergedTrackTruth"), - TrackingVertexInputTag = cms.InputTag("mix", "MergedTrackTruth"), - ## tracking in jets stuff (--> requires AK4 genjet collection present!) - TrackingInJets = cms.bool(True), - GenJetInputTag = cms.InputTag("ak4GenJets", ""), - ) - -#--- Run TMTT track production -#--- Also run the ntuple production for each tracking algorithm -process.load('SimTracker.TrackTriggerAssociation.TrackTriggerAssociator_cff') - -process.TMTrackProducer.TrackFitSettings.TrackFitters = cms.vstring() -#--- TMTT tracks : KF4ParamsComb -if 'KF4ParamsComb' in options.trkFitAlgo: - process.TMTrackProducer.TrackFitSettings.TrackFitters.append("KF4ParamsComb") - - process.TTAssociatorTMTTKF4ParamsComb = process.TTTrackAssociatorFromPixelDigis.clone( - TTTracks = cms.VInputTag(cms.InputTag("TMTrackProducer", 'TML1TracksKF4ParamsComb')) - ) - process.L1TrackNtuple_TMTT_KF4ParamsComb = process.L1TrackNtuple.clone( - L1TrackInputTag = cms.InputTag("TMTrackProducer", 'TML1TracksKF4ParamsComb'), - MCTruthTrackInputTag = cms.InputTag("TTAssociatorTMTTKF4ParamsComb", 'TML1TracksKF4ParamsComb'), - ) - process.p_TMTT_KF4ParamsComb = cms.Path( process.TMTrackProducer*process.TTAssociatorTMTTKF4ParamsComb*process.L1TrackNtuple_TMTT_KF4ParamsComb ) - -if 'KF5ParamsComb' in options.trkFitAlgo: - process.TMTrackProducer.TrackFitSettings.TrackFitters.append("KF5ParamsComb") - - process.TTAssociatorTMTTKF5ParamsComb = process.TTTrackAssociatorFromPixelDigis.clone( - TTTracks = cms.VInputTag(cms.InputTag("TMTrackProducer", 'TML1TracksKF5ParamsComb')) - ) - process.L1TrackNtuple_TMTT_KF5ParamsComb = process.L1TrackNtuple.clone( - L1TrackInputTag = cms.InputTag("TMTrackProducer", 'TML1TracksKF5ParamsComb'), - MCTruthTrackInputTag = cms.InputTag("TTAssociatorTMTTKF5ParamsComb", 'TML1TracksKF5ParamsComb'), - L1Tk_nPar = cms.int32(5), - ) - process.p_TMTT_KF5ParamsComb = cms.Path( process.TMTrackProducer*process.TTAssociatorTMTTKF5ParamsComb*process.L1TrackNtuple_TMTT_KF5ParamsComb ) - - -#--- TMTT tracks : SimpleLR -if 'SimpleLR' in options.trkFitAlgo: - process.TMTrackProducer.TrackFitSettings.TrackFitters.append("SimpleLR") - - process.TTAssociatorTMTTSimpleLR = process.TTTrackAssociatorFromPixelDigis.clone( - TTTracks = cms.VInputTag(cms.InputTag("TMTrackProducer", 'TML1TracksSimpleLR')) - ) - process.L1TrackNtuple_TMTT_SimpleLR = process.L1TrackNtuple.clone( - L1TrackInputTag = cms.InputTag("TMTrackProducer", 'TML1TracksSimpleLR'), - MCTruthTrackInputTag = cms.InputTag("TTAssociatorTMTTSimpleLR", 'TML1TracksSimpleLR'), - ) - process.p_TMTT_SimpleLR = cms.Path( process.TMTrackProducer*process.TTAssociatorTMTTSimpleLR*process.L1TrackNtuple_TMTT_SimpleLR ) - - -#--- Tracklet tracks -if 'Tracklet' in options.trkFitAlgo: - process.load("L1Trigger.TrackFindingTracklet.L1TrackletTracks_cff") - process.TTAssociatorTracklet = process.TTTrackAssociatorFromPixelDigis.clone( - TTTracks = cms.VInputTag(cms.InputTag("TTTracksFromTracklet", "Level1TTTracks")) - ) - process.L1TrackNtuple_Tracklet = process.L1TrackNtuple.clone( - L1TrackInputTag = cms.InputTag("TTTracksFromTracklet", 'Level1TTTracks'), - MCTruthTrackInputTag = cms.InputTag("TTAssociatorTracklet", 'Level1TTTracks'), - ) - process.TrackletPath = cms.Path(process.offlineBeamSpot*process.TTTracksFromTracklet*process.TTAssociatorTracklet*process.L1TrackNtuple_Tracklet) - - - -# Optionally reproduce the stubs -if options.makeStubs == 1: - process.load('L1Trigger.TrackTrigger.TrackTrigger_cff') - process.load('SimTracker.TrackTriggerAssociation.TrackTriggerAssociator_cff') - process.TTClusterAssociatorFromPixelDigis.digiSimLinks = cms.InputTag("simSiPixelDigis","Tracker") - process.p = cms.Path(process.TrackTriggerClustersStubs * process.TrackTriggerAssociatorClustersStubs * process.TMTrackProducer) - - -from FWCore.ParameterSet.Utilities import convertToUnscheduled -process=convertToUnscheduled(process) From af62b54e0a69015050f10e4e7123c323c99b64a6 Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Thu, 2 Apr 2020 10:30:52 +0100 Subject: [PATCH 05/22] Removed KF HLS to put instead in external library --- L1Trigger/TrackFindingTMTT/BuildFile_HLS.xml | 36 -- L1Trigger/TrackFindingTMTT/README_HLS.txt | 35 -- L1Trigger/TrackFindingTMTT/hls.xml | 21 - .../interface/HLS/HLSutilities.h | 191 -------- .../interface/HLS/KFParamsCombCallHLS.h | 107 ----- .../interface/HLS/KFconstants.h | 198 -------- .../interface/HLS/KFpragmaOpts.h | 17 - .../TrackFindingTMTT/interface/HLS/KFstate.h | 307 ------------ .../TrackFindingTMTT/interface/HLS/KFstub.h | 208 -------- .../interface/HLS/KalmanMatrices.h | 235 --------- .../interface/HLS/KalmanMatrices4.h | 262 ---------- .../interface/HLS/KalmanMatrices5.h | 313 ------------ .../interface/HLS/KalmanUpdate.h | 63 --- .../interface/HLS/KalmanUpdate_top.h | 37 -- .../TrackFindingTMTT/src/HLS/HLSutilities.cc | 159 ------ .../src/HLS/KFParamsCombCallHLS.cc | 454 ------------------ .../src/HLS/KalmanMatrices.cc | 283 ----------- .../src/HLS/KalmanMatrices4.cc | 176 ------- .../src/HLS/KalmanMatrices5.cc | 208 -------- .../TrackFindingTMTT/src/HLS/KalmanUpdate.cc | 311 ------------ .../src/HLS/KalmanUpdate_top.cc | 44 -- 21 files changed, 3665 deletions(-) delete mode 100644 L1Trigger/TrackFindingTMTT/BuildFile_HLS.xml delete mode 100644 L1Trigger/TrackFindingTMTT/README_HLS.txt delete mode 100644 L1Trigger/TrackFindingTMTT/hls.xml delete mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h delete mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KFParamsCombCallHLS.h delete mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KFconstants.h delete mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h delete mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KFstate.h delete mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h delete mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices.h delete mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices4.h delete mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices5.h delete mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate.h delete mode 100644 L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate_top.h delete mode 100644 L1Trigger/TrackFindingTMTT/src/HLS/HLSutilities.cc delete mode 100644 L1Trigger/TrackFindingTMTT/src/HLS/KFParamsCombCallHLS.cc delete mode 100644 L1Trigger/TrackFindingTMTT/src/HLS/KalmanMatrices.cc delete mode 100644 L1Trigger/TrackFindingTMTT/src/HLS/KalmanMatrices4.cc delete mode 100644 L1Trigger/TrackFindingTMTT/src/HLS/KalmanMatrices5.cc delete mode 100644 L1Trigger/TrackFindingTMTT/src/HLS/KalmanUpdate.cc delete mode 100644 L1Trigger/TrackFindingTMTT/src/HLS/KalmanUpdate_top.cc diff --git a/L1Trigger/TrackFindingTMTT/BuildFile_HLS.xml b/L1Trigger/TrackFindingTMTT/BuildFile_HLS.xml deleted file mode 100644 index ea9a0f673aab8..0000000000000 --- a/L1Trigger/TrackFindingTMTT/BuildFile_HLS.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/L1Trigger/TrackFindingTMTT/README_HLS.txt b/L1Trigger/TrackFindingTMTT/README_HLS.txt deleted file mode 100644 index c68a3732fdc28..0000000000000 --- a/L1Trigger/TrackFindingTMTT/README_HLS.txt +++ /dev/null @@ -1,35 +0,0 @@ -To run the TMTT tracking chain in CMSSW with the HLS version of the KF, you must have -Vivado on your computer, and have set it up by doing something like: - -setenv VIVADO_DIR /opt/ppd/tools/xilinx/Vivado/2018.1 -source $VIVADO_DIR/settings.csh - -Then checkout the TMTT CMSSW software following instructions in https://github.com/CMS-TMTT/cmssw/blob/TMTT_1025/L1Trigger/TrackFindingTMTT/README.md . - -You should then: - -1) cd L1Trigger/TrackFindingTMTT/ -1) mv BuildFile.xml BuildFile_original.xml -2) mv BuildFile_HLS.xml BuildFile.xml -3) Edit hls.xml , changing variable HLS_BASE to point to your local Vivado directory. -4) scram setup hls.xml -5) Set the TMTT cfg parameter: - TMTrackProducer.TrackFitSettings.TrackFitters = cms.vstring("KF4ParamsCombHLS") - -N.B. If using with the Demonstrator SW, also edit BuildFile.xml, to: - -i) Add: - -Notes: - -a) The HLS code is in src/HLS/ & interface/HLS/ - -b) BuildFile_HLS.xml defines a pragma variable USE_HLS , which is used to switch on a few lines of -C++ in TrackFitGeneric.cc that call the HLS code. - -c) In addition to the usual track performance summary, the HLS code prints a summary recording -if any finite bit HLS variables overflowed. - -Specific notes for use with Hybrid tracking: - -d) Edit L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h to define PT_2GEV and HYBRID_FORMAT. diff --git a/L1Trigger/TrackFindingTMTT/hls.xml b/L1Trigger/TrackFindingTMTT/hls.xml deleted file mode 100644 index fef04c0ba8a08..0000000000000 --- a/L1Trigger/TrackFindingTMTT/hls.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h b/L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h deleted file mode 100644 index 07d6fb9498486..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h +++ /dev/null @@ -1,191 +0,0 @@ -/** - * General HLS utilities, not specific to KF. - * - * Author: Ian Tomalin - */ - -#ifndef __HLSutilities__ -#define __HLSutilities__ - -#ifndef __SYNTHESIS__ -// Switch on short debug summary printout at end of job. -#define PRINT_SUMMARY -// Switch on verbose debug printout (but never during Vivado synthesis). -//#define PRINT -#endif - -#ifdef PRINT -#define PRINT_SUMMARY // Print checkCalc summary of bits used per variable. -#endif - -#ifdef PRINT_SUMMARY -//#define PRINT_HLSARGS // Print all input & outputs stubs & states from KF HLS code. -#endif - -#ifdef PRINT_SUMMARY -#include -#include -#include -#include -#endif - -// Copied from /opt/ppd/tools/xilinx/Vivado_HLS/2016.4/include/ -#include "ap_int.h" -#include "ap_fixed.h" -//#include "hls_half.h" -// Gives access to fp_struct used to cast half to ap_fixed. -//#include "hls/utils/x_hls_utils.h" - -///=== Hard-wired configuration parameters. -///=== WARNING: Since this code must be used in Vivado HLS, it can't use the Settings class. -///=== Therefore all constants are hard-wired here, so may break if you change the configuration parameters. - -#ifdef CMSSW_GIT_HASH -namespace TMTT { - -namespace KalmanHLS { -#endif - -// Used to calculate number of required bits, (which are constants downloaded into FPGA). -#define MAX2(a,b) ((a) > (b) ? (a) : (b)) -#define MAX3(a,b,c) (MAX2(MAX2(a,b),c)) -#define MAX4(a,b,c,d) (MAX2(MAX2(a,b),MAX2(c,d))) - -#ifdef PRINT_SUMMARY - -// Detect poor precision in fixed bit calculations. - -namespace CHECK_AP { - -class INFO { -public: - INFO() {} - INFO(std::string className, int intBitsCfg, int intBitsSeenHigh, int intBitsSeenLow) : className_(className), intBitsCfg_(intBitsCfg), intBitsSeenHigh_(intBitsSeenHigh), intBitsSeenLow_(intBitsSeenLow) {} -public: - std::string className_; - int intBitsCfg_; - int intBitsSeenHigh_; - int intBitsSeenLow_; -}; - -class INFO_int { -public: - INFO_int() {} - INFO_int(int intCfgHigh, int intCfgLow, int intSeenHigh, int intSeenLow) : intCfgHigh_(intCfgHigh), intCfgLow_(intCfgLow), intSeenHigh_(intSeenHigh), intSeenLow_(intSeenLow) {} -public: - int intCfgHigh_; - int intCfgLow_; - int intSeenHigh_; - int intSeenLow_; -}; - -// Map containing info about variable ranges in terms of numbers of bits required to represent them. -extern std::map apCheckMap_; - -// Map containing info about integer ranges expressed as numbers, -extern std::map intRangeMap_; - -// Print contents of map about variable ranges at end of job. -void printCheckMap(); - -// Fill info for summary table & check if fixed bit calculation suffered precision loss. -// (Two versions of this function, one for calculations in float which merely notes max & min -// values of each variable for summary printout, & one for finite bit which also checks precision). - -bool checkCalc(std::string varName, float res_fix, double res_float, double reltol = 0.1, double tol = 0.0); - -template -bool checkCalc(std::string varName, C res_fix, double res_float, double reltol = 0.1, double tol = 0.0) { - bool OK = true; - - double res_float_abs = fabs(res_float); - bool res_float_sign = (res_float >= 0); - int intBitsSeen = (res_float_abs > 0) ? std::ceil(log(res_float_abs)/log(2.)) : -99; - - std::string cNameUgly = typeid(C).name(); - std::string cName = "unknown"; - int intBitsCfg = 0; - if (cNameUgly.find("ap_int") != std::string::npos) { - cName = "ap_int "; - intBitsCfg = res_fix.width - 1; // One bit less for sign - } else if (cNameUgly.find("ap_uint") != std::string::npos) { - cName = "ap_uint "; - intBitsCfg = res_fix.width; - } else if (cNameUgly.find("ap_fixed") != std::string::npos) { - cName = "ap_fixed "; - intBitsCfg = res_fix.iwidth - 1; - } else if (cNameUgly.find("ap_ufixed") != std::string::npos) { - cName = "ap_ufixed"; - intBitsCfg = res_fix.iwidth; - } - - if (apCheckMap_.find(varName) == apCheckMap_.end()) { - apCheckMap_[varName] = INFO(cName, intBitsCfg, intBitsSeen, intBitsSeen); - } else { - int intHighOld = apCheckMap_[varName].intBitsSeenHigh_; - int intLowOld = apCheckMap_[varName].intBitsSeenLow_; - if (intHighOld < intBitsSeen) { - apCheckMap_[varName] = INFO(cName, intBitsCfg, intBitsSeen, intLowOld); - } else if (intLowOld > intBitsSeen) { - apCheckMap_[varName] = INFO(cName, intBitsCfg, intHighOld, intBitsSeen); - } - } - -#ifdef PRINT_SUMMARY - -#ifdef PRINT -#define NPRINTMAX 99999 -#else -#define NPRINTMAX 100 -#endif - - static unsigned int nErrors = 0; - - // Check -ve numbers aren't stored in unsigned variables. - if (res_float < 0) { - if (cName == "ap_uint" || cName == "ap_ufixed") { - OK = false; - if (nErrors < NPRINTMAX) std::cout<<"checkCalc SIGN ERROR ("< reltol && err > tol) { - OK = false; - if (nErrors < NPRINTMAX) { - if (intBitsSeen > intBitsCfg) { - std::cout<<"checkCalc TOO FEW INT BITS ("< "< - KalmanHLS::KFstate getDigiStateIn(unsigned int skipped, unsigned int layer, const KalmanState* state) const; - - // Implement NPAR-specific code called by getDigiStateIn(...). - template - void getDigiStateInUtil(const vector& helixParams, const TMatrixD& cov, KalmanHLS::KFstate& stateDigi) const; - - // Convert digitized ourput KF state to floating point, - // both for NPAR = 4 & 5 param helix states. - template - const KalmanState* getStateOut(const KalmanState* stateIn, const StubCluster* stubCluster, const KalmanHLS::KFstate& stateOutDigi, const KalmanHLS::KFselect& selectOutDigi); - - // Implement NPAR-specific code call by getStateOut(...). - template - void getStateOutUtil(const KalmanHLS::KFstate& stateOutDigi, const KalmanHLS::KFselect& selectOutDigi, vector& x, TMatrixD& pxx); - - // This is identical to version in KFParamsComb, deciding if a state passes cuts, - // except that it also checks the cut decisions produced by the HLS KalmanUpdate. - bool isGoodState( const KalmanState &state ) const; - -private: - // Digitisation multipliers - double rMult_; - double zMult_; - double phiMult_; - double inv2R_Mult_; - double d0_Mult_; - // Reference radius in r-phi plane. - double chosenRofPhi_; - // Number of eta sectors. - unsigned int numEtaRegions_; - - // Store the extra info provided by the HLS updator about whether the state passes cuts. - KalmanHLS::KFselect<4> selectOutDigi4_; - KalmanHLS::KFselect<5> selectOutDigi5_; -}; - -// Fully specialized templates must be declared outside class, but inside .h file, to ensure they are found. - -template <> -void KFParamsCombCallHLS::getDigiStateInUtil<4>(const vector& helixParams, const TMatrixD& cov, KalmanHLS::KFstate<4>& stateDigi) const; - -template <> -void KFParamsCombCallHLS::getDigiStateInUtil<5>(const vector& helixParams, const TMatrixD& cov, KalmanHLS::KFstate<5>& stateDigi) const; - -template <> -void KFParamsCombCallHLS::getStateOutUtil<4>(const KalmanHLS::KFstate<4>& stateOutDigi, const KalmanHLS::KFselect<4>& selectOutDigi, vector& x, TMatrixD& pxx); - -template <> -void KFParamsCombCallHLS::getStateOutUtil<5>(const KalmanHLS::KFstate<5>& stateOutDigi, const KalmanHLS::KFselect<5>& selectOutDigi, vector& x, TMatrixD& pxx); -} - -#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/KFconstants.h b/L1Trigger/TrackFindingTMTT/interface/HLS/KFconstants.h deleted file mode 100644 index f61fc57e01385..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/HLS/KFconstants.h +++ /dev/null @@ -1,198 +0,0 @@ -#ifndef __KFconstants__ -#define __KFconstants__ - -#ifdef CMSSW_GIT_HASH -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstate.h" -#else -#include "KFpragmaOpts.h" -#include "HLSutilities.h" -#include "KFstub.h" -#include "KFstate.h" -#include "hls_math.h" // Provides hls::exp(), hls::pow(), hls::abs() -#endif - -#ifdef CMSSW_GIT_HASH -namespace TMTT { - -namespace KalmanHLS { -#endif - -//--- Number of helix parameters for track fit (ignored if running inside CMSSW, aside from z0 cut below). - -static const unsigned int N_HELIX_PAR = 4; - -//=== Configuration of KF data-handling === - -// These params are not used in the KF maths block, but only in the failed attempt at a -// full KF HLS implementation. - -static const unsigned int nKalmanWorkers = 18; -static const unsigned int TMperiod = 143; // clk cycles. Why not 144? - -// Set accumulation period. Latency = TMperiod*numAccEvents + extraClkCounts -static const unsigned int numAccEvents= 5; // No. of events processed in parallel within KF -static const unsigned int extraClkCounts = 50; // Time to get states through worker pipeline. - -// Max #stubs considered by KF per layer per HT track. (Keep less than KFstubN::NID) -static const unsigned int maxStubsPerLayPerTrack = 4; -// Max #stubs considered by KF per HT track. -static const unsigned int maxStubsPerTrack = 16; - -// Max #stubs HT track must have to be defined "hard" -static const unsigned int maxStubsEasy = 10; // If reduced, some tracks have wrong z0? - -// Max allowed skipped layers on easy/hard tracks. -static const unsigned int maxSkipLayersEasy = 2; -static const unsigned int maxSkipLayersHard = 1; - -// Min/max stubs required to output final fitted track. -static const unsigned int minStubsPerFitTrack = 4; -static const unsigned int maxStubsPerFitTrack = 4; - -//=== Configuration of KF maths === - -// Return number of bits needed to contain variable. -//int width(float x){return 1 + hls::ilogb(x);} - -// Digitisation multipliers (from data format doc). -// KF uses same multiplier for r as for stubs in DTC, but one extra bit to accomodate larger range, -// since KF measures r w.r.t. beamline. And it uses r multiplier for z too. - -#ifdef HYBRID_FORMAT -// Taken from smallest stub granularity in DTC in any region of tracker. -// https://twiki.cern.ch/twiki/bin/viewauth/CMS/HybridDataFormat -static const float rMult = 1. / 0.02929688; -static const float phiMult = 1. / (7.828293e-6 * 8); // Degrade tracklet granularity by factor 8 to save bits. -#else -static const float rMult = pow(2.,KFstubN::BR-1)/91.652837; -static const float phiMult = pow(2.,KFstubN::BPHI)/0.6981317; -#endif - -static const float rphiMult = rMult*phiMult; -static const float inv2R_Mult = (phiMult/rMult); -static const float chi2_Mult = 1.; - -// Beam spot length & reference radii w.r.t. beamline. -static const float beamSpotLength= 15.0; -static const float chosenRofPhi_flt = 67.240; -static const KFstubN::TR chosenRofPhi = chosenRofPhi_flt*rMult + 0.5; -static const float chosenRofZ_flt = 50.0; -static const KFstubN::TR chosenRofZ = chosenRofZ_flt*rMult; - -// These boundaries are for tilted tracker geometry. -static const KFstubN::TZ zBarrel = rMult*125.; // Largest z in barrel. -static const KFstubN::TZ zWheel12 = rMult*170.; // Largest z of endcap wheels 1 or 2. -static const KFstubN::TR rPSbarrel = rMult*60.0; // r of PS-2S transition in barrel. -static const KFstubN::TR rPSwheel12 = rMult*66.4; // r below which stub certain to be PS if in endcap wheels 1 or 2. -static const KFstubN::TR rPSwheel345 = rMult*64.6; // r below which stub certain to be PS if in endcap wheels 3, 4 or 5. - -static const float bField = 3.81120228767395; -static const float cSpeed = 2.99792458e10; // Speed of light (cm/s) -static const float invPtToInv2R = bField*(cSpeed/2.0e13); -#ifdef PT_2GEV -static const float minPt_HT = 2.; // Range of Hough transform -#else -static const float minPt_HT = 3.; // Range of Hough transform -#endif -static const float inv2Rmin_HT = invPtToInv2R*(1./minPt_HT); - -static const float kalmanMultScatTerm = 0.00075; // Same as cfg param of same name in CMSSW TMTT code. - -// Phi sectors -static const float TWO_PI = 2*3.14159265; -static const int numPhiSectors = 18; -static const float phiSectorWidth = TWO_PI / numPhiSectors; - -// Bit shift *_bitShift to calculate HT cell from ap_fixed (phi, inv2R) of helix params. -// Chosen such that pow(2,+-shift) = (dcBin_digi, dmBin_digi) calculated below. -// (where sign diff is because in KalmanUpdate.cc, one is used to shift right & one to shift left). -// Adjust if you change bits assigned to stubs. -enum {phiToCbin_bitShift = 7, inv2RToMbin_bitShift = 4}; // Shift right & left respectively to get (c,m) -enum {BCH=KFstateN::BH1-phiToCbin_bitShift, BMH=KFstateN::BH0+inv2RToMbin_bitShift}; - -// Size of HT array -static const int numPhiBins = 64; -#ifdef PT_2GEV -static const int numPtBins = 48; -#else -static const int numPtBins = 32; -#endif -static const ap_int minPhiBin = -numPhiBins/2; // BCH & BMH should be larger than BC & BM to monitor overflow. -static const ap_int maxPhiBin = numPhiBins/2 - 1; -static const ap_int minPtBin = -numPtBins/2; -static const ap_int maxPtBin = numPtBins/2 - 1; - -/* -static const float dcBin = numPhiBins / phiSectorWidth; -static const float dmBin = numPtBins / (inv2Rmin_HT); -static const float dcBin_digi = dcBin/phiMult; // = pow(2,-7) -static const float dmBin_digi = dmBin/inv2R_Mult; // = pow(2,4) -*/ - -// Eta sector boundaries in z at reference radius (assumed symmetric). -// (As this is complex, ROM initialization fails unless stored in a class ...) - -class EtaBoundaries { -public: - enum {nSec=8}; - - EtaBoundaries() { - static const float eta[nSec+1] = {0.0, 0.20, 0.41, 0.62, 0.90, 1.26, 1.68, 2.08, 2.4}; - for (unsigned int i = 0; i <= nSec; i++) { - float zAtRefR = chosenRofZ_flt/tan(2 * atan(exp(-eta[i]))); - z_[i] = rMult*zAtRefR; - } - for (unsigned int j = 0; j < nSec; j++) { - tanL_[j] = 0.5*(1/tan(2*atan(exp(-eta[j]))) + 1/tan(2*atan(exp(-eta[j+1])))); - } - } - -public: - KFstubN::TZ z_[nSec+1]; // z at ref. radius - KFstateN::TT tanL_[nSec]; // central tanL in eta sector. -}; - -// Also failed in VHDL -//static const EtaBoundaries etaBoundaries; - -//--- Cuts to select acceptable fitted track states. -//--- (Array vs #stubs on track, where element 0 is never used). -//--- N.B. If cut value is zero, this indicates cut is not applied. (Trick to avoid Vivado timing failure). - -// Pt or 1/2R cut. -static const float ptCut_flt_tight = minPt_HT - 0.05; // Smaller than HT cut to allow for resolution during KF fit. -static const float ptCut_flt_loose = minPt_HT - 0.10; -static const float inv2Rcut_flt_tight = invPtToInv2R*(1./ptCut_flt_tight); -static const float inv2Rcut_flt_loose = invPtToInv2R*(1./ptCut_flt_loose); -static const KFstateN::TR inv2Rcut_tight = inv2R_Mult*inv2Rcut_flt_tight; -static const KFstateN::TR inv2Rcut_loose = inv2R_Mult*inv2Rcut_flt_loose; -static const KFstateN::TR inv2Rcut[] = {0, 0, inv2Rcut_loose, inv2Rcut_loose, inv2Rcut_tight, inv2Rcut_tight, inv2Rcut_tight}; -static const KFstateN::TR inv2RcutMinus[] = {0, 0, -inv2Rcut_loose, -inv2Rcut_loose, -inv2Rcut_tight, -inv2Rcut_tight, -inv2Rcut_tight}; - -// z0 cut -static const KFstateN::TZ z0Cut_tight = (N_HELIX_PAR == 4) ? rMult*beamSpotLength : 1.7*rMult*beamSpotLength; // r multiplier used for z in KF. -static const KFstateN::TZ z0Cut[] = {0, 0, z0Cut_tight, z0Cut_tight, z0Cut_tight, z0Cut_tight, z0Cut_tight}; -static const KFstateN::TZ z0CutMinus[] = {0, 0, -z0Cut_tight, -z0Cut_tight, -z0Cut_tight, -z0Cut_tight, -z0Cut_tight}; - -// d0 cut -static const float d0Cut_flt_tight = 5.; -static const float d0Cut_flt_loose = 10.; -static const KFstateN::TD d0Cut_tight = rphiMult*d0Cut_flt_tight; -static const KFstateN::TD d0Cut_loose = rphiMult*d0Cut_flt_loose; -static const KFstateN::TD d0Cut[] = {0, 0, 0, d0Cut_loose, d0Cut_tight, d0Cut_tight, d0Cut_tight}; -static const KFstateN::TD d0CutMinus[] = {0, 0, 0, -d0Cut_loose, -d0Cut_tight, -d0Cut_tight, -d0Cut_tight}; - -// Chi2 cut -static const KFstateN::TCHI chi2Cut[] = {0, 0, chi2_Mult*10, chi2_Mult*30, chi2_Mult*80, chi2_Mult*120, chi2_Mult*160}; -// Scale down chi2 in r-phi plane by this factor when applying chi2 cut (to improve electron efficiency). -static const unsigned int chi2rphiScale = 8; // Must be power of 2! - -#ifdef CMSSW_GIT_HASH -} -} -#endif - -#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h b/L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h deleted file mode 100644 index bf3f3793bf50a..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef __KFpragmaOpts__ -#define __KFpragmaOpts__ - -/** - * Define options specified by pragma statements. - * - * Author: Ian Tomalin - */ - -// OPTION 1: -// If defined, HLS KF will cope with tracking down to 2 GeV Pt instead of 3 GeV. -//#define PT_2GEV - -// If defined, HLS assumes hybrid (=tracklet) input format & digitisation multipliers. -//#define HYBRID_FORMAT - -#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/KFstate.h b/L1Trigger/TrackFindingTMTT/interface/HLS/KFstate.h deleted file mode 100644 index a08f66646cc40..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/HLS/KFstate.h +++ /dev/null @@ -1,307 +0,0 @@ -#ifndef __KFstate__ -#define __KFstate__ - -/** - * This defines Helix States for the Kalman Filter HLS code. - * N.B. It therefore can't use the Settings class or any external libraries! Nor can it be a C++ class. - * - * Only the KFstateN, KFstate & KFselect classes are used in the implementation of the KF maths block. - * The other classes are used in the (failed) attempt at a full KF HLS implementation. - * - * All variable names & equations come from Fruhwirth KF paper - * http://dx.doi.org/10.1016/0168-9002%2887%2990887-4 - * - * Author: Ian Tomalin - */ - -// Copied from /opt/ppd/tools/xilinx/Vivado_HLS/2016.4/include/ -#include "ap_int.h" -#include "ap_fixed.h" - -#ifdef CMSSW_GIT_HASH -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h" -#else -#include "KFpragmaOpts.h" -#include "HLSutilities.h" -#include "KFstub.h" -#endif - -#ifndef __SYNTHESIS__ -#include -#endif - -///=== Hard-wired configuration parameters. -///=== WARNING: Since this code must be used in Vivado HLS, it can't use the Settings class. -///=== Therefore all constants are hard-wired here, so may break if you change the configuration parameters. - -#ifdef CMSSW_GIT_HASH -namespace TMTT { - -namespace KalmanHLS { -#endif - -// Ultrascale DSP = (18 bits * 27 bits = 48 bits). -// Though if multiplying unsigned variables, must use 1 bit less than this. - -enum B_DSP { - // Number of bits used by DSP for multiplication of signed numbers in FPGA (Ultrascale). - B18=18, B27=27, B35=2*B18-1, B48=48, - // Number of bits used by DSP for multiplication of unsigned numbers in FPGA. - B17=B18-1, B26=B27-1, B34=B35-1, - // Number of bits used for interface to VHDL (historic, but increasing may increase VHDL BRAM use). - B25=25, B24=B25-1 -}; - -namespace KFstateN { - -// Data formats from https://gitlab.cern.ch/cms-uk-tracktrigger/firmware/l1tf/blob/master/global_formats.docx . -// Since KF maths rely on same multipliers for helix z0 & stub z, phi0 & phi, 1/2R & (r/phi), -// extra precision desired for the helix params goes after the decimal point. -// e.g. 15 bits for 1/2R, as is factor pow(2,15) more grenular than stub phi/r. -// 3 bits for phi0, as is factor pow(2,3) more granular than stub phi. -// 7 bits for z0, as is factor pow(2,7) more granular than stub r. -// TanL & chi2 have multiplier 1, so no. of integer bits must cover their range. - -// Cov. mat. bits can change, but remember to change protostate cov. matrix in VHDL. - -// Number of integer+sign bits for helix params & chi2. -// FIX: BCHI should be increased to 11, to allow for loose chi2(rphi) cut. -// (requires updating HLS IP in KF firmware & removing "bodge" from DigitalTrack.h). -enum {BH0 = 3, BH1 = 15, BH2 = 5, BH3 = 11, BH4=25, BCHI = 10}; -// Number of bits needed for integer part of helix covariance matrix -//enum {BC00 = -6, BC11 = 16, BC22 = -1, BC33=16, BC44=41+2, BC01=6, BC23=8, BC04=18, BC14=20+8+2}; -enum {BC00 = -6, BC11 = 16, BC22 = -1, BC33=16, BC44=41, BC01=5, BC23=7, BC04=17, BC14=29}; - -// Total number of bits (integer + fractional) needed for helix covariance matrix. -// Increasing to 26/27 doesn't increase DSP use, but does increase BRAM use in KF VHDL. -enum {BLENCOV = 20}; - -enum {BEV = KFstubN::BEV, - BTRK = KFstubN::BTRK, - NTRK = KFstubN::NTRK, - BLAY = KFstubN::BLAY, - NLAY = KFstubN::NLAY, - BID = KFstubN::BLAY, - NID = KFstubN::NLAY, - BSEC = KFstubN::BSEC, - BSEC1 = KFstubN::BSEC1, - BM = KFstubN::BM, BC = KFstubN::BC}; - -typedef ap_fixed TR; -typedef ap_fixed TP; -typedef ap_fixed TT; -typedef ap_fixed TZ; -typedef ap_fixed TD; - -typedef ap_ufixed TC00; -typedef ap_ufixed TC11; -typedef ap_ufixed TC22; -typedef ap_ufixed TC33; -typedef ap_fixed TC01; -typedef ap_fixed TC23; -typedef ap_ufixed TC44; -typedef ap_fixed TC04; -typedef ap_fixed TC14; - -// Additional type with extra bit, for internal use. -typedef ap_ufixed<1+BLENCOV,BC00> TC00EX; -typedef ap_ufixed<1+BLENCOV,BC11> TC11EX; -typedef ap_ufixed<1+BLENCOV,BC22> TC22EX; -typedef ap_ufixed<1+BLENCOV,BC33> TC33EX; -typedef ap_fixed <1+BLENCOV,BC01> TC01EX; -typedef ap_fixed <1+BLENCOV,BC23> TC23EX; -typedef ap_ufixed<1+BLENCOV,BC44> TC44EX; -typedef ap_fixed <1+BLENCOV,BC04> TC04EX; -typedef ap_fixed <1+BLENCOV,BC14> TC14EX; - -typedef ap_ufixed TCHI; - -typedef ap_uint TEV; -typedef ap_uint TTRK; -typedef ap_uint TLAY; -typedef ap_uint TID; -typedef ap_uint TNLAY; -typedef ap_uint TSEC; -typedef ap_uint TSEC1; - -typedef ap_int TM; -typedef ap_int TC; -}; - -#ifdef ALL_HLS // Used only for full KF implementation in HLS - -//--- Extra info about proto-state. - -class ProtoInfo { - -public: - - ProtoInfo() { - for (unsigned int i = 0; i < KFstubN::NLAY; i++) numStubsPerLay[i] = 0; - } - -public: - - KFstateN::TID numStubsPerLay[KFstubN::NLAY]; -}; - -#endif - -//--- Format of KF helix state to match VHDL, for both 4 & 5 param helix states. - -template class KFstate; - -template <> class KFstate<4> { - -public: - - KFstate<4>() : inv2R(0), phi0(0), tanL(0), z0(0), - cov_00(0), cov_11(0), cov_22(0), cov_33(0), cov_01(0), cov_23(0), - chiSquaredRphi(0), chiSquaredRz(0), cBin_ht(0), mBin_ht(0), layerID(0), nSkippedLayers(0), hitPattern(0), - trackID(0), eventID(0), phiSectID(0), etaSectID(0), etaSectZsign(0), - valid(0) {} - -public: - - // The digitized helix & covariance parameters specified here are scaled relative to the floating - // point ones by factors appearing in KF4ParamsCombHLS::getDigiState(). - - KFstateN::TR inv2R; // This is misnamed as rInv in Maxeller. Integer bits = 1+ceil(log2(51)); - KFstateN::TP phi0; // Measured with respect to centre of phi sector. Integer bits = 1+ceil(log2(8191)); - KFstateN::TT tanL; // This is misnamed as tanTheta in Maxeller. Integer bits = 1+ceil(log2(12)); - KFstateN::TZ z0; // Integer bits = 1+ceil(log2(150)); - - KFstateN::TC00 cov_00; - KFstateN::TC11 cov_11; - KFstateN::TC22 cov_22; - KFstateN::TC33 cov_33; - KFstateN::TC01 cov_01; // (inv2R, phi0) -- other off-diagonal elements assumed negligible. - KFstateN::TC23 cov_23; // (tanL, z0) -- other off-diagonal elements assumed negligible. - - KFstateN::TCHI chiSquaredRphi; // Chi2 in r-phi plane + small contributions from r-phi & r-z correlations. - KFstateN::TCHI chiSquaredRz; // Chi2 in r-z plane - - KFstateN::TC cBin_ht; // The HT cell (cbin, mbin) are centred on zero here. - KFstateN::TM mBin_ht; - - // This is the KF layer that the KF updator next wants to take a stub from, encoded by L1KalmanComb::doKF(), which in any eta region increases from 0-7 as a particle goes through each layer in turn. It is updated by the StateStubAssociator. - KFstateN::TLAY layerID; - // This is the number of skipped layers assuming we find a stub in the layer the KF updator is currently searched. The KF updator in HLS/Maxeller does not incremement it. - ap_uint<2> nSkippedLayers; - // Hit pattern - KFstateN::TNLAY hitPattern; - KFstateN::TTRK trackID; // Not used by KF updator. Just helps VHDL keep track of which state this is. - KFstateN::TEV eventID; // Not used by KF updator. Just helps VHDL keep track of which event this is. - ap_uint<1> phiSectID; - KFstateN::TSEC etaSectID; // Eta sector ID, but counting away from 0 near theta=PI/2 & increasing to 8 near endcap. (Named SectorID in Maxeller). - ap_uint<1> etaSectZsign; // True if eta sector is in +ve z side of tracker; False otherwise. (Named zSign in Maxeller). - ap_uint<1> valid; // Used by external code when calculation finished on valid input state & stub. - -#ifdef ALL_HLS - ProtoInfo protoInfo; // Extra info about proto state. -#endif - -#ifndef __SYNTHESIS__ -public: - void print(const char* text) const { - if (valid) { - std::cout< i = 0; i < KFstateN::NLAY; i++) { - if (protoInfo.numStubsPerLay[i] > 0) std::cout< class KFstate<5> : public KFstate<4> { - -public: - KFstateN::TD d0; - - KFstateN::TC44 cov_44; // (d0, d0) - KFstateN::TC04 cov_04; // (inv2R, d0) -- other off-diagonal elements assumed negligible. - KFstateN::TC14 cov_14; // (phi0, d0) -- other off-diagonal elements assumed negligible. - -#ifndef __SYNTHESIS__ -public: - void print(const char* text) const { - this->KFstate<4>::print(text); - if (valid) std::cout< class KFselect<5> : public KFselect<4> { -public: - ap_uint<1> d0Cut; -}; - -#ifdef CMSSW_GIT_HASH -} - -} -#endif - -#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h b/L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h deleted file mode 100644 index 27ea99a3d97ac..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h +++ /dev/null @@ -1,208 +0,0 @@ -#ifndef __KFstub__ -#define __KFstub__ - -/** - * This defines Stubs for the Kalman Filter maths HLS code. - * N.B. It therefore can't use the Settings class or any external libraries! Nor can it be a C++ class. - * - * Only the KFstubN & KFstubC classes are used in the implementation of the KF maths block. - * The other classes are used in the (failed) attempt at a full KF HLS implementation. - * - * Author: Ian Tomalin - */ - -// Must use ap_uint<1) instead of bool, due to bug in HLS IP export. - -#include "ap_int.h" -#include "ap_fixed.h" - -#ifdef CMSSW_GIT_HASH -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFpragmaOpts.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h" -#else -#include "KFpragmaOpts.h" -#include "HLSutilities.h" -#endif - -#ifndef __SYNTHESIS__ -#include -#endif - -///=== Hard-wired configuration parameters. -///=== WARNING: Since this code must be used in Vivado HLS, it can't use the Settings class. -///=== Therefore all constants are hard-wired here, so may break if you change the configuration parameters. - -#ifdef CMSSW_GIT_HASH -namespace TMTT { - -namespace KalmanHLS { -#endif - -///=== Numbers of bits hard-wired, since same code also used within Vivado HLS, where access to Settings class not possible. - -namespace KFstubN { - // Format of Stub taken from KF stubs.vhd, with #bits specified in L1TF config.vhd, aside from following ... - // r : KF measures it with respect to beam-line instead of critical radius, so uses 1 extra bit. - // z : KF uses same multipler as for r, whereas HT uses multiplier factor 2 smaller than r. - // By using type TZ, the additional factor 2 is applied when when KFstub is created. - -enum {BR = 12+1, BZ = 14, BPHI=14, BR1 = BR - 1, BZ1 = BZ + 1, // For stub coords. - BEV = 3, // Allows up to 8 events to be interleaved inside KF - NEV = (1 << BEV), - // BTRK = 5, // Allows up to 32 tracks cand IDs (compare TM*(320MHz/40MHz)/(5 stubs) = 29) from HT per KF worker per event. - BTRK = 6, // Allows up to 64 tracks cand IDs (bigger than needed, but avoids changing output data format of KF VHDL) - NTRK = (1 << BTRK), - BLAY = 3, // Allows up to 7+1 KF layer IDs (where +1 is for invalid layer) - NLAY = (1 << BLAY), - BID = 3, // Stub ID in layer. [pow(2,BID) - 1] must be >= MaxStubsPerLayPerTrack, - NID = (1 << BID), - BSEC = 3, // Allows up to 2*8 eta sectors, where factor 2 comes from zSign. - BSEC1 = BSEC + 1, // To allow same number of sectors in raw stub format, where no zSign used. -#ifdef PT_2GEV - BM = 6, BC = 6}; // Allow 64*64 HT array. -#else - BM = 5, BC = 6}; // Allow 32*64 HT array. -#endif - -typedef ap_ufixed TR; -typedef ap_fixed TR1; -typedef ap_fixed TZ; // Lowest integer bit has value zero. -typedef ap_fixed TPHI; -typedef ap_uint TEV; -typedef ap_uint TTRK; -typedef ap_uint TLAY; -typedef ap_uint TID; -typedef ap_uint TSEC; -typedef ap_uint TSEC1; -typedef ap_int TM; -typedef ap_int TC; -}; - -//--- Class containing stub coords used by KF maths block. - -class KFstubC { -public: - - KFstubC(const KFstubN::TR& r_, const KFstubN::TZ& z_, const KFstubN::TPHI& phi_, const ap_uint<1>& valid_) : - r(r_), z(z_), phiS(phi_), valid(valid_) {} - - KFstubC() : KFstubC(0,0,0,false) {} - -public: - - KFstubN::TR r; // Note this is r, not rT, so is unsigned. - KFstubN::TZ z; // This is (rMult/zMult) larger than digitised z used by HT, so needs one more integer bit. - KFstubN::TPHI phiS; - - ap_uint<1> valid; // Used by external code to indicate if input data is valid. - -#ifndef __SYNTHESIS__ -public: - void print(const char* text) const { - if (valid) std::cout< class BODGE; -template class MatrixInverseR; -template class MatrixH; -template class MatrixS; -template class MatrixS_transpose; -template class MatrixR; -template class MatrixK; -template class VectorRes; -template class VectorX; -template class MatrixC; - -// These hard-wired constants reduce the number of bits relative to that predicted by bit counting -// based on variable ranges observed in CMSSW. So they should be checked if the code is changed. -// (The dependence of one bodge on another is chosen to ensure that changing each affects the declaration -// of only one variable). - -enum BIT_ADJUST_PLAY {BODGE_V=5, BODGE_CHI2=12}; - -template<> -class BODGE<4> { -public: - // enum BIT_ADJUST {V=BODGE_V, S=2, R=5-S, IR=10+R+S, DET=13-2*R-2*S, K=23-IR+R, RES=2, CHI2=BODGE_CHI2}; - enum BIT_ADJUST {V=BODGE_V, S=2, R=5-S, IR=10+R+S, DET=12-2*R-2*S, K=23-IR+R, RES=1, CHI2=BODGE_CHI2}; -}; - -template<> -class BODGE<5> { -public: - enum BIT_ADJUST {V=BODGE_V, S=2, R=4-S, IR=7+R+S, DET=13-2*R-2*S, K=21-IR+R, RES=1, CHI2=BODGE_CHI2}; -}; - -// Allow some bits for correlation in helix params between r-phi and r-z planes. -enum RZ_PHI_CORR {BCORR=1}; // Set this to 1, so this correlation is almost neglected. - -// Vector of stub coords. - -class VectorM { -public: - typedef ap_fixed<1+KFstubN::BPHI,KFstubN::BPHI> TMP; - typedef ap_fixed<1+KFstubN::BZ,KFstubN::BZ1> TMZ; - - VectorM(const KFstubN::TPHI& phiS, const KFstubN::TZ& z) : _0(phiS), _1(z) { - // Compensate for stubs being rounded down when digitized, by adding extra LSB to coords set to '1'. - _0[0] = 1; - _1[0] = 1; - } -public: - // KFstubN::TPHI _0; - // KFstubN::TZ _1; - TMP _0; - TMZ _1; -}; - -// Covariance matrix of stub coords. - -class MatrixV { -public: - // Use same granularity for resolution as for residuals. - - // But with integer range reduced by BODGE_V, as hit resolution much smaller than max. stub coordinate. - enum {BVP=KFstubN::BPHI-BODGE_V, BVZ=KFstubN::BZ1-BODGE_V, BVPP=2*BVP, BVZZ=2*BVZ}; - typedef ap_ufixed TVPP; - typedef ap_ufixed TVZZ; - typedef ap_ufixed<1,1> TV0; - - enum {BM=12}; // Used for pitch. May need increasing if larger r or phi multipliers used. - typedef ap_ufixed TM; - -public: - MatrixV(const KFstubN::TR& r, const KFstubN::TZ& z, const KFstateN::TR& inv2R, const KFstateN::TT& tanL, const KFstateN::TM& mBin); - -public: - TVPP _00; - TVZZ _11; - const TV0 _01; - const TV0& _10; // Matrix symmetric so use reference to top half. - - // Record if stub is in 2S module or not. (Not pretty to include it in this class, but convenient ...) - bool _2Smodule; -}; - -// Utility for calculating pow(pitch/r, 2) from ROM. - -class PitchOverR_2 { -public: - enum {BRED = 4}; // To save ROM resources, reduce granularity in r by this number of bits. - enum {MAXN = 1 << (KFstubN::BR - BRED)}; // pow(2,BR) // Max. value of [r / pow(2,BRED)]. - // Number of bits chosen based on CalcCheck job summary. - typedef ap_ufixed<12,5> TPOR; -public: - - PitchOverR_2(const MatrixV::TM& pitch) { - for (unsigned int n = 2; n < MAXN; n++) { // Don't bother initializing first two, as would overflow bit range. - float pitchOverR = float(pitch)/(float((n << BRED)) + 0.5*(1 << BRED)); - get[n] = pitchOverR * pitchOverR; // Round to nearest half integer - } - } -public: - TPOR get[MAXN]; -}; - -// Utility for estimating pow(const/Pt, 2) from ROM, where 1/Pt is taken from HT m-bin. - -class InvPt2 { -public: - InvPt2(const ap_uint<1>& iOpt = 0, float scaleFactor = 1.) { - float theConst; - if (iOpt == 0) { - // Used to estimate increase in phi stub error due to scattering. - theConst = kalmanMultScatTerm*phiMult; - } else { - // Used to estimate increase in phi stub error due to conversion from (r,phi) to (z,phi) in endcap. - theConst = invPtToInv2R*scaleFactor*inv2R_Mult; - } - for (int m = minPtBin; m <= maxPtBin; m++) { - // Estimate Pt from Hough m-bin cell. - float constOverPt = theConst * (1./minPt_HT)*(float(m) + 0.5)/float(numPtBins/2); - get[m - minPtBin] = constOverPt*constOverPt; - } - } - - const MatrixV::TVPP& getIt(const KFstateN::TM& m) const {return this->get[m - minPtBin];} - -public: - MatrixV::TVPP get[numPtBins]; -}; - -// Utility for calculating 1/(unsigned int), where unsigned int has MaxInverseR::BDET bits and the -// most significant of these bits has value 1. (Loaded into ROM). - -class OneOverInt { -public: - enum {BDET=9}; // Number of significant bits used to calculate 1/determinant. Keep small to save resources. - //enum {MINN = (1 << (BDET - 2)), MAXN = (1 << BDET)}; // Min & max. value of r - enum {MINN = (1 << (BDET - 2)) + (1 <<(BDET - 3)), MAXN = (1 << BDET)}; // // Min & max. value of r - with min tweaked to allow room in bit range for higher order corrections later. - enum {BOI=2-BDET}; // Large enough to contain reciprocal. - typedef ap_ufixed TOI; -public: - OneOverInt() { - for (unsigned int n = 0; n < MAXN; n++) { // Don't bother initializing first two, as would overflow bit range. - if (n > MINN) { - get[n] = 1./float(n); // Round to nearest half integer - } else { - get[n] = 1./float(MINN+1); // Truncated to save bits, but better than nothing. - } - } - } - - const TOI& getIt(const ap_uint& i) const {return get[i];} - -private: - TOI get[MAXN]; -}; - - -// Inverse of matrix R. - -template -class MatrixInverseR { -public: - // Calculate number of integer bits required for elements of R (assuming matrix approximately diagonal). - enum {BIR00=B34 - MatrixR::BR00 - BODGE::IR, - BIR11=B34 - MatrixR::BR11 - BODGE::IR, - BIR01=0}; // correlation between r-phi & r-z planes not used. - typedef ap_ufixed TRI00; - typedef ap_ufixed TRI11; - typedef ap_ufixed TRI01; - - // Additional types used to cast this matrix to a lower precision one for use in chi2 calculation. - typedef ap_ufixed TRI00_short; - typedef ap_ufixed TRI11_short; - typedef ap_ufixed TRI01_short; - - enum {BDET=OneOverInt::BDET}; // Number of significant bits used to calculate 1/determinant. Keep small to save resources. - -public: - MatrixInverseR(const MatrixR& R); - -public: - // R(inverse) - TRI00 _00; - TRI11 _11; - TRI01 _01; - TRI01& _10; // Matrix symmetric, so can use reference. -}; - -// Since chi2 can be large, use more bits for internal calculation than for external number. -typedef ap_ufixed TCHI_INT; - -#ifdef CMSSW_GIT_HASH -} - -} -#endif - -#endif - - - - diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices4.h b/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices4.h deleted file mode 100644 index 07c634d23c57d..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices4.h +++ /dev/null @@ -1,262 +0,0 @@ -/** - * This defines the KF matrices and the operations performance on them. - * - * All variable names & equations come from Fruhwirth KF paper - * http://dx.doi.org/10.1016/0168-9002%2887%2990887-4 - * - * Author: Ian Tomalin - */ - -#ifndef __KalmanMatrices4__ -#define __KalmanMatrices4__ - -// Defines StateHLS & KFstate. Also defines finite bit integers & floats. -#ifdef CMSSW_GIT_HASH -#include "L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstate.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFconstants.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices4.h" -#else -#include "HLSutilities.h" -#include "KFstub.h" -#include "KFstate.h" -#include "KFconstants.h" -#include "KalmanMatrices.h" -#include "KalmanMatrices4.h" -#endif - -#ifdef CMSSW_GIT_HASH -namespace TMTT { - -namespace KalmanHLS { -#endif - -// Calculate matrix of derivatives of predicted stub coords w.r.t. helix params. - -template <> -class MatrixH<4> { -public: - enum {BH=KFstubN::BR+1}; - typedef ap_fixed TH; // One extra bit, since "-r" can be -ve. - typedef ap_ufixed<1,1> T1; - MatrixH(const KFstubN::TR& r) : _00(-r), _12(r), - _01(1), _02(0), _03(0), - _10(0), _11(0), _13(1) {} -public: - TH _00, _12; - const T1 _01, _02, _03, - _10, _11, _13; -}; - -// S = H * C - -template <> -class MatrixS<4> { -public: - enum {BH=MatrixH<4>::BH, - // Calculate number of integer bits required for all non-zero elements of S. - // (Assumes that some elements of C & H are zero and that all non-trivial elements of H have BH bits). - BS00=MAX2(BH+KFstateN::BC00, KFstateN::BC01) - BODGE<4>::S, // H00*C00 + H01*C10 + (H02*C20 + H03*C30 = zero). - BS01=MAX2(BH+KFstateN::BC01, KFstateN::BC11) - BODGE<4>::S, // H00*C01 + H01*C11 + (H02*C21 + H03*C31 = zero). - BS12=MAX2(BH+KFstateN::BC22, KFstateN::BC23) - BODGE<4>::S, // (H00*C02 + H01*C12 = zero) + H02*C22 + H03*C32. - BS13=MAX2(BH+KFstateN::BC23, KFstateN::BC33) - BODGE<4>::S // (H00*C03 + H01*C13 = zero) + H02*C23 + H03*C33. - }; - typedef ap_fixed TS00; - typedef ap_fixed TS01; - typedef ap_fixed TS12; - typedef ap_fixed TS13; - typedef ap_fixed T0; // Neglect correlation between r-phi & r-z planes for now. - -public: - - MatrixS(const MatrixH<4>& H, const MatrixC<4>& C); - -public: - - TS00 _00; - TS01 _01; - TS12 _12; - TS13 _13; - T0 _02, _03, - _10, _11 ; -}; - -// Covariance matrix of helix params. - -template <> -class MatrixC<4> { -public: - typedef ap_ufixed<1,1> T0; // HLS doesn't like zero bit variables. - - // Determine input helix coviaraiance matrix. - MatrixC(const KFstate<4>& stateIn) : - _00(stateIn.cov_00), _11(stateIn.cov_11), _22(stateIn.cov_22), _33(stateIn.cov_33), - _01(stateIn.cov_01), _23(stateIn.cov_23), - _02(0), _03(0), _12(0), _13(0), - _10(_01), _32(_23), _20(_02), _30(_03), _21(_12), _31(_13) - { - _00[0] = 1; - _11[0] = 1; - _22[0] = 1; - _33[0] = 1; - _01[0] = 1; - _23[0] = 1; - } - - // Calculate output helix covariance matrix: C' = C - K*H*C = C - K*S. - MatrixC(const MatrixC<4>& C, const MatrixK<4>& K, const MatrixS<4>& S); - -public: - // Elements that are finite - KFstateN::TC00EX _00; - KFstateN::TC11EX _11; - KFstateN::TC22EX _22; - KFstateN::TC33EX _33; - KFstateN::TC01EX _01; // (inv2R, phi0) -- other off-diagonal elements assumed negligeable. - KFstateN::TC23EX _23; // (tanL, z0) -- other off-diagonal elements assumed negligeable. - // Elements that are zero. - const T0 _02, _03, _12, _13; - // Elements below the diagonal of this symmetric matrix. - const KFstateN::TC01EX &_10; - const KFstateN::TC23EX &_32; - const T0 &_20, &_30, &_21, &_31; -}; - -// S(transpose) = C*H(transpose) - -template <> -class MatrixS_transpose<4> { -public: - typedef MatrixS<4>::TS00 TS00; - typedef MatrixS<4>::TS01 TS01; - typedef MatrixS<4>::TS12 TS12; - typedef MatrixS<4>::TS13 TS13; - typedef MatrixS<4>::T0 T0; - MatrixS_transpose(const MatrixS<4>& S) : _00(S._00), _10(S._01), _21(S._12), _31(S._13), - _01(S._10), _11(S._11), _20(S._02), _30(S._03) {} -public: - const TS00& _00; - const TS01& _10; - const TS12& _21; - const TS13& _31; - const T0& _01, - _11, - _20, - _30 ; -}; - -// Covariance matrix of predicted residuals R = V + H*C*Ht = V + H*St. - -template <> -class MatrixR<4> { -public: - enum {BH=MatrixH<4>::BH, - BS00=MatrixS<4>::BS00, - BS01=MatrixS<4>::BS01, - BS12=MatrixS<4>::BS12, - BS13=MatrixS<4>::BS13, - // Calculate number of integer bits required for elements of R. - BR00 = MAX2(MatrixV::BVPP, MAX2(BH+BS00, BS01)) - BODGE<4>::R, // H00*St00 + H01*St10 + (H02*St20 + H03*St30 = zero) - BR11 = MAX2(MatrixV::BVZZ, MAX2(BH+BS12, BS13)) - BODGE<4>::R, // (H10*St01 + H11*St11 = zero) + H12*St21 + H13*St31 - BR01 = 0 // (H00*St01 + H01*St11 + H02*St21 + H03*St31 = zero) - }; - typedef ap_ufixed TR00; - typedef ap_ufixed TR11; - typedef ap_ufixed TR01; - -public: - MatrixR(const MatrixV& V, const MatrixH<4>& H, const MatrixS_transpose<4>& St); - -public: - TR00 _00; - TR11 _11; - TR01 _01; - TR01& _10; // Matrix symmetric, so can use reference. -}; - -// Kalman gain matrix K = S(transpose)*R(inverse). - -template <> -class MatrixK<4> { -public: - enum {BS00=MatrixS<4>::BS00, - BS01=MatrixS<4>::BS01, - BS12=MatrixS<4>::BS12, - BS13=MatrixS<4>::BS13, - BIR00=MatrixInverseR<4>::BIR00, - BIR11=MatrixInverseR<4>::BIR11, - BIR01=MatrixInverseR<4>::BIR01, - BK00=(BS00+BIR00) - BODGE<4>::K, // St00*Rinv00 (+ St01*Rinv10 = zero) - BK10=(BS01+BIR00) - BODGE<4>::K, // St10*Rinv00 (+ St11*Rinv10 = zero) - BK21=(BS12+BIR11) - BODGE<4>::K, // (St20*Rinv01 = zero) + St21*Rinv11 - BK31=(BS13+BIR11) - BODGE<4>::K}; // (St30*Rinv01 = zero) + St31*Rinv11 - typedef ap_fixed TK00; - typedef ap_fixed TK10; - typedef ap_fixed TK21; - typedef ap_fixed TK31; - typedef ap_fixed T0; // Neglect correlation between r-phi & r-z - MatrixK(const MatrixS_transpose<4>& St, const MatrixInverseR<4>& RmatInv); -public: - // Additional types used to cast this matrix to a lower precision one for updated helix param calculation. - typedef ap_fixed TK00_short; - typedef ap_fixed TK10_short; - typedef ap_fixed TK21_short; - typedef ap_fixed TK31_short; -public: - TK00 _00; - TK10 _10; - TK21 _21; - TK31 _31; - T0 _01, - _11, - _20, - _30 ; -}; - - -// Hit residuals: res = m - H*x. - -template <> -class VectorRes<4> { -public: - // Use higher granularity for residuals than for stubs. - // BODGE<4>::RES should be slightly larger than BODGE_V as hits can be several sigma wrong. - // Add one extra fractional bit relative to stub, to avoid additional precision loss. - typedef ap_fixed::RES+1,KFstubN::BPHI -BODGE<4>::RES> TRP; - typedef ap_fixed::RES+1,KFstubN::BZ1 -BODGE<4>::RES> TRZ; - -public: - VectorRes(const VectorM& m, const MatrixH<4>& H, const VectorX<4>& x); - -public: - TRP _0; - TRZ _1; -}; - -// Vector of helix params. - -template <> -class VectorX<4> { -public: - // Determine input helix params. - VectorX(const KFstate<4>& stateIn) : _0(stateIn.inv2R), _1(stateIn.phi0), _2(stateIn.tanL), _3(stateIn.z0) {} - - // Calculate output helix params: x' = x + K*res - VectorX(const VectorX<4>& x, const MatrixK<4>& K, const VectorRes<4>& res); - -public: - KFstateN::TR _0; - KFstateN::TP _1; - KFstateN::TT _2; - KFstateN::TZ _3; -}; - -#ifdef CMSSW_GIT_HASH -} - -} -#endif - -#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices5.h b/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices5.h deleted file mode 100644 index e78f270171a7d..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices5.h +++ /dev/null @@ -1,313 +0,0 @@ -/** - * This defines the KF matrices and the operations performance on them. - * - * All variable names & equations come from Fruhwirth KF paper - * http://dx.doi.org/10.1016/0168-9002%2887%2990887-4 - * - * Author: Ian Tomalin - */ - -#ifndef __KalmanMatrices5__ -#define __KalmanMatrices5__ - -// Defines StateHLS & KFstate. Also defines finite bit integers & floats. -#ifdef CMSSW_GIT_HASH -#include "L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstate.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFconstants.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices4.h" -#else -#include "HLSutilities.h" -#include "KFstub.h" -#include "KFstate.h" -#include "KFconstants.h" -#include "KalmanMatrices.h" -#include "KalmanMatrices5.h" -#endif - -#ifdef CMSSW_GIT_HASH -namespace TMTT { - -namespace KalmanHLS { -#endif - -// Utility for -1/r from ROM used by MatrixH<5>. - -class MinusOneOverR { -public: - enum {BRED = 4}; // To save ROM resources, reduce granularity in r by this number of bits. - enum {MAXN = 1 << (KFstubN::BR - BRED)}; // pow(2,BR) // Max. value of [r / pow(2,BRED)]. - enum {BIR = -8}; // Chosen using CheckCalc output. - typedef ap_fixed<1+KFstubN::BR,BIR> TIR; -public: - - MinusOneOverR() { - for (unsigned int n = 2; n < MAXN; n++) { // Don't bother initializing first two, as would overflow bit range. - get[n] = -1./(float((n << BRED)) + 0.5*(1 << BRED)); // Round to nearest half integer - } - } -public: - TIR get[MAXN]; -}; - - -// Calculate matrix of derivatives of predicted stub coords w.r.t. helix params. - -template <> -class MatrixH<5> { -public: - enum {BH=1+KFstubN::BR}; - enum {BHD=MinusOneOverR::BIR}; - typedef ap_fixed TH; // One extra bit, since "-r" can be -ve. - typedef ap_fixed THD; // For d0 elements (which have size -1/r) - typedef ap_ufixed<1,1> T1; - MatrixH(const KFstubN::TR& r) : _00(-r), _12(r), _04(this->setH04(r)), - _01(1), _02(0), _03(0), - _10(0), _11(0), _13(1), _14(0) { -#ifdef PRINT_SUMMARY - CHECK_AP::checkCalc("H04", _04, -1./double(r), 0.03); -#endif - } - - // Set element _04 to -1/r. - static THD setH04(const KFstubN::TR& r); - -public: - TH _00, _12; - THD _04; - const T1 _01, _02, _03, - _10, _11, _13, _14; -}; - -// S = H * C - -template <> -class MatrixS<5> { -public: - enum {BH=MatrixH<5>::BH, BHD=MatrixH<5>::BHD, - // Calculate number of integer bits required for all non-zero elements of S. - // (Assumes that some elements of C & H are zero and that all non-trivial elements of H have BH or BHD bits). - BS00=MAX3(BH+KFstateN::BC00, KFstateN::BC01, BHD+KFstateN::BC04) - BODGE<5>::S, // H00*C00 + H01*C10 + (H02*C20 + H03*C30 = zero) + H04*C40. - BS01=MAX3(BH+KFstateN::BC01, KFstateN::BC11, BHD+KFstateN::BC14) - BODGE<5>::S, // H00*C01 + H01*C11 + (H02*C21 + H03*C31 = zero) + H04*C41. - BS12=MAX2(BH+KFstateN::BC22, KFstateN::BC23) - BODGE<5>::S, // (H10*C02 + H11*C12 = zero) + H12*C22 + H13*C32 + (H14*C42 = zero). - BS13=MAX2(BH+KFstateN::BC23, KFstateN::BC33) - BODGE<5>::S, // (H10*C03 + H11*C13 = zero) + H12*C23 + H13*C33 + (H14*C43 = zero); - BS04=MAX3(BH+KFstateN::BC04, KFstateN::BC14, BHD+KFstateN::BC44) - BODGE<5>::S // H00*C04 + H01*C14 + (H02*C24 + H03*C34 = zero) + H04*C44. - }; - typedef ap_fixed TS00; - typedef ap_fixed TS01; - typedef ap_fixed TS12; - typedef ap_fixed TS13; - typedef ap_fixed TS04; - typedef ap_fixed T0; // Neglect correlation between r-phi & r-z planes for now. - -public: - - MatrixS(const MatrixH<5>& H, const MatrixC<5>& C); - -public: - - TS00 _00; - TS01 _01; - TS12 _12; - TS13 _13; - TS04 _04; - T0 _02, _03, - _10, _11, _14; -}; - -// Covariance matrix of helix params. - -template <> -class MatrixC<5> { -public: - typedef ap_ufixed<1,1> T0; // HLS doesn't like zero bit variables. - - // Determine input helix coviaraiance matrix. - MatrixC(const KFstate<5>& stateIn) : - _00(stateIn.cov_00), _11(stateIn.cov_11), _22(stateIn.cov_22), _33(stateIn.cov_33), _44(stateIn.cov_44), - _01(stateIn.cov_01), _23(stateIn.cov_23), _04(stateIn.cov_04), _14(stateIn.cov_14), - _02(0), _03(0), _12(0), _13(0), _42(0), _43(0), - _10(_01), _32(_23), _40(_04), _41(_14), _20(_02), _30(_03), _21(_12), _31(_13), _24(_42), _34(_43) { - _00[0] = 1; - _11[0] = 1; - _22[0] = 1; - _33[0] = 1; - _44[0] = 1; - _01[0] = 1; - _23[0] = 1; - _04[0] = 1; - _14[0] = 1; -} - - // Calculate output helix covariance matrix: C' = C - K*H*C = C - K*S. - MatrixC(const MatrixC<5>& C, const MatrixK<5>& K, const MatrixS<5>& S); - -public: - // Elements that are finite - KFstateN::TC00EX _00; - KFstateN::TC11EX _11; - KFstateN::TC22EX _22; - KFstateN::TC33EX _33; - KFstateN::TC44EX _44; - KFstateN::TC01EX _01; // (inv2R, phi0) -- other off-diagonal elements assumed negligeable. - KFstateN::TC23EX _23; // (tanL, z0) -- other off-diagonal elements assumed negligeable. - KFstateN::TC04EX _04; // (inv2R, d0) -- other off-diagonal elements assumed negligeable. - KFstateN::TC14EX _14; // (phi0, d0) -- other off-diagonal elements assumed negligeable. - // Elements that are zero. - const T0 _02, _03, _12, _13, _42, _43; - // Elements below the diagonal of this symmetric matrix. - const KFstateN::TC01EX &_10; - const KFstateN::TC23EX &_32; - const KFstateN::TC04EX &_40; - const KFstateN::TC14EX &_41; - const T0 &_20, &_30, &_21, &_31, &_24, &_34; -}; - -// S(transpose) = C*H(transpose) - -template <> -class MatrixS_transpose<5> { -public: - typedef MatrixS<5>::TS00 TS00; - typedef MatrixS<5>::TS01 TS01; - typedef MatrixS<5>::TS12 TS12; - typedef MatrixS<5>::TS13 TS13; - typedef MatrixS<5>::TS04 TS04; - typedef MatrixS<5>::T0 T0; - MatrixS_transpose(const MatrixS<5>& S) : _00(S._00), _10(S._01), _21(S._12), _31(S._13), _40(S._04), - _01(S._10), _11(S._11), _20(S._02), _30(S._03), _41(S._14) {} -public: - const TS00& _00; - const TS01& _10; - const TS12& _21; - const TS13& _31; - const TS04& _40; - const T0& _01, - _11, - _20, - _30, - _41; -}; - -// Covariance matrix of predicted residuals R = V + H*C*Ht = V + H*St. - -template <> -class MatrixR<5> { -public: - enum {BH=MatrixH<5>::BH, BHD=MatrixH<5>::BHD, - BS00=MatrixS<5>::BS00, - BS01=MatrixS<5>::BS01, - BS12=MatrixS<5>::BS12, - BS13=MatrixS<5>::BS13, - BS04=MatrixS<5>::BS04, - // Calculate number of integer bits required for elements of R. - BR00 = MAX2(MatrixV::BVPP, MAX3(BH+BS00, BS01, BHD+BS04)) - BODGE<5>::R, // H00*St00 + H01*St10 + (H02*St20 + H03*St30 = zero) + H04*St40 - BR11 = MAX2(MatrixV::BVZZ, MAX2(BH+BS12, BS13)) - BODGE<5>::R, // (H10*St01 + H11*St11 = zero) + H12*St21 + H13*St31 + (H14*St41 = zero) - BR01 = 0 // (H00*St01 + H01*St11 + H02*St21 + H03*St31 + H04*St41 = zero) - }; - typedef ap_ufixed TR00; - typedef ap_ufixed TR11; - typedef ap_ufixed TR01; - -public: - MatrixR(const MatrixV& V, const MatrixH<5>& H, const MatrixS_transpose<5>& St); - -public: - TR00 _00; - TR11 _11; - TR01 _01; - TR01& _10; // Matrix symmetric, so can use reference. -}; - -// Kalman gain matrix K = S(transpose)*R(inverse). - -template <> -class MatrixK<5> { -public: - enum {BS00=MatrixS<5>::BS00, - BS01=MatrixS<5>::BS01, - BS12=MatrixS<5>::BS12, - BS13=MatrixS<5>::BS13, - BS04=MatrixS<5>::BS04, - BIR00=MatrixInverseR<5>::BIR00, - BIR11=MatrixInverseR<5>::BIR11, - BIR01=MatrixInverseR<5>::BIR01, - BK00=(BS00+BIR00) - BODGE<5>::K, // St00*Rinv00 (+ St01*Rinv10 = zero) - BK10=(BS01+BIR00) - BODGE<5>::K, // St10*Rinv00 (+ St11*Rinv10 = zero) - BK21=(BS12+BIR11) - BODGE<5>::K, // (St20*Rinv01 = zero) + St21*Rinv11 - BK31=(BS13+BIR11) - BODGE<5>::K, // (St30*Rinv01 = zero) + St31*Rinv11 - BK40=(BS04+BIR00) - BODGE<5>::K}; // St40*Rinv00 (+ St41*Rinv10 = zero) - typedef ap_fixed TK00; - typedef ap_fixed TK10; - typedef ap_fixed TK21; - typedef ap_fixed TK31; - typedef ap_fixed TK40; - typedef ap_fixed T0; // Neglect correlation between r-phi & r-z - MatrixK(const MatrixS_transpose<5>& St, const MatrixInverseR<5>& RmatInv); -public: - // Additional types used to cast this matrix to a lower precision one for updated helix param calculation. - typedef ap_fixed TK00_short; - typedef ap_fixed TK10_short; - typedef ap_fixed TK21_short; - typedef ap_fixed TK31_short; - typedef ap_fixed TK40_short; -public: - TK00 _00; - TK10 _10; - TK21 _21; - TK31 _31; - TK40 _40; - T0 _01, - _11, - _20, - _30, - _41; -}; - -// Hit residuals: res = m - H*x. - -template <> -class VectorRes<5> { -public: - // Use higher granularity for residuals than for stubs. - // BODGE<5>::RES should be slightly larger than BODGE_V as hits can be several sigma wrong. - // Add one extra fractional bit relative to stub, to avoid additional precision loss. - typedef ap_fixed::RES+1,KFstubN::BPHI -BODGE<5>::RES> TRP; - typedef ap_fixed::RES+1,KFstubN::BZ1 -BODGE<5>::RES> TRZ; - -public: - VectorRes(const VectorM& m, const MatrixH<5>& H, const VectorX<5>& x); - -public: - TRP _0; - TRZ _1; -}; - -// Vector of helix params. - -template <> -class VectorX<5> { -public: - // Determine input helix params. - VectorX(const KFstate<5>& stateIn) : _0(stateIn.inv2R), _1(stateIn.phi0), _2(stateIn.tanL), _3(stateIn.z0), _4(stateIn.d0) {} - - // Calculate output helix params: x' = x + K*res - VectorX(const VectorX<5>& x, const MatrixK<5>& K, const VectorRes<5>& res); - -public: - KFstateN::TR _0; - KFstateN::TP _1; - KFstateN::TT _2; - KFstateN::TZ _3; - KFstateN::TD _4; -}; - -#ifdef CMSSW_GIT_HASH -} - -} -#endif - -#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate.h b/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate.h deleted file mode 100644 index 27a051c57f4f8..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate.h +++ /dev/null @@ -1,63 +0,0 @@ -/** - * This is the top-level HLS function within CMSSW, which updates a helix state by adding a stub to it. - * N.B. It therefore can't use the Settings class or any external libraries! Nor can it be a C++ class. - * - * All variable names & equations come from Fruhwirth KF paper - * http://dx.doi.org/10.1016/0168-9002%2887%2990887-4 - * - * Author: Ian Tomalin - */ - - -#ifndef __KalmanUpdate__ -#define __KalmanUpdate__ - -#ifdef CMSSW_GIT_HASH -#include "L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstate.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices4.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices5.h" -#else -#include "HLSutilities.h" -#include "KFstub.h" -#include "KFstate.h" -#include "KalmanMatrices.h" -#include "KalmanMatrices4.h" -#include "KalmanMatrices5.h" -#endif - -#ifdef CMSSW_GIT_HASH -namespace TMTT { - -namespace KalmanHLS { -#endif - -// Internal interface. -// Add stub to old KF helix state to get new KF helix state for NPAR = 4 or 5 param helix fits. -template -void kalmanUpdate(const KFstubC& stub, const KFstate& stateIn, KFstate& stateOut, KFselect& selectOut); - -// Calculate increase in chi2 (in r-phi & r-z) from adding new stub: delta(chi2) = res(transpose) * R(inverse) * res -template -void calcDeltaChi2(const VectorRes& res, const MatrixInverseR& Rinv, TCHI_INT& dChi2_phi, TCHI_INT& dChi2_z); - -// Set output helix params & associated cov matrix related to d0, & check if d0 passes cut. -// (Relevant only to 5-param helix fit) -template -void setOutputsD0(const VectorX& x_new, const MatrixC& C_new, const ap_uint<3>& nStubs, KFstate& stateOut, KFselect& selectOut); - -// Fully specialized function templates must also be declared to ensure they are found. - -#ifdef CMSSW_GIT_HASH -} - -} -#endif - -#endif - - - - diff --git a/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate_top.h b/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate_top.h deleted file mode 100644 index fd727cb883e32..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate_top.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef __KalmanUpdate_top__ -#define __KalmanUpdate_top__ - -/** - * This is the top-level function for Vivado HLS compilation. - * It is not used by CMSSW. - * - * It is required because HLS does not allow the top-level function to be templated. - * - * Author: Ian Tomalin - */ - -#ifdef CMSSW_GIT_HASH -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstub.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFstate.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate.h" -#else -#include "KFstub.h" -#include "KFstate.h" -#include "KalmanUpdate.h" -#endif - -#ifdef CMSSW_GIT_HASH -namespace TMTT { - -namespace KalmanHLS { -#endif - -void kalmanUpdate_top(const KFstubC& stub, const KFstate& stateIn, KFstate& stateOut, KFselect& selectOut); - -#ifdef CMSSW_GIT_HASH -} - -} -#endif - -#endif diff --git a/L1Trigger/TrackFindingTMTT/src/HLS/HLSutilities.cc b/L1Trigger/TrackFindingTMTT/src/HLS/HLSutilities.cc deleted file mode 100644 index 582ea6ddf043b..0000000000000 --- a/L1Trigger/TrackFindingTMTT/src/HLS/HLSutilities.cc +++ /dev/null @@ -1,159 +0,0 @@ -/** - * General HLS utilities, not specific to KF. - * - * Author: Ian Tomalin - */ - -#ifdef CMSSW_GIT_HASH -#include "L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h" -#else -#include "HLSutilities.h" -#endif - -#ifdef CMSSW_GIT_HASH -namespace TMTT { - -namespace KalmanHLS { -#endif - -#ifdef PRINT_SUMMARY - -namespace CHECK_AP { - -// Map containing info about variable ranges in terms of numbers of bits required to represent them. -std::map apCheckMap_ = std::map(); - -// Map containing info about integer ranges expressed as numbers, -std::map intRangeMap_ = std::map(); - -// Print contents of map about variable ranges. - -void printCheckMap() { - - // Print summary about all variables & bits needed to represent them. - - std::cout<::const_iterator iter; - for (iter = apCheckMap_.begin(); iter != apCheckMap_.end(); iter++) { - const std::string& varName = iter->first; - const INFO& info = iter->second; - std::string status = (info.intBitsCfg_ >= info.intBitsSeenHigh_) ? "OK" : "BAD"; - int iWantBitRange = info.intBitsSeenHigh_-info.intBitsSeenLow_; - std::cout<::const_iterator iterInt; - for (iterInt = intRangeMap_.begin(); iterInt != intRangeMap_.end(); iterInt++) { - const std::string& varName = iterInt->first; - const INFO_int& info = iterInt->second; - std::string status = (info.intCfgHigh_ >= info.intSeenHigh_ && info.intCfgLow_ <= info.intSeenLow_) ? "OK" : "BAD"; - std::cout<= 0); - int intBitsSeen = (res_float_abs > 0) ? std::ceil(log(res_float_abs)/log(2.)) : -99; - - std::string cName = "float "; - int intBitsCfg = 99; - - if (apCheckMap_.find(varName) == apCheckMap_.end()) { - apCheckMap_[varName] = INFO(cName, intBitsCfg, intBitsSeen, intBitsSeen); - } else { - int intHighOld = apCheckMap_[varName].intBitsSeenHigh_; - int intLowOld = apCheckMap_[varName].intBitsSeenLow_; - if (intHighOld < intBitsSeen) { - apCheckMap_[varName] = INFO(cName, intBitsCfg, intBitsSeen, intLowOld); - } else if (intLowOld > intBitsSeen) { - apCheckMap_[varName] = INFO(cName, intBitsCfg, intHighOld, intBitsSeen); - } - } - return true; -} - -// Fill info for integer range summary table. - -bool checkIntRange(std::string varName, int intCfgHigh, int intCfgLow, int intValue) { - - bool OK = (intValue <= intCfgHigh && intValue >= intCfgLow); - - if (intRangeMap_.find(varName) == intRangeMap_.end()) { - intRangeMap_[varName] = INFO_int(intCfgHigh, intCfgLow, intValue, intValue); - } else { - int intHighOld = intRangeMap_[varName].intSeenHigh_; - int intLowOld = intRangeMap_[varName].intSeenLow_; - if (intHighOld < intValue) { - intRangeMap_[varName] = INFO_int(intCfgHigh, intCfgLow, intValue, intLowOld); - } else if (intLowOld > intValue) { - intRangeMap_[varName] = INFO_int(intCfgHigh, intCfgLow, intHighOld, intValue); - } - } - -#ifdef PRINT_SUMMARY - -#ifdef PRINT -#define NPRINTMAXI 99999 -#else -#define NPRINTMAXI 100 -#endif - - static unsigned int nErrors = 0; - - // Check -ve numbers aren't stored in unsigned variables. - if (not OK) { - nErrors++; - if (nErrors < NPRINTMAXI) std::cout<<"checkCalc INT RANGE ERROR: "< 0); -#ifdef PRINT_SUMMARY - static unsigned int detErrCount = 0; - if ((not OK) && detErrCount < 100) { - detErrCount++; - std::cout<<"checkCalc NEGATIVE DETERMINANT "< 0); -#ifdef PRINT_SUMMARY - static unsigned int detErrCount = 0; - if ((not OK) && detErrCount < 100) { - detErrCount++; - std::cout<<"checkCalc NEGATIVE DETERMINANT "< -#include - -namespace TMTT { - -//--- Explicit instantiation required for all non-specialized templates, to allow them to be implemented -//--- in .cc files. - -template KalmanHLS::KFstate<4> KFParamsCombCallHLS::getDigiStateIn(unsigned int skipped, unsigned int layer, const KalmanState* state) const; - -template KalmanHLS::KFstate<5> KFParamsCombCallHLS::getDigiStateIn(unsigned int skipped, unsigned int layer, const KalmanState* state) const; - -template const KalmanState* KFParamsCombCallHLS::getStateOut<4>(const KalmanState* stateIn, const StubCluster* stubCluster, const KalmanHLS::KFstate<4>& stateOutDigi, const KalmanHLS::KFselect<4>& selectOutDigi); - -template const KalmanState* KFParamsCombCallHLS::getStateOut<5>(const KalmanState* stateIn, const StubCluster* stubCluster, const KalmanHLS::KFstate<5>& stateOutDigi, const KalmanHLS::KFselect<5>& selectOutDigi); - -//--- Normal code below ... - -KFParamsCombCallHLS::KFParamsCombCallHLS(const Settings* settings, const uint nPar, const string &fitterName ) : KFParamsComb(settings, nPar, fitterName) { - - // Get digitisation multipliers. - rMult_ = pow(2, getSettings()->rtBits() ) / (getSettings()->rtRange()); - zMult_ = pow(2, getSettings()->zBits() ) / (getSettings()->zRange()); - phiMult_ = pow(2, getSettings()->phiSBits() ) / (getSettings()->phiSRange()); - const double small = 1.e-6; - if (fabs(rMult_ - KalmanHLS::rMult) / rMult_ > small || fabs(zMult_ - KalmanHLS::rMult / 2) / zMult_ > small || fabs(phiMult_ - KalmanHLS::phiMult) / phiMult_ > small) { - throw cms::Exception("ERROR: KFParamsCombCallHLS inconsistent digi multipliers.")<<" r="<chosenRofPhi(); - // Number of eta sectors. - numEtaRegions_ = getSettings()->numEtaRegions(); - -#ifdef PT_2GEV - if (settings->houghMinPt() > 2.5) throw cms::Exception("KFParamsConmbCallHLS: Edit KFpragmaOpts.h to undefine PT_2GEV"); -#else - if (settings->houghMinPt() < 2.5) throw cms::Exception("KFParamsConmbCallHLS: Edit KFpragmaOpts.h to define PT_2GEV"); -#endif - -#ifdef HYBRID_FORMAT - if (not settings_->hybrid()) throw cms::Exception("KFParamsConmbCallHLS: Edit KFpragmaOpts.h to undefine HYBRID_FORMAT"); -#else - if (settings_->hybrid()) throw cms::Exception("KFParamsConmbCallHLS: Edit KFpragmaOpts.h to define HYBRID_FORMAT"); -#endif -} - -//=== Update KF helix params with this stub. -//=== (Override KF state updator in L1KalmanComb with version suitable for HLS). - -const KalmanState* KFParamsCombCallHLS::kalmanUpdate( unsigned skipped, unsigned layer, const StubCluster *stubCluster, const KalmanState &stateIn, const TP *tpa ) { - - // cout.setf(ios::scientific, ios::floatfield); // Get useful debug printout ... - cout.unsetf(ios::floatfield); // Get useful debug printout ... - cout.precision(8); - - // Get digitised stub info - KalmanHLS::KFstubC stubDigi = this->getDigiStub(stubCluster, &stateIn); - - if (nPar_ == 4) { - - // Get digitised KF state info - KalmanHLS::KFstate<4> stateInDigi = this->getDigiStateIn<4>(skipped, layer, &stateIn); - - // Call HLS code to add stub to helix state. - KalmanHLS::KFstate<4> stateOutDigi; - KalmanHLS::KFselect<4> selectOutDigi; - KalmanHLS::kalmanUpdate(stubDigi, stateInDigi, stateOutDigi, selectOutDigi); - - // Convert digitized ourput KF state to floating point. - const KalmanState* newState = this->getStateOut(&stateIn, stubCluster, stateOutDigi, selectOutDigi); - - return newState; - - } else { - - // Get digitised KF state info - KalmanHLS::KFstate<5> stateInDigi = this->getDigiStateIn<5>(skipped, layer, &stateIn); - - // Call HLS code to add stub to helix state. - KalmanHLS::KFstate<5> stateOutDigi; - KalmanHLS::KFselect<5> selectOutDigi; - KalmanHLS::kalmanUpdate(stubDigi, stateInDigi, stateOutDigi, selectOutDigi); - - // Convert digitized ourput KF state to floating point. - const KalmanState* newState = this->getStateOut(&stateIn, stubCluster, stateOutDigi, selectOutDigi); - - return newState; - } -} - -//=== Get digital stub that the KF VHDL injects into the KF state updater (Maxeller/HLS) - -KalmanHLS::KFstubC KFParamsCombCallHLS::getDigiStub(const StubCluster* stubCluster, const KalmanState* state) { - // Get digitised stub(s) making up stub cluster. - const vector stubs = stubCluster->stubs(); - if (stubs.size() != 1) throw cms::Exception("KFParamsCombCallHLS: Can't cope with StubCluster that doesn't contain a single stub")<digitalStub(); - - KalmanHLS::KFstubC stubDigi; - // KF uses stub r, not rT. - stubDigi.r = digiStub.iDigi_Rt() + std::round(rMult_*chosenRofPhi_); - // KF VHDL z multiplier is factor 2 smaller than r multiplier, with BZ = BZ1 - 1 - // bits assigned to integer part of z in VHDL, and BZ1 bits assigned to it in HLS. Following statement - // therefore doubles the effective z multiplier. - enum {BZ = KalmanHLS::KFstubN::BZ, BZ1 = KalmanHLS::KFstubN::BZ1}; - stubDigi.z.range(BZ-1, 0) = ap_fixed(digiStub.iDigi_Z_KF()).range(BZ-1, 0); - stubDigi.phiS = digiStub.iDigi_PhiS(); - - #ifdef IRT_DEBUG - if (state->candidate().getMatchedTP() != nullptr) { - unsigned int iPhiSec = state->candidate().iPhiSec(); - - // Centre of phi (tracking) nonant zero must be along x-axis to be consistent with tracker cabling map. - // Define phi sector zero to start at lower end of phi range in nonant 0. - float phiCentreSec0 = -M_PI/float(getSettings()->numPhiNonants()) + M_PI/float(getSettings()->numPhiSectors()); - float phiSec = 2.*M_PI * float(iPhiSec) / float(getSettings()->numPhiSectors()) + phiCentreSec0; // Centre of sector in phi - - float phiStubOff = reco::deltaPhi(digiStub.phi(), digiStub.phiS()); - cout<<"KF sector phi check "<phi(),phiSec)<psModule()< -KalmanHLS::KFstate KFParamsCombCallHLS::getDigiStateIn(unsigned int skipped, unsigned int layer, const KalmanState* state) const { - // Calculate factors to convert floating point helix params to digitized ones. - // Based on constants & functions named *HWU* in -//https://svnweb.cern.ch/cern/wsvn/UK-TrackTrig/firmware/trunk/cactusupgrades/projects/tracktrigger/kalmanfit/firmware/cgn/src/formats/Constants.maxj . - - KalmanHLS::KFstate stateDigi; - - // Cell HT found track in, with (mbin,cbin) centred on zero. - pair htCell = state->candidate().getCellLocationHT(); - // Digitized HT cell info must be centred on zero. (See L1fittedTrack::digitalTrack()). - stateDigi.mBin_ht = htCell.first - floor(getSettings()->houghNbinsPt()/2); - stateDigi.cBin_ht = htCell.second - floor(getSettings()->houghNbinsPhi()/2); - - stateDigi.hitPattern = state->hitPattern(); - - // Fitted helix parameters. - vector helixParams = state->xa(); - double inv2R = helixParams[0]; // Half inverse radius of curvature. - double phi0 = helixParams[1]; // Measured with respect to centre of phi sector. - double tanL = helixParams[2]; - double z0 = helixParams[3]; - TMatrixD cov = state->pxxa(); - double cov_inv2R_inv2R = cov[0][0]; - double cov_phi0_phi0 = cov[1][1]; - double cov_tanL_tanL = cov[2][2]; - double cov_z0_z0 = cov[3][3]; - double cov_inv2R_phi0 = cov[0][1]; - double cov_tanL_z0 = cov[2][3]; - - // Digitize helix parameters, using multiplication factors in - // Demonstrator Units" section of https://twiki.cern.ch/twiki/pub/CMS/CMSUKTrkTrig/KFequations.pdf . - - // Using the specified multipliers, which are related to those used for stubs (see getDigiStub()) simplifies the maths. - // The helix params need better granularity than the stubs, which is accomodated by using additional bits after the - // decimal point in the digitized numbers (profitting from Maxeller/HLS ability to handle floats). - - stateDigi.inv2R = inv2R*inv2R_Mult_; // See inv2RToHWU() in Maxeller code in above web link. - stateDigi.phi0 = phi0*phiMult_; - - #ifdef IRT_DEBUG - if (state->candidate().getMatchedTP() != nullptr) { - unsigned int iPhiSec = state->candidate().iPhiSec(); - float phiCentreSec0 = -M_PI/float(getSettings()->numPhiNonants()) + M_PI/float(getSettings()->numPhiSectors()); - float phiSec = 2.*M_PI * float(iPhiSec) / float(getSettings()->numPhiSectors()) + phiCentreSec0; // Centre of sector in phi - cout<<"KF Input track (float): q/pt = "<invPtToInvR())<<" phi0 = "<getDigiStateInUtil(helixParams, cov, stateDigi); - - stateDigi.chiSquaredRphi = state->chi2rphi(); - stateDigi.chiSquaredRz = state->chi2rz(); - - // This is the KF layer that we are currently looking for stubs in, incremented by L1KalmanComb::doKF(), which in any eta region increases from 0-7 as a particle goes through each layer in turn. - stateDigi.layerID = layer; - // This is the number of skipped layers assuming we find a stub in the layer currently being searched. - stateDigi.nSkippedLayers = skipped; - - stateDigi.trackID = 0; // Not used by KF updator. - stateDigi.eventID = 0; // Not used by KF updator. - - unsigned int iEtaReg = state->candidate().iEtaReg(); // Although this comes from the state, it is actually the eta region of the stub. - // This is encoded in tortuous way copied from Maxeller code (lines 127-133). -//https://svnweb.cern.ch/cern/wsvn/UK-TrackTrig/firmware/trunk/cactusupgrades/projects/tracktrigger/kalmanfit/firmware/hdl/packages/stubs.vhd - if (iEtaReg < numEtaRegions_/2) { - stateDigi.etaSectID = (numEtaRegions_/2 - 1) - iEtaReg; // Count eta regions increasing away from theta = 90 degrees. - stateDigi.etaSectZsign = true; // Eta sector in -ve z half of Tracker. - } else { - stateDigi.etaSectID = iEtaReg - numEtaRegions_/2; - stateDigi.etaSectZsign = false; - } - - stateDigi.valid = true; - - return stateDigi; -} - -//=== Implement NPAR-specific code called by getDigiStateIn(...). - -template <> -void KFParamsCombCallHLS::getDigiStateInUtil<4>(const vector& helixParams, const TMatrixD& cov, KalmanHLS::KFstate<4>& stateDigi) const {} - -template <> -void KFParamsCombCallHLS::getDigiStateInUtil<5>(const vector& helixParams, const TMatrixD& cov, KalmanHLS::KFstate<5>& stateDigi) const { - - double d0 = helixParams[4]; - double cov_d0_d0 = cov[4][4]; - double cov_inv2R_d0 = cov[0][4]; - double cov_phi0_d0 = cov[1][4]; - - stateDigi.d0 = d0*d0_Mult_; - stateDigi.cov_44 = cov_d0_d0 * d0_Mult_ * d0_Mult_; - stateDigi.cov_04 = cov_inv2R_d0 * inv2R_Mult_ * d0_Mult_; - stateDigi.cov_14 = cov_phi0_d0 * phiMult_ * d0_Mult_; - KalmanHLS::CHECK_AP::checkCalc("helix4", stateDigi.d0 , d0*d0_Mult_ , 9.9e9, 0.1); - KalmanHLS::CHECK_AP::checkCalc("C44_old", stateDigi.cov_44, cov_d0_d0 * d0_Mult_ * d0_Mult_); - KalmanHLS::CHECK_AP::checkCalc("C04_old", stateDigi.cov_04, cov_inv2R_d0 * inv2R_Mult_ * d0_Mult_); - KalmanHLS::CHECK_AP::checkCalc("C14_old", stateDigi.cov_14, cov_phi0_d0 * phiMult_ * d0_Mult_); -} - -//=== Convert digitized ourput KF state to floating point for both NPAR = 4 & 5 param helix fits. - -template -const KalmanState* KFParamsCombCallHLS::getStateOut(const KalmanState* stateIn, const StubCluster* stubCluster, const KalmanHLS::KFstate& stateOutDigi, const KalmanHLS::KFselect& selectOutDigi) { - // Convert digitized helix state to floating point one. - // Also copy some info directly from input floating point to output floating point state, if unchanged. - - // Fill arguments of L1KalmanComb::mkState(), which is called to make a KalmanState object. - const L1track3D& candidate = stateIn->candidate(); - unsigned int n_skipped = stateOutDigi.nSkippedLayers; - unsigned int kLayer_next = stateOutDigi.layerID; // Unchanged by KF updator. - unsigned int layerId = stateIn->layerId(); - const KalmanState* last_state = stateIn; - - // Factors to convert digitized helix params to floating ones are inverse of those in getDigiStateIn(). - vector x(NPAR); // helix params - x[0] = (double(stateOutDigi.inv2R) + 0.5 / pow(2, stateOutDigi.inv2R.width - stateOutDigi.inv2R.iwidth)) / inv2R_Mult_; - x[1] = (double(stateOutDigi.phi0) + 0.5 / pow(2, stateOutDigi.phi0.width - stateOutDigi.phi0.iwidth )) / phiMult_; - x[2] = (double(stateOutDigi.tanL) + 0.5 / pow(2, stateOutDigi.tanL.width - stateOutDigi.tanL.iwidth )); - x[3] = (double(stateOutDigi.z0) + 0.5 / pow(2, stateOutDigi.z0.width - stateOutDigi.z0.iwidth )) / rMult_; - - TMatrixD pxx(NPAR,NPAR); // helix covariance matrix - pxx[0][0] = (double(stateOutDigi.cov_00) + 0.5 / pow(2, stateOutDigi.cov_00.width - stateOutDigi.cov_00.iwidth)) / (inv2R_Mult_ * inv2R_Mult_); - pxx[1][1] = (double(stateOutDigi.cov_11) + 0.5 / pow(2, stateOutDigi.cov_11.width - stateOutDigi.cov_11.iwidth)) / (phiMult_ * phiMult_); - pxx[2][2] = (double(stateOutDigi.cov_22) + 0.5 / pow(2, stateOutDigi.cov_22.width - stateOutDigi.cov_22.iwidth)); - pxx[3][3] = (double(stateOutDigi.cov_33) + 0.5 / pow(2, stateOutDigi.cov_33.width - stateOutDigi.cov_33.iwidth)) / (rMult_ * rMult_); - pxx[0][1] = (double(stateOutDigi.cov_01) + 0.5 / pow(2, stateOutDigi.cov_01.width - stateOutDigi.cov_01.iwidth)) / (inv2R_Mult_ * phiMult_); - pxx[1][0] = pxx[0][1]; - pxx[2][3] = (double(stateOutDigi.cov_23) + 0.5 / pow(2, stateOutDigi.cov_23.width - stateOutDigi.cov_23.iwidth)) / (rMult_); - pxx[3][2] = pxx[2][3]; - - this->getStateOutUtil(stateOutDigi, selectOutDigi, x, pxx); - - TMatrixD K(nPar_,2); // KF gain matrix - don't provide, as can't be used? - TMatrixD dcov(2,2); // Stub (phi,z) position covariance matrix - don't provide as can't be used? - const StubCluster* stubcl = stubCluster; - double chi2rphi = (double(stateOutDigi.chiSquaredRphi) + 0.5 / pow(2, stateOutDigi.chiSquaredRphi.width - stateOutDigi.chiSquaredRphi.iwidth)); - double chi2rz = (double(stateOutDigi.chiSquaredRz) + 0.5 / pow(2, stateOutDigi.chiSquaredRz.width - stateOutDigi.chiSquaredRz.iwidth)); - - const KalmanState* ks = this->mkState(candidate, n_skipped, kLayer_next, layerId, last_state, - x, pxx, K, dcov, stubcl, chi2rphi, chi2rz); - -#ifdef PRINT_HLSARGS - std::cout<invPtToInvR() / (2*state.xa()[INV2R]) ); - double z0=fabs( state.xa()[Z0] ); - - // Check if this state passes Algo50 duplicate removal cuts. - // (Approximate since it negelects "rescue" step of Algo50). - //bool algo50_HLS = true; - if (nStubLayers > 3) { - // algo50_HLS = (selectOutDigi_.consistent && selectOutDigi_.sectorCut); - // Debug printout to debug Algo50. To be used with "Cheat" cfg option. - // And print fittedTrack.consistent() from TMTrackProducer.cc. - // - // cout<<"algo50: HT consistent="<kalmanDebugLevel() >= 1) { - if (goodState && not goodState_HLS) { - // Errors caused by small precision errors in chi2 cut value. - if (nPar_ == 4) { - cout<<"ERROR: KF HLS incorrectly rejected state "< -#endif - -#ifdef CMSSW_GIT_HASH -namespace TMTT { - -namespace KalmanHLS { -#endif - -//--- Explicit instantiation required for all non-specialized templates, to allow them to be implemented -//--- in .cc files. - -template MatrixInverseR<4>::MatrixInverseR(const MatrixR<4>& R); - -template MatrixInverseR<5>::MatrixInverseR(const MatrixR<5>& R); - -// Covariance matrix of stub coords. - -MatrixV::MatrixV(const KFstubN::TR& r, const KFstubN::TZ& z, const KFstateN::TR& inv2R, const KFstateN::TT& tanL, const KFstateN::TM& mBin) : _01(0), _10(_01) { - - // Numbers from http://ghugo.web.cern.ch/ghugo/layouts/July/OT613_200_IT4025/layout.html - // Module pitch for tilted tracker geometry divided by sqrt(12) to get resolution. - //static const float invRoot12 = 1./sqrt(12.); - static const float invRoot12 = 0.288675; // 1/sqrt(12) - // Declaring these static causes cosimulation to set them to zero. Why? - // But it is OK if invRoot12 is defined as 0.288 instead of 1/sqrt(12.) - static const TM pitchPS = rphiMult*invRoot12*0.0099; // < 1024 - static const TM pitch2S = rphiMult*invRoot12*0.0089; - // Factor 1.41 allows for digitisation granularity (Sioni). - //static const TM lengthPS = rMult*invRoot12*0.15; - static const TM lengthPS = 1.41*rMult*invRoot12*0.15; - static const TM length2S = rMult*invRoot12*5.02; // < 16 - - // Initialise pitch/r ROMs. - static const PitchOverR_2 calcPitchPSoverR_2(pitchPS); - static const PitchOverR_2 calcPitch2SoverR_2(pitch2S); - - PitchOverR_2::TPOR pitchPSoverR_2 = calcPitchPSoverR_2.get[r.to_uint() >> PitchOverR_2::BRED]; - PitchOverR_2::TPOR pitch2SoverR_2 = calcPitch2SoverR_2.get[r.to_uint() >> PitchOverR_2::BRED]; - -#ifdef PRINT_SUMMARY - CHECK_AP::checkCalc("p*p/r*r", pitch2SoverR_2, double(pitch2S*pitch2S)/double(r*r)); -#endif -#ifdef PRINT - std::cout<<"p/r check "< sigmaZ; // Uncertainty in z. - MatrixV::TVPP sigmaPhiExtra2; - - // Initialize ROM used to calculate contribution to phi uncertainty from (r,phi) to (z,phi) conversion in endcap. - static const InvPt2 calcPhiExtra2_PS(1, lengthPS); - static const InvPt2 calcPhiExtra2_2S(1, length2S); - - if (absZ < zBarrel) { - // Barrel -#ifdef PRINT - std::cout<<"BARREL "<(BDET-1)]); - double trueDet = double(R._00)*double(R._11)-double(R._01)*double(R._10); - double trueInvDet = 1./trueDet; - double true_ri00 = double(R._11)*trueInvDet; - double true_ri11 = double(R._00)*trueInvDet; - double true_ri01 = -double(R._10)*trueInvDet; - // double invDet = double(invDet_short)*double(ap_ufixed<1-MIN_SHIFT+MAX_SHIFT, 1-MIN_SHIFT>(1) >> SHIFT); - double invDet = double(invDet_short)*double(ap_ufixed<1+NR_EXTRA, 1+IR_EXTRA>(1) >> SHIFT); - CHECK_AP::checkCalc("DET", det, trueDet, 0.00001); - // Precision of this (controlled by BDET) is critical. - // CHECK_AP::checkCalc("INVDET", invDet_short, - // trueInvDet/double(ap_ufixed<1-MIN_SHIFT+MAX_SHIFT, 1-MIN_SHIFT>(1) >> SHIFT), 0.0001); - CHECK_AP::checkCalc("INVDET", invDet_short, - trueInvDet/double(ap_ufixed<1+NR_EXTRA, 1+IR_EXTRA>(1) >> SHIFT), 0.0001); - CHECK_AP::checkCalc("INVR00", _00, true_ri00, 0.001); - CHECK_AP::checkCalc("INVR01", _01, true_ri01, 0.001); - CHECK_AP::checkCalc("INVR11", _11, true_ri11, 0.001); -#endif -} - -#ifdef CMSSW_GIT_HASH -} - -} -#endif - diff --git a/L1Trigger/TrackFindingTMTT/src/HLS/KalmanMatrices4.cc b/L1Trigger/TrackFindingTMTT/src/HLS/KalmanMatrices4.cc deleted file mode 100644 index 2aa8ca1a49e86..0000000000000 --- a/L1Trigger/TrackFindingTMTT/src/HLS/KalmanMatrices4.cc +++ /dev/null @@ -1,176 +0,0 @@ -///=== This is the base class for the Kalman Combinatorial Filter track fit algorithm. - -///=== All variable names & equations come from Fruhwirth KF paper -///=== http://dx.doi.org/10.1016/0168-9002%2887%2990887-4 - -///=== Written by: Ian Tomalin - -#ifdef CMSSW_GIT_HASH -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices4.h" -#else -#include "KalmanMatrices4.h" -#endif - -#ifdef PRINT_SUMMARY -#include -#endif - -#ifdef CMSSW_GIT_HASH -namespace TMTT { - -namespace KalmanHLS { -#endif - -// Calculate S = H * C - -MatrixS<4>::MatrixS(const MatrixH<4>& H, const MatrixC<4>& C) { - _00 = H._00 * C._00 + H._01 * C._10 + H._02 * C._20 + H._03 * C._30; - _01 = H._00 * C._01 + H._01 * C._11 + H._02 * C._21 + H._03 * C._31; - _02 = H._00 * C._02 + H._01 * C._12 + H._02 * C._22 + H._03 * C._32; - _03 = H._00 * C._03 + H._01 * C._13 + H._02 * C._23 + H._03 * C._33; - _10 = H._10 * C._00 + H._11 * C._10 + H._12 * C._20 + H._13 * C._30; - _11 = H._10 * C._01 + H._11 * C._11 + H._12 * C._21 + H._13 * C._31; - _12 = H._10 * C._02 + H._11 * C._12 + H._12 * C._22 + H._13 * C._32; - _13 = H._10 * C._03 + H._11 * C._13 + H._12 * C._23 + H._13 * C._33; - -#ifdef PRINT_SUMMARY - double s00 = H._00 * C._00 + H._01 * C._10 + H._02 * C._20 + H._03 * C._30; - double s01 = H._00 * C._01 + H._01 * C._11 + H._02 * C._21 + H._03 * C._31; - double s02 = H._00 * C._02 + H._01 * C._12 + H._02 * C._22 + H._03 * C._32; - double s03 = H._00 * C._03 + H._01 * C._13 + H._02 * C._23 + H._03 * C._33; - double s10 = H._10 * C._00 + H._11 * C._10 + H._12 * C._20 + H._13 * C._30; - double s11 = H._10 * C._01 + H._11 * C._11 + H._12 * C._21 + H._13 * C._31; - double s12 = H._10 * C._02 + H._11 * C._12 + H._12 * C._22 + H._13 * C._32; - double s13 = H._10 * C._03 + H._11 * C._13 + H._12 * C._23 + H._13 * C._33; - CHECK_AP::checkCalc("S00", _00, s00, 0.03); - CHECK_AP::checkCalc("S01", _01, s01, 0.03); - CHECK_AP::checkCalc("S02", _02, s02, 0.03); - CHECK_AP::checkCalc("S03", _03, s03, 0.03); - CHECK_AP::checkCalc("S10", _10, s10, 0.03); - CHECK_AP::checkCalc("S11", _11, s11, 0.03); - CHECK_AP::checkCalc("S12", _12, s12, 0.03); - CHECK_AP::checkCalc("S13", _13, s13, 0.03); -#endif -} - -// Calculate covariance matrix of predicted residuals R = V + H*C*Ht = V + H*St. - -MatrixR<4>::MatrixR(const MatrixV& V, const MatrixH<4>& H, const MatrixS_transpose<4>& St) : - _10(_01) -{ - _00 = V._00 + (H._00*St._00 + H._01*St._10 + H._02*St._20 + H._03*St._30); - _01 = V._01 + (H._00*St._01 + H._01*St._11 + H._02*St._21 + H._03*St._31); - // R._10 // Matrix symmetric so don't need to calculate this element. - _11 = V._11 + (H._10*St._01 + H._11*St._11 + H._12*St._21 + H._13*St._31); - -#ifdef PRINT_SUMMARY - double r00 = V._00 + (H._00*St._00 + H._01*St._10 + H._02*St._20 + H._03*St._30); - double r01 = V._01 + (H._00*St._01 + H._01*St._11 + H._02*St._21 + H._03*St._31); - double r11 = V._11 + (H._10*St._01 + H._11*St._11 + H._12*St._21 + H._13*St._31); - CHECK_AP::checkCalc("R00", _00, r00); - CHECK_AP::checkCalc("R01", _01, r01); - CHECK_AP::checkCalc("R11", _11, r11); -#endif -} - -// Kalman gain matrix K = S*R(inverse). - -MatrixK<4>::MatrixK(const MatrixS_transpose<4>& St, const MatrixInverseR<4>& RmatInv) { - _00 = St._00 * RmatInv._00 + St._01 * RmatInv._10; - _10 = St._10 * RmatInv._00 + St._11 * RmatInv._10; - _20 = St._20 * RmatInv._00 + St._21 * RmatInv._10; - _30 = St._30 * RmatInv._00 + St._31 * RmatInv._10; - _01 = St._00 * RmatInv._01 + St._01 * RmatInv._11; - _11 = St._10 * RmatInv._01 + St._11 * RmatInv._11; - _21 = St._20 * RmatInv._01 + St._21 * RmatInv._11; - _31 = St._30 * RmatInv._01 + St._31 * RmatInv._11; - -#ifdef PRINT_SUMMARY - double k00 = double(St._00) * double(RmatInv._00) + double(St._01) * double(RmatInv._10); - double k10 = double(St._10) * double(RmatInv._00) + double(St._11) * double(RmatInv._10); - double k20 = double(St._20) * double(RmatInv._00) + double(St._21) * double(RmatInv._10); - double k30 = double(St._30) * double(RmatInv._00) + double(St._31) * double(RmatInv._10); - double k01 = double(St._00) * double(RmatInv._01) + double(St._01) * double(RmatInv._11); - double k11 = double(St._10) * double(RmatInv._01) + double(St._11) * double(RmatInv._11); - double k21 = double(St._20) * double(RmatInv._01) + double(St._21) * double(RmatInv._11); - double k31 = double(St._30) * double(RmatInv._01) + double(St._31) * double(RmatInv._11); - CHECK_AP::checkCalc("K00", _00, k00, 0.001); - CHECK_AP::checkCalc("K10", _10, k10, 0.001); - CHECK_AP::checkCalc("K20", _20, k20, 0.001); - CHECK_AP::checkCalc("K30", _30, k30, 0.001); - CHECK_AP::checkCalc("K01", _01, k01, 0.001); - CHECK_AP::checkCalc("K11", _11, k11, 0.001); - CHECK_AP::checkCalc("K21", _21, k21, 0.001); - CHECK_AP::checkCalc("K31", _31, k31, 0.001); -#endif -} - -// Hit residuals: res = m - H*x. - -VectorRes<4>::VectorRes(const VectorM& m, const MatrixH<4>& H, const VectorX<4>& x) { - _0 = m._0 - (H._00 * x._0 + H._01 * x._1 + H._02 * x._2 + H._03 * x._3); - _1 = m._1 - (H._10 * x._1 + H._11 * x._1 + H._12 * x._2 + H._13 * x._3); -#ifdef PRINT_SUMMARY - double r0 = double(m._0) - (double(H._00) * double(x._0) + double(H._01) * double(x._1) + - double(H._02) * double(x._2) + double(H._03) * double(x._3)); - double r1 = double(m._1) - (double(H._10) * double(x._0) + double(H._11) * double(x._1) + - double(H._12) * double(x._2) + double(H._13) * double(x._3)); - CHECK_AP::checkCalc("RES0", _0, r0, 0.1, 0.1); - CHECK_AP::checkCalc("RES1", _1, r1, 0.1, 0.1); -#endif -} - -// Calculate output helix params: x' = x + K*res - -VectorX<4>::VectorX(const VectorX<4>& x, const MatrixK<4>& K, const VectorRes<4>& res) { - typedef MatrixK<4>::TK00_short TK00_short; - typedef MatrixK<4>::TK10_short TK10_short; - typedef MatrixK<4>::TK21_short TK21_short; - typedef MatrixK<4>::TK31_short TK31_short; - typedef MatrixK<4>::T0 T0; - _0 = x._0 + KFstateN::TR(TK00_short(K._00) * res._0 + T0 (K._01) * res._1); - _1 = x._1 + KFstateN::TP(TK10_short(K._10) * res._0 + T0 (K._11) * res._1); - _2 = x._2 + KFstateN::TT(T0 (K._20) * res._0 + TK21_short(K._21) * res._1); - _3 = x._3 + KFstateN::TZ(T0 (K._30) * res._0 + TK31_short(K._31) * res._1); -} - - -// Calculate output helix covariance matrix: C' = C - K*H*C = C - K*S. - -MatrixC<4>::MatrixC(const MatrixC<4>& C, const MatrixK<4>& K, const MatrixS<4>& S) : - _02(0), _03(0), _12(0), _13(0), - _10(_01), _32(_23), _20(_02), _30(_03), _21(_12), _31(_13) -{ - // Covariance matrix is symmetric & some elements can be neglected. - _00 = C._00 - KFstateN::TC00EX(K._00 * S._00 + K._01 * S._10); - _11 = C._11 - KFstateN::TC11EX(K._10 * S._01 + K._11 * S._11); - _22 = C._22 - KFstateN::TC22EX(K._20 * S._02 + K._21 * S._12); - _33 = C._33 - KFstateN::TC33EX(K._30 * S._03 + K._31 * S._13); - _01 = C._01 - KFstateN::TC01EX(K._00 * S._01 + K._01 * S._11); - _23 = C._23 - KFstateN::TC23EX(K._20 * S._03 + K._21 * S._13); - -#ifdef PRINT_SUMMARY - double c00new = double(C._00) - (double(K._00) * double(S._00) + double(K._01) * double(S._10)); - double c11new = double(C._11) - (double(K._10) * double(S._01) + double(K._11) * double(S._11)); - double c22new = double(C._22) - (double(K._20) * double(S._02) + double(K._21) * double(S._12)); - double c33new = double(C._33) - (double(K._30) * double(S._03) + double(K._31) * double(S._13)); - double c01new = double(C._01) - (double(K._00) * double(S._01) + double(K._01) * double(S._11)); - double c23new = double(C._23) - (double(K._20) * double(S._03) + double(K._21) * double(S._13)); - CHECK_AP::checkCalc("C00_new", _00, c00new, 0.05); - CHECK_AP::checkCalc("C11_new", _11, c11new, 0.03); - CHECK_AP::checkCalc("C22_new", _22, c22new, 0.04); - CHECK_AP::checkCalc("C33_new", _33, c33new, 0.03); - CHECK_AP::checkCalc("C01_new", _01, c01new, 0.03); - CHECK_AP::checkCalc("C23_new", _23, c23new, 0.03); - CHECK_AP::checkDet("C_new(rphi)",_00,_11,_01); - CHECK_AP::checkDet("C_new(rz)" ,_22,_33,_23); -#endif - -} - -#ifdef CMSSW_GIT_HASH -} - -} -#endif - diff --git a/L1Trigger/TrackFindingTMTT/src/HLS/KalmanMatrices5.cc b/L1Trigger/TrackFindingTMTT/src/HLS/KalmanMatrices5.cc deleted file mode 100644 index dd329f8712435..0000000000000 --- a/L1Trigger/TrackFindingTMTT/src/HLS/KalmanMatrices5.cc +++ /dev/null @@ -1,208 +0,0 @@ -///=== This is the base class for the Kalman Combinatorial Filter track fit algorithm. - -///=== All variable names & equations come from Fruhwirth KF paper -///=== http://dx.doi.org/10.1016/0168-9002%2887%2990887-4 - -///=== Written by: Ian Tomalin - -#ifdef CMSSW_GIT_HASH -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices5.h" -#else -#include "KalmanMatrices5.h" -#endif - -#ifdef PRINT_SUMMARY -#include -#endif - -#ifdef CMSSW_GIT_HASH -namespace TMTT { - -namespace KalmanHLS { -#endif - -// Calculate matrix of derivatives of predicted stub coords w.r.t. helix params. - -MatrixH<5>::THD MatrixH<5>::setH04(const KFstubN::TR& r) { - static const MinusOneOverR calcMinusOneOverR; // Get -1/r - THD h04 = calcMinusOneOverR.get[r.to_uint() >> MinusOneOverR::BRED]; - return h04; -} - -// Calculate S = H * C - -MatrixS<5>::MatrixS(const MatrixH<5>& H, const MatrixC<5>& C) { - _00 = H._00 * C._00 + H._01 * C._10 + H._02 * C._20 + H._03 * C._30 + H._04 * C._40; - _01 = H._00 * C._01 + H._01 * C._11 + H._02 * C._21 + H._03 * C._31 + H._04 * C._41; - _02 = H._00 * C._02 + H._01 * C._12 + H._02 * C._22 + H._03 * C._32 + H._04 * C._42; - _03 = H._00 * C._03 + H._01 * C._13 + H._02 * C._23 + H._03 * C._33 + H._04 * C._43; - _04 = H._00 * C._04 + H._01 * C._14 + H._02 * C._24 + H._03 * C._34 + H._04 * C._44; - _10 = H._10 * C._00 + H._11 * C._10 + H._12 * C._20 + H._13 * C._30 + H._14 * C._40; - _11 = H._10 * C._01 + H._11 * C._11 + H._12 * C._21 + H._13 * C._31 + H._14 * C._41; - _12 = H._10 * C._02 + H._11 * C._12 + H._12 * C._22 + H._13 * C._32 + H._14 * C._42; - _13 = H._10 * C._03 + H._11 * C._13 + H._12 * C._23 + H._13 * C._33 + H._14 * C._43; - _14 = H._10 * C._04 + H._11 * C._14 + H._12 * C._24 + H._13 * C._34 + H._14 * C._44; - -#ifdef PRINT_SUMMARY - double s00 = H._00 * C._00 + H._01 * C._10 + H._02 * C._20 + H._03 * C._30 + H._04 * C._40; - double s01 = H._00 * C._01 + H._01 * C._11 + H._02 * C._21 + H._03 * C._31 + H._04 * C._41; - double s02 = H._00 * C._02 + H._01 * C._12 + H._02 * C._22 + H._03 * C._32 + H._04 * C._42; - double s03 = H._00 * C._03 + H._01 * C._13 + H._02 * C._23 + H._03 * C._33 + H._04 * C._43; - double s04 = H._00 * C._04 + H._01 * C._14 + H._02 * C._24 + H._03 * C._34 + H._04 * C._44; - double s10 = H._10 * C._00 + H._11 * C._10 + H._12 * C._20 + H._13 * C._30 + H._14 * C._40; - double s11 = H._10 * C._01 + H._11 * C._11 + H._12 * C._21 + H._13 * C._31 + H._14 * C._41; - double s12 = H._10 * C._02 + H._11 * C._12 + H._12 * C._22 + H._13 * C._32 + H._14 * C._42; - double s13 = H._10 * C._03 + H._11 * C._13 + H._12 * C._23 + H._13 * C._33 + H._14 * C._43; - double s14 = H._10 * C._04 + H._11 * C._14 + H._12 * C._24 + H._13 * C._34 + H._14 * C._44; - CHECK_AP::checkCalc("S00", _00, s00, 0.03); - CHECK_AP::checkCalc("S01", _01, s01, 0.03); - CHECK_AP::checkCalc("S02", _02, s02, 0.03); - CHECK_AP::checkCalc("S03", _03, s03, 0.03); - CHECK_AP::checkCalc("S04", _04, s04, 0.03); - CHECK_AP::checkCalc("S10", _10, s10, 0.03); - CHECK_AP::checkCalc("S11", _11, s11, 0.03); - CHECK_AP::checkCalc("S12", _12, s12, 0.03); - CHECK_AP::checkCalc("S13", _13, s13, 0.03); - CHECK_AP::checkCalc("S14", _14, s14, 0.03); -#endif -} - -// Calculate covariance matrix of predicted residuals R = V + H*C*Ht = V + H*St. - -MatrixR<5>::MatrixR(const MatrixV& V, const MatrixH<5>& H, const MatrixS_transpose<5>& St) : - _10(_01) -{ - _00 = V._00 + (H._00*St._00 + H._01*St._10 + H._02*St._20 + H._03*St._30 + H._04*St._40); - _01 = V._01 + (H._00*St._01 + H._01*St._11 + H._02*St._21 + H._03*St._31 + H._04*St._41); - // R._10 // Matrix symmetric so don't need to calculate this element. - _11 = V._11 + (H._10*St._01 + H._11*St._11 + H._12*St._21 + H._13*St._31 + H._14*St._41); - -#ifdef PRINT_SUMMARY - double r00 = V._00 + (H._00*St._00 + H._01*St._10 + H._02*St._20 + H._03*St._30 + H._04*St._40); - double r01 = V._01 + (H._00*St._01 + H._01*St._11 + H._02*St._21 + H._03*St._31 + H._04*St._41); - double r11 = V._11 + (H._10*St._01 + H._11*St._11 + H._12*St._21 + H._13*St._31 + H._14*St._41); - CHECK_AP::checkCalc("R00", _00, r00); - CHECK_AP::checkCalc("R01", _01, r01); - CHECK_AP::checkCalc("R11", _11, r11); -#endif -} - -// Kalman gain matrix K = S*R(inverse). - -MatrixK<5>::MatrixK(const MatrixS_transpose<5>& St, const MatrixInverseR<5>& RmatInv) { - _00 = St._00 * RmatInv._00 + St._01 * RmatInv._10; - _10 = St._10 * RmatInv._00 + St._11 * RmatInv._10; - _20 = St._20 * RmatInv._00 + St._21 * RmatInv._10; - _30 = St._30 * RmatInv._00 + St._31 * RmatInv._10; - _40 = St._40 * RmatInv._00 + St._41 * RmatInv._10; - _01 = St._00 * RmatInv._01 + St._01 * RmatInv._11; - _11 = St._10 * RmatInv._01 + St._11 * RmatInv._11; - _21 = St._20 * RmatInv._01 + St._21 * RmatInv._11; - _31 = St._30 * RmatInv._01 + St._31 * RmatInv._11; - _41 = St._30 * RmatInv._01 + St._41 * RmatInv._11; - -#ifdef PRINT_SUMMARY - double k00 = double(St._00) * double(RmatInv._00) + double(St._01) * double(RmatInv._10); - double k10 = double(St._10) * double(RmatInv._00) + double(St._11) * double(RmatInv._10); - double k20 = double(St._20) * double(RmatInv._00) + double(St._21) * double(RmatInv._10); - double k30 = double(St._30) * double(RmatInv._00) + double(St._31) * double(RmatInv._10); - double k40 = double(St._40) * double(RmatInv._00) + double(St._41) * double(RmatInv._10); - double k01 = double(St._00) * double(RmatInv._01) + double(St._01) * double(RmatInv._11); - double k11 = double(St._10) * double(RmatInv._01) + double(St._11) * double(RmatInv._11); - double k21 = double(St._20) * double(RmatInv._01) + double(St._21) * double(RmatInv._11); - double k31 = double(St._30) * double(RmatInv._01) + double(St._31) * double(RmatInv._11); - double k41 = double(St._40) * double(RmatInv._01) + double(St._41) * double(RmatInv._11); - CHECK_AP::checkCalc("K00", _00, k00, 0.001); - CHECK_AP::checkCalc("K10", _10, k10, 0.001); - CHECK_AP::checkCalc("K20", _20, k20, 0.001); - CHECK_AP::checkCalc("K30", _30, k30, 0.001); - CHECK_AP::checkCalc("K40", _40, k40, 0.001); - CHECK_AP::checkCalc("K01", _01, k01, 0.001); - CHECK_AP::checkCalc("K11", _11, k11, 0.001); - CHECK_AP::checkCalc("K21", _21, k21, 0.001); - CHECK_AP::checkCalc("K31", _31, k31, 0.001); - CHECK_AP::checkCalc("K41", _41, k41, 0.001); -#endif -} - -// Hit residuals: res = m - H*x. - -VectorRes<5>::VectorRes(const VectorM& m, const MatrixH<5>& H, const VectorX<5>& x) { - _0 = m._0 - (H._00 * x._0 + H._01 * x._1 + H._02 * x._2 + H._03 * x._3 + H._04 * x._4); - _1 = m._1 - (H._10 * x._1 + H._11 * x._1 + H._12 * x._2 + H._13 * x._3 + H._14 * x._4); -#ifdef PRINT_SUMMARY - double r0 = double(m._0) - (double(H._00) * double(x._0) + double(H._01) * double(x._1) + - double(H._02) * double(x._2) + double(H._03) * double(x._3) + - double(H._04) * double(x._4)); - double r1 = double(m._1) - (double(H._10) * double(x._0) + double(H._11) * double(x._1) + - double(H._12) * double(x._2) + double(H._13) * double(x._3) + - double(H._14) * double(x._4)); - CHECK_AP::checkCalc("RES0", _0, r0, 0.1, 0.1); - CHECK_AP::checkCalc("RES1", _1, r1, 0.1, 0.1); -#endif -} - -// Calculate output helix params: x' = x + K*res - -VectorX<5>::VectorX(const VectorX<5>& x, const MatrixK<5>& K, const VectorRes<5>& res) { - typedef MatrixK<5>::TK00_short TK00_short; - typedef MatrixK<5>::TK10_short TK10_short; - typedef MatrixK<5>::TK21_short TK21_short; - typedef MatrixK<5>::TK31_short TK31_short; - typedef MatrixK<5>::TK40_short TK40_short; - typedef MatrixK<5>::T0 T0; - _0 = x._0 + KFstateN::TR(TK00_short(K._00) * res._0 + T0 (K._01) * res._1); - _1 = x._1 + KFstateN::TP(TK10_short(K._10) * res._0 + T0 (K._11) * res._1); - _2 = x._2 + KFstateN::TT(T0 (K._20) * res._0 + TK21_short(K._21) * res._1); - _3 = x._3 + KFstateN::TZ(T0 (K._30) * res._0 + TK31_short(K._31) * res._1); - _4 = x._4 + KFstateN::TD(TK40_short(K._40) * res._0 + T0 (K._41) * res._1); -} - - -// Calculate output helix covariance matrix: C' = C - K*H*C = C - K*S. - -MatrixC<5>::MatrixC(const MatrixC<5>& C, const MatrixK<5>& K, const MatrixS<5>& S) : - _02(0), _03(0), _12(0), _13(0), _42(0), _43(0), - _10(_01), _32(_23), _40(_04), _41(_14), _20(_02), _30(_03), _21(_12), _31(_13), _24(_42), _34(_43) -{ - // Covariance matrix is symmetric & some elements can be neglected. - _00 = C._00 - KFstateN::TC00EX(K._00 * S._00 + K._01 * S._10); - _11 = C._11 - KFstateN::TC11EX(K._10 * S._01 + K._11 * S._11); - _22 = C._22 - KFstateN::TC22EX(K._20 * S._02 + K._21 * S._12); - _33 = C._33 - KFstateN::TC33EX(K._30 * S._03 + K._31 * S._13); - _44 = C._44 - KFstateN::TC44EX(K._40 * S._04 + K._41 * S._14); - _01 = C._01 - KFstateN::TC01EX(K._00 * S._01 + K._01 * S._11); - _23 = C._23 - KFstateN::TC23EX(K._20 * S._03 + K._21 * S._13); - _04 = C._04 - KFstateN::TC04EX(K._00 * S._04 + K._01 * S._14); - _14 = C._14 - KFstateN::TC14EX(K._10 * S._04 + K._11 * S._14); - -#ifdef PRINT_SUMMARY - double c00new = double(C._00) - (double(K._00) * double(S._00) + double(K._01) * double(S._10)); - double c11new = double(C._11) - (double(K._10) * double(S._01) + double(K._11) * double(S._11)); - double c22new = double(C._22) - (double(K._20) * double(S._02) + double(K._21) * double(S._12)); - double c33new = double(C._33) - (double(K._30) * double(S._03) + double(K._31) * double(S._13)); - double c44new = double(C._44) - (double(K._40) * double(S._04) + double(K._41) * double(S._14)); - double c01new = double(C._01) - (double(K._00) * double(S._01) + double(K._01) * double(S._11)); - double c23new = double(C._23) - (double(K._20) * double(S._03) + double(K._21) * double(S._13)); - double c04new = double(C._04) - (double(K._00) * double(S._04) + double(K._01) * double(S._14)); - double c14new = double(C._14) - (double(K._10) * double(S._04) + double(K._11) * double(S._14)); - CHECK_AP::checkCalc("C00_new", _00, c00new, 0.03); - CHECK_AP::checkCalc("C11_new", _11, c11new, 0.03); - CHECK_AP::checkCalc("C22_new", _22, c22new, 0.03); - CHECK_AP::checkCalc("C33_new", _33, c33new, 0.03); - CHECK_AP::checkCalc("C44_new", _44, c44new, 0.03); - CHECK_AP::checkCalc("C01_new", _01, c01new, 0.03); - CHECK_AP::checkCalc("C23_new", _23, c23new, 0.03); - CHECK_AP::checkCalc("C04_new", _04, c04new, 0.03); - CHECK_AP::checkCalc("C14_new", _14, c14new, 0.03); - CHECK_AP::checkDet("C_new(rphi)",_00,_11,_44, _01, _04, _14); - CHECK_AP::checkDet("C_new(rz)" ,_22,_33,_23); -#endif -} - -#ifdef CMSSW_GIT_HASH -} - -} -#endif - diff --git a/L1Trigger/TrackFindingTMTT/src/HLS/KalmanUpdate.cc b/L1Trigger/TrackFindingTMTT/src/HLS/KalmanUpdate.cc deleted file mode 100644 index 7f8eef04f291c..0000000000000 --- a/L1Trigger/TrackFindingTMTT/src/HLS/KalmanUpdate.cc +++ /dev/null @@ -1,311 +0,0 @@ -/** - * This is the top-level HLS function, which updates a helix state by adding a stub to it. - * N.B. It therefore can't use the Settings class or any external libraries! Nor can it be a C++ class. - * - * All variable names & equations come from Fruhwirth KF paper - * http://dx.doi.org/10.1016/0168-9002%2887%2990887-4 - * - * Author: Ian Tomalin - */ - -#ifdef CMSSW_GIT_HASH -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanUpdate.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KalmanMatrices.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/HLSutilities.h" -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFconstants.h" -#else -#include "KalmanUpdate.h" -#include "KalmanMatrices.h" -#include "HLSutilities.h" -#include "KFconstants.h" -#endif - -#ifdef PRINT_SUMMARY -#include -#endif - -#ifdef CMSSW_GIT_HASH -namespace TMTT { - -namespace KalmanHLS { -#endif - -//--- Explicit instantiation required for all non-specialized templates, to allow them to be implemented -//--- in .cc files. - -template void kalmanUpdate(const KFstubC& stub, const KFstate<4>& stateIn, KFstate<4>& stateOut, KFselect<4>& selectOut); - -template void kalmanUpdate(const KFstubC& stub, const KFstate<5>& stateIn, KFstate<5>& stateOut, KFselect<5>& selectOut); - -template void calcDeltaChi2(const VectorRes<4>& res, const MatrixInverseR<4>& Rinv, TCHI_INT& dChi2_phi, TCHI_INT& dChi2_z); - -template void calcDeltaChi2(const VectorRes<5>& res, const MatrixInverseR<5>& Rinv, TCHI_INT& dChi2_phi, TCHI_INT& dChi2_z); - -//=== Add stub to old KF helix state to get new KF helix state. - -template -void kalmanUpdate(const KFstubC& stub, const KFstate& stateIn, KFstate& stateOut, KFselect& selectOut) { - - stateOut.cBin_ht = stateIn.cBin_ht; - stateOut.mBin_ht = stateIn.mBin_ht; - stateOut.layerID = stateIn.layerID; - stateOut.nSkippedLayers = stateIn.nSkippedLayers; - stateOut.hitPattern = stateIn.hitPattern; - stateOut.trackID = stateIn.trackID; - stateOut.eventID = stateIn.eventID; - stateOut.phiSectID = stateIn.phiSectID; - stateOut.etaSectID = stateIn.etaSectID; - stateOut.etaSectZsign = stateIn.etaSectZsign; - stateOut.valid = (stub.valid && stateIn.valid); - -#ifdef PRINT_SUMMARY - static bool first = true; - if (first) { - first = false; - std::cout< MAX_CHI2) chi2_phi = MAX_CHI2; - if (chi2_z > MAX_CHI2) chi2_z = MAX_CHI2; - stateOut.chiSquaredRphi = chi2_phi; - stateOut.chiSquaredRz = chi2_z; - - stateOut.inv2R = x_new._0; - stateOut.phi0 = x_new._1; - stateOut.tanL = x_new._2; - stateOut.z0 = x_new._3; - stateOut.cov_00 = C_new._00; - stateOut.cov_11 = C_new._11; - stateOut.cov_22 = C_new._22; - stateOut.cov_33 = C_new._33; - stateOut.cov_01 = C_new._01; - stateOut.cov_23 = C_new._23; - - // Check if output helix passes cuts. - // (Copied from Maxeller code KFWorker.maxj) - ap_uint<3> nStubs = stateIn.layerID - stateIn.nSkippedLayers; // Number of stubs on state including current one. - - // IRT - feed in test helix params to debug cases seen in QuestaSim. (1/2r, phi, tanl, z0) - //x_new._0 = float(-8163)/float(1 << (B18 - KFstateN::BH0)); - //x_new._1 = float(-57543)/float(1 << (B18 - KFstateN::BH1)); - //x_new._2 = float(4285)/float(1 << (B18 - KFstateN::BH2)); - //x_new._3 = float(-7652)/float(1 << (B18 - KFstateN::BH3)); - - KFstateN::TZ cut_z0 = z0Cut[nStubs]; - KFstateN::TZ cut_z0_minus = z0CutMinus[nStubs]; - KFstateN::TR cut_inv2R = inv2Rcut[nStubs]; - KFstateN::TR cut_inv2R_minus = inv2RcutMinus[nStubs]; - KFstateN::TCHI cut_chi2 = chi2Cut[nStubs]; - // Don't do "hls::abs(x_new._3) <= cut_z0)" as this wastes 2 clk cycles. - // Also, don't do "cut_z0_minus = - cut_z0" or this fails Vivado implementation with timing errors. - selectOut.z0Cut = ((x_new._3 >= cut_z0_minus && x_new._3 <= cut_z0) || (cut_z0 == 0)); // cut = 0 means cut not applied. - selectOut.ptCut = ((x_new._0 >= cut_inv2R_minus && x_new._0 <= cut_inv2R) || (cut_inv2R == 0)); - selectOut.chiSquaredCut = ((chi2_phi / chi2rphiScale + chi2_z <= cut_chi2) || (cut_chi2 == 0)); - selectOut.sufficientPScut = not (nStubs <= 2 && V._2Smodule); - // IRT -- very useful whilst optimising variable bit ranges, to skip all but first iteration. - //selectOut.ptCut = false; - - //=== Set output helix params & associated cov matrix related to d0, & check if d0 passes cut. - //=== (Relevant only to 5-param helix fit) - setOutputsD0(x_new, C_new, nStubs, stateOut, selectOut); - -#ifdef PRINT_HLSARGS - stub.print("HLS INPUT stub:"); - stateIn.print("HLS INPUT state:"); - stateOut.print("HLS OUTPUT state:"); - selectOut.print("HLS OUTPUT extra:"); -#endif -} - -//=== Calculate increase in chi2 (in r-phi & r-z) from adding new stub: delta(chi2) = res(transpose) * R(inverse) * res - -template -void calcDeltaChi2(const VectorRes& res, const MatrixInverseR& Rinv, TCHI_INT& dChi2_phi, TCHI_INT& dChi2_z) { - // Simplify calculation by noting that Rinv is symmetric. - typedef typename MatrixInverseR::TRI00_short TRI00_short; - typedef typename MatrixInverseR::TRI11_short TRI11_short; - typedef typename MatrixInverseR::TRI01_short TRI01_short; - dChi2_phi = (res._0 * res._0) * TRI00_short(Rinv._00) + - 2 * (res._0 * res._1) * TRI01_short(Rinv._01); - dChi2_z = (res._1 * res._1) * TRI11_short(Rinv._11); -#ifdef PRINT_SUMMARY - double chi2_00 = double(res._0) * double(res._0) * double(Rinv._00); - double chi2_01 = double(res._0) * double(res._1) * double(Rinv._01); - double chi2_11 = double(res._1) * double(res._1) * double(Rinv._11); - CHECK_AP::checkCalc("dChi2_phi", dChi2_phi, chi2_00 + 2*chi2_01, 0.1, 0.1); - CHECK_AP::checkCalc("dChi2_z" , dChi2_z , chi2_11 , 0.1, 0.1); -#ifdef PRINT - std::cout<<"Delta chi2_phi = "<& x_new, const MatrixC<4>& C_new, const ap_uint<3>& nStubs, KFstate<4>& stateOut, KFselect<4>& selectOut) {} - -void setOutputsD0(const VectorX<5>& x_new, const MatrixC<5>& C_new, const ap_uint<3>& nStubs, KFstate<5>& stateOut, KFselect<5>& selectOut) { - stateOut.d0 = x_new._4; - stateOut.cov_44 = C_new._44; - stateOut.cov_04 = C_new._04; - stateOut.cov_14 = C_new._14; - KFstateN::TD cut_d0 = d0Cut[nStubs]; - KFstateN::TD cut_d0_minus = d0CutMinus[nStubs]; - selectOut.d0Cut = ((x_new._4 >= cut_d0_minus && x_new._4 <= cut_d0) || (cut_d0 == 0)); -} - - // ----- The following code is now done in VHDL at end of KF, so no longer needed in HLS. ----- - // ----- It used to be run at the end of kalmanUpdate(...) ----- - - /* - - typename KFstateN::TP phiAtRefR = x_new._1 - chosenRofPhi * x_new._0; - KFstubN::TZ zAtRefR = x_new._3 + chosenRofZ * x_new._2; // Intentional use of KFstubN::TZ type - - // Constants BMH & BCH below set in KFconstants.h - // Casting from ap_fixed to ap_int rounds to zero, not -ve infinity, so cast to ap_fixed with no fractional part first. - ap_int mBin_fit_tmp = ap_fixed( - ap_fixed(x_new._0) << inv2RToMbin_bitShift - ); - ap_int cBin_fit_tmp = ap_fixed( - ap_fixed(phiAtRefR) >> phiToCbin_bitShift - ); - bool cBinInRange = (cBin_fit_tmp >= minPhiBin && cBin_fit_tmp <= maxPhiBin); - - // Duplicate removal works best in mBin_fit is forced back into HT array if it lies just outside. - KFstateN::TM mBin_fit_tmp_trunc; - if (mBin_fit_tmp < minPtBin) { - mBin_fit_tmp_trunc = minPtBin; - } else if (mBin_fit_tmp > maxPtBin) { - mBin_fit_tmp_trunc = maxPtBin; - } else { - mBin_fit_tmp_trunc = mBin_fit_tmp; - } - KFstateN::TC cBin_fit_tmp_trunc = cBin_fit_tmp; - selectOut.mBin_fit = mBin_fit_tmp_trunc; - selectOut.cBin_fit = cBin_fit_tmp_trunc; - //std::cout<<"MBIN helix "< etaBounds.z_[TMPS] && zAtRefR < etaBounds.z_[TMPS+1]); - - if (stateIn.etaSectZsign == 1) zAtRefR = -zAtRefR; - bool inEtaSector = (zAtRefR > etaBounds.z_[stateIn.etaSectID] && zAtRefR < etaBounds.z_[stateIn.etaSectID+1]); - - selectOut.sectorCut = (cBinInRange && inEtaSector); - selectOut.consistent = (mBin_fit_tmp_trunc == stateIn.mBin_ht && cBin_fit_tmp_trunc == stateIn.cBin_ht); - - //std::cout<<"ZCALC "<& stateIn, KFstate& stateOut, KFselect& selectOut) { - -#pragma HLS PIPELINE II=1 - //#pragma HLS INTERFACE ap_ctrl_hs register port=return - //#pragma HLS INTERFACE ap_none port=stub register - //#pragma HLS INTERFACE ap_none port=stateIn register - //#pragma HLS INTERFACE ap_none port=stateOut register - //#pragma HLS INTERFACE ap_none port=selectOut register - -#pragma HLS INTERFACE ap_ctrl_hs port=return -#pragma HLS INTERFACE ap_none port=stub -#pragma HLS INTERFACE ap_none port=stateIn -#pragma HLS INTERFACE ap_none port=stateOut -#pragma HLS INTERFACE ap_none port=selectOut - - kalmanUpdate(stub, stateIn, stateOut, selectOut); -} - -#ifdef CMSSW_GIT_HASH -} - -} -#endif From 7ff043b2b2884530f90b6a138b5e285520d17aef Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Thu, 2 Apr 2020 14:39:33 +0100 Subject: [PATCH 06/22] Ran scram b code-format --- L1Trigger/TrackFindingTMTT/Doxyfile | 1519 ---- .../interface/ChiSquared4ParamsApprox.h | 27 +- .../interface/ConverterToTTTrack.h | 89 +- .../TrackFindingTMTT/interface/DeadModuleDB.h | 136 +- .../TrackFindingTMTT/interface/DegradeBend.h | 105 +- .../TrackFindingTMTT/interface/DigitalStub.h | 548 +- .../TrackFindingTMTT/interface/DigitalTrack.h | 669 +- .../TrackFindingTMTT/interface/Get3Dtracks.h | 145 +- L1Trigger/TrackFindingTMTT/interface/HTbase.h | 213 +- L1Trigger/TrackFindingTMTT/interface/HTcell.h | 199 +- L1Trigger/TrackFindingTMTT/interface/HTrphi.h | 288 +- L1Trigger/TrackFindingTMTT/interface/Histos.h | 1260 ++-- .../TrackFindingTMTT/interface/InputData.h | 76 +- .../TrackFindingTMTT/interface/KFParamsComb.h | 60 +- .../interface/KFTrackletTrack.h | 470 +- .../TrackFindingTMTT/interface/KalmanState.h | 204 +- .../interface/KillDupFitTrks.h | 51 +- .../TrackFindingTMTT/interface/KillDupTrks.h | 75 +- .../interface/KillDupTrks.icc | 646 +- .../TrackFindingTMTT/interface/L1ChiSquared.h | 48 +- .../TrackFindingTMTT/interface/L1KalmanComb.h | 345 +- .../interface/L1fittedTrack.h | 672 +- .../TrackFindingTMTT/interface/L1track2D.h | 226 +- .../TrackFindingTMTT/interface/L1track3D.h | 445 +- .../TrackFindingTMTT/interface/L1trackBase.h | 74 +- L1Trigger/TrackFindingTMTT/interface/Matrix.h | 111 +- .../TrackFindingTMTT/interface/MiniHTstage.h | 95 +- .../TrackFindingTMTT/interface/MuxHToutputs.h | 100 +- L1Trigger/TrackFindingTMTT/interface/Sector.h | 227 +- .../TrackFindingTMTT/interface/Settings.h | 1411 ++-- .../TrackFindingTMTT/interface/SimpleLR.h | 100 +- L1Trigger/TrackFindingTMTT/interface/Stub.h | 684 +- .../TrackFindingTMTT/interface/StubCluster.h | 135 +- .../TrackFindingTMTT/interface/StubKiller.h | 66 +- .../interface/StubWindowSuggest.h | 63 +- L1Trigger/TrackFindingTMTT/interface/TP.h | 231 +- .../interface/TrackFitGeneric.h | 54 +- .../interface/TrackerGeometryInfo.h | 41 +- .../TrackFindingTMTT/interface/TrkRZfilter.h | 162 +- .../TrackFindingTMTT/interface/Utility.h | 76 +- .../interfaceDemo/DigiConverter.h | 35 +- .../interfaceDemo/DigiConverter.icc | 172 +- .../interfaceDemo/DigiProducer.h | 55 +- .../interfaceDemo/DigiProducer.icc | 593 +- .../plugins/TMTrackProducer.cc | 567 +- .../plugins/TMTrackProducer.h | 59 +- .../src/ChiSquared4ParamsApprox.cc | 334 +- .../src/ConverterToTTTrack.cc | 129 +- .../TrackFindingTMTT/src/DeadModuleDB.cc | 89 +- L1Trigger/TrackFindingTMTT/src/DegradeBend.cc | 378 +- L1Trigger/TrackFindingTMTT/src/DigitalStub.cc | 734 +- .../TrackFindingTMTT/src/DigitalTrack.cc | 603 +- L1Trigger/TrackFindingTMTT/src/Get3Dtracks.cc | 211 +- L1Trigger/TrackFindingTMTT/src/HTbase.cc | 373 +- L1Trigger/TrackFindingTMTT/src/HTcell.cc | 249 +- L1Trigger/TrackFindingTMTT/src/HTrphi.cc | 1262 ++-- L1Trigger/TrackFindingTMTT/src/Histos.cc | 6548 +++++++++-------- L1Trigger/TrackFindingTMTT/src/InputData.cc | 195 +- .../TrackFindingTMTT/src/KFParamsComb.cc | 709 +- .../TrackFindingTMTT/src/KFTrackletTrack.cc | 3 +- L1Trigger/TrackFindingTMTT/src/KalmanState.cc | 276 +- .../TrackFindingTMTT/src/KillDupFitTrks.cc | 440 +- .../TrackFindingTMTT/src/L1ChiSquared.cc | 253 +- .../TrackFindingTMTT/src/L1KalmanComb.cc | 2865 ++++---- .../TrackFindingTMTT/src/L1fittedTrack.cc | 159 +- L1Trigger/TrackFindingTMTT/src/Matrix.cc | 635 +- L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc | 431 +- .../TrackFindingTMTT/src/MuxHToutputs.cc | 286 +- L1Trigger/TrackFindingTMTT/src/Sector.cc | 520 +- L1Trigger/TrackFindingTMTT/src/Settings.cc | 915 +-- L1Trigger/TrackFindingTMTT/src/SimpleLR.cc | 573 +- L1Trigger/TrackFindingTMTT/src/Stub.cc | 1223 +-- L1Trigger/TrackFindingTMTT/src/StubCluster.cc | 157 +- L1Trigger/TrackFindingTMTT/src/StubKiller.cc | 430 +- .../TrackFindingTMTT/src/StubWindowSuggest.cc | 236 +- L1Trigger/TrackFindingTMTT/src/TP.cc | 299 +- .../TrackFindingTMTT/src/TrackFitGeneric.cc | 59 +- .../src/TrackerGeometryInfo.cc | 93 +- L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc | 514 +- L1Trigger/TrackFindingTMTT/src/Utility.cc | 315 +- .../TrackFindingTMTT/test/PlotEtaSectors.C | 74 +- .../TrackFindingTMTT/test/TrackerLayout.png | Bin 19529 -> 0 bytes L1Trigger/TrackFindingTMTT/test/chi2dof_cut.C | 34 +- L1Trigger/TrackFindingTMTT/test/plot.C | 41 +- 84 files changed, 18344 insertions(+), 17928 deletions(-) delete mode 100644 L1Trigger/TrackFindingTMTT/Doxyfile delete mode 100644 L1Trigger/TrackFindingTMTT/test/TrackerLayout.png diff --git a/L1Trigger/TrackFindingTMTT/Doxyfile b/L1Trigger/TrackFindingTMTT/Doxyfile deleted file mode 100644 index 6cb91d26e52b8..0000000000000 --- a/L1Trigger/TrackFindingTMTT/Doxyfile +++ /dev/null @@ -1,1519 +0,0 @@ -# Doxyfile 1.6.1 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = "IanSimpleCode version of TMTrackTrigger/TMTrackFinder/" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it parses. -# With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this tag. -# The format is ext=language, where ext is a file extension, and language is one of -# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, -# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat -# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), -# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen to replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penality. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will rougly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by -# doxygen. The layout file controls the global structure of the generated output files -# in an output format independent way. The create the layout file that represents -# doxygen's defaults, run doxygen with the -l option. You can optionally specify a -# file name after the option, if omitted DoxygenLayout.xml will be used as the name -# of the layout file. - -LAYOUT_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = L1Trigger SimTracker - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# If the HTML_TIMESTAMP tag is set to YES then the generated HTML -# documentation will contain the timesstamp. - -HTML_TIMESTAMP = NO - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER -# are set, an additional index file will be generated that can be used as input for -# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated -# HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. -# For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's -# filter section matches. -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# When the SEARCHENGINE tag is enable doxygen will generate a search box for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP) -# there is already a search function so this one should typically -# be disabled. - -SEARCHENGINE = YES - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# By default doxygen will write a font called FreeSans.ttf to the output -# directory and reference it in all dot files that doxygen generates. This -# font does not include all possible unicode characters however, so when you need -# these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory -# containing the font. - -DOT_FONTNAME = FreeSans - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/L1Trigger/TrackFindingTMTT/interface/ChiSquared4ParamsApprox.h b/L1Trigger/TrackFindingTMTT/interface/ChiSquared4ParamsApprox.h index b2998b26c96dd..d5d2ee886d62c 100644 --- a/L1Trigger/TrackFindingTMTT/interface/ChiSquared4ParamsApprox.h +++ b/L1Trigger/TrackFindingTMTT/interface/ChiSquared4ParamsApprox.h @@ -1,29 +1,28 @@ #ifndef __CHI_SQUARED_4_PARAMS_APPROX__ #define __CHI_SQUARED_4_PARAMS_APPROX__ - + #include "L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h" namespace TMTT { - -class ChiSquared4ParamsApprox : public L1ChiSquared{ - -public: + + class ChiSquared4ParamsApprox : public L1ChiSquared { + public: ChiSquared4ParamsApprox(const Settings* settings, const uint nPar); - - ~ChiSquared4ParamsApprox(){} - -protected: + + ~ChiSquared4ParamsApprox() {} + + protected: std::vector seed(const L1track3D& l1track3D); std::vector residuals(std::vector x); Matrix D(std::vector x); Matrix Vinv(); std::map convertParams(std::vector x); - -private: + + private: std::vector mapToVec(std::map x); std::map vecToMap(std::vector x); -}; + }; + +} // namespace TMTT -} - #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h b/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h index ef9b5bbe85968..a0b61a498b9a5 100644 --- a/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h +++ b/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h @@ -11,53 +11,50 @@ using namespace std; namespace TMTT { -typedef edmNew::DetSetVector< TTStub > DetSetVec; -typedef edm::Ref > TTStubRef; - -//=== Convert our non-persistent L1 track collection to the official persistent CMSSW EDM TTTrack format. -//=== Works for both L1track3D and for L1fittedTrk4and5 objects. - -class ConverterToTTTrack { - -public: - - // Initialize constants. - ConverterToTTTrack(const Settings* settings) : settings_(settings) {invPtToInvR_ = settings->invPtToInvR();} - - ~ConverterToTTTrack(){} - - // N.B. The function with argument L1fittedTrk4and5 below should be used if both 4 and 5 parameter helix fit results - // are to be stored in the same TTTrack object. Whilst the function with argument L1fittedTrack should be used if - // they are two be stored in two different TTTrack objects. - // One of these is a better idea, but we don't yet know which, so keep both functions! - // N.B. Do not call these two functions for invalid fitted tracks. - - // Convert L1track3D (track candidate before fit) to TTTrack format. - TTTrack< Ref_Phase2TrackerDigi_ > makeTTTrack(const L1track3D& trk , unsigned int iPhiSec, unsigned int iEtaReg) const; - // Convert L1fittedTrack (track candidate after fit) to TTTrack format. - TTTrack< Ref_Phase2TrackerDigi_ > makeTTTrack(const L1fittedTrack& trk , unsigned int iPhiSec, unsigned int iEtaReg) const; - -private: - - // Get references to stubs on track. (Templated, so works for either L1track3D or L1fittedTrack). - template - std::vector getStubRefs(const T& trk) const { - - std::vector ttstubrefs; - const std::vector stubs = trk.getStubs(); - for (size_t ii = 0; ii < stubs.size(); ii++) { - TTStubRef ref = *stubs.at(ii); - ttstubrefs.push_back(ref); + typedef edmNew::DetSetVector > DetSetVec; + typedef edm::Ref > TTStubRef; + + //=== Convert our non-persistent L1 track collection to the official persistent CMSSW EDM TTTrack format. + //=== Works for both L1track3D and for L1fittedTrk4and5 objects. + + class ConverterToTTTrack { + public: + // Initialize constants. + ConverterToTTTrack(const Settings* settings) : settings_(settings) { invPtToInvR_ = settings->invPtToInvR(); } + + ~ConverterToTTTrack() {} + + // N.B. The function with argument L1fittedTrk4and5 below should be used if both 4 and 5 parameter helix fit results + // are to be stored in the same TTTrack object. Whilst the function with argument L1fittedTrack should be used if + // they are two be stored in two different TTTrack objects. + // One of these is a better idea, but we don't yet know which, so keep both functions! + // N.B. Do not call these two functions for invalid fitted tracks. + + // Convert L1track3D (track candidate before fit) to TTTrack format. + TTTrack makeTTTrack(const L1track3D& trk, unsigned int iPhiSec, unsigned int iEtaReg) const; + // Convert L1fittedTrack (track candidate after fit) to TTTrack format. + TTTrack makeTTTrack(const L1fittedTrack& trk, + unsigned int iPhiSec, + unsigned int iEtaReg) const; + + private: + // Get references to stubs on track. (Templated, so works for either L1track3D or L1fittedTrack). + template + std::vector getStubRefs(const T& trk) const { + std::vector ttstubrefs; + const std::vector stubs = trk.getStubs(); + for (size_t ii = 0; ii < stubs.size(); ii++) { + TTStubRef ref = *stubs.at(ii); + ttstubrefs.push_back(ref); + } + + return ttstubrefs; } - return ttstubrefs; - } - -private: - - const Settings *settings_; // Configuration parameters. - float invPtToInvR_; // converts 1/Pt to 1/radius_of_curvature -}; + private: + const Settings* settings_; // Configuration parameters. + float invPtToInvR_; // converts 1/Pt to 1/radius_of_curvature + }; -} +} // namespace TMTT #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h b/L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h index a35bcdb0fe324..38e05decb131c 100644 --- a/L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h +++ b/L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h @@ -13,11 +13,11 @@ using namespace std; namespace TMTT { -class Settings; -class Stub; + class Settings; + class Stub; -//=============================================================================================================== -/** + //=============================================================================================================== + /** * This class allows you to declare parts of the Tracker to be dead. * You should edit the C++ implementation of this class to specify which moduels are dead. * @@ -25,76 +25,76 @@ class Stub; * * Modify function defineDeadSectors() to reduce the number of layers cut on tracks in certain (eta,phi) sectors. */ -//=============================================================================================================== + //=============================================================================================================== -class DeadModuleDB { - -public: - - DeadModuleDB() {this->defineDeadTrackerRegions(); this->defineDeadSectors();} - - ~DeadModuleDB() {} + class DeadModuleDB { + public: + DeadModuleDB() { + this->defineDeadTrackerRegions(); + this->defineDeadSectors(); + } - // Does this stub lie in a dead region of the tracker? - // This function is only invoked if cfg param DeadSimulate = True & used to kill stubs to emulate dead regions. - bool killStub(const Stub* stub) const; + ~DeadModuleDB() {} - // Should the required number of layers that tracks must have be reduced by 1 in the given sector, because of dead modules - // within it? This function is only invoked if cfg param DeadReduceLayers = True. - bool reduceLayerCut(unsigned int iPhiSec, unsigned int iEtaReg) const {return reduceLayerCut_.find( pair(iPhiSec, iEtaReg) ) != reduceLayerCut_.end();} + // Does this stub lie in a dead region of the tracker? + // This function is only invoked if cfg param DeadSimulate = True & used to kill stubs to emulate dead regions. + bool killStub(const Stub* stub) const; -public: + // Should the required number of layers that tracks must have be reduced by 1 in the given sector, because of dead modules + // within it? This function is only invoked if cfg param DeadReduceLayers = True. + bool reduceLayerCut(unsigned int iPhiSec, unsigned int iEtaReg) const { + return reduceLayerCut_.find(pair(iPhiSec, iEtaReg)) != reduceLayerCut_.end(); + } - // Define a class to describe regions of the tracker barrel that are dead. - class DeadBarrelRegion { - public: - DeadBarrelRegion(float phiMin, float phiMax, float zMin, float zMax) : - phiMin_(phiMin), phiMax_(phiMax), zMin_(zMin), zMax_(zMax) {} - public: - const float phiMin_; - const float phiMax_; - const float zMin_; - const float zMax_; - }; - - // Define a class to describe regions of the tracker endcap that are dead. - class DeadEndcapRegion { - public: - DeadEndcapRegion(float phiMin, float phiMax, float rMin, float rMax) : - phiMin_(phiMin), phiMax_(phiMax), rMin_(rMin), rMax_(rMax) {} public: - const float phiMin_; - const float phiMax_; - const float rMin_; - const float rMax_; + // Define a class to describe regions of the tracker barrel that are dead. + class DeadBarrelRegion { + public: + DeadBarrelRegion(float phiMin, float phiMax, float zMin, float zMax) + : phiMin_(phiMin), phiMax_(phiMax), zMin_(zMin), zMax_(zMax) {} + + public: + const float phiMin_; + const float phiMax_; + const float zMin_; + const float zMax_; + }; + + // Define a class to describe regions of the tracker endcap that are dead. + class DeadEndcapRegion { + public: + DeadEndcapRegion(float phiMin, float phiMax, float rMin, float rMax) + : phiMin_(phiMin), phiMax_(phiMax), rMin_(rMin), rMax_(rMax) {} + + public: + const float phiMin_; + const float phiMax_; + const float rMin_; + const float rMax_; + }; + + private: + // Return the difference in azimuth of two angles (phi1 - phi2) in the range 0 to 2*PI. + float deltaPhiPos(float phi1, float phi2) const { return (M_PI + reco::deltaPhi(phi1 - phi2 - M_PI, 0.)); } + + // Define regions of the tracker in which the modules are dead. + // This function is only relevant if cfg param DeadSimulate = True, when any stubs in modules within these regions are killed, + // so emulating MC with dead regions. + void defineDeadTrackerRegions(); + + // Define sectors in which the cut on number of layer numbers on tracks should be reduced by 1, because + // they contain dead modules. This function is only relevant if cfg param DeadReduceLayers = True. + // Ideally these sectors would be derived from the regions declared in definedDeadTrackerRegions(). + void defineDeadSectors(); + + private: + // Regions of the tracker barrel & endcap which are dead. + map > deadBarrelRegions_; + map > deadEndcapRegions_; + + // Sectors in which layer cut should be reduced. + set > reduceLayerCut_; }; -private: - - // Return the difference in azimuth of two angles (phi1 - phi2) in the range 0 to 2*PI. - float deltaPhiPos(float phi1, float phi2) const {return (M_PI + reco::deltaPhi(phi1 - phi2 - M_PI, 0.) );} - - // Define regions of the tracker in which the modules are dead. - // This function is only relevant if cfg param DeadSimulate = True, when any stubs in modules within these regions are killed, - // so emulating MC with dead regions. - void defineDeadTrackerRegions(); - - // Define sectors in which the cut on number of layer numbers on tracks should be reduced by 1, because - // they contain dead modules. This function is only relevant if cfg param DeadReduceLayers = True. - // Ideally these sectors would be derived from the regions declared in definedDeadTrackerRegions(). - void defineDeadSectors(); - -private: - - // Regions of the tracker barrel & endcap which are dead. - map< unsigned int, vector > deadBarrelRegions_; - map< unsigned int, vector > deadEndcapRegions_; - - // Sectors in which layer cut should be reduced. - set< pair > reduceLayerCut_; - -}; - -} +} // namespace TMTT #endif - diff --git a/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h b/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h index 32eb7a20c0d67..4a50724ab12fa 100644 --- a/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h +++ b/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h @@ -11,9 +11,8 @@ using namespace std; namespace TMTT { -class DegradeBend { - - /* + class DegradeBend { + /* *------------------------------------------------------------------------------------------------------------------- * Implements reduced bits to encode stub bend information: 3 bits for PS, 4 bits for 2S, since the Tracker * doesn't have the bandwidth to output the unreduced data from the FE electronics. @@ -34,48 +33,60 @@ class DegradeBend { *------------------------------------------------------------------------------------------------------------------- */ -public: - - DegradeBend(const TrackerTopology* trackerTopo) : theTrackerTopo_(trackerTopo) {} - - DegradeBend() {} - - // Given the original bend, flag indicating if this is a PS or 2S module, & detector identifier, - // this return the degraded stub bend, a boolean indicatng if stub bend was outside the assumed window - // size programmed below, and an integer indicating how many values of the original bend - // were grouped together into this single value of the degraded bend. - // - // (Input argument windowFEnew specifies the stub window size that should be used for this stub instead - // of the window sizes specified in TTStubAlgorithmRegister_cfi.py , but it will ONLY replace the latter - // sizes if it windowFEnew is smaller. If you always want to use TTStubAlgorithmRegister_cfi.py, then - // set windowFEnew to a large number, such as 99999.). - void degrade(float bend, bool psModule, const DetId& stDetId, float windowFEnew, - float& degradedBend, bool& reject, unsigned int& numInGroup) const; - -private: - - // Does the actual work of degrading the bend. - void work(float bend, bool psModule, const DetId& stDetId, float windowFEnew, - float& degradedBend, bool& reject, unsigned int& numInGroup, unsigned int& windowHalfStrips) const; - - // Check for mistakes - void sanityChecks(bool psModule, const DetId& stDetId, float windowFEnew, float degradedBend, unsigned int numInGroup, unsigned int windowHalfStrips) const; - -private: - - const TrackerTopology* theTrackerTopo_; - - // Number of bits used to encoded bend output by FE electronics. - const unsigned int bitsPS_ = 3; - const unsigned int bits2S_ = 4; - - // Stub window sizes as encoded in L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h - static std::vector< double > barrelCut_; - static std::vector< std::vector< double > > ringCut_; - static std::vector< std::vector< double > > tiltedCut_; - static std::vector< double > barrelNTilt_; -}; - -} + public: + DegradeBend(const TrackerTopology* trackerTopo) : theTrackerTopo_(trackerTopo) {} + + DegradeBend() {} + + // Given the original bend, flag indicating if this is a PS or 2S module, & detector identifier, + // this return the degraded stub bend, a boolean indicatng if stub bend was outside the assumed window + // size programmed below, and an integer indicating how many values of the original bend + // were grouped together into this single value of the degraded bend. + // + // (Input argument windowFEnew specifies the stub window size that should be used for this stub instead + // of the window sizes specified in TTStubAlgorithmRegister_cfi.py , but it will ONLY replace the latter + // sizes if it windowFEnew is smaller. If you always want to use TTStubAlgorithmRegister_cfi.py, then + // set windowFEnew to a large number, such as 99999.). + void degrade(float bend, + bool psModule, + const DetId& stDetId, + float windowFEnew, + float& degradedBend, + bool& reject, + unsigned int& numInGroup) const; + + private: + // Does the actual work of degrading the bend. + void work(float bend, + bool psModule, + const DetId& stDetId, + float windowFEnew, + float& degradedBend, + bool& reject, + unsigned int& numInGroup, + unsigned int& windowHalfStrips) const; + + // Check for mistakes + void sanityChecks(bool psModule, + const DetId& stDetId, + float windowFEnew, + float degradedBend, + unsigned int numInGroup, + unsigned int windowHalfStrips) const; + + private: + const TrackerTopology* theTrackerTopo_; + + // Number of bits used to encoded bend output by FE electronics. + const unsigned int bitsPS_ = 3; + const unsigned int bits2S_ = 4; + + // Stub window sizes as encoded in L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h + static std::vector barrelCut_; + static std::vector > ringCut_; + static std::vector > tiltedCut_; + static std::vector barrelNTilt_; + }; + +} // namespace TMTT #endif - diff --git a/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h b/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h index 10b9887a4bfbf..2dbc68ec1e314 100644 --- a/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h +++ b/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h @@ -7,7 +7,7 @@ using namespace std; //=== Used to digitize stubs both for input to GP and for input to HT. -//=== N.B. After constructing an object of type DigitalStub, you must call functions +//=== N.B. After constructing an object of type DigitalStub, you must call functions //=== init() and make() before you try using any of the other functions to access digitized stub info. //=== WARNING: Not all variables available in the GP are available inside the HT or visa-versa, @@ -15,221 +15,333 @@ using namespace std; namespace TMTT { -class Settings; - -class DigitalStub { - -public: - - // Digitization for KF in Hybrid tracking - - DigitalStub(const Settings* settings, double r, double phi, double z, unsigned int iPhiSec); - - // Note configuration parameters (for TMTT tracking) - DigitalStub(const Settings* settings); - - ~DigitalStub(){} - - // Initialize stub with original, floating point stub coords, - // range of m bin (= q/Pt bin) values allowed by bend filter, - // normal & "reduced" tracker layer of stub, stub bend, and pitch & seperation of module, - // and half-length of strip or pixel in r and in z, and if it's in barrel, tilted barrel and/or PS modules. - void init(float phi_orig, float r_orig, float z_orig, - unsigned int min_qOverPt_bin_orig, unsigned int max_qOverPt_bin_orig, - unsigned int layerID, unsigned int layerIDreduced, float bend_orig, - float pitch, float sep, float rErr, float zErr, bool barrel, bool tiltedBarrel, bool psModule); - - // Digitize stub for input to Geographic Processor, with stub phi coord. measured relative to phi nonant that contains specified phi sector. - void makeGPinput(unsigned int iPhiSec); - - // Digitize stub for input to Hough transform, with stub phi coord. measured relative to specified phi sector. - // (Also still allows digital data for input to GP to be accessed). - void makeHTinput(unsigned int iPhiSec); - - // Digitize stub for input to r-z Seed Filter or Track Fitter. - // Argument is "SeedFilter" or name of Track Fitter. - void makeSForTFinput(string SForTF); - - void makeDRinput(unsigned int stubId); - - // N.B. The m_min and m_max variables should logically be calculated by DigitalStub::makeHTinput(), - // but are actually calculated by Stub::digitizeForHTinput() because too lazy to move code. - - //--- The functions below return variables post-digitization. - //--- Do not call any of the functions below, unless you have already called init() and make()! - - // Digits corresponding to stub coords. - // %%% Those common to GP & HT input. - int iDigi_Rt() const {this->okGP(); return iDigi_Rt_;} // r coord. relative to chosen radius - unsigned int iDigi_R() const {this->okSForTF(); return iDigi_R_;} // r coord. - int iDigi_Z() const {this->okGP(); return iDigi_Z_;} // z coord. - int iDigi_Z_KF() const {this->okSForTF(); return iDigi_Z_KF_;} // z coord for internal KF use - // %%% Those exclusively input to HT. - unsigned int iDigi_PhiSec() const {this->okHT(); return iDigi_PhiSec_;} // phi sector number - int iDigi_PhiS() const {this->okHT(); return iDigi_PhiS_;} // phi coord. relative to sector - // %%% Those exclusively input to GP. - unsigned int moduleType() const {this->okin(); return moduleType_;} // module type ID (gives pitch/spacing) - unsigned int iDigi_Nonant() const {this->okGP(); return iDigi_Nonant_;} // phi nonant number - int iDigi_PhiO() const {this->okGP(); return iDigi_PhiO_;} // phi coord. relative to nonant - int iDigi_Bend() const {this->okGP(); return iDigi_Bend_;} // stub bend - // %%% Those exclusively input to seed filter. - unsigned int iDigi_rErr() const {this->okSForTF(); return iDigi_rErr_;} // Stub uncertainty in r, assumed equal to half strip length. - unsigned int iDigi_zErr() const {this->okSForTF(); return iDigi_zErr_;} // Stub uncertainty in z, assumed equal to half strip length. - - // Floating point stub coords derived from digitized info (so with degraded resolution). - // %%% Those common to GP & HT input. - float phi() const {this->okGP(); return phi_;} - float r() const {this->okGP(); return r_;} - float z() const {this->okGP(); return z_;} - float rt() const {this->okGP(); return rt_;} - // %%% Those exclusively input to HT. - float phiS() const {this->okHT(); return phiS_;} - // Integer data after digitization (which doesn't degrade its resolution, but can recast it in a different form). - // m bin range (= q/Pt bin range) allowed by bend filter - // Note this range is centred on zero, so differs from Stub::min_qOverPt_bin() etc. which return a +ve number. - int m_min() const {this->okHT(); return m_min_; } - int m_max() const {this->okHT(); return m_max_; } - // Tracker layer identifier encoded as it will be sent along optical link. - // Note that this differs from the encoding returned by Stub::layerIdReduced()! - unsigned int iDigi_LayerID() const {this->okHT(); return iDigi_LayerID_;} - // %%% Those exclusively input to GP. - float phiO() const {this->okGP(); return phiO_;} - float bend() const {this->okGP(); return bend_;} - // %%% Those exclusively input to seed filter. - float rErr() const {this->okSForTF(); return rErr_;} - float zErr() const {this->okSForTF(); return zErr_;} - - //--- The functions below give access to the original variables prior to digitization. - //%%% Those common to GP & HT input. - float orig_phi() const {this->okin(); return phi_orig_;} - float orig_r() const {this->okin(); return r_orig_;} - float orig_z() const {this->okin(); return z_orig_;} - //%%% Those exclusively input to GP. - float orig_bend() const {this->okin(); return bend_orig_;} - // %%% Those exclusively input to seed filter. - float orig_rErr() const {this->okin(); return rErr_orig_;} - float orig_zErr() const {this->okin(); return zErr_orig_;} - - //--- Utility: return phi nonant number corresponding to given phi sector number. - unsigned int iGetNonant(unsigned int iPhiSec) const {return floor(iPhiSec*numPhiNonants_/numPhiSectors_);} - - unsigned int StubId() const {this->okDR(); return stubId_;} - - -private: - - // Redigitize stub for input to Geographic Processor, if it was previously digitized for a different phi sector. - void quickMakeGPinput(int iPhiSec); - - // Redigitize stub for input to Hough transform, if it was previously digitized for a different phi sector. - void quickMakeHTinput(int iPhiSec); - - // Check that stub coords. & bend angle are within assumed digitization range. - void checkInRange() const; - - // Check that digitisation followed by undigitisation doesn't change significantly the stub coordinates. - void checkAccuracy() const; - - // Check that makeGPinput() or makeHTinput() are called before accessing digitized stub info. - void okGP() const {if (! ranMakeGPinput_) throw cms::Exception("DigitalStub: You forgot to call makeGPinput() or makeHTinput()!");} - void okHT() const {if (! ranMakeHTinput_) throw cms::Exception("DigitalStub: You forgot to call makeGPinput() or makeHTinput()!");} - void okSForTF() const {if (ranMakeSForTFinput_ == "") throw cms::Exception("DigitalStub: You forgot to call makeSForTFinput()!");} - void okDR() const {if (! ranMakeDRinput_) throw cms::Exception("DigitalStub: You forgot to call makeDRinput()!");} - - - // Check that init() is called before accessing original pre-digitization variables. - void okin() const {if (! ranInit_) throw cms::Exception("DigitalStub: You forgot to call init()!");} - -private: - - //--- To check DigitialStub correctly initialized. - bool ranInit_; - bool ranMakeGPinput_; - bool ranMakeHTinput_; - string ranMakeSForTFinput_; - bool ranMakeDRinput_; - //--- configuration - - // Digitization configuration - int iFirmwareType_; - unsigned int phiSectorBits_; - unsigned int phiSBits_; - float phiSRange_; - unsigned int rtBits_; - float rtRange_; - unsigned int zBits_; - float zRange_; - unsigned int phiOBits_; - double phiORange_; - unsigned int bendBits_; - float bendRange_; - - // Digitization multipliers - float phiSMult_; - float rtMult_; - float zMult_; - double phiOMult_; - float bendMult_; - - // Are we using reduced layer ID, so layer can be packed into 3 bits? - bool reduceLayerID_; - - // Number of phi sectors and phi nonants. - unsigned int numPhiSectors_; - unsigned int numPhiNonants_; - // Phi sector and phi nonant width (radians) - double phiSectorWidth_; - double phiNonantWidth_; - // Radius from beamline with respect to which stub r coord. is measured. - float chosenRofPhi_; - - // Number of q/Pt bins in Hough transform array. - unsigned int nbinsPt_; - - //--- Original floating point stub coords before digitization. - float phi_orig_; - float r_orig_; - float z_orig_; - float rt_orig_; - double phiS_orig_; - double phiO_orig_; - unsigned int layerID_; // Tracker layer ID - unsigned int layerIDreduced_; // Tracker "reduced" layer ID - unsigned int min_qOverPt_bin_orig_; // Range in q/Pt bins in HT array compatible with stub bend. (+ve definate) - unsigned int max_qOverPt_bin_orig_; - float bend_orig_; - float rErr_orig_; - float zErr_orig_; - - //--- Digits corresponding to stub coords. - unsigned int iDigi_PhiSec_; - int iDigi_PhiS_; - int iDigi_Rt_; - unsigned int iDigi_R_; - int iDigi_Z_; - int iDigi_Z_KF_; - unsigned int iDigi_LayerID_; // Encoded tracker layer - int m_min_; // Range in q/Pt bins in HT array compatible with stub bend. (range centred on zero) - int m_max_; - unsigned int moduleType_; - unsigned int iDigi_Nonant_; - int iDigi_PhiO_; - int iDigi_Bend_; - unsigned int iDigi_rErr_; - unsigned int iDigi_zErr_; - unsigned int stubId_; - //--- Floating point stub coords derived from digitized info (so with degraded resolution). - float phi_; - float r_; - float z_; - float phiS_; - float rt_; - float phiO_; - float bend_; - float rErr_; - float zErr_; -}; - -} + class Settings; + + class DigitalStub { + public: + // Digitization for KF in Hybrid tracking + + DigitalStub(const Settings* settings, double r, double phi, double z, unsigned int iPhiSec); + + // Note configuration parameters (for TMTT tracking) + DigitalStub(const Settings* settings); + + ~DigitalStub() {} + + // Initialize stub with original, floating point stub coords, + // range of m bin (= q/Pt bin) values allowed by bend filter, + // normal & "reduced" tracker layer of stub, stub bend, and pitch & seperation of module, + // and half-length of strip or pixel in r and in z, and if it's in barrel, tilted barrel and/or PS modules. + void init(float phi_orig, + float r_orig, + float z_orig, + unsigned int min_qOverPt_bin_orig, + unsigned int max_qOverPt_bin_orig, + unsigned int layerID, + unsigned int layerIDreduced, + float bend_orig, + float pitch, + float sep, + float rErr, + float zErr, + bool barrel, + bool tiltedBarrel, + bool psModule); + + // Digitize stub for input to Geographic Processor, with stub phi coord. measured relative to phi nonant that contains specified phi sector. + void makeGPinput(unsigned int iPhiSec); + + // Digitize stub for input to Hough transform, with stub phi coord. measured relative to specified phi sector. + // (Also still allows digital data for input to GP to be accessed). + void makeHTinput(unsigned int iPhiSec); + + // Digitize stub for input to r-z Seed Filter or Track Fitter. + // Argument is "SeedFilter" or name of Track Fitter. + void makeSForTFinput(string SForTF); + + void makeDRinput(unsigned int stubId); + + // N.B. The m_min and m_max variables should logically be calculated by DigitalStub::makeHTinput(), + // but are actually calculated by Stub::digitizeForHTinput() because too lazy to move code. + + //--- The functions below return variables post-digitization. + //--- Do not call any of the functions below, unless you have already called init() and make()! + + // Digits corresponding to stub coords. + // %%% Those common to GP & HT input. + int iDigi_Rt() const { + this->okGP(); + return iDigi_Rt_; + } // r coord. relative to chosen radius + unsigned int iDigi_R() const { + this->okSForTF(); + return iDigi_R_; + } // r coord. + int iDigi_Z() const { + this->okGP(); + return iDigi_Z_; + } // z coord. + int iDigi_Z_KF() const { + this->okSForTF(); + return iDigi_Z_KF_; + } // z coord for internal KF use + // %%% Those exclusively input to HT. + unsigned int iDigi_PhiSec() const { + this->okHT(); + return iDigi_PhiSec_; + } // phi sector number + int iDigi_PhiS() const { + this->okHT(); + return iDigi_PhiS_; + } // phi coord. relative to sector + // %%% Those exclusively input to GP. + unsigned int moduleType() const { + this->okin(); + return moduleType_; + } // module type ID (gives pitch/spacing) + unsigned int iDigi_Nonant() const { + this->okGP(); + return iDigi_Nonant_; + } // phi nonant number + int iDigi_PhiO() const { + this->okGP(); + return iDigi_PhiO_; + } // phi coord. relative to nonant + int iDigi_Bend() const { + this->okGP(); + return iDigi_Bend_; + } // stub bend + // %%% Those exclusively input to seed filter. + unsigned int iDigi_rErr() const { + this->okSForTF(); + return iDigi_rErr_; + } // Stub uncertainty in r, assumed equal to half strip length. + unsigned int iDigi_zErr() const { + this->okSForTF(); + return iDigi_zErr_; + } // Stub uncertainty in z, assumed equal to half strip length. + + // Floating point stub coords derived from digitized info (so with degraded resolution). + // %%% Those common to GP & HT input. + float phi() const { + this->okGP(); + return phi_; + } + float r() const { + this->okGP(); + return r_; + } + float z() const { + this->okGP(); + return z_; + } + float rt() const { + this->okGP(); + return rt_; + } + // %%% Those exclusively input to HT. + float phiS() const { + this->okHT(); + return phiS_; + } + // Integer data after digitization (which doesn't degrade its resolution, but can recast it in a different form). + // m bin range (= q/Pt bin range) allowed by bend filter + // Note this range is centred on zero, so differs from Stub::min_qOverPt_bin() etc. which return a +ve number. + int m_min() const { + this->okHT(); + return m_min_; + } + int m_max() const { + this->okHT(); + return m_max_; + } + // Tracker layer identifier encoded as it will be sent along optical link. + // Note that this differs from the encoding returned by Stub::layerIdReduced()! + unsigned int iDigi_LayerID() const { + this->okHT(); + return iDigi_LayerID_; + } + // %%% Those exclusively input to GP. + float phiO() const { + this->okGP(); + return phiO_; + } + float bend() const { + this->okGP(); + return bend_; + } + // %%% Those exclusively input to seed filter. + float rErr() const { + this->okSForTF(); + return rErr_; + } + float zErr() const { + this->okSForTF(); + return zErr_; + } + + //--- The functions below give access to the original variables prior to digitization. + //%%% Those common to GP & HT input. + float orig_phi() const { + this->okin(); + return phi_orig_; + } + float orig_r() const { + this->okin(); + return r_orig_; + } + float orig_z() const { + this->okin(); + return z_orig_; + } + //%%% Those exclusively input to GP. + float orig_bend() const { + this->okin(); + return bend_orig_; + } + // %%% Those exclusively input to seed filter. + float orig_rErr() const { + this->okin(); + return rErr_orig_; + } + float orig_zErr() const { + this->okin(); + return zErr_orig_; + } + + //--- Utility: return phi nonant number corresponding to given phi sector number. + unsigned int iGetNonant(unsigned int iPhiSec) const { return floor(iPhiSec * numPhiNonants_ / numPhiSectors_); } + + unsigned int StubId() const { + this->okDR(); + return stubId_; + } + + private: + // Redigitize stub for input to Geographic Processor, if it was previously digitized for a different phi sector. + void quickMakeGPinput(int iPhiSec); + + // Redigitize stub for input to Hough transform, if it was previously digitized for a different phi sector. + void quickMakeHTinput(int iPhiSec); + + // Check that stub coords. & bend angle are within assumed digitization range. + void checkInRange() const; + + // Check that digitisation followed by undigitisation doesn't change significantly the stub coordinates. + void checkAccuracy() const; + + // Check that makeGPinput() or makeHTinput() are called before accessing digitized stub info. + void okGP() const { + if (!ranMakeGPinput_) + throw cms::Exception("DigitalStub: You forgot to call makeGPinput() or makeHTinput()!"); + } + void okHT() const { + if (!ranMakeHTinput_) + throw cms::Exception("DigitalStub: You forgot to call makeGPinput() or makeHTinput()!"); + } + void okSForTF() const { + if (ranMakeSForTFinput_ == "") + throw cms::Exception("DigitalStub: You forgot to call makeSForTFinput()!"); + } + void okDR() const { + if (!ranMakeDRinput_) + throw cms::Exception("DigitalStub: You forgot to call makeDRinput()!"); + } + + // Check that init() is called before accessing original pre-digitization variables. + void okin() const { + if (!ranInit_) + throw cms::Exception("DigitalStub: You forgot to call init()!"); + } + + private: + //--- To check DigitialStub correctly initialized. + bool ranInit_; + bool ranMakeGPinput_; + bool ranMakeHTinput_; + string ranMakeSForTFinput_; + bool ranMakeDRinput_; + //--- configuration + + // Digitization configuration + int iFirmwareType_; + unsigned int phiSectorBits_; + unsigned int phiSBits_; + float phiSRange_; + unsigned int rtBits_; + float rtRange_; + unsigned int zBits_; + float zRange_; + unsigned int phiOBits_; + double phiORange_; + unsigned int bendBits_; + float bendRange_; + + // Digitization multipliers + float phiSMult_; + float rtMult_; + float zMult_; + double phiOMult_; + float bendMult_; + + // Are we using reduced layer ID, so layer can be packed into 3 bits? + bool reduceLayerID_; + + // Number of phi sectors and phi nonants. + unsigned int numPhiSectors_; + unsigned int numPhiNonants_; + // Phi sector and phi nonant width (radians) + double phiSectorWidth_; + double phiNonantWidth_; + // Radius from beamline with respect to which stub r coord. is measured. + float chosenRofPhi_; + + // Number of q/Pt bins in Hough transform array. + unsigned int nbinsPt_; + + //--- Original floating point stub coords before digitization. + float phi_orig_; + float r_orig_; + float z_orig_; + float rt_orig_; + double phiS_orig_; + double phiO_orig_; + unsigned int layerID_; // Tracker layer ID + unsigned int layerIDreduced_; // Tracker "reduced" layer ID + unsigned int min_qOverPt_bin_orig_; // Range in q/Pt bins in HT array compatible with stub bend. (+ve definate) + unsigned int max_qOverPt_bin_orig_; + float bend_orig_; + float rErr_orig_; + float zErr_orig_; + + //--- Digits corresponding to stub coords. + unsigned int iDigi_PhiSec_; + int iDigi_PhiS_; + int iDigi_Rt_; + unsigned int iDigi_R_; + int iDigi_Z_; + int iDigi_Z_KF_; + unsigned int iDigi_LayerID_; // Encoded tracker layer + int m_min_; // Range in q/Pt bins in HT array compatible with stub bend. (range centred on zero) + int m_max_; + unsigned int moduleType_; + unsigned int iDigi_Nonant_; + int iDigi_PhiO_; + int iDigi_Bend_; + unsigned int iDigi_rErr_; + unsigned int iDigi_zErr_; + unsigned int stubId_; + //--- Floating point stub coords derived from digitized info (so with degraded resolution). + float phi_; + float r_; + float z_; + float phiS_; + float rt_; + float phiO_; + float bend_; + float rErr_; + float zErr_; + }; + +} // namespace TMTT #endif - diff --git a/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h b/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h index bd9f6eb7f99b5..8af1db68041d2 100644 --- a/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h +++ b/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h @@ -10,251 +10,436 @@ using namespace std; namespace TMTT { -class Settings; + class Settings; -//==================================================================================================== -/** + //==================================================================================================== + /** * Used to digitize the fitted track helix params. * WARNING: Digitizes according to common format agreed for KF and SimpleLR fitters, * and uses KF digitisation cfg for all fitters except SimpleLR. */ -//==================================================================================================== - -class DigitalTrack { - -public: - - // Note configuration parameters. - DigitalTrack(const Settings* settings); - // Dummy constructor - DigitalTrack() {} - // DigitalTrack(); - - ~DigitalTrack(){} - - /// Initialize track with original, floating point coords - void init(const string& fitterName, unsigned int nHelixParams, - unsigned int iPhiSec, unsigned int iEtaReg, int mbin, int cbin, int mBinhelix, int cBinhelix, - unsigned int hitPattern, - float qOverPt_orig, float d0_orig, float phi0_orig, float tanLambda_orig, float z0_orig, float chisquaredRphi_orig, float chisquaredRz_orig, - float qOverPt_bcon_orig, float phi0_bcon_orig, float chisquaredRphi_bcon_orig, // beam-spot constrained values. - unsigned int nLayers, bool consistent, bool consistentSect, bool accepted, - float tp_qOverPt, float tp_d0, float tp_phi0, float tp_tanLambda, float tp_z0, float tp_eta, - int tp_index, bool tp_useForAlgEff, bool tp_useForEff, int tp_pdgId); - - // Digitize track - void makeDigitalTrack(); - - //--- The functions below return variables post-digitization. - //--- Do not call any of the functions below, unless you have already called init() and make()! - - // Digits corresponding to track params. - int iDigi_oneOver2r() const {this->ok(); return iDigi_oneOver2r_;} // half inverse curvature of track. - int iDigi_d0() const {this->ok(); return iDigi_d0_;} - int iDigi_phi0rel() const {this->ok(); return iDigi_phi0rel_;} // measured relative to centre of sector - int iDigi_z0() const {this->ok(); return iDigi_z0_;} - int iDigi_tanLambda() const {this->ok(); return iDigi_tanLambda_;} - unsigned int iDigi_chisquaredRphi() const {this->ok(); return iDigi_chisquaredRphi_;} - unsigned int iDigi_chisquaredRz() const {this->ok(); return iDigi_chisquaredRz_;} - - // Digits corresponding to track params with post-fit beam-spot constraint. - int iDigi_oneOver2r_bcon() const {this->ok(); return iDigi_oneOver2r_bcon_;} // half inverse curvature of track. - int iDigi_phi0rel_bcon() const {this->ok(); return iDigi_phi0rel_bcon_;} // measured relative to centre of sector - unsigned int iDigi_chisquaredRphi_bcon() const {this->ok(); return iDigi_chisquaredRphi_bcon_;} - - // Floating point track params derived from digitized info (so with degraded resolution). - float qOverPt() const {this->ok(); return qOverPt_;} - float oneOver2r() const {this->ok(); return oneOver2r_;} // half inverse curvature of track. - float d0() const {this->ok(); return d0_;} - float phi0() const {this->ok(); return phi0_;} - float phi0rel() const {this->ok(); return phi0rel_;} // measured relative to centre of sector - float z0() const {this->ok(); return z0_;} - float tanLambda() const {this->ok(); return tanLambda_;} - float chisquaredRphi() const {this->ok(); return chisquaredRphi_;} - float chisquaredRz() const {this->ok(); return chisquaredRz_;} - - // Floating point track params derived from digitized track params with post-fit beam-spot constraint. - float qOverPt_bcon() const {this->ok(); return qOverPt_bcon_;} - float oneOver2r_bcon() const {this->ok(); return oneOver2r_bcon_;} // half inverse curvature of track. - float phi0_bcon() const {this->ok(); return phi0_bcon_;} - float phi0rel_bcon() const {this->ok(); return phi0rel_bcon_;} // measured relative to centre of sector - float chisquaredRphi_bcon() const {this->ok(); return chisquaredRphi_bcon_;} - - unsigned int iPhiSec() const {this->okin(); return iPhiSec_;} - unsigned int iEtaReg() const {this->okin(); return iEtaReg_;} - int mBinhelix() const {this->okin(); return mBinhelix_;} - int cBinhelix() const {this->okin(); return cBinhelix_;} - unsigned int nlayers() const {this->okin(); return nlayers_;} - int mBinHT() const {this->okin(); return mBin_;} - int cBinHT() const {this->okin(); return cBin_;} - bool accepted() const {this->okin(); return accepted_;} - unsigned int hitPattern() const {this->okin(); return hitPattern_;} - - //--- The functions below give access to the original variables prior to digitization. - //%%% Those common to GP & HT input. - float orig_qOverPt() const {this->okin(); return qOverPt_orig_;} - float orig_oneOver2r() const {this->okin(); return oneOver2r_orig_;} // half inverse curvature of track. - float orig_d0() const {this->okin(); return d0_orig_;} - float orig_phi0() const {this->okin(); return phi0_orig_;} - float orig_phi0rel() const {this->okin(); return phi0rel_orig_;} // measured relative to centre of sector - float orig_z0() const {this->okin(); return z0_orig_;} - float orig_tanLambda() const {this->okin(); return tanLambda_orig_;} - float orig_chisquaredRphi() const {this->okin(); return chisquaredRphi_orig_;} - float orig_chisquaredRz() const {this->okin(); return chisquaredRz_orig_;} - - float tp_pt() const {this->okin(); return tp_pt_;} - float tp_eta() const {this->okin(); return tp_eta_;} - float tp_d0() const {this->okin(); return tp_d0_;} - float tp_phi0() const {this->okin(); return tp_phi0_;} - float tp_tanLambda() const {this->okin(); return tp_tanLambda_;} - float tp_z0() const {this->okin(); return tp_z0_;} - float tp_qoverpt() const {this->okin(); return tp_qoverpt_;} - int tp_index() const {this->okin(); return tp_index_;} - float tp_useForAlgEff() const {this->okin(); return tp_useForAlgEff_;} - float tp_useForEff() const {this->okin(); return tp_useForEff_;} - float tp_pdgId() const {this->okin(); return tp_pdgId_;} - - //--- Utility: return phi nonant number corresponding to given phi sector number. - unsigned int iGetNonant(unsigned int iPhiSec) const {return floor(iPhiSec*numPhiNonants_/numPhiSectors_);} - - bool available() const {return ranMake_;} - -private: - - // Check DigitalTrack correctly initialized; - void okin() const {if (! ranInit_) throw cms::Exception("DigitalTrack: You forgot to call init()!");} - void ok() const {if (! ranMake_) throw cms::Exception("DigitalTrack: You forgot to call makeDigitalTrack()!");} - - // Get digitisation configuration parameters for the specific track fitter being used here. - void getDigiCfg(const string& fitterName); - - // Check that stub coords. are within assumed digitization range. - void checkInRange() const; - - // Check that digitisation followed by undigitisation doesn't change significantly the track params. - void checkAccuracy() const; - -private: - - // Check DigitalTrack correctly initialized. - bool ranInit_; - bool ranMake_; - - // Configuration params - const Settings* settings_; - - string fitterName_; - unsigned int nHelixParams_; - - // Integer data after digitization (which doesn't degrade its resolution, but can recast it in a different form). - unsigned int nlayers_; - unsigned int iPhiSec_; - unsigned int iEtaReg_; - int mBinhelix_; - int cBinhelix_; - bool consistent_; - bool consistentSect_; - int mBin_; - int cBin_; - bool accepted_; - - float tp_qoverpt_; - float tp_pt_; - float tp_eta_; - float tp_d0_; - float tp_phi0_; - float tp_tanLambda_; - float tp_z0_; - int tp_index_; - bool tp_useForAlgEff_; - bool tp_useForEff_; - int tp_pdgId_; - - // Digitization configuration - bool skipTrackDigi_; - unsigned int oneOver2rBits_; - float oneOver2rRange_; - unsigned int d0Bits_; - float d0Range_; - unsigned int phi0Bits_; - float phi0Range_; - unsigned int z0Bits_; - float z0Range_; - unsigned int tanLambdaBits_; - float tanLambdaRange_; - unsigned int chisquaredBits_; - float chisquaredRange_; - - double oneOver2rMult_; - double d0Mult_; - double phi0Mult_; - double z0Mult_; - double tanLambdaMult_; - double chisquaredMult_; - - // Number of phi sectors and phi nonants. - unsigned int numPhiSectors_; - unsigned int numPhiNonants_; - double phiSectorWidth_; - double phiNonantWidth_; - double phiSectorCentre_; - float chosenRofPhi_; - unsigned int nbinsPt_; - float invPtToDPhi_; - - //--- Original floating point stub coords before digitization. - - unsigned int hitPattern_; - - float qOverPt_orig_; - float oneOver2r_orig_; - float d0_orig_; - float phi0_orig_; - float phi0rel_orig_; - float tanLambda_orig_; - float z0_orig_; - float chisquaredRphi_orig_; - float chisquaredRz_orig_; - - float qOverPt_bcon_orig_; - float oneOver2r_bcon_orig_; - float phi0_bcon_orig_; - float phi0rel_bcon_orig_; - float chisquaredRphi_bcon_orig_; - - //--- Digits corresponding to track params. - - int iDigi_oneOver2r_; - int iDigi_d0_; - int iDigi_phi0rel_; - int iDigi_z0_; - int iDigi_tanLambda_; - unsigned int iDigi_chisquaredRphi_; - unsigned int iDigi_chisquaredRz_; - - int iDigi_oneOver2r_bcon_; - int iDigi_phi0rel_bcon_; - unsigned int iDigi_chisquaredRphi_bcon_; - - //--- Floating point track coords derived from digitized info (so with degraded resolution). - - float qOverPt_; - float oneOver2r_; - float d0_; - float phi0_; - float phi0rel_; - float z0_; - float tanLambda_; - float chisquaredRphi_; - float chisquaredRz_; - - float qOverPt_bcon_; - float oneOver2r_bcon_; - float phi0_bcon_; - float phi0rel_bcon_; - float chisquaredRphi_bcon_; -}; - -} + //==================================================================================================== + + class DigitalTrack { + public: + // Note configuration parameters. + DigitalTrack(const Settings* settings); + // Dummy constructor + DigitalTrack() {} + // DigitalTrack(); + + ~DigitalTrack() {} + + /// Initialize track with original, floating point coords + void init(const string& fitterName, + unsigned int nHelixParams, + unsigned int iPhiSec, + unsigned int iEtaReg, + int mbin, + int cbin, + int mBinhelix, + int cBinhelix, + unsigned int hitPattern, + float qOverPt_orig, + float d0_orig, + float phi0_orig, + float tanLambda_orig, + float z0_orig, + float chisquaredRphi_orig, + float chisquaredRz_orig, + float qOverPt_bcon_orig, + float phi0_bcon_orig, + float chisquaredRphi_bcon_orig, // beam-spot constrained values. + unsigned int nLayers, + bool consistent, + bool consistentSect, + bool accepted, + float tp_qOverPt, + float tp_d0, + float tp_phi0, + float tp_tanLambda, + float tp_z0, + float tp_eta, + int tp_index, + bool tp_useForAlgEff, + bool tp_useForEff, + int tp_pdgId); + + // Digitize track + void makeDigitalTrack(); + + //--- The functions below return variables post-digitization. + //--- Do not call any of the functions below, unless you have already called init() and make()! + + // Digits corresponding to track params. + int iDigi_oneOver2r() const { + this->ok(); + return iDigi_oneOver2r_; + } // half inverse curvature of track. + int iDigi_d0() const { + this->ok(); + return iDigi_d0_; + } + int iDigi_phi0rel() const { + this->ok(); + return iDigi_phi0rel_; + } // measured relative to centre of sector + int iDigi_z0() const { + this->ok(); + return iDigi_z0_; + } + int iDigi_tanLambda() const { + this->ok(); + return iDigi_tanLambda_; + } + unsigned int iDigi_chisquaredRphi() const { + this->ok(); + return iDigi_chisquaredRphi_; + } + unsigned int iDigi_chisquaredRz() const { + this->ok(); + return iDigi_chisquaredRz_; + } + + // Digits corresponding to track params with post-fit beam-spot constraint. + int iDigi_oneOver2r_bcon() const { + this->ok(); + return iDigi_oneOver2r_bcon_; + } // half inverse curvature of track. + int iDigi_phi0rel_bcon() const { + this->ok(); + return iDigi_phi0rel_bcon_; + } // measured relative to centre of sector + unsigned int iDigi_chisquaredRphi_bcon() const { + this->ok(); + return iDigi_chisquaredRphi_bcon_; + } + + // Floating point track params derived from digitized info (so with degraded resolution). + float qOverPt() const { + this->ok(); + return qOverPt_; + } + float oneOver2r() const { + this->ok(); + return oneOver2r_; + } // half inverse curvature of track. + float d0() const { + this->ok(); + return d0_; + } + float phi0() const { + this->ok(); + return phi0_; + } + float phi0rel() const { + this->ok(); + return phi0rel_; + } // measured relative to centre of sector + float z0() const { + this->ok(); + return z0_; + } + float tanLambda() const { + this->ok(); + return tanLambda_; + } + float chisquaredRphi() const { + this->ok(); + return chisquaredRphi_; + } + float chisquaredRz() const { + this->ok(); + return chisquaredRz_; + } + + // Floating point track params derived from digitized track params with post-fit beam-spot constraint. + float qOverPt_bcon() const { + this->ok(); + return qOverPt_bcon_; + } + float oneOver2r_bcon() const { + this->ok(); + return oneOver2r_bcon_; + } // half inverse curvature of track. + float phi0_bcon() const { + this->ok(); + return phi0_bcon_; + } + float phi0rel_bcon() const { + this->ok(); + return phi0rel_bcon_; + } // measured relative to centre of sector + float chisquaredRphi_bcon() const { + this->ok(); + return chisquaredRphi_bcon_; + } + + unsigned int iPhiSec() const { + this->okin(); + return iPhiSec_; + } + unsigned int iEtaReg() const { + this->okin(); + return iEtaReg_; + } + int mBinhelix() const { + this->okin(); + return mBinhelix_; + } + int cBinhelix() const { + this->okin(); + return cBinhelix_; + } + unsigned int nlayers() const { + this->okin(); + return nlayers_; + } + int mBinHT() const { + this->okin(); + return mBin_; + } + int cBinHT() const { + this->okin(); + return cBin_; + } + bool accepted() const { + this->okin(); + return accepted_; + } + unsigned int hitPattern() const { + this->okin(); + return hitPattern_; + } + + //--- The functions below give access to the original variables prior to digitization. + //%%% Those common to GP & HT input. + float orig_qOverPt() const { + this->okin(); + return qOverPt_orig_; + } + float orig_oneOver2r() const { + this->okin(); + return oneOver2r_orig_; + } // half inverse curvature of track. + float orig_d0() const { + this->okin(); + return d0_orig_; + } + float orig_phi0() const { + this->okin(); + return phi0_orig_; + } + float orig_phi0rel() const { + this->okin(); + return phi0rel_orig_; + } // measured relative to centre of sector + float orig_z0() const { + this->okin(); + return z0_orig_; + } + float orig_tanLambda() const { + this->okin(); + return tanLambda_orig_; + } + float orig_chisquaredRphi() const { + this->okin(); + return chisquaredRphi_orig_; + } + float orig_chisquaredRz() const { + this->okin(); + return chisquaredRz_orig_; + } + + float tp_pt() const { + this->okin(); + return tp_pt_; + } + float tp_eta() const { + this->okin(); + return tp_eta_; + } + float tp_d0() const { + this->okin(); + return tp_d0_; + } + float tp_phi0() const { + this->okin(); + return tp_phi0_; + } + float tp_tanLambda() const { + this->okin(); + return tp_tanLambda_; + } + float tp_z0() const { + this->okin(); + return tp_z0_; + } + float tp_qoverpt() const { + this->okin(); + return tp_qoverpt_; + } + int tp_index() const { + this->okin(); + return tp_index_; + } + float tp_useForAlgEff() const { + this->okin(); + return tp_useForAlgEff_; + } + float tp_useForEff() const { + this->okin(); + return tp_useForEff_; + } + float tp_pdgId() const { + this->okin(); + return tp_pdgId_; + } + + //--- Utility: return phi nonant number corresponding to given phi sector number. + unsigned int iGetNonant(unsigned int iPhiSec) const { return floor(iPhiSec * numPhiNonants_ / numPhiSectors_); } + + bool available() const { return ranMake_; } + + private: + // Check DigitalTrack correctly initialized; + void okin() const { + if (!ranInit_) + throw cms::Exception("DigitalTrack: You forgot to call init()!"); + } + void ok() const { + if (!ranMake_) + throw cms::Exception("DigitalTrack: You forgot to call makeDigitalTrack()!"); + } + + // Get digitisation configuration parameters for the specific track fitter being used here. + void getDigiCfg(const string& fitterName); + + // Check that stub coords. are within assumed digitization range. + void checkInRange() const; + + // Check that digitisation followed by undigitisation doesn't change significantly the track params. + void checkAccuracy() const; + + private: + // Check DigitalTrack correctly initialized. + bool ranInit_; + bool ranMake_; + + // Configuration params + const Settings* settings_; + + string fitterName_; + unsigned int nHelixParams_; + + // Integer data after digitization (which doesn't degrade its resolution, but can recast it in a different form). + unsigned int nlayers_; + unsigned int iPhiSec_; + unsigned int iEtaReg_; + int mBinhelix_; + int cBinhelix_; + bool consistent_; + bool consistentSect_; + int mBin_; + int cBin_; + bool accepted_; + + float tp_qoverpt_; + float tp_pt_; + float tp_eta_; + float tp_d0_; + float tp_phi0_; + float tp_tanLambda_; + float tp_z0_; + int tp_index_; + bool tp_useForAlgEff_; + bool tp_useForEff_; + int tp_pdgId_; + + // Digitization configuration + bool skipTrackDigi_; + unsigned int oneOver2rBits_; + float oneOver2rRange_; + unsigned int d0Bits_; + float d0Range_; + unsigned int phi0Bits_; + float phi0Range_; + unsigned int z0Bits_; + float z0Range_; + unsigned int tanLambdaBits_; + float tanLambdaRange_; + unsigned int chisquaredBits_; + float chisquaredRange_; + + double oneOver2rMult_; + double d0Mult_; + double phi0Mult_; + double z0Mult_; + double tanLambdaMult_; + double chisquaredMult_; + + // Number of phi sectors and phi nonants. + unsigned int numPhiSectors_; + unsigned int numPhiNonants_; + double phiSectorWidth_; + double phiNonantWidth_; + double phiSectorCentre_; + float chosenRofPhi_; + unsigned int nbinsPt_; + float invPtToDPhi_; + + //--- Original floating point stub coords before digitization. + + unsigned int hitPattern_; + + float qOverPt_orig_; + float oneOver2r_orig_; + float d0_orig_; + float phi0_orig_; + float phi0rel_orig_; + float tanLambda_orig_; + float z0_orig_; + float chisquaredRphi_orig_; + float chisquaredRz_orig_; + + float qOverPt_bcon_orig_; + float oneOver2r_bcon_orig_; + float phi0_bcon_orig_; + float phi0rel_bcon_orig_; + float chisquaredRphi_bcon_orig_; + + //--- Digits corresponding to track params. + + int iDigi_oneOver2r_; + int iDigi_d0_; + int iDigi_phi0rel_; + int iDigi_z0_; + int iDigi_tanLambda_; + unsigned int iDigi_chisquaredRphi_; + unsigned int iDigi_chisquaredRz_; + + int iDigi_oneOver2r_bcon_; + int iDigi_phi0rel_bcon_; + unsigned int iDigi_chisquaredRphi_bcon_; + + //--- Floating point track coords derived from digitized info (so with degraded resolution). + + float qOverPt_; + float oneOver2r_; + float d0_; + float phi0_; + float phi0rel_; + float z0_; + float tanLambda_; + float chisquaredRphi_; + float chisquaredRz_; + + float qOverPt_bcon_; + float oneOver2r_bcon_; + float phi0_bcon_; + float phi0rel_bcon_; + float chisquaredRphi_bcon_; + }; + +} // namespace TMTT #endif - diff --git a/L1Trigger/TrackFindingTMTT/interface/Get3Dtracks.h b/L1Trigger/TrackFindingTMTT/interface/Get3Dtracks.h index 4c93e3965964c..dbf5d6f26c045 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Get3Dtracks.h +++ b/L1Trigger/TrackFindingTMTT/interface/Get3Dtracks.h @@ -8,7 +8,7 @@ #include #include -using boost::numeric::ublas::matrix; +using boost::numeric::ublas::matrix; using namespace std; @@ -16,89 +16,96 @@ using namespace std; //=== It can do this by simply estimating the r-z helix parameters from the centre of the eta sector //=== and/or by running an r-z filter (e.g. Seed Filter), which also cleans up the tracks by //=== checking their stubs consistency with a straight line in the r-z plane. -//=== +//=== //=== To create 3D tracks, call the sequence init(), run(), and then get tracks via trackCands3D(). namespace TMTT { -class Settings; -class Stub; -class TP; - -class Get3Dtracks { - -public: - - Get3Dtracks() : settings_(nullptr), iPhiSec_(0), iEtaReg_(0), etaMinSector_(0), etaMaxSector_(0), phiCentreSector_(0), runRZfilter_(false) {} - ~Get3Dtracks() {} - - //=== Main routines to make 3D tracks. - - // Initialization - void init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, - float etaMinSector, float etaMaxSector, float phiCentreSector); - - // Make 3D track collections. - void run(const vector& vecTracksRphi) { - this->makeUnfilteredTrks(vecTracksRphi); - if (runRZfilter_) this->makeRZfilteredTrks(vecTracksRphi); - } - - //=== Get 3D tracks. - - // Get 3D tracks (either r-z filtered or unfiltered, depending on the boolean). - // (Each L1track3D object gives access to stubs on each track and helix parameters - // & also to the associated truth tracking particle). - const vector& trackCands3D(bool rzFiltered) const { - if (rzFiltered) { - return vecTracks3D_rzFiltered_; - } else { - return vecTracks3D_unfiltered_; + class Settings; + class Stub; + class TP; + + class Get3Dtracks { + public: + Get3Dtracks() + : settings_(nullptr), + iPhiSec_(0), + iEtaReg_(0), + etaMinSector_(0), + etaMaxSector_(0), + phiCentreSector_(0), + runRZfilter_(false) {} + ~Get3Dtracks() {} + + //=== Main routines to make 3D tracks. + + // Initialization + void init(const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float etaMinSector, + float etaMaxSector, + float phiCentreSector); + + // Make 3D track collections. + void run(const vector& vecTracksRphi) { + this->makeUnfilteredTrks(vecTracksRphi); + if (runRZfilter_) + this->makeRZfilteredTrks(vecTracksRphi); } - } - - // Get all 3D track candidates (either r-z filtered on unfiltered, depending on the boolean), - // that are associated to the given tracking particle. - // (If the vector is empty, then the tracking particle was not reconstructed in this sector). - vector assocTrackCands3D(const TP& tp, bool rzFiltered) const; - //=== Access to track r-z filter in case internal info from it required. + //=== Get 3D tracks. + + // Get 3D tracks (either r-z filtered or unfiltered, depending on the boolean). + // (Each L1track3D object gives access to stubs on each track and helix parameters + // & also to the associated truth tracking particle). + const vector& trackCands3D(bool rzFiltered) const { + if (rzFiltered) { + return vecTracks3D_rzFiltered_; + } else { + return vecTracks3D_unfiltered_; + } + } - bool ranRZfilter() const {return runRZfilter_;} // Was r-z filter required/run? + // Get all 3D track candidates (either r-z filtered on unfiltered, depending on the boolean), + // that are associated to the given tracking particle. + // (If the vector is empty, then the tracking particle was not reconstructed in this sector). + vector assocTrackCands3D(const TP& tp, bool rzFiltered) const; - const TrkRZfilter& getRZfilter() const {return rzFilter_;} + //=== Access to track r-z filter in case internal info from it required. -private: + bool ranRZfilter() const { return runRZfilter_; } // Was r-z filter required/run? - // Convert 2D HT tracks within the current sector to 3D tracks, - // by adding a rough estimate of their r-z helix parameters, without running any r-z track filter. - void makeUnfilteredTrks(const vector& vecTracksRphi); + const TrkRZfilter& getRZfilter() const { return rzFilter_; } - // Make 3D tracks from the 2D HT tracks within the current sector, by running the r-z track filter. - // The r-z filter also adds an estimate of the r-z helix parameters to each track. - // (Not filled if no track fitter needs the r-z filter). - void makeRZfilteredTrks(const vector& vecTracksRphi); + private: + // Convert 2D HT tracks within the current sector to 3D tracks, + // by adding a rough estimate of their r-z helix parameters, without running any r-z track filter. + void makeUnfilteredTrks(const vector& vecTracksRphi); -private: + // Make 3D tracks from the 2D HT tracks within the current sector, by running the r-z track filter. + // The r-z filter also adds an estimate of the r-z helix parameters to each track. + // (Not filled if no track fitter needs the r-z filter). + void makeRZfilteredTrks(const vector& vecTracksRphi); - // Configuration parameters - const Settings* settings_; - unsigned int iPhiSec_; // Sector number. - unsigned int iEtaReg_; - float etaMinSector_; // Range of eta sector - float etaMaxSector_; // Range of eta sector - float phiCentreSector_; // Phi angle of centre of this (eta,phi) sector. + private: + // Configuration parameters + const Settings* settings_; + unsigned int iPhiSec_; // Sector number. + unsigned int iEtaReg_; + float etaMinSector_; // Range of eta sector + float etaMaxSector_; // Range of eta sector + float phiCentreSector_; // Phi angle of centre of this (eta,phi) sector. - bool runRZfilter_; // Does r-z track filter need to be run. + bool runRZfilter_; // Does r-z track filter need to be run. - // Track filter(s), such as r-z filters, run after the r-phi Hough transform. - TrkRZfilter rzFilter_; + // Track filter(s), such as r-z filters, run after the r-phi Hough transform. + TrkRZfilter rzFilter_; - // List of all found 3D track candidates and their associated properties. - vector vecTracks3D_rzFiltered_; // After r-z filter run - vector vecTracks3D_unfiltered_; // Before r-z filter run. -}; + // List of all found 3D track candidates and their associated properties. + vector vecTracks3D_rzFiltered_; // After r-z filter run + vector vecTracks3D_unfiltered_; // Before r-z filter run. + }; -} +} // namespace TMTT #endif - diff --git a/L1Trigger/TrackFindingTMTT/interface/HTbase.h b/L1Trigger/TrackFindingTMTT/interface/HTbase.h index cd560280b6867..b210849043f8f 100644 --- a/L1Trigger/TrackFindingTMTT/interface/HTbase.h +++ b/L1Trigger/TrackFindingTMTT/interface/HTbase.h @@ -9,150 +9,157 @@ #include #include -using boost::numeric::ublas::matrix; +using boost::numeric::ublas::matrix; using namespace std; - //=== Base class for Hough Transform array for a single (eta,phi) sector. namespace TMTT { -class Settings; -class Stub; -class TP; -class L1fittedTrack; - -class HTbase { - -public: - - HTbase() {} - virtual ~HTbase(){} + class Settings; + class Stub; + class TP; + class L1fittedTrack; - // Initialization. - virtual void init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, - float etaMinSector, float etaMaxSector, float) = 0; + class HTbase { + public: + HTbase() {} + virtual ~HTbase() {} - void init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg) {settings_ = settings; iPhiSec_ = iPhiSec; iEtaReg_ = iEtaReg; optoLinkID_ = this->calcOptoLinkID();} + // Initialization. + virtual void init(const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float etaMinSector, + float etaMaxSector, + float) = 0; - // Add stub to HT array. - // N.B. The argument lists for this are different for r-phi & r-z HT, so unfortunately it can't be declared in base class. - //virtual void store(const Stub*) = 0; + void init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg) { + settings_ = settings; + iPhiSec_ = iPhiSec; + iEtaReg_ = iEtaReg; + optoLinkID_ = this->calcOptoLinkID(); + } - // Termination. Causes HT array to search for tracks etc. - virtual void end(); + // Add stub to HT array. + // N.B. The argument lists for this are different for r-phi & r-z HT, so unfortunately it can't be declared in base class. + //virtual void store(const Stub*) = 0; - //=== Get info about filtered stubs in HT array. - //=== (N.B. The `filtered stubs' are stubs passing any requested stub filters, e.g. bend and/or rapidity. - //=== If no filters were requested, they are identical to the unfiltered stubs.) + // Termination. Causes HT array to search for tracks etc. + virtual void end(); - // Get sum of number of filtered stubs stored in each cell of HT array (so a stub appearing in multiple cells is counted multiple times). - virtual unsigned int numStubsInc() const; + //=== Get info about filtered stubs in HT array. + //=== (N.B. The `filtered stubs' are stubs passing any requested stub filters, e.g. bend and/or rapidity. + //=== If no filters were requested, they are identical to the unfiltered stubs.) - // Get sum the number of filtered stubs in the HT array, where each individual stub is counted only once, even if it appears in multiple cells. - virtual unsigned int numStubsExc() const; + // Get sum of number of filtered stubs stored in each cell of HT array (so a stub appearing in multiple cells is counted multiple times). + virtual unsigned int numStubsInc() const; - // Get all the cells that make up the array, which in turn give access to the stubs inside them. - // N.B. You can use getAllCells().size1() and getAllCells().size2() to get the dimensions ofthe array. - virtual const matrix& getAllCells() const {return htArray_;} + // Get sum the number of filtered stubs in the HT array, where each individual stub is counted only once, even if it appears in multiple cells. + virtual unsigned int numStubsExc() const; - //=== Info about track candidates found. + // Get all the cells that make up the array, which in turn give access to the stubs inside them. + // N.B. You can use getAllCells().size1() and getAllCells().size2() to get the dimensions ofthe array. + virtual const matrix& getAllCells() const { return htArray_; } - // N.B. If a duplicate track filter was run inside the HT, this will contain the reduced list of tracks passing this filter. - // N.B. If some tracks could not be read out during the TM period, then such tracks are deleted from this list. + //=== Info about track candidates found. - // Get list of all track candidates found in this HT array, giving access to stubs on each track - // and helix parameters. - virtual const vector& trackCands2D() const {return trackCands2D_;} + // N.B. If a duplicate track filter was run inside the HT, this will contain the reduced list of tracks passing this filter. + // N.B. If some tracks could not be read out during the TM period, then such tracks are deleted from this list. - // Number of track candidates found in this HT array. - // If a duplicate track filter was run, this will contain the reduced list of tracks passing this filter. - virtual unsigned int numTrackCands2D() const {return trackCands2D_.size();} + // Get list of all track candidates found in this HT array, giving access to stubs on each track + // and helix parameters. + virtual const vector& trackCands2D() const { return trackCands2D_; } - // Get number of filtered stubs assigned to track candidates found in this HT array. - virtual unsigned int numStubsOnTrackCands2D() const; + // Number of track candidates found in this HT array. + // If a duplicate track filter was run, this will contain the reduced list of tracks passing this filter. + virtual unsigned int numTrackCands2D() const { return trackCands2D_.size(); } - // Get all reconstructed tracks that were associated to the given tracking particle. - // (If the vector is empty, then the tracking particle was not reconstructed in this sector). - virtual vector assocTrackCands2D(const TP& tp) const; + // Get number of filtered stubs assigned to track candidates found in this HT array. + virtual unsigned int numStubsOnTrackCands2D() const; - //=== Function to replace the collection of 2D tracks found by this HT. + // Get all reconstructed tracks that were associated to the given tracking particle. + // (If the vector is empty, then the tracking particle was not reconstructed in this sector). + virtual vector assocTrackCands2D(const TP& tp) const; - // (This is used by classes MuxHToutputs & MiniHTstage). - virtual void replaceTrackCands2D(const vector& newTracks); - virtual void replaceTrackCands2D(const vector& newTracks) {trackCands2D_ = newTracks;} + //=== Function to replace the collection of 2D tracks found by this HT. - //=== Utilities + // (This is used by classes MuxHToutputs & MiniHTstage). + virtual void replaceTrackCands2D(const vector& newTracks); + virtual void replaceTrackCands2D(const vector& newTracks) { trackCands2D_ = newTracks; } - // Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). - // The helix parameters returned will be those corresponding to the two axes of the HT array. - // So they might be (q/pt, phi65), (eta, z0) or (z110, z0) etc. depending on the configuration. - virtual pair helix2Dhough (unsigned int i, unsigned int j) const = 0; + //=== Utilities - // Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). - // The helix parameters returned will be always be (q/Pt, phi0) or (tan_lambda, z0), irrespective of - // how the axes of the HT array are defined. - virtual pair helix2Dconventional(unsigned int i, unsigned int j) const = 0; + // Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). + // The helix parameters returned will be those corresponding to the two axes of the HT array. + // So they might be (q/pt, phi65), (eta, z0) or (z110, z0) etc. depending on the configuration. + virtual pair helix2Dhough(unsigned int i, unsigned int j) const = 0; - // Which cell in HT array should this TP be in, based on its true trajectory? - // Returns 999999 in at least one index if TP not expected to be in any cell in this array. - virtual pair trueCell( const TP* tp ) const = 0; + // Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). + // The helix parameters returned will be always be (q/Pt, phi0) or (tan_lambda, z0), irrespective of + // how the axes of the HT array are defined. + virtual pair helix2Dconventional(unsigned int i, unsigned int j) const = 0; - // Which cell in HT array should this fitted track be in, based on its fitted trajectory? - // Returns 999999 in at least one index if fitted track not expected to be in any cell in this array. - virtual pair getCell( const L1fittedTrack* fitTrk) const = 0; + // Which cell in HT array should this TP be in, based on its true trajectory? + // Returns 999999 in at least one index if TP not expected to be in any cell in this array. + virtual pair trueCell(const TP* tp) const = 0; - // Disable filters (used for debugging). - virtual void disableBendFilter(); + // Which cell in HT array should this fitted track be in, based on its fitted trajectory? + // Returns 999999 in at least one index if fitted track not expected to be in any cell in this array. + virtual pair getCell(const L1fittedTrack* fitTrk) const = 0; -protected: + // Disable filters (used for debugging). + virtual void disableBendFilter(); - // Given a range in one of the coordinates specified by coordRange, calculate the corresponding range of bins. The other arguments specify the axis. And also if some cells nominally associated to stub are to be killed. - virtual pair convertCoordRangeToBinRange( pair coordRange, unsigned int nBinsAxis, float coordAxisMin, float coordAxisBinSize, unsigned int killSomeHTcells, bool debug = false) const; + protected: + // Given a range in one of the coordinates specified by coordRange, calculate the corresponding range of bins. The other arguments specify the axis. And also if some cells nominally associated to stub are to be killed. + virtual pair convertCoordRangeToBinRange(pair coordRange, + unsigned int nBinsAxis, + float coordAxisMin, + float coordAxisBinSize, + unsigned int killSomeHTcells, + bool debug = false) const; -private: + private: + // Return a list of all track candidates found in this array, giving access to all the stubs on each one + // and the track helix parameters, plus the associated truth particle (if any). + virtual vector calcTrackCands2D() const; - // Return a list of all track candidates found in this array, giving access to all the stubs on each one - // and the track helix parameters, plus the associated truth particle (if any). - virtual vector calcTrackCands2D() const; + // If requested, kill those tracks in this sector that can't be read out during the time-multiplexed period, because + // the HT has associated too many stubs to tracks. + virtual vector killTracksBusySec(const vector& tracks) const = 0; - // If requested, kill those tracks in this sector that can't be read out during the time-multiplexed period, because - // the HT has associated too many stubs to tracks. - virtual vector killTracksBusySec(const vector& tracks) const = 0; + // Define the order in which the hardware processes rows of the HT array when it outputs track candidates. + virtual vector rowOrder(unsigned int numRows) const = 0; - // Define the order in which the hardware processes rows of the HT array when it outputs track candidates. - virtual vector rowOrder(unsigned int numRows) const = 0; + // Calculate output opto-link ID from HT, assuming there is no MUX stage. + virtual unsigned int calcOptoLinkID() const { + unsigned int numPhiSecPerNon = settings_->numPhiSectors() / settings_->numPhiNonants(); + return (iEtaReg_ * numPhiSecPerNon + iPhiSec_); + } - // Calculate output opto-link ID from HT, assuming there is no MUX stage. - virtual unsigned int calcOptoLinkID() const { - unsigned int numPhiSecPerNon = settings_->numPhiSectors() / settings_->numPhiNonants(); - return (iEtaReg_ * numPhiSecPerNon + iPhiSec_); - } + protected: + const Settings* settings_; // configuration parameters. -protected: + unsigned int iPhiSec_; // Sector number. + unsigned int iEtaReg_; - const Settings* settings_; // configuration parameters. + unsigned int optoLinkID_; // ID of opto-link from HT to Track Fitter. - unsigned int iPhiSec_; // Sector number. - unsigned int iEtaReg_; + // Hough transform array. + // This has two dimensions, representing the two track helix parameters being varied. + matrix htArray_; - unsigned int optoLinkID_; // ID of opto-link from HT to Track Fitter. + // Contains algorithm used for duplicate track removal. + KillDupTrks killDupTrks_; - // Hough transform array. - // This has two dimensions, representing the two track helix parameters being varied. - matrix htArray_; + // List of all track candidates found by HT & their associated properties. + // If a duplicate track filter was run inside the HT, this will contain the reduced list of tracks passing this filter. + // If some tracks could not be read out during the TM period, then such tracks are deleted from this list. + vector trackCands2D_; + }; - // Contains algorithm used for duplicate track removal. - KillDupTrks killDupTrks_; - - // List of all track candidates found by HT & their associated properties. - // If a duplicate track filter was run inside the HT, this will contain the reduced list of tracks passing this filter. - // If some tracks could not be read out during the TM period, then such tracks are deleted from this list. - vector trackCands2D_; -}; - -} +} // namespace TMTT #endif - diff --git a/L1Trigger/TrackFindingTMTT/interface/HTcell.h b/L1Trigger/TrackFindingTMTT/interface/HTcell.h index 11498f162dd2a..30df39a362a93 100644 --- a/L1Trigger/TrackFindingTMTT/interface/HTcell.h +++ b/L1Trigger/TrackFindingTMTT/interface/HTcell.h @@ -12,137 +12,152 @@ using namespace std; - //=== A single cell in a Hough Transform array. namespace TMTT { -class Settings; -class Stub; - -class HTcell { + class Settings; + class Stub; -public: - - HTcell() {} - ~HTcell() {} + class HTcell { + public: + HTcell() {} + ~HTcell() {} - // Initialization with cfg params, - // sector number, rapidity range of current sector, estimated q/Pt of cell, - // and the bin number of the cell along the q/Pt axis of the r-phi HT array, - // and a flag indicating if this cell is the merge of smaller HT cells. - void init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, - float etaMinSector, float etaMaxSector, float qOverPt, unsigned int ibin_qOverPt, - bool mergedCell, bool miniHTcell=false); + // Initialization with cfg params, + // sector number, rapidity range of current sector, estimated q/Pt of cell, + // and the bin number of the cell along the q/Pt axis of the r-phi HT array, + // and a flag indicating if this cell is the merge of smaller HT cells. + void init(const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float etaMinSector, + float etaMaxSector, + float qOverPt, + unsigned int ibin_qOverPt, + bool mergedCell, + bool miniHTcell = false); - // Add stub to this cell in HT array. - void store (const Stub* stub) { vStubs_.push_back(stub); } + // Add stub to this cell in HT array. + void store(const Stub* stub) { vStubs_.push_back(stub); } - // Add stub to this cell in HT array, indicating also which subsectors within the sector is consistent with. - void store (const Stub* stub, const vector& inSubSecs) { this->store(stub); subSectors_[stub] = inSubSecs; if (inSubSecs.size() != numSubSecs_) throw cms::Exception("HTcell: Wrong number of subsectors!");} + // Add stub to this cell in HT array, indicating also which subsectors within the sector is consistent with. + void store(const Stub* stub, const vector& inSubSecs) { + this->store(stub); + subSectors_[stub] = inSubSecs; + if (inSubSecs.size() != numSubSecs_) + throw cms::Exception("HTcell: Wrong number of subsectors!"); + } - // Termination. Search for track in this HT cell etc. - void end(); + // Termination. Search for track in this HT cell etc. + void end(); - //=== Cfg of cell + //=== Cfg of cell - // Does this HTcell correspond to merged HT cells (e.g. 2x2)? - bool mergedCell() const {return mergedCell_;} + // Does this HTcell correspond to merged HT cells (e.g. 2x2)? + bool mergedCell() const { return mergedCell_; } - //=== Get results - //=== Most of these functions operate on the filtered stubs, which are stubs passing any requested stub filters (e.g. bend filter). - //=== If no filters were requested, they are identical to the unfiltered stubs.) + //=== Get results + //=== Most of these functions operate on the filtered stubs, which are stubs passing any requested stub filters (e.g. bend filter). + //=== If no filters were requested, they are identical to the unfiltered stubs.) - // Get filtered stubs in this cell in HT array. - const vector& stubs() const { return vFilteredStubs_; } + // Get filtered stubs in this cell in HT array. + const vector& stubs() const { return vFilteredStubs_; } - // Check if a specific stub is in this cell and survived filtering. - bool stubInCell( const Stub* stub ) const { return (std::count(vFilteredStubs_.begin(), vFilteredStubs_.end(), stub ) > 0); } + // Check if a specific stub is in this cell and survived filtering. + bool stubInCell(const Stub* stub) const { + return (std::count(vFilteredStubs_.begin(), vFilteredStubs_.end(), stub) > 0); + } - // Check if a specific stub was stored to this cell (without checking if it survived filtering). - bool stubStoredInCell( const Stub* stub ) const { return (std::count(vStubs_.begin(), vStubs_.end(), stub ) > 0); } + // Check if a specific stub was stored to this cell (without checking if it survived filtering). + bool stubStoredInCell(const Stub* stub) const { return (std::count(vStubs_.begin(), vStubs_.end(), stub) > 0); } - // Return info useful for deciding if there is a track candidate in this cell. - unsigned int numStubs() const { return vFilteredStubs_.size(); } // Number of filtered stubs - unsigned int numLayers() const { return numFilteredLayersInCell_; } // Number of tracker layers with filtered stubs - unsigned int numLayersSubSec() const { return numFilteredLayersInCellBestSubSec_; } // Number of tracker layers with filtered stubs, requiring all stubs to be in same subsector to be counted. The number returned is the highest layer count found in any of the subsectors in this sector. If subsectors are not used, it is equal to numLayers(). + // Return info useful for deciding if there is a track candidate in this cell. + unsigned int numStubs() const { return vFilteredStubs_.size(); } // Number of filtered stubs + unsigned int numLayers() const { return numFilteredLayersInCell_; } // Number of tracker layers with filtered stubs + unsigned int numLayersSubSec() const { + return numFilteredLayersInCellBestSubSec_; + } // Number of tracker layers with filtered stubs, requiring all stubs to be in same subsector to be counted. The number returned is the highest layer count found in any of the subsectors in this sector. If subsectors are not used, it is equal to numLayers(). - // Useful for debugging. - unsigned int numUnfilteredStubs() const { return vStubs_.size(); } // Number of unfiltered stubs + // Useful for debugging. + unsigned int numUnfilteredStubs() const { return vStubs_.size(); } // Number of unfiltered stubs - //=== Check if stubs in this cell form valid track candidate. + //=== Check if stubs in this cell form valid track candidate. - // N.B. If subsectors within a sector are not being used, then numFilteredLayersInCellBestSubSec_ = numFilteredLayersInCell_. - // WARNING: If some tracks are killed as the r-phi HT array can't read them out within the TM period, - // killed tracks are still found by this function. It is in HTbase::calcTrackCands2D() that they are killed. - bool trackCandFound() const {return (numFilteredLayersInCellBestSubSec_ >= Utility::numLayerCut("HT", settings_, iPhiSec_, iEtaReg_, fabs(qOverPtCell_)));} + // N.B. If subsectors within a sector are not being used, then numFilteredLayersInCellBestSubSec_ = numFilteredLayersInCell_. + // WARNING: If some tracks are killed as the r-phi HT array can't read them out within the TM period, + // killed tracks are still found by this function. It is in HTbase::calcTrackCands2D() that they are killed. + bool trackCandFound() const { + return (numFilteredLayersInCellBestSubSec_ >= + Utility::numLayerCut("HT", settings_, iPhiSec_, iEtaReg_, fabs(qOverPtCell_))); + } - //=== Disable filters (used for debugging). + //=== Disable filters (used for debugging). - void disableBendFilter() {useBendFilter_ = false;} + void disableBendFilter() { useBendFilter_ = false; } -private: + private: + // Calculate how many tracker layers the filtered stubs in this cell are in + unsigned int calcNumFilteredLayers() const { return Utility::countLayers(settings_, vFilteredStubs_); } - // Calculate how many tracker layers the filtered stubs in this cell are in - unsigned int calcNumFilteredLayers() const { return Utility::countLayers( settings_, vFilteredStubs_ ); } + // Calculate how many tracker layers the filter stubs in this cell are in, when only the subset of those stubs + // that are in the specified subsector are counted. + unsigned int calcNumFilteredLayers(unsigned int iSubSec) const; - // Calculate how many tracker layers the filter stubs in this cell are in, when only the subset of those stubs - // that are in the specified subsector are counted. - unsigned int calcNumFilteredLayers(unsigned int iSubSec) const; + // Estimate track bend angle at a given radius, derived using the track q/Pt at the centre of this HT cell, ignoring scattering. + float dphi(float rad) const { return (invPtToDphi_ * rad * qOverPtCell_); } - // Estimate track bend angle at a given radius, derived using the track q/Pt at the centre of this HT cell, ignoring scattering. - float dphi(float rad) const { return (invPtToDphi_ * rad * qOverPtCell_); } + // Produce a filtered collection of stubs in this cell that all have consistent bend + vector bendFilter(const vector& stubs) const; - // Produce a filtered collection of stubs in this cell that all have consistent bend - vector bendFilter( const vector& stubs ) const; + // Filter stubs so as to prevent more than specified number of stubs being stored in one cell. + // This reflects finite memory of hardware. + vector maxStubCountFilter(const vector& stubs) const; - // Filter stubs so as to prevent more than specified number of stubs being stored in one cell. - // This reflects finite memory of hardware. - vector maxStubCountFilter( const vector& stubs ) const; + private: + //=== Configuration parameters -private: + const Settings* settings_; - //=== Configuration parameters + unsigned int iPhiSec_; // Sector number + unsigned int iEtaReg_; - const Settings* settings_; + float etaMinSector_; // rapidity range of this sector. + float etaMaxSector_; - unsigned int iPhiSec_; // Sector number - unsigned int iEtaReg_; + float qOverPtCell_; // track q/Pt corresponding to centre of this cell. - float etaMinSector_; // rapidity range of this sector. - float etaMaxSector_; + // Note bin number of cell along q/Pt axis of r-phi HT array. (Not used for r-z HT). + unsigned int ibin_qOverPt_; + // Is this HT cell the merge of smaller HT cells? + bool mergedCell_; - float qOverPtCell_; // track q/Pt corresponding to centre of this cell. + // Is this cell in Mini-HT? + bool miniHTcell_; - // Note bin number of cell along q/Pt axis of r-phi HT array. (Not used for r-z HT). - unsigned int ibin_qOverPt_; - // Is this HT cell the merge of smaller HT cells? - bool mergedCell_; + float invPtToDphi_; // B*c/2E11 - // Is this cell in Mini-HT? - bool miniHTcell_; + // Use filter in each HT cell using only stubs which have consistent bend? + bool useBendFilter_; + // A filter is used each HT cell, which prevents more than the specified number of stubs being stored in the cell. (Reflecting memory limit of hardware). + unsigned int maxStubsInCell_; - float invPtToDphi_; // B*c/2E11 - - // Use filter in each HT cell using only stubs which have consistent bend? - bool useBendFilter_; - // A filter is used each HT cell, which prevents more than the specified number of stubs being stored in the cell. (Reflecting memory limit of hardware). - unsigned int maxStubsInCell_; + // Number of subsectors (if any) within each sector. + unsigned int numSubSecs_; - // Number of subsectors (if any) within each sector. - unsigned int numSubSecs_; + //=== data - //=== data + vector vStubs_; // Stubs in this cell + vector + vFilteredStubs_; // Stubs in cell selected by applying all requested stub filters (e.g. bend and/or eta filter ...) - vector vStubs_; // Stubs in this cell - vector vFilteredStubs_; // Stubs in cell selected by applying all requested stub filters (e.g. bend and/or eta filter ...) + unsigned int numFilteredLayersInCell_; // How many tracker layers these filtered stubs are in + unsigned int + numFilteredLayersInCellBestSubSec_; // Ditto, but requiring all stubs to be in same subsector to be counted. This number is the highest layer count found in any of the subsectors in this sector. - unsigned int numFilteredLayersInCell_; // How many tracker layers these filtered stubs are in - unsigned int numFilteredLayersInCellBestSubSec_; // Ditto, but requiring all stubs to be in same subsector to be counted. This number is the highest layer count found in any of the subsectors in this sector. + map> + subSectors_; // Indicate which subsectors within the sector this stub is consistent with. + }; - map> subSectors_; // Indicate which subsectors within the sector this stub is consistent with. -}; - -} +} // namespace TMTT #endif - diff --git a/L1Trigger/TrackFindingTMTT/interface/HTrphi.h b/L1Trigger/TrackFindingTMTT/interface/HTrphi.h index c875056d63876..037120c3d2e47 100644 --- a/L1Trigger/TrackFindingTMTT/interface/HTrphi.h +++ b/L1Trigger/TrackFindingTMTT/interface/HTrphi.h @@ -10,157 +10,157 @@ using namespace std; //=== The r-phi Hough Transform array for a single (eta,phi) sector. //=== -//=== Its axes are (q/Pt, phiTrk), where phiTrk is the phi at which the track crosses a +//=== Its axes are (q/Pt, phiTrk), where phiTrk is the phi at which the track crosses a //=== user-configurable radius from the beam-line. namespace TMTT { -class Settings; -class Stub; -class TP; -class L1fittedTrack; + class Settings; + class Stub; + class TP; + class L1fittedTrack; -class HTrphi : public HTbase { + class HTrphi : public HTbase { + public: + HTrphi() : HTbase() {} + ~HTrphi() {} -public: - - HTrphi() : HTbase() {} - ~HTrphi(){} + // Initialization with sector number, eta range covered by sector and phi coordinate of its centre. + void init(const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float etaMinSector, + float etaMaxSector, + float phiCentreSector); - // Initialization with sector number, eta range covered by sector and phi coordinate of its centre. - void init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, - float etaMinSector, float etaMaxSector, float phiCentreSector); + // Add stub to HT array. + // If eta subsectors are being used within each sector, specify which ones the stub is compatible with. + void store(const Stub* stub, const vector& inEtaSubSecs); + + // Termination. Causes HT array to search for tracks etc. + // ... function end() is in base class ... + + //=== Info about track candidates found. + + // ... is available via base class ... + + //=== Utilities + + // Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). + // The helix parameters returned will be those corresponding to the two axes of the HT array. + // So they might be (q/pt, phi0) or (q/pt, phi65) etc. depending on the configuration. + pair helix2Dhough(unsigned int i, unsigned int j) const; + + // Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). + // The helix parameters returned will be always be (q/pt, phi0), irrespective of how the axes + // of the HT array are defined. + pair helix2Dconventional(unsigned int i, unsigned int j) const; + + // Which cell in HT array should this TP be in, based on its true trajectory? + // (If TP is outside HT array, it it put in the closest bin inside it). + pair trueCell(const TP* tp) const; + + // Which cell in HT array should this fitted track be in, based on its fitted trajectory? + // Always uses beam-spot constrained trajectory if available. + // (If fitted track is outside HT array, it it put in the closest bin inside it). + pair getCell(const L1fittedTrack* fitTrk) const; + + // Check if specified cell has been merged with its 2x2 neighbours into a single cell, + // as it is in low Pt region. + bool mergedCell(unsigned int iQoverPtBin, unsigned int jPhiTrkBin) const; + + //--- Functions to check that stub filling is compatible with limitations of firmware. + + // Calculate maximum |gradient| that any stub's line across any of the r-phi HT arrays could have, to check it is < 1. + static float maxLineGrad() { return maxLineGradient_; } + // Summed over all r-phi HT arrays, returns fraction of stubs added to an HT column which do not lie NE, E or SE of stub added to previous HT column. + static float fracErrorsTypeA() { return numErrorsTypeA_ / float(numErrorsNormalisation_); } + // Summed over all r-phi HT arrays, returns fraction of stubs added to more than 2 cells in one HT column. (Only a problem for Thomas' firmware). + static float fracErrorsTypeB() { return numErrorsTypeB_ / float(numErrorsNormalisation_); } + + // Number of stubs received from GP, irrespective of whether the stub was actually stored in + // a cell in the HT array. + unsigned int nReceivedStubs() const { return nReceivedStubs_; } + + // Determine which m-bin (q/pt) range the specified track is in. (Used if outputting each m bin range on a different opto-link). + unsigned int getMbinRange(const L1track2D& trk) const; + + private: + // For a given Q/Pt bin, find the range of phi bins that a given stub is consistent with. + pair iPhiRange(const Stub* stub, unsigned int iQoverPtBin, bool debug = false) const; + + // Check that limitations of firmware would not prevent stub being stored correctly in this HT column. + void countFirmwareErrors(unsigned int iQoverPtBin, unsigned int iPhiTrkBinMin, unsigned int iPhiTrkBinMax); + + // Calculate maximum |gradient| that any stub's line across this HT array could have, so can check it doesn't exceed 1. + float calcMaxLineGradArray() const; + + // If requested, kill those tracks in this sector that can't be read out during the time-multiplexed period, because + // the HT has associated too many stubs to tracks. + vector killTracksBusySec(const vector& tracks) const; + + // Define the order in which the hardware processes rows of the HT array when it outputs track candidates. + // Currently corresponds to highest Pt tracks first. + // If two tracks have the same Pt, the -ve charge one is output before the +ve charge one. + vector rowOrder(unsigned int numRows) const; + + private: + float invPtToDphi_; // conversion constant. + unsigned int shape_; + std::vector > > cellCenters_; + + //--- Specifications of HT array. + + float maxAbsQoverPtAxis_; // Max. |q/Pt| covered by HT array. + unsigned int nBinsQoverPtAxis_; // Number of bins in HT array in q/Pt. + float binSizeQoverPtAxis_; // HT array bin size in q/Pt. + + float chosenRofPhi_; // Use phi of track at radius="chosenRofPhi" to define one of the r-phi HT axes. + float phiCentreSector_; // phiTrk angle of centre of this (eta,phi) sector. + float maxAbsPhiTrkAxis_; // Half-width of phiTrk axis in HT array. + unsigned int nBinsPhiTrkAxis_; // Number of bins in HT array in phiTrk axis. + float binSizePhiTrkAxis_; // HT array bin size in phiTrk + + bool enableMerge2x2_; // Optionally merge 2x2 neighbouring cells into a single cell at low Pt, to reduce efficiency loss due to scattering. (Used also by mini-HT). + float minInvPtToMerge2x2_; + + //--- Options when filling HT array. + + unsigned int + killSomeHTCellsRphi_; // Take all cells in HT array crossed by line corresponding to each stub (= 0) or take only some to reduce rate at cost of efficiency ( > 0) + bool handleStripsRphiHT_; // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when fill stubs in r-phi HT? + // Options for killing stubs/tracks that cant be sent within time-multiplexed period. + bool busyInputSectorKill_; + unsigned int busyInputSectorNumStubs_; + bool busySectorKill_; + unsigned int busySectorNumStubs_; + vector busySectorMbinRanges_; + bool busySectorUseMbinRanges_; + vector busySectorMbinOrder_; + bool busySectorUseMbinOrder_; + vector busySectorMbinLow_; + vector busySectorMbinHigh_; - // Add stub to HT array. - // If eta subsectors are being used within each sector, specify which ones the stub is compatible with. - void store( const Stub* stub, const vector& inEtaSubSecs); - - // Termination. Causes HT array to search for tracks etc. - // ... function end() is in base class ... - - //=== Info about track candidates found. - - // ... is available via base class ... - - //=== Utilities - - // Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). - // The helix parameters returned will be those corresponding to the two axes of the HT array. - // So they might be (q/pt, phi0) or (q/pt, phi65) etc. depending on the configuration. - pair helix2Dhough (unsigned int i, unsigned int j) const; - - // Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). - // The helix parameters returned will be always be (q/pt, phi0), irrespective of how the axes - // of the HT array are defined. - pair helix2Dconventional(unsigned int i, unsigned int j) const; - - // Which cell in HT array should this TP be in, based on its true trajectory? - // (If TP is outside HT array, it it put in the closest bin inside it). - pair trueCell( const TP* tp ) const; - - // Which cell in HT array should this fitted track be in, based on its fitted trajectory? - // Always uses beam-spot constrained trajectory if available. - // (If fitted track is outside HT array, it it put in the closest bin inside it). - pair getCell( const L1fittedTrack* fitTrk) const; - - // Check if specified cell has been merged with its 2x2 neighbours into a single cell, - // as it is in low Pt region. - bool mergedCell(unsigned int iQoverPtBin, unsigned int jPhiTrkBin) const; - - //--- Functions to check that stub filling is compatible with limitations of firmware. - - // Calculate maximum |gradient| that any stub's line across any of the r-phi HT arrays could have, to check it is < 1. - static float maxLineGrad() {return maxLineGradient_;} - // Summed over all r-phi HT arrays, returns fraction of stubs added to an HT column which do not lie NE, E or SE of stub added to previous HT column. - static float fracErrorsTypeA() {return numErrorsTypeA_/float(numErrorsNormalisation_);} - // Summed over all r-phi HT arrays, returns fraction of stubs added to more than 2 cells in one HT column. (Only a problem for Thomas' firmware). - static float fracErrorsTypeB() {return numErrorsTypeB_/float(numErrorsNormalisation_);} - - // Number of stubs received from GP, irrespective of whether the stub was actually stored in - // a cell in the HT array. - unsigned int nReceivedStubs() const {return nReceivedStubs_;} - - // Determine which m-bin (q/pt) range the specified track is in. (Used if outputting each m bin range on a different opto-link). - unsigned int getMbinRange(const L1track2D& trk) const; - -private: - - // For a given Q/Pt bin, find the range of phi bins that a given stub is consistent with. - pair iPhiRange( const Stub* stub, unsigned int iQoverPtBin, bool debug = false) const; - - // Check that limitations of firmware would not prevent stub being stored correctly in this HT column. - void countFirmwareErrors(unsigned int iQoverPtBin, unsigned int iPhiTrkBinMin, unsigned int iPhiTrkBinMax); - - // Calculate maximum |gradient| that any stub's line across this HT array could have, so can check it doesn't exceed 1. - float calcMaxLineGradArray() const; - - // If requested, kill those tracks in this sector that can't be read out during the time-multiplexed period, because - // the HT has associated too many stubs to tracks. - vector killTracksBusySec(const vector& tracks) const; - - // Define the order in which the hardware processes rows of the HT array when it outputs track candidates. - // Currently corresponds to highest Pt tracks first. - // If two tracks have the same Pt, the -ve charge one is output before the +ve charge one. - vector rowOrder(unsigned int numRows) const; - -private: - - float invPtToDphi_; // conversion constant. - unsigned int shape_; - std::vector< std::vector< std::pair< float, float > > > cellCenters_; - - //--- Specifications of HT array. - - float maxAbsQoverPtAxis_; // Max. |q/Pt| covered by HT array. - unsigned int nBinsQoverPtAxis_; // Number of bins in HT array in q/Pt. - float binSizeQoverPtAxis_; // HT array bin size in q/Pt. - - float chosenRofPhi_; // Use phi of track at radius="chosenRofPhi" to define one of the r-phi HT axes. - float phiCentreSector_; // phiTrk angle of centre of this (eta,phi) sector. - float maxAbsPhiTrkAxis_; // Half-width of phiTrk axis in HT array. - unsigned int nBinsPhiTrkAxis_; // Number of bins in HT array in phiTrk axis. - float binSizePhiTrkAxis_; // HT array bin size in phiTrk - - bool enableMerge2x2_; // Optionally merge 2x2 neighbouring cells into a single cell at low Pt, to reduce efficiency loss due to scattering. (Used also by mini-HT). - float minInvPtToMerge2x2_; - - //--- Options when filling HT array. - - unsigned int killSomeHTCellsRphi_; // Take all cells in HT array crossed by line corresponding to each stub (= 0) or take only some to reduce rate at cost of efficiency ( > 0) - bool handleStripsRphiHT_; // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when fill stubs in r-phi HT? - // Options for killing stubs/tracks that cant be sent within time-multiplexed period. - bool busyInputSectorKill_; - unsigned int busyInputSectorNumStubs_; - bool busySectorKill_; - unsigned int busySectorNumStubs_; - vector busySectorMbinRanges_; - bool busySectorUseMbinRanges_; - vector busySectorMbinOrder_; - bool busySectorUseMbinOrder_; - vector busySectorMbinLow_; - vector busySectorMbinHigh_; - - //--- Checks that stub filling is compatible with limitations of firmware. - - // Maximum |gradient| of line corresponding to any stub. Should be less than the value of 1.0 assumed by the firmware. - static float maxLineGradient_; - // Error count when stub added to cell which does not lie NE, E or SE of stub added to previous HT column. - static unsigned int numErrorsTypeA_; - // Error count when stub added to more than 2 cells in one HT column (problem only for Thomas' firmware). - static unsigned int numErrorsTypeB_; - // Error count normalisation - static unsigned int numErrorsNormalisation_; - - // Number of stubs received from GP, irrespective of whether the stub was actually stored in - // a cell in the HT array. - unsigned int nReceivedStubs_; - - // ... The Hough transform array data is in the base class ... - - // ... The list of found track candidates is in the base class ... -}; - -} + //--- Checks that stub filling is compatible with limitations of firmware. + + // Maximum |gradient| of line corresponding to any stub. Should be less than the value of 1.0 assumed by the firmware. + static float maxLineGradient_; + // Error count when stub added to cell which does not lie NE, E or SE of stub added to previous HT column. + static unsigned int numErrorsTypeA_; + // Error count when stub added to more than 2 cells in one HT column (problem only for Thomas' firmware). + static unsigned int numErrorsTypeB_; + // Error count normalisation + static unsigned int numErrorsNormalisation_; + + // Number of stubs received from GP, irrespective of whether the stub was actually stored in + // a cell in the HT array. + unsigned int nReceivedStubs_; + + // ... The Hough transform array data is in the base class ... + + // ... The list of found track candidates is in the base class ... + }; + +} // namespace TMTT #endif - diff --git a/L1Trigger/TrackFindingTMTT/interface/Histos.h b/L1Trigger/TrackFindingTMTT/interface/Histos.h index 78b0b9706cfa3..e4aa6fe70de25 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Histos.h +++ b/L1Trigger/TrackFindingTMTT/interface/Histos.h @@ -8,7 +8,7 @@ #include "L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h" #include "boost/numeric/ublas/matrix.hpp" -using boost::numeric::ublas::matrix; +using boost::numeric::ublas::matrix; #include #include @@ -25,633 +25,637 @@ class TGraphAsymmErrors; class TGraph; class TEfficiency; - namespace TMTT { -class InputData; -class TP; -class Sector; -class HTrphi; -class Get3Dtracks; -class L1fittedTrack; -class L1fittedTrk4and5; - -class Histos { - -public: - // Store cfg parameters. - Histos(const Settings* settings); - - virtual ~Histos(){} - - // Book & fill all histograms. - virtual void book(); - virtual void fill(const InputData& inputData, const matrix& mSectors, const matrix& mHtPhis, - const matrix mGet3Dtrks, const std::map>& fittedTracks); - - // Print tracking performance summary & make tracking efficiency histograms. - virtual void endJobAnalysis(); - - // Determine "B" parameter, used in GP firmware to allow for tilted modules. - virtual void trackerGeometryAnalysis( const TrackerGeometryInfo trackerGeometryInfo ); - - // Did user request output histograms via the TFileService in their cfg? - virtual bool available() const {return fs_.isAvailable();} - - // Should histograms be produced? - virtual bool enabled() const {return ( settings_->enableHistos() && available() );} - -protected: - - // Book histograms for specific topics. - virtual TFileDirectory bookInputData(); - virtual TFileDirectory bookEtaPhiSectors(); - virtual TFileDirectory bookRphiHT(); - virtual TFileDirectory bookRZfilters(); - virtual TFileDirectory bookStudyBusyEvents(); - virtual TFileDirectory bookTrackCands(string tName); - virtual map bookTrackFitting(); - - // Fill histograms for specific topics. - virtual void fillInputData(const InputData& inputData); - virtual void fillEtaPhiSectors(const InputData& inputData, const matrix& mSectors); - virtual void fillRphiHT(const matrix& mHtRphis); - virtual void fillRZfilters(const matrix& mGet3Dtrks); - virtual void fillStudyBusyEvents(const InputData& inputData, const matrix& mSectors, const matrix& mHtRphis, - const matrix& mGet3Dtrks); - virtual void fillTrackCands(const InputData& inputData, const vector& tracks, string tName); - virtual void fillTrackFitting(const InputData& inputData, const std::map>& fittedTracks); - - // Produce plots of tracking efficiency after HZ or after r-z track filter (run at end of job) - virtual TFileDirectory plotTrackEfficiency(string tName); - // Produce plots of tracking efficiency after track fit (run at end of job). - virtual TFileDirectory plotTrackEffAfterFit(string fitName); - - // For Hybrid tracking - // Produce plots of tracklet seed finding efficiency before track reco - virtual void plotTrackletSeedEfficiency() {}; - // Produce plots of hybrid duplicate removal efficiency after track reco - virtual void plotHybridDupRemovalEfficiency() {}; - - virtual void makeEfficiencyPlot( TFileDirectory &inputDir, TEfficiency* outputEfficiency, TH1F* pass, TH1F* all, TString name, TString title ); - - // Print summary of track-finding performance after track pattern reco. - virtual void printTrackPerformance(string tName); - - // Print summary of track-finding performance after helix fit for given track fitter. - virtual void printFitTrackPerformance(string fitName); - - // For Hybrid tracking - // Print summary of seed finding and extrapolation performance during track pattern reco. - virtual void printTrackletSeedFindingPerformance() {}; - - // Print summary of duplicate removal performance after track pattern reco. - virtual void printHybridDupRemovalPerformance() {}; - - // Understand why not all tracking particles were reconstructed. - // Returns list of tracking particles that were not reconstructed and an integer indicating why. - // Only considers TP used for algorithmic efficiency measurement. - virtual map diagnoseTracking(const vector& allTPs, const vector& tracks, - bool withRZfilter) const; - - protected: - - // Configuration parameters. - const Settings *settings_; - unsigned int genMinStubLayers_; - unsigned int numPhiSectors_; - unsigned int numEtaRegions_; - float houghMinPt_; - unsigned int houghNbinsPt_; - unsigned int houghNbinsPhi_; - float chosenRofZ_; - vector trackFitters_; - vector useRZfilter_; - bool ranRZfilter_; - bool resPlotOpt_; - - edm::Service fs_; - - // Histograms of input data. - TH1F* hisNumEvents_; - TProfile* profNumStubs_; - TH1F* hisStubsVsEta_; - TH1F* hisStubsVsR_; - TH2F* hisStubsVsRVsZ_; - TH2F* hisStubsModuleVsRVsZ_; - TH2F* hisStubsModuleTiltVsZ_; - TH2F* hisStubsdPhiCorrectionVsZ_; - TH2F* hisStubsVsRVsPhi_; - TH2F* hisStubsModuleVsRVsPhi_; - - TH2F* hisStubsVsRVsZ_outerModuleAtSmallerR_; - TH2F* hisStubsVsRVsPhi_outerModuleAtSmallerR_; - - TProfile* profNumTPs_; - TH1F* hisNumStubsPerTP_; - TH1F* hisNumPSStubsPerTP_; - TH1F* hisNum2SStubsPerTP_; - TH1F* hisNumLayersPerTP_; - TH1F* hisNumPSLayersPerTP_; - TH1F* hisNum2SLayersPerTP_; - - TH1F* hisNumLayersPerTP_lowPt_; - TH1F* hisNumPSLayersPerTP_lowPt_; - TH1F* hisNum2SLayersPerTP_lowPt_; - - TH1F* hisNumLayersPerTP_mediumPt_; - TH1F* hisNumPSLayersPerTP_mediumPt_; - TH1F* hisNum2SLayersPerTP_mediumPt_; - - TH1F* hisNumLayersPerTP_highPt_; - TH1F* hisNumPSLayersPerTP_highPt_; - TH1F* hisNum2SLayersPerTP_highPt_; - - TH1F* hisNumLayersPerTP_muons_; - TH1F* hisNumPSLayersPerTP_muons_; - TH1F* hisNum2SLayersPerTP_muons_; - - TH1F* hisNumLayersPerTP_electrons_; - TH1F* hisNumPSLayersPerTP_electrons_; - TH1F* hisNum2SLayersPerTP_electrons_; - - TH1F* hisNumLayersPerTP_pions_; - TH1F* hisNumPSLayersPerTP_pions_; - TH1F* hisNum2SLayersPerTP_pions_; - - TProfile* hisStubKillFE_; - TProfile* hisStubIneffiVsInvPt_; - TProfile* hisStubIneffiVsEta_; - TProfile* hisStubKillDegradeBend_; - TH1F* hisPtStub_; - TH1F* hisPtResStub_; - TH1F* hisBendFilterPower_; - TH1F* hisDelPhiStub_; - TH1F* hisDelPhiResStub_; - TH1F* hisDelPhiResStub_tilted_; - TH1F* hisDelPhiResStub_notTilted_; - TH1F* hisBendStub_; - TH1F* hisBendResStub_; - TH1F* hisNumMergedBend_; - TH2F* hisBendVsLayerOrRingPS_; - TH2F* hisBendVsLayerOrRing2S_; - TH2F* hisBendFEVsLayerOrRingPS_; - TH2F* hisBendFEVsLayerOrRing2S_; - TH1F* hisPhiStubVsPhiTP_; - TH1F* hisPhiStubVsPhi0TP_; - TH1F* hisPhi0StubVsPhi0TP_; - TH1F* hisPhi0StubVsPhi0TPres_; - TH1F* hisPhiStubVsPhi65TP_; - TH1F* hisPhi65StubVsPhi65TP_; - TH1F* hisPhi65StubVsPhi65TPres_; - TH1F* hisPitchOverSep_; - TH1F* hisRhoParameter_; - TH2F* hisAlphaCheck_; - TH1F* hisFracStubsSharingClus0_; - TH1F* hisFracStubsSharingClus1_; - - // Histograms of B - TH1F* hisStubB_; - TH1F* hisStubBApproxDiff_tilted_; - TGraph* graphBVsZoverR_; - - // Histograms checking that (eta,phi) sector definition is good. - TH1F* hisFracStubsInSec_; - TH1F* hisFracStubsInEtaSec_; - TH1F* hisFracStubsInPhiSec_; - TH1F* hisNumSecsPerStub_; - TH1F* hisNumEtaSecsPerStub_; - TH1F* hisNumPhiSecsPerStub_; - TH1F* hisNumStubsPerSec_; - TProfile* profNumStubsPerEtaSec_; - TH2F* hisLayerIDvsEtaSec_; - TH2F* hisLayerIDreducedvsEtaSec_; - - // Histograms checking filling of r-phi HT array. - TH2Poly* hisArrayHT_; - TF1* hisStubHT_; - TH1F* hisIncStubsPerHT_; - TH1F* hisExcStubsPerHT_; - TH2F* hisNumStubsInCellVsEta_; - TH1F* hisStubsOnRphiTracksPerHT_; - TH1F* hisHTstubsPerTrack_; - TH1F* hisHTmBin_; - TH1F* hisHTcBin_; - - // Histograms about r-z track filters (or other filters applied after r-phi HT array). - TH1F* hisNumZtrkSeedCombinations_; - TH1F* hisNumSeedCombinations_; - TH1F* hisNumGoodSeedCombinations_; - TH1F* hisCorrelationZTrk_; - - // Histograms for studying freak, large events with too many stubs. - TH1F* hisNumBusySecsInPerEvent_; - TH1F* hisNumBusySecsOutPerEvent_; - TProfile* profFracBusyInVsEtaReg_; - TProfile* profFracBusyOutVsEtaReg_; - TProfile* profFracStubsKilledVsEtaReg_; - TProfile* profFracTracksKilledVsEtaReg_; - TProfile* profFracTracksKilledVsInvPt_; - TProfile* profFracTPKilledVsEta_; - TProfile* profFracTPKilledVsInvPt_; - TH1F* hisNumTPkilledBusySec_; - map hisNumInputStubs_; - map hisQoverPtInputStubs_; - map hisNumOutputStubs_; - map hisNumTracks_; - map hisNumStubsPerTrack_; - map hisTrackQoverPt_; - map hisTrackPurity_; - map hisNumTPphysics_; - map hisNumTPpileup_; - map hisSumPtTPphysics_; - map hisSumPtTPpileup_; - - // Histograms studying 3D track candidates found by Hough Transform or r-z Track Filter. - map profNumTrackCands_; - map profNumTracksVsEta_; - map hisNumTracksVsQoverPt_; - map hisNumTrksPerSect_; - map hisNumTrksPerNon_; - map profStubsOnTracks_; - map profStubsOnTracksVsEta_; - map hisStubsOnTracksPerSect_; - map hisStubsOnTracksPerNon_; - map hisUniqueStubsOnTrksPerSect_; - map hisUniqueStubsOnTrksPerNon_; - map hisStubsPerTrack_; - map hisLayersPerTrack_; - map hisPSLayersPerTrack_; - map hisLayersPerTrueTrack_; - map hisPSLayersPerTrueTrack_; - - map hisNumStubsPerLink_; - map hisNumStubsVsLink_; - map profMeanStubsPerLink_; - map hisNumTrksPerLink_; - map hisNumTrksVsLink_; - map profMeanTrksPerLink_; - - map profExcessStubsPerTrackVsPt_; - map hisFracMatchStubsOnTracks_; - map hisDeltaBendTrue_; - map hisDeltaBendFake_; - map profFracTrueStubsVsLayer_; - map profDupTracksVsEta_; - map profDupTracksVsInvPt_; - //map hisWrongSignStubRZ_pBend_; - //map hisWrongSignStubRZ_nBend_; - - // Histos of track params after HT. - map hisQoverPt_; - map hisPhi0_; - map hisEta_; - map hisZ0_; - - // Histograms of track parameter resolution after HT transform. - map hisQoverPtRes_; - map hisPhi0Res_; - map hisEtaRes_; - map hisZ0Res_; - - map hisRecoVsTrueQinvPt_; - map hisRecoVsTruePhi0_; - map hisRecoVsTrueD0_; - map hisRecoVsTrueZ0_; - map hisRecoVsTrueEta_; - - // Diagnosis of failed tracking. - map hisRecoFailureReason_; - map hisRecoFailureLayer_; - - map hisNumStubsOnLayer_; - - // Histos used for denominator of tracking efficiency plots. - TH1F* hisTPinvptForEff_; - TH1F* hisTPptForEff_; - TH1F* hisTPetaForEff_; - TH1F* hisTPphiForEff_; - TH1F* hisTPd0ForEff_; - TH1F* hisTPz0ForEff_; - // - TH1F* hisTPinvptForAlgEff_; - TH1F* hisTPptForAlgEff_; - TH1F* hisTPetaForAlgEff_; - TH1F* hisTPphiForAlgEff_; - TH1F* hisTPd0ForAlgEff_; - TH1F* hisTPz0ForAlgEff_; - // - TH1F* hisTPphisecForAlgEff_; - TH1F* hisTPetasecForAlgEff_; - TH1F* hisTPinvptForAlgEff_inJetPtG30_; - TH1F* hisTPinvptForAlgEff_inJetPtG100_; - TH1F* hisTPinvptForAlgEff_inJetPtG200_; - - // Histograms used to make efficiency plots with 3D track candidates prior to fit. - map hisRecoTPinvptForEff_; - map hisRecoTPptForEff_; - map hisRecoTPetaForEff_; - map hisRecoTPphiForEff_; - // - map hisPerfRecoTPinvptForEff_; - map hisPerfRecoTPptForEff_; - map hisPerfRecoTPetaForEff_; - // - map hisRecoTPd0ForEff_; - map hisRecoTPz0ForEff_; - // - map hisRecoTPinvptForAlgEff_; - map hisRecoTPptForAlgEff_; - map hisRecoTPetaForAlgEff_; - map hisRecoTPphiForAlgEff_; - // - map hisPerfRecoTPinvptForAlgEff_; - map hisPerfRecoTPptForAlgEff_; - map hisPerfRecoTPetaForAlgEff_; - // - map hisRecoTPd0ForAlgEff_; - map hisRecoTPz0ForAlgEff_; - // - map hisRecoTPphisecForAlgEff_; - map hisPerfRecoTPphisecForAlgEff_; - map hisRecoTPetasecForAlgEff_; - map hisPerfRecoTPetasecForAlgEff_; - - map hisRecoTPinvptForAlgEff_inJetPtG30_; - map hisRecoTPinvptForAlgEff_inJetPtG100_; - map hisRecoTPinvptForAlgEff_inJetPtG200_; - - // Histograms for track fitting evaluation, where map index specifies name of track fitting algorithm used. - - map profNumFitTracks_; - map hisNumFitTrks_; - map hisNumFitTrksPerNon_; - map hisNumFitTrksPerSect_; - - map hisStubsPerFitTrack_; - map profStubsOnFitTracks_; - - map hisFitQinvPtMatched_; - map hisFitPhi0Matched_; - map hisFitD0Matched_; - map hisFitZ0Matched_; - map hisFitEtaMatched_; - - map hisFitQinvPtUnmatched_; - map hisFitPhi0Unmatched_; - map hisFitD0Unmatched_; - map hisFitZ0Unmatched_; - map hisFitEtaUnmatched_; - - map hisKalmanNumUpdateCalls_; - map hisKalmanChi2DofSkipLay0Matched_; - map hisKalmanChi2DofSkipLay1Matched_; - map hisKalmanChi2DofSkipLay2Matched_; - map hisKalmanChi2DofSkipLay0Unmatched_; - map hisKalmanChi2DofSkipLay1Unmatched_; - map hisKalmanChi2DofSkipLay2Unmatched_; - - map hisFitChi2Matched_; - map hisFitChi2DofMatched_; - map hisFitChi2DofRphiMatched_; - map hisFitChi2DofRzMatched_; - map hisFitBeamChi2Matched_; - map hisFitBeamChi2DofMatched_; - map profFitChi2VsEtaMatched_; - map profFitChi2DofVsEtaMatched_; - map profFitChi2VsInvPtMatched_; - map profFitChi2DofVsInvPtMatched_; - map profFitChi2VsTrueD0Matched_; - map profFitChi2DofVsTrueD0Matched_; - map hisFitChi2PerfMatched_; - map hisFitChi2DofPerfMatched_; - - map hisFitChi2Unmatched_; - map hisFitChi2DofUnmatched_; - map hisFitChi2DofRphiUnmatched_; - map hisFitChi2DofRzUnmatched_; - map hisFitBeamChi2Unmatched_; - map hisFitBeamChi2DofUnmatched_; - map profFitChi2VsEtaUnmatched_; - map profFitChi2DofVsEtaUnmatched_; - map profFitChi2VsInvPtUnmatched_; - map profFitChi2DofVsInvPtUnmatched_; - - map profFitChi2VsPurity_; - map profFitChi2DofVsPurity_; - - map hisDeltaPhitruePSbarrel_; - map hisDeltaRorZtruePSbarrel_; - map hisDeltaPhitrue2Sbarrel_; - map hisDeltaRorZtrue2Sbarrel_; - map hisDeltaPhitruePSendcap_; - map hisDeltaRorZtruePSendcap_; - map hisDeltaPhitrue2Sendcap_; - map hisDeltaRorZtrue2Sendcap_; - map hisDeltaPhifakePSbarrel_; - map hisDeltaRorZfakePSbarrel_; - map hisDeltaPhifake2Sbarrel_; - map hisDeltaRorZfake2Sbarrel_; - map hisDeltaPhifakePSendcap_; - map hisDeltaRorZfakePSendcap_; - map hisDeltaPhifake2Sendcap_; - map hisDeltaRorZfake2Sendcap_; - map profRecalcRphiChi2VsEtaTrue1_; - map profRecalcRzChi2VsEtaTrue1_; - map profRecalcChi2VsEtaTrue1_; - map profRecalcChi2VsEtaTrue2_; - map profNsigmaPhivsInvPt_; - map profNsigmaPhivsR_; - map profNsigmaPhivsTanl_; - - map hisFitVsSeedQinvPtMatched_; - map hisFitVsSeedPhi0Matched_; - map hisFitVsSeedD0Matched_; - map hisFitVsSeedZ0Matched_; - map hisFitVsSeedEtaMatched_; - - map hisFitVsSeedQinvPtUnmatched_; - map hisFitVsSeedPhi0Unmatched_; - map hisFitVsSeedD0Unmatched_; - map hisFitVsSeedZ0Unmatched_; - map hisFitVsSeedEtaUnmatched_; - - map hisNumStubsVsPurityMatched_; - map profFitFracTrueStubsVsLayerMatched_; - map profFitFracTrueStubsVsEtaMatched_; - - map hisFitVsTrueQinvPt_; - map hisFitVsTruePhi0_; - map hisFitVsTrueD0_; - map hisFitVsTrueZ0_; - map hisFitVsTrueEta_; - - map hisFitQinvPtRes_; - map hisFitPhi0Res_; - map hisFitD0Res_; - map hisFitZ0Res_; - map hisFitEtaRes_; - - map hisQoverPtResVsTrueEta_; - map hisPhi0ResVsTrueEta_; - map hisEtaResVsTrueEta_; - map hisZ0ResVsTrueEta_; - map hisD0ResVsTrueEta_; - - map hisQoverPtResVsTrueInvPt_; - map hisPhi0ResVsTrueInvPt_; - map hisEtaResVsTrueInvPt_; - map hisZ0ResVsTrueInvPt_; - map hisD0ResVsTrueInvPt_; - - map hisQoverPtResBeamVsTrueEta_; - map hisPhi0ResBeamVsTrueEta_; - map hisQoverPtResBeamVsTrueInvPt_; - map hisPhi0ResBeamVsTrueInvPt_; - - map hisFitEfficiencyVsChi2Dof_; - map hisNumStubsVsChi2Dof_; - map hisNumLayersVsChi2Dof_; - map hisAvgNumStubsPerLayerVsChi2Dof_; - - map profDupFitTrksVsEta_; - map profDupFitTrksVsInvPt_; - - // Histograms used for efficiency plots made with fitted tracks. - map hisFitTPinvptForEff_; - map hisFitTPptForEff_; - map hisFitTPetaForEff_; - map hisFitTPphiForEff_; - map hisPerfFitTPinvptForEff_; - map hisPerfFitTPptForEff_; - map hisPerfFitTPetaForEff_; - map hisFitTPd0ForEff_; - map hisFitTPz0ForEff_; - map hisFitTPinvptForAlgEff_; - map hisFitTPptForAlgEff_; - map hisFitTPetaForAlgEff_; - map hisFitTPphiForAlgEff_; - map hisPerfFitTPinvptForAlgEff_; - map hisPerfFitTPptForAlgEff_; - map hisPerfFitTPetaForAlgEff_; - map hisFitTPd0ForAlgEff_; - map hisFitTPz0ForAlgEff_; - map hisFitTPphisecForAlgEff_; - map hisFitTPetasecForAlgEff_; - map hisPerfFitTPphisecForAlgEff_; - map hisPerfFitTPetasecForAlgEff_; - map hisPerfFitTPinvptForAlgEff_inJetPtG30_; - map hisPerfFitTPinvptForAlgEff_inJetPtG100_; - map hisPerfFitTPinvptForAlgEff_inJetPtG200_; - - // Histograms of tracking efficiency & fake rate after Hough transform or after r-z track filter. - map teffEffVsInvPt_; - map teffEffVsPt_; - map teffEffVsEta_; - map teffEffVsPhi_; - // - map teffPerfEffVsInvPt_; - map teffPerfEffVsPt_; - map teffPerfEffVsEta_; - // - map teffEffVsD0_; - map teffEffVsZ0_; - // - map teffAlgEffVsInvPt_; - map teffAlgEffVsPt_; - map teffAlgEffVsEta_; - map teffAlgEffVsPhi_; - map teffAlgEffVsInvPt_inJetPtG30_; - map teffAlgEffVsInvPt_inJetPtG100_; - map teffAlgEffVsInvPt_inJetPtG200_; - // - map teffPerfAlgEffVsInvPt_; - map teffPerfAlgEffVsPt_; - map teffPerfAlgEffVsEta_; - // - map teffAlgEffVsD0_; - map teffAlgEffVsZ0_; - // - map teffAlgEffVsPhiSec_; - map teffAlgEffVsEtaSec_; - map teffPerfAlgEffVsPhiSec_; - map teffPerfAlgEffVsEtaSec_; - - // Histograms of tracking efficiency & fake rate after Hough transform based on tracks after the track fit. - map teffEffFitVsInvPt_; - map teffEffFitVsPt_; - map teffEffFitVsEta_; - map teffEffFitVsPhi_; - // - map teffPerfEffFitVsInvPt_; - map teffPerfEffFitVsPt_; - map teffPerfEffFitVsEta_; - // - map teffEffFitVsD0_; - map teffEffFitVsZ0_; - // - map teffAlgEffFitVsInvPt_; - map teffAlgEffFitVsPt_; - map teffAlgEffFitVsEta_; - map teffAlgEffFitVsPhi_; - // - map teffPerfAlgEffFitVsInvPt_; - map teffPerfAlgEffFitVsPt_; - map teffPerfAlgEffFitVsEta_; - map teffPerfAlgEffFitVsInvPt_inJetPtG30_; - map teffPerfAlgEffFitVsInvPt_inJetPtG100_; - map teffPerfAlgEffFitVsInvPt_inJetPtG200_; - // - map teffAlgEffFitVsD0_; - map teffAlgEffFitVsZ0_; - // - map teffAlgEffFitVsPhiSec_; - map teffAlgEffFitVsEtaSec_; - map teffPerfAlgEffFitVsPhiSec_; - map teffPerfAlgEffFitVsEtaSec_; - - bool plotFirst_; - - // Number of genuine reconstructed and perfectly reconstructed tracks which were fitted. - map numFitAlgEff_; - map numFitPerfAlgEff_; - - // Number of genuine reconstructed and perfectly reconstructed tracks which were fitted post-cut. - map numFitAlgEffPass_; - map numFitPerfAlgEffPass_; - - // Range in r of each barrel layer. - map mapBarrelLayerMinR_; - map mapBarrelLayerMaxR_; - // Range in z of each endcap wheel. - map mapEndcapWheelMinZ_; - map mapEndcapWheelMaxZ_; - - // Range in (r,z) of each module type. - map mapModuleTypeMinR_; - map mapModuleTypeMaxR_; - map mapModuleTypeMinZ_; - map mapModuleTypeMaxZ_; - // Extra maps for wierd barrel layers 1-2 & endcap wheels 3-5. - map mapExtraAModuleTypeMinR_; - map mapExtraAModuleTypeMaxR_; - map mapExtraAModuleTypeMinZ_; - map mapExtraAModuleTypeMaxZ_; - map mapExtraBModuleTypeMinR_; - map mapExtraBModuleTypeMaxR_; - map mapExtraBModuleTypeMinZ_; - map mapExtraBModuleTypeMaxZ_; - map mapExtraCModuleTypeMinR_; - map mapExtraCModuleTypeMaxR_; - map mapExtraCModuleTypeMinZ_; - map mapExtraCModuleTypeMaxZ_; - map mapExtraDModuleTypeMinR_; - map mapExtraDModuleTypeMaxR_; - map mapExtraDModuleTypeMinZ_; - map mapExtraDModuleTypeMaxZ_; - - bool bApproxMistake_; -}; - -} + class InputData; + class TP; + class Sector; + class HTrphi; + class Get3Dtracks; + class L1fittedTrack; + class L1fittedTrk4and5; + + class Histos { + public: + // Store cfg parameters. + Histos(const Settings* settings); + + virtual ~Histos() {} + + // Book & fill all histograms. + virtual void book(); + virtual void fill(const InputData& inputData, + const matrix& mSectors, + const matrix& mHtPhis, + const matrix mGet3Dtrks, + const std::map>& fittedTracks); + + // Print tracking performance summary & make tracking efficiency histograms. + virtual void endJobAnalysis(); + + // Determine "B" parameter, used in GP firmware to allow for tilted modules. + virtual void trackerGeometryAnalysis(const TrackerGeometryInfo trackerGeometryInfo); + + // Did user request output histograms via the TFileService in their cfg? + virtual bool available() const { return fs_.isAvailable(); } + + // Should histograms be produced? + virtual bool enabled() const { return (settings_->enableHistos() && available()); } + + protected: + // Book histograms for specific topics. + virtual TFileDirectory bookInputData(); + virtual TFileDirectory bookEtaPhiSectors(); + virtual TFileDirectory bookRphiHT(); + virtual TFileDirectory bookRZfilters(); + virtual TFileDirectory bookStudyBusyEvents(); + virtual TFileDirectory bookTrackCands(string tName); + virtual map bookTrackFitting(); + + // Fill histograms for specific topics. + virtual void fillInputData(const InputData& inputData); + virtual void fillEtaPhiSectors(const InputData& inputData, const matrix& mSectors); + virtual void fillRphiHT(const matrix& mHtRphis); + virtual void fillRZfilters(const matrix& mGet3Dtrks); + virtual void fillStudyBusyEvents(const InputData& inputData, + const matrix& mSectors, + const matrix& mHtRphis, + const matrix& mGet3Dtrks); + virtual void fillTrackCands(const InputData& inputData, const vector& tracks, string tName); + virtual void fillTrackFitting(const InputData& inputData, + const std::map>& fittedTracks); + + // Produce plots of tracking efficiency after HZ or after r-z track filter (run at end of job) + virtual TFileDirectory plotTrackEfficiency(string tName); + // Produce plots of tracking efficiency after track fit (run at end of job). + virtual TFileDirectory plotTrackEffAfterFit(string fitName); + + // For Hybrid tracking + // Produce plots of tracklet seed finding efficiency before track reco + virtual void plotTrackletSeedEfficiency(){}; + // Produce plots of hybrid duplicate removal efficiency after track reco + virtual void plotHybridDupRemovalEfficiency(){}; + + virtual void makeEfficiencyPlot( + TFileDirectory& inputDir, TEfficiency* outputEfficiency, TH1F* pass, TH1F* all, TString name, TString title); + + // Print summary of track-finding performance after track pattern reco. + virtual void printTrackPerformance(string tName); + + // Print summary of track-finding performance after helix fit for given track fitter. + virtual void printFitTrackPerformance(string fitName); + + // For Hybrid tracking + // Print summary of seed finding and extrapolation performance during track pattern reco. + virtual void printTrackletSeedFindingPerformance(){}; + + // Print summary of duplicate removal performance after track pattern reco. + virtual void printHybridDupRemovalPerformance(){}; + + // Understand why not all tracking particles were reconstructed. + // Returns list of tracking particles that were not reconstructed and an integer indicating why. + // Only considers TP used for algorithmic efficiency measurement. + virtual map diagnoseTracking(const vector& allTPs, + const vector& tracks, + bool withRZfilter) const; + + protected: + // Configuration parameters. + const Settings* settings_; + unsigned int genMinStubLayers_; + unsigned int numPhiSectors_; + unsigned int numEtaRegions_; + float houghMinPt_; + unsigned int houghNbinsPt_; + unsigned int houghNbinsPhi_; + float chosenRofZ_; + vector trackFitters_; + vector useRZfilter_; + bool ranRZfilter_; + bool resPlotOpt_; + + edm::Service fs_; + + // Histograms of input data. + TH1F* hisNumEvents_; + TProfile* profNumStubs_; + TH1F* hisStubsVsEta_; + TH1F* hisStubsVsR_; + TH2F* hisStubsVsRVsZ_; + TH2F* hisStubsModuleVsRVsZ_; + TH2F* hisStubsModuleTiltVsZ_; + TH2F* hisStubsdPhiCorrectionVsZ_; + TH2F* hisStubsVsRVsPhi_; + TH2F* hisStubsModuleVsRVsPhi_; + + TH2F* hisStubsVsRVsZ_outerModuleAtSmallerR_; + TH2F* hisStubsVsRVsPhi_outerModuleAtSmallerR_; + + TProfile* profNumTPs_; + TH1F* hisNumStubsPerTP_; + TH1F* hisNumPSStubsPerTP_; + TH1F* hisNum2SStubsPerTP_; + TH1F* hisNumLayersPerTP_; + TH1F* hisNumPSLayersPerTP_; + TH1F* hisNum2SLayersPerTP_; + + TH1F* hisNumLayersPerTP_lowPt_; + TH1F* hisNumPSLayersPerTP_lowPt_; + TH1F* hisNum2SLayersPerTP_lowPt_; + + TH1F* hisNumLayersPerTP_mediumPt_; + TH1F* hisNumPSLayersPerTP_mediumPt_; + TH1F* hisNum2SLayersPerTP_mediumPt_; + + TH1F* hisNumLayersPerTP_highPt_; + TH1F* hisNumPSLayersPerTP_highPt_; + TH1F* hisNum2SLayersPerTP_highPt_; + + TH1F* hisNumLayersPerTP_muons_; + TH1F* hisNumPSLayersPerTP_muons_; + TH1F* hisNum2SLayersPerTP_muons_; + + TH1F* hisNumLayersPerTP_electrons_; + TH1F* hisNumPSLayersPerTP_electrons_; + TH1F* hisNum2SLayersPerTP_electrons_; + + TH1F* hisNumLayersPerTP_pions_; + TH1F* hisNumPSLayersPerTP_pions_; + TH1F* hisNum2SLayersPerTP_pions_; + + TProfile* hisStubKillFE_; + TProfile* hisStubIneffiVsInvPt_; + TProfile* hisStubIneffiVsEta_; + TProfile* hisStubKillDegradeBend_; + TH1F* hisPtStub_; + TH1F* hisPtResStub_; + TH1F* hisBendFilterPower_; + TH1F* hisDelPhiStub_; + TH1F* hisDelPhiResStub_; + TH1F* hisDelPhiResStub_tilted_; + TH1F* hisDelPhiResStub_notTilted_; + TH1F* hisBendStub_; + TH1F* hisBendResStub_; + TH1F* hisNumMergedBend_; + TH2F* hisBendVsLayerOrRingPS_; + TH2F* hisBendVsLayerOrRing2S_; + TH2F* hisBendFEVsLayerOrRingPS_; + TH2F* hisBendFEVsLayerOrRing2S_; + TH1F* hisPhiStubVsPhiTP_; + TH1F* hisPhiStubVsPhi0TP_; + TH1F* hisPhi0StubVsPhi0TP_; + TH1F* hisPhi0StubVsPhi0TPres_; + TH1F* hisPhiStubVsPhi65TP_; + TH1F* hisPhi65StubVsPhi65TP_; + TH1F* hisPhi65StubVsPhi65TPres_; + TH1F* hisPitchOverSep_; + TH1F* hisRhoParameter_; + TH2F* hisAlphaCheck_; + TH1F* hisFracStubsSharingClus0_; + TH1F* hisFracStubsSharingClus1_; + + // Histograms of B + TH1F* hisStubB_; + TH1F* hisStubBApproxDiff_tilted_; + TGraph* graphBVsZoverR_; + + // Histograms checking that (eta,phi) sector definition is good. + TH1F* hisFracStubsInSec_; + TH1F* hisFracStubsInEtaSec_; + TH1F* hisFracStubsInPhiSec_; + TH1F* hisNumSecsPerStub_; + TH1F* hisNumEtaSecsPerStub_; + TH1F* hisNumPhiSecsPerStub_; + TH1F* hisNumStubsPerSec_; + TProfile* profNumStubsPerEtaSec_; + TH2F* hisLayerIDvsEtaSec_; + TH2F* hisLayerIDreducedvsEtaSec_; + + // Histograms checking filling of r-phi HT array. + TH2Poly* hisArrayHT_; + TF1* hisStubHT_; + TH1F* hisIncStubsPerHT_; + TH1F* hisExcStubsPerHT_; + TH2F* hisNumStubsInCellVsEta_; + TH1F* hisStubsOnRphiTracksPerHT_; + TH1F* hisHTstubsPerTrack_; + TH1F* hisHTmBin_; + TH1F* hisHTcBin_; + + // Histograms about r-z track filters (or other filters applied after r-phi HT array). + TH1F* hisNumZtrkSeedCombinations_; + TH1F* hisNumSeedCombinations_; + TH1F* hisNumGoodSeedCombinations_; + TH1F* hisCorrelationZTrk_; + + // Histograms for studying freak, large events with too many stubs. + TH1F* hisNumBusySecsInPerEvent_; + TH1F* hisNumBusySecsOutPerEvent_; + TProfile* profFracBusyInVsEtaReg_; + TProfile* profFracBusyOutVsEtaReg_; + TProfile* profFracStubsKilledVsEtaReg_; + TProfile* profFracTracksKilledVsEtaReg_; + TProfile* profFracTracksKilledVsInvPt_; + TProfile* profFracTPKilledVsEta_; + TProfile* profFracTPKilledVsInvPt_; + TH1F* hisNumTPkilledBusySec_; + map hisNumInputStubs_; + map hisQoverPtInputStubs_; + map hisNumOutputStubs_; + map hisNumTracks_; + map hisNumStubsPerTrack_; + map hisTrackQoverPt_; + map hisTrackPurity_; + map hisNumTPphysics_; + map hisNumTPpileup_; + map hisSumPtTPphysics_; + map hisSumPtTPpileup_; + + // Histograms studying 3D track candidates found by Hough Transform or r-z Track Filter. + map profNumTrackCands_; + map profNumTracksVsEta_; + map hisNumTracksVsQoverPt_; + map hisNumTrksPerSect_; + map hisNumTrksPerNon_; + map profStubsOnTracks_; + map profStubsOnTracksVsEta_; + map hisStubsOnTracksPerSect_; + map hisStubsOnTracksPerNon_; + map hisUniqueStubsOnTrksPerSect_; + map hisUniqueStubsOnTrksPerNon_; + map hisStubsPerTrack_; + map hisLayersPerTrack_; + map hisPSLayersPerTrack_; + map hisLayersPerTrueTrack_; + map hisPSLayersPerTrueTrack_; + + map hisNumStubsPerLink_; + map hisNumStubsVsLink_; + map profMeanStubsPerLink_; + map hisNumTrksPerLink_; + map hisNumTrksVsLink_; + map profMeanTrksPerLink_; + + map profExcessStubsPerTrackVsPt_; + map hisFracMatchStubsOnTracks_; + map hisDeltaBendTrue_; + map hisDeltaBendFake_; + map profFracTrueStubsVsLayer_; + map profDupTracksVsEta_; + map profDupTracksVsInvPt_; + //map hisWrongSignStubRZ_pBend_; + //map hisWrongSignStubRZ_nBend_; + + // Histos of track params after HT. + map hisQoverPt_; + map hisPhi0_; + map hisEta_; + map hisZ0_; + + // Histograms of track parameter resolution after HT transform. + map hisQoverPtRes_; + map hisPhi0Res_; + map hisEtaRes_; + map hisZ0Res_; + + map hisRecoVsTrueQinvPt_; + map hisRecoVsTruePhi0_; + map hisRecoVsTrueD0_; + map hisRecoVsTrueZ0_; + map hisRecoVsTrueEta_; + + // Diagnosis of failed tracking. + map hisRecoFailureReason_; + map hisRecoFailureLayer_; + + map hisNumStubsOnLayer_; + + // Histos used for denominator of tracking efficiency plots. + TH1F* hisTPinvptForEff_; + TH1F* hisTPptForEff_; + TH1F* hisTPetaForEff_; + TH1F* hisTPphiForEff_; + TH1F* hisTPd0ForEff_; + TH1F* hisTPz0ForEff_; + // + TH1F* hisTPinvptForAlgEff_; + TH1F* hisTPptForAlgEff_; + TH1F* hisTPetaForAlgEff_; + TH1F* hisTPphiForAlgEff_; + TH1F* hisTPd0ForAlgEff_; + TH1F* hisTPz0ForAlgEff_; + // + TH1F* hisTPphisecForAlgEff_; + TH1F* hisTPetasecForAlgEff_; + TH1F* hisTPinvptForAlgEff_inJetPtG30_; + TH1F* hisTPinvptForAlgEff_inJetPtG100_; + TH1F* hisTPinvptForAlgEff_inJetPtG200_; + + // Histograms used to make efficiency plots with 3D track candidates prior to fit. + map hisRecoTPinvptForEff_; + map hisRecoTPptForEff_; + map hisRecoTPetaForEff_; + map hisRecoTPphiForEff_; + // + map hisPerfRecoTPinvptForEff_; + map hisPerfRecoTPptForEff_; + map hisPerfRecoTPetaForEff_; + // + map hisRecoTPd0ForEff_; + map hisRecoTPz0ForEff_; + // + map hisRecoTPinvptForAlgEff_; + map hisRecoTPptForAlgEff_; + map hisRecoTPetaForAlgEff_; + map hisRecoTPphiForAlgEff_; + // + map hisPerfRecoTPinvptForAlgEff_; + map hisPerfRecoTPptForAlgEff_; + map hisPerfRecoTPetaForAlgEff_; + // + map hisRecoTPd0ForAlgEff_; + map hisRecoTPz0ForAlgEff_; + // + map hisRecoTPphisecForAlgEff_; + map hisPerfRecoTPphisecForAlgEff_; + map hisRecoTPetasecForAlgEff_; + map hisPerfRecoTPetasecForAlgEff_; + + map hisRecoTPinvptForAlgEff_inJetPtG30_; + map hisRecoTPinvptForAlgEff_inJetPtG100_; + map hisRecoTPinvptForAlgEff_inJetPtG200_; + + // Histograms for track fitting evaluation, where map index specifies name of track fitting algorithm used. + + map profNumFitTracks_; + map hisNumFitTrks_; + map hisNumFitTrksPerNon_; + map hisNumFitTrksPerSect_; + + map hisStubsPerFitTrack_; + map profStubsOnFitTracks_; + + map hisFitQinvPtMatched_; + map hisFitPhi0Matched_; + map hisFitD0Matched_; + map hisFitZ0Matched_; + map hisFitEtaMatched_; + + map hisFitQinvPtUnmatched_; + map hisFitPhi0Unmatched_; + map hisFitD0Unmatched_; + map hisFitZ0Unmatched_; + map hisFitEtaUnmatched_; + + map hisKalmanNumUpdateCalls_; + map hisKalmanChi2DofSkipLay0Matched_; + map hisKalmanChi2DofSkipLay1Matched_; + map hisKalmanChi2DofSkipLay2Matched_; + map hisKalmanChi2DofSkipLay0Unmatched_; + map hisKalmanChi2DofSkipLay1Unmatched_; + map hisKalmanChi2DofSkipLay2Unmatched_; + + map hisFitChi2Matched_; + map hisFitChi2DofMatched_; + map hisFitChi2DofRphiMatched_; + map hisFitChi2DofRzMatched_; + map hisFitBeamChi2Matched_; + map hisFitBeamChi2DofMatched_; + map profFitChi2VsEtaMatched_; + map profFitChi2DofVsEtaMatched_; + map profFitChi2VsInvPtMatched_; + map profFitChi2DofVsInvPtMatched_; + map profFitChi2VsTrueD0Matched_; + map profFitChi2DofVsTrueD0Matched_; + map hisFitChi2PerfMatched_; + map hisFitChi2DofPerfMatched_; + + map hisFitChi2Unmatched_; + map hisFitChi2DofUnmatched_; + map hisFitChi2DofRphiUnmatched_; + map hisFitChi2DofRzUnmatched_; + map hisFitBeamChi2Unmatched_; + map hisFitBeamChi2DofUnmatched_; + map profFitChi2VsEtaUnmatched_; + map profFitChi2DofVsEtaUnmatched_; + map profFitChi2VsInvPtUnmatched_; + map profFitChi2DofVsInvPtUnmatched_; + + map profFitChi2VsPurity_; + map profFitChi2DofVsPurity_; + + map hisDeltaPhitruePSbarrel_; + map hisDeltaRorZtruePSbarrel_; + map hisDeltaPhitrue2Sbarrel_; + map hisDeltaRorZtrue2Sbarrel_; + map hisDeltaPhitruePSendcap_; + map hisDeltaRorZtruePSendcap_; + map hisDeltaPhitrue2Sendcap_; + map hisDeltaRorZtrue2Sendcap_; + map hisDeltaPhifakePSbarrel_; + map hisDeltaRorZfakePSbarrel_; + map hisDeltaPhifake2Sbarrel_; + map hisDeltaRorZfake2Sbarrel_; + map hisDeltaPhifakePSendcap_; + map hisDeltaRorZfakePSendcap_; + map hisDeltaPhifake2Sendcap_; + map hisDeltaRorZfake2Sendcap_; + map profRecalcRphiChi2VsEtaTrue1_; + map profRecalcRzChi2VsEtaTrue1_; + map profRecalcChi2VsEtaTrue1_; + map profRecalcChi2VsEtaTrue2_; + map profNsigmaPhivsInvPt_; + map profNsigmaPhivsR_; + map profNsigmaPhivsTanl_; + + map hisFitVsSeedQinvPtMatched_; + map hisFitVsSeedPhi0Matched_; + map hisFitVsSeedD0Matched_; + map hisFitVsSeedZ0Matched_; + map hisFitVsSeedEtaMatched_; + + map hisFitVsSeedQinvPtUnmatched_; + map hisFitVsSeedPhi0Unmatched_; + map hisFitVsSeedD0Unmatched_; + map hisFitVsSeedZ0Unmatched_; + map hisFitVsSeedEtaUnmatched_; + + map hisNumStubsVsPurityMatched_; + map profFitFracTrueStubsVsLayerMatched_; + map profFitFracTrueStubsVsEtaMatched_; + + map hisFitVsTrueQinvPt_; + map hisFitVsTruePhi0_; + map hisFitVsTrueD0_; + map hisFitVsTrueZ0_; + map hisFitVsTrueEta_; + + map hisFitQinvPtRes_; + map hisFitPhi0Res_; + map hisFitD0Res_; + map hisFitZ0Res_; + map hisFitEtaRes_; + + map hisQoverPtResVsTrueEta_; + map hisPhi0ResVsTrueEta_; + map hisEtaResVsTrueEta_; + map hisZ0ResVsTrueEta_; + map hisD0ResVsTrueEta_; + + map hisQoverPtResVsTrueInvPt_; + map hisPhi0ResVsTrueInvPt_; + map hisEtaResVsTrueInvPt_; + map hisZ0ResVsTrueInvPt_; + map hisD0ResVsTrueInvPt_; + + map hisQoverPtResBeamVsTrueEta_; + map hisPhi0ResBeamVsTrueEta_; + map hisQoverPtResBeamVsTrueInvPt_; + map hisPhi0ResBeamVsTrueInvPt_; + + map hisFitEfficiencyVsChi2Dof_; + map hisNumStubsVsChi2Dof_; + map hisNumLayersVsChi2Dof_; + map hisAvgNumStubsPerLayerVsChi2Dof_; + + map profDupFitTrksVsEta_; + map profDupFitTrksVsInvPt_; + + // Histograms used for efficiency plots made with fitted tracks. + map hisFitTPinvptForEff_; + map hisFitTPptForEff_; + map hisFitTPetaForEff_; + map hisFitTPphiForEff_; + map hisPerfFitTPinvptForEff_; + map hisPerfFitTPptForEff_; + map hisPerfFitTPetaForEff_; + map hisFitTPd0ForEff_; + map hisFitTPz0ForEff_; + map hisFitTPinvptForAlgEff_; + map hisFitTPptForAlgEff_; + map hisFitTPetaForAlgEff_; + map hisFitTPphiForAlgEff_; + map hisPerfFitTPinvptForAlgEff_; + map hisPerfFitTPptForAlgEff_; + map hisPerfFitTPetaForAlgEff_; + map hisFitTPd0ForAlgEff_; + map hisFitTPz0ForAlgEff_; + map hisFitTPphisecForAlgEff_; + map hisFitTPetasecForAlgEff_; + map hisPerfFitTPphisecForAlgEff_; + map hisPerfFitTPetasecForAlgEff_; + map hisPerfFitTPinvptForAlgEff_inJetPtG30_; + map hisPerfFitTPinvptForAlgEff_inJetPtG100_; + map hisPerfFitTPinvptForAlgEff_inJetPtG200_; + + // Histograms of tracking efficiency & fake rate after Hough transform or after r-z track filter. + map teffEffVsInvPt_; + map teffEffVsPt_; + map teffEffVsEta_; + map teffEffVsPhi_; + // + map teffPerfEffVsInvPt_; + map teffPerfEffVsPt_; + map teffPerfEffVsEta_; + // + map teffEffVsD0_; + map teffEffVsZ0_; + // + map teffAlgEffVsInvPt_; + map teffAlgEffVsPt_; + map teffAlgEffVsEta_; + map teffAlgEffVsPhi_; + map teffAlgEffVsInvPt_inJetPtG30_; + map teffAlgEffVsInvPt_inJetPtG100_; + map teffAlgEffVsInvPt_inJetPtG200_; + // + map teffPerfAlgEffVsInvPt_; + map teffPerfAlgEffVsPt_; + map teffPerfAlgEffVsEta_; + // + map teffAlgEffVsD0_; + map teffAlgEffVsZ0_; + // + map teffAlgEffVsPhiSec_; + map teffAlgEffVsEtaSec_; + map teffPerfAlgEffVsPhiSec_; + map teffPerfAlgEffVsEtaSec_; + + // Histograms of tracking efficiency & fake rate after Hough transform based on tracks after the track fit. + map teffEffFitVsInvPt_; + map teffEffFitVsPt_; + map teffEffFitVsEta_; + map teffEffFitVsPhi_; + // + map teffPerfEffFitVsInvPt_; + map teffPerfEffFitVsPt_; + map teffPerfEffFitVsEta_; + // + map teffEffFitVsD0_; + map teffEffFitVsZ0_; + // + map teffAlgEffFitVsInvPt_; + map teffAlgEffFitVsPt_; + map teffAlgEffFitVsEta_; + map teffAlgEffFitVsPhi_; + // + map teffPerfAlgEffFitVsInvPt_; + map teffPerfAlgEffFitVsPt_; + map teffPerfAlgEffFitVsEta_; + map teffPerfAlgEffFitVsInvPt_inJetPtG30_; + map teffPerfAlgEffFitVsInvPt_inJetPtG100_; + map teffPerfAlgEffFitVsInvPt_inJetPtG200_; + // + map teffAlgEffFitVsD0_; + map teffAlgEffFitVsZ0_; + // + map teffAlgEffFitVsPhiSec_; + map teffAlgEffFitVsEtaSec_; + map teffPerfAlgEffFitVsPhiSec_; + map teffPerfAlgEffFitVsEtaSec_; + + bool plotFirst_; + + // Number of genuine reconstructed and perfectly reconstructed tracks which were fitted. + map numFitAlgEff_; + map numFitPerfAlgEff_; + + // Number of genuine reconstructed and perfectly reconstructed tracks which were fitted post-cut. + map numFitAlgEffPass_; + map numFitPerfAlgEffPass_; + + // Range in r of each barrel layer. + map mapBarrelLayerMinR_; + map mapBarrelLayerMaxR_; + // Range in z of each endcap wheel. + map mapEndcapWheelMinZ_; + map mapEndcapWheelMaxZ_; + + // Range in (r,z) of each module type. + map mapModuleTypeMinR_; + map mapModuleTypeMaxR_; + map mapModuleTypeMinZ_; + map mapModuleTypeMaxZ_; + // Extra maps for wierd barrel layers 1-2 & endcap wheels 3-5. + map mapExtraAModuleTypeMinR_; + map mapExtraAModuleTypeMaxR_; + map mapExtraAModuleTypeMinZ_; + map mapExtraAModuleTypeMaxZ_; + map mapExtraBModuleTypeMinR_; + map mapExtraBModuleTypeMaxR_; + map mapExtraBModuleTypeMinZ_; + map mapExtraBModuleTypeMaxZ_; + map mapExtraCModuleTypeMinR_; + map mapExtraCModuleTypeMaxR_; + map mapExtraCModuleTypeMinZ_; + map mapExtraCModuleTypeMaxZ_; + map mapExtraDModuleTypeMinR_; + map mapExtraDModuleTypeMaxR_; + map mapExtraDModuleTypeMinZ_; + map mapExtraDModuleTypeMaxZ_; + + bool bApproxMistake_; + }; + +} // namespace TMTT #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/InputData.h b/L1Trigger/TrackFindingTMTT/interface/InputData.h index f62dd597a0b6d..3a41f17adb86d 100644 --- a/L1Trigger/TrackFindingTMTT/interface/InputData.h +++ b/L1Trigger/TrackFindingTMTT/interface/InputData.h @@ -12,55 +12,53 @@ using namespace std; namespace TMTT { -class Settings; + class Settings; -//=== Unpacks stub & tracking particle (truth) data into user-friendlier format in Stub & TP classes. -//=== Also makes B-field available to Settings class. + //=== Unpacks stub & tracking particle (truth) data into user-friendlier format in Stub & TP classes. + //=== Also makes B-field available to Settings class. -class InputData { + class InputData { + public: + InputData(const edm::Event& iEvent, + const edm::EventSetup& iSetup, + Settings* settings, + const edm::EDGetTokenT tpInputTag, + const edm::EDGetTokenT stubInputTag, + const edm::EDGetTokenT stubTruthInputTag, + const edm::EDGetTokenT clusterTruthInputTag, + const edm::EDGetTokenT genJetInputTag); -public: - - InputData(const edm::Event& iEvent, const edm::EventSetup& iSetup, Settings* settings, - const edm::EDGetTokenT tpInputTag, - const edm::EDGetTokenT stubInputTag, - const edm::EDGetTokenT stubTruthInputTag, - const edm::EDGetTokenT clusterTruthInputTag, - const edm::EDGetTokenT< reco::GenJetCollection > genJetInputTag - ); + // Get tracking particles + const vector& getTPs() const { return vTPs_; } + // Get stubs that would be output by the front-end readout electronics + const vector& getStubs() const { return vStubs_; } - // Get tracking particles - const vector& getTPs() const {return vTPs_;} - // Get stubs that would be output by the front-end readout electronics - const vector& getStubs() const {return vStubs_;} + //--- of minor importance ... - //--- of minor importance ... + // Get number of stubs prior to applying tighted front-end readout electronics cuts specified in section StubCuts of Analyze_Defaults_cfi.py. (Only used to measure the efficiency of these cuts). + const vector& getAllStubs() const { return vAllStubs_; } - // Get number of stubs prior to applying tighted front-end readout electronics cuts specified in section StubCuts of Analyze_Defaults_cfi.py. (Only used to measure the efficiency of these cuts). - const vector& getAllStubs() const {return vAllStubs_;} + private: + // const edm::EDGetTokenT inputTag; -private: - // const edm::EDGetTokenT inputTag; + // Can optionally be used to sort stubs by bend. + struct SortStubsInBend { + inline bool operator()(const Stub* stub1, const Stub* stub2) { + return (fabs(stub1->bend()) < fabs(stub2->bend())); + } + }; - // Can optionally be used to sort stubs by bend. - struct SortStubsInBend { - inline bool operator() (const Stub* stub1, const Stub* stub2) { - return(fabs(stub1->bend()) < fabs(stub2->bend())); - } - }; - -private: - - bool enableMCtruth_; // Notes if job will use MC truth info. + private: + bool enableMCtruth_; // Notes if job will use MC truth info. - vector vTPs_; // tracking particles - vector vStubs_; // stubs that would be output by the front-end readout electronics. + vector vTPs_; // tracking particles + vector vStubs_; // stubs that would be output by the front-end readout electronics. - //--- of minor importance ... + //--- of minor importance ... - vector vAllStubs_; // all stubs, even those that would fail any tightened front-end readout electronic cuts specified in section StubCuts of Analyze_Defaults_cfi.py. (Only used to measure the efficiency of these cuts). -}; + vector + vAllStubs_; // all stubs, even those that would fail any tightened front-end readout electronic cuts specified in section StubCuts of Analyze_Defaults_cfi.py. (Only used to measure the efficiency of these cuts). + }; -} +} // namespace TMTT #endif - diff --git a/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h b/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h index bd8ab7c19bb82..cffe3d281596a 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h +++ b/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h @@ -1,43 +1,41 @@ ///=== This is the Kalman Combinatorial Filter for 4 & 5 helix parameters track fit algorithm. - + #ifndef __KFPARAMSCOMB__ #define __KFPARAMSCOMB__ - + #include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" #include #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" namespace TMTT { -class KFParamsComb : public L1KalmanComb { - - public: - enum PAR_IDS { INV2R, PHI0, T, Z0, D0 }; - enum MEAS_IDS { PHI, Z }; - public: - KFParamsComb(const Settings* settings, const uint nPar, const string &fitterName ); - virtual ~KFParamsComb(){} - - protected: - virtual std::map getTrackParams(const KalmanState *state )const; - virtual std::map getTrackParams_BeamConstr(const KalmanState *state, double& chi2rphi) const; - virtual std::vector seedx(const L1track3D& l1track3D)const; - virtual TMatrixD seedP(const L1track3D& l1track3D)const; - virtual std::vector d(const StubCluster* stubCluster )const; - virtual TMatrixD H(const StubCluster* stubCluster)const; - virtual TMatrixD dH(const StubCluster* stubCluster)const; - virtual TMatrixD F(const StubCluster* stubCluster=0, const KalmanState *state = 0)const; - virtual TMatrixD PxxModel( const KalmanState *state, const StubCluster *stubCluster )const; - virtual TMatrixD PddMeas(const StubCluster* stubCluster, const KalmanState *state )const; - virtual bool isGoodState( const KalmanState &state )const; - - private: - std::vector mapToVec(std::map x)const; - std::map vecToMap(std::vector x)const; -}; - -} + class KFParamsComb : public L1KalmanComb { + public: + enum PAR_IDS { INV2R, PHI0, T, Z0, D0 }; + enum MEAS_IDS { PHI, Z }; -#endif + public: + KFParamsComb(const Settings* settings, const uint nPar, const string& fitterName); + virtual ~KFParamsComb() {} + protected: + virtual std::map getTrackParams(const KalmanState* state) const; + virtual std::map getTrackParams_BeamConstr(const KalmanState* state, double& chi2rphi) const; + virtual std::vector seedx(const L1track3D& l1track3D) const; + virtual TMatrixD seedP(const L1track3D& l1track3D) const; + virtual std::vector d(const StubCluster* stubCluster) const; + virtual TMatrixD H(const StubCluster* stubCluster) const; + virtual TMatrixD dH(const StubCluster* stubCluster) const; + virtual TMatrixD F(const StubCluster* stubCluster = 0, const KalmanState* state = 0) const; + virtual TMatrixD PxxModel(const KalmanState* state, const StubCluster* stubCluster) const; + virtual TMatrixD PddMeas(const StubCluster* stubCluster, const KalmanState* state) const; + virtual bool isGoodState(const KalmanState& state) const; + private: + std::vector mapToVec(std::map x) const; + std::map vecToMap(std::vector x) const; + }; + +} // namespace TMTT + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h b/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h index ed5b6546a9193..d212b57699de1 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h +++ b/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h @@ -29,228 +29,258 @@ using namespace std; namespace TMTT { -class KFTrackletTrack{ - -public: - - // Store a new fitted track, specifying the input Hough transform track, the stubs used for the fit, - // bit-encoded hit layers, - // the fitted helix parameters & chi2, - // and the number of helix parameters being fitted (=5 if d0 is fitted, or =4 if d0 is not fitted). - // Also specify phi sector and eta region used by track-finding code that this track was in. - // And if track fit declared this to be a valid track (enough stubs left on track after fit etc.). - KFTrackletTrack(const L1track3D& l1track3D, const vector& stubs, - unsigned int hitPattern, - float qOverPt, float d0, float phi0, float z0, float tanLambda, - float chi2rphi, float chi2rz, unsigned int nHelixParam, - unsigned int iPhiSec, unsigned int iEtaReg, bool accepted = true) : - l1track3D_(l1track3D), stubs_(stubs), hitPattern_(hitPattern), - qOverPt_(qOverPt), d0_(d0), phi0_(phi0), z0_(z0), tanLambda_(tanLambda), - chi2rphi_(chi2rphi), chi2rz_(chi2rz), - done_bcon_(false), qOverPt_bcon_(qOverPt), d0_bcon_(d0), phi0_bcon_(phi0), - chi2rphi_bcon_(chi2rphi), nHelixParam_(nHelixParam), - iPhiSec_(iPhiSec), iEtaReg_(iEtaReg), optoLinkID_(l1track3D.optoLinkID()), accepted_(accepted), - nSkippedLayers_(0), numUpdateCalls_(0), numIterations_(0) - { + class KFTrackletTrack { + public: + // Store a new fitted track, specifying the input Hough transform track, the stubs used for the fit, + // bit-encoded hit layers, + // the fitted helix parameters & chi2, + // and the number of helix parameters being fitted (=5 if d0 is fitted, or =4 if d0 is not fitted). + // Also specify phi sector and eta region used by track-finding code that this track was in. + // And if track fit declared this to be a valid track (enough stubs left on track after fit etc.). + KFTrackletTrack(const L1track3D& l1track3D, + const vector& stubs, + unsigned int hitPattern, + float qOverPt, + float d0, + float phi0, + float z0, + float tanLambda, + float chi2rphi, + float chi2rz, + unsigned int nHelixParam, + unsigned int iPhiSec, + unsigned int iEtaReg, + bool accepted = true) + : l1track3D_(l1track3D), + stubs_(stubs), + hitPattern_(hitPattern), + qOverPt_(qOverPt), + d0_(d0), + phi0_(phi0), + z0_(z0), + tanLambda_(tanLambda), + chi2rphi_(chi2rphi), + chi2rz_(chi2rz), + done_bcon_(false), + qOverPt_bcon_(qOverPt), + d0_bcon_(d0), + phi0_bcon_(phi0), + chi2rphi_bcon_(chi2rphi), + nHelixParam_(nHelixParam), + iPhiSec_(iPhiSec), + iEtaReg_(iEtaReg), + optoLinkID_(l1track3D.optoLinkID()), + accepted_(accepted), + nSkippedLayers_(0), + numUpdateCalls_(0), + numIterations_(0) { // Doesn't make sense to assign stubs to track if fitter rejected it. - if (! accepted) stubs_.clear(); - //nLayers_ = Utility::countLayers(settings, stubs); // Count tracker layers these stubs are in - // matchedTP_ = Utility::matchingTP(settings, stubs, nMatchedLayers_, matchedStubs_); // Find associated truth particle & calculate info about match. - // secTmp_.init(settings, iPhiSec, iEtaReg); //Sector class used to check if fitted track trajectory is in expected sector. - // htRphiTmp_.init(settings, iPhiSec, iEtaReg, secTmp_.etaMin(), secTmp_.etaMax(), secTmp_.phiCentre()); // HT class used to identify HT cell that corresponds to fitted helix parameters. - } - - KFTrackletTrack() {}; // Creates track object, but doesn't set any variables. - - ~KFTrackletTrack() {} - - //--- Optionally set track helix params & chi2 if beam-spot constraint is used (for 5-parameter fit). - void setBeamConstr(float qOverPt_bcon, float phi0_bcon, float chi2rphi_bcon) { - done_bcon_ = true; qOverPt_bcon_ = qOverPt_bcon; d0_bcon_ = 0.0, phi0_bcon_ = phi0_bcon; - chi2rphi_bcon_ = chi2rphi_bcon; - } - - //--- Set/get additional info about fitted track that is specific to individual track fit algorithms (KF, LR, chi2) - //--- and is used for debugging/histogramming purposes. - - void setInfoKF( unsigned int nSkippedLayers, unsigned int numUpdateCalls ) { - nSkippedLayers_ = nSkippedLayers; - numUpdateCalls_ = numUpdateCalls; - } - - void getInfoKF( unsigned int& nSkippedLayers, unsigned int& numUpdateCalls ) const { - nSkippedLayers = nSkippedLayers_; - numUpdateCalls = numUpdateCalls_; - } - - - const L1track3D& getL1track3D() const {return l1track3D_;} - - // Get stubs on fitted track (can differ from those on HT track if track fit kicked out stubs with bad residuals) - const vector& getStubs() const {return stubs_;} - // Get number of stubs on fitted track. - unsigned int getNumStubs() const {return stubs_.size();} - // Get number of tracker layers these stubs are in. - unsigned int getNumLayers() const {return nLayers_;} - // Get number of stubs deleted from track candidate by fitter (because they had large residuals) - unsigned int getNumKilledStubs() const {return l1track3D_.getNumStubs() - this->getNumStubs();} - - // Get bit-encoded hit pattern (where layer number assigned by increasing distance from origin, according to layers track expected to cross). - unsigned int getHitPattern() const {return hitPattern_;} - - - //--- Get the fitted track helix parameters. - - float qOverPt() const {return qOverPt_;} - float charge() const {return (qOverPt_ > 0 ? 1 : -1);} - float invPt() const {return fabs(qOverPt_);} - float pt() const {return 1./(1.0e-6 + this->invPt());} // includes protection against 1/pt = 0. - float d0() const {return d0_;} - float phi0() const {return phi0_;} - float z0() const {return z0_;} - float tanLambda() const {return tanLambda_;} - float theta() const {return atan2(1., tanLambda_);} // Use atan2 to ensure 0 < theta < pi. - float eta() const {return -log(tan(0.5*this->theta()));} - - //--- Get the fitted helix parameters with beam-spot constraint. - //--- If constraint not applied (e.g. 4 param fit) then these are identical to unconstrained values. - - bool done_bcon() const {return done_bcon_;} // Was beam-spot constraint aplied? - float qOverPt_bcon() const {return qOverPt_bcon_;} - float charge_bcon() const {return (qOverPt_bcon_ > 0 ? 1 : -1);} - float invPt_bcon() const {return fabs(qOverPt_bcon_);} - float pt_bcon() const {return 1./(1.0e-6 + this->invPt_bcon());} - float phi0_bcon() const {return phi0_bcon_;} - - // Phi and z coordinates at which track crosses "chosenR" values used by r-phi HT and rapidity sectors respectively. - // (Optionally with beam-spot constraint applied). - float phiAtChosenR(bool beamConstraint) const { - if (beamConstraint) { - return reco::deltaPhi(phi0_bcon_ - asin((settings_->invPtToDphi() * settings_->chosenRofPhi()) * qOverPt_bcon_) - d0_bcon_/(settings_->chosenRofPhi()), 0.); - } else { - return reco::deltaPhi(phi0_ - asin((settings_->invPtToDphi() * settings_->chosenRofPhi()) * qOverPt_) - d0_/(settings_->chosenRofPhi()), 0.); + if (!accepted) + stubs_.clear(); + //nLayers_ = Utility::countLayers(settings, stubs); // Count tracker layers these stubs are in + // matchedTP_ = Utility::matchingTP(settings, stubs, nMatchedLayers_, matchedStubs_); // Find associated truth particle & calculate info about match. + // secTmp_.init(settings, iPhiSec, iEtaReg); //Sector class used to check if fitted track trajectory is in expected sector. + // htRphiTmp_.init(settings, iPhiSec, iEtaReg, secTmp_.etaMin(), secTmp_.etaMax(), secTmp_.phiCentre()); // HT class used to identify HT cell that corresponds to fitted helix parameters. } - } - float zAtChosenR() const {return (z0_ + (settings_->chosenRofZ()) * tanLambda_);} // neglects transverse impact parameter & track curvature. - - // Get the number of helix parameters being fitted (=5 if d0 is fitted or =4 if d0 is not fitted). - float nHelixParam() const {return nHelixParam_;} - - // Get the fit degrees of freedom, chi2 & chi2/DOF - unsigned int numDOF() const {return 2*this->getNumStubs() - nHelixParam_;} - unsigned int numDOFrphi() const {return this->getNumStubs() - (nHelixParam_ - 2);} - unsigned int numDOFrz( ) const {return this->getNumStubs() - 2;} - float chi2rphi() const {return chi2rphi_;} - float chi2rz() const {return chi2rz_;} - float chi2() const {return chi2rphi_ + chi2rz_;} - float chi2dof() const {return (this->chi2())/this->numDOF();} - - //--- Ditto, but if beam-spot constraint is applied. - //--- If constraint not applied (e.g. 4 param fit) then these are identical to unconstrained values. - unsigned int numDOF_bcon() const {return (this->numDOF() - 1);} - unsigned int numDOFrphi_bcon() const {return (this->numDOFrphi() - 1);} - float chi2rphi_bcon() const {return chi2rphi_bcon_;} - float chi2_bcon() const {return chi2rphi_bcon_ + chi2rz_;} - float chi2dof_bcon() const {return (this->chi2_bcon())/this->numDOF_bcon();} - - //--- Get phi sector and eta region used by track finding code that this track is in. - unsigned int iPhiSec() const {return iPhiSec_;} - unsigned int iEtaReg() const {return iEtaReg_;} - - //--- Opto-link ID used to send this track from HT to Track Fitter - unsigned int optoLinkID() const {return optoLinkID_;} - - //--- Get whether the track has been rejected or accepted by the fit - - bool accepted() const { - return accepted_; - } - - // Comparitor useful for sorting tracks by q/Pt using std::sort(). - static bool qOverPtSortPredicate(const KFTrackletTrack& t1, const KFTrackletTrack t2) { return t1.qOverPt() < t2.qOverPt(); } - - //--- Functions to help eliminate duplicate tracks. - - // Is the fitted track trajectory should lie within the same HT cell in which the track was originally found? - - // Is the fitted track trajectory within the same (eta,phi) sector of the HT used to find it? - bool consistentSector() const { - bool insidePhi = (fabs(reco::deltaPhi(this->phiAtChosenR(done_bcon_), secTmp_.phiCentre())) < secTmp_.sectorHalfWidth()); - bool insideEta = (this->zAtChosenR() > secTmp_.zAtChosenR_Min() && this->zAtChosenR() < secTmp_.zAtChosenR_Max()); - return (insidePhi && insideEta); - } - - // Digitize track and degrade helix parameter resolution according to effect of digitisation. - void digitizeTrack(const string& fitterName); - - // Access to detailed info about digitized track - const DigitalTrack& digitaltrack() const { return digitalTrack_;} - -private: - - //--- Configuration parameters - const Settings* settings_; - - //--- The 3D hough-transform track candidate which was fitted. - L1track3D l1track3D_; - - //--- The stubs on the fitted track (can differ from those on HT track if fit kicked off stubs with bad residuals) - vector stubs_; - unsigned int nLayers_; - - //--- Bit-encoded hit pattern (where layer number assigned by increasing distance from origin, according to layers track expected to cross). - unsigned int hitPattern_; - - //--- The fitted helix parameters and fit chi-squared. - float qOverPt_; - float d0_; - float phi0_; - float z0_; - float tanLambda_; - float chi2rphi_; - float chi2rz_; - - //--- Ditto with beam-spot constraint applied in case of 5-parameter fit, plus boolean to indicate - bool done_bcon_; - float qOverPt_bcon_; - float d0_bcon_; - float phi0_bcon_; - float chi2rphi_bcon_; - - //--- The number of helix parameters being fitted (=5 if d0 is fitted or =4 if d0 is not fitted). - unsigned int nHelixParam_; - - //--- Phi sector and eta region used track finding code that this track was in. - unsigned int iPhiSec_; - unsigned int iEtaReg_; - //--- Opto-link ID from HT to Track Fitter. - unsigned int optoLinkID_; - - //--- Information about its association (if any) to a truth Tracking Particle. - const TP* matchedTP_; - vector matchedStubs_; - unsigned int nMatchedLayers_; - - //--- Has the track fit declared this to be a valid track? - bool accepted_; - - //--- Sector class used to check if fitted track trajectory is in same sector as HT used to find it. - Sector secTmp_; - //--- r-phi HT class used to determine HT cell location that corresponds to fitted track helix parameters. - HTrphi htRphiTmp_; - - //--- Info specific to KF fitter. - unsigned int nSkippedLayers_; - unsigned int numUpdateCalls_; - //--- Info specific to LR fitter. - int numIterations_; - std::string lostMatchingState_; - std::unordered_map< std::string, int > stateCalls_; - - bool digitizedTrack_; - DigitalTrack digitalTrack_; // Class used to digitize track if required. -}; -} + KFTrackletTrack(){}; // Creates track object, but doesn't set any variables. + + ~KFTrackletTrack() {} + + //--- Optionally set track helix params & chi2 if beam-spot constraint is used (for 5-parameter fit). + void setBeamConstr(float qOverPt_bcon, float phi0_bcon, float chi2rphi_bcon) { + done_bcon_ = true; + qOverPt_bcon_ = qOverPt_bcon; + d0_bcon_ = 0.0, phi0_bcon_ = phi0_bcon; + chi2rphi_bcon_ = chi2rphi_bcon; + } + + //--- Set/get additional info about fitted track that is specific to individual track fit algorithms (KF, LR, chi2) + //--- and is used for debugging/histogramming purposes. + + void setInfoKF(unsigned int nSkippedLayers, unsigned int numUpdateCalls) { + nSkippedLayers_ = nSkippedLayers; + numUpdateCalls_ = numUpdateCalls; + } + + void getInfoKF(unsigned int& nSkippedLayers, unsigned int& numUpdateCalls) const { + nSkippedLayers = nSkippedLayers_; + numUpdateCalls = numUpdateCalls_; + } + + const L1track3D& getL1track3D() const { return l1track3D_; } + + // Get stubs on fitted track (can differ from those on HT track if track fit kicked out stubs with bad residuals) + const vector& getStubs() const { return stubs_; } + // Get number of stubs on fitted track. + unsigned int getNumStubs() const { return stubs_.size(); } + // Get number of tracker layers these stubs are in. + unsigned int getNumLayers() const { return nLayers_; } + // Get number of stubs deleted from track candidate by fitter (because they had large residuals) + unsigned int getNumKilledStubs() const { return l1track3D_.getNumStubs() - this->getNumStubs(); } + + // Get bit-encoded hit pattern (where layer number assigned by increasing distance from origin, according to layers track expected to cross). + unsigned int getHitPattern() const { return hitPattern_; } + + //--- Get the fitted track helix parameters. + + float qOverPt() const { return qOverPt_; } + float charge() const { return (qOverPt_ > 0 ? 1 : -1); } + float invPt() const { return fabs(qOverPt_); } + float pt() const { return 1. / (1.0e-6 + this->invPt()); } // includes protection against 1/pt = 0. + float d0() const { return d0_; } + float phi0() const { return phi0_; } + float z0() const { return z0_; } + float tanLambda() const { return tanLambda_; } + float theta() const { return atan2(1., tanLambda_); } // Use atan2 to ensure 0 < theta < pi. + float eta() const { return -log(tan(0.5 * this->theta())); } + + //--- Get the fitted helix parameters with beam-spot constraint. + //--- If constraint not applied (e.g. 4 param fit) then these are identical to unconstrained values. + + bool done_bcon() const { return done_bcon_; } // Was beam-spot constraint aplied? + float qOverPt_bcon() const { return qOverPt_bcon_; } + float charge_bcon() const { return (qOverPt_bcon_ > 0 ? 1 : -1); } + float invPt_bcon() const { return fabs(qOverPt_bcon_); } + float pt_bcon() const { return 1. / (1.0e-6 + this->invPt_bcon()); } + float phi0_bcon() const { return phi0_bcon_; } + + // Phi and z coordinates at which track crosses "chosenR" values used by r-phi HT and rapidity sectors respectively. + // (Optionally with beam-spot constraint applied). + float phiAtChosenR(bool beamConstraint) const { + if (beamConstraint) { + return reco::deltaPhi(phi0_bcon_ - + asin((settings_->invPtToDphi() * settings_->chosenRofPhi()) * qOverPt_bcon_) - + d0_bcon_ / (settings_->chosenRofPhi()), + 0.); + } else { + return reco::deltaPhi(phi0_ - asin((settings_->invPtToDphi() * settings_->chosenRofPhi()) * qOverPt_) - + d0_ / (settings_->chosenRofPhi()), + 0.); + } + } + float zAtChosenR() const { + return (z0_ + (settings_->chosenRofZ()) * tanLambda_); + } // neglects transverse impact parameter & track curvature. + + // Get the number of helix parameters being fitted (=5 if d0 is fitted or =4 if d0 is not fitted). + float nHelixParam() const { return nHelixParam_; } + + // Get the fit degrees of freedom, chi2 & chi2/DOF + unsigned int numDOF() const { return 2 * this->getNumStubs() - nHelixParam_; } + unsigned int numDOFrphi() const { return this->getNumStubs() - (nHelixParam_ - 2); } + unsigned int numDOFrz() const { return this->getNumStubs() - 2; } + float chi2rphi() const { return chi2rphi_; } + float chi2rz() const { return chi2rz_; } + float chi2() const { return chi2rphi_ + chi2rz_; } + float chi2dof() const { return (this->chi2()) / this->numDOF(); } + + //--- Ditto, but if beam-spot constraint is applied. + //--- If constraint not applied (e.g. 4 param fit) then these are identical to unconstrained values. + unsigned int numDOF_bcon() const { return (this->numDOF() - 1); } + unsigned int numDOFrphi_bcon() const { return (this->numDOFrphi() - 1); } + float chi2rphi_bcon() const { return chi2rphi_bcon_; } + float chi2_bcon() const { return chi2rphi_bcon_ + chi2rz_; } + float chi2dof_bcon() const { return (this->chi2_bcon()) / this->numDOF_bcon(); } + + //--- Get phi sector and eta region used by track finding code that this track is in. + unsigned int iPhiSec() const { return iPhiSec_; } + unsigned int iEtaReg() const { return iEtaReg_; } + + //--- Opto-link ID used to send this track from HT to Track Fitter + unsigned int optoLinkID() const { return optoLinkID_; } + + //--- Get whether the track has been rejected or accepted by the fit + + bool accepted() const { return accepted_; } + + // Comparitor useful for sorting tracks by q/Pt using std::sort(). + static bool qOverPtSortPredicate(const KFTrackletTrack& t1, const KFTrackletTrack t2) { + return t1.qOverPt() < t2.qOverPt(); + } + + //--- Functions to help eliminate duplicate tracks. + + // Is the fitted track trajectory should lie within the same HT cell in which the track was originally found? + + // Is the fitted track trajectory within the same (eta,phi) sector of the HT used to find it? + bool consistentSector() const { + bool insidePhi = + (fabs(reco::deltaPhi(this->phiAtChosenR(done_bcon_), secTmp_.phiCentre())) < secTmp_.sectorHalfWidth()); + bool insideEta = (this->zAtChosenR() > secTmp_.zAtChosenR_Min() && this->zAtChosenR() < secTmp_.zAtChosenR_Max()); + return (insidePhi && insideEta); + } + + // Digitize track and degrade helix parameter resolution according to effect of digitisation. + void digitizeTrack(const string& fitterName); + + // Access to detailed info about digitized track + const DigitalTrack& digitaltrack() const { return digitalTrack_; } + + private: + //--- Configuration parameters + const Settings* settings_; + + //--- The 3D hough-transform track candidate which was fitted. + L1track3D l1track3D_; + + //--- The stubs on the fitted track (can differ from those on HT track if fit kicked off stubs with bad residuals) + vector stubs_; + unsigned int nLayers_; + + //--- Bit-encoded hit pattern (where layer number assigned by increasing distance from origin, according to layers track expected to cross). + unsigned int hitPattern_; + + //--- The fitted helix parameters and fit chi-squared. + float qOverPt_; + float d0_; + float phi0_; + float z0_; + float tanLambda_; + float chi2rphi_; + float chi2rz_; + + //--- Ditto with beam-spot constraint applied in case of 5-parameter fit, plus boolean to indicate + bool done_bcon_; + float qOverPt_bcon_; + float d0_bcon_; + float phi0_bcon_; + float chi2rphi_bcon_; + + //--- The number of helix parameters being fitted (=5 if d0 is fitted or =4 if d0 is not fitted). + unsigned int nHelixParam_; + + //--- Phi sector and eta region used track finding code that this track was in. + unsigned int iPhiSec_; + unsigned int iEtaReg_; + //--- Opto-link ID from HT to Track Fitter. + unsigned int optoLinkID_; + + //--- Information about its association (if any) to a truth Tracking Particle. + const TP* matchedTP_; + vector matchedStubs_; + unsigned int nMatchedLayers_; + + //--- Has the track fit declared this to be a valid track? + bool accepted_; + + //--- Sector class used to check if fitted track trajectory is in same sector as HT used to find it. + Sector secTmp_; + //--- r-phi HT class used to determine HT cell location that corresponds to fitted track helix parameters. + HTrphi htRphiTmp_; + + //--- Info specific to KF fitter. + unsigned int nSkippedLayers_; + unsigned int numUpdateCalls_; + //--- Info specific to LR fitter. + int numIterations_; + std::string lostMatchingState_; + std::unordered_map stateCalls_; + + bool digitizedTrack_; + DigitalTrack digitalTrack_; // Class used to digitize track if required. + }; + +} // namespace TMTT #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/KalmanState.h b/L1Trigger/TrackFindingTMTT/interface/KalmanState.h index b473c4d7d7722..74962c2e597e1 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KalmanState.h +++ b/L1Trigger/TrackFindingTMTT/interface/KalmanState.h @@ -1,6 +1,6 @@ #ifndef __KALMAN_STATE__ #define __KALMAN_STATE__ - + #include #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" #include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" @@ -8,101 +8,111 @@ namespace TMTT { -class L1KalmanComb; -class KalmanState; -class StubCluster; - -typedef std::map (*GET_TRACK_PARAMS)( const L1KalmanComb *p, const KalmanState *state ); - -class KalmanState{ - public: - KalmanState(); - KalmanState( const L1track3D& candidate, unsigned n_skipped, unsigned kLayer_next, unsigned layerId, const KalmanState *last_state, - const std::vector &x, const TMatrixD &pxx, const TMatrixD &K, const TMatrixD &dcov, - const StubCluster* stubcl, double chi2rphi, double chi2rz, - L1KalmanComb *fitter, GET_TRACK_PARAMS f ); - KalmanState(const KalmanState &p); - ~KalmanState(){} - - KalmanState & operator=( const KalmanState &other ); - - unsigned nextLayer() const { return kLayerNext_; } - unsigned layerId() const { return layerId_; } - unsigned endcapRing() const { return endcapRing_; } - bool barrel() const { return barrel_; } - unsigned nSkippedLayers() const { return n_skipped_; } - // Hit coordinates. - double r() const { return r_; } - double z() const { return z_; } - const KalmanState *last_state() const { return last_state_; } - // Helix parameters (1/2R, phi relative to sector, z0, tanLambda) - std::vector xa() const { return xa_; } - // Covariance matrix on helix params. - TMatrixD pxxa() const { return pxxa_; } - // Kalman Gain matrix - TMatrixD K() const { return K_; } - // Hit position covariance matrix. - TMatrixD dcov() const { return dcov_; } - // Hit - const StubCluster* stubCluster() const { return stubCluster_; } - double chi2() const { return chi2rphi_ + chi2rz_; } - double chi2scaled() const { return chi2rphi_/kalmanChi2RphiScale_ + chi2rz_; } // Improves electron performance. - double chi2rphi() const { return chi2rphi_; } - double chi2rz() const { return chi2rz_; } - unsigned nStubLayers() const { return n_stubs_; } - L1track3D candidate() const { return l1track3D_; } - unsigned int hitPattern() const { return hitPattern_; } // Bit-encoded KF layers the fitted track has stubs in. - - bool good( const TP *tp ) const; - double reducedChi2() const; - const KalmanState *last_update_state() const; - std::vector stubs() const; - L1KalmanComb *fitter() const{ return fitter_; } - GET_TRACK_PARAMS fXtoTrackParams() const{ return fXtoTrackParams_; }; - - - static bool orderChi2(const KalmanState *left, const KalmanState *right); - static bool orderMinSkipChi2(const KalmanState *left, const KalmanState *right); - - static bool order(const KalmanState *left, const KalmanState *right); - void dump( ostream &os, const TP *tp=0, bool all=0 ) const; - void setChi2( double chi2rphi, double chi2rz ){ chi2rphi_ = chi2rphi; chi2rz_ = chi2rz; } - - // If using HLS, note/get additional output produced by HLS core. - //void setHLSselect(unsigned int mBinHelix, unsigned int cBinHelix, bool consistent) { mBinHelixHLS_ = mBinHelix; cBinHelixHLS_ = cBinHelix; consistentHLS_ = consistent;} - //void getHLSselect(unsigned int& mBinHelix, unsigned int& cBinHelix, bool& consistent) const { mBinHelix = mBinHelixHLS_; cBinHelix = cBinHelixHLS_; consistent = consistentHLS_;} - - private: - unsigned kLayerNext_; - unsigned layerId_; - unsigned endcapRing_; - double r_; - const KalmanState *last_state_; - std::vector xa_; - TMatrixD pxxa_; - TMatrixD K_; - TMatrixD dcov_; - const StubCluster *stubCluster_; - double chi2rphi_; - double chi2rz_; - unsigned int kalmanChi2RphiScale_; - unsigned n_stubs_; - L1KalmanComb *fitter_; - GET_TRACK_PARAMS fXtoTrackParams_; - bool barrel_; - unsigned n_skipped_; - double z_; - L1track3D l1track3D_; - unsigned int hitPattern_; - - // Additional output from HLS if using it. - unsigned int mBinHelixHLS_; - unsigned int cBinHelixHLS_; - bool consistentHLS_; -}; - -} + class L1KalmanComb; + class KalmanState; + class StubCluster; + + typedef std::map (*GET_TRACK_PARAMS)(const L1KalmanComb *p, const KalmanState *state); + + class KalmanState { + public: + KalmanState(); + KalmanState(const L1track3D &candidate, + unsigned n_skipped, + unsigned kLayer_next, + unsigned layerId, + const KalmanState *last_state, + const std::vector &x, + const TMatrixD &pxx, + const TMatrixD &K, + const TMatrixD &dcov, + const StubCluster *stubcl, + double chi2rphi, + double chi2rz, + L1KalmanComb *fitter, + GET_TRACK_PARAMS f); + KalmanState(const KalmanState &p); + ~KalmanState() {} + + KalmanState &operator=(const KalmanState &other); + + unsigned nextLayer() const { return kLayerNext_; } + unsigned layerId() const { return layerId_; } + unsigned endcapRing() const { return endcapRing_; } + bool barrel() const { return barrel_; } + unsigned nSkippedLayers() const { return n_skipped_; } + // Hit coordinates. + double r() const { return r_; } + double z() const { return z_; } + const KalmanState *last_state() const { return last_state_; } + // Helix parameters (1/2R, phi relative to sector, z0, tanLambda) + std::vector xa() const { return xa_; } + // Covariance matrix on helix params. + TMatrixD pxxa() const { return pxxa_; } + // Kalman Gain matrix + TMatrixD K() const { return K_; } + // Hit position covariance matrix. + TMatrixD dcov() const { return dcov_; } + // Hit + const StubCluster *stubCluster() const { return stubCluster_; } + double chi2() const { return chi2rphi_ + chi2rz_; } + double chi2scaled() const { return chi2rphi_ / kalmanChi2RphiScale_ + chi2rz_; } // Improves electron performance. + double chi2rphi() const { return chi2rphi_; } + double chi2rz() const { return chi2rz_; } + unsigned nStubLayers() const { return n_stubs_; } + L1track3D candidate() const { return l1track3D_; } + unsigned int hitPattern() const { return hitPattern_; } // Bit-encoded KF layers the fitted track has stubs in. + + bool good(const TP *tp) const; + double reducedChi2() const; + const KalmanState *last_update_state() const; + std::vector stubs() const; + L1KalmanComb *fitter() const { return fitter_; } + GET_TRACK_PARAMS fXtoTrackParams() const { return fXtoTrackParams_; }; + + static bool orderChi2(const KalmanState *left, const KalmanState *right); + static bool orderMinSkipChi2(const KalmanState *left, const KalmanState *right); + + static bool order(const KalmanState *left, const KalmanState *right); + void dump(ostream &os, const TP *tp = 0, bool all = 0) const; + void setChi2(double chi2rphi, double chi2rz) { + chi2rphi_ = chi2rphi; + chi2rz_ = chi2rz; + } + + // If using HLS, note/get additional output produced by HLS core. + //void setHLSselect(unsigned int mBinHelix, unsigned int cBinHelix, bool consistent) { mBinHelixHLS_ = mBinHelix; cBinHelixHLS_ = cBinHelix; consistentHLS_ = consistent;} + //void getHLSselect(unsigned int& mBinHelix, unsigned int& cBinHelix, bool& consistent) const { mBinHelix = mBinHelixHLS_; cBinHelix = cBinHelixHLS_; consistent = consistentHLS_;} + + private: + unsigned kLayerNext_; + unsigned layerId_; + unsigned endcapRing_; + double r_; + const KalmanState *last_state_; + std::vector xa_; + TMatrixD pxxa_; + TMatrixD K_; + TMatrixD dcov_; + const StubCluster *stubCluster_; + double chi2rphi_; + double chi2rz_; + unsigned int kalmanChi2RphiScale_; + unsigned n_stubs_; + L1KalmanComb *fitter_; + GET_TRACK_PARAMS fXtoTrackParams_; + bool barrel_; + unsigned n_skipped_; + double z_; + L1track3D l1track3D_; + unsigned int hitPattern_; + + // Additional output from HLS if using it. + unsigned int mBinHelixHLS_; + unsigned int cBinHelixHLS_; + bool consistentHLS_; + }; + +} // namespace TMTT #endif - - diff --git a/L1Trigger/TrackFindingTMTT/interface/KillDupFitTrks.h b/L1Trigger/TrackFindingTMTT/interface/KillDupFitTrks.h index d288b1fab6211..baed535f35fe2 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KillDupFitTrks.h +++ b/L1Trigger/TrackFindingTMTT/interface/KillDupFitTrks.h @@ -21,58 +21,53 @@ using namespace std; namespace TMTT { -class Settings; + class Settings; -class KillDupFitTrks { + class KillDupFitTrks { + public: + KillDupFitTrks() {} -public: + ~KillDupFitTrks() {} - KillDupFitTrks() {} - - ~KillDupFitTrks() {} - - /** + /** * Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. */ - void init(const Settings* settings, unsigned int dupTrkAlg); + void init(const Settings* settings, unsigned int dupTrkAlg); - /** + /** * Eliminate duplicate tracks from the input collection, and so return a reduced list of tracks. */ - vector filter(const vector& vecTracks) const; - -private: + vector filter(const vector& vecTracks) const; - /** + private: + /** * Duplicate removal algorithm designed to run after the track helix fit, which eliminates duplicates simply * by requiring that the fitted (q/Pt, phi0) of the track correspond to the same HT cell in which the track * was originally found by the HT. */ - vector filterAlg50(const vector& tracks) const; + vector filterAlg50(const vector& tracks) const; - /** + /** * Duplicate removal algorithm designed to run after the track helix fit, which eliminates duplicates * simply by requiring that no two tracks should have fitted (q/Pt, phi0) that correspond to the same HT * cell. If they do, then only the first to arrive is kept. */ - vector filterAlg51(const vector& tracks) const; + vector filterAlg51(const vector& tracks) const; - /** + /** * Other duplicate track removal algorithms are available in class KillDupTrks, which this class * can call. */ - // Debug printout of which tracks are duplicates. - void printDuplicateTracks(const vector& tracks) const; + // Debug printout of which tracks are duplicates. + void printDuplicateTracks(const vector& tracks) const; -private: + private: + const Settings* settings_; // Configuration parameters. + unsigned int dupTrkAlg_; // Specifies choice of algorithm for duplicate track removal. + KillDupTrks killDupTrks_; // Contains duplicate removal algorithms common to all track types. + }; - const Settings *settings_; // Configuration parameters. - unsigned int dupTrkAlg_; // Specifies choice of algorithm for duplicate track removal. - KillDupTrks killDupTrks_; // Contains duplicate removal algorithms common to all track types. -}; - -} +} // namespace TMTT #endif - diff --git a/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h b/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h index fef3f2802a416..5adb86edf4eea 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h +++ b/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h @@ -35,72 +35,69 @@ using namespace std; namespace TMTT { -class L1trackBase; -class L1track2D; -class L1track3D; -class L1fittedTrack; - -template class KillDupTrks { - -public: - - KillDupTrks() - { - // Check that classed used as template "T" inherits from class L1trackBase. - static_assert(std::is_base_of::value, "KillDupTrks ERROR: You instantiated this with a template class not inheriting from L1trackBase!"); - } - - ~KillDupTrks() {} - - /** + class L1trackBase; + class L1track2D; + class L1track3D; + class L1fittedTrack; + + template + class KillDupTrks { + public: + KillDupTrks() { + // Check that classed used as template "T" inherits from class L1trackBase. + static_assert(std::is_base_of::value, + "KillDupTrks ERROR: You instantiated this with a template class not inheriting from L1trackBase!"); + } + + ~KillDupTrks() {} + + /** * Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. */ - void init(const Settings* settings, unsigned int dupTrkAlg); + void init(const Settings* settings, unsigned int dupTrkAlg); - /** + /** * Eliminate duplicate tracks from the input collection, and so return a reduced list of tracks. */ - vector filter(const vector& vecTracks) const; - -private: + vector filter(const vector& vecTracks) const; - /** + private: + /** * Implementing "inverse" OSU algorithm, check for stubs in common, * keep largest candidates if common stubs in N or more layers (default 5 at present), both if equal * Implementing "inverse" OSU algorithm, check for stubs in common, * keep largest candidates if common stubs in N or more layers (default 5 at present), both if equal */ - vector filterAlg8(const vector& vecTracks) const; + vector filterAlg8(const vector& vecTracks) const; - /** Implementing "inverse" OSU algorithm, check for layers in common, reverse order as per Luis's suggestion + /** Implementing "inverse" OSU algorithm, check for layers in common, reverse order as per Luis's suggestion * Comparison window of up to 6 * Modified version of Algo23, looking for layers in common as in Algo8 * Check if N or more common layers (default 5 at present) * Then keep candidate with most stubs, use |q/pT| as tie-break, finally drop "latest" if still equal */ -vector filterAlg25(const vector& vecTracks) const; + vector filterAlg25(const vector& vecTracks) const; - /** + /** * Prints out a consistently formatted formatted report of killed duplicate track */ - void printKill(unsigned alg, unsigned dup, unsigned cand, T dupTrack, T candTrack) const; + void printKill(unsigned alg, unsigned dup, unsigned cand, T dupTrack, T candTrack) const; - /** + /** * Counts candidate layers with stubs in common */ - unsigned int layerMatches(std::vector< std::pair >* iStubs, - std::vector< std::pair >* jStubs) const; -private: + unsigned int layerMatches(std::vector >* iStubs, + std::vector >* jStubs) const; - const Settings *settings_; // Configuration parameters. + private: + const Settings* settings_; // Configuration parameters. - unsigned int dupTrkAlg_; // Specifies choice of algorithm for duplicate track removal. - unsigned int dupTrkMinCommonHitsLayers_; // Min no of matched stubs & layers to keep smaller cand -}; + unsigned int dupTrkAlg_; // Specifies choice of algorithm for duplicate track removal. + unsigned int dupTrkMinCommonHitsLayers_; // Min no of matched stubs & layers to keep smaller cand + }; -} +} // namespace TMTT //=== Include file which implements all the functions in the above class. #include "L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc" #endif - diff --git a/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc b/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc index 22a7697d9bcde..9c198fb6675e5 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc +++ b/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc @@ -1,335 +1,319 @@ namespace TMTT { -// Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. -template -void KillDupTrks::init(const Settings* settings, unsigned int dupTrkAlg) -{ - settings_ = settings; - - dupTrkAlg_ = dupTrkAlg; - dupTrkMinCommonHitsLayers_ = settings->dupTrkMinCommonHitsLayers(); -} - -// Count layers with stubs in common -template -unsigned int KillDupTrks::layerMatches(std::vector< std::pair >* iStubs, - std::vector< std::pair >* jStubs) const -{ unsigned int match = 0; - unsigned int indxI = 0; - unsigned int indxJ = 0; - unsigned int lenI = iStubs->size(); - unsigned int lenJ = jStubs->size(); - - std::set layers; - - while ( (indxI < lenI) && (indxJ < lenJ) ) - { + // Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. + template + void KillDupTrks::init(const Settings* settings, unsigned int dupTrkAlg) { + settings_ = settings; + + dupTrkAlg_ = dupTrkAlg; + dupTrkMinCommonHitsLayers_ = settings->dupTrkMinCommonHitsLayers(); + } + + // Count layers with stubs in common + template + unsigned int KillDupTrks::layerMatches(std::vector >* iStubs, + std::vector >* jStubs) const { + unsigned int match = 0; + unsigned int indxI = 0; + unsigned int indxJ = 0; + unsigned int lenI = iStubs->size(); + unsigned int lenJ = jStubs->size(); + + std::set layers; + + while ((indxI < lenI) && (indxJ < lenJ)) { // Stub indices match? - if (iStubs->at(indxI).first == jStubs->at(indxJ).first) - { - // Get layer for stub - unsigned int layer = iStubs->at(indxI).second; - - // Any match in this layer yet? - if (layers.insert(layer).second) - { - ++match; - } - - // Next stubs - ++indxI; - ++indxJ; - } - else - { - if (iStubs->at(indxI).first < jStubs->at(indxJ).first) - { - // In i, not j - ++indxI; - } - else - { - // In j, not i - ++indxJ; - } - } + if (iStubs->at(indxI).first == jStubs->at(indxJ).first) { + // Get layer for stub + unsigned int layer = iStubs->at(indxI).second; + + // Any match in this layer yet? + if (layers.insert(layer).second) { + ++match; + } + + // Next stubs + ++indxI; + ++indxJ; + } else { + if (iStubs->at(indxI).first < jStubs->at(indxJ).first) { + // In i, not j + ++indxI; + } else { + // In j, not i + ++indxJ; + } + } + } + return match; + } + + // Eliminate duplicate tracks from the input collection, and so return a reduced list of tracks. + template + vector KillDupTrks::filter(const vector& vecTracks) const { + // Short-circuit the calculation for trivial cases + if (vecTracks.size() == 0 || vecTracks.size() == 1) { + return vecTracks; } - return match; -} - - -// Eliminate duplicate tracks from the input collection, and so return a reduced list of tracks. -template -vector KillDupTrks::filter(const vector& vecTracks) const -{ - // Short-circuit the calculation for trivial cases - if (vecTracks.size() == 0 || vecTracks.size() == 1) - { - return vecTracks; - } - - // Choose which algorithm to run, based on parameter dupTrkAlg_. - switch (dupTrkAlg_) - { - // Do no filtering at all in the 0 case - case 0: return vecTracks; break; - case 8: return filterAlg8( vecTracks ); break; - case 25: return filterAlg25( vecTracks ); break; - default: throw cms::Exception("KillDupTrks: Option DupTrkAlg in cfg has invalid value."); - } - - // We should never end up here - return vecTracks; -} - -// Implementing "inverse" OSU algorithm, check for stubs in common, -// keep largest candidates if common stubs in N or more layers (default 5 at present), both if equal -// Implementing "inverse" OSU algorithm, check for stubs in common, -// keep largest candidates if common stubs in N or more layers (default 5 at present), both if equal - -template -vector KillDupTrks::filterAlg8(const vector& vecTracks) const -{ - vector vecTracksFiltered; - - // vector (corresponding to candidate tracks) of vectors (indices for stubs) - std::vector< std::vector< std::pair > > candList; - - for (const T& trk : vecTracks) - { - const vector< const Stub * > & stubs = trk.getStubs(); - std::vector< std::pair > stubList; - - for (const auto & myStub: stubs) - { - stubList.push_back( std::pair< unsigned int,unsigned int >( myStub->index(), myStub->layerId() ) ); - } - - // now necessary due to seed-filter disordering stubs - std::sort(stubList.begin(),stubList.end()); - - // make up vector of vectors - candList.push_back(stubList); - } - - std::vector< unsigned int > indices; // to avoid expense of manipulating candidate vector - - for (std::size_t i = 0; i < candList.size(); ++i) - { - indices.push_back(i); - } - - - unsigned int i = 0; - - // Loop through vector - while ( i < (candList.size() - 1) ) - { - unsigned int j = i + 1; - - // Check rest of candidates - while (j < candList.size() ) - { - - if (layerMatches(&(candList[i]), &(candList[j])) >= dupTrkMinCommonHitsLayers_) // Enough in common to keep one and kill the other - { - unsigned int qualI = vecTracks[ indices[i] ].getNumLayers(); - unsigned int qualJ = vecTracks[ indices[j] ].getNumLayers(); - - // Keep best "quality" - if (qualI < qualJ) - { - printKill(dupTrkAlg_, i, j, vecTracks[ indices[i] ], vecTracks[ indices[j] ]); - - candList.erase(candList.begin()+i); - indices.erase(indices.begin()+i); - - // To counter increment we don't want here - --i; - - // Out of j-while - break; - } - else - { - // Delete j if lower quality (or equal to remove duplicates!) - - printKill(dupTrkAlg_, j, i, vecTracks[ indices[j] ], vecTracks[ indices[i] ]); - - candList.erase(candList.begin()+j); - indices.erase(indices.begin()+j); - } - } - else - { - // Keep both, next candidate - ++j; - } - } - ++i; - } - - for (std::size_t i = 0; i < indices.size(); ++i) - { - vecTracksFiltered.push_back(vecTracks.at(indices[i])); // copy non-dupes to output - } - - return vecTracksFiltered; -} - - -// Implementing "inverse" OSU algorithm, check for layers in common, reverse order as per Luis's suggestion -// Comparison window of up to 6 -// Modified version of Algo23, looking for layers in common as in Algo8 -// Check if N or more common layers (default 5 at present) -// Then keep candidate with most stubs, use |q/pT| as tie-break, finally drop "latest" if still equal -template -vector KillDupTrks::filterAlg25(const vector& vecTracks) const -{ // vector (corresponding to candidate tracks) of vectors (indices for stubs) - std::vector< std::vector< std::pair > > candList; - - //std::cout<<"** Alg25 comparing "< & stubs = trk.getStubs(); - std::vector< std::pair > stubList; - - for (const auto & myStub: stubs) - { - stubList.push_back( std::pair< unsigned int,unsigned int >( myStub->index(), myStub->layerId() ) ); - } - - // now necessary due to seed-filter disordering stubs - std::sort(stubList.begin(),stubList.end()); - - // make up vector of vectors - candList.push_back(stubList); - } - - std::vector< bool > indices(candList.size(),true); // since we can't manipulate const candidate vector - - unsigned int i = 0; - - // Loop through vector - while ( i < candList.size() ) - { - unsigned int range = vecTracks[i].getNumStubs(); - - // Check rest of candidates - for (unsigned int j = 0; ji) { range += vecTracks[j].getNumStubs(); - if (range >= 51) break; - } - - if (layerMatches(&(candList[i]), &(candList[j])) >= dupTrkMinCommonHitsLayers_) // Enough in common - { unsigned int qualI = vecTracks[i].getNumLayers(); - unsigned int qualJ = vecTracks[j].getNumLayers(); - - if (j fabs(vecTracks[j].qOverPt())) - { printKill(dupTrkAlg_, i, j, vecTracks[i], vecTracks[j]); - //std::cout<<"a) "<i - { if (qualI < qualJ) // Drop one with fewer layers - { printKill(dupTrkAlg_, i, j, vecTracks[i], vecTracks[j]); - //std::cout<<"c) "<"<"<qualJ "<"<="<"< vecTracksFiltered; // Copy surviving candidates to output - for (unsigned int i=0; i -void KillDupTrks::printKill(unsigned int alg, unsigned int dup, unsigned int cand, T dupTrack, T candTrack) const -{ - // condition to print debug info from duplicate track removal code. - if (settings_->debug( ) == 5) - { - std::pair duploc = dupTrack.getCellLocationHT(); - std::pair canloc = candTrack.getCellLocationHT(); - - const TP *dupTP=dupTrack.getMatchedTP(), *candTP=candTrack.getMatchedTP(); - - int dupTPIndex = dupTP == nullptr ? -1 : dupTP->index(); - int candTPIndex = candTP == nullptr ? -1 : candTP->index(); - - bool dupUsed = false, candUsed = false; - - if ( dupTP != nullptr) { dupUsed = dupTP->useForAlgEff();} - if (candTP != nullptr) { candUsed = candTP->useForAlgEff();} - - std::cout - << "** Alg" << alg - << " erasing dupe " << dup << " (TP "<< dupTPIndex << " "<< dupUsed << ")" - << " at (" << duploc.first << "," << duploc.second << ")" - << " of cand " << cand << " (TP " << candTPIndex << " " << candUsed << ")" - << " at (" << canloc.first << "," << canloc.second << ")" - << " deltas " << int(duploc.first) - int(canloc.first) << " " << int(duploc.second) - int(canloc.second) - << std::endl; - } -} - -// I thought these three lines would allow the class implementation to be inside KillDupTrks.cc instead of in KillDupTrks.icc, but seems not to work ... -//template class KillDupTrks; -//template class KillDupTrks; -//template class KillDupTrks; - -} + + // Choose which algorithm to run, based on parameter dupTrkAlg_. + switch (dupTrkAlg_) { + // Do no filtering at all in the 0 case + case 0: + return vecTracks; + break; + case 8: + return filterAlg8(vecTracks); + break; + case 25: + return filterAlg25(vecTracks); + break; + default: + throw cms::Exception("KillDupTrks: Option DupTrkAlg in cfg has invalid value."); + } + + // We should never end up here + return vecTracks; + } + + // Implementing "inverse" OSU algorithm, check for stubs in common, + // keep largest candidates if common stubs in N or more layers (default 5 at present), both if equal + // Implementing "inverse" OSU algorithm, check for stubs in common, + // keep largest candidates if common stubs in N or more layers (default 5 at present), both if equal + + template + vector KillDupTrks::filterAlg8(const vector& vecTracks) const { + vector vecTracksFiltered; + + // vector (corresponding to candidate tracks) of vectors (indices for stubs) + std::vector > > candList; + + for (const T& trk : vecTracks) { + const vector& stubs = trk.getStubs(); + std::vector > stubList; + + for (const auto& myStub : stubs) { + stubList.push_back(std::pair(myStub->index(), myStub->layerId())); + } + + // now necessary due to seed-filter disordering stubs + std::sort(stubList.begin(), stubList.end()); + + // make up vector of vectors + candList.push_back(stubList); + } + + std::vector indices; // to avoid expense of manipulating candidate vector + + for (std::size_t i = 0; i < candList.size(); ++i) { + indices.push_back(i); + } + + unsigned int i = 0; + + // Loop through vector + while (i < (candList.size() - 1)) { + unsigned int j = i + 1; + + // Check rest of candidates + while (j < candList.size()) { + if (layerMatches(&(candList[i]), &(candList[j])) >= + dupTrkMinCommonHitsLayers_) // Enough in common to keep one and kill the other + { + unsigned int qualI = vecTracks[indices[i]].getNumLayers(); + unsigned int qualJ = vecTracks[indices[j]].getNumLayers(); + + // Keep best "quality" + if (qualI < qualJ) { + printKill(dupTrkAlg_, i, j, vecTracks[indices[i]], vecTracks[indices[j]]); + + candList.erase(candList.begin() + i); + indices.erase(indices.begin() + i); + + // To counter increment we don't want here + --i; + + // Out of j-while + break; + } else { + // Delete j if lower quality (or equal to remove duplicates!) + + printKill(dupTrkAlg_, j, i, vecTracks[indices[j]], vecTracks[indices[i]]); + + candList.erase(candList.begin() + j); + indices.erase(indices.begin() + j); + } + } else { + // Keep both, next candidate + ++j; + } + } + ++i; + } + + for (std::size_t i = 0; i < indices.size(); ++i) { + vecTracksFiltered.push_back(vecTracks.at(indices[i])); // copy non-dupes to output + } + + return vecTracksFiltered; + } + + // Implementing "inverse" OSU algorithm, check for layers in common, reverse order as per Luis's suggestion + // Comparison window of up to 6 + // Modified version of Algo23, looking for layers in common as in Algo8 + // Check if N or more common layers (default 5 at present) + // Then keep candidate with most stubs, use |q/pT| as tie-break, finally drop "latest" if still equal + template + vector KillDupTrks::filterAlg25( + const vector& vecTracks) const { // vector (corresponding to candidate tracks) of vectors (indices for stubs) + std::vector > > candList; + + //std::cout<<"** Alg25 comparing "<& stubs = trk.getStubs(); + std::vector > stubList; + + for (const auto& myStub : stubs) { + stubList.push_back(std::pair(myStub->index(), myStub->layerId())); + } + + // now necessary due to seed-filter disordering stubs + std::sort(stubList.begin(), stubList.end()); + + // make up vector of vectors + candList.push_back(stubList); + } + + std::vector indices(candList.size(), true); // since we can't manipulate const candidate vector + + unsigned int i = 0; + + // Loop through vector + while (i < candList.size()) { + unsigned int range = vecTracks[i].getNumStubs(); + + // Check rest of candidates + for (unsigned int j = 0; j < candList.size(); + ++j) // Start at 0 as tracks out of scope can still eliminate future tracks + { + if (j == i) + continue; // We would always get a match... + if (j > i) { + range += vecTracks[j].getNumStubs(); + if (range >= 51) + break; + } + + if (layerMatches(&(candList[i]), &(candList[j])) >= dupTrkMinCommonHitsLayers_) // Enough in common + { + unsigned int qualI = vecTracks[i].getNumLayers(); + unsigned int qualJ = vecTracks[j].getNumLayers(); + + if (j < i) { + if (qualI == qualJ) // Drop i if same stubs, larger abs(q/pT), keep both if equal + // (later - j - will go out further down) + { + if (fabs(vecTracks[i].qOverPt()) > fabs(vecTracks[j].qOverPt())) { + printKill(dupTrkAlg_, i, j, vecTracks[i], vecTracks[j]); + //std::cout<<"a) "<i + { + if (qualI < qualJ) // Drop one with fewer layers + { + printKill(dupTrkAlg_, i, j, vecTracks[i], vecTracks[j]); + //std::cout<<"c) "<"<"<qualJ "<"<="<"< vecTracksFiltered; // Copy surviving candidates to output + for (unsigned int i = 0; i < vecTracks.size(); ++i) { + if (indices[i]) { + vecTracksFiltered.push_back(vecTracks[i]); + } + } + //std::cout<<"** Alg 25 returning "< + void KillDupTrks::printKill(unsigned int alg, unsigned int dup, unsigned int cand, T dupTrack, T candTrack) const { + // condition to print debug info from duplicate track removal code. + if (settings_->debug() == 5) { + std::pair duploc = dupTrack.getCellLocationHT(); + std::pair canloc = candTrack.getCellLocationHT(); + + const TP *dupTP = dupTrack.getMatchedTP(), *candTP = candTrack.getMatchedTP(); + + int dupTPIndex = dupTP == nullptr ? -1 : dupTP->index(); + int candTPIndex = candTP == nullptr ? -1 : candTP->index(); + + bool dupUsed = false, candUsed = false; + + if (dupTP != nullptr) { + dupUsed = dupTP->useForAlgEff(); + } + if (candTP != nullptr) { + candUsed = candTP->useForAlgEff(); + } + + std::cout << "** Alg" << alg << " erasing dupe " << dup << " (TP " << dupTPIndex << " " << dupUsed << ")" + << " at (" << duploc.first << "," << duploc.second << ")" + << " of cand " << cand << " (TP " << candTPIndex << " " << candUsed << ")" + << " at (" << canloc.first << "," << canloc.second << ")" + << " deltas " << int(duploc.first) - int(canloc.first) << " " << int(duploc.second) - int(canloc.second) + << std::endl; + } + } + + // I thought these three lines would allow the class implementation to be inside KillDupTrks.cc instead of in KillDupTrks.icc, but seems not to work ... + //template class KillDupTrks; + //template class KillDupTrks; + //template class KillDupTrks; + +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h b/L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h index 5f04f3bdf5713..8f1f277de378e 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h @@ -4,7 +4,7 @@ #ifndef __L1_CHI_SQUARED__ #define __L1_CHI_SQUARED__ - + #include "L1Trigger/TrackFindingTMTT/interface/Matrix.h" #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" #include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h" @@ -13,26 +13,25 @@ #include #include #include - - namespace TMTT { - -class L1ChiSquared : public TrackFitGeneric{ -public: +namespace TMTT { + + class L1ChiSquared : public TrackFitGeneric { + public: L1ChiSquared(const Settings* settings, const uint nPar); - - virtual ~L1ChiSquared(){} - + + virtual ~L1ChiSquared() {} + L1fittedTrack fit(const L1track3D& l1track3D); - -protected: + + protected: /* Methods */ - virtual std::vector seed(const L1track3D& l1track3D)=0; - virtual std::vector residuals(std::vector x)=0; - virtual Matrix D(std::vector x)=0; // derivatives - virtual Matrix Vinv()=0; // Covariances - virtual std::map convertParams(std::vector x)=0; - + virtual std::vector seed(const L1track3D& l1track3D) = 0; + virtual std::vector residuals(std::vector x) = 0; + virtual Matrix D(std::vector x) = 0; // derivatives + virtual Matrix Vinv() = 0; // Covariances + virtual std::map convertParams(std::vector x) = 0; + /* Variables */ std::vector stubs_; std::map trackParams_; @@ -40,11 +39,10 @@ class L1ChiSquared : public TrackFitGeneric{ float largestresid_; int ilargestresid_; double chiSq_; - -private: - void calculateChiSq( std::vector resids ); - void calculateDeltaChiSq( std::vector deltaX, std::vector covX ); + private: + void calculateChiSq(std::vector resids); + void calculateDeltaChiSq(std::vector deltaX, std::vector covX); int numFittingIterations_; int killTrackFitWorstHit_; @@ -52,11 +50,9 @@ class L1ChiSquared : public TrackFitGeneric{ double killingResidualCut_; unsigned int minStubLayers_; - unsigned int minStubLayersRed_; -}; + unsigned int minStubLayersRed_; + }; -} +} // namespace TMTT #endif - - diff --git a/L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h b/L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h index aca1d633c427f..3e42f1aded361 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h @@ -1,8 +1,8 @@ ///=== This is the base class for the Kalman Combinatorial Filter track fit algorithm. - + #ifndef __L1_KALMAN_COMB__ #define __L1_KALMAN_COMB__ - + #include #include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h" #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" @@ -20,162 +20,189 @@ class TH2F; namespace TMTT { -class TP; -class KalmanState; -class StubCluster; - -class L1KalmanComb : public TrackFitGeneric{ - - public: - enum OVERLAP_TYPE { TYPE_NORMAL, TYPE_V2, TYPE_NOCLUSTERING, TYPE_TP }; - public: - L1KalmanComb(const Settings* settings, const uint nPar, const string &fitterName="", const uint nMeas=2 ); - - virtual ~L1KalmanComb() { this->resetStates(); this->deleteStubClusters();} - - L1fittedTrack fit(const L1track3D& l1track3D); - void bookHists(); - - protected: - static std::map getTrackParams( const L1KalmanComb *p, const KalmanState *state ); - virtual std::map getTrackParams( const KalmanState *state ) const=0; - - // Get track params with beam-spot constraint & chi2 (r-phi) after applying it.. - virtual std::map getTrackParams_BeamConstr( const KalmanState *state, double& chi2rphi_bcon) const { - chi2rphi_bcon = 0.0; - return (this->getTrackParams(state)); // Returns unconstrained result, unless derived class overrides it. - } - - double sectorPhi()const - { - float phiCentreSec0 = -M_PI/float(getSettings()->numPhiNonants()) + M_PI/float(getSettings()->numPhiSectors()); - return 2.*M_PI * float(iCurrentPhiSec_) / float(getSettings()->numPhiSectors()) + phiCentreSec0; - } - //bool kalmanUpdate( const StubCluster *stubCluster, KalmanState &state, KalmanState &new_state, const TP *tpa ); - virtual const KalmanState *kalmanUpdate( unsigned skipped, unsigned layer, const StubCluster* stubCluster, const KalmanState &state, const TP *); - void resetStates(); - void deleteStubClusters(); - const KalmanState *mkState( const L1track3D &candidate, unsigned skipped, unsigned layer, unsigned layerId, const KalmanState *last_state, - const std::vector &x, const TMatrixD &pxx, const TMatrixD &K, const TMatrixD &dcov, const StubCluster* stubCluster, double chi2rphi, double chi2rz ); - - protected: - /* Methods */ - std::vector Hx( const TMatrixD &pH, const std::vector &x )const; - std::vector Fx( const TMatrixD &pF, const std::vector &x )const; - TMatrixD HxxH( const TMatrixD &pH, const TMatrixD &xx )const; - void getDeltaChi2( const TMatrixD &dcov, const std::vector &delta, bool debug, - double& deltaChi2rphi, double& deltaChi2rz )const; - TMatrixD GetKalmanMatrix( const TMatrixD &h, const TMatrixD &pxcov, const TMatrixD &dcov )const; - void GetAdjustedState( const TMatrixD &K, const TMatrixD &pxcov, - const std::vector &x, const StubCluster *stubCluster, const std::vector& delta, - std::vector &new_x, TMatrixD &new_xcov )const; - - - virtual std::vector seedx(const L1track3D& l1track3D)const=0; - virtual TMatrixD seedP(const L1track3D& l1track3D)const=0; - virtual void barrelToEndcap( double r, const StubCluster *stubCluster, std::vector &x, TMatrixD &cov_x )const{} - virtual std::vector d(const StubCluster* stubCluster )const=0; - virtual TMatrixD H(const StubCluster* stubCluster)const=0; - virtual TMatrixD F(const StubCluster* stubCluster=0, const KalmanState *state=0 )const=0; - virtual TMatrixD PxxModel( const KalmanState *state, const StubCluster *stubCluster )const=0; - virtual TMatrixD PddMeas(const StubCluster* stubCluster, const KalmanState *state )const=0; - - virtual std::vector residual(const StubCluster* stubCluster, const std::vector &x, double candQoverPt )const; - virtual const KalmanState *updateSeedWithStub( const KalmanState &state, const StubCluster *stubCluster ){ return 0; } - virtual bool isGoodState( const KalmanState &state )const{ return true; } - - virtual void calcChi2( const KalmanState &state, double& chi2rphi, double& chi2rz ) const; - - virtual double getRofState( unsigned layerId, const vector &xa )const{ return 0;} - virtual unsigned int getKalmanLayer(unsigned int iEtaReg, unsigned int layerIDreduced, bool barrel, float r, float z) const; - virtual bool getKalmanAmbiguousLayer(unsigned int iEtaReg, unsigned int kfLayer); - - std::vector doKF( const L1track3D &l1track3D, const std::vector &stubClusters, const TP *tpa ); - - void printTPSummary( std::ostream &os, const TP *tp, bool addReturn=true ) const; - void printTP( std::ostream &os, const TP *tp ) const; - void printStubLayers( std::ostream &os, std::vector &stubs, unsigned int iEtaReg ) const; - void printStubCluster( std::ostream &os, const StubCluster * stubCluster, bool addReturn=true ) const; - void printStubClusters( std::ostream &os, std::vector &stubClusters ) const; - void printStub( std::ostream &os, const Stub * stub, bool addReturn=true ) const; - void printStubs( std::ostream &os, std::vector &stubs ) const; - - void fillSeedHists( const KalmanState *state, const TP *tpa ); - void fillCandHists( const KalmanState &state, const TP *tpa=0 ); - void fillStepHists( const TP *tpa, unsigned nItr, const KalmanState *new_state ); - - double DeltaRphiForClustering( unsigned layerId, unsigned endcapRing ); - double DeltaRForClustering( unsigned endcapRing ); - bool isOverlap( const Stub* a, const Stub*b, OVERLAP_TYPE type ); - - set getKalmanDeadLayers( bool& remove2PSCut ) const; - - // Function to calculate approximation for tilted barrel modules (aka B) copied from Stub class. - float getApproxB(float z, float r) const; - - // Is this HLS code? - virtual bool isHLS() {return false;}; - - protected: - unsigned nPar_; - unsigned nMeas_; - unsigned numEtaRegions_; - - std::vector state_list_; - std::vector stbcl_list_; - - std::vector hxaxtmin; - std::vector hxaxtmax; - std::vector hxmin; - std::vector hxmax; - std::vector hymin; - std::vector hymax; - std::vector hdxmin; - std::vector hdxmax; - std::vector hresmin; - std::vector hresmax; - std::vector hddMeasmin; - std::vector hddMeasmax; - - TH1F * hTrackEta_; - TH1F * hUniqueTrackEta_; - std::map hBarrelStubMaxDistanceMap; - std::map hEndcapStubMaxDistanceMap; - std::map hphiErrorRatioMap; - std::map hstubCombMap; - - TH1F* hndupStub_; - TH1F* hnmergeStub_; - std::map hytMap; - std::map hy0Map; - std::map hyfMap; - std::map hxMap; - std::map hxcovMap; - std::map hkMap; - std::map hresMap; - std::map hmcovMap; - - double hchi2min; - double hchi2max; - - unsigned maxNfitForDump_; - bool dump_; - unsigned int iCurrentPhiSec_; - unsigned int iCurrentEtaReg_; - unsigned int iLastPhiSec_; - unsigned int iLastEtaReg_; - - unsigned int minStubLayersRed_; - - unsigned int numUpdateCalls_; - - const TP* tpa_; -}; - -} + class TP; + class KalmanState; + class StubCluster; + + class L1KalmanComb : public TrackFitGeneric { + public: + enum OVERLAP_TYPE { TYPE_NORMAL, TYPE_V2, TYPE_NOCLUSTERING, TYPE_TP }; + + public: + L1KalmanComb(const Settings *settings, const uint nPar, const string &fitterName = "", const uint nMeas = 2); + + virtual ~L1KalmanComb() { + this->resetStates(); + this->deleteStubClusters(); + } + + L1fittedTrack fit(const L1track3D &l1track3D); + void bookHists(); + + protected: + static std::map getTrackParams(const L1KalmanComb *p, const KalmanState *state); + virtual std::map getTrackParams(const KalmanState *state) const = 0; + + // Get track params with beam-spot constraint & chi2 (r-phi) after applying it.. + virtual std::map getTrackParams_BeamConstr(const KalmanState *state, + double &chi2rphi_bcon) const { + chi2rphi_bcon = 0.0; + return (this->getTrackParams(state)); // Returns unconstrained result, unless derived class overrides it. + } + + double sectorPhi() const { + float phiCentreSec0 = + -M_PI / float(getSettings()->numPhiNonants()) + M_PI / float(getSettings()->numPhiSectors()); + return 2. * M_PI * float(iCurrentPhiSec_) / float(getSettings()->numPhiSectors()) + phiCentreSec0; + } + //bool kalmanUpdate( const StubCluster *stubCluster, KalmanState &state, KalmanState &new_state, const TP *tpa ); + virtual const KalmanState *kalmanUpdate( + unsigned skipped, unsigned layer, const StubCluster *stubCluster, const KalmanState &state, const TP *); + void resetStates(); + void deleteStubClusters(); + const KalmanState *mkState(const L1track3D &candidate, + unsigned skipped, + unsigned layer, + unsigned layerId, + const KalmanState *last_state, + const std::vector &x, + const TMatrixD &pxx, + const TMatrixD &K, + const TMatrixD &dcov, + const StubCluster *stubCluster, + double chi2rphi, + double chi2rz); + + protected: + /* Methods */ + std::vector Hx(const TMatrixD &pH, const std::vector &x) const; + std::vector Fx(const TMatrixD &pF, const std::vector &x) const; + TMatrixD HxxH(const TMatrixD &pH, const TMatrixD &xx) const; + void getDeltaChi2(const TMatrixD &dcov, + const std::vector &delta, + bool debug, + double &deltaChi2rphi, + double &deltaChi2rz) const; + TMatrixD GetKalmanMatrix(const TMatrixD &h, const TMatrixD &pxcov, const TMatrixD &dcov) const; + void GetAdjustedState(const TMatrixD &K, + const TMatrixD &pxcov, + const std::vector &x, + const StubCluster *stubCluster, + const std::vector &delta, + std::vector &new_x, + TMatrixD &new_xcov) const; + + virtual std::vector seedx(const L1track3D &l1track3D) const = 0; + virtual TMatrixD seedP(const L1track3D &l1track3D) const = 0; + virtual void barrelToEndcap(double r, + const StubCluster *stubCluster, + std::vector &x, + TMatrixD &cov_x) const {} + virtual std::vector d(const StubCluster *stubCluster) const = 0; + virtual TMatrixD H(const StubCluster *stubCluster) const = 0; + virtual TMatrixD F(const StubCluster *stubCluster = 0, const KalmanState *state = 0) const = 0; + virtual TMatrixD PxxModel(const KalmanState *state, const StubCluster *stubCluster) const = 0; + virtual TMatrixD PddMeas(const StubCluster *stubCluster, const KalmanState *state) const = 0; + + virtual std::vector residual(const StubCluster *stubCluster, + const std::vector &x, + double candQoverPt) const; + virtual const KalmanState *updateSeedWithStub(const KalmanState &state, const StubCluster *stubCluster) { + return 0; + } + virtual bool isGoodState(const KalmanState &state) const { return true; } + + virtual void calcChi2(const KalmanState &state, double &chi2rphi, double &chi2rz) const; + + virtual double getRofState(unsigned layerId, const vector &xa) const { return 0; } + virtual unsigned int getKalmanLayer( + unsigned int iEtaReg, unsigned int layerIDreduced, bool barrel, float r, float z) const; + virtual bool getKalmanAmbiguousLayer(unsigned int iEtaReg, unsigned int kfLayer); + + std::vector doKF(const L1track3D &l1track3D, + const std::vector &stubClusters, + const TP *tpa); + + void printTPSummary(std::ostream &os, const TP *tp, bool addReturn = true) const; + void printTP(std::ostream &os, const TP *tp) const; + void printStubLayers(std::ostream &os, std::vector &stubs, unsigned int iEtaReg) const; + void printStubCluster(std::ostream &os, const StubCluster *stubCluster, bool addReturn = true) const; + void printStubClusters(std::ostream &os, std::vector &stubClusters) const; + void printStub(std::ostream &os, const Stub *stub, bool addReturn = true) const; + void printStubs(std::ostream &os, std::vector &stubs) const; + + void fillSeedHists(const KalmanState *state, const TP *tpa); + void fillCandHists(const KalmanState &state, const TP *tpa = 0); + void fillStepHists(const TP *tpa, unsigned nItr, const KalmanState *new_state); + + double DeltaRphiForClustering(unsigned layerId, unsigned endcapRing); + double DeltaRForClustering(unsigned endcapRing); + bool isOverlap(const Stub *a, const Stub *b, OVERLAP_TYPE type); + + set getKalmanDeadLayers(bool &remove2PSCut) const; + + // Function to calculate approximation for tilted barrel modules (aka B) copied from Stub class. + float getApproxB(float z, float r) const; + + // Is this HLS code? + virtual bool isHLS() { return false; }; + + protected: + unsigned nPar_; + unsigned nMeas_; + unsigned numEtaRegions_; + + std::vector state_list_; + std::vector stbcl_list_; + + std::vector hxaxtmin; + std::vector hxaxtmax; + std::vector hxmin; + std::vector hxmax; + std::vector hymin; + std::vector hymax; + std::vector hdxmin; + std::vector hdxmax; + std::vector hresmin; + std::vector hresmax; + std::vector hddMeasmin; + std::vector hddMeasmax; + + TH1F *hTrackEta_; + TH1F *hUniqueTrackEta_; + std::map hBarrelStubMaxDistanceMap; + std::map hEndcapStubMaxDistanceMap; + std::map hphiErrorRatioMap; + std::map hstubCombMap; + + TH1F *hndupStub_; + TH1F *hnmergeStub_; + std::map hytMap; + std::map hy0Map; + std::map hyfMap; + std::map hxMap; + std::map hxcovMap; + std::map hkMap; + std::map hresMap; + std::map hmcovMap; + + double hchi2min; + double hchi2max; + + unsigned maxNfitForDump_; + bool dump_; + unsigned int iCurrentPhiSec_; + unsigned int iCurrentEtaReg_; + unsigned int iLastPhiSec_; + unsigned int iLastEtaReg_; + + unsigned int minStubLayersRed_; + + unsigned int numUpdateCalls_; + + const TP *tpa_; + }; + +} // namespace TMTT #endif - - - - diff --git a/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h b/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h index 8c4286f77b01c..1322027476544 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h @@ -28,316 +28,380 @@ using namespace std; namespace TMTT { -class L1fittedTrack : public L1trackBase { - -public: - - // Store a new fitted track, specifying the input Hough transform track, the stubs used for the fit, - // bit-encoded hit layer pattern (numbered by increasing distance from origin), - // the fitted helix parameters & chi2, - // and the number of helix parameters being fitted (=5 if d0 is fitted, or =4 if d0 is not fitted). - // And if track fit declared this to be a valid track (enough stubs left on track after fit etc.). - L1fittedTrack(const Settings* settings, const L1track3D& l1track3D, const vector& stubs, - unsigned int hitPattern, - float qOverPt, float d0, float phi0, float z0, float tanLambda, - float chi2rphi, float chi2rz, unsigned int nHelixParam, bool accepted = true) : - L1trackBase(), - settings_(settings), - l1track3D_(l1track3D), stubs_(stubs), hitPattern_(hitPattern), - qOverPt_(qOverPt), d0_(d0), phi0_(phi0), z0_(z0), tanLambda_(tanLambda), - chi2rphi_(chi2rphi), chi2rz_(chi2rz), - done_bcon_(false), qOverPt_bcon_(qOverPt), d0_bcon_(d0), phi0_bcon_(phi0), chi2rphi_bcon_(chi2rphi), - nHelixParam_(nHelixParam), - iPhiSec_(l1track3D.iPhiSec()), iEtaReg_(l1track3D.iEtaReg()), - optoLinkID_(l1track3D.optoLinkID()), accepted_(accepted), - nSkippedLayers_(0), numUpdateCalls_(0), numIterations_(0), - digitizedTrack_(false), digitalTrack_(settings) - { - // Doesn't make sense to assign stubs to track if fitter rejected it. - if (! accepted) stubs_.clear(); - nLayers_ = Utility::countLayers(settings, stubs); // Count tracker layers these stubs are in - matchedTP_ = Utility::matchingTP(settings, stubs, nMatchedLayers_, matchedStubs_); // Find associated truth particle & calculate info about match. - // Set d0 = 0 for 4 param fit, in case fitter didn't do it. - if (nHelixParam == 4) { - d0_ = 0.; - d0_bcon_ = 0.; + class L1fittedTrack : public L1trackBase { + public: + // Store a new fitted track, specifying the input Hough transform track, the stubs used for the fit, + // bit-encoded hit layer pattern (numbered by increasing distance from origin), + // the fitted helix parameters & chi2, + // and the number of helix parameters being fitted (=5 if d0 is fitted, or =4 if d0 is not fitted). + // And if track fit declared this to be a valid track (enough stubs left on track after fit etc.). + L1fittedTrack(const Settings* settings, + const L1track3D& l1track3D, + const vector& stubs, + unsigned int hitPattern, + float qOverPt, + float d0, + float phi0, + float z0, + float tanLambda, + float chi2rphi, + float chi2rz, + unsigned int nHelixParam, + bool accepted = true) + : L1trackBase(), + settings_(settings), + l1track3D_(l1track3D), + stubs_(stubs), + hitPattern_(hitPattern), + qOverPt_(qOverPt), + d0_(d0), + phi0_(phi0), + z0_(z0), + tanLambda_(tanLambda), + chi2rphi_(chi2rphi), + chi2rz_(chi2rz), + done_bcon_(false), + qOverPt_bcon_(qOverPt), + d0_bcon_(d0), + phi0_bcon_(phi0), + chi2rphi_bcon_(chi2rphi), + nHelixParam_(nHelixParam), + iPhiSec_(l1track3D.iPhiSec()), + iEtaReg_(l1track3D.iEtaReg()), + optoLinkID_(l1track3D.optoLinkID()), + accepted_(accepted), + nSkippedLayers_(0), + numUpdateCalls_(0), + numIterations_(0), + digitizedTrack_(false), + digitalTrack_(settings) { + // Doesn't make sense to assign stubs to track if fitter rejected it. + if (!accepted) + stubs_.clear(); + nLayers_ = Utility::countLayers(settings, stubs); // Count tracker layers these stubs are in + matchedTP_ = Utility::matchingTP(settings, + stubs, + nMatchedLayers_, + matchedStubs_); // Find associated truth particle & calculate info about match. + // Set d0 = 0 for 4 param fit, in case fitter didn't do it. + if (nHelixParam == 4) { + d0_ = 0.; + d0_bcon_ = 0.; + } + if (!settings->hybrid()) { + secTmp_.init(settings, + iPhiSec_, + iEtaReg_); //Sector class used to check if fitted track trajectory is in expected sector. + htRphiTmp_.init( + settings, + iPhiSec_, + iEtaReg_, + secTmp_.etaMin(), + secTmp_.etaMax(), + secTmp_.phiCentre()); // HT class used to identify HT cell that corresponds to fitted helix parameters. + } + this->setConsistentHTcell(); + } + + L1fittedTrack() : L1trackBase(){}; // Creates track object, but doesn't set any variables. + + ~L1fittedTrack() {} + + //--- Optionally set track helix params & chi2 if beam-spot constraint is used (for 5-parameter fit). + void setBeamConstr(float qOverPt_bcon, float phi0_bcon, float chi2rphi_bcon) { + done_bcon_ = true; + qOverPt_bcon_ = qOverPt_bcon; + d0_bcon_ = 0.0, phi0_bcon_ = phi0_bcon; + chi2rphi_bcon_ = chi2rphi_bcon; } - if (! settings->hybrid()) { - secTmp_.init(settings, iPhiSec_, iEtaReg_); //Sector class used to check if fitted track trajectory is in expected sector. - htRphiTmp_.init(settings, iPhiSec_, iEtaReg_, secTmp_.etaMin(), secTmp_.etaMax(), secTmp_.phiCentre()); // HT class used to identify HT cell that corresponds to fitted helix parameters. + + //--- Set/get additional info about fitted track that is specific to individual track fit algorithms (KF, LR, chi2) + //--- and is used for debugging/histogramming purposes. + + void setInfoKF(unsigned int nSkippedLayers, unsigned int numUpdateCalls) { + nSkippedLayers_ = nSkippedLayers; + numUpdateCalls_ = numUpdateCalls; + } + void setInfoKF(unsigned int nSkippedLayers, unsigned int numUpdateCalls, bool consistentHLS) { + this->setInfoKF(nSkippedLayers_, numUpdateCalls_); + // consistentCell_ = consistentHLS; // KF HLS code no longer calculates HT cell consistency. + } + void setInfoLR(int numIterations, std::string lostMatchingState, std::unordered_map stateCalls) { + numIterations_ = numIterations; + lostMatchingState_ = lostMatchingState; + stateCalls_ = stateCalls; + } + void setInfoCHI2() {} + + void getInfoKF(unsigned int& nSkippedLayers, unsigned int& numUpdateCalls) const { + nSkippedLayers = nSkippedLayers_; + numUpdateCalls = numUpdateCalls_; } - this->setConsistentHTcell(); - } - - L1fittedTrack() : L1trackBase() {}; // Creates track object, but doesn't set any variables. - - ~L1fittedTrack() {} - - //--- Optionally set track helix params & chi2 if beam-spot constraint is used (for 5-parameter fit). - void setBeamConstr(float qOverPt_bcon, float phi0_bcon, float chi2rphi_bcon) { - done_bcon_ = true; qOverPt_bcon_ = qOverPt_bcon; d0_bcon_ = 0.0, phi0_bcon_ = phi0_bcon; chi2rphi_bcon_ = chi2rphi_bcon; - } - - //--- Set/get additional info about fitted track that is specific to individual track fit algorithms (KF, LR, chi2) - //--- and is used for debugging/histogramming purposes. - - void setInfoKF( unsigned int nSkippedLayers, unsigned int numUpdateCalls ) { - nSkippedLayers_ = nSkippedLayers; - numUpdateCalls_ = numUpdateCalls; - } - void setInfoKF( unsigned int nSkippedLayers, unsigned int numUpdateCalls, bool consistentHLS ) { - this->setInfoKF(nSkippedLayers_, numUpdateCalls_); - // consistentCell_ = consistentHLS; // KF HLS code no longer calculates HT cell consistency. - } - void setInfoLR( int numIterations, std::string lostMatchingState, std::unordered_map< std::string, int > stateCalls ) { - numIterations_ = numIterations; lostMatchingState_ = lostMatchingState; stateCalls_ = stateCalls; - } - void setInfoCHI2() {} - - void getInfoKF( unsigned int& nSkippedLayers, unsigned int& numUpdateCalls ) const { - nSkippedLayers = nSkippedLayers_; - numUpdateCalls = numUpdateCalls_; - } - void getInfoLR( int& numIterations, std::string& lostMatchingState, std::unordered_map< std::string, int >& stateCalls ) const { - numIterations = numIterations_; lostMatchingState = lostMatchingState_; stateCalls = stateCalls_; - } - void getInfoCHI2() const {} - - //--- Convert fitted track to KFTrackletTrack format, for use with HYBRID. - - KFTrackletTrack returnKFTrackletTrack(){ - KFTrackletTrack trk_(getL1track3D(), getStubs(), getHitPattern(), qOverPt(), d0(), phi0(), z0(), tanLambda(), - chi2rphi(), chi2rz(), nHelixParam(), iPhiSec(), iEtaReg(), accepted()); - return trk_; - } - - - //--- Get the 3D Hough transform track candididate corresponding to the fitted track, - //--- Provide direct access to some of the info it contains. - - // Get track candidate from HT (before fit). - const L1track3D& getL1track3D() const {return l1track3D_;} - - // Get stubs on fitted track (can differ from those on HT track if track fit kicked out stubs with bad residuals) - const vector& getStubs() const {return stubs_;} - // Get number of stubs on fitted track. - unsigned int getNumStubs() const {return stubs_.size();} - // Get number of tracker layers these stubs are in. - unsigned int getNumLayers() const {return nLayers_;} - // Get number of stubs deleted from track candidate by fitter (because they had large residuals) - unsigned int getNumKilledStubs() const {return l1track3D_.getNumStubs() - this->getNumStubs();} - // Get bit-encoded hit pattern (where layer number assigned by increasing distance from origin, according to layers track expected to cross). - unsigned int getHitPattern() const {return hitPattern_;} - - // Get Hough transform cell locations in units of bin number, corresponding to the fitted helix parameters of the track. - // Always uses the beam-spot constrained helix params if they are available. - // (If fitted track is outside HT array, it it put in the closest bin inside it). - pair getCellLocationFit() const {return htRphiTmp_.getCell(this);} - // Also get HT cell determined by Hough transform. - pair getCellLocationHT() const {return l1track3D_.getCellLocationHT();} - - //--- Get information about its association (if any) to a truth Tracking Particle. - //--- Can differ from that of corresponding HT track, if track fit kicked out stubs with bad residuals. - - // Get best matching tracking particle (=nullptr if none). - const TP* getMatchedTP() const {return matchedTP_;} - // Get the matched stubs with this Tracking Particle - const vector& getMatchedStubs() const {return matchedStubs_;} - // Get number of matched stubs with this Tracking Particle - unsigned int getNumMatchedStubs() const {return matchedStubs_.size();} - // Get number of tracker layers with matched stubs with this Tracking Particle - unsigned int getNumMatchedLayers() const {return nMatchedLayers_;} - // Get purity of stubs on track (i.e. fraction matching best Tracking Particle) - float getPurity() const {return getNumMatchedStubs()/float(getNumStubs());} - // Get number of stubs matched to correct TP that were deleted from track candidate by fitter. - unsigned int getNumKilledMatchedStubs() const { - unsigned int nStubCount = l1track3D_.getNumMatchedStubs(); - if (nStubCount > 0) { // Original HT track candidate did match a truth particle - const TP* tp = l1track3D_.getMatchedTP(); - for (const Stub* s : stubs_) { - set assTPs = s->assocTPs(); - if (assTPs.find(tp) != assTPs.end()) nStubCount--; // We found a stub matched to original truth particle that survived fit. + void getInfoLR(int& numIterations, + std::string& lostMatchingState, + std::unordered_map& stateCalls) const { + numIterations = numIterations_; + lostMatchingState = lostMatchingState_; + stateCalls = stateCalls_; + } + void getInfoCHI2() const {} + + //--- Convert fitted track to KFTrackletTrack format, for use with HYBRID. + + KFTrackletTrack returnKFTrackletTrack() { + KFTrackletTrack trk_(getL1track3D(), + getStubs(), + getHitPattern(), + qOverPt(), + d0(), + phi0(), + z0(), + tanLambda(), + chi2rphi(), + chi2rz(), + nHelixParam(), + iPhiSec(), + iEtaReg(), + accepted()); + return trk_; + } + + //--- Get the 3D Hough transform track candididate corresponding to the fitted track, + //--- Provide direct access to some of the info it contains. + + // Get track candidate from HT (before fit). + const L1track3D& getL1track3D() const { return l1track3D_; } + + // Get stubs on fitted track (can differ from those on HT track if track fit kicked out stubs with bad residuals) + const vector& getStubs() const { return stubs_; } + // Get number of stubs on fitted track. + unsigned int getNumStubs() const { return stubs_.size(); } + // Get number of tracker layers these stubs are in. + unsigned int getNumLayers() const { return nLayers_; } + // Get number of stubs deleted from track candidate by fitter (because they had large residuals) + unsigned int getNumKilledStubs() const { return l1track3D_.getNumStubs() - this->getNumStubs(); } + // Get bit-encoded hit pattern (where layer number assigned by increasing distance from origin, according to layers track expected to cross). + unsigned int getHitPattern() const { return hitPattern_; } + + // Get Hough transform cell locations in units of bin number, corresponding to the fitted helix parameters of the track. + // Always uses the beam-spot constrained helix params if they are available. + // (If fitted track is outside HT array, it it put in the closest bin inside it). + pair getCellLocationFit() const { return htRphiTmp_.getCell(this); } + // Also get HT cell determined by Hough transform. + pair getCellLocationHT() const { return l1track3D_.getCellLocationHT(); } + + //--- Get information about its association (if any) to a truth Tracking Particle. + //--- Can differ from that of corresponding HT track, if track fit kicked out stubs with bad residuals. + + // Get best matching tracking particle (=nullptr if none). + const TP* getMatchedTP() const { return matchedTP_; } + // Get the matched stubs with this Tracking Particle + const vector& getMatchedStubs() const { return matchedStubs_; } + // Get number of matched stubs with this Tracking Particle + unsigned int getNumMatchedStubs() const { return matchedStubs_.size(); } + // Get number of tracker layers with matched stubs with this Tracking Particle + unsigned int getNumMatchedLayers() const { return nMatchedLayers_; } + // Get purity of stubs on track (i.e. fraction matching best Tracking Particle) + float getPurity() const { return getNumMatchedStubs() / float(getNumStubs()); } + // Get number of stubs matched to correct TP that were deleted from track candidate by fitter. + unsigned int getNumKilledMatchedStubs() const { + unsigned int nStubCount = l1track3D_.getNumMatchedStubs(); + if (nStubCount > 0) { // Original HT track candidate did match a truth particle + const TP* tp = l1track3D_.getMatchedTP(); + for (const Stub* s : stubs_) { + set assTPs = s->assocTPs(); + if (assTPs.find(tp) != assTPs.end()) + nStubCount--; // We found a stub matched to original truth particle that survived fit. + } + } + return nStubCount; + } + + //--- Get the fitted track helix parameters. + + float qOverPt() const { return qOverPt_; } + float charge() const { return (qOverPt_ > 0 ? 1 : -1); } + float invPt() const { return fabs(qOverPt_); } + float pt() const { return 1. / (1.0e-6 + this->invPt()); } // includes protection against 1/pt = 0. + float d0() const { return d0_; } + float phi0() const { return phi0_; } + float z0() const { return z0_; } + float tanLambda() const { return tanLambda_; } + float theta() const { return atan2(1., tanLambda_); } // Use atan2 to ensure 0 < theta < pi. + float eta() const { return -log(tan(0.5 * this->theta())); } + + //--- Get the fitted helix parameters with beam-spot constraint. + //--- If constraint not applied (e.g. 4 param fit) then these are identical to unconstrained values. + + bool done_bcon() const { return done_bcon_; } // Was beam-spot constraint aplied? + float qOverPt_bcon() const { return qOverPt_bcon_; } + float charge_bcon() const { return (qOverPt_bcon_ > 0 ? 1 : -1); } + float invPt_bcon() const { return fabs(qOverPt_bcon_); } + float pt_bcon() const { return 1. / (1.0e-6 + this->invPt_bcon()); } + float phi0_bcon() const { return phi0_bcon_; } + + // Phi and z coordinates at which track crosses "chosenR" values used by r-phi HT and rapidity sectors respectively. + // (Optionally with beam-spot constraint applied). + float phiAtChosenR(bool beamConstraint) const { + if (beamConstraint) { + return reco::deltaPhi(phi0_bcon_ - ((settings_->invPtToDphi() * settings_->chosenRofPhi()) * qOverPt_bcon_) - + d0_bcon_ / (settings_->chosenRofPhi()), + 0.); + } else { + return reco::deltaPhi(phi0_ - ((settings_->invPtToDphi() * settings_->chosenRofPhi()) * qOverPt_) - + d0_ / (settings_->chosenRofPhi()), + 0.); } } - return nStubCount; - } - - //--- Get the fitted track helix parameters. - - float qOverPt() const {return qOverPt_;} - float charge() const {return (qOverPt_ > 0 ? 1 : -1);} - float invPt() const {return fabs(qOverPt_);} - float pt() const {return 1./(1.0e-6 + this->invPt());} // includes protection against 1/pt = 0. - float d0() const {return d0_;} - float phi0() const {return phi0_;} - float z0() const {return z0_;} - float tanLambda() const {return tanLambda_;} - float theta() const {return atan2(1., tanLambda_);} // Use atan2 to ensure 0 < theta < pi. - float eta() const {return -log(tan(0.5*this->theta()));} - - //--- Get the fitted helix parameters with beam-spot constraint. - //--- If constraint not applied (e.g. 4 param fit) then these are identical to unconstrained values. - - bool done_bcon() const {return done_bcon_;} // Was beam-spot constraint aplied? - float qOverPt_bcon() const {return qOverPt_bcon_;} - float charge_bcon() const {return (qOverPt_bcon_ > 0 ? 1 : -1);} - float invPt_bcon() const {return fabs(qOverPt_bcon_);} - float pt_bcon() const {return 1./(1.0e-6 + this->invPt_bcon());} - float phi0_bcon() const {return phi0_bcon_;} - - // Phi and z coordinates at which track crosses "chosenR" values used by r-phi HT and rapidity sectors respectively. - // (Optionally with beam-spot constraint applied). - float phiAtChosenR(bool beamConstraint) const { - if (beamConstraint) { - return reco::deltaPhi(phi0_bcon_ - ((settings_->invPtToDphi() * settings_->chosenRofPhi()) * qOverPt_bcon_) - d0_bcon_/(settings_->chosenRofPhi()), 0.); - } else { - return reco::deltaPhi(phi0_ - ((settings_->invPtToDphi() * settings_->chosenRofPhi()) * qOverPt_) - d0_/(settings_->chosenRofPhi()), 0.); + float zAtChosenR() const { + return (z0_ + (settings_->chosenRofZ()) * tanLambda_); + } // neglects transverse impact parameter & track curvature. + + // Get the number of helix parameters being fitted (=5 if d0 is fitted or =4 if d0 is not fitted). + float nHelixParam() const { return nHelixParam_; } + + // Get the fit degrees of freedom, chi2 & chi2/DOF (also in r-phi & r-z planes). + unsigned int numDOF() const { return 2 * this->getNumStubs() - nHelixParam_; } + unsigned int numDOFrphi() const { return this->getNumStubs() - (nHelixParam_ - 2); } + unsigned int numDOFrz() const { return this->getNumStubs() - 2; } + float chi2rphi() const { return chi2rphi_; } + float chi2rz() const { return chi2rz_; } + float chi2() const { return chi2rphi_ + chi2rz_; } + float chi2dof() const { return (this->chi2()) / this->numDOF(); } + + //--- Ditto, but if beam-spot constraint is applied. + //--- If constraint not applied (e.g. 4 param fit) then these are identical to unconstrained values. + unsigned int numDOF_bcon() const { return (this->numDOF() - 1); } + unsigned int numDOFrphi_bcon() const { return (this->numDOFrphi() - 1); } + float chi2rphi_bcon() const { return chi2rphi_bcon_; } + float chi2_bcon() const { return chi2rphi_bcon_ + chi2rz_; } + float chi2dof_bcon() const { return (this->chi2_bcon()) / this->numDOF_bcon(); } + + //--- Get phi sector and eta region used by track finding code that this track is in. + unsigned int iPhiSec() const { return iPhiSec_; } + unsigned int iEtaReg() const { return iEtaReg_; } + + //--- Opto-link ID used to send this track from HT to Track Fitter + unsigned int optoLinkID() const { return optoLinkID_; } + + //--- Get whether the track has been rejected or accepted by the fit + + bool accepted() const { return accepted_; } + + // Comparitor useful for sorting tracks by q/Pt using std::sort(). + static bool qOverPtSortPredicate(const L1fittedTrack& t1, const L1fittedTrack t2) { + return t1.qOverPt() < t2.qOverPt(); } - } - float zAtChosenR() const {return (z0_ + (settings_->chosenRofZ()) * tanLambda_);} // neglects transverse impact parameter & track curvature. - - // Get the number of helix parameters being fitted (=5 if d0 is fitted or =4 if d0 is not fitted). - float nHelixParam() const {return nHelixParam_;} - - // Get the fit degrees of freedom, chi2 & chi2/DOF (also in r-phi & r-z planes). - unsigned int numDOF() const {return 2*this->getNumStubs() - nHelixParam_;} - unsigned int numDOFrphi() const {return this->getNumStubs() - (nHelixParam_ - 2);} - unsigned int numDOFrz( ) const {return this->getNumStubs() - 2;} - float chi2rphi() const {return chi2rphi_;} - float chi2rz() const {return chi2rz_;} - float chi2() const {return chi2rphi_ + chi2rz_;} - float chi2dof() const {return (this->chi2())/this->numDOF();} - - //--- Ditto, but if beam-spot constraint is applied. - //--- If constraint not applied (e.g. 4 param fit) then these are identical to unconstrained values. - unsigned int numDOF_bcon() const {return (this->numDOF() - 1);} - unsigned int numDOFrphi_bcon() const {return (this->numDOFrphi() - 1);} - float chi2rphi_bcon() const {return chi2rphi_bcon_;} - float chi2_bcon() const {return chi2rphi_bcon_ + chi2rz_;} - float chi2dof_bcon() const {return (this->chi2_bcon())/this->numDOF_bcon();} - - //--- Get phi sector and eta region used by track finding code that this track is in. - unsigned int iPhiSec() const {return iPhiSec_;} - unsigned int iEtaReg() const {return iEtaReg_;} - - //--- Opto-link ID used to send this track from HT to Track Fitter - unsigned int optoLinkID() const {return optoLinkID_;} - - //--- Get whether the track has been rejected or accepted by the fit - - bool accepted() const { - return accepted_; - } - - // Comparitor useful for sorting tracks by q/Pt using std::sort(). - static bool qOverPtSortPredicate(const L1fittedTrack& t1, const L1fittedTrack t2) { return t1.qOverPt() < t2.qOverPt(); } - - //--- Functions to help eliminate duplicate tracks. - - // Is the fitted track trajectory should lie within the same HT cell in which the track was originally found? - bool consistentHTcell() const {return consistentCell_;} - - // Determine if the fitted track trajectory should lie within the same HT cell in which the track was originally found? - void setConsistentHTcell() { - //return (max(fabs(this->deltaM()), fabs(this->deltaC())) < 0.5); - // Use helix params with beam-spot constaint if done in case of 5 param fit. - - pair htCell = this->getCellLocationHT(); - bool consistent = (htCell == this->getCellLocationFit()); - - if (l1track3D_.mergedHTcell()) { - // If this is a merged cell, check other elements of merged cell. - pair htCell10( htCell.first + 1, htCell.second); - pair htCell01( htCell.first , htCell.second + 1); - pair htCell11( htCell.first + 1, htCell.second + 1); - if (htCell10 == this->getCellLocationFit()) consistent = true; - if (htCell01 == this->getCellLocationFit()) consistent = true; - if (htCell11 == this->getCellLocationFit()) consistent = true; + + //--- Functions to help eliminate duplicate tracks. + + // Is the fitted track trajectory should lie within the same HT cell in which the track was originally found? + bool consistentHTcell() const { return consistentCell_; } + + // Determine if the fitted track trajectory should lie within the same HT cell in which the track was originally found? + void setConsistentHTcell() { + //return (max(fabs(this->deltaM()), fabs(this->deltaC())) < 0.5); + // Use helix params with beam-spot constaint if done in case of 5 param fit. + + pair htCell = this->getCellLocationHT(); + bool consistent = (htCell == this->getCellLocationFit()); + + if (l1track3D_.mergedHTcell()) { + // If this is a merged cell, check other elements of merged cell. + pair htCell10(htCell.first + 1, htCell.second); + pair htCell01(htCell.first, htCell.second + 1); + pair htCell11(htCell.first + 1, htCell.second + 1); + if (htCell10 == this->getCellLocationFit()) + consistent = true; + if (htCell01 == this->getCellLocationFit()) + consistent = true; + if (htCell11 == this->getCellLocationFit()) + consistent = true; + } + + consistentCell_ = consistent; + } + + // Is the fitted track trajectory within the same (eta,phi) sector of the HT used to find it? + bool consistentSector() const { + bool insidePhi = + (fabs(reco::deltaPhi(this->phiAtChosenR(done_bcon_), secTmp_.phiCentre())) < secTmp_.sectorHalfWidth()); + bool insideEta = (this->zAtChosenR() > secTmp_.zAtChosenR_Min() && this->zAtChosenR() < secTmp_.zAtChosenR_Max()); + return (insidePhi && insideEta); } - consistentCell_ = consistent; - } - - // Is the fitted track trajectory within the same (eta,phi) sector of the HT used to find it? - bool consistentSector() const { - bool insidePhi = (fabs(reco::deltaPhi(this->phiAtChosenR(done_bcon_), secTmp_.phiCentre())) < secTmp_.sectorHalfWidth()); - bool insideEta = (this->zAtChosenR() > secTmp_.zAtChosenR_Min() && this->zAtChosenR() < secTmp_.zAtChosenR_Max()); - return (insidePhi && insideEta); - } - - // Digitize track and degrade helix parameter resolution according to effect of digitisation. - void digitizeTrack(const string& fitterName); - - // Access to detailed info about digitized track - const DigitalTrack& digitaltrack() const { return digitalTrack_;} - -private: - - //--- Configuration parameters - const Settings* settings_; - - //--- The 3D hough-transform track candidate which was fitted. - L1track3D l1track3D_; - - //--- The stubs on the fitted track (can differ from those on HT track if fit kicked off stubs with bad residuals) - vector stubs_; - unsigned int nLayers_; - - //--- Bit-encoded hit pattern (where layer number assigned by increasing distance from origin, according to layers track expected to cross). - unsigned int hitPattern_; - - //--- The fitted helix parameters and fit chi-squared. - float qOverPt_; - float d0_; - float phi0_; - float z0_; - float tanLambda_; - float chi2rphi_; - float chi2rz_; - - //--- Ditto with beam-spot constraint applied in case of 5-parameter fit, plus boolean to indicate - bool done_bcon_; - float qOverPt_bcon_; - float d0_bcon_; - float phi0_bcon_; - float chi2rphi_bcon_; - - //--- The number of helix parameters being fitted (=5 if d0 is fitted or =4 if d0 is not fitted). - unsigned int nHelixParam_; - - //--- Phi sector and eta region used track finding code that this track was in. - unsigned int iPhiSec_; - unsigned int iEtaReg_; - //--- Opto-link ID from HT to Track Fitter. - unsigned int optoLinkID_; - - //--- Information about its association (if any) to a truth Tracking Particle. - const TP* matchedTP_; - vector matchedStubs_; - unsigned int nMatchedLayers_; - - //--- Has the track fit declared this to be a valid track? - bool accepted_; - - //--- Sector class used to check if fitted track trajectory is in same sector as HT used to find it. - Sector secTmp_; - //--- r-phi HT class used to determine HT cell location that corresponds to fitted track helix parameters. - HTrphi htRphiTmp_; - - //--- Info specific to KF fitter. - unsigned int nSkippedLayers_; - unsigned int numUpdateCalls_; - //--- Info specific to LR fitter. - int numIterations_; - std::string lostMatchingState_; - std::unordered_map< std::string, int > stateCalls_; - - bool digitizedTrack_; - DigitalTrack digitalTrack_; // Class used to digitize track if required. - - bool consistentCell_; -}; - -} + // Digitize track and degrade helix parameter resolution according to effect of digitisation. + void digitizeTrack(const string& fitterName); + + // Access to detailed info about digitized track + const DigitalTrack& digitaltrack() const { return digitalTrack_; } + + private: + //--- Configuration parameters + const Settings* settings_; + + //--- The 3D hough-transform track candidate which was fitted. + L1track3D l1track3D_; + + //--- The stubs on the fitted track (can differ from those on HT track if fit kicked off stubs with bad residuals) + vector stubs_; + unsigned int nLayers_; + + //--- Bit-encoded hit pattern (where layer number assigned by increasing distance from origin, according to layers track expected to cross). + unsigned int hitPattern_; + + //--- The fitted helix parameters and fit chi-squared. + float qOverPt_; + float d0_; + float phi0_; + float z0_; + float tanLambda_; + float chi2rphi_; + float chi2rz_; + + //--- Ditto with beam-spot constraint applied in case of 5-parameter fit, plus boolean to indicate + bool done_bcon_; + float qOverPt_bcon_; + float d0_bcon_; + float phi0_bcon_; + float chi2rphi_bcon_; + + //--- The number of helix parameters being fitted (=5 if d0 is fitted or =4 if d0 is not fitted). + unsigned int nHelixParam_; + + //--- Phi sector and eta region used track finding code that this track was in. + unsigned int iPhiSec_; + unsigned int iEtaReg_; + //--- Opto-link ID from HT to Track Fitter. + unsigned int optoLinkID_; + + //--- Information about its association (if any) to a truth Tracking Particle. + const TP* matchedTP_; + vector matchedStubs_; + unsigned int nMatchedLayers_; + + //--- Has the track fit declared this to be a valid track? + bool accepted_; + + //--- Sector class used to check if fitted track trajectory is in same sector as HT used to find it. + Sector secTmp_; + //--- r-phi HT class used to determine HT cell location that corresponds to fitted track helix parameters. + HTrphi htRphiTmp_; + + //--- Info specific to KF fitter. + unsigned int nSkippedLayers_; + unsigned int numUpdateCalls_; + //--- Info specific to LR fitter. + int numIterations_; + std::string lostMatchingState_; + std::unordered_map stateCalls_; + + bool digitizedTrack_; + DigitalTrack digitalTrack_; // Class used to digitize track if required. + + bool consistentCell_; + }; + +} // namespace TMTT #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/L1track2D.h b/L1Trigger/TrackFindingTMTT/interface/L1track2D.h index 57711e4829290..829926be2a6af 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1track2D.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1track2D.h @@ -19,112 +19,124 @@ using namespace std; namespace TMTT { -class L1track2D : public L1trackBase { - -public: - - // Give stubs on track, its cell location inside HT array, its 2D helix parameters. - L1track2D(const Settings* settings, const vector& stubs, - pair cellLocationHT, pair helix2D, - unsigned int iPhiSec, unsigned int iEtaReg, unsigned int optoLinkID, bool mergedHTcell) : - L1trackBase(), - settings_(settings), - stubs_(stubs), - cellLocationHT_(cellLocationHT), - helix2D_(helix2D), - estValid_(false), estZ0_(0.), estTanLambda_(0.), - iPhiSec_(iPhiSec), iEtaReg_(iEtaReg), optoLinkID_(optoLinkID), mergedHTcell_(mergedHTcell) - { - nLayers_ = Utility::countLayers(settings, stubs); // Count tracker layers these stubs are in - matchedTP_ = Utility::matchingTP(settings, stubs, nMatchedLayers_, matchedStubs_); // Find associated truth particle & calculate info about match. - } - - L1track2D() : L1trackBase() {}; // Creates track object, but doesn't set any variables. - - ~L1track2D() {} - - //--- Get information about the reconstructed track. - - // Get stubs on track candidate. - const vector& getStubs() const {return stubs_;} - // Get number of stubs on track candidate. - unsigned int getNumStubs() const {return stubs_.size();} - // Get number of tracker layers these stubs are in. - unsigned int getNumLayers() const {return nLayers_;} - // Get cell location of track candidate in Hough Transform array in units of bin number. - pair getCellLocationHT() const {return cellLocationHT_;} - // The two conventionally agreed track helix parameters relevant in this 2D plane. - // i.e. (q/Pt, phi0). - pair getHelix2D() const {return helix2D_;} - - //--- User-friendlier access to the helix parameters obtained from track location inside HT array. - - float qOverPt() const {return helix2D_.first;} - float phi0() const {return helix2D_.second;} - - //--- In the case of tracks found by the r-phi HT, a rough estimate of the (z0, tan_lambda) may be provided by any r-z - //--- track filter run after the r-phi HT. These two functions give set/get access to these. - //--- The "get" function returns a boolean indicating if an estimate exists (i.e. "set" has been called). - - void setTrkEstZ0andTanLam(float estZ0, float estTanLambda) { - estZ0_ = estZ0; estTanLambda_ = estTanLambda; estValid_ = true; - } - - bool getTrkEstZ0andTanLam(float& estZ0, float& estTanLambda) const { - estZ0 = estZ0_; estTanLambda = estTanLambda_; return estValid_; - } - - //--- Get phi sector and eta region used by track finding code that this track is in. - unsigned int iPhiSec() const {return iPhiSec_;} - unsigned int iEtaReg() const {return iEtaReg_;} - - //--- Opto-link ID used to send this track from HT to Track Fitter. Both read & write functions. - unsigned int optoLinkID() const {return optoLinkID_;} - void setOptoLinkID(unsigned int linkID) {optoLinkID_ = linkID;} - - - //--- Was this track produced from a marged HT cell (e.g. 2x2)? - bool mergedHTcell() const {return mergedHTcell_;} - - //--- Get information about its association (if any) to a truth Tracking Particle. - - // Get matching tracking particle (=nullptr if none). - const TP* getMatchedTP() const {return matchedTP_;} - // Get the matched stubs. - const vector& getMatchedStubs() const {return matchedStubs_;} - // Get number of matched stubs. - unsigned int getNumMatchedStubs() const {return matchedStubs_.size();} - // Get number of tracker layers with matched stubs. - unsigned int getNumMatchedLayers() const {return nMatchedLayers_;} - -private: - - //--- Configuration parameters - const Settings* settings_; - - //--- Information about the reconstructed track from Hough transform. - vector stubs_; - unsigned int nLayers_; - pair cellLocationHT_; - pair helix2D_; - - //--- Rough estimate of r-z track parameters from r-z filter, which may be present in case of r-phi Hough transform - bool estValid_; - float estZ0_; - float estTanLambda_; - - unsigned int iPhiSec_; - unsigned int iEtaReg_; - unsigned int optoLinkID_; - - bool mergedHTcell_; - - //--- Information about its association (if any) to a truth Tracking Particle. - const TP* matchedTP_; - vector matchedStubs_; - unsigned int nMatchedLayers_; -}; - -} + class L1track2D : public L1trackBase { + public: + // Give stubs on track, its cell location inside HT array, its 2D helix parameters. + L1track2D(const Settings* settings, + const vector& stubs, + pair cellLocationHT, + pair helix2D, + unsigned int iPhiSec, + unsigned int iEtaReg, + unsigned int optoLinkID, + bool mergedHTcell) + : L1trackBase(), + settings_(settings), + stubs_(stubs), + cellLocationHT_(cellLocationHT), + helix2D_(helix2D), + estValid_(false), + estZ0_(0.), + estTanLambda_(0.), + iPhiSec_(iPhiSec), + iEtaReg_(iEtaReg), + optoLinkID_(optoLinkID), + mergedHTcell_(mergedHTcell) { + nLayers_ = Utility::countLayers(settings, stubs); // Count tracker layers these stubs are in + matchedTP_ = Utility::matchingTP(settings, + stubs, + nMatchedLayers_, + matchedStubs_); // Find associated truth particle & calculate info about match. + } + + L1track2D() : L1trackBase(){}; // Creates track object, but doesn't set any variables. + + ~L1track2D() {} + + //--- Get information about the reconstructed track. + + // Get stubs on track candidate. + const vector& getStubs() const { return stubs_; } + // Get number of stubs on track candidate. + unsigned int getNumStubs() const { return stubs_.size(); } + // Get number of tracker layers these stubs are in. + unsigned int getNumLayers() const { return nLayers_; } + // Get cell location of track candidate in Hough Transform array in units of bin number. + pair getCellLocationHT() const { return cellLocationHT_; } + // The two conventionally agreed track helix parameters relevant in this 2D plane. + // i.e. (q/Pt, phi0). + pair getHelix2D() const { return helix2D_; } + + //--- User-friendlier access to the helix parameters obtained from track location inside HT array. + + float qOverPt() const { return helix2D_.first; } + float phi0() const { return helix2D_.second; } + + //--- In the case of tracks found by the r-phi HT, a rough estimate of the (z0, tan_lambda) may be provided by any r-z + //--- track filter run after the r-phi HT. These two functions give set/get access to these. + //--- The "get" function returns a boolean indicating if an estimate exists (i.e. "set" has been called). + + void setTrkEstZ0andTanLam(float estZ0, float estTanLambda) { + estZ0_ = estZ0; + estTanLambda_ = estTanLambda; + estValid_ = true; + } + + bool getTrkEstZ0andTanLam(float& estZ0, float& estTanLambda) const { + estZ0 = estZ0_; + estTanLambda = estTanLambda_; + return estValid_; + } + + //--- Get phi sector and eta region used by track finding code that this track is in. + unsigned int iPhiSec() const { return iPhiSec_; } + unsigned int iEtaReg() const { return iEtaReg_; } + + //--- Opto-link ID used to send this track from HT to Track Fitter. Both read & write functions. + unsigned int optoLinkID() const { return optoLinkID_; } + void setOptoLinkID(unsigned int linkID) { optoLinkID_ = linkID; } + + //--- Was this track produced from a marged HT cell (e.g. 2x2)? + bool mergedHTcell() const { return mergedHTcell_; } + + //--- Get information about its association (if any) to a truth Tracking Particle. + + // Get matching tracking particle (=nullptr if none). + const TP* getMatchedTP() const { return matchedTP_; } + // Get the matched stubs. + const vector& getMatchedStubs() const { return matchedStubs_; } + // Get number of matched stubs. + unsigned int getNumMatchedStubs() const { return matchedStubs_.size(); } + // Get number of tracker layers with matched stubs. + unsigned int getNumMatchedLayers() const { return nMatchedLayers_; } + + private: + //--- Configuration parameters + const Settings* settings_; + + //--- Information about the reconstructed track from Hough transform. + vector stubs_; + unsigned int nLayers_; + pair cellLocationHT_; + pair helix2D_; + + //--- Rough estimate of r-z track parameters from r-z filter, which may be present in case of r-phi Hough transform + bool estValid_; + float estZ0_; + float estTanLambda_; + + unsigned int iPhiSec_; + unsigned int iEtaReg_; + unsigned int optoLinkID_; + + bool mergedHTcell_; + + //--- Information about its association (if any) to a truth Tracking Particle. + const TP* matchedTP_; + vector matchedStubs_; + unsigned int nMatchedLayers_; + }; + +} // namespace TMTT #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/L1track3D.h b/L1Trigger/TrackFindingTMTT/interface/L1track3D.h index f627bc08e2203..d5387998f4b6e 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1track3D.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1track3D.h @@ -23,223 +23,254 @@ using namespace std; namespace TMTT { -class L1track3D : public L1trackBase { - -public: - - L1track3D(const Settings* settings, const vector& stubs, - pair cellLocationHT, pair helixRphi, pair helixRz, float helixD0, - unsigned int iPhiSec, unsigned int iEtaReg, unsigned int optoLinkID, bool mergedHTcell) : - L1trackBase(), - settings_(settings), - stubs_(stubs), - cellLocationHT_(cellLocationHT), helixRphi_(helixRphi), helixRz_ (helixRz), helixD0_(helixD0), - iPhiSec_(iPhiSec), iEtaReg_(iEtaReg), optoLinkID_(optoLinkID), mergedHTcell_(mergedHTcell), - seedLayerType_(999), seedPS_(999) - { - nLayers_ = Utility::countLayers(settings, stubs); // Count tracker layers these stubs are in - matchedTP_ = Utility::matchingTP(settings, stubs, nMatchedLayers_, matchedStubs_); // Find associated truth particle & calculate info about match. - } - - L1track3D(const Settings* settings, const vector& stubs, - pair cellLocationHT, pair helixRphi, pair helixRz, - unsigned int iPhiSec, unsigned int iEtaReg, unsigned int optoLinkID, bool mergedHTcell) : - L1track3D(settings, stubs, cellLocationHT, helixRphi, helixRz, 0.0, iPhiSec, iEtaReg, optoLinkID, mergedHTcell){} - - L1track3D() : L1trackBase() {}; // Creates track object, but doesn't set any variables. - - ~L1track3D() {} - - //--- Set/get optional info for tracklet tracks. - - // Tracklet seeding layer pair (from FPGATracklet::seedIndex()) - // 0-7 = "L1L2","L2L3","L3L4","L5L6","D1D2","D3D4","L1D1","L2D1" - void setSeedLayerType(unsigned int seedLayerType) {seedLayerType_ = seedLayerType;} - unsigned int seedLayerType() const {return seedLayerType_;} - - // Tracklet seed stub pair uses PS modules (from FPGATracket::PSseed()) - void setSeedPS(unsigned int seedPS) {seedPS_ = seedPS;} - unsigned int seedPS() const {return seedPS_;} - - // Best stub (stub with smallest Phi residual in each layer/disk) - void setBestStubs(std::unordered_set bestStubs) {bestStubs_ = bestStubs;} - std::unordered_set bestStubs() const {return bestStubs_;} - - //--- Get information about the reconstructed track. - - // Get stubs on track candidate. - const vector& getStubs() const {return stubs_;} - // Get number of stubs on track candidate. - unsigned int getNumStubs() const {return stubs_.size();} - // Get number of tracker layers these stubs are in. - unsigned int getNumLayers() const {return nLayers_;} - // Get cell location of track candidate in r-phi Hough Transform array in units of bin number. - pair getCellLocationHT() const {return cellLocationHT_;} - // The two conventionally agreed track helix parameters relevant in r-phi plane. i.e. (q/Pt, phi0) - pair getHelixRphi() const {return helixRphi_;} - // The two conventionally agreed track helix parameters relevant in r-z plane. i.e. (z0, tan_lambda) - pair getHelixRz() const {return helixRz_;} - - //--- Return chi variables, (both digitized & undigitized), which are the stub coords. relative to track. - - vector getChiPhi() { - vector result; - for (const Stub* s: stubs_) { - float chi_phi = reco::deltaPhi(s->phi(), this->phi0() - s->r() * this->qOverPt() * settings_->invPtToDphi()); - result.push_back(chi_phi); + class L1track3D : public L1trackBase { + public: + L1track3D(const Settings* settings, + const vector& stubs, + pair cellLocationHT, + pair helixRphi, + pair helixRz, + float helixD0, + unsigned int iPhiSec, + unsigned int iEtaReg, + unsigned int optoLinkID, + bool mergedHTcell) + : L1trackBase(), + settings_(settings), + stubs_(stubs), + cellLocationHT_(cellLocationHT), + helixRphi_(helixRphi), + helixRz_(helixRz), + helixD0_(helixD0), + iPhiSec_(iPhiSec), + iEtaReg_(iEtaReg), + optoLinkID_(optoLinkID), + mergedHTcell_(mergedHTcell), + seedLayerType_(999), + seedPS_(999) { + nLayers_ = Utility::countLayers(settings, stubs); // Count tracker layers these stubs are in + matchedTP_ = Utility::matchingTP(settings, + stubs, + nMatchedLayers_, + matchedStubs_); // Find associated truth particle & calculate info about match. } - return result; - } - - vector getChiPhiDigi() { - vector result; - static const float phiMult = pow(2, settings_->phiSBits()) / settings_->phiSRange(); - for (const float& chi_phi: this->getChiPhi()) { - int iDigi_chi_phi = floor(chi_phi * phiMult); - result.push_back(iDigi_chi_phi); - } - return result; - } - - vector getChiZ() { - vector result; - for (const Stub* s: stubs_) { - float chi_z = s->z() - (this->z0() + s->r()*this->tanLambda()); - result.push_back(chi_z); - } - return result; - } - - vector getChiZDigi() { - vector result; - static const float zMult = pow(2, settings_->zBits()) / settings_->zRange(); - for (const float& chi_z: this->getChiZ()) { - int iDigi_chi_z = floor(chi_z * zMult); - result.push_back(iDigi_chi_z); - } - return result; - } - - //--- User-friendlier access to the helix parameters. - - float qOverPt() const {return helixRphi_.first;} - float charge() const {return (this->qOverPt() > 0 ? 1 : -1);} - float invPt() const {return fabs(this->qOverPt());} - float pt() const {return 1./(1.0e-6 + this->invPt());} // includes protection against 1/pt = 0. - float d0() const {return helixD0_;} // Hough transform assumes d0 = 0. - float phi0() const {return helixRphi_.second;} - float z0() const {return helixRz_.first;} - float tanLambda() const {return helixRz_.second;} - float theta() const {return atan2(1., this->tanLambda());} // Use atan2 to ensure 0 < theta < pi. - float eta() const {return -log(tan(0.5*this->theta()));} - - // Phi and z coordinates at which track crosses "chosenR" values used by r-phi HT and rapidity sectors respectively. - float phiAtChosenR() const {return reco::deltaPhi(this->phi0() - (settings_->invPtToDphi() * settings_->chosenRofPhi()) * this->qOverPt(), 0.);} - float zAtChosenR() const {return (this->z0() + (settings_->chosenRofZ()) * this->tanLambda());} // neglects transverse impact parameter & track curvature. - - //--- Get phi sector and eta region used by track finding code that this track is in. - unsigned int iPhiSec() const {return iPhiSec_;} - unsigned int iEtaReg() const {return iEtaReg_;} - - //--- Opto-link ID used to send this track from HT to Track Fitter - unsigned int optoLinkID() const {return optoLinkID_;} - - //--- Was this track produced from a marged HT cell (e.g. 2x2)? - bool mergedHTcell() const {return mergedHTcell_;} - - //--- Get information about its association (if any) to a truth Tracking Particle. - - // Get best matching tracking particle (=nullptr if none). - const TP* getMatchedTP() const {return matchedTP_;} - // Get the matched stubs with this Tracking Particle - const vector& getMatchedStubs() const {return matchedStubs_;} - // Get number of matched stubs with this Tracking Particle - unsigned int getNumMatchedStubs() const {return matchedStubs_.size();} - // Get number of tracker layers with matched stubs with this Tracking Particle - unsigned int getNumMatchedLayers() const {return nMatchedLayers_;} - // Get purity of stubs on track candidate (i.e. fraction matching best Tracking Particle) - float getPurity() const {return getNumMatchedStubs()/float(getNumStubs());} - - //--- For debugging purposes. - - // Remove incorrect stubs from the track using truth information. - // Also veto tracks where the HT cell estimated from the true helix parameters is inconsistent with the cell the HT found the track in, (since probable duplicates). - // Also veto tracks that match a truth particle not used for the algo efficiency measurement. - // Return a boolean indicating if the track should be kept. (i.e. Is genuine & non-duplicate). - bool cheat() { - bool keep = false; - - vector stubsSel; - if (matchedTP_ != nullptr) { // Genuine track + + L1track3D(const Settings* settings, + const vector& stubs, + pair cellLocationHT, + pair helixRphi, + pair helixRz, + unsigned int iPhiSec, + unsigned int iEtaReg, + unsigned int optoLinkID, + bool mergedHTcell) + : L1track3D( + settings, stubs, cellLocationHT, helixRphi, helixRz, 0.0, iPhiSec, iEtaReg, optoLinkID, mergedHTcell) {} + + L1track3D() : L1trackBase(){}; // Creates track object, but doesn't set any variables. + + ~L1track3D() {} + + //--- Set/get optional info for tracklet tracks. + + // Tracklet seeding layer pair (from FPGATracklet::seedIndex()) + // 0-7 = "L1L2","L2L3","L3L4","L5L6","D1D2","D3D4","L1D1","L2D1" + void setSeedLayerType(unsigned int seedLayerType) { seedLayerType_ = seedLayerType; } + unsigned int seedLayerType() const { return seedLayerType_; } + + // Tracklet seed stub pair uses PS modules (from FPGATracket::PSseed()) + void setSeedPS(unsigned int seedPS) { seedPS_ = seedPS; } + unsigned int seedPS() const { return seedPS_; } + + // Best stub (stub with smallest Phi residual in each layer/disk) + void setBestStubs(std::unordered_set bestStubs) { bestStubs_ = bestStubs; } + std::unordered_set bestStubs() const { return bestStubs_; } + + //--- Get information about the reconstructed track. + + // Get stubs on track candidate. + const vector& getStubs() const { return stubs_; } + // Get number of stubs on track candidate. + unsigned int getNumStubs() const { return stubs_.size(); } + // Get number of tracker layers these stubs are in. + unsigned int getNumLayers() const { return nLayers_; } + // Get cell location of track candidate in r-phi Hough Transform array in units of bin number. + pair getCellLocationHT() const { return cellLocationHT_; } + // The two conventionally agreed track helix parameters relevant in r-phi plane. i.e. (q/Pt, phi0) + pair getHelixRphi() const { return helixRphi_; } + // The two conventionally agreed track helix parameters relevant in r-z plane. i.e. (z0, tan_lambda) + pair getHelixRz() const { return helixRz_; } + + //--- Return chi variables, (both digitized & undigitized), which are the stub coords. relative to track. + + vector getChiPhi() { + vector result; for (const Stub* s : stubs_) { - const TP* tp = s->assocTP(); - if (tp != nullptr) { - if (matchedTP_->index() == tp->index()) { - stubsSel.push_back(s); // This stub was produced by same truth particle as rest of track, so keep it. - } - } + float chi_phi = reco::deltaPhi(s->phi(), this->phi0() - s->r() * this->qOverPt() * settings_->invPtToDphi()); + result.push_back(chi_phi); } + return result; } - stubs_ = stubsSel; - - nLayers_ = Utility::countLayers(settings_, stubs_); // Count tracker layers these stubs are in - matchedTP_ = Utility::matchingTP(settings_, stubs_, nMatchedLayers_, matchedStubs_); // Find associated truth particle & calculate info about match. - - bool genuine = (matchedTP_ != nullptr); - - if (genuine && matchedTP_->useForAlgEff()) { - Sector secTmp; - HTrphi htRphiTmp; - secTmp.init(settings_, iPhiSec_, iEtaReg_); - htRphiTmp.init(settings_, iPhiSec_, iEtaReg_, secTmp.etaMin(), secTmp.etaMax(), secTmp.phiCentre()); - pair trueCell = htRphiTmp.trueCell(matchedTP_); - - pair htCell = this->getCellLocationHT(); - bool consistent = (htCell == trueCell); // If true, track is probably not a duplicate. - if (mergedHTcell_) { - // If this is a merged cell, check other elements of merged cell. - pair htCell10( htCell.first + 1, htCell.second); - pair htCell01( htCell.first , htCell.second + 1); - pair htCell11( htCell.first + 1, htCell.second + 1); - if (htCell10 == trueCell) consistent = true; - if (htCell01 == trueCell) consistent = true; - if (htCell11 == trueCell) consistent = true; + + vector getChiPhiDigi() { + vector result; + static const float phiMult = pow(2, settings_->phiSBits()) / settings_->phiSRange(); + for (const float& chi_phi : this->getChiPhi()) { + int iDigi_chi_phi = floor(chi_phi * phiMult); + result.push_back(iDigi_chi_phi); } - if (consistent) keep = true; + return result; } - return keep; // Indicate if track should be kept. - } - - -private: - - //--- Configuration parameters - const Settings* settings_; + vector getChiZ() { + vector result; + for (const Stub* s : stubs_) { + float chi_z = s->z() - (this->z0() + s->r() * this->tanLambda()); + result.push_back(chi_z); + } + return result; + } - //--- Information about the reconstructed track. - vector stubs_; - unordered_set bestStubs_; - unsigned int nLayers_; - pair cellLocationHT_; - pair helixRphi_; - pair helixRz_; - float helixD0_; - unsigned int iPhiSec_; - unsigned int iEtaReg_; - unsigned int optoLinkID_; - bool mergedHTcell_; + vector getChiZDigi() { + vector result; + static const float zMult = pow(2, settings_->zBits()) / settings_->zRange(); + for (const float& chi_z : this->getChiZ()) { + int iDigi_chi_z = floor(chi_z * zMult); + result.push_back(iDigi_chi_z); + } + return result; + } - //--- Optional info used for tracklet tracks. - unsigned int seedLayerType_; - unsigned int seedPS_; + //--- User-friendlier access to the helix parameters. + + float qOverPt() const { return helixRphi_.first; } + float charge() const { return (this->qOverPt() > 0 ? 1 : -1); } + float invPt() const { return fabs(this->qOverPt()); } + float pt() const { return 1. / (1.0e-6 + this->invPt()); } // includes protection against 1/pt = 0. + float d0() const { return helixD0_; } // Hough transform assumes d0 = 0. + float phi0() const { return helixRphi_.second; } + float z0() const { return helixRz_.first; } + float tanLambda() const { return helixRz_.second; } + float theta() const { return atan2(1., this->tanLambda()); } // Use atan2 to ensure 0 < theta < pi. + float eta() const { return -log(tan(0.5 * this->theta())); } + + // Phi and z coordinates at which track crosses "chosenR" values used by r-phi HT and rapidity sectors respectively. + float phiAtChosenR() const { + return reco::deltaPhi(this->phi0() - (settings_->invPtToDphi() * settings_->chosenRofPhi()) * this->qOverPt(), + 0.); + } + float zAtChosenR() const { + return (this->z0() + (settings_->chosenRofZ()) * this->tanLambda()); + } // neglects transverse impact parameter & track curvature. + + //--- Get phi sector and eta region used by track finding code that this track is in. + unsigned int iPhiSec() const { return iPhiSec_; } + unsigned int iEtaReg() const { return iEtaReg_; } + + //--- Opto-link ID used to send this track from HT to Track Fitter + unsigned int optoLinkID() const { return optoLinkID_; } + + //--- Was this track produced from a marged HT cell (e.g. 2x2)? + bool mergedHTcell() const { return mergedHTcell_; } + + //--- Get information about its association (if any) to a truth Tracking Particle. + + // Get best matching tracking particle (=nullptr if none). + const TP* getMatchedTP() const { return matchedTP_; } + // Get the matched stubs with this Tracking Particle + const vector& getMatchedStubs() const { return matchedStubs_; } + // Get number of matched stubs with this Tracking Particle + unsigned int getNumMatchedStubs() const { return matchedStubs_.size(); } + // Get number of tracker layers with matched stubs with this Tracking Particle + unsigned int getNumMatchedLayers() const { return nMatchedLayers_; } + // Get purity of stubs on track candidate (i.e. fraction matching best Tracking Particle) + float getPurity() const { return getNumMatchedStubs() / float(getNumStubs()); } + + //--- For debugging purposes. + + // Remove incorrect stubs from the track using truth information. + // Also veto tracks where the HT cell estimated from the true helix parameters is inconsistent with the cell the HT found the track in, (since probable duplicates). + // Also veto tracks that match a truth particle not used for the algo efficiency measurement. + // Return a boolean indicating if the track should be kept. (i.e. Is genuine & non-duplicate). + bool cheat() { + bool keep = false; + + vector stubsSel; + if (matchedTP_ != nullptr) { // Genuine track + for (const Stub* s : stubs_) { + const TP* tp = s->assocTP(); + if (tp != nullptr) { + if (matchedTP_->index() == tp->index()) { + stubsSel.push_back(s); // This stub was produced by same truth particle as rest of track, so keep it. + } + } + } + } + stubs_ = stubsSel; + + nLayers_ = Utility::countLayers(settings_, stubs_); // Count tracker layers these stubs are in + matchedTP_ = Utility::matchingTP(settings_, + stubs_, + nMatchedLayers_, + matchedStubs_); // Find associated truth particle & calculate info about match. + + bool genuine = (matchedTP_ != nullptr); + + if (genuine && matchedTP_->useForAlgEff()) { + Sector secTmp; + HTrphi htRphiTmp; + secTmp.init(settings_, iPhiSec_, iEtaReg_); + htRphiTmp.init(settings_, iPhiSec_, iEtaReg_, secTmp.etaMin(), secTmp.etaMax(), secTmp.phiCentre()); + pair trueCell = htRphiTmp.trueCell(matchedTP_); + + pair htCell = this->getCellLocationHT(); + bool consistent = (htCell == trueCell); // If true, track is probably not a duplicate. + if (mergedHTcell_) { + // If this is a merged cell, check other elements of merged cell. + pair htCell10(htCell.first + 1, htCell.second); + pair htCell01(htCell.first, htCell.second + 1); + pair htCell11(htCell.first + 1, htCell.second + 1); + if (htCell10 == trueCell) + consistent = true; + if (htCell01 == trueCell) + consistent = true; + if (htCell11 == trueCell) + consistent = true; + } + if (consistent) + keep = true; + } - //--- Information about its association (if any) to a truth Tracking Particle. - const TP* matchedTP_; - vector matchedStubs_; - unsigned int nMatchedLayers_; -}; + return keep; // Indicate if track should be kept. + } -} + private: + //--- Configuration parameters + const Settings* settings_; + + //--- Information about the reconstructed track. + vector stubs_; + unordered_set bestStubs_; + unsigned int nLayers_; + pair cellLocationHT_; + pair helixRphi_; + pair helixRz_; + float helixD0_; + unsigned int iPhiSec_; + unsigned int iEtaReg_; + unsigned int optoLinkID_; + bool mergedHTcell_; + + //--- Optional info used for tracklet tracks. + unsigned int seedLayerType_; + unsigned int seedPS_; + + //--- Information about its association (if any) to a truth Tracking Particle. + const TP* matchedTP_; + vector matchedStubs_; + unsigned int nMatchedLayers_; + }; + +} // namespace TMTT #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h b/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h index 73709b9cc4122..3386a5f020475 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h @@ -13,55 +13,53 @@ using namespace std; namespace TMTT { -class Stub; -class TP; + class Stub; + class TP; -class L1trackBase { + class L1trackBase { + protected: + L1trackBase() {} -protected: + virtual ~L1trackBase() {} - L1trackBase() {} + //--- Get information about the reconstructed track. - virtual ~L1trackBase() {} + // Get stubs on track candidate. + virtual const vector& getStubs() const = 0; + // Get number of stubs on track candidate. + virtual unsigned int getNumStubs() const = 0; + // Get number of tracker layers these stubs are in. + virtual unsigned int getNumLayers() const = 0; - //--- Get information about the reconstructed track. + //--- User-friendly access to the helix parameters. - // Get stubs on track candidate. - virtual const vector& getStubs() const = 0; - // Get number of stubs on track candidate. - virtual unsigned int getNumStubs() const = 0; - // Get number of tracker layers these stubs are in. - virtual unsigned int getNumLayers() const = 0; + virtual float qOverPt() const = 0; + virtual float phi0() const = 0; + //virtual float z0() const = 0; + //virtual float tanLambda() const = 0; - //--- User-friendly access to the helix parameters. + //--- Cell locations of the track candidate in the r-phi Hough transform array in units of bin number. + virtual pair getCellLocationHT() const = 0; - virtual float qOverPt() const = 0; - virtual float phi0() const = 0; - //virtual float z0() const = 0; - //virtual float tanLambda() const = 0; + //--- Get phi sector and eta region used by track finding code that this track is in. + virtual unsigned int iPhiSec() const = 0; + virtual unsigned int iEtaReg() const = 0; - //--- Cell locations of the track candidate in the r-phi Hough transform array in units of bin number. - virtual pair getCellLocationHT() const = 0; + //--- Opto-link ID used to send this track from HT to Track Fitter + virtual unsigned int optoLinkID() const = 0; - //--- Get phi sector and eta region used by track finding code that this track is in. - virtual unsigned int iPhiSec() const = 0; - virtual unsigned int iEtaReg() const = 0; + //--- Get information about its association (if any) to a truth Tracking Particle. - //--- Opto-link ID used to send this track from HT to Track Fitter - virtual unsigned int optoLinkID() const = 0; + // Get matching tracking particle (=nullptr if none). + virtual const TP* getMatchedTP() const = 0; + // Get the matched stubs. + virtual const vector& getMatchedStubs() const = 0; + // Get number of matched stubs. + virtual unsigned int getNumMatchedStubs() const = 0; + // Get number of tracker layers with matched stubs. + virtual unsigned int getNumMatchedLayers() const = 0; + }; - //--- Get information about its association (if any) to a truth Tracking Particle. - - // Get matching tracking particle (=nullptr if none). - virtual const TP* getMatchedTP() const = 0; - // Get the matched stubs. - virtual const vector& getMatchedStubs() const = 0; - // Get number of matched stubs. - virtual unsigned int getNumMatchedStubs() const = 0; - // Get number of tracker layers with matched stubs. - virtual unsigned int getNumMatchedLayers() const = 0; -}; - -} +} // namespace TMTT #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/Matrix.h b/L1Trigger/TrackFindingTMTT/interface/Matrix.h index 474ead9f777f3..b970b68626543 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Matrix.h +++ b/L1Trigger/TrackFindingTMTT/interface/Matrix.h @@ -1,63 +1,60 @@ #ifndef __L1TRK_MATRIX_H__ #define __L1TRK_MATRIX_H__ - + #include - + namespace TMTT { -template class Matrix { - private: - std::vector > mat; - unsigned rows; - unsigned cols; - - public: - Matrix(); - Matrix(unsigned _rows, unsigned _cols, const T& _initial); - Matrix(const Matrix& rhs); - virtual ~Matrix(); - - // Operator overloading, for "standard" mathematical matrix operations - Matrix& operator=(const Matrix& rhs); - - // Matrix mathematical operations - Matrix operator+(const Matrix& rhs); - Matrix& operator+=(const Matrix& rhs); - Matrix operator-(const Matrix& rhs); - Matrix& operator-=(const Matrix& rhs); - Matrix operator*(const Matrix& rhs); - Matrix& operator*=(const Matrix& rhs); - Matrix transpose(); - T determinant(); - Matrix cofactor(); - Matrix inverse(); - - // Matrix/scalar operations - Matrix operator+(const T& rhs); - Matrix operator-(const T& rhs); - Matrix operator*(const T& rhs); - Matrix operator/(const T& rhs); - - // Matrix/vector operations - std::vector operator*(const std::vector& rhs); - std::vector diag_vec(); - - // Access the individual elements - T& operator()(const unsigned& row, const unsigned& col); - const T& operator()(const unsigned& row, const unsigned& col) const; - - // Access the row and column sizes - unsigned get_rows() const; - unsigned get_cols() const; - - // Print to stdout - void print(); - -}; - -} - -#endif - - + template + class Matrix { + private: + std::vector > mat; + unsigned rows; + unsigned cols; + + public: + Matrix(); + Matrix(unsigned _rows, unsigned _cols, const T& _initial); + Matrix(const Matrix& rhs); + virtual ~Matrix(); + + // Operator overloading, for "standard" mathematical matrix operations + Matrix& operator=(const Matrix& rhs); + + // Matrix mathematical operations + Matrix operator+(const Matrix& rhs); + Matrix& operator+=(const Matrix& rhs); + Matrix operator-(const Matrix& rhs); + Matrix& operator-=(const Matrix& rhs); + Matrix operator*(const Matrix& rhs); + Matrix& operator*=(const Matrix& rhs); + Matrix transpose(); + T determinant(); + Matrix cofactor(); + Matrix inverse(); + + // Matrix/scalar operations + Matrix operator+(const T& rhs); + Matrix operator-(const T& rhs); + Matrix operator*(const T& rhs); + Matrix operator/(const T& rhs); + // Matrix/vector operations + std::vector operator*(const std::vector& rhs); + std::vector diag_vec(); + + // Access the individual elements + T& operator()(const unsigned& row, const unsigned& col); + const T& operator()(const unsigned& row, const unsigned& col) const; + + // Access the row and column sizes + unsigned get_rows() const; + unsigned get_cols() const; + + // Print to stdout + void print(); + }; + +} // namespace TMTT + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h b/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h index 4f428f1a60560..ca6f91a07edb0 100644 --- a/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h +++ b/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h @@ -8,52 +8,53 @@ using boost::numeric::ublas::matrix; namespace TMTT { -class Settings; - -class MiniHTstage { - -public: - - MiniHTstage( const Settings* settings ); - - ~MiniHTstage(){}; - - void exec( matrix< HTrphi >& mHtRphis ); - -private: - - // Do load balancing - unsigned int linkIDLoadBalanced(unsigned int link, unsigned int mBin, unsigned int cBin, unsigned int numStubs, map< pair, unsigned int>& numStubsPerLinkStage1, map< pair, unsigned int>& numStubsPerLinkStage2, bool test = false) const; - -private: - - const Settings* settings_; // Configuration parameters - bool miniHTstage_; - unsigned int muxOutputsHT_; - unsigned int houghNbinsPt_; - unsigned int houghNbinsPhi_; - unsigned int miniHoughLoadBalance_; - unsigned int miniHoughNbinsPt_; - unsigned int miniHoughNbinsPhi_; - float miniHoughMinPt_; - bool miniHoughDontKill_; - float miniHoughDontKillMinPt_; - unsigned int numSubSecsEta_; - unsigned int numPhiNonants_; - unsigned int numPhiSecPerNon_; - unsigned int numEtaRegions_; - bool busySectorKill_; - unsigned int busySectorNumStubs_; - vector< unsigned int > busySectorMbinRanges_; - float chosenRofPhi_; - float binSizeQoverPtAxis_; - float binSizePhiTrkAxis_; - float invPtToDphi_; - unsigned int nMiniHTcells_; - unsigned int nHTlinksPerNonant_; -}; - -} + class Settings; + + class MiniHTstage { + public: + MiniHTstage(const Settings* settings); + + ~MiniHTstage(){}; + + void exec(matrix& mHtRphis); + + private: + // Do load balancing + unsigned int linkIDLoadBalanced(unsigned int link, + unsigned int mBin, + unsigned int cBin, + unsigned int numStubs, + map, unsigned int>& numStubsPerLinkStage1, + map, unsigned int>& numStubsPerLinkStage2, + bool test = false) const; + + private: + const Settings* settings_; // Configuration parameters + bool miniHTstage_; + unsigned int muxOutputsHT_; + unsigned int houghNbinsPt_; + unsigned int houghNbinsPhi_; + unsigned int miniHoughLoadBalance_; + unsigned int miniHoughNbinsPt_; + unsigned int miniHoughNbinsPhi_; + float miniHoughMinPt_; + bool miniHoughDontKill_; + float miniHoughDontKillMinPt_; + unsigned int numSubSecsEta_; + unsigned int numPhiNonants_; + unsigned int numPhiSecPerNon_; + unsigned int numEtaRegions_; + bool busySectorKill_; + unsigned int busySectorNumStubs_; + vector busySectorMbinRanges_; + float chosenRofPhi_; + float binSizeQoverPtAxis_; + float binSizePhiTrkAxis_; + float invPtToDphi_; + unsigned int nMiniHTcells_; + unsigned int nHTlinksPerNonant_; + }; + +} // namespace TMTT #endif - diff --git a/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h b/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h index 90889e30f891b..1b2073529a15e 100644 --- a/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h +++ b/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h @@ -24,56 +24,54 @@ using boost::numeric::ublas::matrix; namespace TMTT { -class Settings; - -class MuxHToutputs { - -public: - - // Initialize constants from configuration parameters. - MuxHToutputs(const Settings* settings); - - ~MuxHToutputs() {} - - // Determine which tracks are transmitted on each HT output optical link, taking into account the multiplexing - // of multiple (eta,phi) sectors onto single links and the truncation of the tracks caused by the requirement - // to output all the tracks within the time-multiplexed period. - // This function replaces the 2D track collection in the r-phi HT with the subset surviving the TM cut. - void exec(matrix& mHtRphis) const; - - // Determine number of optical links used to output tracks from each phi nonant - // (where "link" refers to a pair of links in the hardware). - unsigned int numLinksPerNonant() const {unsigned int iCorr = (settings_->miniHTstage()) ? 1 : 0; return numPhiSecPerNon_ * numEtaRegions_ * (busySectorMbinRanges_.size() - iCorr)/ this->muxFactor();} - -private: - - // Define the number of (eta,phi) sectors that each output opto-link takes tracks from. (Depends on MUX scheme). - unsigned int muxFactor() const; - - // Define the MUX algorithm by which tracks from the specified m-bin range in the HT for a given (phi,eta) - // sector within a phi nonant are multiplexed onto a single output optical link. - unsigned int linkID(unsigned int iSecInNon, unsigned int iEtaReg, unsigned int mBinRange) const; - - // Do sanity check of the MUX algorithm implemented in linkID(). - void sanityCheck(); - -private: - - const Settings* settings_; // Configuration parameters - - // Configuration parameters - unsigned int muxOutputsHT_; - unsigned int numPhiNonants_; - unsigned int numPhiSectors_; - unsigned int numPhiSecPerNon_; - unsigned int numEtaRegions_; - bool busySectorKill_; - unsigned int busySectorNumStubs_; - vector busySectorMbinRanges_; - bool busySectorUseMbinRanges_; -}; - -} + class Settings; + + class MuxHToutputs { + public: + // Initialize constants from configuration parameters. + MuxHToutputs(const Settings* settings); + + ~MuxHToutputs() {} + + // Determine which tracks are transmitted on each HT output optical link, taking into account the multiplexing + // of multiple (eta,phi) sectors onto single links and the truncation of the tracks caused by the requirement + // to output all the tracks within the time-multiplexed period. + // This function replaces the 2D track collection in the r-phi HT with the subset surviving the TM cut. + void exec(matrix& mHtRphis) const; + + // Determine number of optical links used to output tracks from each phi nonant + // (where "link" refers to a pair of links in the hardware). + unsigned int numLinksPerNonant() const { + unsigned int iCorr = (settings_->miniHTstage()) ? 1 : 0; + return numPhiSecPerNon_ * numEtaRegions_ * (busySectorMbinRanges_.size() - iCorr) / this->muxFactor(); + } + + private: + // Define the number of (eta,phi) sectors that each output opto-link takes tracks from. (Depends on MUX scheme). + unsigned int muxFactor() const; + + // Define the MUX algorithm by which tracks from the specified m-bin range in the HT for a given (phi,eta) + // sector within a phi nonant are multiplexed onto a single output optical link. + unsigned int linkID(unsigned int iSecInNon, unsigned int iEtaReg, unsigned int mBinRange) const; + + // Do sanity check of the MUX algorithm implemented in linkID(). + void sanityCheck(); + + private: + const Settings* settings_; // Configuration parameters + + // Configuration parameters + unsigned int muxOutputsHT_; + unsigned int numPhiNonants_; + unsigned int numPhiSectors_; + unsigned int numPhiSecPerNon_; + unsigned int numEtaRegions_; + bool busySectorKill_; + unsigned int busySectorNumStubs_; + vector busySectorMbinRanges_; + bool busySectorUseMbinRanges_; + }; + +} // namespace TMTT #endif - diff --git a/L1Trigger/TrackFindingTMTT/interface/Sector.h b/L1Trigger/TrackFindingTMTT/interface/Sector.h index 86144290af33d..04b6ea11ba810 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Sector.h +++ b/L1Trigger/TrackFindingTMTT/interface/Sector.h @@ -10,104 +10,133 @@ using namespace std; namespace TMTT { -class Settings; -class Stub; - -class Sector { - -public: - - Sector() : settings_(nullptr), beamWindowZ_(0), trackerOuterRadius_(0), trackerInnerRadius_(0), trackerHalfLength_(0), handleStripsPhiSec_(0), handleStripsEtaSec_(0), iPhiSec_(0), iEtaReg_(0), etaMin_(0), etaMax_(0), chosenRofZ_(0), rOuterMax_(0), zOuterMax_(0), rOuterMin_(0), zOuterMin_(0), phiCentre_(0), sectorHalfWidth_(0), chosenRofPhi_(0), useStubPhi_(0), minPt_(0), useStubPhiTrk_(0), assumedPhiTrkRes_(0), calcPhiTrkRes_(0), numSubSecsEta_(0), zOuterMinSub_(), zOuterMaxSub_() {} - - ~Sector() {} - - // Initialization. - void init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaSec); - - // Check if stub within the eta and/or phi boundaries of this sector. - bool inside ( const Stub* stub ) const {return (this->insideEta(stub) && this->insidePhi(stub));} - bool insideEta( const Stub* stub ) const; - bool insidePhi( const Stub* stub ) const; - - // Check if stub is within subsectors in eta that sector may be divided into. - vector insideEtaSubSecs( const Stub* stub) const; - - unsigned int iPhiSec() const { return iPhiSec_; } // Sector number. - unsigned int iEtaReg() const { return iEtaReg_; } - float phiCentre() const { return phiCentre_; } // Return phi of centre of this sector. - float etaMin() const { return etaMin_; } // Eta range covered by this sector. - float etaMax() const { return etaMax_; } // Eta range covered by this sector. - - float sectorHalfWidth() const {return sectorHalfWidth_;} // Half width in phi of sector measured in radians. - float zAtChosenR_Min() const {return zOuterMin_;} // Range in z of particle at chosen radius from beam line covered by this sector. - float zAtChosenR_Max() const {return zOuterMax_;} - - // For performance studies, note which stubs on given tracking particle are inside the sector. - // Returns two booleans for each stub, indicating if they are in phi & eta sectors respectively. - // You can AND them together to check if stub is in (eta,phi) sector. - unordered_map> stubsInside ( const TP& tp) const; - - // Count number of stubs in given tracking particle which are inside this (phi,eta) sector; - // or inside it if only the eta cuts are applied; or inside it if only the phi cuts are applied. - // The results are returned as the 3 last arguments of the function. - void numStubsInside( const TP& tp, - unsigned int& nStubsInsideEtaPhi, unsigned int& nStubsInsideEta, - unsigned int& nStubsInsidePhi) const ; - - // Check if the helix parameters of a tracking particle (truth) are consistent with this sector. - bool insidePhiSec(const TP& tp) const {return (fabs(tp.trkPhiAtR(chosenRofPhi_) - phiCentre_) < sectorHalfWidth_);} - bool insideEtaReg(const TP& tp) const {return (tp.trkZAtR(chosenRofZ_) > zOuterMin_ && tp.trkZAtR(chosenRofZ_) < zOuterMax_);} - -private: - - // Check if stub is within eta sector or subsector that is delimated by specified zTrk range. - bool insideEtaRange( const Stub* stub, float zRangeMin, float zRangeMax) const; - - // Digitize a floating point number to 2s complement integer, dropping anything after the decimal point. (Kristian Harder) - Long64_t forceBitWidth( const float value, const UInt_t nBits ) const; - - // Check if stub is within subsectors in eta that sector may be divided into. Uses digitized calculation corresponding to GP firmware. (Kristian Harder) - vector subEtaFwCalc(const int rT, const int z) const; - -private: - - const Settings* settings_; - - float beamWindowZ_; - float trackerOuterRadius_; - float trackerInnerRadius_; - float trackerHalfLength_; - bool handleStripsPhiSec_; - bool handleStripsEtaSec_; - - // Define eta region. - unsigned int iPhiSec_; // Sector number - unsigned int iEtaReg_; - float etaMin_; // Range in eta covered by this sector. - float etaMax_; - float chosenRofZ_; // Use z of track at radius="chosenRofZ" to define eta sectors. - float rOuterMax_; // Larger eta boundary point (r,z) - float zOuterMax_; - float rOuterMin_; // Smaller eta boundary point (r,z) - float zOuterMin_; - - // Define phi sector. - float phiCentre_; // phi of centre of sector. - float sectorHalfWidth_; // sector half-width excluding overlaps. - float chosenRofPhi_; // Use phi of track at radius="chosenRofPhi" to define phi sectors. - bool useStubPhi_; // Require stub phi to be consistent with track of Pt > HTArraySpec.HoughMinPt that crosses HT phi axis? - float minPt_; // Min Pt covered by HT array. - bool useStubPhiTrk_; // Require stub phi0 (or phi65 etc.) as estimated from stub bend, to lie within HT phi axis, allowing tolerance specified below? - float assumedPhiTrkRes_; // Tolerance in stub phi0 (or phi65) assumed to be this fraction of phi sector width. (N.B. If > 0.5, then stubs can be shared by more than 2 phi sectors). - bool calcPhiTrkRes_; // If true, tolerance in stub phi0 (or phi65 etc.) will be reduced below AssumedPhiTrkRes if stub bend resolution specified in HTFilling.BendResolution suggests it is safe to do so. - - // Possible subsectors in eta within each sector. - unsigned int numSubSecsEta_; - vector zOuterMinSub_; - vector zOuterMaxSub_; -}; - -} + class Settings; + class Stub; + + class Sector { + public: + Sector() + : settings_(nullptr), + beamWindowZ_(0), + trackerOuterRadius_(0), + trackerInnerRadius_(0), + trackerHalfLength_(0), + handleStripsPhiSec_(0), + handleStripsEtaSec_(0), + iPhiSec_(0), + iEtaReg_(0), + etaMin_(0), + etaMax_(0), + chosenRofZ_(0), + rOuterMax_(0), + zOuterMax_(0), + rOuterMin_(0), + zOuterMin_(0), + phiCentre_(0), + sectorHalfWidth_(0), + chosenRofPhi_(0), + useStubPhi_(0), + minPt_(0), + useStubPhiTrk_(0), + assumedPhiTrkRes_(0), + calcPhiTrkRes_(0), + numSubSecsEta_(0), + zOuterMinSub_(), + zOuterMaxSub_() {} + + ~Sector() {} + + // Initialization. + void init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaSec); + + // Check if stub within the eta and/or phi boundaries of this sector. + bool inside(const Stub* stub) const { return (this->insideEta(stub) && this->insidePhi(stub)); } + bool insideEta(const Stub* stub) const; + bool insidePhi(const Stub* stub) const; + + // Check if stub is within subsectors in eta that sector may be divided into. + vector insideEtaSubSecs(const Stub* stub) const; + + unsigned int iPhiSec() const { return iPhiSec_; } // Sector number. + unsigned int iEtaReg() const { return iEtaReg_; } + float phiCentre() const { return phiCentre_; } // Return phi of centre of this sector. + float etaMin() const { return etaMin_; } // Eta range covered by this sector. + float etaMax() const { return etaMax_; } // Eta range covered by this sector. + + float sectorHalfWidth() const { return sectorHalfWidth_; } // Half width in phi of sector measured in radians. + float zAtChosenR_Min() const { + return zOuterMin_; + } // Range in z of particle at chosen radius from beam line covered by this sector. + float zAtChosenR_Max() const { return zOuterMax_; } + + // For performance studies, note which stubs on given tracking particle are inside the sector. + // Returns two booleans for each stub, indicating if they are in phi & eta sectors respectively. + // You can AND them together to check if stub is in (eta,phi) sector. + unordered_map> stubsInside(const TP& tp) const; + + // Count number of stubs in given tracking particle which are inside this (phi,eta) sector; + // or inside it if only the eta cuts are applied; or inside it if only the phi cuts are applied. + // The results are returned as the 3 last arguments of the function. + void numStubsInside(const TP& tp, + unsigned int& nStubsInsideEtaPhi, + unsigned int& nStubsInsideEta, + unsigned int& nStubsInsidePhi) const; + + // Check if the helix parameters of a tracking particle (truth) are consistent with this sector. + bool insidePhiSec(const TP& tp) const { + return (fabs(tp.trkPhiAtR(chosenRofPhi_) - phiCentre_) < sectorHalfWidth_); + } + bool insideEtaReg(const TP& tp) const { + return (tp.trkZAtR(chosenRofZ_) > zOuterMin_ && tp.trkZAtR(chosenRofZ_) < zOuterMax_); + } + + private: + // Check if stub is within eta sector or subsector that is delimated by specified zTrk range. + bool insideEtaRange(const Stub* stub, float zRangeMin, float zRangeMax) const; + + // Digitize a floating point number to 2s complement integer, dropping anything after the decimal point. (Kristian Harder) + Long64_t forceBitWidth(const float value, const UInt_t nBits) const; + + // Check if stub is within subsectors in eta that sector may be divided into. Uses digitized calculation corresponding to GP firmware. (Kristian Harder) + vector subEtaFwCalc(const int rT, const int z) const; + + private: + const Settings* settings_; + + float beamWindowZ_; + float trackerOuterRadius_; + float trackerInnerRadius_; + float trackerHalfLength_; + bool handleStripsPhiSec_; + bool handleStripsEtaSec_; + + // Define eta region. + unsigned int iPhiSec_; // Sector number + unsigned int iEtaReg_; + float etaMin_; // Range in eta covered by this sector. + float etaMax_; + float chosenRofZ_; // Use z of track at radius="chosenRofZ" to define eta sectors. + float rOuterMax_; // Larger eta boundary point (r,z) + float zOuterMax_; + float rOuterMin_; // Smaller eta boundary point (r,z) + float zOuterMin_; + + // Define phi sector. + float phiCentre_; // phi of centre of sector. + float sectorHalfWidth_; // sector half-width excluding overlaps. + float chosenRofPhi_; // Use phi of track at radius="chosenRofPhi" to define phi sectors. + bool useStubPhi_; // Require stub phi to be consistent with track of Pt > HTArraySpec.HoughMinPt that crosses HT phi axis? + float minPt_; // Min Pt covered by HT array. + bool useStubPhiTrk_; // Require stub phi0 (or phi65 etc.) as estimated from stub bend, to lie within HT phi axis, allowing tolerance specified below? + float assumedPhiTrkRes_; // Tolerance in stub phi0 (or phi65) assumed to be this fraction of phi sector width. (N.B. If > 0.5, then stubs can be shared by more than 2 phi sectors). + bool calcPhiTrkRes_; // If true, tolerance in stub phi0 (or phi65 etc.) will be reduced below AssumedPhiTrkRes if stub bend resolution specified in HTFilling.BendResolution suggests it is safe to do so. + + // Possible subsectors in eta within each sector. + unsigned int numSubSecsEta_; + vector zOuterMinSub_; + vector zOuterMaxSub_; + }; + +} // namespace TMTT #endif - diff --git a/L1Trigger/TrackFindingTMTT/interface/Settings.h b/L1Trigger/TrackFindingTMTT/interface/Settings.h index 25c8ec649ab27..f8d63bfced81b 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Settings.h +++ b/L1Trigger/TrackFindingTMTT/interface/Settings.h @@ -12,683 +12,738 @@ using namespace std; namespace TMTT { -class Settings { - -public: - - // Constructor for HYBRID (sets config to hard-wired consts to allow use outside CMSSW). - Settings(); - - // Constructor for TMTT (reads config from python cfg) - Settings(const edm::ParameterSet& iConfig); - - ~Settings(){} - - //=== General settings. - - // Enable all use of MC truth info (disable to save CPU). - bool enableMCtruth() const {return enableMCtruth_;} - // Enable output histograms & job tracking performance summary (disable to save CPU). - bool enableHistos() const {return enableHistos_;} - - //=== Cuts on MC truth tracks for tracking efficiency measurements. - - double genMinPt() const {return genMinPt_;} - double genMaxAbsEta() const {return genMaxAbsEta_;} - double genMaxVertR() const {return genMaxVertR_;} - double genMaxVertZ() const {return genMaxVertZ_;} - double genMaxD0() const {return genMaxD0_;} - double genMaxZ0() const {return genMaxZ0_;} - vector genPdgIds() const {return genPdgIds_;} - // Additional cut on MC truth tracks for algorithmic tracking efficiency measurements. - unsigned int genMinStubLayers() const {return genMinStubLayers_;} // Min. number of layers TP made stub in. - - //=== Cuts applied to stubs before arriving in L1 track finding board. - - // Reduce number of bits used by front-end chips to store stub bend info? - // = 0 (no); = 1 (yes using official recipe); = 2 (yes using TMTT method) - unsigned int degradeBendRes() const {return degradeBendRes_;} - // Don't use stubs with eta beyond this cut, since the tracker geometry makes it impossible to reconstruct tracks with them. - double maxStubEta() const {return maxStubEta_;} - // Don't use stubs whose measured Pt from bend info is significantly below HTArraySpec.HoughMinPt, where "significantly" means allowing for resolution in q/Pt derived from stub bend resolution HTFilling.BendResolution - bool killLowPtStubs() const {return killLowPtStubs_;} - // Print stub windows corresponding to KillLowPtStubs, in python cfg format used by CMSSW. - bool printStubWindows() const {return printStubWindows_;} - // Bend resolution assumed by bend filter in units of strip pitch. Also used when assigning stubs to sectors if calcPhiTrkRes() is true. - double bendResolution() const {return bendResolution_;} - // Additional contribution to bend resolution from its encoding into a reduced number of bits. - // This number is the assumed resolution relative to the naive guess of its value. - // It is ignored in DegradeBendRes = 0. - double bendResolutionExtra() const {return bendResolutionExtra_;} - // Order stubs by bend in DTC, such that highest Pt stubs are transmitted first. - bool orderStubsByBend() const {return orderStubsByBend_;} - - //=== Optional stub digitization configuration - - bool enableDigitize() const {return enableDigitize_;} - //--- Parameters available in MP board. - unsigned int phiSectorBits() const {return phiSectorBits_;} - unsigned int phiSBits() const {return phiSBits_;} - double phiSRange() const {return phiSRange_;} - unsigned int rtBits() const {return rtBits_;} - double rtRange() const {return rtRange_;} - unsigned int zBits() const {return zBits_;} - double zRange() const {return zRange_;} - //--- Parameters available in GP board (excluding any in common with MP specified above). - unsigned int phiOBits() const {return phiOBits_;} - double phiORange() const {return phiORange_;} - unsigned int bendBits() const {return bendBits_;} - - //=== Configuration of Geometric Processor. - // Use an FPGA-friendly approximation to determine track angle dphi from bend in GP? - bool useApproxB() const {return useApproxB_;} - double bApprox_gradient() const {return bApprox_gradient_;} - double bApprox_intercept() const {return bApprox_intercept_;} - - //=== Definition of phi sectors. - - unsigned int numPhiNonants() const {return numPhiNonants_;} - unsigned int numPhiSectors() const {return numPhiSectors_;} - double chosenRofPhi() const {return chosenRofPhi_;} // 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. - bool useStubPhi() const {return useStubPhi_;} // Require stub phi to be consistent with track of Pt > HTArraySpec.HoughMinPt that crosses HT phi axis? - bool useStubPhiTrk() const {return useStubPhiTrk_;} // Require stub phi0 (or phi65 etc.) as estimated from stub bend, to lie within HT phi axis, allowing tolerance specified below? - double assumedPhiTrkRes() const {return assumedPhiTrkRes_;} // Tolerance in stub phi0 (or phi65) assumed to be this fraction of phi sector width. (N.B. If > 0.5, then stubs can be shared by more than 2 phi sectors). - bool calcPhiTrkRes() const {return calcPhiTrkRes_;} // If true, tolerance in stub phi0 (or phi65 etc.) will be reduced below AssumedPhiTrkRes if stub bend resolution specified in StubCuts.BendResolution suggests it is safe to do so. - bool handleStripsPhiSec() const {return handleStripsPhiSec_;} // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when assigning stubs to phi sectors? - - //=== Definition of eta sectors. - - vector etaRegions() const {return etaRegions_;} // Boundaries of eta regions de - unsigned int numEtaRegions() const {return (etaRegions_.size() - 1);} - double chosenRofZ() const {return chosenRofZ_;} // Use z of track at this radius for assignment of stubs to phi sectors & also for one of the axes of the r-z HT. - double beamWindowZ() const {return beamWindowZ_;} // Half-width of window supposed to contain beam-spot in z. - bool handleStripsEtaSec() const {return handleStripsEtaSec_;} // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when assigning stubs to eta sectors? - bool allowOver2EtaSecs() const {return allowOver2EtaSecs_;} // If True, the code will not throw an error if a stub is assigned to 3 or more eta sectors. - - //=== r-phi Hough transform array specifications. - - double houghMinPt() const {return houghMinPt_;} - unsigned int houghNbinsPt() const {return houghNbinsPt_;} // Dimension in any q/Pt related variable. Not valid if houghNcellsRphi() > 0. (If MiniHTstage = True, this refers to mini cells in whole HT array). - unsigned int houghNbinsPhi() const {return houghNbinsPhi_;} // Dimension in any track-phi related variable. Not valid if houghNcellsRphi() > 0. (If MiniHTstage = True, this refers to mini cells in whole HT array). - int houghNcellsRphi() const {return houghNcellsRphi_;} // Required no. of cells in r-phi HT array. If > 0, then parameters HoughNbinsPt and HoughNbinsPhi will be calculated from the constraints that their product should equal HoughNcellsRz and their ratio should make the maximum |gradient|" of stub lines in the HT array equal to 1. If <= 0, then HoughNbinsPt and HoughNbinsPhi will be taken from the values configured above. - bool enableMerge2x2() const {return enableMerge2x2_;} // Groups of neighbouring 2x2 cells in HT will be treated as if they are a single large cell. (Also enabled in MiniHTstage = True). - double maxPtToMerge2x2() const {return maxPtToMerge2x2_;} // but only cells with pt < maxPtToMerge2x2() will be merged in this way (irrelevant if enableMerge2x2() = false). - unsigned int numSubSecsEta() const {return numSubSecsEta_;} // Subdivide each sector into this number of subsectors in eta within r-phi HT. - unsigned int shape() const {return shape_;} // define cell shape (0 square, 1 diamond, 2 hexagon) - // Run 2nd stage HT with mini cells inside each 1st stage normal HT cell. N.B. This automatically sets EnableMerge2x2 = True & MaxPtToMerge = 999999. - bool miniHTstage() const {return miniHTstage_;} - // Number of mini cells along q/Pt & phi axes inside each normal HT cell. - unsigned int miniHoughNbinsPt() const {return miniHoughNbinsPt_;} - unsigned int miniHoughNbinsPhi() const {return miniHoughNbinsPhi_;} - // Below this Pt threshold, the mini HT will not be used, so only tracks found by 1st stage coarse HT will be output. (Used to improve low Pt tracking). (HT cell numbering remains as if mini HT were in use everywhere). - float miniHoughMinPt() const {return miniHoughMinPt_;} - // If true, allows tracks found by 1st stage coarse HT to be output if 2nd stage mini HT finds no tracks. - bool miniHoughDontKill() const {return miniHoughDontKill_;} - // If MiniHoughDontKill=True, this option restricts it to keep 1st stage HT tracks only if their Pt is exceeds this cut. (Used to improve electron tracking above this threshold). - float miniHoughDontKillMinPt() const {return miniHoughDontKillMinPt_;} - // load balancing disabled = 0; static load balancing of output links = 1; dynamic load balancing of output links = 2. - unsigned int miniHoughLoadBalance() const {return miniHoughLoadBalance_;} - - //=== Rules governing how stubs are filled into the r-phi Hough Transform array. - - // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when filling stubs in r-phi HT? - bool handleStripsRphiHT() const {return handleStripsRphiHT_;} - // Take all cells in HT array crossed by line corresponding to each stub (= 0) or take only some to reduce rate at cost - // of efficiency ( > 0). If this option is > 0, it can be 1 or 2, corresponding to different algorithms for rejecting some of the cells. - unsigned int killSomeHTCellsRphi() const {return killSomeHTCellsRphi_;} - // Use filter in each HT cell using only stubs which have consistent bend, allowing for resolution specified in StubCuts.BendResolution. - bool useBendFilter() const {return useBendFilter_;} - // A filter is used each HT cell, which prevents more than the specified number of stubs being stored in the cell. (Reflecting memory limit of hardware). N.B. If mini-HT is in use, then this cut applies to coarse-HT. - unsigned int maxStubsInCell() const {return maxStubsInCell_;} - // Similar cut for Mini-HT. - unsigned int maxStubsInCellMiniHough() const {return maxStubsInCellMiniHough_;} - // If this returns true, and if more than busySectorNumStubs() stubs are assigned to tracks by an r-phi HT array, then - // the excess tracks are killed, with lowest Pt ones killed first. This is because hardware has finite readout time. - bool busySectorKill() const {return busySectorKill_;} - unsigned int busySectorNumStubs() const {return busySectorNumStubs_;} - // If this returns a non-empty vector, then the BusySectorNumStubs cut is instead applied to the subset of tracks appearing in the following m bin ranges (q/Pt) of the HT array. The sum of the entries in the vector should equal the number of m bins in the HT, although the entries will be rescaled if this is not the case. If the vector is empty, this option is disabled. (P.S. If the HT includes "merged" cells, then the m bin ranges specified here should correspond to the bins before merging). - vector busySectorMbinRanges() const {return busySectorMbinRanges_;} - // If BusySecMbinOrder is empty, then the groupings specified in BusySectorMbinRanges are applied to the m bins in the order - // 0,1,2,3,4,5 ... . If it is not empty, then they are grouped in the order specified here. - vector busySectorMbinOrder() const {return busySectorMbinOrder_;} - // If this is True, and more than BusyInputSectorNumStubs() are input to the HT array from the GP, then - // the excess stubs are killed. This is because HT hardware has finite readin time. - bool busyInputSectorKill() const {return busyInputSectorKill_;} - unsigned int busyInputSectorNumStubs() const {return busyInputSectorNumStubs_;} - // Multiplex the outputs from several HTs onto a single pair of output optical links? - // Options: 0 = disable Mux; 1 = Dec. 2016 Mux; 2 = Mar 2018 Mux (transverse HT readout by m-bin); - // 3 = Sept 2019 Mux (transverse HT readout by m-bin) - unsigned int muxOutputsHT() const {return muxOutputsHT_;} - // Is specified eta sector enabled? - bool isHTRPhiEtaRegWhitelisted(unsigned const iEtaReg) const; - - //=== Options controlling r-z track filters (or any other track filters run after the Hough transform, as opposed to inside it). - - // Specify preferred r-z filter (from those available inside TrkRZfilter.cc) - currently only "SeedFilter". - string rzFilterName() const {return rzFilterName_;} - // --- Options relevant for Seed filter, (so only relevant if rzFilterName()="SeedFilter"). - // Added resolution beyond that estimated from hit resolution. - double seedResolution() const {return seedResolution_;} - // Store stubs compatible with all possible good seed (relevant for Seed filter)? - bool keepAllSeed() const {return keepAllSeed_;} - // Maximum number of seed combinations to check (relevant for Seed filter). - unsigned int maxSeedCombinations() const {return maxSeedCombinations_;} - // Maximum number of seed combinations consistent with (z0,eta) sector constraints to bother checking per track candidate. - unsigned int maxGoodSeedCombinations() const {return maxGoodSeedCombinations_;} - // Maximum number of seeds that a single stub can be included in. - unsigned int maxSeedsPerStub() const {return maxSeedsPerStub_;} - // Check that estimated zTrk from seeding stub is within the sector boundaries (relevant for Seed filter)? - bool zTrkSectorCheck() const {return zTrkSectorCheck_;} - // Min. number of layers in rz track that must have stubs for track to be declared found. - unsigned int minFilterLayers() const {return minFilterLayers_;} - - //=== Rules for deciding when the (HT) track finding has found an L1 track candidate - - // Min. number of layers in HT cell that must have stubs for track to be declared found. - unsigned int minStubLayers() const {return minStubLayers_;} - // Change min. number of layers cut to (MinStubLayers - 1) for tracks with Pt exceeding this cut. - // If this is set to > 10000, this option is disabled. - double minPtToReduceLayers() const {return minPtToReduceLayers_;} - // Change min. number of layers cut to (MinStubLayers - 1) for tracks in these rapidity sectors. - vector etaSecsReduceLayers() const {return etaSecsReduceLayers_;} - // Define layers using layer ID (true) or by bins in radius of 5 cm width (false)? - bool useLayerID() const {return useLayerID_;} - //Reduce this layer ID, so that it takes no more than 8 different values in any eta region (simplifies firmware)? - bool reduceLayerID() const {return reduceLayerID_;} - - //=== Specification of algorithm to eliminate duplicate tracks - - // --- Which algorithms are enabled. - // Algorithm used for duplicate removal of 2D tracks produced by r-phi HT. - unsigned int dupTrkAlgRphi() const {return dupTrkAlgRphi_;} - // Algorithm run on all 3D tracks within each sector after r-z track filter. (Ignored if r-z track filter not run). - unsigned int dupTrkAlg3D() const {return dupTrkAlg3D_;} - // Algorithm run on tracks after the track helix fit has been done. - unsigned int dupTrkAlgFit() const {return dupTrkAlgFit_;} - //--- Options used by individual algorithms. - unsigned int dupTrkMinCommonHitsLayers() const {return dupTrkMinCommonHitsLayers_;} - - //=== Rules for deciding when a reconstructed L1 track matches a MC truth particle (i.e. tracking particle). - - //--- Three different ways to define if a tracking particle matches a reco track candidate. (Usually, set two of them to ultra loose). - // Min. fraction of matched stubs relative to number of stubs on reco track. - double minFracMatchStubsOnReco() const {return minFracMatchStubsOnReco_;} - // Min. fraction of matched stubs relative to number of stubs on tracking particle. - double minFracMatchStubsOnTP() const {return minFracMatchStubsOnTP_;} - // Min. number of matched layers & min. number of matched PS layers.. - unsigned int minNumMatchLayers() const {return minNumMatchLayers_;} - unsigned int minNumMatchPSLayers() const {return minNumMatchPSLayers_;} - // Associate stub to TP only if the TP contributed to both its clusters? (If False, then associate even if only one cluster was made by TP). - bool stubMatchStrict() const {return stubMatchStrict_;} - - //=== Track Fitting Settings - - //--- Options applicable to all track fitters --- - - // Track fitting algorithms to use. You can run several in parallel. - vector trackFitters() const {return trackFitters_;} - // Indicate subset of fitters wanting r-z track filter to be run before them. - // (Excludes fitters that are not run). - vector useRZfilter() const {return useRZfilter_;} - // Print detailed summary of track fit performance at end of job (as opposed to a brief one)? - bool detailedFitOutput() const {return detailedFitOutput_;} - // Use MC truth to eliminate all fake tracks & all incorrect stubs assigned to tracks before doing fit. - bool trackFitCheat() const {return trackFitCheat_;} - - //--- Options for chi2 track fitter --- - - // Number of iterations that the track fit should perform. - unsigned int numTrackFitIterations() const {return numTrackFitIterations_;} - // Optionally remove hit with worst residual in track fit? (Only used by chi2 track fit). - bool killTrackFitWorstHit() const {return killTrackFitWorstHit_;} - // Cuts in standard deviations used to kill hits with big residuals during fit. If the residual exceeds the "General" - // cut, the hit is killed providing it leaves the track with enough hits to survive. If the residual exceeds the - // "Killing" cut, the hit is killed even if that kills the track. - double generalResidualCut() const {return generalResidualCut_;} - double killingResidualCut() const {return killingResidualCut_;} - - //--- Additional options for Thomas Schuh's Linear Regression track fitter --- - - // Max allowed iterations. - unsigned int maxIterationsLR() const { return maxIterationsLR_;} - // Internal histograms are filled if it is True - bool LRFillInternalHists() const { return LRFillInternalHists_;} - bool combineResiduals() const { return combineResiduals_; } - bool lineariseStubPosition() const { return lineariseStubPosition_; } - bool checkSectorConsistency() const { return checkSectorConsistency_; } - bool checkHTCellConsistency() const { return checkHTCellConsistency_; } - unsigned int minPSLayers() const { return minPSLayers_; } - // Digitization - bool digitizeLR() const { return digitizeLR_; } - float PhiPrecision() const { return PhiPrecision_; } - float RPrecision() const { return RPrecision_; } - float ZPrecision() const { return ZPrecision_; } - unsigned int ZSlopeWidth() const { return ZSlopeWidth_; } - unsigned int ZInterceptWidth() const { return ZInterceptWidth_; } - - //--- Additional options for Davide Cieri's Simple Linear Regression track fitter --- - - // Digitize Simple Linear Regression variables & calculation. (Disabled if EnableDigitize=False). - bool digitizeSLR() const {return digitizeSLR_;} - /// Number of bits to be used in hardware to compute the division needed to calculate the helix parameters - unsigned int dividerBitsHelix() const {return dividerBitsHelix_;} - unsigned int dividerBitsHelixZ() const {return dividerBitsHelixZ_;} - /// Number of bits to reduce the RPhi helix parameter denominator calculation weight - unsigned int ShiftingBitsDenRPhi() const {return ShiftingBitsDenRPhi_;} - - /// Number of bits to reduce the RZ helix parameter denominator calculation weight - unsigned int ShiftingBitsDenRZ() const {return ShiftingBitsDenRZ_;} - /// Number of bits to reduce the qOverPt parameter numerator calculation weight - unsigned int ShiftingBitsPt() const {return ShiftingBitsPt_;} - /// Number of bits to reduce the PhiT parameter numerator calculation weight - unsigned int ShiftingBitsPhi() const {return ShiftingBitsPhi_;} - /// Number of bits to reduce the tanLambda parameter calculation weight - unsigned int ShiftingBitsLambda() const {return ShiftingBitsLambda_;} - /// Number of bits to reduce the tanLambda parameter calculation weight - unsigned int ShiftingBitsZ0() const {return ShiftingBitsZ0_;} - /// ChiSquare Cut - double slr_chi2cut() const {return slr_chi2cut_;} - /// Cut on RPhi Residual (radians) - double ResidualCut() const {return residualCut_;} - - //--- Options for Kalman filter track fitters --- - - // Larger number has more debugging printout. - unsigned kalmanDebugLevel() const { return kalmanDebugLevel_; } - // Internal histograms are filled if it is True - bool kalmanFillInternalHists() const { return kalmanFillInternalHists_;} - // Fit will reject fitted tracks unless it can assign at least this number of stubs to them. - unsigned int kalmanMinNumStubs() const { return kalmanMinNumStubs_;} - // Fit will attempt to add up to this nummber of stubs to each fitted tracks, but won't bother adding more. - unsigned int kalmanMaxNumStubs() const { return kalmanMaxNumStubs_;} - // For 5-param helix fits, calculate also beam-constrained helix params after fit is complete, & use them for duplicate removal if DupTrkAlgFit=50. - bool kalmanAddBeamConstr() const { return kalmanAddBeamConstr_;} - // Remove requirement of at least 2 PS layers per track. - bool kalmanRemove2PScut() const { return kalmanRemove2PScut_;} - // Allow the KF to skip this many layers in total per track for "hard" or "easy" input tracks - unsigned int kalmanMaxSkipLayersHard() const { return kalmanMaxSkipLayersHard_;} - unsigned int kalmanMaxSkipLayersEasy() const { return kalmanMaxSkipLayersEasy_;} - // Max #stubs an input track can have to be defined "easy". - unsigned int kalmanMaxStubsEasy() const { return kalmanMaxStubsEasy_;} - // KF will consider only this no. of stubs per layer. - unsigned int kalmanMaxStubsPerLayer() const { return kalmanMaxStubsPerLayer_;} - // Multiple scattering term - inflate hit phi errors by this divided by Pt - double kalmanMultiScattTerm() const { return kalmanMultiScattTerm_;} - // Scale down chi2 in r-phi plane by this factor to improve electron performance. - unsigned int kalmanChi2RphiScale() const { return kalmanChi2RphiScale_;} - //--- Enable Higher order corrections - // Treat z uncertainty in tilted barrel modules correctly. - bool kalmanHOtilted() const {return kalmanHOtilted_;} - // Higher order circle explansion terms for low Pt. - bool kalmanHOhelixExp() const {return kalmanHOhelixExp_;} - // Alpha correction for non-radial 2S endcap strips. (0=disable correction, 1=correct with offset, 2=correct with non-diagonal stub covariance matrix). - unsigned int kalmanHOalpha() const {return kalmanHOalpha_;} - // 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). - unsigned int kalmanHOprojZcorr() const {return kalmanHOprojZcorr_;} - // Use dodgy calculation to account for non-radial endcap 2S modules that was used in Dec. 2016 demonstrator & use no special treatment for tilted barrel modules. - bool kalmanHOdodgy() const {return kalmanHOdodgy_;} - - //=== Treatment of dead modules. - - //--- Either use this private TMTT way of studying dead modules - // In (eta,phi) sectors containing dead modules, reduce the min. number of layers cut on tracks to (MinStubLayers() - 1)? - // The sectors affected are hard-wired in DeadModuleDB::defineDeadTrackerRegions(). - bool deadReduceLayers() const {return deadReduceLayers_;} - // Emulate dead modules by killing fraction of stubs given by DeadSimulateFrac in certain layers & angular regions of - // the tracker that are hard-wired in DeadModuleDB::defineDeadSectors(). Disable by setting <= 0. Fully enable by setting to 1. - // Do not use if KillScenario > 0. - double deadSimulateFrac() const {return deadSimulateFrac_;} - // - //--- Or this use communal way developed with Tracklet of studying dead modules - // Emulate dead/inefficient modules using the StubKiller code, with stubs killed according to the scenarios of the Stress Test group. - // (0=Don't kill any stubs; 1-5 = Scenarios from https://github.com/EmyrClement/StubKiller/blob/master/README.md). - unsigned int killScenario() const {return killScenario_;} - // Modify TMTT tracking to try to recover tracking efficiency in presence of dead modules. (Does nothing if KillScenario = 0). - bool killRecover() const {return killRecover_;} - - //=== Track fit digitisation configuration for various track fitters - - // These are used only for SimpleLR track fitter. - bool slr_skipTrackDigi() const {return slr_skipTrackDigi_;} - unsigned int slr_oneOver2rBits() const {return slr_oneOver2rBits_;} - double slr_oneOver2rRange() const {return slr_oneOver2rRange_;} - unsigned int slr_d0Bits() const {return slr_d0Bits_;} - double slr_d0Range() const {return slr_d0Range_;} - unsigned int slr_phi0Bits() const {return slr_phi0Bits_;} - double slr_phi0Range() const {return slr_phi0Range_;} - unsigned int slr_z0Bits() const {return slr_z0Bits_;} - double slr_z0Range() const {return slr_z0Range_;} - unsigned int slr_tanlambdaBits() const {return slr_tanlambdaBits_;} - double slr_tanlambdaRange() const {return slr_tanlambdaRange_;} - unsigned int slr_chisquaredBits() const {return slr_chisquaredBits_;} - double slr_chisquaredRange() const {return slr_chisquaredRange_;} - // These are used for KF track fitter and for all other track fitters (though are probably not right for other track fitters ...) - bool kf_skipTrackDigi() const {return kf_skipTrackDigi_;} - unsigned int kf_oneOver2rBits() const {return kf_oneOver2rBits_;} - double kf_oneOver2rRange() const {return kf_oneOver2rRange_;} - unsigned int kf_d0Bits() const {return kf_d0Bits_;} - double kf_d0Range() const {return kf_d0Range_;} - unsigned int kf_phi0Bits() const {return kf_phi0Bits_;} - double kf_phi0Range() const {return kf_phi0Range_;} - unsigned int kf_z0Bits() const {return kf_z0Bits_;} - double kf_z0Range() const {return kf_z0Range_;} - unsigned int kf_tanlambdaBits() const {return kf_tanlambdaBits_;} - double kf_tanlambdaRange() const {return kf_tanlambdaRange_;} - unsigned int kf_chisquaredBits() const {return kf_chisquaredBits_;} - double kf_chisquaredRange() const {return kf_chisquaredRange_;} - vector kf_chisquaredBinEdges() const {return kf_chisquaredBinEdges_;} - // Skip track digitisation when fitted is not SimpleLR or KF? - bool other_skipTrackDigi() const {return other_skipTrackDigi_;} - - //=== Debug printout & plots - - // Printout level. - unsigned int debug() const {return debug_;} - // When making helix parameter resolution plots, only use particles from the physics event (True) - // or also use particles from pileup (False) ? - bool resPlotOpt() const {return resPlotOpt_;} - // Specify sector for which debug histos for hexagonal HT will be made. - unsigned int iPhiPlot() const {return iPhiPlot_;} - unsigned int iEtaPlot() const {return iEtaPlot_;} - - // Booleain indicating if an output EDM file will be written. - // N.B. This parameter does not appear inside TMTrackProducer_Defaults_cfi.py . It is created inside tmtt_tf_analysis_cfg.py . - bool writeOutEdmFile() const {return writeOutEdmFile_;} - - //=== Hard-wired constants - - double pitchPS() const {cout<<"ERROR: Use Stub::stripPitch instead of Settings::pitchPS!";exit(1);return 0.;} // pitch of PS modules - OBSOLETE - double pitch2S() const {cout<<"ERROR: Use Stub::stripPitch instead of Settings::pitch2S!";exit(1);return 0.;} // pitch of 2S modules - OBSOLETE - double cSpeed() const {return 2.99792458e10;} // Speed of light (cm/s) - double invPtToInvR() const {return (this->getBfield())*(this->cSpeed())/1.0E13;} // B*c/1E11 - converts q/Pt to 1/radius_of_curvature - double invPtToDphi() const {return (this->getBfield())*(this->cSpeed())/2.0E13;} // B*c/2E11 - converts q/Pt to track angle at some radius from beamline. - double trackerOuterRadius() const {return 112.7;} // max. occuring stub radius. - double trackerInnerRadius() const {return 21.8;} // min. occuring stub radius. - double trackerHalfLength() const {return 270.;} // half-length of tracker. - double stripLength2S() const {cout<<"ERROR: Use Stub::stripLength instead of Settings::stripLength2S!"< genPdgIds_; - unsigned int genMinStubLayers_; - - // Cuts applied to stubs before arriving in L1 track finding board. - unsigned int degradeBendRes_; - double maxStubEta_; - bool killLowPtStubs_; - bool printStubWindows_; - double bendResolution_; - double bendResolutionExtra_; - bool orderStubsByBend_; - - // Optional stub digitization. - bool enableDigitize_; - unsigned int phiSectorBits_; - unsigned int phiSBits_; - double phiSRange_; - unsigned int rtBits_; - double rtRange_; - unsigned int zBits_; - double zRange_; - unsigned int phiOBits_; - double phiORange_; - unsigned int bendBits_; - - // Configuration of Geometric Processor. - bool useApproxB_; - double bApprox_gradient_; - double bApprox_intercept_; - - // Definition of phi sectors. - unsigned int numPhiNonants_; - unsigned int numPhiSectors_; - double chosenRofPhi_; - bool useStubPhi_; - bool useStubPhiTrk_; - double assumedPhiTrkRes_; - bool calcPhiTrkRes_; - bool handleStripsPhiSec_; - - // Definition of eta sectors. - vector etaRegions_; - double chosenRofZ_; - double beamWindowZ_; - bool handleStripsEtaSec_; - bool allowOver2EtaSecs_; - - // r-phi Hough transform array specifications. - double houghMinPt_; - unsigned int houghNbinsPt_; - unsigned int houghNbinsPhi_; - int houghNcellsRphi_; - bool enableMerge2x2_; - double maxPtToMerge2x2_; - unsigned int numSubSecsEta_; - unsigned int shape_; - bool miniHTstage_; - unsigned int miniHoughNbinsPt_; - unsigned int miniHoughNbinsPhi_; - double miniHoughMinPt_; - bool miniHoughDontKill_; - double miniHoughDontKillMinPt_; - unsigned int miniHoughLoadBalance_; - - // Rules governing how stubs are filled into the r-phi Hough Transform array. - bool handleStripsRphiHT_; - unsigned int killSomeHTCellsRphi_; - bool useBendFilter_; - unsigned int maxStubsInCell_; - unsigned int maxStubsInCellMiniHough_; - bool busySectorKill_; - unsigned int busySectorNumStubs_; - vector busySectorMbinRanges_; - vector busySectorMbinOrder_; - bool busyInputSectorKill_; - unsigned int busyInputSectorNumStubs_; - unsigned int muxOutputsHT_; - vector etaRegWhitelist_; - - // Options controlling r-z track filters (or any other track filters run after the Hough transform, as opposed to inside it). - string rzFilterName_; - double seedResolution_; - bool keepAllSeed_; - unsigned int maxSeedCombinations_; - unsigned int maxGoodSeedCombinations_; - unsigned int maxSeedsPerStub_; - bool zTrkSectorCheck_; - unsigned int minFilterLayers_; - - // Rules for deciding when the track-finding has found an L1 track candidate - unsigned int minStubLayers_; - double minPtToReduceLayers_; - vector etaSecsReduceLayers_; - bool useLayerID_; - bool reduceLayerID_; - - // Specification of algorithm to eliminate duplicate tracks - unsigned int dupTrkAlgRphi_; - unsigned int dupTrkAlg3D_; - unsigned int dupTrkAlgFit_; - unsigned int dupTrkMinCommonHitsLayers_; - - // Rules for deciding when a reconstructed L1 track matches a MC truth particle (i.e. tracking particle). - double minFracMatchStubsOnReco_; - double minFracMatchStubsOnTP_; - unsigned int minNumMatchLayers_; - unsigned int minNumMatchPSLayers_; - bool stubMatchStrict_; - - // Track Fitting Settings - vector trackFitters_; - vector useRZfilter_; - double chi2OverNdfCut_; - bool detailedFitOutput_; - bool trackFitCheat_; - // - unsigned int numTrackFitIterations_; - bool killTrackFitWorstHit_; - double generalResidualCut_; - double killingResidualCut_; - // - unsigned int maxIterationsLR_; - bool LRFillInternalHists_; - bool combineResiduals_; - bool lineariseStubPosition_; - bool checkSectorConsistency_; - bool checkHTCellConsistency_; - unsigned int minPSLayers_; - bool digitizeLR_; - float PhiPrecision_; - float RPrecision_; - float ZPrecision_; - unsigned int ZSlopeWidth_; - unsigned int ZInterceptWidth_; - // - bool digitizeSLR_; - unsigned int dividerBitsHelix_; - unsigned int dividerBitsHelixZ_; - unsigned int ShiftingBitsDenRPhi_; - unsigned int ShiftingBitsDenRZ_; - unsigned int ShiftingBitsPt_; - unsigned int ShiftingBitsPhi_; - - unsigned int ShiftingBitsLambda_; - unsigned int ShiftingBitsZ0_; - double slr_chi2cut_; - double residualCut_; - // - unsigned kalmanDebugLevel_; - bool kalmanFillInternalHists_; - unsigned int kalmanMinNumStubs_; - unsigned int kalmanMaxNumStubs_; - bool kalmanAddBeamConstr_; - bool kalmanRemove2PScut_; - unsigned int kalmanMaxSkipLayersHard_; - unsigned int kalmanMaxSkipLayersEasy_; - unsigned int kalmanMaxStubsEasy_; - unsigned int kalmanMaxStubsPerLayer_; - double kalmanMultiScattTerm_; - unsigned int kalmanChi2RphiScale_; - bool kalmanHOtilted_; - bool kalmanHOhelixExp_; - unsigned int kalmanHOalpha_; - unsigned int kalmanHOprojZcorr_; - bool kalmanHOdodgy_; - - // Treatment of dead modules. - bool deadReduceLayers_; - double deadSimulateFrac_; - unsigned int killScenario_; - bool killRecover_; - - // Track digitisation configuration for various track fitters - bool slr_skipTrackDigi_; - unsigned int slr_oneOver2rBits_; - double slr_oneOver2rRange_; - double slr_oneOver2rMult_; - unsigned int slr_d0Bits_; - double slr_d0Range_; - unsigned int slr_phi0Bits_; - double slr_phi0Range_; - unsigned int slr_z0Bits_; - double slr_z0Range_; - unsigned int slr_tanlambdaBits_; - double slr_tanlambdaRange_; - unsigned int slr_chisquaredBits_; - double slr_chisquaredRange_; - // - bool kf_skipTrackDigi_; - unsigned int kf_oneOver2rBits_; - double kf_oneOver2rRange_; - double kf_oneOver2rMult_; - unsigned int kf_d0Bits_; - double kf_d0Range_; - unsigned int kf_phi0Bits_; - double kf_phi0Range_; - unsigned int kf_z0Bits_; - double kf_z0Range_; - unsigned int kf_tanlambdaBits_; - double kf_tanlambdaRange_; - unsigned int kf_chisquaredBits_; - double kf_chisquaredRange_; - vector kf_chisquaredBinEdges_; - // - bool other_skipTrackDigi_; - - // Debug printout - unsigned int debug_; - bool resPlotOpt_; - unsigned int iPhiPlot_; - unsigned int iEtaPlot_; - - // Boolean indicating an an EDM output file will be written. - bool writeOutEdmFile_; - - // B-field in Tesla - float bField_; - - // Hybrid tracking - bool hybrid_; - - double psStripPitch_; - double psNStrips_; - double psPixelLength_; - double ssStripPitch_; - double ssNStrips_; - double ssStripLength_; - - double zMaxNonTilted_[4]; -}; - -} + class Settings { + public: + // Constructor for HYBRID (sets config to hard-wired consts to allow use outside CMSSW). + Settings(); + + // Constructor for TMTT (reads config from python cfg) + Settings(const edm::ParameterSet& iConfig); + + ~Settings() {} + + //=== General settings. + + // Enable all use of MC truth info (disable to save CPU). + bool enableMCtruth() const { return enableMCtruth_; } + // Enable output histograms & job tracking performance summary (disable to save CPU). + bool enableHistos() const { return enableHistos_; } + + //=== Cuts on MC truth tracks for tracking efficiency measurements. + + double genMinPt() const { return genMinPt_; } + double genMaxAbsEta() const { return genMaxAbsEta_; } + double genMaxVertR() const { return genMaxVertR_; } + double genMaxVertZ() const { return genMaxVertZ_; } + double genMaxD0() const { return genMaxD0_; } + double genMaxZ0() const { return genMaxZ0_; } + vector genPdgIds() const { return genPdgIds_; } + // Additional cut on MC truth tracks for algorithmic tracking efficiency measurements. + unsigned int genMinStubLayers() const { return genMinStubLayers_; } // Min. number of layers TP made stub in. + + //=== Cuts applied to stubs before arriving in L1 track finding board. + + // Reduce number of bits used by front-end chips to store stub bend info? + // = 0 (no); = 1 (yes using official recipe); = 2 (yes using TMTT method) + unsigned int degradeBendRes() const { return degradeBendRes_; } + // Don't use stubs with eta beyond this cut, since the tracker geometry makes it impossible to reconstruct tracks with them. + double maxStubEta() const { return maxStubEta_; } + // Don't use stubs whose measured Pt from bend info is significantly below HTArraySpec.HoughMinPt, where "significantly" means allowing for resolution in q/Pt derived from stub bend resolution HTFilling.BendResolution + bool killLowPtStubs() const { return killLowPtStubs_; } + // Print stub windows corresponding to KillLowPtStubs, in python cfg format used by CMSSW. + bool printStubWindows() const { return printStubWindows_; } + // Bend resolution assumed by bend filter in units of strip pitch. Also used when assigning stubs to sectors if calcPhiTrkRes() is true. + double bendResolution() const { return bendResolution_; } + // Additional contribution to bend resolution from its encoding into a reduced number of bits. + // This number is the assumed resolution relative to the naive guess of its value. + // It is ignored in DegradeBendRes = 0. + double bendResolutionExtra() const { return bendResolutionExtra_; } + // Order stubs by bend in DTC, such that highest Pt stubs are transmitted first. + bool orderStubsByBend() const { return orderStubsByBend_; } + + //=== Optional stub digitization configuration + + bool enableDigitize() const { return enableDigitize_; } + //--- Parameters available in MP board. + unsigned int phiSectorBits() const { return phiSectorBits_; } + unsigned int phiSBits() const { return phiSBits_; } + double phiSRange() const { return phiSRange_; } + unsigned int rtBits() const { return rtBits_; } + double rtRange() const { return rtRange_; } + unsigned int zBits() const { return zBits_; } + double zRange() const { return zRange_; } + //--- Parameters available in GP board (excluding any in common with MP specified above). + unsigned int phiOBits() const { return phiOBits_; } + double phiORange() const { return phiORange_; } + unsigned int bendBits() const { return bendBits_; } + + //=== Configuration of Geometric Processor. + // Use an FPGA-friendly approximation to determine track angle dphi from bend in GP? + bool useApproxB() const { return useApproxB_; } + double bApprox_gradient() const { return bApprox_gradient_; } + double bApprox_intercept() const { return bApprox_intercept_; } + + //=== Definition of phi sectors. + + unsigned int numPhiNonants() const { return numPhiNonants_; } + unsigned int numPhiSectors() const { return numPhiSectors_; } + double chosenRofPhi() const { + return chosenRofPhi_; + } // 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. + bool useStubPhi() const { + return useStubPhi_; + } // Require stub phi to be consistent with track of Pt > HTArraySpec.HoughMinPt that crosses HT phi axis? + bool useStubPhiTrk() const { + return useStubPhiTrk_; + } // Require stub phi0 (or phi65 etc.) as estimated from stub bend, to lie within HT phi axis, allowing tolerance specified below? + double assumedPhiTrkRes() const { + return assumedPhiTrkRes_; + } // Tolerance in stub phi0 (or phi65) assumed to be this fraction of phi sector width. (N.B. If > 0.5, then stubs can be shared by more than 2 phi sectors). + bool calcPhiTrkRes() const { + return calcPhiTrkRes_; + } // If true, tolerance in stub phi0 (or phi65 etc.) will be reduced below AssumedPhiTrkRes if stub bend resolution specified in StubCuts.BendResolution suggests it is safe to do so. + bool handleStripsPhiSec() const { + return handleStripsPhiSec_; + } // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when assigning stubs to phi sectors? + + //=== Definition of eta sectors. + + vector etaRegions() const { return etaRegions_; } // Boundaries of eta regions de + unsigned int numEtaRegions() const { return (etaRegions_.size() - 1); } + double chosenRofZ() const { + return chosenRofZ_; + } // Use z of track at this radius for assignment of stubs to phi sectors & also for one of the axes of the r-z HT. + double beamWindowZ() const { return beamWindowZ_; } // Half-width of window supposed to contain beam-spot in z. + bool handleStripsEtaSec() const { + return handleStripsEtaSec_; + } // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when assigning stubs to eta sectors? + bool allowOver2EtaSecs() const { + return allowOver2EtaSecs_; + } // If True, the code will not throw an error if a stub is assigned to 3 or more eta sectors. + + //=== r-phi Hough transform array specifications. + + double houghMinPt() const { return houghMinPt_; } + unsigned int houghNbinsPt() const { + return houghNbinsPt_; + } // Dimension in any q/Pt related variable. Not valid if houghNcellsRphi() > 0. (If MiniHTstage = True, this refers to mini cells in whole HT array). + unsigned int houghNbinsPhi() const { + return houghNbinsPhi_; + } // Dimension in any track-phi related variable. Not valid if houghNcellsRphi() > 0. (If MiniHTstage = True, this refers to mini cells in whole HT array). + int houghNcellsRphi() const { + return houghNcellsRphi_; + } // Required no. of cells in r-phi HT array. If > 0, then parameters HoughNbinsPt and HoughNbinsPhi will be calculated from the constraints that their product should equal HoughNcellsRz and their ratio should make the maximum |gradient|" of stub lines in the HT array equal to 1. If <= 0, then HoughNbinsPt and HoughNbinsPhi will be taken from the values configured above. + bool enableMerge2x2() const { + return enableMerge2x2_; + } // Groups of neighbouring 2x2 cells in HT will be treated as if they are a single large cell. (Also enabled in MiniHTstage = True). + double maxPtToMerge2x2() const { + return maxPtToMerge2x2_; + } // but only cells with pt < maxPtToMerge2x2() will be merged in this way (irrelevant if enableMerge2x2() = false). + unsigned int numSubSecsEta() const { + return numSubSecsEta_; + } // Subdivide each sector into this number of subsectors in eta within r-phi HT. + unsigned int shape() const { return shape_; } // define cell shape (0 square, 1 diamond, 2 hexagon) + // Run 2nd stage HT with mini cells inside each 1st stage normal HT cell. N.B. This automatically sets EnableMerge2x2 = True & MaxPtToMerge = 999999. + bool miniHTstage() const { return miniHTstage_; } + // Number of mini cells along q/Pt & phi axes inside each normal HT cell. + unsigned int miniHoughNbinsPt() const { return miniHoughNbinsPt_; } + unsigned int miniHoughNbinsPhi() const { return miniHoughNbinsPhi_; } + // Below this Pt threshold, the mini HT will not be used, so only tracks found by 1st stage coarse HT will be output. (Used to improve low Pt tracking). (HT cell numbering remains as if mini HT were in use everywhere). + float miniHoughMinPt() const { return miniHoughMinPt_; } + // If true, allows tracks found by 1st stage coarse HT to be output if 2nd stage mini HT finds no tracks. + bool miniHoughDontKill() const { return miniHoughDontKill_; } + // If MiniHoughDontKill=True, this option restricts it to keep 1st stage HT tracks only if their Pt is exceeds this cut. (Used to improve electron tracking above this threshold). + float miniHoughDontKillMinPt() const { return miniHoughDontKillMinPt_; } + // load balancing disabled = 0; static load balancing of output links = 1; dynamic load balancing of output links = 2. + unsigned int miniHoughLoadBalance() const { return miniHoughLoadBalance_; } + + //=== Rules governing how stubs are filled into the r-phi Hough Transform array. + + // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when filling stubs in r-phi HT? + bool handleStripsRphiHT() const { return handleStripsRphiHT_; } + // Take all cells in HT array crossed by line corresponding to each stub (= 0) or take only some to reduce rate at cost + // of efficiency ( > 0). If this option is > 0, it can be 1 or 2, corresponding to different algorithms for rejecting some of the cells. + unsigned int killSomeHTCellsRphi() const { return killSomeHTCellsRphi_; } + // Use filter in each HT cell using only stubs which have consistent bend, allowing for resolution specified in StubCuts.BendResolution. + bool useBendFilter() const { return useBendFilter_; } + // A filter is used each HT cell, which prevents more than the specified number of stubs being stored in the cell. (Reflecting memory limit of hardware). N.B. If mini-HT is in use, then this cut applies to coarse-HT. + unsigned int maxStubsInCell() const { return maxStubsInCell_; } + // Similar cut for Mini-HT. + unsigned int maxStubsInCellMiniHough() const { return maxStubsInCellMiniHough_; } + // If this returns true, and if more than busySectorNumStubs() stubs are assigned to tracks by an r-phi HT array, then + // the excess tracks are killed, with lowest Pt ones killed first. This is because hardware has finite readout time. + bool busySectorKill() const { return busySectorKill_; } + unsigned int busySectorNumStubs() const { return busySectorNumStubs_; } + // If this returns a non-empty vector, then the BusySectorNumStubs cut is instead applied to the subset of tracks appearing in the following m bin ranges (q/Pt) of the HT array. The sum of the entries in the vector should equal the number of m bins in the HT, although the entries will be rescaled if this is not the case. If the vector is empty, this option is disabled. (P.S. If the HT includes "merged" cells, then the m bin ranges specified here should correspond to the bins before merging). + vector busySectorMbinRanges() const { return busySectorMbinRanges_; } + // If BusySecMbinOrder is empty, then the groupings specified in BusySectorMbinRanges are applied to the m bins in the order + // 0,1,2,3,4,5 ... . If it is not empty, then they are grouped in the order specified here. + vector busySectorMbinOrder() const { return busySectorMbinOrder_; } + // If this is True, and more than BusyInputSectorNumStubs() are input to the HT array from the GP, then + // the excess stubs are killed. This is because HT hardware has finite readin time. + bool busyInputSectorKill() const { return busyInputSectorKill_; } + unsigned int busyInputSectorNumStubs() const { return busyInputSectorNumStubs_; } + // Multiplex the outputs from several HTs onto a single pair of output optical links? + // Options: 0 = disable Mux; 1 = Dec. 2016 Mux; 2 = Mar 2018 Mux (transverse HT readout by m-bin); + // 3 = Sept 2019 Mux (transverse HT readout by m-bin) + unsigned int muxOutputsHT() const { return muxOutputsHT_; } + // Is specified eta sector enabled? + bool isHTRPhiEtaRegWhitelisted(unsigned const iEtaReg) const; + + //=== Options controlling r-z track filters (or any other track filters run after the Hough transform, as opposed to inside it). + + // Specify preferred r-z filter (from those available inside TrkRZfilter.cc) - currently only "SeedFilter". + string rzFilterName() const { return rzFilterName_; } + // --- Options relevant for Seed filter, (so only relevant if rzFilterName()="SeedFilter"). + // Added resolution beyond that estimated from hit resolution. + double seedResolution() const { return seedResolution_; } + // Store stubs compatible with all possible good seed (relevant for Seed filter)? + bool keepAllSeed() const { return keepAllSeed_; } + // Maximum number of seed combinations to check (relevant for Seed filter). + unsigned int maxSeedCombinations() const { return maxSeedCombinations_; } + // Maximum number of seed combinations consistent with (z0,eta) sector constraints to bother checking per track candidate. + unsigned int maxGoodSeedCombinations() const { return maxGoodSeedCombinations_; } + // Maximum number of seeds that a single stub can be included in. + unsigned int maxSeedsPerStub() const { return maxSeedsPerStub_; } + // Check that estimated zTrk from seeding stub is within the sector boundaries (relevant for Seed filter)? + bool zTrkSectorCheck() const { return zTrkSectorCheck_; } + // Min. number of layers in rz track that must have stubs for track to be declared found. + unsigned int minFilterLayers() const { return minFilterLayers_; } + + //=== Rules for deciding when the (HT) track finding has found an L1 track candidate + + // Min. number of layers in HT cell that must have stubs for track to be declared found. + unsigned int minStubLayers() const { return minStubLayers_; } + // Change min. number of layers cut to (MinStubLayers - 1) for tracks with Pt exceeding this cut. + // If this is set to > 10000, this option is disabled. + double minPtToReduceLayers() const { return minPtToReduceLayers_; } + // Change min. number of layers cut to (MinStubLayers - 1) for tracks in these rapidity sectors. + vector etaSecsReduceLayers() const { return etaSecsReduceLayers_; } + // Define layers using layer ID (true) or by bins in radius of 5 cm width (false)? + bool useLayerID() const { return useLayerID_; } + //Reduce this layer ID, so that it takes no more than 8 different values in any eta region (simplifies firmware)? + bool reduceLayerID() const { return reduceLayerID_; } + + //=== Specification of algorithm to eliminate duplicate tracks + + // --- Which algorithms are enabled. + // Algorithm used for duplicate removal of 2D tracks produced by r-phi HT. + unsigned int dupTrkAlgRphi() const { return dupTrkAlgRphi_; } + // Algorithm run on all 3D tracks within each sector after r-z track filter. (Ignored if r-z track filter not run). + unsigned int dupTrkAlg3D() const { return dupTrkAlg3D_; } + // Algorithm run on tracks after the track helix fit has been done. + unsigned int dupTrkAlgFit() const { return dupTrkAlgFit_; } + //--- Options used by individual algorithms. + unsigned int dupTrkMinCommonHitsLayers() const { return dupTrkMinCommonHitsLayers_; } + + //=== Rules for deciding when a reconstructed L1 track matches a MC truth particle (i.e. tracking particle). + + //--- Three different ways to define if a tracking particle matches a reco track candidate. (Usually, set two of them to ultra loose). + // Min. fraction of matched stubs relative to number of stubs on reco track. + double minFracMatchStubsOnReco() const { return minFracMatchStubsOnReco_; } + // Min. fraction of matched stubs relative to number of stubs on tracking particle. + double minFracMatchStubsOnTP() const { return minFracMatchStubsOnTP_; } + // Min. number of matched layers & min. number of matched PS layers.. + unsigned int minNumMatchLayers() const { return minNumMatchLayers_; } + unsigned int minNumMatchPSLayers() const { return minNumMatchPSLayers_; } + // Associate stub to TP only if the TP contributed to both its clusters? (If False, then associate even if only one cluster was made by TP). + bool stubMatchStrict() const { return stubMatchStrict_; } + + //=== Track Fitting Settings + + //--- Options applicable to all track fitters --- + + // Track fitting algorithms to use. You can run several in parallel. + vector trackFitters() const { return trackFitters_; } + // Indicate subset of fitters wanting r-z track filter to be run before them. + // (Excludes fitters that are not run). + vector useRZfilter() const { return useRZfilter_; } + // Print detailed summary of track fit performance at end of job (as opposed to a brief one)? + bool detailedFitOutput() const { return detailedFitOutput_; } + // Use MC truth to eliminate all fake tracks & all incorrect stubs assigned to tracks before doing fit. + bool trackFitCheat() const { return trackFitCheat_; } + + //--- Options for chi2 track fitter --- + + // Number of iterations that the track fit should perform. + unsigned int numTrackFitIterations() const { return numTrackFitIterations_; } + // Optionally remove hit with worst residual in track fit? (Only used by chi2 track fit). + bool killTrackFitWorstHit() const { return killTrackFitWorstHit_; } + // Cuts in standard deviations used to kill hits with big residuals during fit. If the residual exceeds the "General" + // cut, the hit is killed providing it leaves the track with enough hits to survive. If the residual exceeds the + // "Killing" cut, the hit is killed even if that kills the track. + double generalResidualCut() const { return generalResidualCut_; } + double killingResidualCut() const { return killingResidualCut_; } + + //--- Additional options for Thomas Schuh's Linear Regression track fitter --- + + // Max allowed iterations. + unsigned int maxIterationsLR() const { return maxIterationsLR_; } + // Internal histograms are filled if it is True + bool LRFillInternalHists() const { return LRFillInternalHists_; } + bool combineResiduals() const { return combineResiduals_; } + bool lineariseStubPosition() const { return lineariseStubPosition_; } + bool checkSectorConsistency() const { return checkSectorConsistency_; } + bool checkHTCellConsistency() const { return checkHTCellConsistency_; } + unsigned int minPSLayers() const { return minPSLayers_; } + // Digitization + bool digitizeLR() const { return digitizeLR_; } + float PhiPrecision() const { return PhiPrecision_; } + float RPrecision() const { return RPrecision_; } + float ZPrecision() const { return ZPrecision_; } + unsigned int ZSlopeWidth() const { return ZSlopeWidth_; } + unsigned int ZInterceptWidth() const { return ZInterceptWidth_; } + + //--- Additional options for Davide Cieri's Simple Linear Regression track fitter --- + + // Digitize Simple Linear Regression variables & calculation. (Disabled if EnableDigitize=False). + bool digitizeSLR() const { return digitizeSLR_; } + /// Number of bits to be used in hardware to compute the division needed to calculate the helix parameters + unsigned int dividerBitsHelix() const { return dividerBitsHelix_; } + unsigned int dividerBitsHelixZ() const { return dividerBitsHelixZ_; } + /// Number of bits to reduce the RPhi helix parameter denominator calculation weight + unsigned int ShiftingBitsDenRPhi() const { return ShiftingBitsDenRPhi_; } + + /// Number of bits to reduce the RZ helix parameter denominator calculation weight + unsigned int ShiftingBitsDenRZ() const { return ShiftingBitsDenRZ_; } + /// Number of bits to reduce the qOverPt parameter numerator calculation weight + unsigned int ShiftingBitsPt() const { return ShiftingBitsPt_; } + /// Number of bits to reduce the PhiT parameter numerator calculation weight + unsigned int ShiftingBitsPhi() const { return ShiftingBitsPhi_; } + /// Number of bits to reduce the tanLambda parameter calculation weight + unsigned int ShiftingBitsLambda() const { return ShiftingBitsLambda_; } + /// Number of bits to reduce the tanLambda parameter calculation weight + unsigned int ShiftingBitsZ0() const { return ShiftingBitsZ0_; } + /// ChiSquare Cut + double slr_chi2cut() const { return slr_chi2cut_; } + /// Cut on RPhi Residual (radians) + double ResidualCut() const { return residualCut_; } + + //--- Options for Kalman filter track fitters --- + + // Larger number has more debugging printout. + unsigned kalmanDebugLevel() const { return kalmanDebugLevel_; } + // Internal histograms are filled if it is True + bool kalmanFillInternalHists() const { return kalmanFillInternalHists_; } + // Fit will reject fitted tracks unless it can assign at least this number of stubs to them. + unsigned int kalmanMinNumStubs() const { return kalmanMinNumStubs_; } + // Fit will attempt to add up to this nummber of stubs to each fitted tracks, but won't bother adding more. + unsigned int kalmanMaxNumStubs() const { return kalmanMaxNumStubs_; } + // For 5-param helix fits, calculate also beam-constrained helix params after fit is complete, & use them for duplicate removal if DupTrkAlgFit=50. + bool kalmanAddBeamConstr() const { return kalmanAddBeamConstr_; } + // Remove requirement of at least 2 PS layers per track. + bool kalmanRemove2PScut() const { return kalmanRemove2PScut_; } + // Allow the KF to skip this many layers in total per track for "hard" or "easy" input tracks + unsigned int kalmanMaxSkipLayersHard() const { return kalmanMaxSkipLayersHard_; } + unsigned int kalmanMaxSkipLayersEasy() const { return kalmanMaxSkipLayersEasy_; } + // Max #stubs an input track can have to be defined "easy". + unsigned int kalmanMaxStubsEasy() const { return kalmanMaxStubsEasy_; } + // KF will consider only this no. of stubs per layer. + unsigned int kalmanMaxStubsPerLayer() const { return kalmanMaxStubsPerLayer_; } + // Multiple scattering term - inflate hit phi errors by this divided by Pt + double kalmanMultiScattTerm() const { return kalmanMultiScattTerm_; } + // Scale down chi2 in r-phi plane by this factor to improve electron performance. + unsigned int kalmanChi2RphiScale() const { return kalmanChi2RphiScale_; } + //--- Enable Higher order corrections + // Treat z uncertainty in tilted barrel modules correctly. + bool kalmanHOtilted() const { return kalmanHOtilted_; } + // Higher order circle explansion terms for low Pt. + bool kalmanHOhelixExp() const { return kalmanHOhelixExp_; } + // Alpha correction for non-radial 2S endcap strips. (0=disable correction, 1=correct with offset, 2=correct with non-diagonal stub covariance matrix). + unsigned int kalmanHOalpha() const { return kalmanHOalpha_; } + // 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). + unsigned int kalmanHOprojZcorr() const { return kalmanHOprojZcorr_; } + // Use dodgy calculation to account for non-radial endcap 2S modules that was used in Dec. 2016 demonstrator & use no special treatment for tilted barrel modules. + bool kalmanHOdodgy() const { return kalmanHOdodgy_; } + + //=== Treatment of dead modules. + + //--- Either use this private TMTT way of studying dead modules + // In (eta,phi) sectors containing dead modules, reduce the min. number of layers cut on tracks to (MinStubLayers() - 1)? + // The sectors affected are hard-wired in DeadModuleDB::defineDeadTrackerRegions(). + bool deadReduceLayers() const { return deadReduceLayers_; } + // Emulate dead modules by killing fraction of stubs given by DeadSimulateFrac in certain layers & angular regions of + // the tracker that are hard-wired in DeadModuleDB::defineDeadSectors(). Disable by setting <= 0. Fully enable by setting to 1. + // Do not use if KillScenario > 0. + double deadSimulateFrac() const { return deadSimulateFrac_; } + // + //--- Or this use communal way developed with Tracklet of studying dead modules + // Emulate dead/inefficient modules using the StubKiller code, with stubs killed according to the scenarios of the Stress Test group. + // (0=Don't kill any stubs; 1-5 = Scenarios from https://github.com/EmyrClement/StubKiller/blob/master/README.md). + unsigned int killScenario() const { return killScenario_; } + // Modify TMTT tracking to try to recover tracking efficiency in presence of dead modules. (Does nothing if KillScenario = 0). + bool killRecover() const { return killRecover_; } + + //=== Track fit digitisation configuration for various track fitters + + // These are used only for SimpleLR track fitter. + bool slr_skipTrackDigi() const { return slr_skipTrackDigi_; } + unsigned int slr_oneOver2rBits() const { return slr_oneOver2rBits_; } + double slr_oneOver2rRange() const { return slr_oneOver2rRange_; } + unsigned int slr_d0Bits() const { return slr_d0Bits_; } + double slr_d0Range() const { return slr_d0Range_; } + unsigned int slr_phi0Bits() const { return slr_phi0Bits_; } + double slr_phi0Range() const { return slr_phi0Range_; } + unsigned int slr_z0Bits() const { return slr_z0Bits_; } + double slr_z0Range() const { return slr_z0Range_; } + unsigned int slr_tanlambdaBits() const { return slr_tanlambdaBits_; } + double slr_tanlambdaRange() const { return slr_tanlambdaRange_; } + unsigned int slr_chisquaredBits() const { return slr_chisquaredBits_; } + double slr_chisquaredRange() const { return slr_chisquaredRange_; } + // These are used for KF track fitter and for all other track fitters (though are probably not right for other track fitters ...) + bool kf_skipTrackDigi() const { return kf_skipTrackDigi_; } + unsigned int kf_oneOver2rBits() const { return kf_oneOver2rBits_; } + double kf_oneOver2rRange() const { return kf_oneOver2rRange_; } + unsigned int kf_d0Bits() const { return kf_d0Bits_; } + double kf_d0Range() const { return kf_d0Range_; } + unsigned int kf_phi0Bits() const { return kf_phi0Bits_; } + double kf_phi0Range() const { return kf_phi0Range_; } + unsigned int kf_z0Bits() const { return kf_z0Bits_; } + double kf_z0Range() const { return kf_z0Range_; } + unsigned int kf_tanlambdaBits() const { return kf_tanlambdaBits_; } + double kf_tanlambdaRange() const { return kf_tanlambdaRange_; } + unsigned int kf_chisquaredBits() const { return kf_chisquaredBits_; } + double kf_chisquaredRange() const { return kf_chisquaredRange_; } + vector kf_chisquaredBinEdges() const { return kf_chisquaredBinEdges_; } + // Skip track digitisation when fitted is not SimpleLR or KF? + bool other_skipTrackDigi() const { return other_skipTrackDigi_; } + + //=== Debug printout & plots + + // Printout level. + unsigned int debug() const { return debug_; } + // When making helix parameter resolution plots, only use particles from the physics event (True) + // or also use particles from pileup (False) ? + bool resPlotOpt() const { return resPlotOpt_; } + // Specify sector for which debug histos for hexagonal HT will be made. + unsigned int iPhiPlot() const { return iPhiPlot_; } + unsigned int iEtaPlot() const { return iEtaPlot_; } + + // Booleain indicating if an output EDM file will be written. + // N.B. This parameter does not appear inside TMTrackProducer_Defaults_cfi.py . It is created inside tmtt_tf_analysis_cfg.py . + bool writeOutEdmFile() const { return writeOutEdmFile_; } + + //=== Hard-wired constants + + double pitchPS() const { + cout << "ERROR: Use Stub::stripPitch instead of Settings::pitchPS!"; + exit(1); + return 0.; + } // pitch of PS modules - OBSOLETE + double pitch2S() const { + cout << "ERROR: Use Stub::stripPitch instead of Settings::pitch2S!"; + exit(1); + return 0.; + } // pitch of 2S modules - OBSOLETE + double cSpeed() const { return 2.99792458e10; } // Speed of light (cm/s) + double invPtToInvR() const { + return (this->getBfield()) * (this->cSpeed()) / 1.0E13; + } // B*c/1E11 - converts q/Pt to 1/radius_of_curvature + double invPtToDphi() const { + return (this->getBfield()) * (this->cSpeed()) / 2.0E13; + } // B*c/2E11 - converts q/Pt to track angle at some radius from beamline. + double trackerOuterRadius() const { return 112.7; } // max. occuring stub radius. + double trackerInnerRadius() const { return 21.8; } // min. occuring stub radius. + double trackerHalfLength() const { return 270.; } // half-length of tracker. + double stripLength2S() const { + cout << "ERROR: Use Stub::stripLength instead of Settings::stripLength2S!" << endl; + exit(1); + return 0.; + } // Strip length of 2S modules. - OBSOLETE + double layerIDfromRadiusBin() const { + return 6.; + } // When counting stubs in layers, actually histogram stubs in distance from beam-line with this bin size. + double crazyStubCut() const { + return 0.01; + } // Stubs differing from TP trajectory by more than this in phi are assumed to come from delta rays etc. + + //=== Set and get B-field value in Tesla. + // N.B. This must bet set for each event, and can't be initialized at the beginning of the job. + void setBfield(float bField) { bField_ = bField; } + float getBfield() const { + if (bField_ == 0.) + throw cms::Exception("Settings.h:You attempted to access the B field before it was initialized"); + return bField_; + } + + //=== Settings used for HYBRID TRACKING code only. + + // Is hybrid tracking in use? + bool hybrid() const { return hybrid_; } + // Info about geometry, needed for use of hybrid outside CMSSW. + double ssStripPitch() const { return ssStripPitch_; } + double ssNStrips() const { return ssNStrips_; } + double ssStripLength() const { return ssStripLength_; } + double psStripPitch() const { return psStripPitch_; } + double psNStrips() const { return psNStrips_; } + double psPixelLength() const { return psPixelLength_; } + // max z at which non-tilted modules are found in inner 3 barrel layers. (Element 0 not used). + void get_zMaxNonTilted(double (&zMax)[4]) const { + zMax[1] = zMaxNonTilted_[1]; + zMax[2] = zMaxNonTilted_[2]; + zMax[3] = zMaxNonTilted_[3]; + } + + private: + // Parameter sets for differents types of configuration parameter. + edm::ParameterSet genCuts_; + edm::ParameterSet stubCuts_; + edm::ParameterSet stubDigitize_; + edm::ParameterSet geometricProc_; + edm::ParameterSet phiSectors_; + edm::ParameterSet etaSectors_; + edm::ParameterSet htArraySpecRphi_; + edm::ParameterSet htFillingRphi_; + edm::ParameterSet rzFilterOpts_; + edm::ParameterSet l1TrackDef_; + edm::ParameterSet dupTrkRemoval_; + edm::ParameterSet trackMatchDef_; + edm::ParameterSet trackFitSettings_; + edm::ParameterSet deadModuleOpts_; + edm::ParameterSet trackDigi_; + + // General settings + bool enableMCtruth_; + bool enableHistos_; + + // Cuts on truth tracking particles. + double genMinPt_; + double genMaxAbsEta_; + double genMaxVertR_; + double genMaxVertZ_; + double genMaxD0_; + double genMaxZ0_; + vector genPdgIds_; + unsigned int genMinStubLayers_; + + // Cuts applied to stubs before arriving in L1 track finding board. + unsigned int degradeBendRes_; + double maxStubEta_; + bool killLowPtStubs_; + bool printStubWindows_; + double bendResolution_; + double bendResolutionExtra_; + bool orderStubsByBend_; + + // Optional stub digitization. + bool enableDigitize_; + unsigned int phiSectorBits_; + unsigned int phiSBits_; + double phiSRange_; + unsigned int rtBits_; + double rtRange_; + unsigned int zBits_; + double zRange_; + unsigned int phiOBits_; + double phiORange_; + unsigned int bendBits_; + + // Configuration of Geometric Processor. + bool useApproxB_; + double bApprox_gradient_; + double bApprox_intercept_; + + // Definition of phi sectors. + unsigned int numPhiNonants_; + unsigned int numPhiSectors_; + double chosenRofPhi_; + bool useStubPhi_; + bool useStubPhiTrk_; + double assumedPhiTrkRes_; + bool calcPhiTrkRes_; + bool handleStripsPhiSec_; + + // Definition of eta sectors. + vector etaRegions_; + double chosenRofZ_; + double beamWindowZ_; + bool handleStripsEtaSec_; + bool allowOver2EtaSecs_; + + // r-phi Hough transform array specifications. + double houghMinPt_; + unsigned int houghNbinsPt_; + unsigned int houghNbinsPhi_; + int houghNcellsRphi_; + bool enableMerge2x2_; + double maxPtToMerge2x2_; + unsigned int numSubSecsEta_; + unsigned int shape_; + bool miniHTstage_; + unsigned int miniHoughNbinsPt_; + unsigned int miniHoughNbinsPhi_; + double miniHoughMinPt_; + bool miniHoughDontKill_; + double miniHoughDontKillMinPt_; + unsigned int miniHoughLoadBalance_; + + // Rules governing how stubs are filled into the r-phi Hough Transform array. + bool handleStripsRphiHT_; + unsigned int killSomeHTCellsRphi_; + bool useBendFilter_; + unsigned int maxStubsInCell_; + unsigned int maxStubsInCellMiniHough_; + bool busySectorKill_; + unsigned int busySectorNumStubs_; + vector busySectorMbinRanges_; + vector busySectorMbinOrder_; + bool busyInputSectorKill_; + unsigned int busyInputSectorNumStubs_; + unsigned int muxOutputsHT_; + vector etaRegWhitelist_; + + // Options controlling r-z track filters (or any other track filters run after the Hough transform, as opposed to inside it). + string rzFilterName_; + double seedResolution_; + bool keepAllSeed_; + unsigned int maxSeedCombinations_; + unsigned int maxGoodSeedCombinations_; + unsigned int maxSeedsPerStub_; + bool zTrkSectorCheck_; + unsigned int minFilterLayers_; + + // Rules for deciding when the track-finding has found an L1 track candidate + unsigned int minStubLayers_; + double minPtToReduceLayers_; + vector etaSecsReduceLayers_; + bool useLayerID_; + bool reduceLayerID_; + + // Specification of algorithm to eliminate duplicate tracks + unsigned int dupTrkAlgRphi_; + unsigned int dupTrkAlg3D_; + unsigned int dupTrkAlgFit_; + unsigned int dupTrkMinCommonHitsLayers_; + + // Rules for deciding when a reconstructed L1 track matches a MC truth particle (i.e. tracking particle). + double minFracMatchStubsOnReco_; + double minFracMatchStubsOnTP_; + unsigned int minNumMatchLayers_; + unsigned int minNumMatchPSLayers_; + bool stubMatchStrict_; + + // Track Fitting Settings + vector trackFitters_; + vector useRZfilter_; + double chi2OverNdfCut_; + bool detailedFitOutput_; + bool trackFitCheat_; + // + unsigned int numTrackFitIterations_; + bool killTrackFitWorstHit_; + double generalResidualCut_; + double killingResidualCut_; + // + unsigned int maxIterationsLR_; + bool LRFillInternalHists_; + bool combineResiduals_; + bool lineariseStubPosition_; + bool checkSectorConsistency_; + bool checkHTCellConsistency_; + unsigned int minPSLayers_; + bool digitizeLR_; + float PhiPrecision_; + float RPrecision_; + float ZPrecision_; + unsigned int ZSlopeWidth_; + unsigned int ZInterceptWidth_; + // + bool digitizeSLR_; + unsigned int dividerBitsHelix_; + unsigned int dividerBitsHelixZ_; + unsigned int ShiftingBitsDenRPhi_; + unsigned int ShiftingBitsDenRZ_; + unsigned int ShiftingBitsPt_; + unsigned int ShiftingBitsPhi_; + + unsigned int ShiftingBitsLambda_; + unsigned int ShiftingBitsZ0_; + double slr_chi2cut_; + double residualCut_; + // + unsigned kalmanDebugLevel_; + bool kalmanFillInternalHists_; + unsigned int kalmanMinNumStubs_; + unsigned int kalmanMaxNumStubs_; + bool kalmanAddBeamConstr_; + bool kalmanRemove2PScut_; + unsigned int kalmanMaxSkipLayersHard_; + unsigned int kalmanMaxSkipLayersEasy_; + unsigned int kalmanMaxStubsEasy_; + unsigned int kalmanMaxStubsPerLayer_; + double kalmanMultiScattTerm_; + unsigned int kalmanChi2RphiScale_; + bool kalmanHOtilted_; + bool kalmanHOhelixExp_; + unsigned int kalmanHOalpha_; + unsigned int kalmanHOprojZcorr_; + bool kalmanHOdodgy_; + + // Treatment of dead modules. + bool deadReduceLayers_; + double deadSimulateFrac_; + unsigned int killScenario_; + bool killRecover_; + + // Track digitisation configuration for various track fitters + bool slr_skipTrackDigi_; + unsigned int slr_oneOver2rBits_; + double slr_oneOver2rRange_; + double slr_oneOver2rMult_; + unsigned int slr_d0Bits_; + double slr_d0Range_; + unsigned int slr_phi0Bits_; + double slr_phi0Range_; + unsigned int slr_z0Bits_; + double slr_z0Range_; + unsigned int slr_tanlambdaBits_; + double slr_tanlambdaRange_; + unsigned int slr_chisquaredBits_; + double slr_chisquaredRange_; + // + bool kf_skipTrackDigi_; + unsigned int kf_oneOver2rBits_; + double kf_oneOver2rRange_; + double kf_oneOver2rMult_; + unsigned int kf_d0Bits_; + double kf_d0Range_; + unsigned int kf_phi0Bits_; + double kf_phi0Range_; + unsigned int kf_z0Bits_; + double kf_z0Range_; + unsigned int kf_tanlambdaBits_; + double kf_tanlambdaRange_; + unsigned int kf_chisquaredBits_; + double kf_chisquaredRange_; + vector kf_chisquaredBinEdges_; + // + bool other_skipTrackDigi_; + + // Debug printout + unsigned int debug_; + bool resPlotOpt_; + unsigned int iPhiPlot_; + unsigned int iEtaPlot_; + + // Boolean indicating an an EDM output file will be written. + bool writeOutEdmFile_; + + // B-field in Tesla + float bField_; + + // Hybrid tracking + bool hybrid_; + + double psStripPitch_; + double psNStrips_; + double psPixelLength_; + double ssStripPitch_; + double ssNStrips_; + double ssStripLength_; + + double zMaxNonTilted_[4]; + }; + +} // namespace TMTT #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/SimpleLR.h b/L1Trigger/TrackFindingTMTT/interface/SimpleLR.h index d55d6611bd7e9..69fe082b0b5e8 100644 --- a/L1Trigger/TrackFindingTMTT/interface/SimpleLR.h +++ b/L1Trigger/TrackFindingTMTT/interface/SimpleLR.h @@ -17,57 +17,53 @@ namespace TMTT { -class SimpleLR : public TrackFitGeneric { - -public: - SimpleLR(const Settings* settings) : TrackFitGeneric(settings), settings_(settings) {}; - - virtual ~SimpleLR() {}; - - virtual void initRun(); - - L1fittedTrack fit(const L1track3D& l1track3D); - -protected: - - const Settings* settings_; - - float phiSectorWidth_; - float phiSectorCentre_; - float phiNonantWidth_; - - float phiMult_; - float rTMult_; - float zMult_; - float qOverPtMult_; - float phiTMult_; - float z0Mult_; - float tanLambdaMult_; - float numeratorPtMult_; - float numeratorZ0Mult_; - float numeratorLambdaMult_; - float numeratorPhiMult_; - float denominatorMult_; - float chi2Mult_; - float resMult_; - float chi2cut_; - float invPtToDPhi_; - float chosenRofPhi_; - - bool digitize_; - unsigned int dividerBitsHelix_; - unsigned int dividerBitsHelixZ_; - unsigned int dividerBitsChi2_; - unsigned int shiftingBitsPhi_; - unsigned int shiftingBitsDenRPhi_; - unsigned int shiftingBitsDenRZ_; - unsigned int shiftingBitsPt_; - unsigned int shiftingBitsz0_; - unsigned int shiftingBitsLambda_; - - -}; - -} + class SimpleLR : public TrackFitGeneric { + public: + SimpleLR(const Settings* settings) : TrackFitGeneric(settings), settings_(settings){}; + + virtual ~SimpleLR(){}; + + virtual void initRun(); + + L1fittedTrack fit(const L1track3D& l1track3D); + + protected: + const Settings* settings_; + + float phiSectorWidth_; + float phiSectorCentre_; + float phiNonantWidth_; + + float phiMult_; + float rTMult_; + float zMult_; + float qOverPtMult_; + float phiTMult_; + float z0Mult_; + float tanLambdaMult_; + float numeratorPtMult_; + float numeratorZ0Mult_; + float numeratorLambdaMult_; + float numeratorPhiMult_; + float denominatorMult_; + float chi2Mult_; + float resMult_; + float chi2cut_; + float invPtToDPhi_; + float chosenRofPhi_; + + bool digitize_; + unsigned int dividerBitsHelix_; + unsigned int dividerBitsHelixZ_; + unsigned int dividerBitsChi2_; + unsigned int shiftingBitsPhi_; + unsigned int shiftingBitsDenRPhi_; + unsigned int shiftingBitsDenRZ_; + unsigned int shiftingBitsPt_; + unsigned int shiftingBitsz0_; + unsigned int shiftingBitsLambda_; + }; + +} // namespace TMTT #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/Stub.h b/L1Trigger/TrackFindingTMTT/interface/Stub.h index 3f87526fb671e..d61dfde8b0b5e 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Stub.h +++ b/L1Trigger/TrackFindingTMTT/interface/Stub.h @@ -34,324 +34,368 @@ class TrackerTopology; namespace TMTT { -class TP; - -// typedef edm::Ref< edm::DetSetVector< Phase2TrackerDigi >, Phase2TrackerDigi > Ref_Phase2TrackerDigi_; -typedef edmNew::DetSetVector< TTStub > DetSetVec; -typedef edmNew::DetSet< TTStub > DetSet; -typedef edm::Ref > TTStubRef; -typedef edm::Ref< edmNew::DetSetVector< TTCluster< Ref_Phase2TrackerDigi_ > >, TTCluster< Ref_Phase2TrackerDigi_ > > TTClusterRef; -typedef TTStubAssociationMap TTStubAssMap; -typedef TTClusterAssociationMap TTClusterAssMap; - -//=== Represents a Tracker stub (=pair of hits) - -class Stub : public TTStubRef { - -public: - - // Store useful info about the stub (for use with HYBRID code), with hard-wired constants to allow use outside CMSSW. - Stub(double phi, double r, double z, double bend, int layerid, bool psModule, bool barrel, unsigned int iphi, double alpha, const Settings* settings, const TrackerTopology* trackerTopology, unsigned int ID, unsigned int iPhiSec); - - // Store useful info about stub (for use with TMTT code). - Stub(const TTStubRef& ttStubRef, unsigned int index_in_vStubs, const Settings* settings, const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology); - - ~Stub(){} - - bool operator==(const Stub& stubOther) {return (this->index() == stubOther.index());} - - // Fill truth info with association from stub to tracking particles. - // The 1st argument is a map relating TrackingParticles to TP. - void fillTruth(const map, const TP* >& translateTP, const edm::Handle& mcTruthTTStubHandle, const edm::Handle& mcTruthTTClusterHandle); - - // Calculate bin range along q/Pt axis of r-phi Hough transform array consistent with bend of this stub. - void calcQoverPtrange(); - - // Digitize stub for input to Geographic Processor, with digitized phi coord. measured relative to closest phi sector. - // (This approximation is valid if their are an integer number of digitisation bins inside each phi nonant). - // However, you should also call digitizeForHTinput() before accessing digitized stub data, even if you only care about that going into GP! Otherwise, you will not identify stubs assigned to more than one nonant. - void digitizeForGPinput(unsigned int iPhiSec); - - // Digitize stub for input to Hough transform, with digitized phi coord. measured relative to specified phi sector. - void digitizeForHTinput(unsigned int iPhiSec); - - // Digitize stub for input to r-z Seed Filter. - // (Kept for backwards compatibility.) - void digitizeForSFinput() {this->digitizeForSForTFinput("SeedFilter");} - - // Digitize stub for input to r-z Seed Filter or Track Fitter. - // Argument is "SeedFilter" or name of Track Fitter. - void digitizeForSForTFinput(string SForTF); - - // Digitize stub for input to Duplicate Removal . - void digitizeForDRinput(unsigned int stubId); - - // Control warning messages about accessing non-digitized quantities. - void setDigitizeWarningsOn(bool newVal) {digitizeWarningsOn_ = newVal;} - - // Restore stub to pre-digitized state. i.e. Undo what function digitize() did. - - void reset_digitize(); - - // === Functions for returning info about reconstructed stubs === - - // Location in InputData::vStubs_ - unsigned int index() const { return index_in_vStubs_; } - - //--- Stub data and quantities derived from it --- - - // Stub coordinates (optionally after digitisation, if digitisation requested via cfg). - // N.B. Digitisation is not run when the stubs are created, but later, after stubs are assigned to sectors. - // Until then, these functions return the original coordinates. - float phi() const { return phi_; } - float r() const { return r_; } - float z() const { return z_; } - float theta() const { return atan2(r_, z_); } - float eta() const { return asinh(z_/r_); } - // Access to digitized version of stub coords. - const DigitalStub& digitalStub() const { return digitalStub_;} - // Access to booleans indicating if the stub has been digitized. - bool digitizedForGPinput() const { return digitizedForGPinput_;} - bool digitizedForHTinput() const { return digitizedForHTinput_;} - string digitizedForSForTFinput() const { return digitizedForSForTFinput_;} // Returns which SF or TF digitisation was done for, if any. - bool digitizedForDRinput() const { return digitizedForDRinput_;} - - // Get stub bend (i.e. displacement between two hits in stub in units of strip pitch) and its estimated resolution. - float bend() const { this->check1(); return bend_; } - // The bend resolution has a contribution from the sensor and a contribution from encoding the bend into - // a reduced number of bits. - float bendRes() const { return (settings_->bendResolution() + (numMergedBend_-1)*settings_->bendResolutionExtra()); } - // Number of bend values which loss of bit to store bend resulted in being merged into this bend value. - float numMergedBend() const { return numMergedBend_;} - // Bend angle of track measured by stub and its estimated resolution. - float dphi() const { this->check2(); return (bend_ * dphiOverBend()); } - float dphiRes() const { return (dphiOverBend() * this->bendRes()); } - // Estimated track q/Pt based on stub bend info. - float qOverPt() const { return (this->qOverPtOverBend() * this->bend()); } - float qOverPtres() const { return (this->qOverPtOverBend() * this->bendRes()); } - // Range in q/Pt bins in HT array compatible with stub bend. - unsigned int min_qOverPt_bin() const { return min_qOverPt_bin_; } - unsigned int max_qOverPt_bin() const { return max_qOverPt_bin_; } - // Estimated phi0 of track at beam-line based on stub bend info. - float beta() const { return (phi_ + dphi()); } - // Estimated phi angle at which track intercepts a given radius rad, based on stub bend info. Also estimate uncertainty on this angle due to endcap 2S module strip length. - // This is identical to beta() if rad=0. - pair trkPhiAtR(float rad) const; - // Estimated resolution in trkPhiAtR(rad) based on nominal stub bend resolution. - float trkPhiAtRres(float rad) const { return this->dphiRes() * fabs(1 - rad / r_); } - // Difference in phi between stub and angle at which track crosses given radius, assuming track has given Pt. - float phiDiff(float rad, float Pt) const { return fabs(r_ - rad)*(settings_->invPtToDphi())/Pt; } - // -- conversion factors - // Ratio of bend angle to bend, where bend is the displacement in strips between the two hits making up stub. - float dphiOverBend() const { this->check2(); return dphiOverBend_; } - // Correction factor that was used when calculating dPhiOverBend, due to tilt of module. - float dphiOverBendCorrection() const { return dphiOverBendCorrection_; } - // Approximation of dphiOverBendCorrection, used in firmware. - float dphiOverBendCorrectionApprox() const { return dphiOverBendCorrection_approx_; } - // Ratio of q/Pt to bend, where bend is the displacement in strips between the two hits making up stub. - float qOverPtOverBend() const { return this->dphiOverBend() / (r_ * settings_->invPtToDphi()); } - - //--- Info about the two clusters that make up the stub. - // Coordinates in frame of sensor, measured in units of strip pitch along two orthogonal axes running perpendicular and parallel to longer axis of pixels/strips (U & V). - array localU_cluster() const { return localU_cluster_;} - array localV_cluster() const { return localV_cluster_;} - - //--- Check if this stub will be output by front-end readout electronics, - //--- (where we can reconfigure the stub window size and rapidity cut). - //--- Don't use stubs failing this cut. - bool frontendPass() const { return frontendPass_; } - // Indicates if stub would have passed front-end cuts, were it not for window size encoded in DegradeBend.h - bool stubFailedDegradeWindow() const { return stubFailedDegradeWindow_;} - - //--- Quantities common to all stubs in a given module --- - - // Unique identifier for each stacked module, allowing one to check which stubs are on the same module. - unsigned int idDet() const { return idDet_.rawId();} - // Uncertainty in stub coordinates due to strip length, assumed equal to 0.5*strip-or-pixel-length - float rErr() const { return rErr_;} - float zErr() const { return zErr_;} - // Coordinates of centre of two sensors in (r,phi,z) - float minR() const { return moduleMinR_; } - float maxR() const { return moduleMaxR_; } - float minPhi() const { return moduleMinPhi_; } - float maxPhi() const { return moduleMaxPhi_; } - float minZ() const { return moduleMinZ_; } - float maxZ() const { return moduleMaxZ_; } - // Angle between normal to module and beam-line along +ve z axis. (In range -PI/2 to +PI/2). - float moduleTilt() const { return moduleTilt_; } - // Which of two sensors in module is furthest from beam-line? - bool outerModuleAtSmallerR() const { return outerModuleAtSmallerR_; } - // Sensor pitch over separation. - float pitchOverSep() const { return pitchOverSep_;} - // Location of stub in module in units of strip number (or pixel number along finest granularity axis). - // Range from 0 to (nStrips - 1) inclusive. - unsigned int iphi() const { return iphi_; } - // alpha correction for non-radial strips in endcap 2S modules. - // (If true hit at larger r than stub r by deltaR, then stub phi needs correcting by +alpha*deltaR). - // *** TO DO *** : Digitize this. - float alpha() const { return alpha_; } - // Module type: PS or 2S? - bool psModule() const { return psModule_; } - // Tracker layer ID number (1-6 = barrel layer; 11-15 = endcap A disk; 21-25 = endcap B disk) - unsigned int layerId() const { return layerId_; } - // Reduced layer ID (in range 1-7). This encodes the layer ID in only 3 bits (to simplify firmware) by merging some barrel layer and endcap disk layer IDs into a single ID. - unsigned int layerIdReduced() const; - // Endcap ring of module (returns zero in case of barrel) - unsigned int endcapRing() const { return endcapRing_; } - bool barrel() const { return barrel_; } - // True if stub is in tilted barrel module. - bool tiltedBarrel() const { return tiltedBarrel_; } - // Strip pitch (or pixel pitch along shortest axis). - float stripPitch() const { return stripPitch_; } - // Strip length (or pixel pitch along longest axis). - float stripLength() const { return stripLength_; } - // No. of strips in sensor. - unsigned int nStrips() const { return nStrips_; } - // Width of sensitive region of sensor. - float sensorWidth() const { return sensorWidth_; } - // Hit resolution perpendicular to strip (or to longest pixel axis) = pitch/sqrt(12). Measures phi. - float sigmaPerp() const { return sigmaPerp_; } - // Hit resolution parallel to strip (or to longest pixel axis) = length/sqrt(12). Measures r or z. - float sigmaPar() const { return sigmaPar_; } - - // Clone a few of the above functions with the less helpful names expected by the track fitting code. (Try to phase these out with time ...) - unsigned int nstrip() const { return this->nStrips(); } - float width() const { return this->sensorWidth(); } - float sigmaX() const { return this->sigmaPerp(); } - float sigmaZ() const { return this->sigmaPar(); } - - //--- Truth info - - // Association of stub to tracking particles - const set& assocTPs() const { return assocTPs_; } // Return TPs associated to this stub. (Whether only TPs contributing to both clusters are returned is determined by "StubMatchStrict" config param.) - bool genuine() const { return (assocTPs_.size() > 0); } // Did stub match at least one TP? - const TP* assocTP() const { return assocTP_; } // If only one TP contributed to both clusters, this tells you which TP it is. Returns nullptr if none. - - // Association of both clusters making up stub to tracking particles - array genuineCluster() const { return array{ {(assocTPofCluster_[0] != nullptr), (assocTPofCluster_[1] != nullptr)} }; } // Was cluster produced by a single TP? - array assocTPofCluster() const { return assocTPofCluster_; } // Which TP made each cluster. Warning: If cluster was not produced by a single TP, then returns nullptr! (P.S. If both clusters match same TP, then this will equal assocTP()). - - // Note if stub is a crazy distance from the tracking particle trajectory that produced it. (e.g. perhaps produced by delta ray) - bool crazyStub() const; - - // Get stub bend and its resolution, as available within the front end chip (i.e. prior to loss of bits - // or digitisation). - float bendInFrontend() const { return bendInFrontend_; } - float bendResInFrontend() const { return settings_->bendResolution(); } - - // Return tracker geometry (T3, T4, T5 ...) - // See https://github.com/cms-sw/cmssw/blob/CMSSW_9_1_X/Configuration/Geometry/README.md - string trackerGeometryVersion() const { return trackerGeometryVersion_;} - -private: - - // Degrade assumed stub bend resolution. - // Also return boolean indicating if stub bend was outside assumed window, so stub should be rejected - // and return an integer indicating how many values of bend are merged into this single one. - void degradeResolution(float bend, - float& degradedBend, bool& reject, unsigned int& num) const; - - // Set the frontendPass_ flag, indicating if frontend readout electronics will output this stub. - // Argument indicates if stub bend was outside window size encoded in DegradeBend.h - void setFrontend(bool rejectStub); - - // Set info about the module that this stub is in. - void setModuleInfo(const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology, const DetId& detId); - - // Determine tracker geometry version by counting modules. - void setTrackerGeometryVersion(const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology); - - // Function to calculate approximation for dphiOverBendCorrection aka B - double getApproxB(); - - // No HT firmware can access directly the stub bend info. - void check1() const {if (digitizeWarningsOn_ && digitizedForHTinput_) throw cms::Exception("Stub: You can't access digitized bend variable within HT firmware!");} - // If using daisy-chain firmware, then it makes no sense to access the digiitzed values of dphi within HT. - void check2() const {if (digitizeWarningsOn_ && digitizedForHTinput_) throw cms::Exception("Stub: You can't access digitized dphi within the HT or KF!");} - -private: - - const Settings* settings_; // configuration parameters. - - unsigned int index_in_vStubs_; // location of this stub in InputData::vStubs - - //--- Parameters passed along optical links from PP to MP (or equivalent ones if easier for analysis software to use). - // WARNING: If you add any variables in this section, take care to ensure that they are digitized correctly by Stub::digitize(). - float phi_; // stub coords, optionally after digitisation. - float r_; - float z_; - float bend_; // bend of stub. - float dphiOverBend_; // related to rho parameter. - float dphiOverBendCorrection_; // Correction from tilt of module - float dphiOverBendCorrection_approx_; // Correction from tilt of module - unsigned int min_qOverPt_bin_; // Range in q/Pt bins in HT array compatible with stub bend. - unsigned int max_qOverPt_bin_; - - //--- Info about the two clusters that make up the stub. - array localU_cluster_; - array localV_cluster_; - - //--- Parameters common to all stubs in a given module. - DetId idDet_; - float rErr_; - float zErr_; - float moduleMinR_; - float moduleMaxR_; - float moduleMinPhi_; - float moduleMaxPhi_; - float moduleMinZ_; - float moduleMaxZ_; - float moduleTilt_; - float pitchOverSep_; - unsigned int iphi_; - float alpha_; - bool psModule_; - unsigned int layerId_; - unsigned int endcapRing_; - bool barrel_; - bool tiltedBarrel_; - float sigmaPerp_; - float sigmaPar_; - float stripPitch_; - float stripLength_; - unsigned int nStrips_; - float sensorWidth_; - bool outerModuleAtSmallerR_; - //--- Truth info about stub. - const TP* assocTP_; - set assocTPs_; - //--- Truth info about the two clusters that make up the stub - array assocTPofCluster_; - - // Would front-end electronics output this stub? - bool frontendPass_; - // Did stub fail window cuts assumed in DegradeBend.h? - bool stubFailedDegradeWindow_; - // Bend in front end chip (prior to degredation by loss of bits & digitization). - float bendInFrontend_; - // Used for stub bend resolution degrading. - unsigned int numMergedBend_; - - DigitalStub digitalStub_; // Class used to digitize stub if required. - bool digitizedForGPinput_; // Has this stub been digitized for GP input? - bool digitizedForHTinput_; // Has this stub been digitized for HT input? - string digitizedForSForTFinput_; // Has this stub been digitized for seed filter or track fitter input? If so, this was its name. - bool digitizedForDRinput_; // Has this stub been digitized for seed filter input? - bool digitizeWarningsOn_; // Enable warnings about accessing non-digitized quantities. - - // Which tracker geometry is this? - static thread_local string trackerGeometryVersion_; - - // Used to provide TMTT recommendations for stub window sizes that CMS should use. - StubWindowSuggest stubWindowSuggest_; - - // Used to degrade stub bend information. - DegradeBend degradeBend_; - - //--- Utility to emulate dead modules. - static bool stubKillerInit_; - static StubKiller stubKiller_; -}; - -} + class TP; + + // typedef edm::Ref< edm::DetSetVector< Phase2TrackerDigi >, Phase2TrackerDigi > Ref_Phase2TrackerDigi_; + typedef edmNew::DetSetVector > DetSetVec; + typedef edmNew::DetSet > DetSet; + typedef edm::Ref > TTStubRef; + typedef edm::Ref >, TTCluster > + TTClusterRef; + typedef TTStubAssociationMap TTStubAssMap; + typedef TTClusterAssociationMap TTClusterAssMap; + + //=== Represents a Tracker stub (=pair of hits) + + class Stub : public TTStubRef { + public: + // Store useful info about the stub (for use with HYBRID code), with hard-wired constants to allow use outside CMSSW. + Stub(double phi, + double r, + double z, + double bend, + int layerid, + bool psModule, + bool barrel, + unsigned int iphi, + double alpha, + const Settings* settings, + const TrackerTopology* trackerTopology, + unsigned int ID, + unsigned int iPhiSec); + + // Store useful info about stub (for use with TMTT code). + Stub(const TTStubRef& ttStubRef, + unsigned int index_in_vStubs, + const Settings* settings, + const TrackerGeometry* trackerGeometry, + const TrackerTopology* trackerTopology); + + ~Stub() {} + + bool operator==(const Stub& stubOther) { return (this->index() == stubOther.index()); } + + // Fill truth info with association from stub to tracking particles. + // The 1st argument is a map relating TrackingParticles to TP. + void fillTruth(const map, const TP*>& translateTP, + const edm::Handle& mcTruthTTStubHandle, + const edm::Handle& mcTruthTTClusterHandle); + + // Calculate bin range along q/Pt axis of r-phi Hough transform array consistent with bend of this stub. + void calcQoverPtrange(); + + // Digitize stub for input to Geographic Processor, with digitized phi coord. measured relative to closest phi sector. + // (This approximation is valid if their are an integer number of digitisation bins inside each phi nonant). + // However, you should also call digitizeForHTinput() before accessing digitized stub data, even if you only care about that going into GP! Otherwise, you will not identify stubs assigned to more than one nonant. + void digitizeForGPinput(unsigned int iPhiSec); + + // Digitize stub for input to Hough transform, with digitized phi coord. measured relative to specified phi sector. + void digitizeForHTinput(unsigned int iPhiSec); + + // Digitize stub for input to r-z Seed Filter. + // (Kept for backwards compatibility.) + void digitizeForSFinput() { this->digitizeForSForTFinput("SeedFilter"); } + + // Digitize stub for input to r-z Seed Filter or Track Fitter. + // Argument is "SeedFilter" or name of Track Fitter. + void digitizeForSForTFinput(string SForTF); + + // Digitize stub for input to Duplicate Removal . + void digitizeForDRinput(unsigned int stubId); + + // Control warning messages about accessing non-digitized quantities. + void setDigitizeWarningsOn(bool newVal) { digitizeWarningsOn_ = newVal; } + + // Restore stub to pre-digitized state. i.e. Undo what function digitize() did. + + void reset_digitize(); + + // === Functions for returning info about reconstructed stubs === + + // Location in InputData::vStubs_ + unsigned int index() const { return index_in_vStubs_; } + + //--- Stub data and quantities derived from it --- + + // Stub coordinates (optionally after digitisation, if digitisation requested via cfg). + // N.B. Digitisation is not run when the stubs are created, but later, after stubs are assigned to sectors. + // Until then, these functions return the original coordinates. + float phi() const { return phi_; } + float r() const { return r_; } + float z() const { return z_; } + float theta() const { return atan2(r_, z_); } + float eta() const { return asinh(z_ / r_); } + // Access to digitized version of stub coords. + const DigitalStub& digitalStub() const { return digitalStub_; } + // Access to booleans indicating if the stub has been digitized. + bool digitizedForGPinput() const { return digitizedForGPinput_; } + bool digitizedForHTinput() const { return digitizedForHTinput_; } + string digitizedForSForTFinput() const { + return digitizedForSForTFinput_; + } // Returns which SF or TF digitisation was done for, if any. + bool digitizedForDRinput() const { return digitizedForDRinput_; } + + // Get stub bend (i.e. displacement between two hits in stub in units of strip pitch) and its estimated resolution. + float bend() const { + this->check1(); + return bend_; + } + // The bend resolution has a contribution from the sensor and a contribution from encoding the bend into + // a reduced number of bits. + float bendRes() const { + return (settings_->bendResolution() + (numMergedBend_ - 1) * settings_->bendResolutionExtra()); + } + // Number of bend values which loss of bit to store bend resulted in being merged into this bend value. + float numMergedBend() const { return numMergedBend_; } + // Bend angle of track measured by stub and its estimated resolution. + float dphi() const { + this->check2(); + return (bend_ * dphiOverBend()); + } + float dphiRes() const { return (dphiOverBend() * this->bendRes()); } + // Estimated track q/Pt based on stub bend info. + float qOverPt() const { return (this->qOverPtOverBend() * this->bend()); } + float qOverPtres() const { return (this->qOverPtOverBend() * this->bendRes()); } + // Range in q/Pt bins in HT array compatible with stub bend. + unsigned int min_qOverPt_bin() const { return min_qOverPt_bin_; } + unsigned int max_qOverPt_bin() const { return max_qOverPt_bin_; } + // Estimated phi0 of track at beam-line based on stub bend info. + float beta() const { return (phi_ + dphi()); } + // Estimated phi angle at which track intercepts a given radius rad, based on stub bend info. Also estimate uncertainty on this angle due to endcap 2S module strip length. + // This is identical to beta() if rad=0. + pair trkPhiAtR(float rad) const; + // Estimated resolution in trkPhiAtR(rad) based on nominal stub bend resolution. + float trkPhiAtRres(float rad) const { return this->dphiRes() * fabs(1 - rad / r_); } + // Difference in phi between stub and angle at which track crosses given radius, assuming track has given Pt. + float phiDiff(float rad, float Pt) const { return fabs(r_ - rad) * (settings_->invPtToDphi()) / Pt; } + // -- conversion factors + // Ratio of bend angle to bend, where bend is the displacement in strips between the two hits making up stub. + float dphiOverBend() const { + this->check2(); + return dphiOverBend_; + } + // Correction factor that was used when calculating dPhiOverBend, due to tilt of module. + float dphiOverBendCorrection() const { return dphiOverBendCorrection_; } + // Approximation of dphiOverBendCorrection, used in firmware. + float dphiOverBendCorrectionApprox() const { return dphiOverBendCorrection_approx_; } + // Ratio of q/Pt to bend, where bend is the displacement in strips between the two hits making up stub. + float qOverPtOverBend() const { return this->dphiOverBend() / (r_ * settings_->invPtToDphi()); } + + //--- Info about the two clusters that make up the stub. + // Coordinates in frame of sensor, measured in units of strip pitch along two orthogonal axes running perpendicular and parallel to longer axis of pixels/strips (U & V). + array localU_cluster() const { return localU_cluster_; } + array localV_cluster() const { return localV_cluster_; } + + //--- Check if this stub will be output by front-end readout electronics, + //--- (where we can reconfigure the stub window size and rapidity cut). + //--- Don't use stubs failing this cut. + bool frontendPass() const { return frontendPass_; } + // Indicates if stub would have passed front-end cuts, were it not for window size encoded in DegradeBend.h + bool stubFailedDegradeWindow() const { return stubFailedDegradeWindow_; } + + //--- Quantities common to all stubs in a given module --- + + // Unique identifier for each stacked module, allowing one to check which stubs are on the same module. + unsigned int idDet() const { return idDet_.rawId(); } + // Uncertainty in stub coordinates due to strip length, assumed equal to 0.5*strip-or-pixel-length + float rErr() const { return rErr_; } + float zErr() const { return zErr_; } + // Coordinates of centre of two sensors in (r,phi,z) + float minR() const { return moduleMinR_; } + float maxR() const { return moduleMaxR_; } + float minPhi() const { return moduleMinPhi_; } + float maxPhi() const { return moduleMaxPhi_; } + float minZ() const { return moduleMinZ_; } + float maxZ() const { return moduleMaxZ_; } + // Angle between normal to module and beam-line along +ve z axis. (In range -PI/2 to +PI/2). + float moduleTilt() const { return moduleTilt_; } + // Which of two sensors in module is furthest from beam-line? + bool outerModuleAtSmallerR() const { return outerModuleAtSmallerR_; } + // Sensor pitch over separation. + float pitchOverSep() const { return pitchOverSep_; } + // Location of stub in module in units of strip number (or pixel number along finest granularity axis). + // Range from 0 to (nStrips - 1) inclusive. + unsigned int iphi() const { return iphi_; } + // alpha correction for non-radial strips in endcap 2S modules. + // (If true hit at larger r than stub r by deltaR, then stub phi needs correcting by +alpha*deltaR). + // *** TO DO *** : Digitize this. + float alpha() const { return alpha_; } + // Module type: PS or 2S? + bool psModule() const { return psModule_; } + // Tracker layer ID number (1-6 = barrel layer; 11-15 = endcap A disk; 21-25 = endcap B disk) + unsigned int layerId() const { return layerId_; } + // Reduced layer ID (in range 1-7). This encodes the layer ID in only 3 bits (to simplify firmware) by merging some barrel layer and endcap disk layer IDs into a single ID. + unsigned int layerIdReduced() const; + // Endcap ring of module (returns zero in case of barrel) + unsigned int endcapRing() const { return endcapRing_; } + bool barrel() const { return barrel_; } + // True if stub is in tilted barrel module. + bool tiltedBarrel() const { return tiltedBarrel_; } + // Strip pitch (or pixel pitch along shortest axis). + float stripPitch() const { return stripPitch_; } + // Strip length (or pixel pitch along longest axis). + float stripLength() const { return stripLength_; } + // No. of strips in sensor. + unsigned int nStrips() const { return nStrips_; } + // Width of sensitive region of sensor. + float sensorWidth() const { return sensorWidth_; } + // Hit resolution perpendicular to strip (or to longest pixel axis) = pitch/sqrt(12). Measures phi. + float sigmaPerp() const { return sigmaPerp_; } + // Hit resolution parallel to strip (or to longest pixel axis) = length/sqrt(12). Measures r or z. + float sigmaPar() const { return sigmaPar_; } + + // Clone a few of the above functions with the less helpful names expected by the track fitting code. (Try to phase these out with time ...) + unsigned int nstrip() const { return this->nStrips(); } + float width() const { return this->sensorWidth(); } + float sigmaX() const { return this->sigmaPerp(); } + float sigmaZ() const { return this->sigmaPar(); } + + //--- Truth info + + // Association of stub to tracking particles + const set& assocTPs() const { + return assocTPs_; + } // Return TPs associated to this stub. (Whether only TPs contributing to both clusters are returned is determined by "StubMatchStrict" config param.) + bool genuine() const { return (assocTPs_.size() > 0); } // Did stub match at least one TP? + const TP* assocTP() const { + return assocTP_; + } // If only one TP contributed to both clusters, this tells you which TP it is. Returns nullptr if none. + + // Association of both clusters making up stub to tracking particles + array genuineCluster() const { + return array{{(assocTPofCluster_[0] != nullptr), (assocTPofCluster_[1] != nullptr)}}; + } // Was cluster produced by a single TP? + array assocTPofCluster() const { + return assocTPofCluster_; + } // Which TP made each cluster. Warning: If cluster was not produced by a single TP, then returns nullptr! (P.S. If both clusters match same TP, then this will equal assocTP()). + + // Note if stub is a crazy distance from the tracking particle trajectory that produced it. (e.g. perhaps produced by delta ray) + bool crazyStub() const; + + // Get stub bend and its resolution, as available within the front end chip (i.e. prior to loss of bits + // or digitisation). + float bendInFrontend() const { return bendInFrontend_; } + float bendResInFrontend() const { return settings_->bendResolution(); } + + // Return tracker geometry (T3, T4, T5 ...) + // See https://github.com/cms-sw/cmssw/blob/CMSSW_9_1_X/Configuration/Geometry/README.md + string trackerGeometryVersion() const { return trackerGeometryVersion_; } + + private: + // Degrade assumed stub bend resolution. + // Also return boolean indicating if stub bend was outside assumed window, so stub should be rejected + // and return an integer indicating how many values of bend are merged into this single one. + void degradeResolution(float bend, float& degradedBend, bool& reject, unsigned int& num) const; + + // Set the frontendPass_ flag, indicating if frontend readout electronics will output this stub. + // Argument indicates if stub bend was outside window size encoded in DegradeBend.h + void setFrontend(bool rejectStub); + + // Set info about the module that this stub is in. + void setModuleInfo(const TrackerGeometry* trackerGeometry, + const TrackerTopology* trackerTopology, + const DetId& detId); + + // Determine tracker geometry version by counting modules. + void setTrackerGeometryVersion(const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology); + + // Function to calculate approximation for dphiOverBendCorrection aka B + double getApproxB(); + + // No HT firmware can access directly the stub bend info. + void check1() const { + if (digitizeWarningsOn_ && digitizedForHTinput_) + throw cms::Exception("Stub: You can't access digitized bend variable within HT firmware!"); + } + // If using daisy-chain firmware, then it makes no sense to access the digiitzed values of dphi within HT. + void check2() const { + if (digitizeWarningsOn_ && digitizedForHTinput_) + throw cms::Exception("Stub: You can't access digitized dphi within the HT or KF!"); + } + + private: + const Settings* settings_; // configuration parameters. + + unsigned int index_in_vStubs_; // location of this stub in InputData::vStubs + + //--- Parameters passed along optical links from PP to MP (or equivalent ones if easier for analysis software to use). + // WARNING: If you add any variables in this section, take care to ensure that they are digitized correctly by Stub::digitize(). + float phi_; // stub coords, optionally after digitisation. + float r_; + float z_; + float bend_; // bend of stub. + float dphiOverBend_; // related to rho parameter. + float dphiOverBendCorrection_; // Correction from tilt of module + float dphiOverBendCorrection_approx_; // Correction from tilt of module + unsigned int min_qOverPt_bin_; // Range in q/Pt bins in HT array compatible with stub bend. + unsigned int max_qOverPt_bin_; + + //--- Info about the two clusters that make up the stub. + array localU_cluster_; + array localV_cluster_; + + //--- Parameters common to all stubs in a given module. + DetId idDet_; + float rErr_; + float zErr_; + float moduleMinR_; + float moduleMaxR_; + float moduleMinPhi_; + float moduleMaxPhi_; + float moduleMinZ_; + float moduleMaxZ_; + float moduleTilt_; + float pitchOverSep_; + unsigned int iphi_; + float alpha_; + bool psModule_; + unsigned int layerId_; + unsigned int endcapRing_; + bool barrel_; + bool tiltedBarrel_; + float sigmaPerp_; + float sigmaPar_; + float stripPitch_; + float stripLength_; + unsigned int nStrips_; + float sensorWidth_; + bool outerModuleAtSmallerR_; + //--- Truth info about stub. + const TP* assocTP_; + set assocTPs_; + //--- Truth info about the two clusters that make up the stub + array assocTPofCluster_; + + // Would front-end electronics output this stub? + bool frontendPass_; + // Did stub fail window cuts assumed in DegradeBend.h? + bool stubFailedDegradeWindow_; + // Bend in front end chip (prior to degredation by loss of bits & digitization). + float bendInFrontend_; + // Used for stub bend resolution degrading. + unsigned int numMergedBend_; + + DigitalStub digitalStub_; // Class used to digitize stub if required. + bool digitizedForGPinput_; // Has this stub been digitized for GP input? + bool digitizedForHTinput_; // Has this stub been digitized for HT input? + string + digitizedForSForTFinput_; // Has this stub been digitized for seed filter or track fitter input? If so, this was its name. + bool digitizedForDRinput_; // Has this stub been digitized for seed filter input? + bool digitizeWarningsOn_; // Enable warnings about accessing non-digitized quantities. + + // Which tracker geometry is this? + static thread_local string trackerGeometryVersion_; + + // Used to provide TMTT recommendations for stub window sizes that CMS should use. + StubWindowSuggest stubWindowSuggest_; + + // Used to degrade stub bend information. + DegradeBend degradeBend_; + + //--- Utility to emulate dead modules. + static bool stubKillerInit_; + static StubKiller stubKiller_; + }; + +} // namespace TMTT #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/StubCluster.h b/L1Trigger/TrackFindingTMTT/interface/StubCluster.h index c44aa1731a264..dd90b1927dfee 100644 --- a/L1Trigger/TrackFindingTMTT/interface/StubCluster.h +++ b/L1Trigger/TrackFindingTMTT/interface/StubCluster.h @@ -4,83 +4,82 @@ #include #include - // Used to merge all clusters assigned to a track in a single layer into a single StubCluster // whose coordinate is the mean of all the individual clusters. namespace TMTT { -class Stub; -class TP; - -class StubCluster{ + class Stub; + class TP; - public : - StubCluster( std::vector stubs, double SectorPhi, int lres_dr = 1 ); - ~StubCluster(){} + class StubCluster { + public: + StubCluster(std::vector stubs, double SectorPhi, int lres_dr = 1); + ~StubCluster() {} - void setLayerKF(unsigned int lay){layerKF_=lay;} // KF encoded tracker layer - unsigned int layerKF() const {return layerKF_;} + void setLayerKF(unsigned int lay) { layerKF_ = lay; } // KF encoded tracker layer + unsigned int layerKF() const { return layerKF_; } - unsigned nStubs() const { return nstubs_; } - std::vector stubs() const { return stubs_; } // Returns original stubs that were usefd to make StubCluster. - double r() const { return r_; } - double phi() const { return phi_; } - double z() const { return z_; } - double eta() const { return eta_; } - std::set assocTPs() const { return assocTPs_; } - unsigned layerId() const { return layerId_; } - unsigned layerIdReduced() const { return layerIdReduced_; } - unsigned endcapRing() const { return endcapRing_; } - bool barrel() const { return barrel_; } - bool tiltedBarrel() const { return tiltedBarrel_;} - bool psModule() const { return psModule_;} - //quadratic sum of the short side error of sensors and RMS of the sensor positions along the short side. - double sigmaX() const { return sigmaX_; } - //quadratic sum of the long side error of sensors and RMS of the sensor positions along the long side. - double sigmaZ() const { return sigmaZ_; } - //phi error from strip pitch - double dphi_dl() const { return dphi_dl_; } - //phi error from strip length in the endcap - double dphi_dr() const { return dphi_dr_; } - //total phi error - double dphi() const { return dphi_; } - //strip distance in cm from the center of the sensor. - double deltal() const { return deltal_; } - //strip distance from the center of the sensor. - double deltai() const { return deltai_; } - //alpha correction for non-radial strips in endcap 2S modules. - double alpha() const { return alpha_;} - // Angle between normal to module and beam-line along +ve z axis. (In range -PI/2 to PI/2). - double moduleTilt() const { return moduleTilt_;} + unsigned nStubs() const { return nstubs_; } + std::vector stubs() const { + return stubs_; + } // Returns original stubs that were usefd to make StubCluster. + double r() const { return r_; } + double phi() const { return phi_; } + double z() const { return z_; } + double eta() const { return eta_; } + std::set assocTPs() const { return assocTPs_; } + unsigned layerId() const { return layerId_; } + unsigned layerIdReduced() const { return layerIdReduced_; } + unsigned endcapRing() const { return endcapRing_; } + bool barrel() const { return barrel_; } + bool tiltedBarrel() const { return tiltedBarrel_; } + bool psModule() const { return psModule_; } + //quadratic sum of the short side error of sensors and RMS of the sensor positions along the short side. + double sigmaX() const { return sigmaX_; } + //quadratic sum of the long side error of sensors and RMS of the sensor positions along the long side. + double sigmaZ() const { return sigmaZ_; } + //phi error from strip pitch + double dphi_dl() const { return dphi_dl_; } + //phi error from strip length in the endcap + double dphi_dr() const { return dphi_dr_; } + //total phi error + double dphi() const { return dphi_; } + //strip distance in cm from the center of the sensor. + double deltal() const { return deltal_; } + //strip distance from the center of the sensor. + double deltai() const { return deltai_; } + //alpha correction for non-radial strips in endcap 2S modules. + double alpha() const { return alpha_; } + // Angle between normal to module and beam-line along +ve z axis. (In range -PI/2 to PI/2). + double moduleTilt() const { return moduleTilt_; } - private: - std::vector stubs_; - unsigned nstubs_; - double r_; - double phi_; - double z_; - double eta_; - std::set assocTPs_; - unsigned layerId_; - unsigned layerIdReduced_; - unsigned endcapRing_; - unsigned layerKF_; - bool barrel_; - bool tiltedBarrel_; - bool psModule_; - double sigmaX_; - double sigmaZ_; - double dphi_dl_; - double dphi_dr_; - double dphi_; - double deltal_; - double deltai_; - double alpha_; - double moduleTilt_; -}; + private: + std::vector stubs_; + unsigned nstubs_; + double r_; + double phi_; + double z_; + double eta_; + std::set assocTPs_; + unsigned layerId_; + unsigned layerIdReduced_; + unsigned endcapRing_; + unsigned layerKF_; + bool barrel_; + bool tiltedBarrel_; + bool psModule_; + double sigmaX_; + double sigmaZ_; + double dphi_dl_; + double dphi_dr_; + double dphi_; + double deltal_; + double deltai_; + double alpha_; + double moduleTilt_; + }; -} +} // namespace TMTT #endif - diff --git a/L1Trigger/TrackFindingTMTT/interface/StubKiller.h b/L1Trigger/TrackFindingTMTT/interface/StubKiller.h index a82b35fba14a0..e4c3fdda10d12 100644 --- a/L1Trigger/TrackFindingTMTT/interface/StubKiller.h +++ b/L1Trigger/TrackFindingTMTT/interface/StubKiller.h @@ -15,53 +15,51 @@ using namespace std; class StubKiller { - public: - StubKiller(); ~StubKiller() {} - void initialise( unsigned int killScenario, const TrackerTopology* trackerTopology, const TrackerGeometry* trackerGeometry ); + void initialise(unsigned int killScenario, + const TrackerTopology* trackerTopology, + const TrackerGeometry* trackerGeometry); - bool killStub( - const TTStub* stub, - const vector layersToKill, - const int minPhiToKill, - const int maxPhiToKill, - const int minZToKill, - const int maxZToKill, - const int minRToKill, - const int maxRToKill, - const double fractionOfStubsToKillInLayers, - const double fractionOfStubsToKillEverywhere - ); + bool killStub(const TTStub* stub, + const vector layersToKill, + const int minPhiToKill, + const int maxPhiToKill, + const int minZToKill, + const int maxZToKill, + const int minRToKill, + const int maxRToKill, + const double fractionOfStubsToKillInLayers, + const double fractionOfStubsToKillEverywhere); - bool killStub( const TTStub* stub ); + bool killStub(const TTStub* stub); - bool killStubInDeadModule( const TTStub* stub ); + bool killStubInDeadModule(const TTStub* stub); - map getListOfDeadModules() { return deadModules_ ;} + map getListOfDeadModules() { return deadModules_; } private: - void chooseModulesToKill(); - void addDeadLayerModulesToDeadModuleList(); + void chooseModulesToKill(); + void addDeadLayerModulesToDeadModuleList(); - unsigned int killScenario_; - const TrackerTopology* trackerTopology_; - const TrackerGeometry* trackerGeometry_; + unsigned int killScenario_; + const TrackerTopology* trackerTopology_; + const TrackerGeometry* trackerGeometry_; - vector layersToKill_; - int minPhiToKill_; - int maxPhiToKill_; - int minZToKill_; - int maxZToKill_; - int minRToKill_; - int maxRToKill_; - double fractionOfStubsToKillInLayers_; - double fractionOfStubsToKillEverywhere_; - double fractionOfModulesToKillEverywhere_; + vector layersToKill_; + int minPhiToKill_; + int maxPhiToKill_; + int minZToKill_; + int maxZToKill_; + int minRToKill_; + int maxRToKill_; + double fractionOfStubsToKillInLayers_; + double fractionOfStubsToKillEverywhere_; + double fractionOfModulesToKillEverywhere_; - map deadModules_; + map deadModules_; }; #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h b/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h index 0955a3a8ee22d..50a60f48d4cf6 100644 --- a/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h +++ b/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h @@ -11,9 +11,9 @@ class TrackerTopology; namespace TMTT { -class Stub; + class Stub; -/** + /** * ======================================================================================================== * This provides recommendations to CMS for the stub window sizes to be used in the FE electronics. * It prints the output as a python configuration file in the form of @@ -25,46 +25,41 @@ class Stub; * ======================================================================================================== */ -class StubWindowSuggest { + class StubWindowSuggest { + public: + // Initialize (for use with TMTT). + StubWindowSuggest(const Settings* settings, const TrackerTopology* trackerTopo) + : settings_(settings), ptMin_(settings->houghMinPt()), theTrackerTopo_(trackerTopo) {} -public: - - // Initialize (for use with TMTT). - StubWindowSuggest(const Settings* settings, const TrackerTopology* trackerTopo) : - settings_(settings), ptMin_(settings->houghMinPt()), theTrackerTopo_(trackerTopo) {} + // Initialize (for use with HYBRID) + StubWindowSuggest(const Settings* settings) : settings_(settings), ptMin_(settings->houghMinPt()) {} - // Initialize (for use with HYBRID) - StubWindowSuggest(const Settings* settings) : settings_(settings), ptMin_(settings->houghMinPt()) {} + ~StubWindowSuggest() {} - ~StubWindowSuggest() {} + // Analyse stub window required for this stub. + void process(const Stub* stub); - // Analyse stub window required for this stub. - void process(const Stub* stub); + // Print results (should be done in endJob(); + static void printResults(); - // Print results (should be done in endJob(); - static void printResults(); + private: + // Update stored stub window size with this stub. + void updateStoredWindow(const Stub* stub, double bendWind); -private: + private: + // Configuration parameters. + const Settings* settings_; + const float ptMin_; - // Update stored stub window size with this stub. - void updateStoredWindow(const Stub* stub, double bendWind); + const TrackerTopology* theTrackerTopo_; -private: + // Stub window sizes as encoded in L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h + static std::vector barrelCut_; + static std::vector > ringCut_; + static std::vector > tiltedCut_; + static std::vector barrelNTilt_; + }; - // Configuration parameters. - const Settings* settings_; - const float ptMin_; - - const TrackerTopology* theTrackerTopo_; - - // Stub window sizes as encoded in L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h - static std::vector< double > barrelCut_; - static std::vector< std::vector< double > > ringCut_; - static std::vector< std::vector< double > > tiltedCut_; - static std::vector< double > barrelNTilt_; -}; - -} +} // namespace TMTT #endif - diff --git a/L1Trigger/TrackFindingTMTT/interface/TP.h b/L1Trigger/TrackFindingTMTT/interface/TP.h index 2ac88754f081f..d70a8408d95e5 100644 --- a/L1Trigger/TrackFindingTMTT/interface/TP.h +++ b/L1Trigger/TrackFindingTMTT/interface/TP.h @@ -17,121 +17,120 @@ using namespace std; namespace TMTT { -class Stub; - -typedef edm::Ptr TrackingParticlePtr; - -class TP : public TrackingParticlePtr { - -public: - // Fill useful info about tracking particle. - TP(const TrackingParticlePtr& tpPtr, unsigned int index_in_vTPs, const Settings* settings); - ~TP(){} - - bool operator==(const TP& tpOther) {return (this->index() == tpOther.index());} - - // Fill truth info with association from tracking particle to stubs. - void fillTruth(const vector& vStubs); - - // == Functions for returning info about tracking particles === - - // Location in InputData::vTPs_ - unsigned int index() const { return index_in_vTPs_; } - // Basic TP properties - int pdgId() const { return pdgId_; } - // Did TP come from in-time or out-of-time bunch crossing? - bool inTimeBx() const { return inTimeBx_; } - // Did it come from the main physics collision or from pileup? - bool physicsCollision() const { return physicsCollision_; } - int charge() const { return charge_; } - float mass() const { return mass_; } - float pt() const { return pt_; } - float qOverPt() const { return (pt_ > 0) ? charge_/pt_ : 9.9e9; } - float eta() const { return eta_; } - float theta() const { return theta_; } - float tanLambda() const { return tanLambda_; } - float phi0() const { return phi0_; } - // TP production vertex (x,y,z) coordinates. - float vx() const { return vx_; } - float vy() const { return vy_; } - float vz() const { return vz_; } - // d0 and z0 impact parameters with respect to (x,y) = (0,0). - float d0() const { return d0_;} - float z0() const { return z0_;} - // Estimate track bend angle at a given radius, ignoring scattering. - float dphi(float rad) const { return asin(settings_->invPtToDphi() * rad * charge_/pt_); } - // Estimated phi angle at which TP trajectory crosses a given radius rad, ignoring scattering. - float trkPhiAtR(float rad) const { return reco::deltaPhi(phi0_ - this->dphi(rad) - d0_/rad, 0.); } - // Estimated z coord at which TP trajectory crosses a given radius rad, ignoring scattering. - float trkZAtR(float rad) const { return (vz_ + rad * tanLambda_); } - // Estimated phi angle at which TP trajectory crosses the module containing the given stub. - float trkPhiAtStub(const Stub* stub) const; - // Estimated r coord at which TP trajectory crosses the module containing the given stub. - float trkRAtStub(const Stub* stub) const; - // Estimated z coord at which TP trajectory crosses the module containing the given stub. - float trkZAtStub(const Stub* stub) const; - - // == Functions returning stubs produced by tracking particle. - const vector& assocStubs() const { return assocStubs_; } // associated stubs. (Includes those failing tightened front-end electronics cuts supplied by user). (Which stubs are returned is affected by "StubMatchStrict" config param.) - unsigned int numAssocStubs() const { return assocStubs_.size(); } - unsigned int numLayers() const { return nLayersWithStubs_; } - // TP is worth keeping (e.g. for fake rate measurement) - bool use() const { return use_; } - // TP can be used for efficiency measurement (good kinematics, in-time Bx, optionally specified PDG ID). - bool useForEff() const { return useForEff_; } - // TP can be used for algorithmic efficiency measurement (also requires stubs in enough layers). - bool useForAlgEff() const { return useForAlgEff_; } - - void fillNearestJetInfo( const reco::GenJetCollection* genJets ); // Store info (deltaR, pt) with nearest jet - - float tpInJet() const { return tpInJet_ && nearestJetPt_ > 30; } - float tpInHighPtJet() const { return tpInJet_ && nearestJetPt_ > 100; } - float tpInVeryHighPtJet() const { return tpInJet_ && nearestJetPt_ > 200; } - - float nearestJetPt() const { return nearestJetPt_; } - -private: - - void fillUse(); // Fill the use_ flag. - void fillUseForEff(); // Fill the useForEff_ flag. - void fillUseForAlgEff(); // Fill the useforAlgEff_ flag. - - // Calculate how many tracker layers this TP has stubs in. - void calcNumLayers() { nLayersWithStubs_ = Utility::countLayers( settings_, assocStubs_, false); } - -private: - - unsigned int index_in_vTPs_; // location of this TP in InputData::vTPs - - const Settings* settings_; // Configuration parameters - - int pdgId_; - bool inTimeBx_; // TP came from in-time bunch crossing. - bool physicsCollision_; // True if TP from physics collision rather than pileup. - int charge_; - float mass_; - float pt_; // TP kinematics - float eta_; - float theta_; - float tanLambda_; - float phi0_; - float vx_; // TP production point. - float vy_; - float vz_; - float d0_; // d0 impact parameter with respect to (x,y) = (0,0) - float z0_; // z0 impact parameter with respect to (x,y) = (0,0) - - bool use_; // TP is worth keeping (e.g. for fake rate measurement) - bool useForEff_; // TP can be used for tracking efficiency measurement. - bool useForAlgEff_; // TP can be used for tracking algorithmic efficiency measurement. - - vector assocStubs_; - unsigned int nLayersWithStubs_; // Number of tracker layers with stubs from this TP. - - bool tpInJet_; - float nearestJetPt_; -}; - -} + class Stub; + + typedef edm::Ptr TrackingParticlePtr; + + class TP : public TrackingParticlePtr { + public: + // Fill useful info about tracking particle. + TP(const TrackingParticlePtr& tpPtr, unsigned int index_in_vTPs, const Settings* settings); + ~TP() {} + + bool operator==(const TP& tpOther) { return (this->index() == tpOther.index()); } + + // Fill truth info with association from tracking particle to stubs. + void fillTruth(const vector& vStubs); + + // == Functions for returning info about tracking particles === + + // Location in InputData::vTPs_ + unsigned int index() const { return index_in_vTPs_; } + // Basic TP properties + int pdgId() const { return pdgId_; } + // Did TP come from in-time or out-of-time bunch crossing? + bool inTimeBx() const { return inTimeBx_; } + // Did it come from the main physics collision or from pileup? + bool physicsCollision() const { return physicsCollision_; } + int charge() const { return charge_; } + float mass() const { return mass_; } + float pt() const { return pt_; } + float qOverPt() const { return (pt_ > 0) ? charge_ / pt_ : 9.9e9; } + float eta() const { return eta_; } + float theta() const { return theta_; } + float tanLambda() const { return tanLambda_; } + float phi0() const { return phi0_; } + // TP production vertex (x,y,z) coordinates. + float vx() const { return vx_; } + float vy() const { return vy_; } + float vz() const { return vz_; } + // d0 and z0 impact parameters with respect to (x,y) = (0,0). + float d0() const { return d0_; } + float z0() const { return z0_; } + // Estimate track bend angle at a given radius, ignoring scattering. + float dphi(float rad) const { return asin(settings_->invPtToDphi() * rad * charge_ / pt_); } + // Estimated phi angle at which TP trajectory crosses a given radius rad, ignoring scattering. + float trkPhiAtR(float rad) const { return reco::deltaPhi(phi0_ - this->dphi(rad) - d0_ / rad, 0.); } + // Estimated z coord at which TP trajectory crosses a given radius rad, ignoring scattering. + float trkZAtR(float rad) const { return (vz_ + rad * tanLambda_); } + // Estimated phi angle at which TP trajectory crosses the module containing the given stub. + float trkPhiAtStub(const Stub* stub) const; + // Estimated r coord at which TP trajectory crosses the module containing the given stub. + float trkRAtStub(const Stub* stub) const; + // Estimated z coord at which TP trajectory crosses the module containing the given stub. + float trkZAtStub(const Stub* stub) const; + + // == Functions returning stubs produced by tracking particle. + const vector& assocStubs() const { + return assocStubs_; + } // associated stubs. (Includes those failing tightened front-end electronics cuts supplied by user). (Which stubs are returned is affected by "StubMatchStrict" config param.) + unsigned int numAssocStubs() const { return assocStubs_.size(); } + unsigned int numLayers() const { return nLayersWithStubs_; } + // TP is worth keeping (e.g. for fake rate measurement) + bool use() const { return use_; } + // TP can be used for efficiency measurement (good kinematics, in-time Bx, optionally specified PDG ID). + bool useForEff() const { return useForEff_; } + // TP can be used for algorithmic efficiency measurement (also requires stubs in enough layers). + bool useForAlgEff() const { return useForAlgEff_; } + + void fillNearestJetInfo(const reco::GenJetCollection* genJets); // Store info (deltaR, pt) with nearest jet + + float tpInJet() const { return tpInJet_ && nearestJetPt_ > 30; } + float tpInHighPtJet() const { return tpInJet_ && nearestJetPt_ > 100; } + float tpInVeryHighPtJet() const { return tpInJet_ && nearestJetPt_ > 200; } + + float nearestJetPt() const { return nearestJetPt_; } + + private: + void fillUse(); // Fill the use_ flag. + void fillUseForEff(); // Fill the useForEff_ flag. + void fillUseForAlgEff(); // Fill the useforAlgEff_ flag. + + // Calculate how many tracker layers this TP has stubs in. + void calcNumLayers() { nLayersWithStubs_ = Utility::countLayers(settings_, assocStubs_, false); } + + private: + unsigned int index_in_vTPs_; // location of this TP in InputData::vTPs + + const Settings* settings_; // Configuration parameters + + int pdgId_; + bool inTimeBx_; // TP came from in-time bunch crossing. + bool physicsCollision_; // True if TP from physics collision rather than pileup. + int charge_; + float mass_; + float pt_; // TP kinematics + float eta_; + float theta_; + float tanLambda_; + float phi0_; + float vx_; // TP production point. + float vy_; + float vz_; + float d0_; // d0 impact parameter with respect to (x,y) = (0,0) + float z0_; // z0 impact parameter with respect to (x,y) = (0,0) + + bool use_; // TP is worth keeping (e.g. for fake rate measurement) + bool useForEff_; // TP can be used for tracking efficiency measurement. + bool useForAlgEff_; // TP can be used for tracking algorithmic efficiency measurement. + + vector assocStubs_; + unsigned int nLayersWithStubs_; // Number of tracker layers with stubs from this TP. + + bool tpInJet_; + float nearestJetPt_; + }; + +} // namespace TMTT #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h b/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h index 53540d2cc1e69..cd456f9309db4 100644 --- a/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h +++ b/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h @@ -6,7 +6,7 @@ #define __TrackFitGeneric_H__ // Don't fit track candidates if they have more than this number of stubs. -#define __MAX_STUBS_PER_TRK__ 30 +#define __MAX_STUBS_PER_TRK__ 30 #include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" @@ -18,41 +18,37 @@ using namespace std; namespace TMTT { -class Settings; + class Settings; -class TrackFitGeneric { + class TrackFitGeneric { + public: + // Set configuration parameters. + TrackFitGeneric(const Settings* settings, const string& fitterName = ""); -public: + virtual ~TrackFitGeneric() {} - // Set configuration parameters. - TrackFitGeneric( const Settings* settings, const string &fitterName="" ); + // Static method to produce a fitter based on a string + // static std::auto_ptr create(std::string, const Settings* settings); + static TrackFitGeneric* create(std::string, const Settings* settings); + virtual void bookHists() {} - virtual ~TrackFitGeneric() {} + virtual void initRun() {} + // Fit a track candidate obtained from the Hough Transform. + virtual L1fittedTrack fit(const L1track3D& l1track3D); - // Static method to produce a fitter based on a string -// static std::auto_ptr create(std::string, const Settings* settings); - static TrackFitGeneric* create(std::string, const Settings* settings); - virtual void bookHists(){} + // Optional debug printout at end of job. + virtual void endJob() {} - virtual void initRun() {} - // Fit a track candidate obtained from the Hough Transform. - virtual L1fittedTrack fit( const L1track3D& l1track3D ); + const Settings* getSettings() const { return settings_; } + unsigned nDupStubs() const { return nDupStubs_; } - // Optional debug printout at end of job. - virtual void endJob() {} + protected: + // Configuration parameters + const Settings* settings_; + const string fitterName_; + unsigned nDupStubs_; + }; - const Settings* getSettings()const{return settings_;} - unsigned nDupStubs()const{ return nDupStubs_; } - -protected: - - // Configuration parameters - const Settings* settings_; - const string fitterName_; - unsigned nDupStubs_; -}; - -} +} // namespace TMTT #endif - diff --git a/L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h b/L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h index e12a84794d970..dd595635cd82d 100644 --- a/L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h +++ b/L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h @@ -16,38 +16,37 @@ class TrackerGeometry; namespace TMTT { - -/** + /** * ======================================================================================================== * Class for storing info on tracker geometry * Currently stores the z/r and B of tilted modules, and only needs to do this once per job * ======================================================================================================== */ -class TrackerGeometryInfo { - -public: - - // Initialize. - TrackerGeometryInfo(); + class TrackerGeometryInfo { + public: + // Initialize. + TrackerGeometryInfo(); - ~TrackerGeometryInfo() {} + ~TrackerGeometryInfo() {} - void getTiltedModuleInfo(const Settings* settings, const TrackerTopology* trackerTopo, const TrackerGeometry* trackerGeom); - double barrelNTiltedModules() const { return barrelNTiltedModules_; } - double barrelNLayersWithTiltedModules() const { return barrelNLayersWithTiltedModules_; } + void getTiltedModuleInfo(const Settings* settings, + const TrackerTopology* trackerTopo, + const TrackerGeometry* trackerGeom); + double barrelNTiltedModules() const { return barrelNTiltedModules_; } + double barrelNLayersWithTiltedModules() const { return barrelNLayersWithTiltedModules_; } - vector< double > moduleZoR() const { return moduleZoR_; } - vector< double > moduleB() const { return moduleB_; } + vector moduleZoR() const { return moduleZoR_; } + vector moduleB() const { return moduleB_; } -private: - unsigned int barrelNTiltedModules_; - unsigned int barrelNLayersWithTiltedModules_; + private: + unsigned int barrelNTiltedModules_; + unsigned int barrelNLayersWithTiltedModules_; - std::vector< double > moduleZoR_; - vector< double > moduleB_; -}; + std::vector moduleZoR_; + vector moduleB_; + }; -} +} // namespace TMTT #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h b/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h index 6fdba06c544d6..3c3091f5401b7 100644 --- a/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h +++ b/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h @@ -19,7 +19,7 @@ using namespace std; //=== The r-z filters also add an estimate of the r-z helix parameters to the selected track candidates, //=== The filtered tracks are returned at L1track3D type, since they contain this information. //=== -//=== It does NOT contain filters such as the bend filter, which are so simple that the firmware can run them +//=== It does NOT contain filters such as the bend filter, which are so simple that the firmware can run them //=== INSIDE the r-phi HT. Simple filters of this kind are in class HTcell. //=== //=== After creating the L1track3D tracks, TrkRZfilter can optionally run duplicate removal on them, @@ -27,100 +27,112 @@ using namespace std; namespace TMTT { -class Settings; -class Stub; - -class TrkRZfilter { - -public: - - TrkRZfilter() : settings_(nullptr), iPhiSec_(0), iEtaReg_(0), etaMinSector_(0), etaMaxSector_(0), phiCentreSector_(0), rzHelix_z0_(0), rzHelix_tanL_(0), rzHelix_set_(false), chosenRofZ_(0), zTrkMinSector_(0), zTrkMaxSector_(0), beamWindowZ_(0) {} - ~TrkRZfilter() {} - - struct SortStubsInLayer{ - inline bool operator() (const Stub *stub1, const Stub *stub2){ - return(fabs(stub1->layerId()) < fabs(stub2->layerId())); + class Settings; + class Stub; + + class TrkRZfilter { + public: + TrkRZfilter() + : settings_(nullptr), + iPhiSec_(0), + iEtaReg_(0), + etaMinSector_(0), + etaMaxSector_(0), + phiCentreSector_(0), + rzHelix_z0_(0), + rzHelix_tanL_(0), + rzHelix_set_(false), + chosenRofZ_(0), + zTrkMinSector_(0), + zTrkMaxSector_(0), + beamWindowZ_(0) {} + ~TrkRZfilter() {} + + struct SortStubsInLayer { + inline bool operator()(const Stub* stub1, const Stub* stub2) { + return (fabs(stub1->layerId()) < fabs(stub2->layerId())); } }; - - - // Initialize configuration parameters, and note sector number, eta range covered by sector and phi coordinate of its centre. - void init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, - float etaMinSector, float etaMaxSector, float phiCentreSector); - // Filters track candidates (found by the r-phi Hough transform), removing inconsistent stubs from the tracks, - // also killing some of the tracks altogether if they are left with too few stubs. - // Also adds an estimate of r-z helix parameters to the selected track objects, returning the tracks as L1track3D type. - // - vector filterTracks(const vector& tracks); + // Initialize configuration parameters, and note sector number, eta range covered by sector and phi coordinate of its centre. + void init(const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float etaMinSector, + float etaMaxSector, + float phiCentreSector); - //=== Extra information about each track input to filter. (Only use after you have first called filterTracks). + // Filters track candidates (found by the r-phi Hough transform), removing inconsistent stubs from the tracks, + // also killing some of the tracks altogether if they are left with too few stubs. + // Also adds an estimate of r-z helix parameters to the selected track objects, returning the tracks as L1track3D type. + // + vector filterTracks(const vector& tracks); - // Number of seed combinations considered by the Seed Filter for each input track. - vector numSeedCombsPerTrk() const {return numSeedCombsPerTrk_; } - vector numGoodSeedCombsPerTrk() const {return numGoodSeedCombsPerTrk_; } // Only counts seeds compatible with beam-spot. + //=== Extra information about each track input to filter. (Only use after you have first called filterTracks). + // Number of seed combinations considered by the Seed Filter for each input track. + vector numSeedCombsPerTrk() const { return numSeedCombsPerTrk_; } + vector numGoodSeedCombsPerTrk() const { + return numGoodSeedCombsPerTrk_; + } // Only counts seeds compatible with beam-spot. -private: + private: + //--- Filters returning filtered stubs based on input ones. - //--- Filters returning filtered stubs based on input ones. - - // Use Seed Filter to produce a filtered collection of stubs on this track candidate that are consistent with a straight line - // in r-z using tracklet algo. - vector seedFilter (const vector& stubs, float trkQoverPt, bool print ); + // Use Seed Filter to produce a filtered collection of stubs on this track candidate that are consistent with a straight line + // in r-z using tracklet algo. + vector seedFilter(const vector& stubs, float trkQoverPt, bool print); - //--- Estimate r-z helix parameters from centre of eta-sector if no better estimate provided by r-z filter. - void estRZhelix(); + //--- Estimate r-z helix parameters from centre of eta-sector if no better estimate provided by r-z filter. + void estRZhelix(); -private: + private: + //=== Configuration parameters - //=== Configuration parameters + const Settings* settings_; - const Settings* settings_; + unsigned int iPhiSec_; // Sector number. + unsigned int iEtaReg_; + float etaMinSector_; // rapidity range of this sector. + float etaMaxSector_; + float phiCentreSector_; // phi coordinate of its centre. - unsigned int iPhiSec_; // Sector number. - unsigned int iEtaReg_; - float etaMinSector_; // rapidity range of this sector. - float etaMaxSector_; - float phiCentreSector_; // phi coordinate of its centre. + // Track (z0, tan_lambda) estimate from r-z filter or centre of eta sector, and boolean to indicate if this data is filled. + float rzHelix_z0_; + float rzHelix_tanL_; + bool rzHelix_set_; - // Track (z0, tan_lambda) estimate from r-z filter or centre of eta sector, and boolean to indicate if this data is filled. - float rzHelix_z0_; - float rzHelix_tanL_; - bool rzHelix_set_; + // Useful info for r-z filters. + float chosenRofZ_; // Radius used to defined zTrkMinSector and zTrkMaxSector. + float zTrkMinSector_; // corresponding range of this sector specified as z coordinate of track at given radius. + float zTrkMaxSector_; + float beamWindowZ_; // Assumed length of beam spot in z. - // Useful info for r-z filters. - float chosenRofZ_; // Radius used to defined zTrkMinSector and zTrkMaxSector. - float zTrkMinSector_; // corresponding range of this sector specified as z coordinate of track at given radius. - float zTrkMaxSector_; - float beamWindowZ_; // Assumed length of beam spot in z. + // Name of r-z track filter algorithm to run. + string rzFilterName_; - // Name of r-z track filter algorithm to run. - string rzFilterName_; + // Filter stubs in cell using Seed Filter? (a tracklet-like algorithm in r-z plane). + bool useSeedFilter_; - // Filter stubs in cell using Seed Filter? (a tracklet-like algorithm in r-z plane). - bool useSeedFilter_; + // Options for Seed filter. + float seedResolution_; + bool keepAllSeed_; - // Options for Seed filter. - float seedResolution_; - bool keepAllSeed_; + // Number of seed combinations considered by the Seed Filter, for each input track. + vector numSeedCombsPerTrk_; + vector numGoodSeedCombsPerTrk_; + unsigned int maxSeedCombinations_; + unsigned int maxGoodSeedCombinations_; + unsigned int maxSeedsPerStub_; + bool zTrkSectorCheck_; - // Number of seed combinations considered by the Seed Filter, for each input track. - vector numSeedCombsPerTrk_; - vector numGoodSeedCombsPerTrk_; - unsigned int maxSeedCombinations_; - unsigned int maxGoodSeedCombinations_; - unsigned int maxSeedsPerStub_; - bool zTrkSectorCheck_; + // For debugging + unsigned int minNumMatchLayers_; - // For debugging - unsigned int minNumMatchLayers_; + //=== Contains algorithm used for optional duplicate track removal. + KillDupTrks killDupTrks_; + }; - //=== Contains algorithm used for optional duplicate track removal. - KillDupTrks killDupTrks_; -}; - -} +} // namespace TMTT #endif - diff --git a/L1Trigger/TrackFindingTMTT/interface/Utility.h b/L1Trigger/TrackFindingTMTT/interface/Utility.h index 890ebdb953f71..2e915b7030842 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Utility.h +++ b/L1Trigger/TrackFindingTMTT/interface/Utility.h @@ -7,40 +7,46 @@ using namespace std; namespace TMTT { -class TP; -class Stub; -class Settings; - -namespace Utility { - // Count number of tracker layers a given list of stubs are in. - // - // By default uses the "reduced" layer ID if the configuration file requested it. However, - // you can insist on "normal" layer ID being used instead, ignoring the configuration file, by - // setting disableReducedLayerID = true. - // - // N.B. The "reduced" layer ID merges some layer IDs, so that no more than 8 ID are needed in any - // eta region, so as to simplify the firmware. - // - // N.B. You should set disableReducedLayerID = false when counting the number of layers on a tracking - // particle or how many layers it shares with an L1 track. Such counts by CMS convention use "normal" layer ID. - // - // By default, considers both PS+2S modules, but optionally considers only the PS ones if onlyPS = true. - - unsigned int countLayers(const Settings* settings, const vector& stubs, bool disableReducedLayerID = false, bool onlyPS = false); - - // Given a set of stubs (presumably on a reconstructed track candidate) - // return the best matching Tracking Particle (if any), - // the number of tracker layers in which one of the stubs matched one from this tracking particle, - // and the list of the subset of the stubs which match those on the tracking particle. - - const TP* matchingTP(const Settings* settings, const vector& vstubs, - unsigned int& nMatchedLayersBest, vector& matchedStubsBest); - - // Determine the minimum number of layers a track candidate must have stubs in to be defined as a track. - // The first argument indicates from what type of algorithm this function is called: "HT", "SEED", "DUP" or "FIT". - unsigned int numLayerCut(string algo, const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, float invPt, float eta = 0.); -} - -} + class TP; + class Stub; + class Settings; + + namespace Utility { + // Count number of tracker layers a given list of stubs are in. + // + // By default uses the "reduced" layer ID if the configuration file requested it. However, + // you can insist on "normal" layer ID being used instead, ignoring the configuration file, by + // setting disableReducedLayerID = true. + // + // N.B. The "reduced" layer ID merges some layer IDs, so that no more than 8 ID are needed in any + // eta region, so as to simplify the firmware. + // + // N.B. You should set disableReducedLayerID = false when counting the number of layers on a tracking + // particle or how many layers it shares with an L1 track. Such counts by CMS convention use "normal" layer ID. + // + // By default, considers both PS+2S modules, but optionally considers only the PS ones if onlyPS = true. + + unsigned int countLayers(const Settings* settings, + const vector& stubs, + bool disableReducedLayerID = false, + bool onlyPS = false); + + // Given a set of stubs (presumably on a reconstructed track candidate) + // return the best matching Tracking Particle (if any), + // the number of tracker layers in which one of the stubs matched one from this tracking particle, + // and the list of the subset of the stubs which match those on the tracking particle. + + const TP* matchingTP(const Settings* settings, + const vector& vstubs, + unsigned int& nMatchedLayersBest, + vector& matchedStubsBest); + + // Determine the minimum number of layers a track candidate must have stubs in to be defined as a track. + // The first argument indicates from what type of algorithm this function is called: "HT", "SEED", "DUP" or "FIT". + unsigned int numLayerCut( + string algo, const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, float invPt, float eta = 0.); + } // namespace Utility + +} // namespace TMTT #endif diff --git a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h index 5c94bf145f071..5fb2b95afa1ec 100644 --- a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h +++ b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h @@ -13,29 +13,34 @@ namespace demo { -/** + /** * @brief Utility class to convert simulation objects into edm did objects */ - -class DigiConverter { + class DigiConverter { public: - DigiConverter( const TMTT::Settings* settings ); + DigiConverter(const TMTT::Settings* settings); ~DigiConverter() = default; - DigiDTCStub makeDigiDTCStub( const TMTT::Stub& aDTCStub, uint32_t aDigiPhiSec ) const; - DigiHTStub makeDigiHTStub( const TMTT::Stub& aHTStub, uint32_t aPhiSectorIdInNon, uint32_t aEtaSectorId, int cBin, int aChiZ, int aChiPhi, bool mSel) const; - DigiHTMiniStub makeDigiHTMiniStub( const TMTT::Stub& aHTMiniStub, uint32_t aPhiSectorIdInNon, uint32_t aEtaSectorId, int8_t cBin, int8_t mBin) const; - DigiKF4Track makeDigiKF4Track( const TMTT::L1fittedTrack& aFitTrk ) const; + DigiDTCStub makeDigiDTCStub(const TMTT::Stub& aDTCStub, uint32_t aDigiPhiSec) const; + DigiHTStub makeDigiHTStub(const TMTT::Stub& aHTStub, + uint32_t aPhiSectorIdInNon, + uint32_t aEtaSectorId, + int cBin, + int aChiZ, + int aChiPhi, + bool mSel) const; + DigiHTMiniStub makeDigiHTMiniStub(const TMTT::Stub& aHTMiniStub, + uint32_t aPhiSectorIdInNon, + uint32_t aEtaSectorId, + int8_t cBin, + int8_t mBin) const; + DigiKF4Track makeDigiKF4Track(const TMTT::L1fittedTrack& aFitTrk) const; private: + const TMTT::Settings* mSettings; // Configuration parameters. + }; - const TMTT::Settings *mSettings; // Configuration parameters. - -}; - - - -} // demo +} // namespace demo #endif /* __DEMONSTRATOR_DATAFORMATS_DIGICONVERTER_H__ */ diff --git a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.icc b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.icc index 3981c57fe3b6f..76e7d6e47969c 100644 --- a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.icc +++ b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.icc @@ -1,98 +1,86 @@ #include "L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h" - - namespace demo { -//----------------------------------------------------------------------------- -DigiConverter::DigiConverter( const TMTT::Settings* settings ) : -mSettings(settings) { - -} -//----------------------------------------------------------------------------- - - -//----------------------------------------------------------------------------- -DigiDTCStub -DigiConverter::makeDigiDTCStub(const TMTT::Stub& aDTCStub, uint32_t aDigiPhiSec) const { - return DigiDTCStub( - aDTCStub.digitalStub().iDigi_PhiO(), - aDTCStub.digitalStub().moduleType(), - aDigiPhiSec, - aDTCStub.digitalStub().iDigi_Z(), - aDTCStub.digitalStub().iDigi_Bend(), - aDTCStub.digitalStub().iDigi_Rt(), - true - ); -} -//----------------------------------------------------------------------------- - - -//----------------------------------------------------------------------------- -DigiHTStub -DigiConverter::makeDigiHTStub( const TMTT::Stub& aHTStub, uint32_t aPhiSectorIdInNon, uint32_t aEtaSectorId, int cBin, int aChiZ, int aChiPhi, bool mSel ) const { - return DigiHTStub( - aHTStub.layerIdReduced(), - aPhiSectorIdInNon, - aEtaSectorId, - cBin, - aChiZ, - aChiPhi, - aHTStub.digitalStub().iDigi_Rt(), - mSel, - true // valid - ); -} -//----------------------------------------------------------------------------- - - -//----------------------------------------------------------------------------- -DigiHTMiniStub -DigiConverter::makeDigiHTMiniStub( const TMTT::Stub& aHTMiniStub, uint32_t aPhiSectorIdInNon, uint32_t aEtaSectorId, int8_t cBin, int8_t mBin) const { - return DigiHTMiniStub( - aHTMiniStub.layerIdReduced(), - aPhiSectorIdInNon, - aEtaSectorId, - cBin, - mBin, - aHTMiniStub.digitalStub().iDigi_PhiS(), - aHTMiniStub.digitalStub().iDigi_Z(), - aHTMiniStub.digitalStub().iDigi_Rt(), - true // valid - ); -} -//----------------------------------------------------------------------------- - - -//----------------------------------------------------------------------------- -DigiKF4Track -DigiConverter::makeDigiKF4Track( const TMTT::L1fittedTrack& aFitTrk ) const { - + //----------------------------------------------------------------------------- + DigiConverter::DigiConverter(const TMTT::Settings* settings) : mSettings(settings) {} + //----------------------------------------------------------------------------- + + //----------------------------------------------------------------------------- + DigiDTCStub DigiConverter::makeDigiDTCStub(const TMTT::Stub& aDTCStub, uint32_t aDigiPhiSec) const { + return DigiDTCStub(aDTCStub.digitalStub().iDigi_PhiO(), + aDTCStub.digitalStub().moduleType(), + aDigiPhiSec, + aDTCStub.digitalStub().iDigi_Z(), + aDTCStub.digitalStub().iDigi_Bend(), + aDTCStub.digitalStub().iDigi_Rt(), + true); + } + //----------------------------------------------------------------------------- + + //----------------------------------------------------------------------------- + DigiHTStub DigiConverter::makeDigiHTStub(const TMTT::Stub& aHTStub, + uint32_t aPhiSectorIdInNon, + uint32_t aEtaSectorId, + int cBin, + int aChiZ, + int aChiPhi, + bool mSel) const { + return DigiHTStub(aHTStub.layerIdReduced(), + aPhiSectorIdInNon, + aEtaSectorId, + cBin, + aChiZ, + aChiPhi, + aHTStub.digitalStub().iDigi_Rt(), + mSel, + true // valid + ); + } + //----------------------------------------------------------------------------- + + //----------------------------------------------------------------------------- + DigiHTMiniStub DigiConverter::makeDigiHTMiniStub(const TMTT::Stub& aHTMiniStub, + uint32_t aPhiSectorIdInNon, + uint32_t aEtaSectorId, + int8_t cBin, + int8_t mBin) const { + return DigiHTMiniStub(aHTMiniStub.layerIdReduced(), + aPhiSectorIdInNon, + aEtaSectorId, + cBin, + mBin, + aHTMiniStub.digitalStub().iDigi_PhiS(), + aHTMiniStub.digitalStub().iDigi_Z(), + aHTMiniStub.digitalStub().iDigi_Rt(), + true // valid + ); + } + //----------------------------------------------------------------------------- + + //----------------------------------------------------------------------------- + DigiKF4Track DigiConverter::makeDigiKF4Track(const TMTT::L1fittedTrack& aFitTrk) const { const uint numPhiSecPerNon = mSettings->numPhiSectors() / mSettings->numPhiNonants(); - return DigiKF4Track( - aFitTrk.digitaltrack().iDigi_oneOver2r(), - aFitTrk.digitaltrack().iDigi_phi0rel(), - aFitTrk.digitaltrack().iDigi_tanLambda(), - aFitTrk.digitaltrack().iDigi_z0(), - 0, // d0 - aFitTrk.digitaltrack().iDigi_chisquaredRphi(), - aFitTrk.digitaltrack().iDigi_chisquaredRz(), - aFitTrk.getHitPattern(), - aFitTrk.getNumLayers(), - 0, - aFitTrk.getCellLocationHT().first - mSettings->houghNbinsPt() / 2, - aFitTrk.getCellLocationHT().second - mSettings->houghNbinsPhi() / 2, - aFitTrk.iPhiSec()%numPhiSecPerNon, - aFitTrk.iEtaReg(), - aFitTrk.getCellLocationFit().first - mSettings->houghNbinsPt() / 2, - aFitTrk.getCellLocationFit().second - mSettings->houghNbinsPhi() / 2, - aFitTrk.consistentHTcell(), - true - ); - -} -//----------------------------------------------------------------------------- - -} // namespace demo - + return DigiKF4Track(aFitTrk.digitaltrack().iDigi_oneOver2r(), + aFitTrk.digitaltrack().iDigi_phi0rel(), + aFitTrk.digitaltrack().iDigi_tanLambda(), + aFitTrk.digitaltrack().iDigi_z0(), + 0, // d0 + aFitTrk.digitaltrack().iDigi_chisquaredRphi(), + aFitTrk.digitaltrack().iDigi_chisquaredRz(), + aFitTrk.getHitPattern(), + aFitTrk.getNumLayers(), + 0, + aFitTrk.getCellLocationHT().first - mSettings->houghNbinsPt() / 2, + aFitTrk.getCellLocationHT().second - mSettings->houghNbinsPhi() / 2, + aFitTrk.iPhiSec() % numPhiSecPerNon, + aFitTrk.iEtaReg(), + aFitTrk.getCellLocationFit().first - mSettings->houghNbinsPt() / 2, + aFitTrk.getCellLocationFit().second - mSettings->houghNbinsPhi() / 2, + aFitTrk.consistentHTcell(), + true); + } + //----------------------------------------------------------------------------- + +} // namespace demo diff --git a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.h b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.h index 61d03eaa5e9d3..a2107a743661c 100644 --- a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.h +++ b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.h @@ -29,44 +29,41 @@ using namespace std; namespace demo { -/*class Settings; + /*class Settings; class Histos; class TrackFitGeneric;*/ -class DigiProducer : public edm::EDProducer { + class DigiProducer : public edm::EDProducer { + public: + explicit DigiProducer(const edm::ParameterSet &); + ~DigiProducer() {} -public: - explicit DigiProducer(const edm::ParameterSet&); - ~DigiProducer(){} + private: + typedef std::vector > TTTrackCollection; -private: + virtual void beginRun(const edm::Run &, const edm::EventSetup &); + virtual void produce(edm::Event &, const edm::EventSetup &); + virtual void endJob(); - typedef std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > TTTrackCollection; + private: + const edm::EDGetTokenT tpInputTag; + const edm::EDGetTokenT stubInputTag; + const edm::EDGetTokenT stubTruthInputTag; + const edm::EDGetTokenT clusterTruthInputTag; + const edm::EDGetTokenT genJetInputTag_; - virtual void beginRun(const edm::Run&, const edm::EventSetup&); - virtual void produce(edm::Event&, const edm::EventSetup&); - virtual void endJob() ; + // Configuration parameters + TMTT::Settings *settings_; + vector trackFitters_; + vector useRZfilter_; + bool runRZfilter_; -private: - const edm::EDGetTokenT tpInputTag; - const edm::EDGetTokenT stubInputTag; - const edm::EDGetTokenT stubTruthInputTag; - const edm::EDGetTokenT clusterTruthInputTag; - const edm::EDGetTokenT genJetInputTag_; - - // Configuration parameters - TMTT::Settings *settings_; - vector trackFitters_; - vector useRZfilter_; - bool runRZfilter_; + TMTT::Histos *hists_; + map fitterWorkerMap_; - TMTT::Histos *hists_; - map fitterWorkerMap_; + TMTT::TrackerGeometryInfo trackerGeometryInfo_; + }; - TMTT::TrackerGeometryInfo trackerGeometryInfo_; -}; - -} +} // namespace demo #endif /* __DEMONSTRATOR_PRODUCER_DIGIPRODUCER_HPP__ */ - diff --git a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.icc b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.icc index 0d5c0f301a258..2acc990665d8e 100644 --- a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.icc +++ b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.icc @@ -41,31 +41,32 @@ using boost::numeric::ublas::matrix; namespace demo { -DigiProducer::DigiProducer(const edm::ParameterSet& iConfig): - tpInputTag( consumes( iConfig.getParameter("tpInputTag") ) ), - stubInputTag( consumes( iConfig.getParameter("stubInputTag") ) ), - stubTruthInputTag( consumes( iConfig.getParameter("stubTruthInputTag") ) ), - clusterTruthInputTag( consumes( iConfig.getParameter("clusterTruthInputTag") ) ), - genJetInputTag_( consumes( iConfig.getParameter("genJetInputTag") ) ), - trackerGeometryInfo_() { + DigiProducer::DigiProducer(const edm::ParameterSet& iConfig) + : tpInputTag(consumes(iConfig.getParameter("tpInputTag"))), + stubInputTag(consumes(iConfig.getParameter("stubInputTag"))), + stubTruthInputTag(consumes(iConfig.getParameter("stubTruthInputTag"))), + clusterTruthInputTag( + consumes(iConfig.getParameter("clusterTruthInputTag"))), + genJetInputTag_(consumes(iConfig.getParameter("genJetInputTag"))), + trackerGeometryInfo_() { // Get configuration parameters settings_ = new TMTT::Settings(iConfig); trackFitters_ = settings_->trackFitters(); useRZfilter_ = settings_->useRZfilter(); - runRZfilter_ = (useRZfilter_.size() > 0); // Do any fitters require an r-z track filter to be run? + runRZfilter_ = (useRZfilter_.size() > 0); // Do any fitters require an r-z track filter to be run? // Tame debug printout. cout.setf(ios::fixed, ios::floatfield); cout.precision(4); // Book histograms. - hists_ = new TMTT::Histos( settings_ ); + hists_ = new TMTT::Histos(settings_); hists_->book(); // Create track fitting algorithm (& internal histograms if it uses them) for (const string& fitterName : trackFitters_) { - fitterWorkerMap_[ fitterName ] = TMTT::TrackFitGeneric::create(fitterName, settings_); - fitterWorkerMap_[ fitterName ]->bookHists(); + fitterWorkerMap_[fitterName] = TMTT::TrackFitGeneric::create(fitterName, settings_); + fitterWorkerMap_[fitterName]->bookHists(); } //--- Define EDM output to be written to file (if required) @@ -74,63 +75,61 @@ DigiProducer::DigiProducer(const edm::ParameterSet& iConfig): // produces< TTTrackCollection >( "TML1TracksHT" ).setBranchAlias("TML1TracksHT"); // L1 tracks found by r-z track filter. - produces ("SimDigiKF4Tracks").setBranchAlias("SimDigiKF4Tracks"); - produces ("SimDigiKF4TracksWithDups").setBranchAlias("SimDigiKF4TracksWithDups"); - produces ("SimDigiHTStubs").setBranchAlias("SimDigiHTStubs"); - produces ("SimDigiHTMiniStubs").setBranchAlias("SimDigiHTMiniStubs"); - produces ("SimDigiHTStubs").setBranchAlias("SimDigiHTStubs"); - produces ("SimDigiDTCStubs").setBranchAlias("SimDigiDTCStubs"); + produces("SimDigiKF4Tracks").setBranchAlias("SimDigiKF4Tracks"); + produces("SimDigiKF4TracksWithDups").setBranchAlias("SimDigiKF4TracksWithDups"); + produces("SimDigiHTStubs").setBranchAlias("SimDigiHTStubs"); + produces("SimDigiHTMiniStubs").setBranchAlias("SimDigiHTMiniStubs"); + produces("SimDigiHTStubs").setBranchAlias("SimDigiHTStubs"); + produces("SimDigiDTCStubs").setBranchAlias("SimDigiDTCStubs"); // L1 tracks after track fit by each of the fitting algorithms under study for (const string& fitterName : trackFitters_) { - string edmName = string("TML1Tracks") + fitterName; - produces< TTTrackCollection >(edmName).setBranchAlias(edmName); + string edmName = string("TML1Tracks") + fitterName; + produces(edmName).setBranchAlias(edmName); } -} + } - -void DigiProducer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) { + void DigiProducer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) { // Get the B-field and store its value in the Settings class. edm::ESHandle magneticFieldHandle; iSetup.get().get(magneticFieldHandle); const MagneticField* theMagneticField = magneticFieldHandle.product(); - float bField = theMagneticField->inTesla(GlobalPoint(0, 0, 0)).z(); // B field in Tesla. + float bField = theMagneticField->inTesla(GlobalPoint(0, 0, 0)).z(); // B field in Tesla. cout << endl << "--- B field = " << bField << " Tesla ---" << endl << endl; settings_->setBfield(bField); // Initialize track fitting algorithm at start of run (especially with B-field dependent variables). for (const string& fitterName : trackFitters_) { - fitterWorkerMap_[ fitterName ]->initRun(); + fitterWorkerMap_[fitterName]->initRun(); } // Print info on tilted modules edm::ESHandle trackerGeometryHandle; - iSetup.get().get( trackerGeometryHandle ); - const TrackerGeometry* trackerGeometry = trackerGeometryHandle.product(); + iSetup.get().get(trackerGeometryHandle); + const TrackerGeometry* trackerGeometry = trackerGeometryHandle.product(); edm::ESHandle trackerTopologyHandle; iSetup.get().get(trackerTopologyHandle); - const TrackerTopology* trackerTopology = trackerTopologyHandle.product(); - - trackerGeometryInfo_.getTiltedModuleInfo( settings_, trackerTopology, trackerGeometry ); -} - -void DigiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { + const TrackerTopology* trackerTopology = trackerTopologyHandle.product(); + trackerGeometryInfo_.getTiltedModuleInfo(settings_, trackerTopology, trackerGeometry); + } + void DigiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { // Note useful info about MC truth particles and about reconstructed stubs . - TMTT::InputData inputData(iEvent, iSetup, settings_, tpInputTag, stubInputTag, stubTruthInputTag, clusterTruthInputTag, genJetInputTag_ ); + TMTT::InputData inputData( + iEvent, iSetup, settings_, tpInputTag, stubInputTag, stubTruthInputTag, clusterTruthInputTag, genJetInputTag_); - const vector& vTPs = inputData.getTPs(); + const vector& vTPs = inputData.getTPs(); const vector& vStubs = inputData.getStubs(); // Creates matrix of Sector objects, which decide which stubs are in which (eta,phi) sector - matrix mSectors(settings_->numPhiSectors(), settings_->numEtaRegions()); + matrix mSectors(settings_->numPhiSectors(), settings_->numEtaRegions()); // Create matrix of r-phi Hough-Transform arrays, with one-to-one correspondence to sectors. - matrix mHtRphis(settings_->numPhiSectors(), settings_->numEtaRegions()); + matrix mHtRphis(settings_->numPhiSectors(), settings_->numEtaRegions()); // Create matrix of Get3Dtracks objects, to run optional r-z track filter, with one-to-one correspondence to sectors. - matrix mGet3Dtrks(settings_->numPhiSectors(), settings_->numEtaRegions()); + matrix mGet3Dtrks(settings_->numPhiSectors(), settings_->numEtaRegions()); //=== Initialization // Create utility for converting L1 tracks from our private format to official CMSSW EDM format. @@ -140,18 +139,18 @@ void DigiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { const unsigned int nFitAlgs = trackFitters_.size(); std::unique_ptr allFitTTTracksForOutput[nFitAlgs]; - std::unique_ptr allDigiKF4Tracks(new std::vector< DigiKF4Track >); - std::unique_ptr allDigiKF4TracksWithDups(new std::vector< DigiKF4Track >); - std::unique_ptr allDigiHTMiniStubs(new std::vector< DigiHTMiniStub >); - std::unique_ptr allDigiHTStubs(new std::vector< DigiHTStub >); - std::unique_ptr allDigiDTCStubs(new std::vector< DigiDTCStub >); + std::unique_ptr allDigiKF4Tracks(new std::vector); + std::unique_ptr allDigiKF4TracksWithDups(new std::vector); + std::unique_ptr allDigiHTMiniStubs(new std::vector); + std::unique_ptr allDigiHTStubs(new std::vector); + std::unique_ptr allDigiDTCStubs(new std::vector); map locationInsideArray; unsigned int ialg = 0; for (const string& fitterName : trackFitters_) { - std::unique_ptr fitTTTracksForOutput(new TTTrackCollection); - allFitTTTracksForOutput[ialg] = std::move( fitTTTracksForOutput ); - locationInsideArray[fitterName] = ialg++; + std::unique_ptr fitTTTracksForOutput(new TTTrackCollection); + allFitTTTracksForOutput[ialg] = std::move(fitTTTracksForOutput); + locationInsideArray[fitterName] = ialg++; } //=== Do tracking in the r-phi Hough transform within each sector. @@ -159,211 +158,201 @@ void DigiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { #ifdef THOMAS // Debug printout for Thomas static unsigned int jEventCount = 0; - cout<<"============================ DIGI EVENT "<, ostringstream> thomasString; #endif - map > stubsInNonant; + map> stubsInNonant; uint numPhiSecPerNon = settings_->numPhiSectors() / settings_->numPhiNonants(); // Fill Hough-Transform arrays with stubs. for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { - for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { + for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { + TMTT::Sector& sector = mSectors(iPhiSec, iEtaReg); + TMTT::HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); - TMTT::Sector& sector = mSectors(iPhiSec, iEtaReg); - TMTT::HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); + // Initialize constants for this sector. + sector.init(settings_, iPhiSec, iEtaReg); + htRphi.init(settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), sector.phiCentre()); - // Initialize constants for this sector. - sector.init(settings_, iPhiSec, iEtaReg); - htRphi.init(settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), sector.phiCentre()); + // Check sector is enabled (always true, except if user disabled some for special studies). + if (settings_->isHTRPhiEtaRegWhitelisted(iEtaReg)) { + for (const TMTT::Stub* stub : vStubs) { + // Digitize stub as would be at input to GP. This doesn't need the nonant number, since we assumed an integer number of + // phi digitisation bins inside an nonant. N.B. This changes the coordinates & bend stored in the stub. + // The cast allows us to ignore the "const". - // Check sector is enabled (always true, except if user disabled some for special studies). - if (settings_->isHTRPhiEtaRegWhitelisted(iEtaReg)) { + const_cast(stub)->digitizeForGPinput(iPhiSec); + // Check if stub is inside this sector + bool inside = sector.inside(stub); - for (const TMTT::Stub* stub : vStubs) { - // Digitize stub as would be at input to GP. This doesn't need the nonant number, since we assumed an integer number of - // phi digitisation bins inside an nonant. N.B. This changes the coordinates & bend stored in the stub. - // The cast allows us to ignore the "const". + if (inside) { + // Check which eta subsectors within the sector the stub is compatible with (if subsectors being used). + const vector inEtaSubSecs = sector.insideEtaSubSecs(stub); - const_cast(stub)->digitizeForGPinput(iPhiSec); - // Check if stub is inside this sector - bool inside = sector.inside( stub ); + // Digitize stub if as would be at input to HT, which slightly degrades its coord. & bend resolution, affecting the HT performance. + const_cast(stub)->digitizeForHTinput(iPhiSec); - if (inside) { - // Check which eta subsectors within the sector the stub is compatible with (if subsectors being used). - const vector inEtaSubSecs = sector.insideEtaSubSecs( stub ); + // Store stub in Hough transform array for this sector, indicating its compatibility with eta subsectors with sector. + htRphi.store(stub, inEtaSubSecs); - // Digitize stub if as would be at input to HT, which slightly degrades its coord. & bend resolution, affecting the HT performance. - const_cast(stub)->digitizeForHTinput(iPhiSec); + unsigned int iPhiNonant = std::floor(iPhiSec / numPhiSecPerNon); + unsigned int digiPhiSec = iPhiSec % numPhiSecPerNon; - // Store stub in Hough transform array for this sector, indicating its compatibility with eta subsectors with sector. - htRphi.store( stub, inEtaSubSecs ); + set& stubsInThisNonant = stubsInNonant[iPhiNonant]; + if (std::count(stubsInThisNonant.begin(), stubsInThisNonant.end(), stub) == 0) { + stubsInNonant[iPhiSec / 2].insert(stub); - unsigned int iPhiNonant = std::floor(iPhiSec / numPhiSecPerNon); - unsigned int digiPhiSec = iPhiSec % numPhiSecPerNon; + DigiDTCStub digiDTCStub = digiConverter.makeDigiDTCStub(*stub, digiPhiSec); - set& stubsInThisNonant = stubsInNonant[iPhiNonant]; - if (std::count(stubsInThisNonant.begin(), stubsInThisNonant.end(), stub) == 0) { - stubsInNonant[iPhiSec/2].insert(stub); + std::srand(stub->digitalStub().iDigi_PhiO()); + short unsigned int link_init = rand() % 48; - DigiDTCStub digiDTCStub = digiConverter.makeDigiDTCStub( *stub, digiPhiSec ); - - std::srand(stub->digitalStub().iDigi_PhiO()); - short unsigned int link_init = rand() % 48; - - digiDTCStub.setRouteId({(uint16_t)(iPhiNonant), (uint16_t)link_init, DigiRouteId::kNullTimeIndex}); - allDigiDTCStubs->push_back(digiDTCStub); + digiDTCStub.setRouteId({(uint16_t)(iPhiNonant), (uint16_t)link_init, DigiRouteId::kNullTimeIndex}); + allDigiDTCStubs->push_back(digiDTCStub); #ifdef THOMAS - // IRT - debug printout for Thomas - unsigned int link = link_init; // GP input links in use in firmware. - if (link >= 36) { - link += 20; - } else if (link >= 12) { - link += 12; - } else { - link += 4; - } - int mBinMin = (int(stub->min_qOverPt_bin()) - int(settings_->houghNbinsPt()) / 2) / 2; - int mBinMax = (int(stub->max_qOverPt_bin()) - int(settings_->houghNbinsPt()) / 2) / 2; - thomasString[pair(iPhiNonant,stub)]<<"DIGI STUB: iNonant="<(iPhiNonant, stub)] << " (" << digiPhiSec << "," + << iEtaReg << ")"; #endif - } - } } - - // Find tracks in r-phi HT array. - htRphi.end(); // Calls htArrayRphi_.end() -> HTBase::end() + } } + + // Find tracks in r-phi HT array. + htRphi.end(); // Calls htArrayRphi_.end() -> HTBase::end() + } } #ifdef THOMAS // Thomas debug printout. for (const auto& p : thomasString) { - cout<<(p.second).str()<muxOutputsHT() > 0) { - // Multiplex outputs of several HT onto one pair of output opto-links. - // This only affects tracking performance if option busySectorKill is enabled, so that tracks that - // can't be sent down the link within the time-multiplexed period are killed. - TMTT::MuxHToutputs muxHT(settings_); - muxHT.exec(mHtRphis); + // Multiplex outputs of several HT onto one pair of output opto-links. + // This only affects tracking performance if option busySectorKill is enabled, so that tracks that + // can't be sent down the link within the time-multiplexed period are killed. + TMTT::MuxHToutputs muxHT(settings_); + muxHT.exec(mHtRphis); } // for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { - - unsigned int iNonant = iPhiSec / numPhiSecPerNon; - unsigned int iPhiSecInNonant = iPhiSec%numPhiSecPerNon; - - for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { - - const TMTT::Sector& sector = mSectors(iPhiSec, iEtaReg); - - TMTT::Get3Dtracks& get3DtrkCoarse = mGet3Dtrks(iPhiSec, iEtaReg); - // Initialize utility for making 3D tracks from 2D ones. - get3DtrkCoarse.init(settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), sector.phiCentre()); - - // Convert 2D tracks found by HT to 3D tracks (optionally by running r-z filters & duplicate track removal) - get3DtrkCoarse.run(mHtRphis(iPhiSec, iEtaReg).trackCands2D()); - - // Loop over candidates in this phi/eta sector - for ( const TMTT::L1track3D& trk : get3DtrkCoarse.trackCands3D(false)) { - auto lMTrk = const_cast(trk); - auto lChiPhi = lMTrk.getChiPhiDigi(); - auto lChiZ = lMTrk.getChiZDigi(); - const auto& lStubs = lMTrk.getStubs(); - - int8_t cBin = (trk.getCellLocationHT().second - settings_->houghNbinsPhi() / 2) / 2; - int8_t mBin = (trk.getCellLocationHT().first - settings_->houghNbinsPt() / 2) / 2; - //bool mSel = (mBin % 2 == 0); - // IRT - fix to match firmware - no longer needed. - //mBin = -int(mBin) - 1; - bool mSel = (mBin >= 0); - - //cout<<"Thomas check: mBin="<numEtaRegions(); iEtaReg++) { + const TMTT::Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); + + // Loop over all the fitting algorithms we are trying. + for (const string& fitterName : trackFitters_) { + // Get 3D track candidates found by Hough transform (plus optional r-z filters/duplicate removal) in this sector. + const vector& vecTrk3D = get3Dtrk.trackCands3D(false); + + // Fit all tracks in this sector + vector fittedTracksInSec; + for (const TMTT::L1track3D& trk : vecTrk3D) { + // Ensure stubs assigned to this track is digitized with respect to the phi sector the track is in. + if (settings_->enableDigitize()) { + const vector& stubsOnTrk = trk.getStubs(); + for (const TMTT::Stub* s : stubsOnTrk) { + (const_cast(s))->digitizeForHTinput(iPhiSec); + // Also digitize stub in way this specific track fitter uses it. + (const_cast(s))->digitizeForSForTFinput(fitterName); + } + } - // Apply cut on diff between (m,c) of helix params & from HT, since in DR fw this is not applied, whereas - // in TMTT DR sw, it is applied. No longer true. + TMTT::L1fittedTrack fitTrack = fitterWorkerMap_[fitterName]->fit(trk); - static const bool limitDiff = false; // Edit this line to switch this option on or off. + if (fitTrack.accepted()) { // If fitter accepted track, then store it. + // Optionally digitize fitted track, degrading slightly resolution. + if (settings_->enableDigitize()) + fitTrack.digitizeTrack(fitterName); + // Store fitted tracks, such that there is one fittedTracks corresponding to each HT tracks. + // N.B. Tracks rejected by the fit are also stored, but marked. + fittedTracksInSec.push_back(fitTrack); + } + } - bool passDiffCut = true; - if (limitDiff) { - static const unsigned int maxDiff = 1; - passDiffCut = (abs(int(fitTrk.getCellLocationHT().first) - int(fitTrk.getCellLocationFit().first)) <= maxDiff && - abs(int(fitTrk.getCellLocationHT().second) - int(fitTrk.getCellLocationFit().second)) <= maxDiff); - } + // Save digi tracks with duplicates + for (const TMTT::L1fittedTrack& fitTrk : fittedTracksInSec) { + if (!settings_->enableDigitize() && "Digitization must be enabled to run the digi producer") { + assert(0); + } - if (passDiffCut) { - DigiKF4Track digiTrack = digiConverter.makeDigiKF4Track(fitTrk); + // Apply cut on diff between (m,c) of helix params & from HT, since in DR fw this is not applied, whereas + // in TMTT DR sw, it is applied. No longer true. - digiTrack.setRouteId({(uint16_t)(iPhiSec / numPhiSecPerNon), (uint16_t)fitTrk.optoLinkID(), DigiRouteId::kNullTimeIndex}); - allDigiKF4TracksWithDups->push_back(digiTrack); - } - } + static const bool limitDiff = false; // Edit this line to switch this option on or off. + bool passDiffCut = true; + if (limitDiff) { + static const unsigned int maxDiff = 1; + passDiffCut = + (abs(int(fitTrk.getCellLocationHT().first) - int(fitTrk.getCellLocationFit().first)) <= maxDiff && + abs(int(fitTrk.getCellLocationHT().second) - int(fitTrk.getCellLocationFit().second)) <= maxDiff); + } - ///allDigiKFTracks Run duplicate track removal on the fitted tracks if requested. - const vector filtFittedTracksInSec = killDupFitTrks.filter( fittedTracksInSec ); + if (passDiffCut) { + DigiKF4Track digiTrack = digiConverter.makeDigiKF4Track(fitTrk); - // Store fitted tracks from entire tracker. - for (const TMTT::L1fittedTrack& fitTrk : filtFittedTracksInSec) { - fittedTracks[fitterName].push_back(fitTrk); - // Convert these fitted tracks to EDM format for output (used for collaborative work outside TMTT group). - TTTrack< Ref_Phase2TrackerDigi_ > fitTTTrack = converter.makeTTTrack(fitTrk, iPhiSec, iEtaReg); - allFitTTTracksForOutput[locationInsideArray[fitterName]]->push_back(fitTTTrack); - if (!settings_->enableDigitize() && "Digitization must be enabled to run the digi producer" ) {assert(0);} + digiTrack.setRouteId( + {(uint16_t)(iPhiSec / numPhiSecPerNon), (uint16_t)fitTrk.optoLinkID(), DigiRouteId::kNullTimeIndex}); + allDigiKF4TracksWithDups->push_back(digiTrack); + } + } + + ///allDigiKFTracks Run duplicate track removal on the fitted tracks if requested. + const vector filtFittedTracksInSec = killDupFitTrks.filter(fittedTracksInSec); + + // Store fitted tracks from entire tracker. + for (const TMTT::L1fittedTrack& fitTrk : filtFittedTracksInSec) { + fittedTracks[fitterName].push_back(fitTrk); + // Convert these fitted tracks to EDM format for output (used for collaborative work outside TMTT group). + TTTrack fitTTTrack = converter.makeTTTrack(fitTrk, iPhiSec, iEtaReg); + allFitTTTracksForOutput[locationInsideArray[fitterName]]->push_back(fitTTTrack); + if (!settings_->enableDigitize() && "Digitization must be enabled to run the digi producer") { + assert(0); + } - // Save digi tracks without duplicates - DigiKF4Track digiTrack = digiConverter.makeDigiKF4Track(fitTrk); + // Save digi tracks without duplicates + DigiKF4Track digiTrack = digiConverter.makeDigiKF4Track(fitTrk); - digiTrack.setRouteId({(uint16_t)(iPhiSec / numPhiSecPerNon), DigiRouteId::kNullChannel, DigiRouteId::kNullTimeIndex}); - allDigiKF4Tracks->push_back(digiTrack); - } - } + digiTrack.setRouteId( + {(uint16_t)(iPhiSec / numPhiSecPerNon), DigiRouteId::kNullChannel, DigiRouteId::kNullTimeIndex}); + allDigiKF4Tracks->push_back(digiTrack); + } } + } } // Debug printout unsigned int static nEvents = 0; nEvents++; if (settings_->debug() >= 1 && nEvents <= 1000) { - cout << "INPUT #TPs = " << vTPs.size() << " #STUBs = " << vStubs.size() << endl; - unsigned int numHTtracks = 0; - for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { - for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { - const TMTT::Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); - numHTtracks += get3Dtrk.trackCands3D(false).size(); - } - } - cout << "Number of tracks after HT = " << numHTtracks << endl; - for (const auto& p : fittedTracks) { - const string& fitName = p.first; - const vector& fittedTracks = p.second; - cout << "Number of tracks after " << fitName << " track helix fit = " << fittedTracks.size() << endl; + cout << "INPUT #TPs = " << vTPs.size() << " #STUBs = " << vStubs.size() << endl; + unsigned int numHTtracks = 0; + for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { + const TMTT::Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); + numHTtracks += get3Dtrk.trackCands3D(false).size(); } + } + cout << "Number of tracks after HT = " << numHTtracks << endl; + for (const auto& p : fittedTracks) { + const string& fitName = p.first; + const vector& fittedTracks = p.second; + cout << "Number of tracks after " << fitName << " track helix fit = " << fittedTracks.size() << endl; + } } - // Allow histogramming to plot undigitized variables. for (const TMTT::Stub* stub : vStubs) { - if (settings_->enableDigitize()) (const_cast(stub))->setDigitizeWarningsOn(false); + if (settings_->enableDigitize()) + (const_cast(stub))->setDigitizeWarningsOn(false); } // Fill histograms to monitor input data & tracking performance. @@ -496,16 +488,16 @@ void DigiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { iEvent.put(std::move(allDigiHTStubs), "SimDigiHTStubs"); iEvent.put(std::move(allDigiHTMiniStubs), "SimDigiHTMiniStubs"); iEvent.put(std::move(allDigiDTCStubs), "SimDigiDTCStubs"); -} - + } -void DigiProducer::endJob() { + void DigiProducer::endJob() { // Print stub window sizes that TMTT recommends CMS uses in FE chips. - if (settings_->printStubWindows()) TMTT::StubWindowSuggest::printResults(); + if (settings_->printStubWindows()) + TMTT::StubWindowSuggest::printResults(); // Optional debug printout from track fitters at end of job. for (const string& fitterName : trackFitters_) { - fitterWorkerMap_[ fitterName ]->endJob(); + fitterWorkerMap_[fitterName]->endJob(); } // Print job summary @@ -513,14 +505,15 @@ void DigiProducer::endJob() { hists_->endJobAnalysis(); for (const string& fitterName : trackFitters_) { - //cout << "# of duplicated stubs = " << fitterWorkerMap_[fitterName]->nDupStubs() << endl; - delete fitterWorkerMap_[ string(fitterName) ]; + //cout << "# of duplicated stubs = " << fitterWorkerMap_[fitterName]->nDupStubs() << endl; + delete fitterWorkerMap_[string(fitterName)]; } - cout << endl << "Number of (eta,phi) sectors used = (" << settings_->numEtaRegions() << "," << settings_->numPhiSectors() << ")" << endl; - -} + cout << endl + << "Number of (eta,phi) sectors used = (" << settings_->numEtaRegions() << "," << settings_->numPhiSectors() + << ")" << endl; + } -DEFINE_FWK_MODULE(DigiProducer); + DEFINE_FWK_MODULE(DigiProducer); -} +} // namespace demo diff --git a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc index 4908e9a34c542..c42cad5a72f27 100644 --- a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc +++ b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc @@ -33,355 +33,348 @@ using boost::numeric::ublas::matrix; namespace TMTT { -TMTrackProducer::TMTrackProducer(const edm::ParameterSet& iConfig): - stubInputTag( consumes( iConfig.getParameter("stubInputTag") ) ), - trackerGeometryInfo_() -{ - // Get configuration parameters - settings_ = new Settings(iConfig); - - if (settings_->enableMCtruth()) { - // These lines use lots of CPU, even if no use of truth info is made later. - tpInputTag = consumes( iConfig.getParameter("tpInputTag") ); - stubTruthInputTag = consumes( iConfig.getParameter("stubTruthInputTag") ); - clusterTruthInputTag = consumes( iConfig.getParameter("clusterTruthInputTag") ); - genJetInputTag_ = consumes( iConfig.getParameter("genJetInputTag") ); - } + TMTrackProducer::TMTrackProducer(const edm::ParameterSet& iConfig) + : stubInputTag(consumes(iConfig.getParameter("stubInputTag"))), trackerGeometryInfo_() { + // Get configuration parameters + settings_ = new Settings(iConfig); + + if (settings_->enableMCtruth()) { + // These lines use lots of CPU, even if no use of truth info is made later. + tpInputTag = consumes(iConfig.getParameter("tpInputTag")); + stubTruthInputTag = consumes(iConfig.getParameter("stubTruthInputTag")); + clusterTruthInputTag = consumes(iConfig.getParameter("clusterTruthInputTag")); + genJetInputTag_ = consumes(iConfig.getParameter("genJetInputTag")); + } - trackFitters_ = settings_->trackFitters(); - useRZfilter_ = settings_->useRZfilter(); - runRZfilter_ = (useRZfilter_.size() > 0); // Do any fitters require an r-z track filter to be run? + trackFitters_ = settings_->trackFitters(); + useRZfilter_ = settings_->useRZfilter(); + runRZfilter_ = (useRZfilter_.size() > 0); // Do any fitters require an r-z track filter to be run? - // Tame debug printout. - cout.setf(ios::fixed, ios::floatfield); - cout.precision(4); + // Tame debug printout. + cout.setf(ios::fixed, ios::floatfield); + cout.precision(4); - // Book histograms. - hists_ = new Histos( settings_ ); - hists_->book(); + // Book histograms. + hists_ = new Histos(settings_); + hists_->book(); - // Create track fitting algorithm (& internal histograms if it uses them) - for (const string& fitterName : trackFitters_) { - fitterWorkerMap_[ fitterName ] = TrackFitGeneric::create(fitterName, settings_); - fitterWorkerMap_[ fitterName ]->bookHists(); - } + // Create track fitting algorithm (& internal histograms if it uses them) + for (const string& fitterName : trackFitters_) { + fitterWorkerMap_[fitterName] = TrackFitGeneric::create(fitterName, settings_); + fitterWorkerMap_[fitterName]->bookHists(); + } - //--- Define EDM output to be written to file (if required) + //--- Define EDM output to be written to file (if required) #ifdef OutputHT_TTracks - // L1 tracks found by Hough Transform - produces< TTTrackCollection >( "TML1TracksHT" ).setBranchAlias("TML1TracksHT"); - // L1 tracks found by r-z track filter. - if (runRZfilter_) produces< TTTrackCollection >( "TML1TracksRZ" ).setBranchAlias("TML1TracksRZ"); + // L1 tracks found by Hough Transform + produces("TML1TracksHT").setBranchAlias("TML1TracksHT"); + // L1 tracks found by r-z track filter. + if (runRZfilter_) + produces("TML1TracksRZ").setBranchAlias("TML1TracksRZ"); #endif - // L1 tracks after track fit by each of the fitting algorithms under study - for (const string& fitterName : trackFitters_) { - string edmName = string("TML1Tracks") + fitterName; - produces< TTTrackCollection >(edmName).setBranchAlias(edmName); + // L1 tracks after track fit by each of the fitting algorithms under study + for (const string& fitterName : trackFitters_) { + string edmName = string("TML1Tracks") + fitterName; + produces(edmName).setBranchAlias(edmName); + } } -} - - -void TMTrackProducer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) -{ - // Get the B-field and store its value in the Settings class. - edm::ESHandle magneticFieldHandle; - iSetup.get().get(magneticFieldHandle); - const MagneticField* theMagneticField = magneticFieldHandle.product(); - float bField = theMagneticField->inTesla(GlobalPoint(0,0,0)).z(); // B field in Tesla. - cout<setBfield(bField); + edm::ESHandle magneticFieldHandle; + iSetup.get().get(magneticFieldHandle); + const MagneticField* theMagneticField = magneticFieldHandle.product(); + float bField = theMagneticField->inTesla(GlobalPoint(0, 0, 0)).z(); // B field in Tesla. + cout << endl << "--- B field = " << bField << " Tesla ---" << endl << endl; - // Initialize track fitting algorithm at start of run (especially with B-field dependent variables). - for (const string& fitterName : trackFitters_) { - fitterWorkerMap_[ fitterName ]->initRun(); - } - - // Print info on tilted modules - edm::ESHandle trackerGeometryHandle; - iSetup.get().get( trackerGeometryHandle ); - const TrackerGeometry* trackerGeometry = trackerGeometryHandle.product(); + settings_->setBfield(bField); - edm::ESHandle trackerTopologyHandle; - iSetup.get().get(trackerTopologyHandle); - const TrackerTopology* trackerTopology = trackerTopologyHandle.product(); + // Initialize track fitting algorithm at start of run (especially with B-field dependent variables). + for (const string& fitterName : trackFitters_) { + fitterWorkerMap_[fitterName]->initRun(); + } - trackerGeometryInfo_.getTiltedModuleInfo( settings_, trackerTopology, trackerGeometry ); -} + // Print info on tilted modules + edm::ESHandle trackerGeometryHandle; + iSetup.get().get(trackerGeometryHandle); + const TrackerGeometry* trackerGeometry = trackerGeometryHandle.product(); -void TMTrackProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) -{ + edm::ESHandle trackerTopologyHandle; + iSetup.get().get(trackerTopologyHandle); + const TrackerTopology* trackerTopology = trackerTopologyHandle.product(); - // edm::Handle tpHandle; - // edm::EDGetToken token( consumes>( edm::InputTag( "mix", "MergedTrackTruth" ) ) ); - // iEvent.getByToken(inputTag, tpHandle ); + trackerGeometryInfo_.getTiltedModuleInfo(settings_, trackerTopology, trackerGeometry); + } + void TMTrackProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { + // edm::Handle tpHandle; + // edm::EDGetToken token( consumes>( edm::InputTag( "mix", "MergedTrackTruth" ) ) ); + // iEvent.getByToken(inputTag, tpHandle ); - // Note useful info about MC truth particles and about reconstructed stubs . - InputData inputData(iEvent, iSetup, settings_, tpInputTag, stubInputTag, stubTruthInputTag, clusterTruthInputTag, genJetInputTag_); + // Note useful info about MC truth particles and about reconstructed stubs . + InputData inputData( + iEvent, iSetup, settings_, tpInputTag, stubInputTag, stubTruthInputTag, clusterTruthInputTag, genJetInputTag_); - const vector& vTPs = inputData.getTPs(); - const vector& vStubs = inputData.getStubs(); + const vector& vTPs = inputData.getTPs(); + const vector& vStubs = inputData.getStubs(); - // Creates matrix of Sector objects, which decide which stubs are in which (eta,phi) sector - matrix mSectors(settings_->numPhiSectors(), settings_->numEtaRegions()); - // Create matrix of r-phi Hough-Transform arrays, with one-to-one correspondence to sectors. - matrix mHtRphis(settings_->numPhiSectors(), settings_->numEtaRegions()); - // Create matrix of Get3Dtracks objects, to run optional r-z track filter, with one-to-one correspondence to sectors. - matrix mGet3Dtrks(settings_->numPhiSectors(), settings_->numEtaRegions()); + // Creates matrix of Sector objects, which decide which stubs are in which (eta,phi) sector + matrix mSectors(settings_->numPhiSectors(), settings_->numEtaRegions()); + // Create matrix of r-phi Hough-Transform arrays, with one-to-one correspondence to sectors. + matrix mHtRphis(settings_->numPhiSectors(), settings_->numEtaRegions()); + // Create matrix of Get3Dtracks objects, to run optional r-z track filter, with one-to-one correspondence to sectors. + matrix mGet3Dtrks(settings_->numPhiSectors(), settings_->numEtaRegions()); - //=== Initialization - // Create utility for converting L1 tracks from our private format to official CMSSW EDM format. - const ConverterToTTTrack converter(settings_); + //=== Initialization + // Create utility for converting L1 tracks from our private format to official CMSSW EDM format. + const ConverterToTTTrack converter(settings_); #ifdef OutputHT_TTracks - // Storage for EDM L1 track collection to be produced directly from HT output. - std::unique_ptr htTTTracksForOutput(new TTTrackCollection); - // Storage for EDM L1 track collection to be produced directly from r-z track filter output (if run). - std::unique_ptr rzTTTracksForOutput(new TTTrackCollection); + // Storage for EDM L1 track collection to be produced directly from HT output. + std::unique_ptr htTTTracksForOutput(new TTTrackCollection); + // Storage for EDM L1 track collection to be produced directly from r-z track filter output (if run). + std::unique_ptr rzTTTracksForOutput(new TTTrackCollection); #endif - // Storage for EDM L1 track collection to be produced from fitted tracks (one for each fit algorithm being used). - // auto_ptr cant be stored in std containers, so use C one, together with map noting which element corresponds to which algorithm. - const unsigned int nFitAlgs = trackFitters_.size(); - std::unique_ptr allFitTTTracksForOutput[nFitAlgs]; - map locationInsideArray; - unsigned int ialg = 0; - for (const string& fitterName : trackFitters_) { - std::unique_ptr fitTTTracksForOutput(new TTTrackCollection); - allFitTTTracksForOutput[ialg] = std::move( fitTTTracksForOutput ); - locationInsideArray[fitterName] = ialg++; - } - - //=== Do tracking in the r-phi Hough transform within each sector. - - // Fill Hough-Transform arrays with stubs. - for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { - for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { - - Sector& sector = mSectors(iPhiSec, iEtaReg); - HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); - - // Initialize constants for this sector. - sector.init(settings_, iPhiSec, iEtaReg); - htRphi.init(settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), sector.phiCentre()); - - // Check sector is enabled (always true, except if user disabled some for special studies). - if (settings_->isHTRPhiEtaRegWhitelisted(iEtaReg)) { - - for (const Stub* stub: vStubs) { - // Digitize stub as would be at input to GP. This doesn't need the nonant number, since we assumed an integer number of - // phi digitisation bins inside an nonant. N.B. This changes the coordinates & bend stored in the stub. - // The cast allows us to ignore the "const". - if (settings_->enableDigitize()) (const_cast(stub))->digitizeForGPinput(iPhiSec); - - // Check if stub is inside this sector - bool inside = sector.inside( stub ); + // Storage for EDM L1 track collection to be produced from fitted tracks (one for each fit algorithm being used). + // auto_ptr cant be stored in std containers, so use C one, together with map noting which element corresponds to which algorithm. + const unsigned int nFitAlgs = trackFitters_.size(); + std::unique_ptr allFitTTTracksForOutput[nFitAlgs]; + map locationInsideArray; + unsigned int ialg = 0; + for (const string& fitterName : trackFitters_) { + std::unique_ptr fitTTTracksForOutput(new TTTrackCollection); + allFitTTTracksForOutput[ialg] = std::move(fitTTTracksForOutput); + locationInsideArray[fitterName] = ialg++; + } - if (inside) { - // Check which eta subsectors within the sector the stub is compatible with (if subsectors being used). - const vector inEtaSubSecs = sector.insideEtaSubSecs( stub ); + //=== Do tracking in the r-phi Hough transform within each sector. - // Digitize stub if as would be at input to HT, which slightly degrades its coord. & bend resolution, affecting the HT performance. - if (settings_->enableDigitize()) (const_cast(stub))->digitizeForHTinput(iPhiSec); + // Fill Hough-Transform arrays with stubs. + for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { + Sector& sector = mSectors(iPhiSec, iEtaReg); + HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); + + // Initialize constants for this sector. + sector.init(settings_, iPhiSec, iEtaReg); + htRphi.init(settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), sector.phiCentre()); + + // Check sector is enabled (always true, except if user disabled some for special studies). + if (settings_->isHTRPhiEtaRegWhitelisted(iEtaReg)) { + for (const Stub* stub : vStubs) { + // Digitize stub as would be at input to GP. This doesn't need the nonant number, since we assumed an integer number of + // phi digitisation bins inside an nonant. N.B. This changes the coordinates & bend stored in the stub. + // The cast allows us to ignore the "const". + if (settings_->enableDigitize()) + (const_cast(stub))->digitizeForGPinput(iPhiSec); + + // Check if stub is inside this sector + bool inside = sector.inside(stub); + + if (inside) { + // Check which eta subsectors within the sector the stub is compatible with (if subsectors being used). + const vector inEtaSubSecs = sector.insideEtaSubSecs(stub); + + // Digitize stub if as would be at input to HT, which slightly degrades its coord. & bend resolution, affecting the HT performance. + if (settings_->enableDigitize()) + (const_cast(stub))->digitizeForHTinput(iPhiSec); + + // Store stub in Hough transform array for this sector, indicating its compatibility with eta subsectors with sector. + htRphi.store(stub, inEtaSubSecs); + } + } + } - // Store stub in Hough transform array for this sector, indicating its compatibility with eta subsectors with sector. - htRphi.store( stub, inEtaSubSecs ); - } - } + // Find tracks in r-phi HT array. + htRphi.end(); // Calls htArrayRphi_.end() -> HTBase::end() } - - // Find tracks in r-phi HT array. - htRphi.end(); // Calls htArrayRphi_.end() -> HTBase::end() } - } - if (settings_->muxOutputsHT() > 0) { - // Multiplex outputs of several HT onto one pair of output opto-links. - // This only affects tracking performance if option busySectorKill is enabled, so that tracks that - // can't be sent down the link within the time-multiplexed period are killed. - MuxHToutputs muxHT(settings_); - muxHT.exec(mHtRphis); - } - - // Optionally, run 2nd stage mini HT -- WITHOUT TRUNCATION ??? - if ( settings_->miniHTstage() ) { - MiniHTstage miniHTstage( settings_ ); - miniHTstage.exec( mHtRphis ); - } + if (settings_->muxOutputsHT() > 0) { + // Multiplex outputs of several HT onto one pair of output opto-links. + // This only affects tracking performance if option busySectorKill is enabled, so that tracks that + // can't be sent down the link within the time-multiplexed period are killed. + MuxHToutputs muxHT(settings_); + muxHT.exec(mHtRphis); + } - //=== Make 3D tracks, optionally running r-z track filters (such as Seed Filter) & duplicate track removal. + // Optionally, run 2nd stage mini HT -- WITHOUT TRUNCATION ??? + if (settings_->miniHTstage()) { + MiniHTstage miniHTstage(settings_); + miniHTstage.exec(mHtRphis); + } - for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { - for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { + //=== Make 3D tracks, optionally running r-z track filters (such as Seed Filter) & duplicate track removal. - const Sector& sector = mSectors(iPhiSec, iEtaReg); + for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { + const Sector& sector = mSectors(iPhiSec, iEtaReg); - // Get tracks found by r-phi HT. - const HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); - const vector& vecTracksRphi = htRphi.trackCands2D(); + // Get tracks found by r-phi HT. + const HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); + const vector& vecTracksRphi = htRphi.trackCands2D(); - Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); - // Initialize utility for making 3D tracks from 2D ones. - get3Dtrk.init(settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), sector.phiCentre()); + Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); + // Initialize utility for making 3D tracks from 2D ones. + get3Dtrk.init(settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), sector.phiCentre()); - // Convert 2D tracks found by HT to 3D tracks (optionally by running r-z filters & duplicate track removal) - get3Dtrk.run(vecTracksRphi); + // Convert 2D tracks found by HT to 3D tracks (optionally by running r-z filters & duplicate track removal) + get3Dtrk.run(vecTracksRphi); #ifdef OutputHT_TTracks - // Convert these tracks to EDM format for output (used for collaborative work outside TMTT group). - // Do this for tracks output by HT & optionally also for those output by r-z track filter. - const vector& vecTrk3D_ht = get3Dtrk.trackCands3D(false); - for (const L1track3D& trk : vecTrk3D_ht) { - TTTrack< Ref_Phase2TrackerDigi_ > htTTTrack = converter.makeTTTrack(trk, iPhiSec, iEtaReg); - htTTTracksForOutput->push_back( htTTTrack ); - } + // Convert these tracks to EDM format for output (used for collaborative work outside TMTT group). + // Do this for tracks output by HT & optionally also for those output by r-z track filter. + const vector& vecTrk3D_ht = get3Dtrk.trackCands3D(false); + for (const L1track3D& trk : vecTrk3D_ht) { + TTTrack htTTTrack = converter.makeTTTrack(trk, iPhiSec, iEtaReg); + htTTTracksForOutput->push_back(htTTTrack); + } - if (runRZfilter_) { - const vector& vecTrk3D_rz = get3Dtrk.trackCands3D(true); - for (const L1track3D& trk : vecTrk3D_rz) { - TTTrack< Ref_Phase2TrackerDigi_ > rzTTTrack = converter.makeTTTrack(trk, iPhiSec, iEtaReg); - rzTTTracksForOutput->push_back( rzTTTrack ); + if (runRZfilter_) { + const vector& vecTrk3D_rz = get3Dtrk.trackCands3D(true); + for (const L1track3D& trk : vecTrk3D_rz) { + TTTrack rzTTTrack = converter.makeTTTrack(trk, iPhiSec, iEtaReg); + rzTTTracksForOutput->push_back(rzTTTrack); + } } - } #endif + } } - } - // Initialize the duplicate track removal algorithm that can optionally be run after the track fit. - KillDupFitTrks killDupFitTrks; - killDupFitTrks.init(settings_, settings_->dupTrkAlgFit()); - - //=== Do a helix fit to all the track candidates. + // Initialize the duplicate track removal algorithm that can optionally be run after the track fit. + KillDupFitTrks killDupFitTrks; + killDupFitTrks.init(settings_, settings_->dupTrkAlgFit()); - map> fittedTracks; - // Initialize with empty vector in case no fitted tracks found. - for (const string& fitterName : trackFitters_) { // Loop over fit algos. - fittedTracks[fitterName] = vector(); - } + //=== Do a helix fit to all the track candidates. - for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { - for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { - - const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); - - // Loop over all the fitting algorithms we are trying. - for (const string& fitterName : trackFitters_) { - - // Does this fitter require r-z track filter to be run before it? - bool useRZfilt = (std::count(useRZfilter_.begin(), useRZfilter_.end(), fitterName) > 0); - - // Get 3D track candidates found by Hough transform (plus optional r-z filters/duplicate removal) in this sector. - const vector& vecTrk3D = get3Dtrk.trackCands3D(useRZfilt); - - // Fit all tracks in this sector - vector fittedTracksInSec; - for (const L1track3D& trk : vecTrk3D) { - - // IRT - //bool OK = (trk.getMatchedTP() != nullptr && trk.getMatchedTP()->pt() > 50 && fabs(trk.getMatchedTP()->eta()) > 1.4 && fabs(trk.getMatchedTP()->eta()) < 1.8); - //if (trk.getNumStubs() != trk.getNumLayers()) OK = false; - //if (not OK) continue; - - // Ensure stubs assigned to this track is digitized with respect to the phi sector the track is in. - if (settings_->enableDigitize()) { - const vector& stubsOnTrk = trk.getStubs(); - for (const Stub* s : stubsOnTrk) { - (const_cast(s))->digitizeForHTinput(iPhiSec); - // Also digitize stub in way this specific track fitter uses it. - (const_cast(s))->digitizeForSForTFinput(fitterName); - } - } - - L1fittedTrack fitTrack = fitterWorkerMap_[fitterName]->fit(trk); - - if (fitTrack.accepted()) { // If fitter accepted track, then store it. - // Optionally digitize fitted track, degrading slightly resolution. - if (settings_->enableDigitize()) fitTrack.digitizeTrack(fitterName); - // Store fitted tracks, such that there is one fittedTracks corresponding to each HT tracks. - // N.B. Tracks rejected by the fit are also stored, but marked. - fittedTracksInSec.push_back(fitTrack); - } - } - - // Run duplicate track removal on the fitted tracks if requested. - const vector filtFittedTracksInSec = killDupFitTrks.filter( fittedTracksInSec ); - - // Store fitted tracks from entire tracker. - for (const L1fittedTrack& fitTrk : filtFittedTracksInSec) { - fittedTracks[fitterName].push_back(fitTrk); - // Convert these fitted tracks to EDM format for output (used for collaborative work outside TMTT group). - TTTrack< Ref_Phase2TrackerDigi_ > fitTTTrack = converter.makeTTTrack(fitTrk, iPhiSec, iEtaReg); - allFitTTTracksForOutput[locationInsideArray[fitterName]]->push_back(fitTTTrack); - } - } + map> fittedTracks; + // Initialize with empty vector in case no fitted tracks found. + for (const string& fitterName : trackFitters_) { // Loop over fit algos. + fittedTracks[fitterName] = vector(); } - } - // Debug printout - unsigned int static nEvents = 0; - nEvents++; - if (settings_->debug() >= 1 && nEvents <= 1000) { - cout<<"INPUT #TPs = "<printStubWindows()) + StubWindowSuggest::printResults(); -void TMTrackProducer::endJob() -{ - // Print stub window sizes that TMTT recommends CMS uses in FE chips. - if (settings_->printStubWindows()) StubWindowSuggest::printResults(); + // Optional debug printout from track fitters at end of job. + for (const string& fitterName : trackFitters_) { + fitterWorkerMap_[fitterName]->endJob(); + } - // Optional debug printout from track fitters at end of job. - for (const string& fitterName : trackFitters_) { - fitterWorkerMap_[ fitterName ]->endJob(); - } + // Print job summary + hists_->trackerGeometryAnalysis(trackerGeometryInfo_); + hists_->endJobAnalysis(); - // Print job summary - hists_->trackerGeometryAnalysis(trackerGeometryInfo_); - hists_->endJobAnalysis(); + for (const string& fitterName : trackFitters_) { + //cout << "# of duplicated stubs = " << fitterWorkerMap_[fitterName]->nDupStubs() << endl; + delete fitterWorkerMap_[string(fitterName)]; + } - for (const string& fitterName : trackFitters_) { - //cout << "# of duplicated stubs = " << fitterWorkerMap_[fitterName]->nDupStubs() << endl; - delete fitterWorkerMap_[ string(fitterName) ]; + cout << endl + << "Number of (eta,phi) sectors used = (" << settings_->numEtaRegions() << "," << settings_->numPhiSectors() + << ")" << endl; } - cout<numEtaRegions() << "," << settings_->numPhiSectors()<<")"< > TTTrackCollection; -private: + virtual void beginRun(const edm::Run &, const edm::EventSetup &); + virtual void produce(edm::Event &, const edm::EventSetup &); + virtual void endJob(); - typedef std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > TTTrackCollection; + private: + edm::EDGetTokenT stubInputTag; + edm::EDGetTokenT tpInputTag; + edm::EDGetTokenT stubTruthInputTag; + edm::EDGetTokenT clusterTruthInputTag; + edm::EDGetTokenT genJetInputTag_; - virtual void beginRun(const edm::Run&, const edm::EventSetup&); - virtual void produce(edm::Event&, const edm::EventSetup&); - virtual void endJob() ; + // Configuration parameters + Settings *settings_; + vector trackFitters_; + vector useRZfilter_; + bool runRZfilter_; -private: - edm::EDGetTokenT stubInputTag; - edm::EDGetTokenT tpInputTag; - edm::EDGetTokenT stubTruthInputTag; - edm::EDGetTokenT clusterTruthInputTag; - edm::EDGetTokenT genJetInputTag_; + Histos *hists_; + map fitterWorkerMap_; - // Configuration parameters - Settings *settings_; - vector trackFitters_; - vector useRZfilter_; - bool runRZfilter_; + TrackerGeometryInfo trackerGeometryInfo_; + }; - Histos *hists_; - map fitterWorkerMap_; - - TrackerGeometryInfo trackerGeometryInfo_; -}; - -} +} // namespace TMTT #endif - diff --git a/L1Trigger/TrackFindingTMTT/src/ChiSquared4ParamsApprox.cc b/L1Trigger/TrackFindingTMTT/src/ChiSquared4ParamsApprox.cc index 136351ac9719e..afc6fd96ab094 100644 --- a/L1Trigger/TrackFindingTMTT/src/ChiSquared4ParamsApprox.cc +++ b/L1Trigger/TrackFindingTMTT/src/ChiSquared4ParamsApprox.cc @@ -1,16 +1,16 @@ #include "L1Trigger/TrackFindingTMTT/interface/ChiSquared4ParamsApprox.h" namespace TMTT { - -ChiSquared4ParamsApprox::ChiSquared4ParamsApprox(const Settings* settings, const uint nPar) : L1ChiSquared(settings, nPar){ + + ChiSquared4ParamsApprox::ChiSquared4ParamsApprox(const Settings* settings, const uint nPar) + : L1ChiSquared(settings, nPar) { //parameterStream_ << "4Params_TrackletStyle_MCTruthSeed"; //configParameters_ = (lsStr_.str()); largestresid_ = -1.0; - ilargestresid_ = -1; - -} - -std::map ChiSquared4ParamsApprox::vecToMap(std::vector x){ + ilargestresid_ = -1; + } + + std::map ChiSquared4ParamsApprox::vecToMap(std::vector x) { // Convert a vector of track parameters to a labelled map for ease of use std::map result; result["rInv"] = x[0]; @@ -18,9 +18,9 @@ std::map ChiSquared4ParamsApprox::vecToMap(std::vector ChiSquared4ParamsApprox::mapToVec(std::map x){ + } + + std::vector ChiSquared4ParamsApprox::mapToVec(std::map x) { // Conevrt the map of labelled track parameters to a vector (in correct order) std::vector result; result.resize(4); @@ -29,9 +29,9 @@ std::vector ChiSquared4ParamsApprox::mapToVec(std::map ChiSquared4ParamsApprox::seed(const L1track3D& l1track3D){ + } + + std::vector ChiSquared4ParamsApprox::seed(const L1track3D& l1track3D) { /* Cheat by using MC trutth to initialize helix parameters. Useful to check if conevrgence is the problem */ std::map x; x["rInv"] = getSettings()->invPtToInvR() * l1track3D.qOverPt(); @@ -39,177 +39,183 @@ std::vector ChiSquared4ParamsApprox::seed(const L1track3D& l1track3D){ x["z0"] = l1track3D.z0(); x["t"] = l1track3D.tanLambda(); return mapToVec(x); -} - -Matrix ChiSquared4ParamsApprox::D(std::vector x){ - Matrix D(2 * stubs_.size(), nPar_, 0.0); // Empty matrix + } + + Matrix ChiSquared4ParamsApprox::D(std::vector x) { + Matrix D(2 * stubs_.size(), nPar_, 0.0); // Empty matrix int j = 0; - std::map y = vecToMap(x); // Get the track params by label + std::map y = vecToMap(x); // Get the track params by label double rInv = y["rInv"]; double phi0 = y["phi0"]; double t = y["t"]; - for (unsigned i = 0; i < stubs_.size(); i++){ - double ri=stubs_[i]->r(); - if( stubs_[i]->barrel() ){ - D(j, 0) = -0.5*ri*ri; // Fine for now; - D(j, 1) = ri; // Fine - //D(j, 2); - //D(j, 3); - j++; - //D(j, 0) - //D(j, 1) - D(j, 2) = ri; // ri; // Fine for now - D(j, 3) = 1; // Fine - j++; - } - else { - //here we handle a disk hit - //first we have the r position - double phii=stubs_[i]->phi(); - int iphi=stubs_[i]->iphi(); - - // N.B. These represent HALF the width and number of strips of sensor. - double width = stubs_[i]->width()/2.0; - double nstrip = stubs_[i]->nstrip()/2.0; - - double Deltai=width*(iphi-nstrip)/nstrip; //A bit of a hack... - - if (stubs_[i]->z()>0.0) Deltai=-Deltai; - double DeltaiOverRi = Deltai/ri; - double theta0=(DeltaiOverRi)+0.67*(DeltaiOverRi)*(DeltaiOverRi)*(DeltaiOverRi); - - double phi_track=phi0-0.5*rInv*ri; //Expected phi hit given the track - //std::cout << phi_track << "/" << phi0 << "/" << rInv << "/" << t << std::endl; - - double tInv = 1/t; - - D(j, 0) = -0.167*ri*ri*ri*rInv; // Tweaking of constant? - D(j, 1) = 0; // Exact - D(j, 2) = -ri*tInv; // Fine; - D(j, 3) = -1*tInv; // Fine - j++; - //second the rphi position - D(j, 0) = -0.5 * ri * ri; // Needs fine tuning, was (phimultiplier*-0.5*(zi-z0)/t+rmultiplier*drdrinv); - D(j, 1) = ri; // Fine, originally phimultiplier - D(j, 2) = ri*0.5*rInv*ri*tInv - ((phi_track-phii)-theta0)*ri*tInv; - D(j, 3) = ri*0.5*rInv*tInv - ((phi_track-phii)-theta0)*tInv; - j++; - } + for (unsigned i = 0; i < stubs_.size(); i++) { + double ri = stubs_[i]->r(); + if (stubs_[i]->barrel()) { + D(j, 0) = -0.5 * ri * ri; // Fine for now; + D(j, 1) = ri; // Fine + //D(j, 2); + //D(j, 3); + j++; + //D(j, 0) + //D(j, 1) + D(j, 2) = ri; // ri; // Fine for now + D(j, 3) = 1; // Fine + j++; + } else { + //here we handle a disk hit + //first we have the r position + double phii = stubs_[i]->phi(); + int iphi = stubs_[i]->iphi(); + + // N.B. These represent HALF the width and number of strips of sensor. + double width = stubs_[i]->width() / 2.0; + double nstrip = stubs_[i]->nstrip() / 2.0; + + double Deltai = width * (iphi - nstrip) / nstrip; //A bit of a hack... + + if (stubs_[i]->z() > 0.0) + Deltai = -Deltai; + double DeltaiOverRi = Deltai / ri; + double theta0 = (DeltaiOverRi) + 0.67 * (DeltaiOverRi) * (DeltaiOverRi) * (DeltaiOverRi); + + double phi_track = phi0 - 0.5 * rInv * ri; //Expected phi hit given the track + //std::cout << phi_track << "/" << phi0 << "/" << rInv << "/" << t << std::endl; + + double tInv = 1 / t; + + D(j, 0) = -0.167 * ri * ri * ri * rInv; // Tweaking of constant? + D(j, 1) = 0; // Exact + D(j, 2) = -ri * tInv; // Fine; + D(j, 3) = -1 * tInv; // Fine + j++; + //second the rphi position + D(j, 0) = -0.5 * ri * ri; // Needs fine tuning, was (phimultiplier*-0.5*(zi-z0)/t+rmultiplier*drdrinv); + D(j, 1) = ri; // Fine, originally phimultiplier + D(j, 2) = ri * 0.5 * rInv * ri * tInv - ((phi_track - phii) - theta0) * ri * tInv; + D(j, 3) = ri * 0.5 * rInv * tInv - ((phi_track - phii) - theta0) * tInv; + j++; + } } return D; -} - -Matrix ChiSquared4ParamsApprox::Vinv(){ - Matrix Vinv(2*stubs_.size(), 2*stubs_.size(), 0.0); - for(unsigned i = 0; i < stubs_.size(); i++){ - if(stubs_[i]->barrel()){ - Vinv(2*i, 2*i) = 1/stubs_[i]->sigmaX(); - Vinv(2*i + 1, 2*i + 1) = 1/stubs_[i]->sigmaZ(); - }else{ - Vinv(2*i, 2*i) = 1/stubs_[i]->sigmaZ(); - Vinv(2*i + 1, 2*i + 1) = 1/stubs_[i]->sigmaX(); - } - + } + + Matrix ChiSquared4ParamsApprox::Vinv() { + Matrix Vinv(2 * stubs_.size(), 2 * stubs_.size(), 0.0); + for (unsigned i = 0; i < stubs_.size(); i++) { + if (stubs_[i]->barrel()) { + Vinv(2 * i, 2 * i) = 1 / stubs_[i]->sigmaX(); + Vinv(2 * i + 1, 2 * i + 1) = 1 / stubs_[i]->sigmaZ(); + } else { + Vinv(2 * i, 2 * i) = 1 / stubs_[i]->sigmaZ(); + Vinv(2 * i + 1, 2 * i + 1) = 1 / stubs_[i]->sigmaX(); + } } return Vinv; -} - -std::vector ChiSquared4ParamsApprox::residuals(std::vector x) { - - unsigned int n=stubs_.size(); - + } + + std::vector ChiSquared4ParamsApprox::residuals(std::vector x) { + unsigned int n = stubs_.size(); + std::vector delta; - delta.resize(2*n); - - std::map trackParams = vecToMap(x); // Get the track params by label + delta.resize(2 * n); + + std::map trackParams = vecToMap(x); // Get the track params by label double rInv = trackParams["rInv"]; double phi0 = trackParams["phi0"]; double t = trackParams["t"]; double z0 = trackParams["z0"]; - - double chiSq=0.0; - - unsigned int j=0; - - if (getSettings()->debug()==6) std::cout << "Residuals ("<invPtToInvR()/rInv<<"]: "; - + + double chiSq = 0.0; + + unsigned int j = 0; + + if (getSettings()->debug() == 6) + std::cout << "Residuals (" << chiSq << ") [" << getSettings()->invPtToInvR() / rInv << "]: "; + largestresid_ = -1.0; - ilargestresid_ = -1; - - for(unsigned int i=0;ir(); - double zi=stubs_[i]->z(); - double phii=stubs_[i]->phi(); - const double sigmax=stubs_[i]->sigmaX(); - const double sigmaz=stubs_[i]->sigmaZ(); - - if ( stubs_[i]->barrel() ) { - //we are dealing with a barrel stub - - double halfRinvRi = 0.5*ri*rInv; - double aSinHalfRinvRi = halfRinvRi + 0.67*halfRinvRi*halfRinvRi*halfRinvRi; - - double deltaphi=phi0-aSinHalfRinvRi-phii; - if (deltaphi>M_PI) deltaphi-=2*M_PI; - if (deltaphi<-M_PI) deltaphi+=2*M_PI; - delta[j++]=(ri*deltaphi)/sigmax; // TODO this is different from tracklet - delta[j++]=(z0+(2.0/rInv)*t*aSinHalfRinvRi-zi)/sigmaz; - }else { - //we are dealing with a disk hit - - double tInv = 1/t; - - double r_track=(zi-z0)*tInv; - double phi_track=phi0-0.5*rInv*(zi-z0)*tInv; - int iphi=stubs_[i]->iphi(); - - // N.B. These represent HALF the width and number of strips of sensor. - double width = stubs_[i]->width()/2.0; - double nstrip = stubs_[i]->nstrip()/2.0; - - double Deltai=width*(iphi-nstrip)/nstrip; //A bit of a hack... - - if (stubs_[i]->z()>0.0) Deltai=-Deltai; - - double DeltaiOverRi = Deltai/ri; - double theta0=(DeltaiOverRi)+0.67*(DeltaiOverRi)*(DeltaiOverRi)*(DeltaiOverRi); //+0.125*DeltaiOverRi*DeltaiOverRi*DeltaiOverRi*DeltaiOverRi*DeltaiOverRi; - - double Delta=Deltai-r_track*(theta0-(phi_track-phii)); - - delta[j++]=(r_track-ri)/sigmaz; - delta[j++]=Delta/sigmax; - } - - if (getSettings()->debug()==6) std::cout << delta[j-2]<<" "<largestresid_) { - largestresid_=fabs(delta[j-2]); - ilargestresid_=i; - } - - if (fabs(delta[j-1])>largestresid_) { - largestresid_=fabs(delta[j-1]); - ilargestresid_=i; - } - if (getSettings()->debug()==6) std::cout << __FILE__ << ":" << __LINE__ << " - Residuals(): delta["<debug()==6) std::cout << __FILE__ << ":" << __LINE__ << " - Residuals(): chisq: " << chiSq << std::endl; - + ilargestresid_ = -1; + + for (unsigned int i = 0; i < n; i++) { + double ri = stubs_[i]->r(); + double zi = stubs_[i]->z(); + double phii = stubs_[i]->phi(); + const double sigmax = stubs_[i]->sigmaX(); + const double sigmaz = stubs_[i]->sigmaZ(); + + if (stubs_[i]->barrel()) { + //we are dealing with a barrel stub + + double halfRinvRi = 0.5 * ri * rInv; + double aSinHalfRinvRi = halfRinvRi + 0.67 * halfRinvRi * halfRinvRi * halfRinvRi; + + double deltaphi = phi0 - aSinHalfRinvRi - phii; + if (deltaphi > M_PI) + deltaphi -= 2 * M_PI; + if (deltaphi < -M_PI) + deltaphi += 2 * M_PI; + delta[j++] = (ri * deltaphi) / sigmax; // TODO this is different from tracklet + delta[j++] = (z0 + (2.0 / rInv) * t * aSinHalfRinvRi - zi) / sigmaz; + } else { + //we are dealing with a disk hit + + double tInv = 1 / t; + + double r_track = (zi - z0) * tInv; + double phi_track = phi0 - 0.5 * rInv * (zi - z0) * tInv; + int iphi = stubs_[i]->iphi(); + + // N.B. These represent HALF the width and number of strips of sensor. + double width = stubs_[i]->width() / 2.0; + double nstrip = stubs_[i]->nstrip() / 2.0; + + double Deltai = width * (iphi - nstrip) / nstrip; //A bit of a hack... + + if (stubs_[i]->z() > 0.0) + Deltai = -Deltai; + + double DeltaiOverRi = Deltai / ri; + double theta0 = (DeltaiOverRi) + + 0.67 * (DeltaiOverRi) * (DeltaiOverRi) * + (DeltaiOverRi); //+0.125*DeltaiOverRi*DeltaiOverRi*DeltaiOverRi*DeltaiOverRi*DeltaiOverRi; + + double Delta = Deltai - r_track * (theta0 - (phi_track - phii)); + + delta[j++] = (r_track - ri) / sigmaz; + delta[j++] = Delta / sigmax; + } + + if (getSettings()->debug() == 6) + std::cout << delta[j - 2] << " " << delta[j - 1] << " "; + + chiSq += delta[j - 2] * delta[j - 2] + delta[j - 1] * delta[j - 1]; + + if (fabs(delta[j - 2]) > largestresid_) { + largestresid_ = fabs(delta[j - 2]); + ilargestresid_ = i; + } + + if (fabs(delta[j - 1]) > largestresid_) { + largestresid_ = fabs(delta[j - 1]); + ilargestresid_ = i; + } + if (getSettings()->debug() == 6) + std::cout << __FILE__ << ":" << __LINE__ << " - Residuals(): delta[" << j - 2 << "]/delta[" << j - 1 + << "]: " << delta[j - 2] << "/" << delta[j - 1] << std::endl; + if (getSettings()->debug() == 6) + std::cout << __FILE__ << ":" << __LINE__ << " - Residuals(): chisq: " << chiSq << std::endl; } - + return delta; - -} - -std::map ChiSquared4ParamsApprox::convertParams(std::vector x){ - std::map y = vecToMap(x); // Get track parameters by label + } + + std::map ChiSquared4ParamsApprox::convertParams(std::vector x) { + std::map y = vecToMap(x); // Get track parameters by label std::map result; result["qOverPt"] = y["rInv"] / getSettings()->invPtToInvR(); result["phi0"] = y["phi0"]; result["z0"] = y["z0"]; result["t"] = y["t"]; return result; -} + } -} +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc b/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc index 2e8c1be47d288..08b800fd13365 100644 --- a/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc +++ b/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc @@ -6,16 +6,16 @@ namespace TMTT { + TTTrack ConverterToTTTrack::makeTTTrack(const L1track3D& trk, + unsigned int iPhiSec, + unsigned int iEtaReg) const { + // Get references to stubs on this track. + std::vector ttstubrefs = this->getStubRefs(trk); -TTTrack< Ref_Phase2TrackerDigi_ > ConverterToTTTrack::makeTTTrack(const L1track3D& trk, unsigned int iPhiSec, unsigned int iEtaReg) const { + // Set helix parameters. + const unsigned int nPar4 = 4; // Number of helix parameters determined by HT. - // Get references to stubs on this track. - std::vector ttstubrefs = this->getStubRefs(trk); - - // Set helix parameters. - const unsigned int nPar4 = 4; // Number of helix parameters determined by HT. - - /* + /* // Create TTTrack object using these stubs. TTTrack< Ref_Phase2TrackerDigi_ > track(ttstubrefs); @@ -46,44 +46,47 @@ TTTrack< Ref_Phase2TrackerDigi_ > ConverterToTTTrack::makeTTTrack(const L1track3 track.setStubPtConsistency(-1, nPar); */ - // new TTTrack constructor - double tmp_rinv = invPtToInvR_ * trk.qOverPt(); - double tmp_phi = trk.phi0(); - double tmp_tanL = trk.tanLambda(); - double tmp_z0 = trk.z0(); - double tmp_d0 = trk.d0(); - double tmp_chi2 = -1; - unsigned int tmp_hit = 0; - unsigned int tmp_npar = nPar4; - double tmp_Bfield = settings_->getBfield(); - TTTrack< Ref_Phase2TrackerDigi_ > track(tmp_rinv, tmp_phi, tmp_tanL, tmp_z0, tmp_d0, tmp_chi2, 0,0,0, tmp_hit, tmp_npar, tmp_Bfield); - - // set stub references - track.setStubRefs(ttstubrefs); + // new TTTrack constructor + double tmp_rinv = invPtToInvR_ * trk.qOverPt(); + double tmp_phi = trk.phi0(); + double tmp_tanL = trk.tanLambda(); + double tmp_z0 = trk.z0(); + double tmp_d0 = trk.d0(); + double tmp_chi2 = -1; + unsigned int tmp_hit = 0; + unsigned int tmp_npar = nPar4; + double tmp_Bfield = settings_->getBfield(); + TTTrack track( + tmp_rinv, tmp_phi, tmp_tanL, tmp_z0, tmp_d0, tmp_chi2, 0, 0, 0, tmp_hit, tmp_npar, tmp_Bfield); - // Note which (eta,phi) sector this track was reconstructed in by HT. - track.setPhiSector(iPhiSec); - track.setEtaSector(iEtaReg); + // set stub references + track.setStubRefs(ttstubrefs); - track.setStubPtConsistency(-1); // not filled. - - return track; -} + // Note which (eta,phi) sector this track was reconstructed in by HT. + track.setPhiSector(iPhiSec); + track.setEtaSector(iEtaReg); -//=== Convert our non-persistent L1fittedTrack object (fitted track candidate) -//=== to the official persistent CMSSW EDM TTrack format. + track.setStubPtConsistency(-1); // not filled. -TTTrack< Ref_Phase2TrackerDigi_ > ConverterToTTTrack::makeTTTrack(const L1fittedTrack& trk, unsigned int iPhiSec, unsigned int iEtaReg) const{ + return track; + } - // Check that this track is valid. - if (! trk.accepted()) throw cms::Exception("ConverterToTTTrack ERROR: requested to convert invalid L1fittedTrack."); + //=== Convert our non-persistent L1fittedTrack object (fitted track candidate) + //=== to the official persistent CMSSW EDM TTrack format. - // Get references to stubs on this track. - std::vector ttstubrefs = this->getStubRefs(trk); + TTTrack ConverterToTTTrack::makeTTTrack(const L1fittedTrack& trk, + unsigned int iPhiSec, + unsigned int iEtaReg) const { + // Check that this track is valid. + if (!trk.accepted()) + throw cms::Exception("ConverterToTTTrack ERROR: requested to convert invalid L1fittedTrack."); - const unsigned int nPar = trk.nHelixParam(); // Number of helix parameters determined by HT. + // Get references to stubs on this track. + std::vector ttstubrefs = this->getStubRefs(trk); - /* + const unsigned int nPar = trk.nHelixParam(); // Number of helix parameters determined by HT. + + /* // Create TTTrack object using these stubs. TTTrack< Ref_Phase2TrackerDigi_ > track(ttstubrefs); @@ -113,28 +116,28 @@ TTTrack< Ref_Phase2TrackerDigi_ > ConverterToTTTrack::makeTTTrack(const L1fitted track.setStubPtConsistency(-1, nPar); */ - // new TTTrack constructor - double tmp_rinv = invPtToInvR_ * trk.qOverPt(); - double tmp_phi = trk.phi0(); - double tmp_tanL = trk.tanLambda(); - double tmp_z0 = trk.z0(); - double tmp_d0 = trk.d0(); - double tmp_chi2 = -1; - unsigned int tmp_hit = 0; - unsigned int tmp_npar = nPar; - double tmp_Bfield = settings_->getBfield(); - TTTrack< Ref_Phase2TrackerDigi_ > track(tmp_rinv, tmp_phi, tmp_tanL, tmp_z0, tmp_d0, tmp_chi2, 0,0,0, tmp_hit, tmp_npar, tmp_Bfield); - - // set stub references - track.setStubRefs(ttstubrefs); - - // Note which (eta,phi) sector this track was reconstructed in by HT. - track.setPhiSector(iPhiSec); - track.setEtaSector(iEtaReg); - - track.setStubPtConsistency(-1); // not filled. - - - return track; -} -} + // new TTTrack constructor + double tmp_rinv = invPtToInvR_ * trk.qOverPt(); + double tmp_phi = trk.phi0(); + double tmp_tanL = trk.tanLambda(); + double tmp_z0 = trk.z0(); + double tmp_d0 = trk.d0(); + double tmp_chi2 = -1; + unsigned int tmp_hit = 0; + unsigned int tmp_npar = nPar; + double tmp_Bfield = settings_->getBfield(); + TTTrack track( + tmp_rinv, tmp_phi, tmp_tanL, tmp_z0, tmp_d0, tmp_chi2, 0, 0, 0, tmp_hit, tmp_npar, tmp_Bfield); + + // set stub references + track.setStubRefs(ttstubrefs); + + // Note which (eta,phi) sector this track was reconstructed in by HT. + track.setPhiSector(iPhiSec); + track.setEtaSector(iEtaReg); + + track.setStubPtConsistency(-1); // not filled. + + return track; + } +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/DeadModuleDB.cc b/L1Trigger/TrackFindingTMTT/src/DeadModuleDB.cc index ebbdeba9fbc41..5cc26849b8ce8 100644 --- a/L1Trigger/TrackFindingTMTT/src/DeadModuleDB.cc +++ b/L1Trigger/TrackFindingTMTT/src/DeadModuleDB.cc @@ -6,59 +6,60 @@ namespace TMTT { -bool DeadModuleDB::killStub(const Stub* stub) const { - bool dead = false; - if (stub->barrel()) { - if (deadBarrelRegions_.find(stub->layerId()) != deadBarrelRegions_.end()) { - const vector& bRegions = deadBarrelRegions_.at(stub->layerId()); - for (const DeadModuleDB::DeadBarrelRegion& bDead : bRegions) { - if (this->deltaPhiPos(stub->phi(), bDead.phiMin_) < this->deltaPhiPos(bDead.phiMax_, bDead.phiMin_) && - stub->z() > bDead.zMin_ && stub->z() < bDead.zMax_) dead = true; + bool DeadModuleDB::killStub(const Stub* stub) const { + bool dead = false; + if (stub->barrel()) { + if (deadBarrelRegions_.find(stub->layerId()) != deadBarrelRegions_.end()) { + const vector& bRegions = deadBarrelRegions_.at(stub->layerId()); + for (const DeadModuleDB::DeadBarrelRegion& bDead : bRegions) { + if (this->deltaPhiPos(stub->phi(), bDead.phiMin_) < this->deltaPhiPos(bDead.phiMax_, bDead.phiMin_) && + stub->z() > bDead.zMin_ && stub->z() < bDead.zMax_) + dead = true; + } } - } - } else { - if (deadEndcapRegions_.find(stub->layerId()) != deadEndcapRegions_.end()) { - const vector& eRegions = deadEndcapRegions_.at(stub->layerId()); - for (const DeadModuleDB::DeadEndcapRegion& eDead : eRegions) { - if (this->deltaPhiPos(stub->phi(), eDead.phiMin_) < this->deltaPhiPos(eDead.phiMax_, eDead.phiMin_) && - stub->r() > eDead.rMin_ && stub->r() < eDead.rMax_) dead = true; + } else { + if (deadEndcapRegions_.find(stub->layerId()) != deadEndcapRegions_.end()) { + const vector& eRegions = deadEndcapRegions_.at(stub->layerId()); + for (const DeadModuleDB::DeadEndcapRegion& eDead : eRegions) { + if (this->deltaPhiPos(stub->phi(), eDead.phiMin_) < this->deltaPhiPos(eDead.phiMax_, eDead.phiMin_) && + stub->r() > eDead.rMin_ && stub->r() < eDead.rMax_) + dead = true; + } } } + return dead; } - return dead; -} - -//=== Define regions of the tracker in which the modules are dead. -//=== This function is only involed if cfg param DeadSimulate = True, when any stubs in modules within these regions are killed, -//=== so emulating MC with dead regions. -void DeadModuleDB::defineDeadTrackerRegions() { - // Example of how to declare a region of the tracker barrel as dead. - const unsigned int iLayer = 5; // (1-6 = barrel layer; 11-15 = endcap A disk; 21-25 = endcap B disk) -//=== Should this stub be killed to emulate dead modules lying within a dead tracker region? -//=== This function is only invoked if cfg param DeadSimulate = True + //=== Define regions of the tracker in which the modules are dead. + //=== This function is only involed if cfg param DeadSimulate = True, when any stubs in modules within these regions are killed, + //=== so emulating MC with dead regions. - const float phiMin = 0.5; - const float phiMax = 2.5; - const float zMin = -100.0; - const float zMax = 0.0; - deadBarrelRegions_[iLayer] .push_back( DeadModuleDB::DeadBarrelRegion(phiMin, phiMax, zMin, zMax) ); -} + void DeadModuleDB::defineDeadTrackerRegions() { + // Example of how to declare a region of the tracker barrel as dead. + const unsigned int iLayer = 5; // (1-6 = barrel layer; 11-15 = endcap A disk; 21-25 = endcap B disk) + //=== Should this stub be killed to emulate dead modules lying within a dead tracker region? + //=== This function is only invoked if cfg param DeadSimulate = True -//=== Define sectors in which the cut on number of layer numbers on tracks should be reduced by 1, because -//=== they contain dead modules. This function is only invoked if cfg param DeadReduceLayers = True. -//=== Ideally these sectors would be derived from the regions declared in definedDeadTrackerRegions(). + const float phiMin = 0.5; + const float phiMax = 2.5; + const float zMin = -100.0; + const float zMax = 0.0; + deadBarrelRegions_[iLayer].push_back(DeadModuleDB::DeadBarrelRegion(phiMin, phiMax, zMin, zMax)); + } -void DeadModuleDB::defineDeadSectors() { + //=== Define sectors in which the cut on number of layer numbers on tracks should be reduced by 1, because + //=== they contain dead modules. This function is only invoked if cfg param DeadReduceLayers = True. + //=== Ideally these sectors would be derived from the regions declared in definedDeadTrackerRegions(). - // Example of how to declare sectors as dead. - // N.B. Histograms "AlgEffVsPhiSec", "AlgEffVsEtaSec", "AlgEffFitVsPhiSec*" and "AlgEffFitVsEtaSec*" - // will help you determine which sectors you need to declare here. - for (unsigned int iPhiSec = 9; iPhiSec <= 13; iPhiSec++) { - for (unsigned int iEtaReg = 5; iEtaReg <= 8; iEtaReg++) { - reduceLayerCut_.insert( pair (iPhiSec, iEtaReg) ); + void DeadModuleDB::defineDeadSectors() { + // Example of how to declare sectors as dead. + // N.B. Histograms "AlgEffVsPhiSec", "AlgEffVsEtaSec", "AlgEffFitVsPhiSec*" and "AlgEffFitVsEtaSec*" + // will help you determine which sectors you need to declare here. + for (unsigned int iPhiSec = 9; iPhiSec <= 13; iPhiSec++) { + for (unsigned int iEtaReg = 5; iEtaReg <= 8; iEtaReg++) { + reduceLayerCut_.insert(pair(iPhiSec, iEtaReg)); + } } } -} -} \ No newline at end of file +} // namespace TMTT \ No newline at end of file diff --git a/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc b/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc index 0c5b2c3eceb72..75879dc5fd056 100644 --- a/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc +++ b/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc @@ -14,192 +14,218 @@ using namespace std; namespace TMTT { -//--- Stub window sizes copied from L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py - -std::vector< double > DegradeBend::barrelCut_ = - {0, 2.0, 2.0, 3.5, 4.5, 5.5, 6.5}; -std::vector< std::vector< double > > DegradeBend::ringCut_ = - {{0}, - {0, 1, 1.5, 1.5, 2, 2, 2.5, 3, 3, 3.5, 4, 2.5, 3, 3.5, 4.5, 5.5}, - {0, 1, 1.5, 1.5, 2, 2, 2, 2.5, 3, 3, 3, 2, 3, 4, 5, 5.5}, - {0, 1.5, 1.5, 2, 2, 2.5, 2.5, 2.5, 3.5, 2.5, 5, 5.5, 6}, - {0, 1.0, 1.5, 1.5, 2, 2, 2, 2, 3, 3, 6, 6, 6.5}, - {0, 1.0, 1.5, 1.5, 1.5, 2, 2, 2, 3, 3, 6, 6, 6.5}}; -std::vector< std::vector< double > > DegradeBend::tiltedCut_ = - {{0}, - {0, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2., 2., 1.5, 1.5, 1., 1.}, - {0, 3., 3., 3., 3., 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2, 2}, - {0, 4.5, 4.5, 4, 4, 4, 4, 3.5, 3.5, 3.5, 3, 3, 3}}; -std::vector< double > DegradeBend::barrelNTilt_ = - {0., 12., 12., 12., 0., 0., 0.}; - -//--- Given the original bend, flag indicating if this is a PS or 2S module, & detector identifier, -//--- this return the degraded stub bend, a boolean indicatng if stub bend was outside the assumed window -//--- size programmed below, and an integer indicating how many values of the original bend -//--- were grouped together into this single value of the degraded bend. - -void DegradeBend::degrade(float bend, bool psModule, const DetId& stDetId, float windowFEnew, - float& degradedBend, bool& reject, unsigned int& numInGroup) const { - - // Get degraded bend value. - unsigned int windowHalfStrips; - this->work(bend, psModule, stDetId, windowFEnew, - degradedBend, reject, numInGroup, windowHalfStrips); - - // Check for mistakes. - this->sanityChecks(psModule, stDetId, windowFEnew, degradedBend, numInGroup, windowHalfStrips); -} - -//--- Does the actual work of degrading the bend. - -void DegradeBend::work(float bend, bool psModule, const DetId& stDetId, float windowFEnew, - float& degradedBend, bool& reject, unsigned int& numInGroup, unsigned int& windowHalfStrips) const { - - // Calculate stub window size in half-strip units used to produce stubs. - // This code should be kept identical to that in - // L1Trigger/TrackTrigger/src/TTStubAlgorithm_official.cc - - unsigned int window = 0; - - if (stDetId.subdetId()==StripSubdetector::TOB) - { - int layer = theTrackerTopo_->layer(stDetId); - int ladder = theTrackerTopo_->tobRod(stDetId); - int type = 2*theTrackerTopo_->tobSide(stDetId)-3; // -1 for tilted-, 1 for tilted+, 3 for flat - double corr=0; - - if (type<3) // Only for tilted modules - { - corr = (barrelNTilt_.at(layer)+1)/2.; - ladder = corr-(corr-ladder)*type; // Corrected ring number, bet 0 and barrelNTilt.at(layer), in ascending |z| - window = 2*(tiltedCut_.at(layer)).at(ladder); - } - else // Classic barrel window otherwise - { - window = 2*barrelCut_.at( layer ); - } - } - else if (stDetId.subdetId()==StripSubdetector::TID) - { - window = 2*(ringCut_.at( theTrackerTopo_->tidWheel(stDetId))).at(theTrackerTopo_->tidRing(stDetId)); - } - - // Compare this with the possibly tighter window provided by the user, converting to half-strip units. - unsigned int newWindow = (unsigned int)(2*windowFEnew); - if (window > newWindow) window = newWindow; - - // This is the window size measured in half-strips. - windowHalfStrips = window; - - // Number of degraded bend values should correspond to 3 bits (PS modules) or 4 bits (2S modules), - // so measuring everything in half-strip units, max integer "window" size that can be encoded without - // compression given by 2*window+1 <= pow(2,B), where B is number of bits. - // Hence no compression required if window cut is abs(b) < 3 (PS) or 7 (2S). Must introduce one merge for - // each 1 unit increase in "window" beyond this. - - // Bend is measured with granularity of 0.5 strips. - // Convert it to integer measured in half-strip units for this calculation! - - int b = std::round(2*bend); - - if (abs(b) <= window) { - reject = false; - float degradedB; - unsigned int numBends = 2*window + 1; - unsigned int numAllowed = (psModule) ? pow(2, bitsPS_) : pow(2, bits2S_); - // Existance of bend = 0 means can only use an odd number of groups. - numAllowed -= 1; - if (numBends <= numAllowed) { - // Can output uncompressed bend info. - numInGroup = 1; - degradedB = float(b); - } else { - unsigned int inSmallGroup = numBends/numAllowed; - unsigned int numLargeGroups = numBends%numAllowed; - unsigned int inLargeGroup = inSmallGroup + 1; - unsigned int numSmallGroups = numAllowed - numLargeGroups; - vector groups; - for (unsigned int i = 0; i < numLargeGroups/2; i++) groups.push_back(inLargeGroup); - for (unsigned int i = 0; i < numSmallGroups/2; i++) groups.push_back(inSmallGroup); - // Only one of numLargeGroups & numSmallGroups can be odd, since numAllowed is odd. - // And whichever one is odd is associated to a group with an odd number of elements since numBends is odd, - if (numLargeGroups%2 == 1 && inLargeGroup%2 == 1) { - groups.push_back(inLargeGroup); - } else if (numSmallGroups%2 == 1 && inSmallGroup%2 == 1) { - groups.push_back(inSmallGroup); - } else { - throw cms::Exception("DegradeBend: logic error with odd numbers"); - } - for (unsigned int i = 0; i < numSmallGroups/2; i++) groups.push_back(inSmallGroup); - for (unsigned int i = 0; i < numLargeGroups/2; i++) groups.push_back(inLargeGroup); - - degradedB = 999; - int iUp = -int(window) - 1; - for (unsigned int& inGroup: groups) { - iUp += inGroup; - int iDown = iUp - inGroup + 1; - if (b <= iUp && b >= iDown) { - numInGroup = inGroup; - degradedB = 0.5*(iUp + iDown); - } - } - if (degradedB == 999) throw cms::Exception("DegradeResolution: Logic error in loop over groups"); - } - - // This is degraded bend in full strip units (neglecting bend sign). - degradedBend = float(degradedB)/2.; - - } else { - // This shouldn't happen. If it does, the the window sizes assumed in this code are tighter than the ones - // actually used to produce the stubs. - reject = true; - numInGroup = 0; - degradedBend = 99999; + //--- Stub window sizes copied from L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py + + std::vector DegradeBend::barrelCut_ = {0, 2.0, 2.0, 3.5, 4.5, 5.5, 6.5}; + std::vector > DegradeBend::ringCut_ = { + {0}, + {0, 1, 1.5, 1.5, 2, 2, 2.5, 3, 3, 3.5, 4, 2.5, 3, 3.5, 4.5, 5.5}, + {0, 1, 1.5, 1.5, 2, 2, 2, 2.5, 3, 3, 3, 2, 3, 4, 5, 5.5}, + {0, 1.5, 1.5, 2, 2, 2.5, 2.5, 2.5, 3.5, 2.5, 5, 5.5, 6}, + {0, 1.0, 1.5, 1.5, 2, 2, 2, 2, 3, 3, 6, 6, 6.5}, + {0, 1.0, 1.5, 1.5, 1.5, 2, 2, 2, 3, 3, 6, 6, 6.5}}; + std::vector > DegradeBend::tiltedCut_ = { + {0}, + {0, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2., 2., 1.5, 1.5, 1., 1.}, + {0, 3., 3., 3., 3., 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2, 2}, + {0, 4.5, 4.5, 4, 4, 4, 4, 3.5, 3.5, 3.5, 3, 3, 3}}; + std::vector DegradeBend::barrelNTilt_ = {0., 12., 12., 12., 0., 0., 0.}; + + //--- Given the original bend, flag indicating if this is a PS or 2S module, & detector identifier, + //--- this return the degraded stub bend, a boolean indicatng if stub bend was outside the assumed window + //--- size programmed below, and an integer indicating how many values of the original bend + //--- were grouped together into this single value of the degraded bend. + + void DegradeBend::degrade(float bend, + bool psModule, + const DetId& stDetId, + float windowFEnew, + float& degradedBend, + bool& reject, + unsigned int& numInGroup) const { + // Get degraded bend value. + unsigned int windowHalfStrips; + this->work(bend, psModule, stDetId, windowFEnew, degradedBend, reject, numInGroup, windowHalfStrips); + + // Check for mistakes. + this->sanityChecks(psModule, stDetId, windowFEnew, degradedBend, numInGroup, windowHalfStrips); } -} -//--- Check for mistakes. + //--- Does the actual work of degrading the bend. -void DegradeBend::sanityChecks(bool psModule, const DetId& stDetId, float windowFEnew, float degradedBend, unsigned int numInGroup, unsigned int windowHalfStrips) const { + void DegradeBend::work(float bend, + bool psModule, + const DetId& stDetId, + float windowFEnew, + float& degradedBend, + bool& reject, + unsigned int& numInGroup, + unsigned int& windowHalfStrips) const { + // Calculate stub window size in half-strip units used to produce stubs. + // This code should be kept identical to that in + // L1Trigger/TrackTrigger/src/TTStubAlgorithm_official.cc - pair p(windowHalfStrips, psModule); + unsigned int window = 0; - // Map notes if this (window size, psModule) combination has already been checked. - static map, bool> checked; + if (stDetId.subdetId() == StripSubdetector::TOB) { + int layer = theTrackerTopo_->layer(stDetId); + int ladder = theTrackerTopo_->tobRod(stDetId); + int type = 2 * theTrackerTopo_->tobSide(stDetId) - 3; // -1 for tilted-, 1 for tilted+, 3 for flat + double corr = 0; + + if (type < 3) // Only for tilted modules + { + corr = (barrelNTilt_.at(layer) + 1) / 2.; + ladder = + corr - (corr - ladder) * type; // Corrected ring number, bet 0 and barrelNTilt.at(layer), in ascending |z| + window = 2 * (tiltedCut_.at(layer)).at(ladder); + } else // Classic barrel window otherwise + { + window = 2 * barrelCut_.at(layer); + } + } else if (stDetId.subdetId() == StripSubdetector::TID) { + window = 2 * (ringCut_.at(theTrackerTopo_->tidWheel(stDetId))).at(theTrackerTopo_->tidRing(stDetId)); + } - if (checked.find(p) == checked.end()) { - bool wasDegraded = false; // Was any stub bend encoding required for this window size? - set degradedBendTmpValues; - set bendTmpMatches; + // Compare this with the possibly tighter window provided by the user, converting to half-strip units. + unsigned int newWindow = (unsigned int)(2 * windowFEnew); + if (window > newWindow) + window = newWindow; + + // This is the window size measured in half-strips. + windowHalfStrips = window; + + // Number of degraded bend values should correspond to 3 bits (PS modules) or 4 bits (2S modules), + // so measuring everything in half-strip units, max integer "window" size that can be encoded without + // compression given by 2*window+1 <= pow(2,B), where B is number of bits. + // Hence no compression required if window cut is abs(b) < 3 (PS) or 7 (2S). Must introduce one merge for + // each 1 unit increase in "window" beyond this. + + // Bend is measured with granularity of 0.5 strips. + // Convert it to integer measured in half-strip units for this calculation! + + int b = std::round(2 * bend); + + if (abs(b) <= window) { + reject = false; + float degradedB; + unsigned int numBends = 2 * window + 1; + unsigned int numAllowed = (psModule) ? pow(2, bitsPS_) : pow(2, bits2S_); + // Existance of bend = 0 means can only use an odd number of groups. + numAllowed -= 1; + if (numBends <= numAllowed) { + // Can output uncompressed bend info. + numInGroup = 1; + degradedB = float(b); + } else { + unsigned int inSmallGroup = numBends / numAllowed; + unsigned int numLargeGroups = numBends % numAllowed; + unsigned int inLargeGroup = inSmallGroup + 1; + unsigned int numSmallGroups = numAllowed - numLargeGroups; + vector groups; + for (unsigned int i = 0; i < numLargeGroups / 2; i++) + groups.push_back(inLargeGroup); + for (unsigned int i = 0; i < numSmallGroups / 2; i++) + groups.push_back(inSmallGroup); + // Only one of numLargeGroups & numSmallGroups can be odd, since numAllowed is odd. + // And whichever one is odd is associated to a group with an odd number of elements since numBends is odd, + if (numLargeGroups % 2 == 1 && inLargeGroup % 2 == 1) { + groups.push_back(inLargeGroup); + } else if (numSmallGroups % 2 == 1 && inSmallGroup % 2 == 1) { + groups.push_back(inSmallGroup); + } else { + throw cms::Exception("DegradeBend: logic error with odd numbers"); + } + for (unsigned int i = 0; i < numSmallGroups / 2; i++) + groups.push_back(inSmallGroup); + for (unsigned int i = 0; i < numLargeGroups / 2; i++) + groups.push_back(inLargeGroup); + + degradedB = 999; + int iUp = -int(window) - 1; + for (unsigned int& inGroup : groups) { + iUp += inGroup; + int iDown = iUp - inGroup + 1; + if (b <= iUp && b >= iDown) { + numInGroup = inGroup; + degradedB = 0.5 * (iUp + iDown); + } + } + if (degradedB == 999) + throw cms::Exception("DegradeResolution: Logic error in loop over groups"); + } - // Loop over all bend values allowed within the window size. - for (int bendHalfStrips = -int(windowHalfStrips); bendHalfStrips <= int(windowHalfStrips); bendHalfStrips++) { - float bendTmp = float(bendHalfStrips)/2.; - float degradedBendTmp; - bool rejectTmp; - unsigned int numInGroupTmp = 0; - unsigned int windowHalfStripsTmp = 0; - this->work(bendTmp, psModule, stDetId, windowFEnew, - degradedBendTmp, rejectTmp, numInGroupTmp, windowHalfStripsTmp); - if (numInGroupTmp > 1) wasDegraded = true; - degradedBendTmpValues.insert(degradedBendTmp); - if (degradedBend == degradedBendTmp) bendTmpMatches.insert(bendTmp); // Gives same degraded bend as original problem. + // This is degraded bend in full strip units (neglecting bend sign). + degradedBend = float(degradedB) / 2.; - // Sanity checks. - if (rejectTmp) throw cms::Exception("DegradeBend: `rejected' flag set, despite bend being within window")<<" fabs("< "< maxAllowed) throw cms::Exception("DegradeBend: Bend encoding using too many bits")< "< p(windowHalfStrips, psModule); + + // Map notes if this (window size, psModule) combination has already been checked. + static map, bool> checked; + + if (checked.find(p) == checked.end()) { + bool wasDegraded = false; // Was any stub bend encoding required for this window size? + set degradedBendTmpValues; + set bendTmpMatches; + + // Loop over all bend values allowed within the window size. + for (int bendHalfStrips = -int(windowHalfStrips); bendHalfStrips <= int(windowHalfStrips); bendHalfStrips++) { + float bendTmp = float(bendHalfStrips) / 2.; + float degradedBendTmp; + bool rejectTmp; + unsigned int numInGroupTmp = 0; + unsigned int windowHalfStripsTmp = 0; + this->work( + bendTmp, psModule, stDetId, windowFEnew, degradedBendTmp, rejectTmp, numInGroupTmp, windowHalfStripsTmp); + if (numInGroupTmp > 1) + wasDegraded = true; + degradedBendTmpValues.insert(degradedBendTmp); + if (degradedBend == degradedBendTmp) + bendTmpMatches.insert(bendTmp); // Gives same degraded bend as original problem. + + // Sanity checks. + if (rejectTmp) + throw cms::Exception("DegradeBend: `rejected' flag set, despite bend being within window") + << " fabs(" << bendTmp << ") <= " << float(windowHalfStrips) / 2. << endl; + if (4 * fabs(bendTmp - degradedBendTmp) > std::round(numInGroupTmp - 1)) + throw cms::Exception("DegradeBend: degraded bend differs by more than expected from input bend.") + << " bendTmp=" << bendTmp << " degradedBendTmp=" << degradedBendTmp << " numInGroupTmp=" << numInGroupTmp + << endl; + } + + // Sanity checks. + unsigned int numRedValues = degradedBendTmpValues.size(); + unsigned int maxAllowed = (psModule) ? pow(2, bitsPS_) : pow(2, bits2S_); + if (wasDegraded) { + if (numRedValues != maxAllowed - 1) + throw cms::Exception("DegradeBend: Bend encoding using wrong number of bits") + << numRedValues << " > " << maxAllowed << endl; + } else { + if (numRedValues > maxAllowed) + throw cms::Exception("DegradeBend: Bend encoding using too many bits") + << numRedValues << " > " << maxAllowed << endl; + } + if (bendTmpMatches.size() != numInGroup) + throw cms::Exception("DegradeBend: number of bend values in group inconsistent.") + << bendTmpMatches.size() << " is not equal to " << numInGroup << endl; } - if (bendTmpMatches.size() != numInGroup) throw cms::Exception("DegradeBend: number of bend values in group inconsistent.")<phiSBits()), // No. of bits to store phiS coord. - phiSRange_ (settings->phiSRange()), // Range of phiS coord. in radians. - rtBits_ (settings->rtBits()), // No. of bits to store rT coord. - rtRange_ (settings->rtRange()), // Range of rT coord. in cm. - zBits_ (settings->zBits()), // No. of bits to store z coord. - zRange_ (settings->zRange()), // Range of z coord in cm. - phiSMult_ (pow(2, phiSBits_)/phiSRange_), - rtMult_ (pow(2, rtBits_ )/rtRange_), - zMult_ (pow(2, zBits_ )/zRange_), - // Radius from beamline with respect to which stub r coord. is measured. - numPhiSectors_ (settings->numPhiSectors()), - numPhiNonants_ (9), - phiSectorWidth_(2.*M_PI / float(numPhiSectors_)), - chosenRofPhi_ (settings->chosenRofPhi()) -{ - // Centre of this sector in phi. (Nonant 0 is centred on x-axis). - double phiCentreSec0 = -M_PI/float(numPhiNonants_) + M_PI/float(numPhiSectors_); - double phiSectorCentre = phiSectorWidth_ * float(iPhiSec) + phiCentreSec0; - - r_orig_ = r; - phi_orig_ = phi; - z_orig_ = z; - - rt_orig_ = r_orig_ - chosenRofPhi_; - phiS_orig_ = reco::deltaPhi(phi_orig_, phiSectorCentre); - - // Digitize - iDigi_Rt_ = floor(rt_orig_*rtMult_); - iDigi_PhiS_ = floor(phiS_orig_*phiSMult_); - iDigi_Z_ = floor(z_orig_*zMult_); - iDigi_Z_KF_ = iDigi_Z_; - - /* + //=== Simplified version of DigitalStub for use with KF in Hybrid tracking. + + DigitalStub::DigitalStub(const Settings* settings, double r, double phi, double z, unsigned int iPhiSec) + : ranInit_(true), + ranMakeGPinput_(true), + ranMakeHTinput_(true), + ranMakeSForTFinput_("KF"), + phiSBits_(settings->phiSBits()), // No. of bits to store phiS coord. + phiSRange_(settings->phiSRange()), // Range of phiS coord. in radians. + rtBits_(settings->rtBits()), // No. of bits to store rT coord. + rtRange_(settings->rtRange()), // Range of rT coord. in cm. + zBits_(settings->zBits()), // No. of bits to store z coord. + zRange_(settings->zRange()), // Range of z coord in cm. + phiSMult_(pow(2, phiSBits_) / phiSRange_), + rtMult_(pow(2, rtBits_) / rtRange_), + zMult_(pow(2, zBits_) / zRange_), + // Radius from beamline with respect to which stub r coord. is measured. + numPhiSectors_(settings->numPhiSectors()), + numPhiNonants_(9), + phiSectorWidth_(2. * M_PI / float(numPhiSectors_)), + chosenRofPhi_(settings->chosenRofPhi()) { + // Centre of this sector in phi. (Nonant 0 is centred on x-axis). + double phiCentreSec0 = -M_PI / float(numPhiNonants_) + M_PI / float(numPhiSectors_); + double phiSectorCentre = phiSectorWidth_ * float(iPhiSec) + phiCentreSec0; + + r_orig_ = r; + phi_orig_ = phi; + z_orig_ = z; + + rt_orig_ = r_orig_ - chosenRofPhi_; + phiS_orig_ = reco::deltaPhi(phi_orig_, phiSectorCentre); + + // Digitize + iDigi_Rt_ = floor(rt_orig_ * rtMult_); + iDigi_PhiS_ = floor(phiS_orig_ * phiSMult_); + iDigi_Z_ = floor(z_orig_ * zMult_); + iDigi_Z_KF_ = iDigi_Z_; + + /* // SKIP UNTIL HYBRID DIGITISATION PARAMS IMPLEMENTED @@ -61,371 +60,398 @@ DigitalStub::DigitalStub(const Settings* settings, double r, double phi, double this->checkAccuracy(); */ -} - - -//=== Note configuration parameters (for use with TMTT tracking). - -DigitalStub::DigitalStub(const Settings* settings) : - - // To check that DigitalStub is correctly initialized. - ranInit_(false), - ranMakeGPinput_(false), - ranMakeHTinput_(false), - ranMakeSForTFinput_(""), - - // Digitization configuration parameters - phiSectorBits_ (settings->phiSectorBits()), // No. of bits to store phi sector number - //--- Parameters available in HT board. - phiSBits_ (settings->phiSBits()), // No. of bits to store phiS coord. - phiSRange_ (settings->phiSRange()), // Range of phiS coord. in radians. - rtBits_ (settings->rtBits()), // No. of bits to store rT coord. - rtRange_ (settings->rtRange()), // Range of rT coord. in cm. - zBits_ (settings->zBits()), // No. of bits to store z coord. - zRange_ (settings->zRange()), // Range of z coord in cm. - //--- Parameters available in GP board (excluding any in common with HT specified above). - phiOBits_ (settings->phiOBits()), // No. of bits to store phiO parameter. - phiORange_ (settings->phiORange()), // Range of phiO parameter - bendBits_ (settings->bendBits()), // No. of bits to store stub bend. - - // Note if using reduced layer ID, so tracker layer can be encoded in 3 bits. - reduceLayerID_ (settings->reduceLayerID()), - - // Number of phi sectors and phi nonants. - numPhiSectors_ (settings->numPhiSectors()), - numPhiNonants_ (settings->numPhiNonants()), - // Phi sector and phi nonant width (radians) - phiSectorWidth_(2.*M_PI / float(numPhiSectors_)), - phiNonantWidth_(2.*M_PI / float(numPhiNonants_)), - // Radius from beamline with respect to which stub r coord. is measured. - chosenRofPhi_ (settings->chosenRofPhi()), - - // Number of q/Pt bins in Hough transform array. - nbinsPt_ ((int) settings->houghNbinsPt()) -{ - // Calculate multipliers to digitize the floating point numbers. - phiSMult_ = pow(2, phiSBits_)/phiSRange_; - rtMult_ = pow(2, rtBits_ )/rtRange_; - zMult_ = pow(2, zBits_ )/zRange_; - phiOMult_ = pow(2, phiOBits_)/phiORange_; - - bendMult_ = 4.; // No precision lost by digitization, since original bend (after encoding) has steps of 0.25 (in units of pitch). - bendRange_ = round(pow(2, bendBits_)/bendMult_); // discrete values, so digitisation different -} - -//=== Initialize stub with original, floating point stub coords, -//=== range of m bin (= q/Pt bin) values allowed by bend filter, -//=== normal & "reduced" tracker layer of stub, stub bend, and pitch & seperation of module, -//=== and half-length of strip or pixel in r and in z, and if it's in barrel, tilted barrel and/or PS module. - -void DigitalStub::init(float phi_orig, float r_orig, float z_orig, - unsigned int min_qOverPt_bin_orig, unsigned int max_qOverPt_bin_orig, - unsigned int layerID, unsigned int layerIDreduced, float bend_orig, - float pitch, float sep, float rErr, float zErr, bool barrel, bool tiltedBarrel, bool psModule) { - - ranInit_ = true; // Note we ran init(). - // Variables in HT. - phi_orig_ = phi_orig; - r_orig_ = r_orig; - z_orig_ = z_orig; - min_qOverPt_bin_orig_ = min_qOverPt_bin_orig; - max_qOverPt_bin_orig_ = max_qOverPt_bin_orig; - layerID_ = layerID; - layerIDreduced_ = layerIDreduced; - // Variables exclusively in GP. - bend_orig_ = bend_orig; - rErr_orig_ = rErr; - zErr_orig_ = zErr; - - // Calculate unique module type ID, allowing pitch/sep of module to be determined. - // (N.B. Module types 0 & 1 have identical pitch & sep, but one is tilted & one is flat barrel module). - - moduleType_ = 999; - // EJC new (additional) module type for tilted geometry - const vector pitchVsType = {0.0099, 0.0099, 0.0099, 0.0099, 0.0089, 0.0099, 0.0089, 0.0089}; - const vector sepVsType = {0.26 , 0.26 , 0.16 , 0.4 , 0.18 , 0.4 , 0.18 , 0.4 }; - const vector barrelVsType = {true , true , true , true , true , false , false , false }; - const vector psVsType = {true , true , true , true , false , true , false , false }; - const vector tiltedVsType = {false , true , false , true , false, false , false , false }; - if (pitchVsType.size() != sepVsType.size()) throw cms::Exception("DigitalStub: module type array size wrong"); - const float tol = 0.001; // Tolerance - for (unsigned int i = 0; i < pitchVsType.size(); i++) { - if (fabs(pitch - pitchVsType[i]) < tol && fabs(sep - sepVsType[i]) < tol && barrel == barrelVsType[i] && tiltedBarrel == tiltedVsType[i] && psModule == psVsType[i]) { - moduleType_ = i; - } } - if (moduleType_ == 999) throw cms::Exception("DigitalStub: unknown module type")<<"pitch="<phiSectorBits()), // No. of bits to store phi sector number + //--- Parameters available in HT board. + phiSBits_(settings->phiSBits()), // No. of bits to store phiS coord. + phiSRange_(settings->phiSRange()), // Range of phiS coord. in radians. + rtBits_(settings->rtBits()), // No. of bits to store rT coord. + rtRange_(settings->rtRange()), // Range of rT coord. in cm. + zBits_(settings->zBits()), // No. of bits to store z coord. + zRange_(settings->zRange()), // Range of z coord in cm. + //--- Parameters available in GP board (excluding any in common with HT specified above). + phiOBits_(settings->phiOBits()), // No. of bits to store phiO parameter. + phiORange_(settings->phiORange()), // Range of phiO parameter + bendBits_(settings->bendBits()), // No. of bits to store stub bend. + + // Note if using reduced layer ID, so tracker layer can be encoded in 3 bits. + reduceLayerID_(settings->reduceLayerID()), + + // Number of phi sectors and phi nonants. + numPhiSectors_(settings->numPhiSectors()), + numPhiNonants_(settings->numPhiNonants()), + // Phi sector and phi nonant width (radians) + phiSectorWidth_(2. * M_PI / float(numPhiSectors_)), + phiNonantWidth_(2. * M_PI / float(numPhiNonants_)), + // Radius from beamline with respect to which stub r coord. is measured. + chosenRofPhi_(settings->chosenRofPhi()), + + // Number of q/Pt bins in Hough transform array. + nbinsPt_((int)settings->houghNbinsPt()) { + // Calculate multipliers to digitize the floating point numbers. + phiSMult_ = pow(2, phiSBits_) / phiSRange_; + rtMult_ = pow(2, rtBits_) / rtRange_; + zMult_ = pow(2, zBits_) / zRange_; + phiOMult_ = pow(2, phiOBits_) / phiORange_; + + bendMult_ = + 4.; // No precision lost by digitization, since original bend (after encoding) has steps of 0.25 (in units of pitch). + bendRange_ = round(pow(2, bendBits_) / bendMult_); // discrete values, so digitisation different + } + + //=== Initialize stub with original, floating point stub coords, + //=== range of m bin (= q/Pt bin) values allowed by bend filter, + //=== normal & "reduced" tracker layer of stub, stub bend, and pitch & seperation of module, + //=== and half-length of strip or pixel in r and in z, and if it's in barrel, tilted barrel and/or PS module. + + void DigitalStub::init(float phi_orig, + float r_orig, + float z_orig, + unsigned int min_qOverPt_bin_orig, + unsigned int max_qOverPt_bin_orig, + unsigned int layerID, + unsigned int layerIDreduced, + float bend_orig, + float pitch, + float sep, + float rErr, + float zErr, + bool barrel, + bool tiltedBarrel, + bool psModule) { + ranInit_ = true; // Note we ran init(). + // Variables in HT. + phi_orig_ = phi_orig; + r_orig_ = r_orig; + z_orig_ = z_orig; + min_qOverPt_bin_orig_ = min_qOverPt_bin_orig; + max_qOverPt_bin_orig_ = max_qOverPt_bin_orig; + layerID_ = layerID; + layerIDreduced_ = layerIDreduced; + // Variables exclusively in GP. + bend_orig_ = bend_orig; + rErr_orig_ = rErr; + zErr_orig_ = zErr; + + // Calculate unique module type ID, allowing pitch/sep of module to be determined. + // (N.B. Module types 0 & 1 have identical pitch & sep, but one is tilted & one is flat barrel module). + + moduleType_ = 999; + // EJC new (additional) module type for tilted geometry + const vector pitchVsType = {0.0099, 0.0099, 0.0099, 0.0099, 0.0089, 0.0099, 0.0089, 0.0089}; + const vector sepVsType = {0.26, 0.26, 0.16, 0.4, 0.18, 0.4, 0.18, 0.4}; + const vector barrelVsType = {true, true, true, true, true, false, false, false}; + const vector psVsType = {true, true, true, true, false, true, false, false}; + const vector tiltedVsType = {false, true, false, true, false, false, false, false}; + if (pitchVsType.size() != sepVsType.size()) + throw cms::Exception("DigitalStub: module type array size wrong"); + const float tol = 0.001; // Tolerance + for (unsigned int i = 0; i < pitchVsType.size(); i++) { + if (fabs(pitch - pitchVsType[i]) < tol && fabs(sep - sepVsType[i]) < tol && barrel == barrelVsType[i] && + tiltedBarrel == tiltedVsType[i] && psModule == psVsType[i]) { + moduleType_ = i; + } + } + if (moduleType_ == 999) + throw cms::Exception("DigitalStub: unknown module type") + << "pitch=" << pitch << " separation=" << sep << " barrel=" << barrel << " tilted=" << tiltedBarrel + << " PS=" << psModule << endl; + } -void DigitalStub::makeGPinput(unsigned int iPhiSec) { + //=== Digitize stub for input to Geographic Processor, with stub phi coord. measured relative to phi nonant that contains specified phi sector. - if (! ranInit_) throw cms::Exception("DigitalStub: You forgot to call init() before makeGPinput()!"); + void DigitalStub::makeGPinput(unsigned int iPhiSec) { + if (!ranInit_) + throw cms::Exception("DigitalStub: You forgot to call init() before makeGPinput()!"); - unsigned int iPhiNon = floor(iPhiSec*numPhiNonants_/numPhiSectors_); // Find nonant corresponding to this sector. + unsigned int iPhiNon = + floor(iPhiSec * numPhiNonants_ / numPhiSectors_); // Find nonant corresponding to this sector. - // If this stub was already digitized, we don't have to redo all the work again. Save CPU. - if (ranMakeGPinput_) { - if (iPhiNon == iDigi_Nonant_) { - return; // Work already done. - } else { - this->quickMakeGPinput(iPhiSec); - return; + // If this stub was already digitized, we don't have to redo all the work again. Save CPU. + if (ranMakeGPinput_) { + if (iPhiNon == iDigi_Nonant_) { + return; // Work already done. + } else { + this->quickMakeGPinput(iPhiSec); + return; + } } - } - ranMakeGPinput_ = true; // Note we ran make(). + ranMakeGPinput_ = true; // Note we ran make(). - //--- Shift axes of coords. if required. + //--- Shift axes of coords. if required. - // r coordinate relative to specified point. - rt_orig_ = r_orig_ - chosenRofPhi_; + // r coordinate relative to specified point. + rt_orig_ = r_orig_ - chosenRofPhi_; - // Phi coord. of stub relative to centre of nonant. - double phiNonantCentre = phiNonantWidth_ * double(iPhiNon); + // Phi coord. of stub relative to centre of nonant. + double phiNonantCentre = phiNonantWidth_ * double(iPhiNon); - phiO_orig_ = reco::deltaPhi(phi_orig_, phiNonantCentre); + phiO_orig_ = reco::deltaPhi(phi_orig_, phiNonantCentre); - //--- Digitize variables used exclusively in GP. - iDigi_Nonant_ = iPhiNon; - iDigi_PhiO_ = floor(phiO_orig_*phiOMult_); - iDigi_Bend_ = round(bend_orig_*bendMult_); // discrete values, so digitisation different - //--- Digitize variables used in both GP & HT. - iDigi_Rt_ = floor(rt_orig_*rtMult_); - iDigi_Z_ = floor(z_orig_*zMult_); - - //--- Determine floating point stub coords. from digitized numbers (so with degraded resolution). - //--- First for variables used exclusively in GP. - phiO_ = (iDigi_PhiO_ + 0.5)/phiOMult_; - bend_ = iDigi_Bend_/bendMult_; // discrete values, so digitisation different - phi_ = reco::deltaPhi(phiO_, -phiNonantCentre); - //--- Then for variables used in both GP & HT. - rt_ = (iDigi_Rt_ + 0.5)/rtMult_; - r_ = rt_ + chosenRofPhi_; - z_ = (iDigi_Z_ + 0.5)/zMult_; -} + //--- Digitize variables used exclusively in GP. + iDigi_Nonant_ = iPhiNon; + iDigi_PhiO_ = floor(phiO_orig_ * phiOMult_); + iDigi_Bend_ = round(bend_orig_ * bendMult_); // discrete values, so digitisation different + //--- Digitize variables used in both GP & HT. + iDigi_Rt_ = floor(rt_orig_ * rtMult_); + iDigi_Z_ = floor(z_orig_ * zMult_); -//=== Digitize stub for input to Hough transform, with stub phi coord. measured relative to specified phi sector. + //--- Determine floating point stub coords. from digitized numbers (so with degraded resolution). + //--- First for variables used exclusively in GP. + phiO_ = (iDigi_PhiO_ + 0.5) / phiOMult_; + bend_ = iDigi_Bend_ / bendMult_; // discrete values, so digitisation different + phi_ = reco::deltaPhi(phiO_, -phiNonantCentre); + //--- Then for variables used in both GP & HT. + rt_ = (iDigi_Rt_ + 0.5) / rtMult_; + r_ = rt_ + chosenRofPhi_; + z_ = (iDigi_Z_ + 0.5) / zMult_; + } -void DigitalStub::makeHTinput(unsigned int iPhiSec) { + //=== Digitize stub for input to Hough transform, with stub phi coord. measured relative to specified phi sector. - if (! ranInit_) throw cms::Exception("DigitalStub: You forgot to call init() before makeHTinput()!"); + void DigitalStub::makeHTinput(unsigned int iPhiSec) { + if (!ranInit_) + throw cms::Exception("DigitalStub: You forgot to call init() before makeHTinput()!"); - // Digitize for GP input if not already done, since some variables are shared by GP & HT. - this->makeGPinput(iPhiSec); + // Digitize for GP input if not already done, since some variables are shared by GP & HT. + this->makeGPinput(iPhiSec); - // If this stub was already digitized, we don't have to redo all the work again. Save CPU. - if (ranMakeHTinput_) { - if (iPhiSec == iDigi_PhiSec_) { - return; // Work already done. - } else { - this->quickMakeHTinput(iPhiSec); - return; + // If this stub was already digitized, we don't have to redo all the work again. Save CPU. + if (ranMakeHTinput_) { + if (iPhiSec == iDigi_PhiSec_) { + return; // Work already done. + } else { + this->quickMakeHTinput(iPhiSec); + return; + } } - } - ranMakeHTinput_ = true; // Note we ran makeHTinput(). + ranMakeHTinput_ = true; // Note we ran makeHTinput(). - //--- Shift axes of coords. if required. + //--- Shift axes of coords. if required. - // Centre of this sector in phi - double phiCentreSec0 = -M_PI/float(numPhiNonants_) + M_PI/float(numPhiSectors_); - double phiSectorCentre = phiSectorWidth_ * float(iPhiSec) + phiCentreSec0; + // Centre of this sector in phi + double phiCentreSec0 = -M_PI / float(numPhiNonants_) + M_PI / float(numPhiSectors_); + double phiSectorCentre = phiSectorWidth_ * float(iPhiSec) + phiCentreSec0; - // Point in sector from which stub phiS should be measured. - double phiSectorRef = phiSectorCentre; + // Point in sector from which stub phiS should be measured. + double phiSectorRef = phiSectorCentre; - // Phi coord. of stub relative to centre of sector. - phiS_orig_ = reco::deltaPhi(phi_orig_, phiSectorRef); + // Phi coord. of stub relative to centre of sector. + phiS_orig_ = reco::deltaPhi(phi_orig_, phiSectorRef); - //--- Digitize variables used exclusively by HT. - iDigi_PhiSec_ = iPhiSec; - iDigi_PhiS_ = floor(phiS_orig_*phiSMult_); - // Don't bother digitising here variables used by both GP & HT, as makeGPinput() will already have digitized them. + //--- Digitize variables used exclusively by HT. + iDigi_PhiSec_ = iPhiSec; + iDigi_PhiS_ = floor(phiS_orig_ * phiSMult_); + // Don't bother digitising here variables used by both GP & HT, as makeGPinput() will already have digitized them. - // N.B. If using daisy-chain firmware, then should logically recalculate m bin range here, since it depends on the now - // digitized r and z coordinates. But too lazy to move code here from Stub::digitizeForHTinput(), where calculation - // actually done. - - //--- Determine floating point stub coords. from digitized numbers (so with degraded resolution). - //--- First for variables used exclusively by HT - phiS_ = (iDigi_PhiS_ + 0.5)/phiSMult_; - phi_ = reco::deltaPhi(phiS_, -phiSectorRef); // N.B. phi_ measured w.r.t sector here, but w.r.t. nonant in makeGPinput() - // Don't bother with variables used by both GP & HT, as makeGPinput() will already have already calculated them. + // N.B. If using daisy-chain firmware, then should logically recalculate m bin range here, since it depends on the now + // digitized r and z coordinates. But too lazy to move code here from Stub::digitizeForHTinput(), where calculation + // actually done. - //--- Do next two checks here rather than in makeGPinput(), as the latter may be called for stubs in the wrong nonant, so out of range. + //--- Determine floating point stub coords. from digitized numbers (so with degraded resolution). + //--- First for variables used exclusively by HT + phiS_ = (iDigi_PhiS_ + 0.5) / phiSMult_; + phi_ = reco::deltaPhi(phiS_, + -phiSectorRef); // N.B. phi_ measured w.r.t sector here, but w.r.t. nonant in makeGPinput() + // Don't bother with variables used by both GP & HT, as makeGPinput() will already have already calculated them. - // Check that stub coords. are within assumed digitization range. - this->checkInRange(); + //--- Do next two checks here rather than in makeGPinput(), as the latter may be called for stubs in the wrong nonant, so out of range. - // Check that digitization followed by undigitization doesn't change results too much. - this->checkAccuracy(); + // Check that stub coords. are within assumed digitization range. + this->checkInRange(); + + // Check that digitization followed by undigitization doesn't change results too much. + this->checkAccuracy(); + + // Adjust m-bin range, as hardware counts q/Pt bins in HT array using a signed integer in a symmetric range about zero. + const int min_array_bin = (nbinsPt_ % 2 == 0) ? -(nbinsPt_ / 2) : -(nbinsPt_ - 1) / 2; + m_min_ = min_qOverPt_bin_orig_ + min_array_bin; + m_max_ = max_qOverPt_bin_orig_ + min_array_bin; + + //--- Produce tracker layer identifier, encoded as it is sent along the optical link. + + if (reduceLayerID_) { + // Firmware is using "reduced" layer ID, which can be packed into 3 bits in range 1-7. + iDigi_LayerID_ = layerIDreduced_; - // Adjust m-bin range, as hardware counts q/Pt bins in HT array using a signed integer in a symmetric range about zero. - const int min_array_bin = (nbinsPt_%2 == 0) ? -(nbinsPt_/2) : -(nbinsPt_ - 1)/2; - m_min_ = min_qOverPt_bin_orig_ + min_array_bin; - m_max_ = max_qOverPt_bin_orig_ + min_array_bin; - - //--- Produce tracker layer identifier, encoded as it is sent along the optical link. - - if (reduceLayerID_) { - // Firmware is using "reduced" layer ID, which can be packed into 3 bits in range 1-7. - iDigi_LayerID_ = layerIDreduced_; - - } else { - // Firmware is using normal layer ID, which needs more than 3 bits to store it. - // Encode barrel layers as 0 to 5. - iDigi_LayerID_ = layerID_ - 1; - // Endcode endcap layers as 6 to 10, not bothering to distinguish the two endcaps. - if (iDigi_LayerID_ == 10 || iDigi_LayerID_ == 20) { - iDigi_LayerID_ = 6; - } else if (iDigi_LayerID_ == 11 || iDigi_LayerID_ == 21) { - iDigi_LayerID_ = 7; - } else if (iDigi_LayerID_ == 12 || iDigi_LayerID_ == 22) { - iDigi_LayerID_ = 8; - } else if (iDigi_LayerID_ == 13 || iDigi_LayerID_ == 23) { - iDigi_LayerID_ = 9; - } else if (iDigi_LayerID_ == 14 || iDigi_LayerID_ == 24) { - iDigi_LayerID_ = 10; - } - } -} - -//=== Digitize stub for input to r-z Seed Filter or Track Fitter. -//=== Argument is "SeedFilter" or name of Track Fitter. -//=== N.B. This digitisation is done internally within the FPGA not for transmission along opto-links. - -void DigitalStub::makeSForTFinput(string SForTF) { - if (! ranInit_) throw cms::Exception("DigitalStub: You forgot to call init() before makeSForTFinput()!"); - - // Save CPU by not digitizing stub again if already done. - if (ranMakeSForTFinput_ != SForTF) { - ranMakeSForTFinput_ = SForTF; // Note we ran makeSForTFinput(). - - // The stub r coordinate is calculated inside the seed filter from the value of rT. - // Best to choose a ref. radius such that digitising then undigitising it leaves it unchanged. - iDigi_R_ = iDigi_Rt_ + std::round(chosenRofPhi_*rtMult_); - - //--- Determine floating point variables from digtized numbers. - r_ = (iDigi_R_ + 0.5)/rtMult_; - rt_ = r_ - chosenRofPhi_; - - if (SForTF.find("KF") != string::npos) { - // Digitize variables that are exclusive to Kalman filter. - // Data format uses z directly from HT, as its multiplier is exactly a factor 2 - // smaller than for r, which is easy to fix in VHDL-HLS interface. - iDigi_Z_KF_ = iDigi_Z_; - // Determine floating point variable from digitized one, using z multiplier. - z_ = (iDigi_Z_KF_ + 0.5)/zMult_; } else { - // If not using KF, then restore z value from HT. - iDigi_Z_KF_ = 0; // Shoudln't be used in this case. - z_ = (iDigi_Z_ + 0.5)/zMult_; + // Firmware is using normal layer ID, which needs more than 3 bits to store it. + // Encode barrel layers as 0 to 5. + iDigi_LayerID_ = layerID_ - 1; + // Endcode endcap layers as 6 to 10, not bothering to distinguish the two endcaps. + if (iDigi_LayerID_ == 10 || iDigi_LayerID_ == 20) { + iDigi_LayerID_ = 6; + } else if (iDigi_LayerID_ == 11 || iDigi_LayerID_ == 21) { + iDigi_LayerID_ = 7; + } else if (iDigi_LayerID_ == 12 || iDigi_LayerID_ == 22) { + iDigi_LayerID_ = 8; + } else if (iDigi_LayerID_ == 13 || iDigi_LayerID_ == 23) { + iDigi_LayerID_ = 9; + } else if (iDigi_LayerID_ == 14 || iDigi_LayerID_ == 24) { + iDigi_LayerID_ = 10; + } } + } - if (SForTF == "SeedFilter") { - //--- Digitize variables used exclusively in seed filter. - // The stub (r,z) uncertainties are actually calculated inside the seed filter and not passed to it along optical links. - iDigi_rErr_ = ceil(rErr_orig_*rtMult_); // Round up to avoid zero uncertainty ... - iDigi_zErr_ = ceil(zErr_orig_*zMult_); - //--- Determine floating point variables from digtized numbers - rErr_ = (iDigi_rErr_ - 0.5)/rtMult_; - zErr_ = (iDigi_zErr_ - 0.5)/zMult_; - } else { - // Restore original value. Although perhaps better to leave? - rErr_ = rErr_orig_; - zErr_ = zErr_orig_; + //=== Digitize stub for input to r-z Seed Filter or Track Fitter. + //=== Argument is "SeedFilter" or name of Track Fitter. + //=== N.B. This digitisation is done internally within the FPGA not for transmission along opto-links. + + void DigitalStub::makeSForTFinput(string SForTF) { + if (!ranInit_) + throw cms::Exception("DigitalStub: You forgot to call init() before makeSForTFinput()!"); + + // Save CPU by not digitizing stub again if already done. + if (ranMakeSForTFinput_ != SForTF) { + ranMakeSForTFinput_ = SForTF; // Note we ran makeSForTFinput(). + + // The stub r coordinate is calculated inside the seed filter from the value of rT. + // Best to choose a ref. radius such that digitising then undigitising it leaves it unchanged. + iDigi_R_ = iDigi_Rt_ + std::round(chosenRofPhi_ * rtMult_); + + //--- Determine floating point variables from digtized numbers. + r_ = (iDigi_R_ + 0.5) / rtMult_; + rt_ = r_ - chosenRofPhi_; + + if (SForTF.find("KF") != string::npos) { + // Digitize variables that are exclusive to Kalman filter. + // Data format uses z directly from HT, as its multiplier is exactly a factor 2 + // smaller than for r, which is easy to fix in VHDL-HLS interface. + iDigi_Z_KF_ = iDigi_Z_; + // Determine floating point variable from digitized one, using z multiplier. + z_ = (iDigi_Z_KF_ + 0.5) / zMult_; + } else { + // If not using KF, then restore z value from HT. + iDigi_Z_KF_ = 0; // Shoudln't be used in this case. + z_ = (iDigi_Z_ + 0.5) / zMult_; + } + + if (SForTF == "SeedFilter") { + //--- Digitize variables used exclusively in seed filter. + // The stub (r,z) uncertainties are actually calculated inside the seed filter and not passed to it along optical links. + iDigi_rErr_ = ceil(rErr_orig_ * rtMult_); // Round up to avoid zero uncertainty ... + iDigi_zErr_ = ceil(zErr_orig_ * zMult_); + //--- Determine floating point variables from digtized numbers + rErr_ = (iDigi_rErr_ - 0.5) / rtMult_; + zErr_ = (iDigi_zErr_ - 0.5) / zMult_; + } else { + // Restore original value. Although perhaps better to leave? + rErr_ = rErr_orig_; + zErr_ = zErr_orig_; + } } } -} -void DigitalStub::makeDRinput(unsigned int stubId){ - if (! ranInit_) throw cms::Exception("DigitalStub: You forgot to call init() before makeDRinput()!"); + void DigitalStub::makeDRinput(unsigned int stubId) { + if (!ranInit_) + throw cms::Exception("DigitalStub: You forgot to call init() before makeDRinput()!"); - ranMakeDRinput_ = true; // Note we ran makeDRinput(). - stubId_ = stubId; -} + ranMakeDRinput_ = true; // Note we ran makeDRinput(). + stubId_ = stubId; + } + //=== Redigitize stub for input to Geographic Processor, if it was previously digitized for a different phi sector. -//=== Redigitize stub for input to Geographic Processor, if it was previously digitized for a different phi sector. + void DigitalStub::quickMakeGPinput(int iPhiSec) { + //--- Shift axes of coords. if required. -void DigitalStub::quickMakeGPinput(int iPhiSec) { + // Phi coord. of stub relative to centre of nonant. + unsigned int iPhiNon = floor(iPhiSec * numPhiNonants_ / numPhiSectors_); + double phiNonantCentre = phiNonantWidth_ * double(iPhiNon); + phiO_orig_ = reco::deltaPhi(phi_orig_, phiNonantCentre); - //--- Shift axes of coords. if required. + //--- Digitize variables used exclusively in GP. + iDigi_Nonant_ = iPhiNon; + iDigi_PhiO_ = floor(phiO_orig_ * phiOMult_); - // Phi coord. of stub relative to centre of nonant. - unsigned int iPhiNon = floor(iPhiSec*numPhiNonants_/numPhiSectors_); - double phiNonantCentre = phiNonantWidth_ * double(iPhiNon); - phiO_orig_ = reco::deltaPhi(phi_orig_, phiNonantCentre); + //--- Determine floating point stub coords. from digitized numbers (so with degraded resolution). + //--- Variables used exclusively in GP. + phiO_ = (iDigi_PhiO_) / phiOMult_; + phi_ = reco::deltaPhi(phiO_, -phiNonantCentre); + } - //--- Digitize variables used exclusively in GP. - iDigi_Nonant_ = iPhiNon; - iDigi_PhiO_ = floor(phiO_orig_*phiOMult_); - - //--- Determine floating point stub coords. from digitized numbers (so with degraded resolution). - //--- Variables used exclusively in GP. - phiO_ = (iDigi_PhiO_)/phiOMult_; - phi_ = reco::deltaPhi(phiO_, -phiNonantCentre); -} + //=== Redigitize stub for input to Hough transform, if it was previously digitized for a different phi sector. -//=== Redigitize stub for input to Hough transform, if it was previously digitized for a different phi sector. + void DigitalStub::quickMakeHTinput(int iPhiSec) { + //--- Shift axes of coords. if required. -void DigitalStub::quickMakeHTinput(int iPhiSec) { + // Centre of this sector in phi + double phiCentreSec0 = -M_PI / float(numPhiNonants_) + M_PI / float(numPhiSectors_); + double phiSectorCentre = phiSectorWidth_ * float(iPhiSec) + phiCentreSec0; - //--- Shift axes of coords. if required. + // Point in sector from which stub phiS should be measured. + double phiSectorRef = phiSectorCentre; - // Centre of this sector in phi - double phiCentreSec0 = -M_PI/float(numPhiNonants_) + M_PI/float(numPhiSectors_); - double phiSectorCentre = phiSectorWidth_ * float(iPhiSec) + phiCentreSec0; + // Phi coord. of stub relative to centre of sector. + phiS_orig_ = reco::deltaPhi(phi_orig_, phiSectorRef); - // Point in sector from which stub phiS should be measured. - double phiSectorRef = phiSectorCentre; + // Check that stub coords. are within assumed digitization range. + this->checkInRange(); - // Phi coord. of stub relative to centre of sector. - phiS_orig_ = reco::deltaPhi(phi_orig_, phiSectorRef); + //--- Digitize variables used in HT. + iDigi_PhiSec_ = iPhiSec; + iDigi_PhiS_ = floor(phiS_orig_ * phiSMult_); - // Check that stub coords. are within assumed digitization range. - this->checkInRange(); + //--- Determine floating point stub coords. from digitized numbers (so with degraded resolution). + //--- First for variables used in HT. + phiS_ = (iDigi_PhiS_) / phiSMult_; + phi_ = reco::deltaPhi(phiS_, -phiSectorRef); + } + + //=== Check that stub coords. are within assumed digitization range. + + void DigitalStub::checkInRange() const { + // All ranges are centred at zero, except for rho, which is +ve-definate. + if (fabs(phiS_orig_) >= 0.5 * phiSRange_) + throw cms::Exception("DigitalStub: Stub phiS is out of assumed digitization range.") + << " |phiS| = " << fabs(phiS_orig_) << " > " << 0.5 * phiSRange_ << endl; + if (fabs(rt_orig_) >= 0.5 * rtRange_) + throw cms::Exception("DigitalStub: Stub rT is out of assumed digitization range.") + << " |rt| = " << fabs(rt_orig_) << " > " << 0.5 * rtRange_ << endl; + if (fabs(z_orig_) >= 0.5 * zRange_) + throw cms::Exception("DigitalStub: Stub z is out of assumed digitization range.") + << " |z| = " << fabs(z_orig_) << " > " << 0.5 * zRange_ << endl; + if (fabs(phiO_orig_) >= 0.5 * phiORange_) + throw cms::Exception("DigitalStub: Stub phiO is out of assumed digitization range.") + << " |phiO| = " << fabs(phiO_orig_) << " > " << 0.5 * phiORange_ << endl; + if (fabs(bend_orig_) >= 0.5 * bendRange_) + throw cms::Exception("DigitalStub: Stub bend is out of assumed digitization range.") + << " |bend| = " << fabs(bend_orig_) << " > " << 0.5 * bendRange_ << endl; + } - //--- Digitize variables used in HT. - iDigi_PhiSec_ = iPhiSec; - iDigi_PhiS_ = floor(phiS_orig_*phiSMult_); - - //--- Determine floating point stub coords. from digitized numbers (so with degraded resolution). - //--- First for variables used in HT. - phiS_ = (iDigi_PhiS_)/phiSMult_; - phi_ = reco::deltaPhi(phiS_, -phiSectorRef); -} - -//=== Check that stub coords. are within assumed digitization range. - -void DigitalStub::checkInRange() const { - // All ranges are centred at zero, except for rho, which is +ve-definate. - if (fabs(phiS_orig_) >= 0.5*phiSRange_) throw cms::Exception("DigitalStub: Stub phiS is out of assumed digitization range.")<<" |phiS| = " < "<<0.5*phiSRange_<= 0.5*rtRange_) throw cms::Exception("DigitalStub: Stub rT is out of assumed digitization range.") <<" |rt| = " < "<<0.5*rtRange_ <= 0.5*zRange_) throw cms::Exception("DigitalStub: Stub z is out of assumed digitization range.") <<" |z| = " < "<<0.5*zRange_ <= 0.5*phiORange_) throw cms::Exception("DigitalStub: Stub phiO is out of assumed digitization range.")<<" |phiO| = " < "<<0.5*phiORange_ <= 0.5*bendRange_) throw cms::Exception("DigitalStub: Stub bend is out of assumed digitization range.")<<" |bend| = " < "<<0.5*bendRange_ < 0.001 || fabs(TB) > 0.3 || fabs(TC) > 0.25 || fabs(TD) > 0.005 || fabs(TE) > 0.01) { - nErr++; - cout<<"WARNING: DigitalStub lost precision: "< 0.001 || fabs(TB) > 0.3 || fabs(TC) > 0.25 || fabs(TD) > 0.005 || fabs(TE) > 0.01) { + nErr++; + cout << "WARNING: DigitalStub lost precision: " << TA << " " << TB << " " << TC << " " << TD << " " << TE + << endl; + } } } -} -} +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/DigitalTrack.cc b/L1Trigger/TrackFindingTMTT/src/DigitalTrack.cc index edba8bfc02355..54910475eda94 100644 --- a/L1Trigger/TrackFindingTMTT/src/DigitalTrack.cc +++ b/L1Trigger/TrackFindingTMTT/src/DigitalTrack.cc @@ -7,298 +7,347 @@ namespace TMTT { -//=== Note configuration parameters. - -DigitalTrack::DigitalTrack(const Settings* settings) : - - // Check DigitalTrack correctly initialized. - ranInit_ (false), - ranMake_ (false), - - // Digitization configuration parameters - settings_(settings), - - // Number of phi sectors and phi nonants. - numPhiSectors_ (settings->numPhiSectors()), - numPhiNonants_ (settings->numPhiNonants()), - // Phi sector and phi nonant width (radians) - phiSectorWidth_(2.*M_PI / float(numPhiSectors_)), - phiNonantWidth_(2.*M_PI / float(numPhiNonants_)), - // Radius from beamline with respect to which stub r coord. is measured. - chosenRofPhi_ (settings->chosenRofPhi()), - - // Number of q/Pt bins in Hough transform array. - nbinsPt_ ((int) settings->houghNbinsPt()), - invPtToDPhi_ (settings->invPtToDphi()) -{ -} - -//=== Get digitisation configuration parameters for the specific track fitter being used here. - -void DigitalTrack::getDigiCfg(const string& fitterName) { - if (fitterName == "SimpleLR") { - // SimpleLR track fitter - skipTrackDigi_ = settings_->slr_skipTrackDigi(); - oneOver2rBits_ = settings_->slr_oneOver2rBits(); - oneOver2rRange_ = settings_->slr_oneOver2rRange(); - d0Bits_ = settings_->slr_d0Bits(); - d0Range_ = settings_->slr_d0Range(); - phi0Bits_ = settings_->slr_phi0Bits(); - phi0Range_ = settings_->slr_phi0Range(); - z0Bits_ = settings_->slr_z0Bits(); - z0Range_ = settings_->slr_z0Range(); - tanLambdaBits_ = settings_->slr_tanlambdaBits(); - tanLambdaRange_ = settings_->slr_tanlambdaRange(); - chisquaredBits_ = settings_->slr_chisquaredBits(); - chisquaredRange_= settings_->slr_chisquaredRange(); - } else { - // KF track fitter - // Also used for all other fitters, though unlikely to be correct them them ... - if (fitterName == "KF4ParamsComb" || fitterName == "KF5ParamsComb" || fitterName == "KF4ParamsCombHLS") { - skipTrackDigi_ = settings_->kf_skipTrackDigi(); + //=== Note configuration parameters. + + DigitalTrack::DigitalTrack(const Settings* settings) + : + + // Check DigitalTrack correctly initialized. + ranInit_(false), + ranMake_(false), + + // Digitization configuration parameters + settings_(settings), + + // Number of phi sectors and phi nonants. + numPhiSectors_(settings->numPhiSectors()), + numPhiNonants_(settings->numPhiNonants()), + // Phi sector and phi nonant width (radians) + phiSectorWidth_(2. * M_PI / float(numPhiSectors_)), + phiNonantWidth_(2. * M_PI / float(numPhiNonants_)), + // Radius from beamline with respect to which stub r coord. is measured. + chosenRofPhi_(settings->chosenRofPhi()), + + // Number of q/Pt bins in Hough transform array. + nbinsPt_((int)settings->houghNbinsPt()), + invPtToDPhi_(settings->invPtToDphi()) {} + + //=== Get digitisation configuration parameters for the specific track fitter being used here. + + void DigitalTrack::getDigiCfg(const string& fitterName) { + if (fitterName == "SimpleLR") { + // SimpleLR track fitter + skipTrackDigi_ = settings_->slr_skipTrackDigi(); + oneOver2rBits_ = settings_->slr_oneOver2rBits(); + oneOver2rRange_ = settings_->slr_oneOver2rRange(); + d0Bits_ = settings_->slr_d0Bits(); + d0Range_ = settings_->slr_d0Range(); + phi0Bits_ = settings_->slr_phi0Bits(); + phi0Range_ = settings_->slr_phi0Range(); + z0Bits_ = settings_->slr_z0Bits(); + z0Range_ = settings_->slr_z0Range(); + tanLambdaBits_ = settings_->slr_tanlambdaBits(); + tanLambdaRange_ = settings_->slr_tanlambdaRange(); + chisquaredBits_ = settings_->slr_chisquaredBits(); + chisquaredRange_ = settings_->slr_chisquaredRange(); } else { - skipTrackDigi_ = settings_->other_skipTrackDigi(); // Allows to skip digitisation for other fitters + // KF track fitter + // Also used for all other fitters, though unlikely to be correct them them ... + if (fitterName == "KF4ParamsComb" || fitterName == "KF5ParamsComb" || fitterName == "KF4ParamsCombHLS") { + skipTrackDigi_ = settings_->kf_skipTrackDigi(); + } else { + skipTrackDigi_ = settings_->other_skipTrackDigi(); // Allows to skip digitisation for other fitters + } + oneOver2rBits_ = settings_->kf_oneOver2rBits(); + oneOver2rRange_ = settings_->kf_oneOver2rRange(); + d0Bits_ = settings_->kf_d0Bits(); + d0Range_ = settings_->kf_d0Range(); + phi0Bits_ = settings_->kf_phi0Bits(); + phi0Range_ = settings_->kf_phi0Range(); + z0Bits_ = settings_->kf_z0Bits(); + z0Range_ = settings_->kf_z0Range(); + tanLambdaBits_ = settings_->kf_tanlambdaBits(); + tanLambdaRange_ = settings_->kf_tanlambdaRange(); + chisquaredBits_ = settings_->kf_chisquaredBits(); + chisquaredRange_ = settings_->kf_chisquaredRange(); } - oneOver2rBits_ = settings_->kf_oneOver2rBits(); - oneOver2rRange_ = settings_->kf_oneOver2rRange(); - d0Bits_ = settings_->kf_d0Bits(); - d0Range_ = settings_->kf_d0Range(); - phi0Bits_ = settings_->kf_phi0Bits(); - phi0Range_ = settings_->kf_phi0Range(); - z0Bits_ = settings_->kf_z0Bits(); - z0Range_ = settings_->kf_z0Range(); - tanLambdaBits_ = settings_->kf_tanlambdaBits(); - tanLambdaRange_ = settings_->kf_tanlambdaRange(); - chisquaredBits_ = settings_->kf_chisquaredBits(); - chisquaredRange_= settings_->kf_chisquaredRange(); + + // Calculate multipliers to digitize the floating point numbers. + oneOver2rMult_ = pow(2., oneOver2rBits_) / oneOver2rRange_; + d0Mult_ = pow(2., d0Bits_) / d0Range_; + phi0Mult_ = pow(2., phi0Bits_) / phi0Range_; + z0Mult_ = pow(2., z0Bits_) / z0Range_; + tanLambdaMult_ = pow(2., tanLambdaBits_) / tanLambdaRange_; + chisquaredMult_ = pow(2., chisquaredBits_) / chisquaredRange_; } - // Calculate multipliers to digitize the floating point numbers. - oneOver2rMult_ = pow(2.,oneOver2rBits_)/oneOver2rRange_; - d0Mult_ = pow(2.,d0Bits_)/d0Range_; - phi0Mult_ = pow(2.,phi0Bits_)/phi0Range_; - z0Mult_ = pow(2.,z0Bits_)/z0Range_; - tanLambdaMult_ = pow(2.,tanLambdaBits_)/tanLambdaRange_; - chisquaredMult_= pow(2.,chisquaredBits_)/chisquaredRange_; -} - -//=== Initialize track with original, floating point track params - -void DigitalTrack::init(const string& fitterName, unsigned int nHelixParams, - unsigned int iPhiSec, unsigned int iEtaReg, int mbin, int cbin, int mBinhelix, int cBinhelix, - unsigned int hitPattern, - float qOverPt_orig, float d0_orig, float phi0_orig, float tanLambda_orig, float z0_orig, float chisquaredRphi_orig, float chisquaredRz_orig, - float qOverPt_bcon_orig, float phi0_bcon_orig, float chisquaredRphi_bcon_orig, // beam-spot constrained values. - unsigned int nLayers, bool consistent, bool consistentSect, bool accepted, - float tp_qOverPt, float tp_d0, float tp_phi0, float tp_tanLambda, float tp_z0, float tp_eta, - int tp_index, bool tp_useForAlgEff, bool tp_useForEff, int tp_pdgId) -{ - ranInit_ = true; // Note we ran init(). - - fitterName_ = fitterName; - nHelixParams_ = nHelixParams; - - // Get digitisation parameters for this particular track fitter. - this->getDigiCfg(fitterName); - - double phiCentreSec0 = -M_PI/float(numPhiNonants_) + M_PI/float(numPhiSectors_); - phiSectorCentre_ = phiSectorWidth_ * float(iPhiSec) + phiCentreSec0; - - // FIX: Remove this BODGE once BCHI increased to 11 in KFstate.h - if (chisquaredRphi_orig >= chisquaredRange_) chisquaredRphi_orig = chisquaredRange_ - 0.1; - if (chisquaredRphi_bcon_orig >= chisquaredRange_) chisquaredRphi_bcon_orig = chisquaredRange_ - 0.1; - - qOverPt_orig_ = qOverPt_orig; - oneOver2r_orig_ = qOverPt_orig*invPtToDPhi_; - d0_orig_ = d0_orig; - phi0_orig_ = phi0_orig; - phi0rel_orig_ = reco::deltaPhi(phi0_orig_, phiSectorCentre_); - tanLambda_orig_ = tanLambda_orig; - z0_orig_ = z0_orig; - chisquaredRphi_orig_ = chisquaredRphi_orig; - chisquaredRz_orig_ = chisquaredRz_orig; - - // Same again with beam-spot constraint. - qOverPt_bcon_orig_ = qOverPt_bcon_orig; - oneOver2r_bcon_orig_ = qOverPt_bcon_orig*invPtToDPhi_; - phi0_bcon_orig_ = phi0_bcon_orig; - phi0rel_bcon_orig_ = reco::deltaPhi(phi0_bcon_orig_, phiSectorCentre_); - chisquaredRphi_bcon_orig_= chisquaredRphi_bcon_orig; - - nlayers_ = nLayers; - iPhiSec_ = iPhiSec; - iEtaReg_ = iEtaReg; - mBin_ = mbin; - cBin_ = cbin; - mBinhelix_ = mBinhelix; - cBinhelix_ = cBinhelix; - hitPattern_ = hitPattern; - - consistent_ = consistent; - consistentSect_ = consistentSect; - accepted_ = accepted; - tp_tanLambda_ = tp_tanLambda; - tp_qoverpt_ = tp_qOverPt; - tp_pt_ = 1./(1.0e-6 + fabs(tp_qOverPt)); - tp_d0_ = tp_d0; - tp_eta_ = tp_eta; - tp_phi0_ = tp_phi0; - tp_z0_ = tp_z0; - tp_index_ = tp_index; - tp_useForAlgEff_ = tp_useForAlgEff; - tp_useForEff_ = tp_useForEff; - tp_pdgId_ = tp_pdgId; -} - -//=== Digitize track - -void DigitalTrack::makeDigitalTrack() { - - if (! ranInit_) throw cms::Exception("DigitalTrack: You forgot to call init() before makeDigitalTrack()!"); - - ranMake_ = true; // Note we ran makeDigitalTrack() - - if (skipTrackDigi_) { - // Optionally skip track digitisaton if done internally inside track fitting code, so - // retain original helix params. - iDigi_oneOver2r_ = 0; - iDigi_d0_ = 0; - iDigi_phi0rel_ = 0; - iDigi_tanLambda_ = 0; - iDigi_z0_ = 0; - iDigi_chisquaredRphi_ = 0; - iDigi_chisquaredRz_ = 0; - - iDigi_oneOver2r_bcon_ = 0; - iDigi_phi0rel_bcon_ = 0; - iDigi_chisquaredRphi_bcon_ = 0; - - oneOver2r_ = oneOver2r_orig_; - qOverPt_ = qOverPt_orig_; - d0_ = d0_orig_; - phi0rel_ = phi0rel_orig_; - phi0_ = phi0_orig_; - tanLambda_ = tanLambda_orig_; - z0_ = z0_orig_; - chisquaredRphi_ = chisquaredRphi_orig_; - chisquaredRz_ = chisquaredRz_orig_; + //=== Initialize track with original, floating point track params + + void DigitalTrack::init(const string& fitterName, + unsigned int nHelixParams, + unsigned int iPhiSec, + unsigned int iEtaReg, + int mbin, + int cbin, + int mBinhelix, + int cBinhelix, + unsigned int hitPattern, + float qOverPt_orig, + float d0_orig, + float phi0_orig, + float tanLambda_orig, + float z0_orig, + float chisquaredRphi_orig, + float chisquaredRz_orig, + float qOverPt_bcon_orig, + float phi0_bcon_orig, + float chisquaredRphi_bcon_orig, // beam-spot constrained values. + unsigned int nLayers, + bool consistent, + bool consistentSect, + bool accepted, + float tp_qOverPt, + float tp_d0, + float tp_phi0, + float tp_tanLambda, + float tp_z0, + float tp_eta, + int tp_index, + bool tp_useForAlgEff, + bool tp_useForEff, + int tp_pdgId) { + ranInit_ = true; // Note we ran init(). + + fitterName_ = fitterName; + nHelixParams_ = nHelixParams; + + // Get digitisation parameters for this particular track fitter. + this->getDigiCfg(fitterName); + + double phiCentreSec0 = -M_PI / float(numPhiNonants_) + M_PI / float(numPhiSectors_); + phiSectorCentre_ = phiSectorWidth_ * float(iPhiSec) + phiCentreSec0; + + // FIX: Remove this BODGE once BCHI increased to 11 in KFstate.h + if (chisquaredRphi_orig >= chisquaredRange_) + chisquaredRphi_orig = chisquaredRange_ - 0.1; + if (chisquaredRphi_bcon_orig >= chisquaredRange_) + chisquaredRphi_bcon_orig = chisquaredRange_ - 0.1; + + qOverPt_orig_ = qOverPt_orig; + oneOver2r_orig_ = qOverPt_orig * invPtToDPhi_; + d0_orig_ = d0_orig; + phi0_orig_ = phi0_orig; + phi0rel_orig_ = reco::deltaPhi(phi0_orig_, phiSectorCentre_); + tanLambda_orig_ = tanLambda_orig; + z0_orig_ = z0_orig; + chisquaredRphi_orig_ = chisquaredRphi_orig; + chisquaredRz_orig_ = chisquaredRz_orig; // Same again with beam-spot constraint. - oneOver2r_bcon_ = oneOver2r_bcon_orig_; - qOverPt_bcon_ = qOverPt_bcon_orig_; - phi0rel_bcon_ = phi0rel_bcon_orig_; - phi0_bcon_ = phi0_bcon_orig_; - chisquaredRphi_bcon_ = chisquaredRphi_bcon_orig_; - - } else { - - //--- Digitize variables - - iDigi_oneOver2r_ = floor(oneOver2r_orig_*oneOver2rMult_); - iDigi_d0_ = floor(d0_orig_*d0Mult_); - iDigi_phi0rel_ = floor(phi0rel_orig_*phi0Mult_); - iDigi_tanLambda_ = floor(tanLambda_orig_*tanLambdaMult_); - iDigi_z0_ = floor(z0_orig_*z0Mult_); - iDigi_chisquaredRphi_ = floor(chisquaredRphi_orig_*chisquaredMult_); - iDigi_chisquaredRz_ = floor(chisquaredRz_orig_*chisquaredMult_); - - // If fitted declared track invalid, it will have set its chi2 to very large number. - // So truncate it at maximum allowed by digitisation range. - if ( ! accepted_ ) { - iDigi_chisquaredRphi_ = pow(2.,chisquaredBits_) - 1; - iDigi_chisquaredRz_ = pow(2.,chisquaredBits_) - 1; - } + qOverPt_bcon_orig_ = qOverPt_bcon_orig; + oneOver2r_bcon_orig_ = qOverPt_bcon_orig * invPtToDPhi_; + phi0_bcon_orig_ = phi0_bcon_orig; + phi0rel_bcon_orig_ = reco::deltaPhi(phi0_bcon_orig_, phiSectorCentre_); + chisquaredRphi_bcon_orig_ = chisquaredRphi_bcon_orig; + + nlayers_ = nLayers; + iPhiSec_ = iPhiSec; + iEtaReg_ = iEtaReg; + mBin_ = mbin; + cBin_ = cbin; + mBinhelix_ = mBinhelix; + cBinhelix_ = cBinhelix; + hitPattern_ = hitPattern; + + consistent_ = consistent; + consistentSect_ = consistentSect; + accepted_ = accepted; + tp_tanLambda_ = tp_tanLambda; + tp_qoverpt_ = tp_qOverPt; + tp_pt_ = 1. / (1.0e-6 + fabs(tp_qOverPt)); + tp_d0_ = tp_d0; + tp_eta_ = tp_eta; + tp_phi0_ = tp_phi0; + tp_z0_ = tp_z0; + tp_index_ = tp_index; + tp_useForAlgEff_ = tp_useForAlgEff; + tp_useForEff_ = tp_useForEff; + tp_pdgId_ = tp_pdgId; + } - // Same again with beam-spot constraint. - iDigi_oneOver2r_bcon_ = floor(oneOver2r_bcon_orig_*oneOver2rMult_); - iDigi_phi0rel_bcon_ = floor(phi0rel_bcon_orig_*phi0Mult_); - iDigi_chisquaredRphi_bcon_ = floor(chisquaredRphi_bcon_orig_*chisquaredMult_); - if ( ! accepted_ ) iDigi_chisquaredRphi_bcon_ = pow(2.,chisquaredBits_) - 1; - - // if(settings_->digitizeSLR()){ - // mBinhelix_ = floor(iDigi_1over2r_/pow(2,5)); - // cBinhelix_ = floor(iDigi_phiT_/pow(2,7)); - // } - - //--- Determine floating point track params from digitized numbers (so with degraded resolution). - - oneOver2r_ = (iDigi_oneOver2r_ + 0.5)/oneOver2rMult_; - qOverPt_ = oneOver2r_/invPtToDPhi_; - if (nHelixParams_ == 5) { - d0_ = (iDigi_d0_ + 0.5)/d0Mult_; - } else { - d0_ = 0.; - } - phi0rel_ = (iDigi_phi0rel_ + 0.5)/phi0Mult_; - phi0_ = reco::deltaPhi(phi0rel_, -phiSectorCentre_); - tanLambda_ = (iDigi_tanLambda_ + 0.5)/tanLambdaMult_; - z0_ = (iDigi_z0_ + 0.5)/z0Mult_; - chisquaredRphi_ = (iDigi_chisquaredRphi_ + 0.5)/chisquaredMult_; - chisquaredRz_ = (iDigi_chisquaredRz_ + 0.5)/chisquaredMult_; + //=== Digitize track + + void DigitalTrack::makeDigitalTrack() { + if (!ranInit_) + throw cms::Exception("DigitalTrack: You forgot to call init() before makeDigitalTrack()!"); + + ranMake_ = true; // Note we ran makeDigitalTrack() + + if (skipTrackDigi_) { + // Optionally skip track digitisaton if done internally inside track fitting code, so + // retain original helix params. + iDigi_oneOver2r_ = 0; + iDigi_d0_ = 0; + iDigi_phi0rel_ = 0; + iDigi_tanLambda_ = 0; + iDigi_z0_ = 0; + iDigi_chisquaredRphi_ = 0; + iDigi_chisquaredRz_ = 0; + + iDigi_oneOver2r_bcon_ = 0; + iDigi_phi0rel_bcon_ = 0; + iDigi_chisquaredRphi_bcon_ = 0; + + oneOver2r_ = oneOver2r_orig_; + qOverPt_ = qOverPt_orig_; + d0_ = d0_orig_; + phi0rel_ = phi0rel_orig_; + phi0_ = phi0_orig_; + tanLambda_ = tanLambda_orig_; + z0_ = z0_orig_; + chisquaredRphi_ = chisquaredRphi_orig_; + chisquaredRz_ = chisquaredRz_orig_; + + // Same again with beam-spot constraint. + oneOver2r_bcon_ = oneOver2r_bcon_orig_; + qOverPt_bcon_ = qOverPt_bcon_orig_; + phi0rel_bcon_ = phi0rel_bcon_orig_; + phi0_bcon_ = phi0_bcon_orig_; + chisquaredRphi_bcon_ = chisquaredRphi_bcon_orig_; - // Same again with beam-spot constraint. - if (nHelixParams_ == 5) { - oneOver2r_bcon_ = (iDigi_oneOver2r_bcon_ + 0.5)/oneOver2rMult_; - qOverPt_bcon_ = oneOver2r_bcon_/invPtToDPhi_; - phi0rel_bcon_ = (iDigi_phi0rel_bcon_ + 0.5)/phi0Mult_; - phi0_bcon_ = reco::deltaPhi(phi0rel_bcon_, -phiSectorCentre_); - chisquaredRphi_bcon_ = (iDigi_chisquaredRphi_bcon_ + 0.5)/chisquaredMult_; } else { - oneOver2r_bcon_ = oneOver2r_; - qOverPt_bcon_ = qOverPt_; - phi0rel_bcon_ = phi0rel_; - phi0_bcon_ = phi0_; - chisquaredRphi_bcon_ = chisquaredRphi_; - } + //--- Digitize variables + + iDigi_oneOver2r_ = floor(oneOver2r_orig_ * oneOver2rMult_); + iDigi_d0_ = floor(d0_orig_ * d0Mult_); + iDigi_phi0rel_ = floor(phi0rel_orig_ * phi0Mult_); + iDigi_tanLambda_ = floor(tanLambda_orig_ * tanLambdaMult_); + iDigi_z0_ = floor(z0_orig_ * z0Mult_); + iDigi_chisquaredRphi_ = floor(chisquaredRphi_orig_ * chisquaredMult_); + iDigi_chisquaredRz_ = floor(chisquaredRz_orig_ * chisquaredMult_); + + // If fitted declared track invalid, it will have set its chi2 to very large number. + // So truncate it at maximum allowed by digitisation range. + if (!accepted_) { + iDigi_chisquaredRphi_ = pow(2., chisquaredBits_) - 1; + iDigi_chisquaredRz_ = pow(2., chisquaredBits_) - 1; + } - // Check that track coords. are within assumed digitization range. - this->checkInRange(); + // Same again with beam-spot constraint. + iDigi_oneOver2r_bcon_ = floor(oneOver2r_bcon_orig_ * oneOver2rMult_); + iDigi_phi0rel_bcon_ = floor(phi0rel_bcon_orig_ * phi0Mult_); + iDigi_chisquaredRphi_bcon_ = floor(chisquaredRphi_bcon_orig_ * chisquaredMult_); + if (!accepted_) + iDigi_chisquaredRphi_bcon_ = pow(2., chisquaredBits_) - 1; + + // if(settings_->digitizeSLR()){ + // mBinhelix_ = floor(iDigi_1over2r_/pow(2,5)); + // cBinhelix_ = floor(iDigi_phiT_/pow(2,7)); + // } + + //--- Determine floating point track params from digitized numbers (so with degraded resolution). + + oneOver2r_ = (iDigi_oneOver2r_ + 0.5) / oneOver2rMult_; + qOverPt_ = oneOver2r_ / invPtToDPhi_; + if (nHelixParams_ == 5) { + d0_ = (iDigi_d0_ + 0.5) / d0Mult_; + } else { + d0_ = 0.; + } + phi0rel_ = (iDigi_phi0rel_ + 0.5) / phi0Mult_; + phi0_ = reco::deltaPhi(phi0rel_, -phiSectorCentre_); + tanLambda_ = (iDigi_tanLambda_ + 0.5) / tanLambdaMult_; + z0_ = (iDigi_z0_ + 0.5) / z0Mult_; + chisquaredRphi_ = (iDigi_chisquaredRphi_ + 0.5) / chisquaredMult_; + chisquaredRz_ = (iDigi_chisquaredRz_ + 0.5) / chisquaredMult_; + + // Same again with beam-spot constraint. + if (nHelixParams_ == 5) { + oneOver2r_bcon_ = (iDigi_oneOver2r_bcon_ + 0.5) / oneOver2rMult_; + qOverPt_bcon_ = oneOver2r_bcon_ / invPtToDPhi_; + phi0rel_bcon_ = (iDigi_phi0rel_bcon_ + 0.5) / phi0Mult_; + phi0_bcon_ = reco::deltaPhi(phi0rel_bcon_, -phiSectorCentre_); + chisquaredRphi_bcon_ = (iDigi_chisquaredRphi_bcon_ + 0.5) / chisquaredMult_; + } else { + oneOver2r_bcon_ = oneOver2r_; + qOverPt_bcon_ = qOverPt_; + phi0rel_bcon_ = phi0rel_; + phi0_bcon_ = phi0_; + chisquaredRphi_bcon_ = chisquaredRphi_; + } - // Check that digitization followed by undigitization doesn't change results too much. - this->checkAccuracy(); + // Check that track coords. are within assumed digitization range. + this->checkInRange(); + + // Check that digitization followed by undigitization doesn't change results too much. + this->checkAccuracy(); + } } -} - -//=== Check that stub coords. are within assumed digitization range. - -void DigitalTrack::checkInRange() const { - if (accepted_) { // Don't bother apply to tracks rejected by the fitter. - if (fabs(oneOver2r_orig_) >= 0.5*oneOver2rRange_) throw cms::Exception("DigitalTrack: Track oneOver2r is out of assumed digitization range.")<<" |oneOver2r| = " < "<<0.5*oneOver2rRange_<<"; Fitter="< "<<0.5*phi0Range_<<"; Fitter="< "<<0.5*z0Range_<<"; Fitter="< "<<0.5*d0Range_<<"; Fitter="< "<<0.5*tanLambdaRange_<<"; Fitter="< "< "< " << 0.5 * oneOver2rRange_ + << "; Fitter=" << fitterName_ << "; track accepted = " << accepted_ << endl; + if (consistentSect_) { // don't bother if track will fail sector consistency cut. + if (fabs(phi0rel_orig_) >= 0.5 * phi0Range_) + throw cms::Exception("DigitalTrack: Track phi0rel is out of assumed digitization range.") + << " |phi0rel| = " << fabs(phi0rel_orig_) << " > " << 0.5 * phi0Range_ << "; Fitter=" << fitterName_ + << "; track accepted = " << accepted_ << endl; + } + if (fabs(z0_orig_) >= 0.5 * z0Range_) + throw cms::Exception("DigitalTrack: Track z0 is out of assumed digitization range.") + << " |z0| = " << fabs(z0_orig_) << " > " << 0.5 * z0Range_ << "; Fitter=" << fitterName_ + << "; track accepted = " << accepted_ << endl; + if (fabs(d0_orig_) >= 0.5 * d0Range_) + throw cms::Exception("DigitalTrack: Track d0 is out of assumed digitization range.") + << " |d0| = " << fabs(d0_orig_) << " > " << 0.5 * d0Range_ << "; Fitter=" << fitterName_ + << "; track accepted = " << accepted_ << endl; + if (fabs(tanLambda_orig_) >= 0.5 * tanLambdaRange_) + throw cms::Exception("DigitalTrack: Track tanLambda is out of assumed digitization range.") + << " |tanLambda| = " << fabs(tanLambda_orig_) << " > " << 0.5 * tanLambdaRange_ + << "; Fitter=" << fitterName_ << "; track accepted = " << accepted_ << endl; + if (accepted_) { // Tracks declared invalid by fitter can have very large original chi2. + if (chisquaredRphi_orig_ >= chisquaredRange_ or chisquaredRphi_orig_ < 0.) + throw cms::Exception("DigitalTrack: Track chisquaredRphi is out of assumed digitization range.") + << " chisquaredRphi = " << chisquaredRphi_orig_ << " > " << chisquaredRange_ << " or < 0" + << "; Fitter=" << fitterName_ << "; track accepted = " << accepted_ << endl; + if (chisquaredRz_orig_ >= chisquaredRange_ or chisquaredRz_orig_ < 0.) + throw cms::Exception("DigitalTrack: Track chisquaredRz is out of assumed digitization range.") + << " chisquaredRz = " << chisquaredRz_orig_ << " > " << chisquaredRange_ << " or < 0" + << "; Fitter=" << fitterName_ << "; track accepted = " << accepted_ << endl; + } } } -} - -//=== Check that digitisation followed by undigitisation doesn't change significantly the stub coordinates. - -void DigitalTrack::checkAccuracy() const { - if (accepted_) { // Don't bother apply to tracks rejected by the fitter. - float TA = qOverPt_- qOverPt_orig_; - float TB = reco::deltaPhi(phi0_, phi0_orig_); - float TC = z0_ - z0_orig_; - float TD = tanLambda_ - tanLambda_orig_; - float TE = d0_ - d0_orig_; - float TF = chisquaredRphi_ - chisquaredRphi_orig_; - float TG = chisquaredRz_ - chisquaredRz_orig_; - - static map nErr; // Count precision errors from each fitter. - if (nErr.find(fitterName_) == nErr.end()) nErr[fitterName_] = 0; // Initialize error count. - const unsigned int maxErr = 20; // Print error message only this number of times. - if (nErr[fitterName_] < maxErr) { - if (fabs(TA) > 0.01 || fabs(TB) > 0.001 || fabs(TC) > 0.05 || fabs(TD) > 0.002 || fabs(TE) > 0.05 || fabs(TF) > 0.5 || fabs(TG) > 0.5) { - nErr[fitterName_]++; - cout<<"WARNING: DigitalTrack lost precision: "< nErr; // Count precision errors from each fitter. + if (nErr.find(fitterName_) == nErr.end()) + nErr[fitterName_] = 0; // Initialize error count. + const unsigned int maxErr = 20; // Print error message only this number of times. + if (nErr[fitterName_] < maxErr) { + if (fabs(TA) > 0.01 || fabs(TB) > 0.001 || fabs(TC) > 0.05 || fabs(TD) > 0.002 || fabs(TE) > 0.05 || + fabs(TF) > 0.5 || fabs(TG) > 0.5) { + nErr[fitterName_]++; + cout << "WARNING: DigitalTrack lost precision: " << fitterName_ << " accepted=" << accepted_ << " " << TA + << " " << TB << " " << TC << " " << TD << " " << TE << " " << TF << " " << TG << endl; + } } } } -} -} +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/Get3Dtracks.cc b/L1Trigger/TrackFindingTMTT/src/Get3Dtracks.cc index 2201af0158582..e7dc3e1511b83 100644 --- a/L1Trigger/TrackFindingTMTT/src/Get3Dtracks.cc +++ b/L1Trigger/TrackFindingTMTT/src/Get3Dtracks.cc @@ -9,117 +9,128 @@ using namespace std; namespace TMTT { -class Settings; - -//=== Initialization - -void Get3Dtracks::init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, - float etaMinSector, float etaMaxSector, float phiCentreSector) { - - // Store config params & arguments. - settings_ = settings; - iPhiSec_ = iPhiSec; // Sector number - iEtaReg_ = iEtaReg; - etaMinSector_ = etaMinSector; // Range of eta sector - etaMaxSector_ = etaMaxSector; // Range of eta sector - phiCentreSector_ = phiCentreSector; // Centre of phi sector - - // Note if any fitters require an r-z track filter to be run. - runRZfilter_ = (settings->useRZfilter().size() > 0); - - // Initialize any track filters (e.g. r-z) run after the r-phi Hough transform. - if (runRZfilter_) rzFilter_.init(settings_, iPhiSec_, iEtaReg_, etaMinSector_, etaMaxSector_, phiCentreSector_); -} - -//=== Convert 2D tracks found by HT within the current sector to 3D tracks, without running any r-z track filter. -//=== by adding a rough estimate of their r-z helix parameters. - -void Get3Dtracks::makeUnfilteredTrks(const vector& vecTracksRphi) { - - vecTracks3D_unfiltered_.clear(); - - for (const L1track2D& trkRphi : vecTracksRphi) { - const vector& stubsOnTrkRphi = trkRphi.getStubs(); // stubs assigned to track - - float qOverPt = trkRphi.getHelix2D().first; - float phi0 = trkRphi.getHelix2D().second; - - if (settings_->enableDigitize()) { - // Centre of HT bin lies on boundary of two fitted track digi bins, so nudge slightly +ve (like FW) - // to remove ambiguity. - const float small = 0.1; - const unsigned int nHelixBits = 18; // Bits used internally in KF HLS to represent helix params. - qOverPt += (2./settings_->invPtToInvR()) * - small*settings_->kf_oneOver2rRange()/pow(2., nHelixBits); - phi0 += small*settings_->kf_phi0Range() /pow(2., nHelixBits); - } - pair helixRphi(qOverPt, phi0); - - // Estimate r-z track helix parameters from centre of eta sector. - float z0 = 0.; - float tan_lambda = 0.5*(1/tan(2*atan(exp(-etaMinSector_))) + 1/tan(2*atan(exp(-etaMaxSector_)))); + class Settings; + + //=== Initialization + + void Get3Dtracks::init(const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float etaMinSector, + float etaMaxSector, + float phiCentreSector) { + // Store config params & arguments. + settings_ = settings; + iPhiSec_ = iPhiSec; // Sector number + iEtaReg_ = iEtaReg; + etaMinSector_ = etaMinSector; // Range of eta sector + etaMaxSector_ = etaMaxSector; // Range of eta sector + phiCentreSector_ = phiCentreSector; // Centre of phi sector + + // Note if any fitters require an r-z track filter to be run. + runRZfilter_ = (settings->useRZfilter().size() > 0); + + // Initialize any track filters (e.g. r-z) run after the r-phi Hough transform. + if (runRZfilter_) + rzFilter_.init(settings_, iPhiSec_, iEtaReg_, etaMinSector_, etaMaxSector_, phiCentreSector_); + } - // float etaCentreSector = 0.5*(etaMinSector_ + etaMaxSector_); - // float theta = 2. * atan(exp(-etaCentreSector)); - // tan_lambda = 1./tan(theta); + //=== Convert 2D tracks found by HT within the current sector to 3D tracks, without running any r-z track filter. + //=== by adding a rough estimate of their r-z helix parameters. + + void Get3Dtracks::makeUnfilteredTrks(const vector& vecTracksRphi) { + vecTracks3D_unfiltered_.clear(); + + for (const L1track2D& trkRphi : vecTracksRphi) { + const vector& stubsOnTrkRphi = trkRphi.getStubs(); // stubs assigned to track + + float qOverPt = trkRphi.getHelix2D().first; + float phi0 = trkRphi.getHelix2D().second; + + if (settings_->enableDigitize()) { + // Centre of HT bin lies on boundary of two fitted track digi bins, so nudge slightly +ve (like FW) + // to remove ambiguity. + const float small = 0.1; + const unsigned int nHelixBits = 18; // Bits used internally in KF HLS to represent helix params. + qOverPt += (2. / settings_->invPtToInvR()) * small * settings_->kf_oneOver2rRange() / pow(2., nHelixBits); + phi0 += small * settings_->kf_phi0Range() / pow(2., nHelixBits); + } + pair helixRphi(qOverPt, phi0); + + // Estimate r-z track helix parameters from centre of eta sector. + float z0 = 0.; + float tan_lambda = 0.5 * (1 / tan(2 * atan(exp(-etaMinSector_))) + 1 / tan(2 * atan(exp(-etaMaxSector_)))); + + // float etaCentreSector = 0.5*(etaMinSector_ + etaMaxSector_); + // float theta = 2. * atan(exp(-etaCentreSector)); + // tan_lambda = 1./tan(theta); + + pair helixRz(z0, tan_lambda); + + // Create 3D track, by adding r-z helix params to 2D track + L1track3D trk3D(settings_, + stubsOnTrkRphi, + trkRphi.getCellLocationHT(), + helixRphi, + helixRz, + iPhiSec_, + iEtaReg_, + trkRphi.optoLinkID(), + trkRphi.mergedHTcell()); + // L1track3D trk3D(settings_, stubsOnTrkRphi, + // trkRphi.getCellLocationHT(), trkRphi.getHelix2D(), helixRz, + // iPhiSec_ , iEtaReg_ , trkRphi.optoLinkID(), trkRphi.mergedHTcell()); + + // Optionally use MC truth to eliminate all fake tracks & all incorrect stubs assigned to tracks + // before doing fit (for debugging). + bool cheat_keep = true; + if (settings_->trackFitCheat()) + cheat_keep = trk3D.cheat(); + + // Add to list of stored 3D tracks. + if (cheat_keep) + vecTracks3D_unfiltered_.push_back(trk3D); + } + } - pair helixRz(z0, tan_lambda); + //=== Make 3D tracks from the 2D tracks found by the HT within the current sector, by running the r-z track filter. + //=== The r-z filter also adds an estimate of the r-z helix parameters to each track. - // Create 3D track, by adding r-z helix params to 2D track - L1track3D trk3D(settings_, stubsOnTrkRphi, - trkRphi.getCellLocationHT(), helixRphi, helixRz, - iPhiSec_ , iEtaReg_ , trkRphi.optoLinkID(), trkRphi.mergedHTcell()); - // L1track3D trk3D(settings_, stubsOnTrkRphi, - // trkRphi.getCellLocationHT(), trkRphi.getHelix2D(), helixRz, - // iPhiSec_ , iEtaReg_ , trkRphi.optoLinkID(), trkRphi.mergedHTcell()); + void Get3Dtracks::makeRZfilteredTrks(const vector& vecTracksRphi) { + vecTracks3D_rzFiltered_ = rzFilter_.filterTracks(vecTracksRphi); - // Optionally use MC truth to eliminate all fake tracks & all incorrect stubs assigned to tracks + // Optionally use MC truth to eliminate all fake tracks & all incorrect stubs assigned to tracks // before doing fit (for debugging). - bool cheat_keep = true; - if (settings_->trackFitCheat()) cheat_keep = trk3D.cheat(); - - // Add to list of stored 3D tracks. - if (cheat_keep) vecTracks3D_unfiltered_.push_back( trk3D ); - } -} - -//=== Make 3D tracks from the 2D tracks found by the HT within the current sector, by running the r-z track filter. -//=== The r-z filter also adds an estimate of the r-z helix parameters to each track. - -void Get3Dtracks::makeRZfilteredTrks(const vector& vecTracksRphi) { - vecTracks3D_rzFiltered_ = rzFilter_.filterTracks(vecTracksRphi); - - // Optionally use MC truth to eliminate all fake tracks & all incorrect stubs assigned to tracks - // before doing fit (for debugging). - if (settings_->trackFitCheat()) { - vector vecTracks3D_tmp; - for (const L1track3D& trk : vecTracks3D_rzFiltered_) { - L1track3D trk_tmp = trk; - bool cheat_keep = trk_tmp.cheat(); - if (cheat_keep) vecTracks3D_tmp.push_back(trk_tmp); + if (settings_->trackFitCheat()) { + vector vecTracks3D_tmp; + for (const L1track3D& trk : vecTracks3D_rzFiltered_) { + L1track3D trk_tmp = trk; + bool cheat_keep = trk_tmp.cheat(); + if (cheat_keep) + vecTracks3D_tmp.push_back(trk_tmp); + } + vecTracks3D_rzFiltered_ = vecTracks3D_tmp; } - vecTracks3D_rzFiltered_ = vecTracks3D_tmp; } -} - -//=== Get all 3D track candidates (either r-z filtered on unfiltered, depending on the boolean), -//=== that are associated to the given tracking particle. -//=== (If the vector is empty, then the tracking particle was not reconstructed in this sector). -vector Get3Dtracks::assocTrackCands3D(const TP& tp, bool rzFiltered) const { + //=== Get all 3D track candidates (either r-z filtered on unfiltered, depending on the boolean), + //=== that are associated to the given tracking particle. + //=== (If the vector is empty, then the tracking particle was not reconstructed in this sector). - const vector& allTracks3D = (rzFiltered) ? vecTracks3D_rzFiltered_ : vecTracks3D_unfiltered_; + vector Get3Dtracks::assocTrackCands3D(const TP& tp, bool rzFiltered) const { + const vector& allTracks3D = (rzFiltered) ? vecTracks3D_rzFiltered_ : vecTracks3D_unfiltered_; - vector assocRecoTrk; + vector assocRecoTrk; - // Loop over track candidates, looking for those associated to given TP. - for (const L1track3D& trk : allTracks3D) { - if (trk.getMatchedTP() != nullptr) { - if (trk.getMatchedTP()->index() == tp.index()) assocRecoTrk.push_back(&trk); + // Loop over track candidates, looking for those associated to given TP. + for (const L1track3D& trk : allTracks3D) { + if (trk.getMatchedTP() != nullptr) { + if (trk.getMatchedTP()->index() == tp.index()) + assocRecoTrk.push_back(&trk); + } } - } - return assocRecoTrk; -} + return assocRecoTrk; + } -} +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/HTbase.cc b/L1Trigger/TrackFindingTMTT/src/HTbase.cc index e1e9b31d3cba2..34a3aae6d720d 100644 --- a/L1Trigger/TrackFindingTMTT/src/HTbase.cc +++ b/L1Trigger/TrackFindingTMTT/src/HTbase.cc @@ -11,242 +11,249 @@ using namespace std; namespace TMTT { -//=== Termination. Causes HT array to search for tracks etc. + //=== Termination. Causes HT array to search for tracks etc. -void HTbase::end() { - - // Calculate useful info about each cell in array. - for (unsigned int i = 0; i < htArray_.size1(); i++) { - for (unsigned int j = 0; j < htArray_.size2(); j++) { - htArray_(i,j).end(); // Calls HTcell::end() + void HTbase::end() { + // Calculate useful info about each cell in array. + for (unsigned int i = 0; i < htArray_.size1(); i++) { + for (unsigned int j = 0; j < htArray_.size2(); j++) { + htArray_(i, j).end(); // Calls HTcell::end() + } } - } - - // Produce a list of all track candidates found in this array, each containing all the stubs on each one - // and the track helix parameters, plus the associated truth particle (if any). - trackCands2D_ = this->calcTrackCands2D(); - // Run algorithm to kill duplicate tracks (e.g. those sharing many hits in common). - trackCands2D_ = killDupTrks_.filter( trackCands2D_ ); + // Produce a list of all track candidates found in this array, each containing all the stubs on each one + // and the track helix parameters, plus the associated truth particle (if any). + trackCands2D_ = this->calcTrackCands2D(); - // If requested, kill those tracks in this sector that can't be read out during the time-multiplexed period, because - // the HT has associated too many stubs to tracks. - if (settings_->busySectorKill()) { - trackCands2D_ = this->killTracksBusySec( trackCands2D_ ); - } -} - -//=== Number of filtered stubs in each cell summed over all cells in HT array. -//=== If a stub appears in multiple cells, it will be counted multiple times. -unsigned int HTbase::numStubsInc() const { + // Run algorithm to kill duplicate tracks (e.g. those sharing many hits in common). + trackCands2D_ = killDupTrks_.filter(trackCands2D_); - unsigned int nStubs = 0; - - // Loop over cells in HT array. - for (unsigned int i = 0; i < htArray_.size1(); i++) { - for (unsigned int j = 0; j < htArray_.size2(); j++) { - nStubs += htArray_(i,j).numStubs(); // Calls HTcell::numStubs() + // If requested, kill those tracks in this sector that can't be read out during the time-multiplexed period, because + // the HT has associated too many stubs to tracks. + if (settings_->busySectorKill()) { + trackCands2D_ = this->killTracksBusySec(trackCands2D_); } } - return nStubs; -} + //=== Number of filtered stubs in each cell summed over all cells in HT array. + //=== If a stub appears in multiple cells, it will be counted multiple times. + unsigned int HTbase::numStubsInc() const { + unsigned int nStubs = 0; -//=== Number of filtered stubs in HT array. -//=== If a stub appears in multiple cells, it will be counted only once. -unsigned int HTbase::numStubsExc() const { + // Loop over cells in HT array. + for (unsigned int i = 0; i < htArray_.size1(); i++) { + for (unsigned int j = 0; j < htArray_.size2(); j++) { + nStubs += htArray_(i, j).numStubs(); // Calls HTcell::numStubs() + } + } - unordered_set stubIDs; // Each ID stored only once, no matter how often it is added. + return nStubs; + } - // Loop over cells in HT array. - for (unsigned int i = 0; i < htArray_.size1(); i++) { - for (unsigned int j = 0; j < htArray_.size2(); j++) { - // Loop over stubs in each cells, storing their IDs. - const vector& vStubs = htArray_(i,j).stubs(); // Calls HTcell::stubs() - for (const Stub* stub : vStubs) { - stubIDs.insert( stub->index() ); + //=== Number of filtered stubs in HT array. + //=== If a stub appears in multiple cells, it will be counted only once. + unsigned int HTbase::numStubsExc() const { + unordered_set stubIDs; // Each ID stored only once, no matter how often it is added. + + // Loop over cells in HT array. + for (unsigned int i = 0; i < htArray_.size1(); i++) { + for (unsigned int j = 0; j < htArray_.size2(); j++) { + // Loop over stubs in each cells, storing their IDs. + const vector& vStubs = htArray_(i, j).stubs(); // Calls HTcell::stubs() + for (const Stub* stub : vStubs) { + stubIDs.insert(stub->index()); + } } } - } - return stubIDs.size(); -} + return stubIDs.size(); + } -//=== Get number of filtered stubs assigned to track candidates found in this HT array. + //=== Get number of filtered stubs assigned to track candidates found in this HT array. -unsigned int HTbase::numStubsOnTrackCands2D() const { + unsigned int HTbase::numStubsOnTrackCands2D() const { + unsigned int nStubs = 0; - unsigned int nStubs = 0; + // Loop over track candidates + for (const L1track2D& trk : trackCands2D_) { + nStubs += trk.getStubs().size(); + } - // Loop over track candidates - for (const L1track2D& trk : trackCands2D_) { - nStubs += trk.getStubs().size(); + return nStubs; } - return nStubs; -} - -//=== Get all reconstructed tracks that were associated to the given tracking particle. -//=== (If the vector is empty, then the tracking particle was not reconstructed in this sector). + //=== Get all reconstructed tracks that were associated to the given tracking particle. + //=== (If the vector is empty, then the tracking particle was not reconstructed in this sector). -vector HTbase::assocTrackCands2D(const TP& tp) const { + vector HTbase::assocTrackCands2D(const TP& tp) const { + vector assocRecoTrk; - vector assocRecoTrk; + // Loop over track candidates, looking for those associated to given TP. + for (const L1track2D& trk : trackCands2D_) { + if (trk.getMatchedTP() != nullptr) { + if (trk.getMatchedTP()->index() == tp.index()) + assocRecoTrk.push_back(&trk); + } + } - // Loop over track candidates, looking for those associated to given TP. - for (const L1track2D& trk : trackCands2D_) { - if (trk.getMatchedTP() != nullptr) { - if (trk.getMatchedTP()->index() == tp.index()) assocRecoTrk.push_back(&trk); - } + return assocRecoTrk; } - return assocRecoTrk; -} + //=== Function to replace the collection of 2D tracks found by this HT. + //=== (This is used by class MuxHToutputs to kill tracks that can't be output in the time-multiplexed period). -//=== Function to replace the collection of 2D tracks found by this HT. -//=== (This is used by class MuxHToutputs to kill tracks that can't be output in the time-multiplexed period). - -void HTbase::replaceTrackCands2D(const vector& newTracks) { - vector tmpTracks; - for (const L1track2D* trk : newTracks) { - tmpTracks.push_back(*trk); + void HTbase::replaceTrackCands2D(const vector& newTracks) { + vector tmpTracks; + for (const L1track2D* trk : newTracks) { + tmpTracks.push_back(*trk); + } + trackCands2D_.clear(); + trackCands2D_ = tmpTracks; } - trackCands2D_.clear(); - trackCands2D_ = tmpTracks; -} -//=== Disable filters (used for debugging). + //=== Disable filters (used for debugging). -void HTbase::disableBendFilter() { - // Loop over cells in HT array. - for (unsigned int i = 0; i < htArray_.size1(); i++) { - for (unsigned int j = 0; j < htArray_.size2(); j++) { - htArray_(i,j).disableBendFilter(); - } - } -} - -//=== Given a range in one of the coordinates specified by coordRange, calculate the corresponding range of bins. The other arguments specify the axis. And also if some cells nominally associated to stub are to be killed. - -pair HTbase::convertCoordRangeToBinRange( pair coordRange, unsigned int nBinsAxis, float coordAxisMin, float coordAxisBinSize, unsigned int killSomeHTcells, bool debug) const { - - float coordMin = coordRange.first; - float coordMax = coordRange.second; - float coordAvg = ( coordRange.first + coordRange.second ) / 2.; - - int iCoordBinMin, iCoordBinMax; - - //--- There are various options for doing this. - //--- Option killSomeHTcells = 0 is the obvious one. - //--- If killSomeHTcells > 0, then some of the cells nominally associated with the stub are killed. - - if (killSomeHTcells == 0) { - // Take the full range of phi bins consistent with the stub. - iCoordBinMin = floor( ( coordMin - coordAxisMin ) / coordAxisBinSize ); - iCoordBinMax = floor( ( coordMax - coordAxisMin ) / coordAxisBinSize ); - } else if (killSomeHTcells == 1) { - // Use the reduced range of bins. - // This algorithm, proposed by Ian, should reduce the rate, at the cost of some efficiency. - const float fracCut = 0.3; - iCoordBinMin = floor( ( coordMin - coordAxisMin ) / coordAxisBinSize ); - iCoordBinMax = floor( ( coordMax - coordAxisMin ) / coordAxisBinSize ); - unsigned int nbins = iCoordBinMax - iCoordBinMin + 1; - if (nbins >= 2) { // Can't reduce range if already only 1 bin - float lower = coordAxisMin + (iCoordBinMin + 1) * coordAxisBinSize; // upper edge of lowest bin - float upper = coordAxisMin + (iCoordBinMax ) * coordAxisBinSize; // lower edge of highest bin. - // Calculate fractional amount of min and max bin that this stub uses. - float extraLow = (lower - coordMin) / coordAxisBinSize; - float extraUp = (coordMax - upper) / coordAxisBinSize; - if (min(extraLow,extraUp) < -0.001 || max(extraLow, extraUp) > 1.001) cout<<"THIS SHOULD NOT HAPPEN "<= 3 || extraLow < extraUp)) iCoordBinMin += 1; - if (extraUp < fracCut && (nbins >= 3 || extraUp < extraLow)) iCoordBinMax -= 1; + void HTbase::disableBendFilter() { + // Loop over cells in HT array. + for (unsigned int i = 0; i < htArray_.size1(); i++) { + for (unsigned int j = 0; j < htArray_.size2(); j++) { + htArray_(i, j).disableBendFilter(); + } } - } else if ( killSomeHTcells == 2 ) { - // This corresponds to Thomas's firmware implementation, which can't fill more than one HT cell per column. - iCoordBinMin = floor( ( coordAvg - coordAxisMin ) / coordAxisBinSize ); - iCoordBinMax = iCoordBinMin; - } else { - throw cms::Exception("HT: invalid HoughUseFullRange option in cfg"); } - if (debug) cout<<"Initial Coord range: "< HTbase::convertCoordRangeToBinRange(pair coordRange, + unsigned int nBinsAxis, + float coordAxisMin, + float coordAxisBinSize, + unsigned int killSomeHTcells, + bool debug) const { + float coordMin = coordRange.first; + float coordMax = coordRange.second; + float coordAvg = (coordRange.first + coordRange.second) / 2.; + + int iCoordBinMin, iCoordBinMax; + + //--- There are various options for doing this. + //--- Option killSomeHTcells = 0 is the obvious one. + //--- If killSomeHTcells > 0, then some of the cells nominally associated with the stub are killed. + + if (killSomeHTcells == 0) { + // Take the full range of phi bins consistent with the stub. + iCoordBinMin = floor((coordMin - coordAxisMin) / coordAxisBinSize); + iCoordBinMax = floor((coordMax - coordAxisMin) / coordAxisBinSize); + } else if (killSomeHTcells == 1) { + // Use the reduced range of bins. + // This algorithm, proposed by Ian, should reduce the rate, at the cost of some efficiency. + const float fracCut = 0.3; + iCoordBinMin = floor((coordMin - coordAxisMin) / coordAxisBinSize); + iCoordBinMax = floor((coordMax - coordAxisMin) / coordAxisBinSize); + unsigned int nbins = iCoordBinMax - iCoordBinMin + 1; + if (nbins >= 2) { // Can't reduce range if already only 1 bin + float lower = coordAxisMin + (iCoordBinMin + 1) * coordAxisBinSize; // upper edge of lowest bin + float upper = coordAxisMin + (iCoordBinMax)*coordAxisBinSize; // lower edge of highest bin. + // Calculate fractional amount of min and max bin that this stub uses. + float extraLow = (lower - coordMin) / coordAxisBinSize; + float extraUp = (coordMax - upper) / coordAxisBinSize; + if (min(extraLow, extraUp) < -0.001 || max(extraLow, extraUp) > 1.001) + cout << "THIS SHOULD NOT HAPPEN " << extraLow + << endl; // allowing 0.001 tolerance for floating point precision here. + if (extraLow < fracCut && (nbins >= 3 || extraLow < extraUp)) + iCoordBinMin += 1; + if (extraUp < fracCut && (nbins >= 3 || extraUp < extraLow)) + iCoordBinMax -= 1; + } + } else if (killSomeHTcells == 2) { + // This corresponds to Thomas's firmware implementation, which can't fill more than one HT cell per column. + iCoordBinMin = floor((coordAvg - coordAxisMin) / coordAxisBinSize); + iCoordBinMax = iCoordBinMin; + } else { + throw cms::Exception("HT: invalid HoughUseFullRange option in cfg"); + } - // Limit range to dimensions of HT array. - iCoordBinMin = max(iCoordBinMin, 0); - iCoordBinMax = min(iCoordBinMax, int(nBinsAxis) - 1); + if (debug) + cout << "Initial Coord range: " << coordMin << " " << coordMax << " " << iCoordBinMin << " " << iCoordBinMax + << endl; - if (debug) { - float downPhiLim = coordAxisMin + iCoordBinMin * coordAxisBinSize; - float upPhiLim = coordAxisMin + (iCoordBinMax + 1) * coordAxisBinSize; - cout<<"Final Coord range: "< max. - if (iCoordBinMin > int(nBinsAxis) - 1 || iCoordBinMax < 0) { - iCoordBinMin = int(nBinsAxis) - 1; - iCoordBinMax = 0; - } - - return pair(iCoordBinMin, iCoordBinMax); -} + if (debug) { + float downPhiLim = coordAxisMin + iCoordBinMin * coordAxisBinSize; + float upPhiLim = coordAxisMin + (iCoordBinMax + 1) * coordAxisBinSize; + cout << "Final Coord range: " << downPhiLim << " " << upPhiLim << " " << iCoordBinMin << " " << iCoordBinMax + << endl; + } -//=== Return a list of all track candidates found in this array, giving access to all the stubs on each one -//=== and the track helix parameters, plus the associated truth particle (if any). + // If whole range is outside HT array, flag this by setting range to specific values with min > max. + if (iCoordBinMin > int(nBinsAxis) - 1 || iCoordBinMax < 0) { + iCoordBinMin = int(nBinsAxis) - 1; + iCoordBinMax = 0; + } -vector HTbase::calcTrackCands2D() const { + return pair(iCoordBinMin, iCoordBinMax); + } - vector trackCands2D; + //=== Return a list of all track candidates found in this array, giving access to all the stubs on each one + //=== and the track helix parameters, plus the associated truth particle (if any). - if (settings_->debug() == 3) cout<<"Printing track candidates in an HT array"< HTbase::calcTrackCands2D() const { + vector trackCands2D; - const unsigned int numRows = htArray_.size1(); - const unsigned int numCols = htArray_.size2(); + if (settings_->debug() == 3) + cout << "Printing track candidates in an HT array" << endl; - // Check if the hardware processes rows of the HT array in a specific order when outputting track candidates. - // Currently this is by decreasing Pt for r-phi HT and unordered for r-z HT. - const vector iOrder = this->rowOrder(numRows); - bool wantOrdering = (iOrder.size() > 0); + const unsigned int numRows = htArray_.size1(); + const unsigned int numCols = htArray_.size2(); - unsigned int numStubsLeft = 0; - unsigned int numStubsRight = 0; + // Check if the hardware processes rows of the HT array in a specific order when outputting track candidates. + // Currently this is by decreasing Pt for r-phi HT and unordered for r-z HT. + const vector iOrder = this->rowOrder(numRows); + bool wantOrdering = (iOrder.size() > 0); - // Loop over cells in HT array. - for (unsigned int i = 0; i < numRows; i++) { + unsigned int numStubsLeft = 0; + unsigned int numStubsRight = 0; - // Access rows in specific order if required. - unsigned int iPos = wantOrdering ? iOrder[i] : i; + // Loop over cells in HT array. + for (unsigned int i = 0; i < numRows; i++) { + // Access rows in specific order if required. + unsigned int iPos = wantOrdering ? iOrder[i] : i; - for (unsigned int j = 0; j < numCols; j++) { - if (htArray_(iPos,j).trackCandFound()) { // track candidate found in this cell. + for (unsigned int j = 0; j < numCols; j++) { + if (htArray_(iPos, j).trackCandFound()) { // track candidate found in this cell. - // Note if this corresponds to a merged HT cell (e.g. 2x2). - const bool merged = htArray_(iPos,j).mergedCell(); + // Note if this corresponds to a merged HT cell (e.g. 2x2). + const bool merged = htArray_(iPos, j).mergedCell(); - // Get stubs on this track candidate. - const vector& stubs = htArray_(iPos,j).stubs(); + // Get stubs on this track candidate. + const vector& stubs = htArray_(iPos, j).stubs(); - // And note location of cell inside HT array. - const pair cellLocation(iPos, j); + // And note location of cell inside HT array. + const pair cellLocation(iPos, j); - // Get (q/Pt, phi0) or (tan_lambda, z0) corresponding to middle of this cell. - const pair helixParams2D = this->helix2Dconventional(iPos, j); + // Get (q/Pt, phi0) or (tan_lambda, z0) corresponding to middle of this cell. + const pair helixParams2D = this->helix2Dconventional(iPos, j); - // Store all this reconstruction info about this track. - // The L1track2D class automatically finds the associated MC truth Tracking Particle particle (if any) - L1track2D l1Trk2D(settings_, stubs, cellLocation, helixParams2D, iPhiSec_, iEtaReg_, optoLinkID_, merged); + // Store all this reconstruction info about this track. + // The L1track2D class automatically finds the associated MC truth Tracking Particle particle (if any) + L1track2D l1Trk2D(settings_, stubs, cellLocation, helixParams2D, iPhiSec_, iEtaReg_, optoLinkID_, merged); - // Store all this info about the track. - trackCands2D.push_back( l1Trk2D ); + // Store all this info about the track. + trackCands2D.push_back(l1Trk2D); - } else { - if (settings_->debug() == 3) cout<<" ."; // Indicate no track in this cell. + } else { + if (settings_->debug() == 3) + cout << " ."; // Indicate no track in this cell. + } } + if (settings_->debug() == 3) + cout << endl; } - if (settings_->debug() == 3) cout<invPtToDphi(); // B*c/2E11 - - // Use filter in each HT cell using only stubs which have consistent bend? - useBendFilter_ = settings->useBendFilter(); - - // A filter is used each HT cell, which prevents more than the specified number of stubs being stored in the cell. (Reflecting memory limit of hardware). - if (miniHTcell_) { - maxStubsInCell_ = settings->maxStubsInCellMiniHough(); - } else { - maxStubsInCell_ = settings->maxStubsInCell(); - } - - // Check if subsectors are being used within each sector. These are only ever used for r-phi HT. - numSubSecs_ = settings->numSubSecsEta(); -} - -//=== Termination. Search for track in this HT cell etc. - -void HTcell::end(){ - // Produce list of filtered stubs by applying all requested filters (e.g. on stub bend). - // (If no filters are requested, then filtered & unfiltered stub collections will be identical). - - // N.B. Other filters, such as the r-z filters, which the firmware runs after the HT because they are too slow within it, - // are not defined here, but instead inside class TrkFilterAfterRphiHT. - - - vFilteredStubs_ = vStubs_; - if (useBendFilter_) vFilteredStubs_ = this->bendFilter(vFilteredStubs_); - - // Prevent too many stubs being stored in a single HT cell if requested (to reflect hardware memory limits). - // N.B. This MUST be the last filter applied. - if (maxStubsInCell_ <= 99) vFilteredStubs_ = this->maxStubCountFilter(vFilteredStubs_); - - // Calculate the number of layers the filtered stubs in this cell are in. - numFilteredLayersInCell_ = this->calcNumFilteredLayers(); - - if (numSubSecs_ > 1) { - // If using subsectors within each sector, calculate the number of layers the filters stubs in this cell are in, - // when one considers only the subset of the stubs within each subsector. - // Look for the "best" subsector. - numFilteredLayersInCellBestSubSec_ = 0; - for (unsigned int i = 0; i < numSubSecs_; i++) { - unsigned int numLaySubSec = this->calcNumFilteredLayers(i); - numFilteredLayersInCellBestSubSec_ = max(numFilteredLayersInCellBestSubSec_, numLaySubSec); + //=== Initialization with cfg params, + //=== rapidity range of current sector, and estimated q/Pt of cell, + //=== and the bin number of the cell along the q/Pt axis of the r-phi HT array, + //=== and a flag indicating if this cell is the merge of smaller HT cells. + + void HTcell::init(const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float etaMinSector, + float etaMaxSector, + float qOverPt, + unsigned int ibin_qOverPt, + bool mergedCell, + bool miniHTcell) { + settings_ = settings; + + // Sector number + iPhiSec_ = iPhiSec; + iEtaReg_ = iEtaReg; + + // Note track q/Pt. + // In this case of an r-phi HT, each cell corresponds to a unique q/Pt. + // In the case of an r-z HT, it is assumed that we know q/Pt from previously run r-phi HT. + qOverPtCell_ = qOverPt; + // Note bin number of cell along q/Pt axis of r-phi HT array. (Not used if r-z HT). + ibin_qOverPt_ = ibin_qOverPt; + mergedCell_ = mergedCell; + // Is cell in Mini-HT? + miniHTcell_ = miniHTcell; + // Rapidity range of sector. + etaMinSector_ = etaMinSector; + etaMaxSector_ = etaMaxSector; + + invPtToDphi_ = settings->invPtToDphi(); // B*c/2E11 + + // Use filter in each HT cell using only stubs which have consistent bend? + useBendFilter_ = settings->useBendFilter(); + + // A filter is used each HT cell, which prevents more than the specified number of stubs being stored in the cell. (Reflecting memory limit of hardware). + if (miniHTcell_) { + maxStubsInCell_ = settings->maxStubsInCellMiniHough(); + } else { + maxStubsInCell_ = settings->maxStubsInCell(); } - } else { - // If only 1 sub-sector, then subsector and sector are identical. - numFilteredLayersInCellBestSubSec_ = numFilteredLayersInCell_; - } -} - -// Calculate how many tracker layers the filter stubs in this cell are in, when only the subset of those stubs -// that are in the specified subsector are counted. -unsigned int HTcell::calcNumFilteredLayers(unsigned int iSubSec) const { - vector stubsInSubSec; - for (const Stub* s : vFilteredStubs_) { - const vector& inSubSec = subSectors_.at(s); // Find out which subsectors this stub is in. - if (inSubSec[iSubSec]) stubsInSubSec.push_back(s); + // Check if subsectors are being used within each sector. These are only ever used for r-phi HT. + numSubSecs_ = settings->numSubSecsEta(); } - return Utility::countLayers( settings_, stubsInSubSec ); -} - - -//=== Produce a filtered collection of stubs in this cell that all have consistent bend. -//=== Only called for r-phi Hough transform. - -vector HTcell::bendFilter( const vector& stubs ) const { - // Create bend-filtered stub collection. - vector filteredStubs; - for (const Stub* s : stubs) { + //=== Termination. Search for track in this HT cell etc. + + void HTcell::end() { + // Produce list of filtered stubs by applying all requested filters (e.g. on stub bend). + // (If no filters are requested, then filtered & unfiltered stub collections will be identical). + + // N.B. Other filters, such as the r-z filters, which the firmware runs after the HT because they are too slow within it, + // are not defined here, but instead inside class TrkFilterAfterRphiHT. + + vFilteredStubs_ = vStubs_; + if (useBendFilter_) + vFilteredStubs_ = this->bendFilter(vFilteredStubs_); + + // Prevent too many stubs being stored in a single HT cell if requested (to reflect hardware memory limits). + // N.B. This MUST be the last filter applied. + if (maxStubsInCell_ <= 99) + vFilteredStubs_ = this->maxStubCountFilter(vFilteredStubs_); + + // Calculate the number of layers the filtered stubs in this cell are in. + numFilteredLayersInCell_ = this->calcNumFilteredLayers(); + + if (numSubSecs_ > 1) { + // If using subsectors within each sector, calculate the number of layers the filters stubs in this cell are in, + // when one considers only the subset of the stubs within each subsector. + // Look for the "best" subsector. + numFilteredLayersInCellBestSubSec_ = 0; + for (unsigned int i = 0; i < numSubSecs_; i++) { + unsigned int numLaySubSec = this->calcNumFilteredLayers(i); + numFilteredLayersInCellBestSubSec_ = max(numFilteredLayersInCellBestSubSec_, numLaySubSec); + } + } else { + // If only 1 sub-sector, then subsector and sector are identical. + numFilteredLayersInCellBestSubSec_ = numFilteredLayersInCell_; + } + } - // Require stub bend to be consistent with q/Pt of this cell. + // Calculate how many tracker layers the filter stubs in this cell are in, when only the subset of those stubs + // that are in the specified subsector are counted. - unsigned int minBin = s->min_qOverPt_bin(); - unsigned int maxBin = s->max_qOverPt_bin(); - if ( mergedCell_ ) { - if ( minBin % 2 == 1 ) minBin--; - // Next line not wanted with current m-bin range definition in Stub::calcQoverPtRange(). - //if ( maxBin % 2 == 1 ) maxBin++; + unsigned int HTcell::calcNumFilteredLayers(unsigned int iSubSec) const { + vector stubsInSubSec; + for (const Stub* s : vFilteredStubs_) { + const vector& inSubSec = subSectors_.at(s); // Find out which subsectors this stub is in. + if (inSubSec[iSubSec]) + stubsInSubSec.push_back(s); } - if (minBin <= ibin_qOverPt_ && ibin_qOverPt_ <= maxBin ) filteredStubs.push_back(s); + return Utility::countLayers(settings_, stubsInSubSec); } - return filteredStubs; -} + //=== Produce a filtered collection of stubs in this cell that all have consistent bend. + //=== Only called for r-phi Hough transform. + + vector HTcell::bendFilter(const vector& stubs) const { + // Create bend-filtered stub collection. + vector filteredStubs; + for (const Stub* s : stubs) { + // Require stub bend to be consistent with q/Pt of this cell. + + unsigned int minBin = s->min_qOverPt_bin(); + unsigned int maxBin = s->max_qOverPt_bin(); + if (mergedCell_) { + if (minBin % 2 == 1) + minBin--; + // Next line not wanted with current m-bin range definition in Stub::calcQoverPtRange(). + //if ( maxBin % 2 == 1 ) maxBin++; + } + if (minBin <= ibin_qOverPt_ && ibin_qOverPt_ <= maxBin) + filteredStubs.push_back(s); + } -//=== Filter stubs so as to prevent more than specified number of stubs being stored in one cell. -//=== This reflects finite memory of hardware. + return filteredStubs; + } -vector HTcell::maxStubCountFilter( const vector& stubs ) const { - vector filteredStubs; - // If there are too many stubs in a cell, the hardware keeps (maxStubsInCell - 1) of the first stubs in the list - // plus the last stub. - if (stubs.size() > maxStubsInCell_) { - for (unsigned int i = 0; i < maxStubsInCell_ - 1; i++) { // first stubs - filteredStubs.push_back(stubs[i]); + //=== Filter stubs so as to prevent more than specified number of stubs being stored in one cell. + //=== This reflects finite memory of hardware. + + vector HTcell::maxStubCountFilter(const vector& stubs) const { + vector filteredStubs; + // If there are too many stubs in a cell, the hardware keeps (maxStubsInCell - 1) of the first stubs in the list + // plus the last stub. + if (stubs.size() > maxStubsInCell_) { + for (unsigned int i = 0; i < maxStubsInCell_ - 1; i++) { // first stubs + filteredStubs.push_back(stubs[i]); + } + filteredStubs.push_back(stubs[stubs.size() - 1]); // plus last stub + } else { + filteredStubs = stubs; } - filteredStubs.push_back(stubs[ stubs.size() - 1] ); // plus last stub - } else { - filteredStubs = stubs; + return filteredStubs; } - return filteredStubs; -} -} +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/HTrphi.cc b/L1Trigger/TrackFindingTMTT/src/HTrphi.cc index 29c495b78e181..4c261de8023df 100644 --- a/L1Trigger/TrackFindingTMTT/src/HTrphi.cc +++ b/L1Trigger/TrackFindingTMTT/src/HTrphi.cc @@ -12,692 +12,730 @@ namespace TMTT { -//=== The r-phi Hough Transform array for a single (eta,phi) sector. -//=== -//=== Its axes are (q/Pt, phiTrk), where phiTrk is the phi at which the track crosses a -//=== user-configurable radius from the beam-line. - -using namespace std; - -// Maximum |gradient| of line corresponding to any stub. Should be less than the value of 1.0 assumed by the firmware. -float HTrphi::maxLineGradient_ = 0.; -// Error count when stub added to cell which does not lie NE, E or SE of stub added to previous HT column. -unsigned int HTrphi::numErrorsTypeA_ = 0; -// Error count when stub added to more than 2 cells in one HT column (problem only for Thomas' firmware). -unsigned int HTrphi::numErrorsTypeB_ = 0; -// Error count normalisation -unsigned int HTrphi::numErrorsNormalisation_ = 0; - -//=== Initialise - -void HTrphi::init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, - float etaMinSector, float etaMaxSector, float phiCentreSector) { - - HTbase::init(settings, iPhiSec, iEtaReg); - - invPtToDphi_ = settings->invPtToDphi(); - shape_ = settings->shape(); - - int nCellsHT = settings->houghNcellsRphi(); // Total number of required cells in HT array (if > 0) - - //--- Specification of HT q/Pt axis. - - maxAbsQoverPtAxis_ = 1./settings->houghMinPt(); // Max. |q/Pt| covered by HT array. - nBinsQoverPtAxis_ = settings->houghNbinsPt(); // No. of bins in HT array in q/Pt. - if (nCellsHT > 0) nBinsQoverPtAxis_ = 1; // Will calculate number of bins automatically. Initialize it to non-zero value. - binSizeQoverPtAxis_ = 2*maxAbsQoverPtAxis_ / nBinsQoverPtAxis_; - if ( shape_ == 2 || shape_ == 1 || settings_->shape() == 3 ) - binSizeQoverPtAxis_ = 2. * maxAbsQoverPtAxis_ / ( nBinsQoverPtAxis_ - 1. ); - - //--- Specification of HT phiTrk axis - - // N.B. phiTrk corresponds to phi where track crosses radius = chosenRofPhi_. - chosenRofPhi_ = settings->chosenRofPhi(); - phiCentreSector_ = phiCentreSector; // Centre of phiTrk sector. - maxAbsPhiTrkAxis_ = M_PI / float(settings->numPhiSectors()); // Half-width of phiTrk axis in HT array. - nBinsPhiTrkAxis_ = settings->houghNbinsPhi(); // No. of bins in HT array phiTrk - if (nCellsHT > 0) nBinsPhiTrkAxis_ = 1; // Will calculate number of bins automatically. Initialize it to non-zero value. - binSizePhiTrkAxis_ = 2*maxAbsPhiTrkAxis_ / nBinsPhiTrkAxis_; - if ( shape_ == 2 ) - binSizePhiTrkAxis_ = 2. * maxAbsPhiTrkAxis_ / ( nBinsPhiTrkAxis_ - 1. / 6. ); - else if ( shape_ == 1 ) - binSizePhiTrkAxis_ = 2. * maxAbsPhiTrkAxis_ / ( nBinsPhiTrkAxis_ - 1. / 2. ); - - // Did user specify number of cells required in HT array? If so, determine number of bins along - // array axes such that their product equals required number of cells, and that their ratio gives - // a maximum line |gradient| of stubs crossing the array of 1.0. - if (nCellsHT > 0) { - // Get line gradient with current array axes. - float currentLineGrad = this->calcMaxLineGradArray(); - // Calculate new number of bins on each axis to meet constraint. - float fact = nBinsQoverPtAxis_ * currentLineGrad / nBinsPhiTrkAxis_; - nBinsQoverPtAxis_ = ceil( sqrt(nCellsHT * fact) ); - nBinsPhiTrkAxis_ = int ( sqrt(nCellsHT / fact) ); - // And recalculate bin size accordingly. - binSizeQoverPtAxis_ = 2*maxAbsQoverPtAxis_ / nBinsQoverPtAxis_; - binSizePhiTrkAxis_ = 2*maxAbsPhiTrkAxis_ / nBinsPhiTrkAxis_; - } - - // Note max. |gradient| that the line corresponding to any stub in any of the r-phi HT arrays could have. - // Firmware assumes this should not exceed 1.0; - HTrphi::maxLineGradient_ = max( HTrphi::maxLineGradient_, this->calcMaxLineGradArray()); - - // Optionally merge 2x2 neighbouring cells into a single cell at low Pt, to reduce efficiency loss due to - // scattering. (Do this if either of options EnableMerge2x2 or MiniHTstage are enabled. - // N.B These two options are never both enabled). - enableMerge2x2_ = (settings->enableMerge2x2() || settings->miniHTstage()); - if (settings->miniHTstage()) { - // Mini-HT stage cfg: Merge all bins, irrespective of Pt. - minInvPtToMerge2x2_ = 0.; - } else { - // Merged cells cfg: Merge bins below specified Pt threshold. - minInvPtToMerge2x2_ = 1./(settings->maxPtToMerge2x2()); - if (minInvPtToMerge2x2_ > maxAbsQoverPtAxis_) enableMerge2x2_ = false; - } - - // Merging 2x2 cells into 1 merged cell is only allowed if HT array dimensions are even. - // (This restriction could be removed along q/Pt axis, since there are also unmerged cells there. But this - // would require correcting the code after each called to mergedCell() below, since - // "if (i%2 == 1) iStore = i - 1" not correct in this case). - if (enableMerge2x2_ && (nBinsQoverPtAxis_%2 != 0 || nBinsPhiTrkAxis_%2 != 0)) throw cms::Exception("HTrphi: You are not allowed to set EnableMerge2x2 or MiniHTstage = True if you have an odd number of bins in r-phi HT array ")<killSomeHTCellsRphi(); - // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when fill stubs in r-phi HT? - handleStripsRphiHT_ = settings->handleStripsRphiHT(); - - // Used to kill excess stubs or tracks that can't be transmitted within time-multiplexed period. - nReceivedStubs_ = 0; - busyInputSectorKill_ = settings_->busyInputSectorKill(); // Kill excess stubs going fron GP to HT? - busyInputSectorNumStubs_ = settings_->busyInputSectorNumStubs(); // Max. num. of stubs that can be sent from GP to HT within TM period - busySectorKill_ = settings_->busySectorKill(); // Kill excess tracks flowing out of HT? - busySectorNumStubs_ = settings_->busySectorNumStubs(); // Max. num. of stubs that can be sent out of HT within TM period - busySectorMbinRanges_ = settings_->busySectorMbinRanges(); // or individual m bin (=q/Pt) ranges to be output to optical links. - busySectorUseMbinRanges_ = ( ! busySectorMbinRanges_.empty() ); // m bin ranges option disabled if vector empty. - busySectorMbinOrder_ = settings_->busySectorMbinOrder(); // Specifies which m bins should be grouped together by BusySectorMbinRanges. If empty, then they are grouped in order 0,1,2,3,4,5 ... - busySectorUseMbinOrder_ = ( ! busySectorMbinOrder_.empty() ); - - bool rescaleMbins = false; - if (busySectorUseMbinRanges_) { - // Check if the total number of bins specified in cfg option BusySectorMbinRanges corresponds - // to the number of m bins (q/Pt) in the HT. If not, determine how much the ranges must be scaled - // to make this true. - unsigned int nTotalBins = 0; - for (unsigned int j = 0; j < busySectorMbinRanges_.size(); j++) { - nTotalBins += busySectorMbinRanges_[j]; + //=== The r-phi Hough Transform array for a single (eta,phi) sector. + //=== + //=== Its axes are (q/Pt, phiTrk), where phiTrk is the phi at which the track crosses a + //=== user-configurable radius from the beam-line. + + using namespace std; + + // Maximum |gradient| of line corresponding to any stub. Should be less than the value of 1.0 assumed by the firmware. + float HTrphi::maxLineGradient_ = 0.; + // Error count when stub added to cell which does not lie NE, E or SE of stub added to previous HT column. + unsigned int HTrphi::numErrorsTypeA_ = 0; + // Error count when stub added to more than 2 cells in one HT column (problem only for Thomas' firmware). + unsigned int HTrphi::numErrorsTypeB_ = 0; + // Error count normalisation + unsigned int HTrphi::numErrorsNormalisation_ = 0; + + //=== Initialise + + void HTrphi::init(const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float etaMinSector, + float etaMaxSector, + float phiCentreSector) { + HTbase::init(settings, iPhiSec, iEtaReg); + + invPtToDphi_ = settings->invPtToDphi(); + shape_ = settings->shape(); + + int nCellsHT = settings->houghNcellsRphi(); // Total number of required cells in HT array (if > 0) + + //--- Specification of HT q/Pt axis. + + maxAbsQoverPtAxis_ = 1. / settings->houghMinPt(); // Max. |q/Pt| covered by HT array. + nBinsQoverPtAxis_ = settings->houghNbinsPt(); // No. of bins in HT array in q/Pt. + if (nCellsHT > 0) + nBinsQoverPtAxis_ = 1; // Will calculate number of bins automatically. Initialize it to non-zero value. + binSizeQoverPtAxis_ = 2 * maxAbsQoverPtAxis_ / nBinsQoverPtAxis_; + if (shape_ == 2 || shape_ == 1 || settings_->shape() == 3) + binSizeQoverPtAxis_ = 2. * maxAbsQoverPtAxis_ / (nBinsQoverPtAxis_ - 1.); + + //--- Specification of HT phiTrk axis + + // N.B. phiTrk corresponds to phi where track crosses radius = chosenRofPhi_. + chosenRofPhi_ = settings->chosenRofPhi(); + phiCentreSector_ = phiCentreSector; // Centre of phiTrk sector. + maxAbsPhiTrkAxis_ = M_PI / float(settings->numPhiSectors()); // Half-width of phiTrk axis in HT array. + nBinsPhiTrkAxis_ = settings->houghNbinsPhi(); // No. of bins in HT array phiTrk + if (nCellsHT > 0) + nBinsPhiTrkAxis_ = 1; // Will calculate number of bins automatically. Initialize it to non-zero value. + binSizePhiTrkAxis_ = 2 * maxAbsPhiTrkAxis_ / nBinsPhiTrkAxis_; + if (shape_ == 2) + binSizePhiTrkAxis_ = 2. * maxAbsPhiTrkAxis_ / (nBinsPhiTrkAxis_ - 1. / 6.); + else if (shape_ == 1) + binSizePhiTrkAxis_ = 2. * maxAbsPhiTrkAxis_ / (nBinsPhiTrkAxis_ - 1. / 2.); + + // Did user specify number of cells required in HT array? If so, determine number of bins along + // array axes such that their product equals required number of cells, and that their ratio gives + // a maximum line |gradient| of stubs crossing the array of 1.0. + if (nCellsHT > 0) { + // Get line gradient with current array axes. + float currentLineGrad = this->calcMaxLineGradArray(); + // Calculate new number of bins on each axis to meet constraint. + float fact = nBinsQoverPtAxis_ * currentLineGrad / nBinsPhiTrkAxis_; + nBinsQoverPtAxis_ = ceil(sqrt(nCellsHT * fact)); + nBinsPhiTrkAxis_ = int(sqrt(nCellsHT / fact)); + // And recalculate bin size accordingly. + binSizeQoverPtAxis_ = 2 * maxAbsQoverPtAxis_ / nBinsQoverPtAxis_; + binSizePhiTrkAxis_ = 2 * maxAbsPhiTrkAxis_ / nBinsPhiTrkAxis_; } - rescaleMbins = (nTotalBins != nBinsQoverPtAxis_); - // No rescaling allowed with MBinOrder option. - if (rescaleMbins && busySectorUseMbinOrder_) throw cms::Exception("HTrphi: BusySectorUserMbin error"); - float rescaleFactor = rescaleMbins ? float(nBinsQoverPtAxis_)/float(nTotalBins) : 1. ; - // Find lower and upper inclusive limits of each m bin range to be sent to a separate optical link. - busySectorMbinLow_.resize( busySectorMbinRanges_.size() ); - busySectorMbinHigh_.resize( busySectorMbinRanges_.size() ); - float mBinSum = 0.; - for (unsigned int i = 0; i < busySectorMbinRanges_.size(); i++) { - busySectorMbinLow_[i] = std::round(mBinSum); - busySectorMbinHigh_[i] = std::round(mBinSum + rescaleFactor * busySectorMbinRanges_[i]) - 1; - mBinSum += rescaleFactor * busySectorMbinRanges_[i]; - } - } - //--- Options for duplicate track removal after running HT. - unsigned int dupTrkAlgRphi = settings->dupTrkAlgRphi(); - HTbase::killDupTrks_.init(settings, dupTrkAlgRphi); - - // Resize HT array to suit these specifications, and initialise each cell with configuration parameters. - HTbase::htArray_.resize(nBinsQoverPtAxis_, nBinsPhiTrkAxis_, false); - // - for (unsigned int i = 0; i < nBinsQoverPtAxis_; i++) { - for (unsigned int j = 0; j < nBinsPhiTrkAxis_; j++) { - pair helix = this->helix2Dconventional(i, j); // Get track params at centre of cell. - float qOverPt = helix.first; - // Check if this cell is merged with its neighbours (as in low Pt region). - bool mergedCell = false; - if (enableMerge2x2_ && this->mergedCell(i, j)) mergedCell = true; - HTbase::htArray_(i,j).init( settings, iPhiSec, iEtaReg, - etaMinSector, etaMaxSector, qOverPt, i, mergedCell); // Calls HTcell::init() + // Note max. |gradient| that the line corresponding to any stub in any of the r-phi HT arrays could have. + // Firmware assumes this should not exceed 1.0; + HTrphi::maxLineGradient_ = max(HTrphi::maxLineGradient_, this->calcMaxLineGradArray()); + + // Optionally merge 2x2 neighbouring cells into a single cell at low Pt, to reduce efficiency loss due to + // scattering. (Do this if either of options EnableMerge2x2 or MiniHTstage are enabled. + // N.B These two options are never both enabled). + enableMerge2x2_ = (settings->enableMerge2x2() || settings->miniHTstage()); + if (settings->miniHTstage()) { + // Mini-HT stage cfg: Merge all bins, irrespective of Pt. + minInvPtToMerge2x2_ = 0.; + } else { + // Merged cells cfg: Merge bins below specified Pt threshold. + minInvPtToMerge2x2_ = 1. / (settings->maxPtToMerge2x2()); + if (minInvPtToMerge2x2_ > maxAbsQoverPtAxis_) + enableMerge2x2_ = false; } - } - static bool first = true; - if (first) { - first = false; - cout<<"=== R-PHI HOUGH TRANSFORM AXES RANGES: abs(q/Pt) < "<killSomeHTCellsRphi(); + // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when fill stubs in r-phi HT? + handleStripsRphiHT_ = settings->handleStripsRphiHT(); + + // Used to kill excess stubs or tracks that can't be transmitted within time-multiplexed period. + nReceivedStubs_ = 0; + busyInputSectorKill_ = settings_->busyInputSectorKill(); // Kill excess stubs going fron GP to HT? + busyInputSectorNumStubs_ = + settings_->busyInputSectorNumStubs(); // Max. num. of stubs that can be sent from GP to HT within TM period + busySectorKill_ = settings_->busySectorKill(); // Kill excess tracks flowing out of HT? + busySectorNumStubs_ = + settings_->busySectorNumStubs(); // Max. num. of stubs that can be sent out of HT within TM period + busySectorMbinRanges_ = + settings_->busySectorMbinRanges(); // or individual m bin (=q/Pt) ranges to be output to optical links. + busySectorUseMbinRanges_ = (!busySectorMbinRanges_.empty()); // m bin ranges option disabled if vector empty. + busySectorMbinOrder_ = + settings_ + ->busySectorMbinOrder(); // Specifies which m bins should be grouped together by BusySectorMbinRanges. If empty, then they are grouped in order 0,1,2,3,4,5 ... + busySectorUseMbinOrder_ = (!busySectorMbinOrder_.empty()); + + bool rescaleMbins = false; + if (busySectorUseMbinRanges_) { + // Check if the total number of bins specified in cfg option BusySectorMbinRanges corresponds + // to the number of m bins (q/Pt) in the HT. If not, determine how much the ranges must be scaled + // to make this true. + unsigned int nTotalBins = 0; + for (unsigned int j = 0; j < busySectorMbinRanges_.size(); j++) { + nTotalBins += busySectorMbinRanges_[j]; + } + rescaleMbins = (nTotalBins != nBinsQoverPtAxis_); + // No rescaling allowed with MBinOrder option. + if (rescaleMbins && busySectorUseMbinOrder_) + throw cms::Exception("HTrphi: BusySectorUserMbin error"); + float rescaleFactor = rescaleMbins ? float(nBinsQoverPtAxis_) / float(nTotalBins) : 1.; + // Find lower and upper inclusive limits of each m bin range to be sent to a separate optical link. + busySectorMbinLow_.resize(busySectorMbinRanges_.size()); + busySectorMbinHigh_.resize(busySectorMbinRanges_.size()); + float mBinSum = 0.; for (unsigned int i = 0; i < busySectorMbinRanges_.size(); i++) { - cout<<" "<<(busySectorMbinHigh_[i] - busySectorMbinLow_[i] + 1); + busySectorMbinLow_[i] = std::round(mBinSum); + busySectorMbinHigh_[i] = std::round(mBinSum + rescaleFactor * busySectorMbinRanges_[i]) - 1; + mBinSum += rescaleFactor * busySectorMbinRanges_[i]; } - cout< > binCenters; - for ( unsigned int c = 0; c < nBinsPhiTrkAxis_; c++ ) - binCenters.push_back( this->helix2Dhough( m, c ) ); - cellCenters_.push_back( binCenters ); - } - -} + //--- Options for duplicate track removal after running HT. + unsigned int dupTrkAlgRphi = settings->dupTrkAlgRphi(); + HTbase::killDupTrks_.init(settings, dupTrkAlgRphi); -//=== Add stub to HT array. -//=== If eta subsectors are being used within each sector, specify which ones the stub is compatible with. + // Resize HT array to suit these specifications, and initialise each cell with configuration parameters. + HTbase::htArray_.resize(nBinsQoverPtAxis_, nBinsPhiTrkAxis_, false); + // + for (unsigned int i = 0; i < nBinsQoverPtAxis_; i++) { + for (unsigned int j = 0; j < nBinsPhiTrkAxis_; j++) { + pair helix = this->helix2Dconventional(i, j); // Get track params at centre of cell. + float qOverPt = helix.first; + // Check if this cell is merged with its neighbours (as in low Pt region). + bool mergedCell = false; + if (enableMerge2x2_ && this->mergedCell(i, j)) + mergedCell = true; + HTbase::htArray_(i, j).init( + settings, iPhiSec, iEtaReg, etaMinSector, etaMaxSector, qOverPt, i, mergedCell); // Calls HTcell::init() + } + } -void HTrphi::store(const Stub* stub, const vector& inEtaSubSecs) { + static bool first = true; + if (first) { + first = false; + cout << "=== R-PHI HOUGH TRANSFORM AXES RANGES: abs(q/Pt) < " << maxAbsQoverPtAxis_ << " & abs(track-phi) < " + << maxAbsPhiTrkAxis_ << " ===" << endl; + cout << "=== R-PHI HOUGH TRANSFORM ARRAY SIZE: q/Pt bins = " << nBinsQoverPtAxis_ + << " & track-phi bins = " << nBinsPhiTrkAxis_ << " ===" << endl; + cout << "=== R-PHI HOUGH TRANSFORM BIN SIZE: BIN(q/Pt) = " << binSizeQoverPtAxis_ + << " & BIN(track-phi) = " << binSizePhiTrkAxis_ << " ===" << endl + << endl; + if (busySectorKill_ && busySectorUseMbinRanges_ && rescaleMbins) { + cout << "=== R-PHI HOUGH TRANSFORM WARNING: Rescaled m bin ranges specified by cfg parameter " + "BusySectorMbinRanges, as they were inconsistent with total number of m bins in HT." + << endl; + cout << "=== Rescaled values for BusySectorMbinRanges ="; + for (unsigned int i = 0; i < busySectorMbinRanges_.size(); i++) { + cout << " " << (busySectorMbinHigh_[i] - busySectorMbinLow_[i] + 1); + } + cout << endl; + } + } - // Optionally, only store stubs that can be sent from GP to HT within TM period. - if ( ( ! busyInputSectorKill_) || (nReceivedStubs_ < busyInputSectorNumStubs_) ) { + // Note helix parameters at the centre of each HT cell. + cellCenters_.clear(); + for (unsigned int m = 0; m < nBinsQoverPtAxis_; m++) { + std::vector > binCenters; + for (unsigned int c = 0; c < nBinsPhiTrkAxis_; c++) + binCenters.push_back(this->helix2Dhough(m, c)); + cellCenters_.push_back(binCenters); + } + } - nReceivedStubs_++; + //=== Add stub to HT array. + //=== If eta subsectors are being used within each sector, specify which ones the stub is compatible with. + + void HTrphi::store(const Stub* stub, const vector& inEtaSubSecs) { + // Optionally, only store stubs that can be sent from GP to HT within TM period. + if ((!busyInputSectorKill_) || (nReceivedStubs_ < busyInputSectorNumStubs_)) { + nReceivedStubs_++; + + // Loop over q/Pt related bins in HT array. + for (unsigned int i = 0; i < nBinsQoverPtAxis_; i++) { + if (shape_ == 0) { + //--- This is a traditional HT with square cells. + + // In this q/Pt bin, find the range of phi bins that this stub is consistent with. + pair iRange = this->iPhiRange(stub, i); + unsigned int iPhiTrkBinMin = iRange.first; + unsigned int iPhiTrkBinMax = iRange.second; + + // Store stubs in these cells. + for (unsigned int j = iPhiTrkBinMin; j <= iPhiTrkBinMax; j++) { + bool canStoreStub = true; + unsigned int iStore = i; + unsigned int jStore = j; + + // Optionally merge 2x2 neighbouring cells into a single cell at low Pt, to reduce efficiency loss + // due to scattering. + if (enableMerge2x2_) { + // Check if this cell is merged with its neighbours (as in low Pt region). + if (this->mergedCell(i, j)) { + // Get location of cell that this cell is merged into (iStore, jStore). + // Calculation assumes HT array has even number of bins in both dimensions. + if (i % 2 == 1) + iStore = i - 1; + if (j % 2 == 1) + jStore = j - 1; + // If this stub was already stored in this merged 2x2 cell, then don't store it again. + if (HTbase::htArray_(iStore, jStore).stubStoredInCell(stub)) + canStoreStub = false; + } + } - // Loop over q/Pt related bins in HT array. - for (unsigned int i = 0; i < nBinsQoverPtAxis_; i++) { + if (canStoreStub) + HTbase::htArray_(iStore, jStore).store(stub, inEtaSubSecs); // Calls HTcell::store() + } - if ( shape_ == 0) { - - //--- This is a traditional HT with square cells. - - // In this q/Pt bin, find the range of phi bins that this stub is consistent with. - pair iRange = this->iPhiRange( stub, i); - unsigned int iPhiTrkBinMin = iRange.first; - unsigned int iPhiTrkBinMax = iRange.second; - - // Store stubs in these cells. - for (unsigned int j = iPhiTrkBinMin; j <= iPhiTrkBinMax; j++) { - - bool canStoreStub = true; - unsigned int iStore = i; - unsigned int jStore = j; - - // Optionally merge 2x2 neighbouring cells into a single cell at low Pt, to reduce efficiency loss - // due to scattering. - if (enableMerge2x2_) { - // Check if this cell is merged with its neighbours (as in low Pt region). - if (this->mergedCell(i, j)) { - // Get location of cell that this cell is merged into (iStore, jStore). - // Calculation assumes HT array has even number of bins in both dimensions. - if (i%2 == 1) iStore = i - 1; - if (j%2 == 1) jStore = j - 1; - // If this stub was already stored in this merged 2x2 cell, then don't store it again. - if (HTbase::htArray_(iStore, jStore).stubStoredInCell( stub )) canStoreStub = false; + // Check that limitations of firmware would not prevent stub being stored correctly in this HT column. + this->countFirmwareErrors(i, iPhiTrkBinMin, iPhiTrkBinMax); + + } else { + //--- This is are novel HT with unusual shaped cells. + + if (shape_ == 1) { + //--- This HT has diamond shaped cells. + + float qOverPtBin = -maxAbsQoverPtAxis_ + i * binSizeQoverPtAxis_; + float phiTrk = reco::deltaPhi(stub->phi(), phiCentreSector_) + + invPtToDphi_ * qOverPtBin * (stub->r() - chosenRofPhi_) + maxAbsPhiTrkAxis_; + if (i % 2 == 0) + phiTrk += binSizePhiTrkAxis_ / 2.; + unsigned int binCenter = std::floor(phiTrk / binSizePhiTrkAxis_); + if (binCenter < nBinsPhiTrkAxis_) + HTbase::htArray_(i, binCenter).store(stub, inEtaSubSecs); + + } else if (shape_ == 2) { + //--- This HT has hexagonal cells (with two of its sides parallel to the phi axis). + + float qOverPtBin = -maxAbsQoverPtAxis_ + i * binSizeQoverPtAxis_; + float qOverPtBinVar = binSizeQoverPtAxis_; + float phiTrk = reco::deltaPhi(stub->phi(), phiCentreSector_) + + invPtToDphi_ * qOverPtBin * (stub->r() - chosenRofPhi_) + maxAbsPhiTrkAxis_; + float phiTrkVar = invPtToDphi_ * qOverPtBinVar * std::fabs(stub->r() - chosenRofPhi_); + float phiTrkMin = phiTrk - phiTrkVar; + float phiTrkMax = phiTrk + phiTrkVar; + if (i % 2 == 0) + phiTrk += binSizePhiTrkAxis_ / 6.; + else { + phiTrk -= binSizePhiTrkAxis_ / 3.; + phiTrkMin -= binSizePhiTrkAxis_ / 2.; + phiTrkMax -= binSizePhiTrkAxis_ / 2.; } + unsigned int iCenter = std::floor(phiTrk / binSizePhiTrkAxis_ * 3.); + unsigned int iMin = std::floor(phiTrkMin / binSizePhiTrkAxis_ * 3.); + unsigned int iMax = std::floor(phiTrkMax / binSizePhiTrkAxis_ * 3.); + std::pair binCenter; + std::pair binMin; + std::pair binMax; + binCenter.second = iCenter / 3; + binMin.second = iMin / 3; + binMax.second = iMax / 3; + binCenter.first = !(iCenter % 3 == 2); + binMin.first = (iMin % 3 == 0); + binMax.first = (iMax % 3 == 0); + if (binCenter.first && binCenter.second < nBinsPhiTrkAxis_) + HTbase::htArray_(i, binCenter.second).store(stub, inEtaSubSecs); + else if (binMin.first && binMin.second < nBinsPhiTrkAxis_) + HTbase::htArray_(i, binMin.second).store(stub, inEtaSubSecs); + else if (binMax.first && binMax.second < nBinsPhiTrkAxis_) + HTbase::htArray_(i, binMax.second).store(stub, inEtaSubSecs); + + } else if (shape_ == 3) { + //--- This HT has square cells with alternate rows shifted horizontally by 0.5*cell_width. + + float qOverPtBin = -maxAbsQoverPtAxis_ + i * binSizeQoverPtAxis_; + float qOverPtBinVar = binSizeQoverPtAxis_; + float phiTrk = reco::deltaPhi(stub->phi(), phiCentreSector_) + + invPtToDphi_ * qOverPtBin * (stub->r() - chosenRofPhi_) + maxAbsPhiTrkAxis_; + float phiTrkVar = invPtToDphi_ * qOverPtBinVar * std::fabs(stub->r() - chosenRofPhi_); + float phiTrkMin = phiTrk - phiTrkVar; + float phiTrkMax = phiTrk + phiTrkVar; + unsigned int iMin = std::floor(phiTrkMin / binSizePhiTrkAxis_ * 2.); + unsigned int iMax = std::floor(phiTrkMax / binSizePhiTrkAxis_ * 2.); + std::pair binMin; + std::pair binMax; + binMin.second = iMin / 2; + binMax.second = iMax / 2; + binMin.first = (iMin % 2 == i % 2); + binMax.first = (iMax % 2 == i % 2); + if (binMin.first && binMin.second < nBinsPhiTrkAxis_) + HTbase::htArray_(i, binMin.second).store(stub, inEtaSubSecs); + else if (binMax.first && binMax.second < nBinsPhiTrkAxis_) + HTbase::htArray_(i, binMax.second).store(stub, inEtaSubSecs); } - - if (canStoreStub) HTbase::htArray_(iStore, jStore).store( stub, inEtaSubSecs ); // Calls HTcell::store() } - - // Check that limitations of firmware would not prevent stub being stored correctly in this HT column. - this->countFirmwareErrors(i, iPhiTrkBinMin, iPhiTrkBinMax); - - } else { - - //--- This is are novel HT with unusual shaped cells. - - if ( shape_ == 1 ) { - - //--- This HT has diamond shaped cells. - - float qOverPtBin = -maxAbsQoverPtAxis_ + i * binSizeQoverPtAxis_; - float phiTrk = reco::deltaPhi( stub->phi(), phiCentreSector_ ) + invPtToDphi_ * qOverPtBin * ( stub->r() - chosenRofPhi_ ) + maxAbsPhiTrkAxis_; - if ( i % 2 == 0 ) - phiTrk += binSizePhiTrkAxis_ / 2.; - unsigned int binCenter = std::floor( phiTrk / binSizePhiTrkAxis_ ); - if ( binCenter < nBinsPhiTrkAxis_ ) - HTbase::htArray_(i, binCenter).store( stub, inEtaSubSecs ); - - } else if ( shape_ == 2 ) { - - //--- This HT has hexagonal cells (with two of its sides parallel to the phi axis). - - float qOverPtBin = -maxAbsQoverPtAxis_ + i * binSizeQoverPtAxis_; - float qOverPtBinVar = binSizeQoverPtAxis_; - float phiTrk = reco::deltaPhi( stub->phi(), phiCentreSector_ ) + invPtToDphi_ * qOverPtBin * ( stub->r() - chosenRofPhi_ ) + maxAbsPhiTrkAxis_; - float phiTrkVar = invPtToDphi_ * qOverPtBinVar * std::fabs( stub->r() - chosenRofPhi_ ); - float phiTrkMin = phiTrk - phiTrkVar; - float phiTrkMax = phiTrk + phiTrkVar; - if ( i % 2 == 0 ) - phiTrk += binSizePhiTrkAxis_ / 6.; - else { - phiTrk -= binSizePhiTrkAxis_ / 3.; - phiTrkMin -= binSizePhiTrkAxis_ / 2.; - phiTrkMax -= binSizePhiTrkAxis_ / 2.; - } - unsigned int iCenter = std::floor( phiTrk / binSizePhiTrkAxis_ * 3. ); - unsigned int iMin = std::floor( phiTrkMin / binSizePhiTrkAxis_ * 3. ); - unsigned int iMax = std::floor( phiTrkMax / binSizePhiTrkAxis_ * 3. ); - std::pair< bool, unsigned int > binCenter; - std::pair< bool, unsigned int > binMin; - std::pair< bool, unsigned int > binMax; - binCenter.second = iCenter / 3; - binMin.second = iMin / 3; - binMax.second = iMax / 3; - binCenter.first = !( iCenter % 3 == 2 ); - binMin.first = ( iMin % 3 == 0 ); - binMax.first = ( iMax % 3 == 0 ); - if ( binCenter.first && binCenter.second < nBinsPhiTrkAxis_ ) - HTbase::htArray_(i, binCenter.second).store( stub, inEtaSubSecs ); - else if ( binMin.first && binMin.second < nBinsPhiTrkAxis_ ) - HTbase::htArray_(i, binMin.second).store( stub, inEtaSubSecs ); - else if ( binMax.first && binMax.second < nBinsPhiTrkAxis_ ) - HTbase::htArray_(i, binMax.second).store( stub, inEtaSubSecs ); - - } else if ( shape_ == 3 ) { - - //--- This HT has square cells with alternate rows shifted horizontally by 0.5*cell_width. - - float qOverPtBin = -maxAbsQoverPtAxis_ + i * binSizeQoverPtAxis_; - float qOverPtBinVar = binSizeQoverPtAxis_; - float phiTrk = reco::deltaPhi( stub->phi(), phiCentreSector_ ) + invPtToDphi_ * qOverPtBin * ( stub->r() - chosenRofPhi_ ) + maxAbsPhiTrkAxis_; - float phiTrkVar = invPtToDphi_ * qOverPtBinVar * std::fabs( stub->r() - chosenRofPhi_ ); - float phiTrkMin = phiTrk - phiTrkVar; - float phiTrkMax = phiTrk + phiTrkVar; - unsigned int iMin = std::floor( phiTrkMin / binSizePhiTrkAxis_ * 2. ); - unsigned int iMax = std::floor( phiTrkMax / binSizePhiTrkAxis_ * 2. ); - std::pair< bool, unsigned int > binMin; - std::pair< bool, unsigned int > binMax; - binMin.second = iMin / 2; - binMax.second = iMax / 2; - binMin.first = ( iMin % 2 == i % 2 ); - binMax.first = ( iMax % 2 == i % 2 ); - if ( binMin.first && binMin.second < nBinsPhiTrkAxis_ ) - HTbase::htArray_(i, binMin.second).store( stub, inEtaSubSecs ); - else if ( binMax.first && binMax.second < nBinsPhiTrkAxis_ ) - HTbase::htArray_(i, binMax.second).store( stub, inEtaSubSecs ); - } } } } -} - -//=== Determine the m-bin (q/pt) range the specified track is in. (Used if outputting each m bin range on a different opto-link). - -unsigned int HTrphi::getMbinRange(const L1track2D& trk) const { - if (busySectorUseMbinRanges_) { - unsigned int mBin = trk.getCellLocationHT().first; - unsigned int mBinOrder; - if (busySectorUseMbinOrder_) { - // User wants to group bins in a wierd order. - mBinOrder = 99999; - for (unsigned int k = 0; k < busySectorMbinOrder_.size(); k++) { - if (mBin == busySectorMbinOrder_[k]) mBinOrder = k; + + //=== Determine the m-bin (q/pt) range the specified track is in. (Used if outputting each m bin range on a different opto-link). + + unsigned int HTrphi::getMbinRange(const L1track2D& trk) const { + if (busySectorUseMbinRanges_) { + unsigned int mBin = trk.getCellLocationHT().first; + unsigned int mBinOrder; + if (busySectorUseMbinOrder_) { + // User wants to group bins in a wierd order. + mBinOrder = 99999; + for (unsigned int k = 0; k < busySectorMbinOrder_.size(); k++) { + if (mBin == busySectorMbinOrder_[k]) + mBinOrder = k; + } + if (mBinOrder == 99999) + throw cms::Exception("HTrphi::getMbinRange() mBinOrder calculation wrong."); + } else { + // User grouping bins in numerical order 0,1,2,3,4,5... + mBinOrder = mBin; } - if (mBinOrder == 99999) throw cms::Exception("HTrphi::getMbinRange() mBinOrder calculation wrong."); - } else { - // User grouping bins in numerical order 0,1,2,3,4,5... - mBinOrder = mBin; - } - for (unsigned int i = 0; i < busySectorMbinRanges_.size(); i++) { - if (mBinOrder >= busySectorMbinLow_[i] && mBinOrder <= busySectorMbinHigh_[i]) return i; - } - throw cms::Exception("HTrphi::getMbinRange() messed up"); - } else { - return 0; - } -} - -//=== For a given Q/Pt bin, find the range of phi bins that a given stub is consistent with. -//=== Return as a pair (min bin, max bin) -//=== If it range lies outside the HT array, then the min bin will be set larger than the max bin. - -pair HTrphi::iPhiRange( const Stub* stub, unsigned int iQoverPtBin, bool debug) const { - - // Note q/Pt value corresponding to centre of this bin. - float qOverPtBin = -maxAbsQoverPtAxis_ + (iQoverPtBin + 0.5) * binSizeQoverPtAxis_; - // Note change in this q/Pt value needed to reach either edge of the bin. - float qOverPtBinVar = 0.5*binSizeQoverPtAxis_; - - // Reducing effective bin width can reduce fake rate. - //qOverPtVar = 0.4*binSizeQoverPtAxis_; - - // Calculate range of track-phi that would allow a track in this q/Pt range to pass through the stub. - float phiTrk = stub->phi() + invPtToDphi_ * qOverPtBin * (stub->r() - chosenRofPhi_); - // The next line does the phiTrk calculation without the usual approximation, but it doesn't - // improve performance. - //float phiTrk = stub->phi() + asin(invPtToDphi_ * qOverPtBin * stub->r()) - asin(invPtToDphi_ * qOverPtBin * chosenRofPhi_); - float phiTrkVar = invPtToDphi_ * qOverPtBinVar * fabs(stub->r() - chosenRofPhi_); - float phiTrkMin = phiTrk - phiTrkVar; - float phiTrkMax = phiTrk + phiTrkVar; - - // Allow for uncertainty due to strip length if requested. - if (handleStripsRphiHT_) { - // Estimate uncertainty due to strip length, using first order derivative of phiTrk w.r.t. stub coords. - // Note that barrel modules only care about zErr and endcap ones about rErr. - float phiTrkVarStub; - if (stub->barrel()) { - phiTrkVarStub = 0.; + for (unsigned int i = 0; i < busySectorMbinRanges_.size(); i++) { + if (mBinOrder >= busySectorMbinLow_[i] && mBinOrder <= busySectorMbinHigh_[i]) + return i; + } + throw cms::Exception("HTrphi::getMbinRange() messed up"); } else { - phiTrkVarStub = invPtToDphi_ * fabs(qOverPtBin) * stub->rErr(); + return 0; } - phiTrkMin -= phiTrkVarStub; - phiTrkMax += phiTrkVarStub; } - // Allow for multiple scattering/resolution - // phiTrkMin -= 0.005; - // phiTrkMax += 0.005; + //=== For a given Q/Pt bin, find the range of phi bins that a given stub is consistent with. + //=== Return as a pair (min bin, max bin) + //=== If it range lies outside the HT array, then the min bin will be set larger than the max bin. + + pair HTrphi::iPhiRange(const Stub* stub, unsigned int iQoverPtBin, bool debug) const { + // Note q/Pt value corresponding to centre of this bin. + float qOverPtBin = -maxAbsQoverPtAxis_ + (iQoverPtBin + 0.5) * binSizeQoverPtAxis_; + // Note change in this q/Pt value needed to reach either edge of the bin. + float qOverPtBinVar = 0.5 * binSizeQoverPtAxis_; + + // Reducing effective bin width can reduce fake rate. + //qOverPtVar = 0.4*binSizeQoverPtAxis_; + + // Calculate range of track-phi that would allow a track in this q/Pt range to pass through the stub. + float phiTrk = stub->phi() + invPtToDphi_ * qOverPtBin * (stub->r() - chosenRofPhi_); + // The next line does the phiTrk calculation without the usual approximation, but it doesn't + // improve performance. + //float phiTrk = stub->phi() + asin(invPtToDphi_ * qOverPtBin * stub->r()) - asin(invPtToDphi_ * qOverPtBin * chosenRofPhi_); + float phiTrkVar = invPtToDphi_ * qOverPtBinVar * fabs(stub->r() - chosenRofPhi_); + float phiTrkMin = phiTrk - phiTrkVar; + float phiTrkMax = phiTrk + phiTrkVar; - float deltaPhiMin = reco::deltaPhi(phiTrkMin, phiCentreSector_); // Offset to centre of sector. - float deltaPhiMax = reco::deltaPhi(phiTrkMax, phiCentreSector_); - pair phiTrkRange( deltaPhiMin, deltaPhiMax ); + // Allow for uncertainty due to strip length if requested. + if (handleStripsRphiHT_) { + // Estimate uncertainty due to strip length, using first order derivative of phiTrk w.r.t. stub coords. + // Note that barrel modules only care about zErr and endcap ones about rErr. + float phiTrkVarStub; + if (stub->barrel()) { + phiTrkVarStub = 0.; + } else { + phiTrkVarStub = invPtToDphi_ * fabs(qOverPtBin) * stub->rErr(); + } + phiTrkMin -= phiTrkVarStub; + phiTrkMax += phiTrkVarStub; + } - // Determine which HT array cell range in track-phi this range "phiTrkRange" corresponds to. - pair iPhiTrkBinRange = this->HTbase::convertCoordRangeToBinRange(phiTrkRange, nBinsPhiTrkAxis_, (-maxAbsPhiTrkAxis_), binSizePhiTrkAxis_, killSomeHTCellsRphi_); + // Allow for multiple scattering/resolution + // phiTrkMin -= 0.005; + // phiTrkMax += 0.005; - return iPhiTrkBinRange; -} + float deltaPhiMin = reco::deltaPhi(phiTrkMin, phiCentreSector_); // Offset to centre of sector. + float deltaPhiMax = reco::deltaPhi(phiTrkMax, phiCentreSector_); + pair phiTrkRange(deltaPhiMin, deltaPhiMax); -//=== Check that limitations of firmware would not prevent stub being stored correctly in this HT column. + // Determine which HT array cell range in track-phi this range "phiTrkRange" corresponds to. + pair iPhiTrkBinRange = this->HTbase::convertCoordRangeToBinRange( + phiTrkRange, nBinsPhiTrkAxis_, (-maxAbsPhiTrkAxis_), binSizePhiTrkAxis_, killSomeHTCellsRphi_); -void HTrphi::countFirmwareErrors(unsigned int iQoverPtBin, unsigned int iPhiTrkBinMin, unsigned int iPhiTrkBinMax) { - static unsigned int iPhiTrkBinMinLast = 0; - static unsigned int iPhiTrkBinMaxLast = 99999; - // Reinitialize if this is left-most column in HT array. - if (iQoverPtBin == 0) { - iPhiTrkBinMinLast = 0; - iPhiTrkBinMaxLast = 99999; + return iPhiTrkBinRange; } - // Only do check if stub is being stored somewhere in this HT column. - if (iPhiTrkBinMax >= iPhiTrkBinMin) { - //--- Remaining code below checks that firmware could successfully store this stub in this column. - // (a) Does cell lie NE, E or SE of cell filled in previous column? - bool OK_a = (iPhiTrkBinMin + 1 >= iPhiTrkBinMinLast) && (iPhiTrkBinMax <= iPhiTrkBinMaxLast + 1); - // (b) Are no more than 2 cells filled in this column (problem only for Thomas' firmware) - bool OK_b = (iPhiTrkBinMax - iPhiTrkBinMin + 1 <= 2); + //=== Check that limitations of firmware would not prevent stub being stored correctly in this HT column. - if ( ! OK_a ) numErrorsTypeA_++; - if ( ! OK_b ) numErrorsTypeB_++; - numErrorsNormalisation_++; // No. of times a stub is added to an HT column. + void HTrphi::countFirmwareErrors(unsigned int iQoverPtBin, unsigned int iPhiTrkBinMin, unsigned int iPhiTrkBinMax) { + static unsigned int iPhiTrkBinMinLast = 0; + static unsigned int iPhiTrkBinMaxLast = 99999; + // Reinitialize if this is left-most column in HT array. + if (iQoverPtBin == 0) { + iPhiTrkBinMinLast = 0; + iPhiTrkBinMaxLast = 99999; + } - iPhiTrkBinMinLast = iPhiTrkBinMin; - iPhiTrkBinMaxLast = iPhiTrkBinMax; - } -} - -//=== Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). -//=== The helix parameters returned will be those corresponding to the two axes of the HT array. -//=== So they might be (q/pt, phi0) or (q/pt, phi65) etc. depending on the configuration. - -pair HTrphi::helix2Dhough(unsigned int i, unsigned int j) const { - - unsigned int qOverPtBin = i; - unsigned int phiTrkBin = j; - - // If using merged 2x2 cells in low Pt parts of array, must correct for this. - bool merged = false; - if (enableMerge2x2_) { - // Check if this cell is merged with its neighbours (as in low Pt region). - if (this->mergedCell(i, j)) { - merged = true; - // Get location of cell that this cell is merged into (iStore, jStore). - // Calculation assumes HT array has even number of bins in both dimensions. - if (i%2 == 1) qOverPtBin = i - 1; - if (j%2 == 1) phiTrkBin = j - 1; + // Only do check if stub is being stored somewhere in this HT column. + if (iPhiTrkBinMax >= iPhiTrkBinMin) { + //--- Remaining code below checks that firmware could successfully store this stub in this column. + // (a) Does cell lie NE, E or SE of cell filled in previous column? + bool OK_a = (iPhiTrkBinMin + 1 >= iPhiTrkBinMinLast) && (iPhiTrkBinMax <= iPhiTrkBinMaxLast + 1); + // (b) Are no more than 2 cells filled in this column (problem only for Thomas' firmware) + bool OK_b = (iPhiTrkBinMax - iPhiTrkBinMin + 1 <= 2); + + if (!OK_a) + numErrorsTypeA_++; + if (!OK_b) + numErrorsTypeB_++; + numErrorsNormalisation_++; // No. of times a stub is added to an HT column. + + iPhiTrkBinMinLast = iPhiTrkBinMin; + iPhiTrkBinMaxLast = iPhiTrkBinMax; } } - float qOverPtBinCenter = .5; - float phiTrkBinCenter = .5; - - if ( shape_ == 2 || shape_ == 1 || shape_ == 3 ) - qOverPtBinCenter = 0.; + //=== Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). + //=== The helix parameters returned will be those corresponding to the two axes of the HT array. + //=== So they might be (q/pt, phi0) or (q/pt, phi65) etc. depending on the configuration. - if ( shape_ == 2 ) - phiTrkBinCenter = ( qOverPtBin % 2 == 0 ) ? 1. / 6. : 2. / 3.; - else if ( shape_ == 1 ) - phiTrkBinCenter = ( qOverPtBin % 2 == 0 ) ? 0. : 1. / 2.; - else if ( shape_ == 3 ) - phiTrkBinCenter = ( qOverPtBin % 2 == 0 ) ? 1. / 4. : 3. / 4.; + pair HTrphi::helix2Dhough(unsigned int i, unsigned int j) const { + unsigned int qOverPtBin = i; + unsigned int phiTrkBin = j; - float qOverPt = - maxAbsQoverPtAxis_ + ( qOverPtBin + qOverPtBinCenter ) * binSizeQoverPtAxis_; - float phiTrk = - maxAbsPhiTrkAxis_ + ( phiTrkBin + phiTrkBinCenter ) * binSizePhiTrkAxis_; - - if (merged) { - qOverPt += 0.5*binSizeQoverPtAxis_; - phiTrk += 0.5*binSizePhiTrkAxis_; - } - - phiTrk = reco::deltaPhi(phiTrk + phiCentreSector_, 0.); // Correct phiTrk to centre of sector, taking care of 2*pi wrapping - return pair(qOverPt, phiTrk); -} - -//=== Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). -//=== The helix parameters returned will be always be (q/pt, phi0), irrespective of how the axes -//=== of the HT array are defined. - -pair HTrphi::helix2Dconventional(unsigned int i, unsigned int j) const { - // Get the helix parameters corresponding to the axes definitions of the HT. - pair helix2Dht = this->helix2Dhough(i,j); - // Convert to the conventionally agreed pair of helix parameters, (q/pt, phi0). - float qOverPt = helix2Dht.first; // easy - float phi0 = reco::deltaPhi(helix2Dht.second + invPtToDphi_*chosenRofPhi_*qOverPt, 0.); // If HT defined track phi other than at r=0, must correct to get phi0. Allow for 2*pi wrapping of phi. - return pair(qOverPt, phi0); -} - -//=== Which cell in HT array should this TP be in, based on its true trajectory? -//=== (If TP is outside HT array, it it put in the closest bin inside it). - -pair HTrphi::trueCell( const TP* tp ) const { - - // Get HT axis variables corresponding to this TP. - float qOverPt = tp->qOverPt(); - float phiTrk = tp->trkPhiAtR( chosenRofPhi_ ); - // Measure phi relative to centre of sector. - float deltaPhi = reco::deltaPhi(phiTrk, phiCentreSector_); - // Convert to bin numbers inside HT array. - int iQoverPt = floor( ( qOverPt - ( -maxAbsQoverPtAxis_) ) / binSizeQoverPtAxis_ ); - int iPhiTrk = floor( ( deltaPhi - ( -maxAbsPhiTrkAxis_ ) ) / binSizePhiTrkAxis_ ); - // Check if this cell was within the HT array. - if (iQoverPt >= 0 && iQoverPt < int(nBinsQoverPtAxis_) && iPhiTrk >= 0 && iPhiTrk < int(nBinsPhiTrkAxis_)) { - // Check if this cell is merged with its neighbours (as in low Pt region), and if so return merged cell location. - /* - if (this->mergedCell((unsigned int) iQoverPt, (unsigned int) iPhiTrk)) { - if (iQoverPt%2 == 1) iQoverPt -= 1; - if (iPhiTrk%2 == 1) iPhiTrk -= 1; + // If using merged 2x2 cells in low Pt parts of array, must correct for this. + bool merged = false; + if (enableMerge2x2_) { + // Check if this cell is merged with its neighbours (as in low Pt region). + if (this->mergedCell(i, j)) { + merged = true; + // Get location of cell that this cell is merged into (iStore, jStore). + // Calculation assumes HT array has even number of bins in both dimensions. + if (i % 2 == 1) + qOverPtBin = i - 1; + if (j % 2 == 1) + phiTrkBin = j - 1; + } } - */ - } else { - // TP is not in this HT array at all. Flag this by setting "outside" bin index to 0 (Nbins) if outside array below (above). - if (iQoverPt < 0) iQoverPt = 0; - if (iQoverPt >= int(nBinsQoverPtAxis_)) iQoverPt = nBinsQoverPtAxis_ - 1; - if (iPhiTrk < 0) iPhiTrk = 0; - if (iPhiTrk >= int(nBinsPhiTrkAxis_)) iPhiTrk = nBinsPhiTrkAxis_ - 1; - } - return pair(iQoverPt, iPhiTrk); -} -//=== Which cell in HT array should this fitted track be in, based on its fitted trajectory? -//=== Always uses beam-spot constrained trajectory if available. -//=== (If fitted track is outside HT array, it it put in the closest bin inside it). + float qOverPtBinCenter = .5; + float phiTrkBinCenter = .5; -pair HTrphi::getCell( const L1fittedTrack* fitTrk) const { + if (shape_ == 2 || shape_ == 1 || shape_ == 3) + qOverPtBinCenter = 0.; - bool beamConstraint = fitTrk->done_bcon(); // Is beam-spot constraint available? (e.g. 5 param helix fit) - // Get HT axis variables corresponding to this fitted track. - float qOverPt = beamConstraint ? fitTrk->qOverPt_bcon() : fitTrk->qOverPt(); - // Convert phi0 to phi at chosen radius used in HT. - float phiTrk = fitTrk->phiAtChosenR(beamConstraint); - // Measure phi relative to centre of sector. - float deltaPhi = reco::deltaPhi(phiTrk, phiCentreSector_); - // Convert to bin numbers inside HT array. - int iQoverPt = 999999; - int iPhiTrk = 999999; + if (shape_ == 2) + phiTrkBinCenter = (qOverPtBin % 2 == 0) ? 1. / 6. : 2. / 3.; + else if (shape_ == 1) + phiTrkBinCenter = (qOverPtBin % 2 == 0) ? 0. : 1. / 2.; + else if (shape_ == 3) + phiTrkBinCenter = (qOverPtBin % 2 == 0) ? 1. / 4. : 3. / 4.; - if ( shape_ == 0) { + float qOverPt = -maxAbsQoverPtAxis_ + (qOverPtBin + qOverPtBinCenter) * binSizeQoverPtAxis_; + float phiTrk = -maxAbsPhiTrkAxis_ + (phiTrkBin + phiTrkBinCenter) * binSizePhiTrkAxis_; - //--- This is a traditional HT with square cells. + if (merged) { + qOverPt += 0.5 * binSizeQoverPtAxis_; + phiTrk += 0.5 * binSizePhiTrkAxis_; + } - iQoverPt = floor( ( qOverPt - ( -maxAbsQoverPtAxis_) ) / binSizeQoverPtAxis_ ); - iPhiTrk = floor( ( deltaPhi - ( -maxAbsPhiTrkAxis_ ) ) / binSizePhiTrkAxis_ ); + phiTrk = reco::deltaPhi(phiTrk + phiCentreSector_, + 0.); // Correct phiTrk to centre of sector, taking care of 2*pi wrapping + return pair(qOverPt, phiTrk); + } + //=== Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). + //=== The helix parameters returned will be always be (q/pt, phi0), irrespective of how the axes + //=== of the HT array are defined. + + pair HTrphi::helix2Dconventional(unsigned int i, unsigned int j) const { + // Get the helix parameters corresponding to the axes definitions of the HT. + pair helix2Dht = this->helix2Dhough(i, j); + // Convert to the conventionally agreed pair of helix parameters, (q/pt, phi0). + float qOverPt = helix2Dht.first; // easy + float phi0 = reco::deltaPhi( + helix2Dht.second + invPtToDphi_ * chosenRofPhi_ * qOverPt, + 0.); // If HT defined track phi other than at r=0, must correct to get phi0. Allow for 2*pi wrapping of phi. + return pair(qOverPt, phi0); + } + //=== Which cell in HT array should this TP be in, based on its true trajectory? + //=== (If TP is outside HT array, it it put in the closest bin inside it). + + pair HTrphi::trueCell(const TP* tp) const { + // Get HT axis variables corresponding to this TP. + float qOverPt = tp->qOverPt(); + float phiTrk = tp->trkPhiAtR(chosenRofPhi_); + // Measure phi relative to centre of sector. + float deltaPhi = reco::deltaPhi(phiTrk, phiCentreSector_); + // Convert to bin numbers inside HT array. + int iQoverPt = floor((qOverPt - (-maxAbsQoverPtAxis_)) / binSizeQoverPtAxis_); + int iPhiTrk = floor((deltaPhi - (-maxAbsPhiTrkAxis_)) / binSizePhiTrkAxis_); // Check if this cell was within the HT array. if (iQoverPt >= 0 && iQoverPt < int(nBinsQoverPtAxis_) && iPhiTrk >= 0 && iPhiTrk < int(nBinsPhiTrkAxis_)) { // Check if this cell is merged with its neighbours (as in low Pt region), and if so return merged cell location. - // New: because 2nd stage mini HT may recreate tracks from merged cells with finer cell granularity, one can't predict - // if a merged cell was used to create a track merely by looking at its cell location. - // So instead ask L1track3D, which knows if it was created from a merged HT cell or not. - /* + if (this->mergedCell((unsigned int) iQoverPt, (unsigned int) iPhiTrk)) { + if (iQoverPt%2 == 1) iQoverPt -= 1; + if (iPhiTrk%2 == 1) iPhiTrk -= 1; + } + */ + } else { + // TP is not in this HT array at all. Flag this by setting "outside" bin index to 0 (Nbins) if outside array below (above). + if (iQoverPt < 0) + iQoverPt = 0; + if (iQoverPt >= int(nBinsQoverPtAxis_)) + iQoverPt = nBinsQoverPtAxis_ - 1; + if (iPhiTrk < 0) + iPhiTrk = 0; + if (iPhiTrk >= int(nBinsPhiTrkAxis_)) + iPhiTrk = nBinsPhiTrkAxis_ - 1; + } + return pair(iQoverPt, iPhiTrk); + } + + //=== Which cell in HT array should this fitted track be in, based on its fitted trajectory? + //=== Always uses beam-spot constrained trajectory if available. + //=== (If fitted track is outside HT array, it it put in the closest bin inside it). + + pair HTrphi::getCell(const L1fittedTrack* fitTrk) const { + bool beamConstraint = fitTrk->done_bcon(); // Is beam-spot constraint available? (e.g. 5 param helix fit) + // Get HT axis variables corresponding to this fitted track. + float qOverPt = beamConstraint ? fitTrk->qOverPt_bcon() : fitTrk->qOverPt(); + // Convert phi0 to phi at chosen radius used in HT. + float phiTrk = fitTrk->phiAtChosenR(beamConstraint); + // Measure phi relative to centre of sector. + float deltaPhi = reco::deltaPhi(phiTrk, phiCentreSector_); + // Convert to bin numbers inside HT array. + int iQoverPt = 999999; + int iPhiTrk = 999999; + + if (shape_ == 0) { + //--- This is a traditional HT with square cells. + + iQoverPt = floor((qOverPt - (-maxAbsQoverPtAxis_)) / binSizeQoverPtAxis_); + iPhiTrk = floor((deltaPhi - (-maxAbsPhiTrkAxis_)) / binSizePhiTrkAxis_); + + // Check if this cell was within the HT array. + if (iQoverPt >= 0 && iQoverPt < int(nBinsQoverPtAxis_) && iPhiTrk >= 0 && iPhiTrk < int(nBinsPhiTrkAxis_)) { + // Check if this cell is merged with its neighbours (as in low Pt region), and if so return merged cell location. + // New: because 2nd stage mini HT may recreate tracks from merged cells with finer cell granularity, one can't predict + // if a merged cell was used to create a track merely by looking at its cell location. + // So instead ask L1track3D, which knows if it was created from a merged HT cell or not. + + /* if (fitTrk->getL1track3D().mergedHTcell()) { if (iQoverPt%2 == 1) iQoverPt -= 1; if (iPhiTrk%2 == 1) iPhiTrk -= 1; } */ - } else { - // Fitted track is not in this HT array at all. Flag this by setting "outside" bin index to 0 (Nbins-1) if outside array below (above). - if (iQoverPt < 0) iQoverPt = 0; - if (iQoverPt >= int(nBinsQoverPtAxis_)) iQoverPt = nBinsQoverPtAxis_ - 1; - if (iPhiTrk < 0) iPhiTrk = 0; - if (iPhiTrk >= int(nBinsPhiTrkAxis_)) iPhiTrk = nBinsPhiTrkAxis_ - 1; - } + } else { + // Fitted track is not in this HT array at all. Flag this by setting "outside" bin index to 0 (Nbins-1) if outside array below (above). + if (iQoverPt < 0) + iQoverPt = 0; + if (iQoverPt >= int(nBinsQoverPtAxis_)) + iQoverPt = nBinsQoverPtAxis_ - 1; + if (iPhiTrk < 0) + iPhiTrk = 0; + if (iPhiTrk >= int(nBinsPhiTrkAxis_)) + iPhiTrk = nBinsPhiTrkAxis_ - 1; + } - } else { - - //--- This is are novel HT with unusual shaped cells. - - float minD = std::numeric_limits< float >::infinity(); - float d( 0 ); - unsigned int m( 0 ); - for ( auto binCenters : cellCenters_ ) { - unsigned int c( 0 ); - for ( auto cellCenter : binCenters ) { - d = std::pow( ( cellCenter.first - qOverPt ) / (float)binSizeQoverPtAxis_ , 2 ) + std::pow( ( cellCenter.second - phiTrk ) / (float)binSizePhiTrkAxis_ , 2 ); - if ( d < minD ) { - minD = d; - iQoverPt = m; - iPhiTrk = c; + } else { + //--- This is are novel HT with unusual shaped cells. + + float minD = std::numeric_limits::infinity(); + float d(0); + unsigned int m(0); + for (auto binCenters : cellCenters_) { + unsigned int c(0); + for (auto cellCenter : binCenters) { + d = std::pow((cellCenter.first - qOverPt) / (float)binSizeQoverPtAxis_, 2) + + std::pow((cellCenter.second - phiTrk) / (float)binSizePhiTrkAxis_, 2); + if (d < minD) { + minD = d; + iQoverPt = m; + iPhiTrk = c; + } + c++; } - c++; + m++; } - m++; + // Fitted track is not in this HT array at all. Flag this by setting "outside" bin index to 0 (Nbins-1) if outside array below (above). + if (iQoverPt < 0) + iQoverPt = 0; + if (iQoverPt >= int(nBinsQoverPtAxis_)) + iQoverPt = nBinsQoverPtAxis_ - 1; + if (iPhiTrk < 0) + iPhiTrk = 0; + if (iPhiTrk >= int(nBinsPhiTrkAxis_)) + iPhiTrk = nBinsPhiTrkAxis_ - 1; } - // Fitted track is not in this HT array at all. Flag this by setting "outside" bin index to 0 (Nbins-1) if outside array below (above). - if (iQoverPt < 0) iQoverPt = 0; - if (iQoverPt >= int(nBinsQoverPtAxis_)) iQoverPt = nBinsQoverPtAxis_ - 1; - if (iPhiTrk < 0) iPhiTrk = 0; - if (iPhiTrk >= int(nBinsPhiTrkAxis_)) iPhiTrk = nBinsPhiTrkAxis_ - 1; - } - - return pair(iQoverPt, iPhiTrk); -} - -//=== Check if specified cell is merged with its 2x2 neighbours into a single cell, -//=== as it is in low Pt region. -bool HTrphi::mergedCell(unsigned int iQoverPtBin, unsigned int jPhiTrkBin) const { + return pair(iQoverPt, iPhiTrk); + } - bool merge = false; + //=== Check if specified cell is merged with its 2x2 neighbours into a single cell, + //=== as it is in low Pt region. + + bool HTrphi::mergedCell(unsigned int iQoverPtBin, unsigned int jPhiTrkBin) const { + bool merge = false; + + if (enableMerge2x2_) { + unsigned int i = iQoverPtBin; + unsigned int j = jPhiTrkBin; + + // Calculate number of merged bins on each q/Pt side of array. + float fMergeBins = (maxAbsQoverPtAxis_ - minInvPtToMerge2x2_) / (2. * binSizeQoverPtAxis_); + // Number of unmerged bins this corresponds to, which must be even, since each merged bin comprises two normal q/pt bins. + unsigned int numQoverPtBinsToMerge = 2 * min((unsigned int)(std::round(fMergeBins)), (nBinsQoverPtAxis_ / 4)); + // IRT - bug fix + const float small = 0.001; + if (minInvPtToMerge2x2_ < small && (unsigned int)(std::round(2. * fMergeBins)) % 2 == 1) + numQoverPtBinsToMerge++; + unsigned int iB = (nBinsQoverPtAxis_ - 1) - i; // Count backwards across array. + if (min(i, iB) < numQoverPtBinsToMerge) + merge = true; + } - if (enableMerge2x2_) { - unsigned int i = iQoverPtBin; - unsigned int j = jPhiTrkBin; + return merge; + } - // Calculate number of merged bins on each q/Pt side of array. - float fMergeBins = (maxAbsQoverPtAxis_ - minInvPtToMerge2x2_)/(2.*binSizeQoverPtAxis_); - // Number of unmerged bins this corresponds to, which must be even, since each merged bin comprises two normal q/pt bins. - unsigned int numQoverPtBinsToMerge = 2 * min( (unsigned int)(std::round(fMergeBins)), (nBinsQoverPtAxis_/4) ); - // IRT - bug fix - const float small = 0.001; - if (minInvPtToMerge2x2_ < small && (unsigned int)(std::round(2.*fMergeBins))%2 == 1) numQoverPtBinsToMerge++; - unsigned int iB = (nBinsQoverPtAxis_ - 1) - i; // Count backwards across array. - if (min(i, iB) < numQoverPtBinsToMerge) merge = true; + //=== Calculate maximum |gradient| that any stub's line across this HT array could have, so can check it doesn't exceed 1. + + float HTrphi::calcMaxLineGradArray() const { + // Get max. |gradient| possible in this HT array. + float gradOuter = fabs(invPtToDphi_ * (settings_->trackerOuterRadius() - chosenRofPhi_)); + float gradInner = fabs(invPtToDphi_ * (settings_->trackerInnerRadius() - chosenRofPhi_)); + float maxGrad = max(gradOuter, gradInner); + // Convert it to units of bin width. + maxGrad *= binSizeQoverPtAxis_ / binSizePhiTrkAxis_; + if (shape_ == 2) + maxGrad *= 3.; + else if (shape_ == 1) + maxGrad *= 2.; + else if (shape_ == 3) + maxGrad *= 4.; + return maxGrad; } - return merge; -} - -//=== Calculate maximum |gradient| that any stub's line across this HT array could have, so can check it doesn't exceed 1. - -float HTrphi::calcMaxLineGradArray() const { - // Get max. |gradient| possible in this HT array. - float gradOuter = fabs(invPtToDphi_ * (settings_->trackerOuterRadius() - chosenRofPhi_)); - float gradInner = fabs(invPtToDphi_ * (settings_->trackerInnerRadius() - chosenRofPhi_)); - float maxGrad = max(gradOuter, gradInner); - // Convert it to units of bin width. - maxGrad *= binSizeQoverPtAxis_ / binSizePhiTrkAxis_; - if ( shape_ == 2 ) - maxGrad *= 3.; - else if ( shape_ == 1 ) - maxGrad *= 2.; - else if ( shape_ == 3 ) - maxGrad *= 4.; - return maxGrad; -} - -//=== If requested, kill those tracks in this sector that can't be read out during the time-multiplexed period, because -//=== the HT has associated too many stubs to tracks. - -vector HTrphi::killTracksBusySec(const vector& tracks) const { - - vector outTracks; - - if (busySectorKill_) { - - unsigned int nStubsOut = 0; // #stubs assigned to tracks in this sector. - vector nStubsOutInRange(busySectorMbinRanges_.size(), 0); // #stubs assigned to each m bin range in this sector. - - for (const L1track2D& trk : tracks) { - bool keep = true; - unsigned int nStubs = trk.getNumStubs(); // #stubs on this track. - if (busySectorUseMbinRanges_) { // Are tracks from different m bin ranges output seperately to increase bandwidth? - unsigned int mBinRange = this->getMbinRange(trk); // Which m bin range is this track in? - nStubsOutInRange[ mBinRange ] += nStubs; - if (nStubsOutInRange[ mBinRange ] > busySectorNumStubs_) keep = false; - } else { - nStubsOut += nStubs; - if (nStubsOut > busySectorNumStubs_) keep = false; + //=== If requested, kill those tracks in this sector that can't be read out during the time-multiplexed period, because + //=== the HT has associated too many stubs to tracks. + + vector HTrphi::killTracksBusySec(const vector& tracks) const { + vector outTracks; + + if (busySectorKill_) { + unsigned int nStubsOut = 0; // #stubs assigned to tracks in this sector. + vector nStubsOutInRange(busySectorMbinRanges_.size(), + 0); // #stubs assigned to each m bin range in this sector. + + for (const L1track2D& trk : tracks) { + bool keep = true; + unsigned int nStubs = trk.getNumStubs(); // #stubs on this track. + if (busySectorUseMbinRanges_) { // Are tracks from different m bin ranges output seperately to increase bandwidth? + unsigned int mBinRange = this->getMbinRange(trk); // Which m bin range is this track in? + nStubsOutInRange[mBinRange] += nStubs; + if (nStubsOutInRange[mBinRange] > busySectorNumStubs_) + keep = false; + } else { + nStubsOut += nStubs; + if (nStubsOut > busySectorNumStubs_) + keep = false; + } + + if (keep) + outTracks.push_back(trk); } - if (keep) outTracks.push_back(trk); + } else { + outTracks = tracks; } - } else { + return outTracks; + } - outTracks = tracks; + //=== Define the order in which the hardware processes rows of the HT array when it outputs track candidates. + //=== Currently corresponds to highest Pt tracks first. + //=== If two tracks have the same Pt, the -ve charge one is output before the +ve charge one. - } + vector HTrphi::rowOrder(unsigned int numRows) const { + vector iOrder; - return outTracks; -} - -//=== Define the order in which the hardware processes rows of the HT array when it outputs track candidates. -//=== Currently corresponds to highest Pt tracks first. -//=== If two tracks have the same Pt, the -ve charge one is output before the +ve charge one. - -vector HTrphi::rowOrder(unsigned int numRows) const { - vector iOrder; - - // Logic slightly different depending on whether HT array has even or odd number of rows. - const bool oddNumRows = (numRows%2 == 1); - - // This selects middle rows first before moving to exterior ones. - if (oddNumRows) { - unsigned int middleRow = (numRows - 1)/2; - iOrder.push_back(middleRow); - for (unsigned int i = 1; i <= (numRows - 1)/2; i++) { - iOrder.push_back(middleRow - i); // -ve charge - iOrder.push_back(middleRow + i); // +ve charge - } - } else { - unsigned int startRowPos = numRows/2; - unsigned int startRowNeg = startRowPos - 1; - for (unsigned int i = 0; i < numRows/2; i++) { - iOrder.push_back(startRowNeg - i); // -ve charge - iOrder.push_back(startRowPos + i); // +ve charge + // Logic slightly different depending on whether HT array has even or odd number of rows. + const bool oddNumRows = (numRows % 2 == 1); + + // This selects middle rows first before moving to exterior ones. + if (oddNumRows) { + unsigned int middleRow = (numRows - 1) / 2; + iOrder.push_back(middleRow); + for (unsigned int i = 1; i <= (numRows - 1) / 2; i++) { + iOrder.push_back(middleRow - i); // -ve charge + iOrder.push_back(middleRow + i); // +ve charge + } + } else { + unsigned int startRowPos = numRows / 2; + unsigned int startRowNeg = startRowPos - 1; + for (unsigned int i = 0; i < numRows / 2; i++) { + iOrder.push_back(startRowNeg - i); // -ve charge + iOrder.push_back(startRowPos + i); // +ve charge + } } - } - return iOrder; -} + return iOrder; + } -} +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/Histos.cc b/L1Trigger/TrackFindingTMTT/src/Histos.cc index 3a8d29757b848..cf7718bffb8bc 100644 --- a/L1Trigger/TrackFindingTMTT/src/Histos.cc +++ b/L1Trigger/TrackFindingTMTT/src/Histos.cc @@ -29,1374 +29,1607 @@ using namespace std; namespace TMTT { -//=== Store cfg parameters. - -Histos::Histos(const Settings* settings) : settings_(settings), plotFirst_(true), bApproxMistake_(false) { - genMinStubLayers_ = settings->genMinStubLayers(); - numPhiSectors_ = settings->numPhiSectors(); - numEtaRegions_ = settings->numEtaRegions(); - houghMinPt_ = settings->houghMinPt(); - houghNbinsPt_ = settings->houghNbinsPt(); - houghNbinsPhi_ = settings->houghNbinsPhi(); - chosenRofZ_ = settings->chosenRofZ(); - trackFitters_ = settings->trackFitters(); - useRZfilter_ = settings->useRZfilter(); - ranRZfilter_ = (useRZfilter_.size() > 0); // Was any r-z track filter run? - resPlotOpt_ = settings->resPlotOpt(); // Only use signal events for helix resolution plots? -} - -//=== Book all histograms - -void Histos::book() { - // Don't bother booking histograms if user didn't request them via TFileService in their cfg. - if ( ! this->enabled() ) return; - - TH1::SetDefaultSumw2(true); - - // Book histograms about input data. - this->bookInputData(); - // Book histograms checking if (eta,phi) sector definition choices are good. - this->bookEtaPhiSectors(); - // Book histograms checking filling of r-phi HT array. - this->bookRphiHT(); - // Book histograms about r-z track filters. - if (ranRZfilter_) this->bookRZfilters(); - // Book histograms for studying freak, extra large events at HT. - this->bookStudyBusyEvents(); - // Book histograms studying 3D track candidates found after HT. - this->bookTrackCands("HT"); - // Book histograms studying 3D track candidates found after r-z track filter. - if (ranRZfilter_) this->bookTrackCands("RZ"); - // Book histograms studying track fitting performance - this->bookTrackFitting(); -} - -//=== Fill all histograms - -void Histos::fill(const InputData& inputData, const matrix& mSectors, const matrix& mHtRphis, - const matrix mGet3Dtrks, const std::map>& fittedTracks) -{ - // Don't bother filling histograms if user didn't request them via TFileService in their cfg. - if ( ! this->enabled() ) return; - - // Fill histograms about input data. - this->fillInputData(inputData); - // Fill histograms checking if (eta,phi) sector definition choices are good. - this->fillEtaPhiSectors(inputData, mSectors); - // Fill histograms checking filling of r-phi HT array. - this->fillRphiHT(mHtRphis); - // Fill histograms about r-z track filters. - if (ranRZfilter_) this->fillRZfilters(mGet3Dtrks); - // Fill histograms for studying freak, extra large events at HT. - this->fillStudyBusyEvents(inputData, mSectors, mHtRphis, mGet3Dtrks); - // Fill histograms studying 3D track candidates found after HT. - vector tracksHT; - bool withRZfilter = false; - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); - const std::vector< L1track3D >& tracks = get3Dtrk.trackCands3D(withRZfilter); - tracksHT.insert(tracksHT.end(), tracks.begin(), tracks.end()); + //=== Store cfg parameters. + + Histos::Histos(const Settings* settings) : settings_(settings), plotFirst_(true), bApproxMistake_(false) { + genMinStubLayers_ = settings->genMinStubLayers(); + numPhiSectors_ = settings->numPhiSectors(); + numEtaRegions_ = settings->numEtaRegions(); + houghMinPt_ = settings->houghMinPt(); + houghNbinsPt_ = settings->houghNbinsPt(); + houghNbinsPhi_ = settings->houghNbinsPhi(); + chosenRofZ_ = settings->chosenRofZ(); + trackFitters_ = settings->trackFitters(); + useRZfilter_ = settings->useRZfilter(); + ranRZfilter_ = (useRZfilter_.size() > 0); // Was any r-z track filter run? + resPlotOpt_ = settings->resPlotOpt(); // Only use signal events for helix resolution plots? } - this->fillTrackCands(inputData, tracksHT, "HT"); - // Fill histograms studying 3D track candidates found after r-z track filter. - if (ranRZfilter_) { - vector tracksRZ; - bool withRZfilter = true; - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); - const std::vector< L1track3D >& tracks = get3Dtrk.trackCands3D(withRZfilter); - tracksRZ.insert(tracksRZ.end(), tracks.begin(), tracks.end()); - } - this->fillTrackCands(inputData, tracksRZ, "RZ"); + + //=== Book all histograms + + void Histos::book() { + // Don't bother booking histograms if user didn't request them via TFileService in their cfg. + if (!this->enabled()) + return; + + TH1::SetDefaultSumw2(true); + + // Book histograms about input data. + this->bookInputData(); + // Book histograms checking if (eta,phi) sector definition choices are good. + this->bookEtaPhiSectors(); + // Book histograms checking filling of r-phi HT array. + this->bookRphiHT(); + // Book histograms about r-z track filters. + if (ranRZfilter_) + this->bookRZfilters(); + // Book histograms for studying freak, extra large events at HT. + this->bookStudyBusyEvents(); + // Book histograms studying 3D track candidates found after HT. + this->bookTrackCands("HT"); + // Book histograms studying 3D track candidates found after r-z track filter. + if (ranRZfilter_) + this->bookTrackCands("RZ"); + // Book histograms studying track fitting performance + this->bookTrackFitting(); } - // Fill histograms studying track fitting performance - this->fillTrackFitting(inputData, fittedTracks); -} - -//=== Book histograms using input stubs and tracking particles. - -TFileDirectory Histos::bookInputData() { - TFileDirectory inputDir = fs_->mkdir("InputData"); - - // N.B. Histograms of the kinematics and production vertex of tracking particles - // are booked in bookTrackCands(), since they are used to study the tracking efficiency. - - hisNumEvents_ = inputDir.make("NumEvents",";; No. of events",1,-0.5,0.5); - - // Count stubs & tracking particles. - - profNumStubs_ = inputDir.make("NumStubs","; Category; No. stubs in tracker",4,0.5,4.5); - profNumStubs_->GetXaxis()->SetBinLabel(1,"All stubs"); - profNumStubs_->GetXaxis()->SetBinLabel(2,"Genuine stubs"); - profNumStubs_->GetXaxis()->SetBinLabel(3,"Stubs matched to TP"); - profNumStubs_->GetXaxis()->SetBinLabel(4,"Stubs matched to TP for eff"); - profNumStubs_->LabelsOption("d"); - - hisStubsVsEta_ = inputDir.make("StubsVsEta","; #eta; No. stubs in tracker",30,-3.0,3.0); - hisStubsVsR_ = inputDir.make("StubsVsR","; radius (cm); No. stubs in tracker",1200,0.,120.); - - hisStubsVsRVsZ_ = inputDir.make("StubsVsRVsZ","; z (cm); radius (cm); No. stubs in tracker",1000,-280,280,1000,0,130); - hisStubsModuleVsRVsZ_ = inputDir.make("StubsModuleVsRVsZ","; z (cm); radius (cm); No. stubs in tracker",1000,-280,280,1000,0,130); - hisStubsVsRVsPhi_ = inputDir.make("StubsVsRVsPhi","; x (cm); y (cm); No. stubs in tracker",1000,-130,130,1000,-130,130); - hisStubsModuleVsRVsPhi_ = inputDir.make("StubsModuleVsRVsPhi","; x (cm); y (cm); No. stubs in tracker",1000,-130,130,1000,-130,130); - hisStubsModuleTiltVsZ_ = inputDir.make("StubsModuleTiltVsZ","; z (cm); Tilt; Module tilt vs z",1000,-280,280,128,-3.2,3.2); - hisStubsdPhiCorrectionVsZ_ = inputDir.make("StubsdPhiCorrectionVsZ","; z (cm); Correction; dPhi Correction vs z",1000,-280,280,100,-1,10); - - hisStubsVsRVsZ_outerModuleAtSmallerR_ = inputDir.make("StubsVsRVsZ_outerModuleAtSmallerR","; z (cm); radius (cm); No. stubs in tracker",1000,-280,280,1000,0,130); - hisStubsVsRVsPhi_outerModuleAtSmallerR_ = inputDir.make("StubsVsRVsPhi_outerModuleAtSmallerR","; x (cm); y (cm); No. stubs in tracker",1000,-130,130,1000,-130,130); - - profNumTPs_ = inputDir.make("NumTPs","; Category; No. of TPs in tracker",3,0.5,3.5); - profNumTPs_->GetXaxis()->SetBinLabel(1,"All TPs"); - profNumTPs_->GetXaxis()->SetBinLabel(2,"TPs for eff."); - profNumTPs_->GetXaxis()->SetBinLabel(3,"TPs for alg. eff."); - profNumTPs_->LabelsOption("d"); - - hisNumStubsPerTP_ = inputDir.make("NumStubsPerTP","; Number of stubs per TP for alg. eff.",50,-0.5,49.5); - hisNumPSStubsPerTP_ = inputDir.make("NumPSStubsPerTP","; Number of PS stubs per TP for alg. eff.",50,-0.5,49.5); - hisNum2SStubsPerTP_ = inputDir.make("Num2SStubsPerTP","; Number of 2S stubs per TP for alg. eff.",50,-0.5,49.5); - - hisNumLayersPerTP_ = inputDir.make("NumLayersPerTP","; Number of layers per TP for alg. eff.",50,-0.5,49.5); - hisNumPSLayersPerTP_ = inputDir.make("NumPSLayersPerTP","; Number of PS layers per TP for alg. eff.",50,-0.5,49.5); - hisNum2SLayersPerTP_ = inputDir.make("Num2SLayersPerTP","; Number of 2S layers per TP for alg. eff.",50,-0.5,49.5); - - hisNumLayersPerTP_muons_ = inputDir.make("NumLayersPerTP_muons","; Number of layers per TP for alg. eff.",50,-0.5,49.5); - hisNumPSLayersPerTP_muons_ = inputDir.make("NumPSLayersPerTP_muons","; Number of PS layers per TP for alg. eff.",50,-0.5,49.5); - hisNum2SLayersPerTP_muons_ = inputDir.make("Num2SLayersPerTP_muons","; Number of 2S layers per TP for alg. eff.",50,-0.5,49.5); - - hisNumLayersPerTP_electrons_ = inputDir.make("NumLayersPerTP_electrons","; Number of layers per TP for alg. eff.",50,-0.5,49.5); - hisNumPSLayersPerTP_electrons_ = inputDir.make("NumPSLayersPerTP_electrons","; Number of PS layers per TP for alg. eff.",50,-0.5,49.5); - hisNum2SLayersPerTP_electrons_ = inputDir.make("Num2SLayersPerTP_electrons","; Number of 2S layers per TP for alg. eff.",50,-0.5,49.5); - - hisNumLayersPerTP_pions_ = inputDir.make("NumLayersPerTP_pions","; Number of layers per TP for alg. eff.",50,-0.5,49.5); - hisNumPSLayersPerTP_pions_ = inputDir.make("NumPSLayersPerTP_pions","; Number of PS layers per TP for alg. eff.",50,-0.5,49.5); - hisNum2SLayersPerTP_pions_ = inputDir.make("Num2SLayersPerTP_pions","; Number of 2S layers per TP for alg. eff.",50,-0.5,49.5); - - hisNumLayersPerTP_lowPt_ = inputDir.make("NumLayersPerTP_lowPt","; Number of layers per TP for alg. eff.",50,-0.5,49.5); - hisNumPSLayersPerTP_lowPt_ = inputDir.make("NumPSLayersPerTP_lowPt","; Number of PS layers per TP for alg. eff.",50,-0.5,49.5); - hisNum2SLayersPerTP_lowPt_ = inputDir.make("Num2SLayersPerTP_lowPt","; Number of 2S layers per TP for alg. eff.",50,-0.5,49.5); - - hisNumLayersPerTP_mediumPt_ = inputDir.make("NumLayersPerTP_mediumPt","; Number of layers per TP for alg. eff.",50,-0.5,49.5); - hisNumPSLayersPerTP_mediumPt_ = inputDir.make("NumPSLayersPerTP_mediumPt","; Number of PS layers per TP for alg. eff.",50,-0.5,49.5); - hisNum2SLayersPerTP_mediumPt_ = inputDir.make("Num2SLayersPerTP_mediumPt","; Number of 2S layers per TP for alg. eff.",50,-0.5,49.5); - - hisNumLayersPerTP_highPt_ = inputDir.make("NumLayersPerTP_highPt","; Number of layers per TP for alg. eff.",50,-0.5,49.5); - hisNumPSLayersPerTP_highPt_ = inputDir.make("NumPSLayersPerTP_highPt","; Number of PS layers per TP for alg. eff.",50,-0.5,49.5); - hisNum2SLayersPerTP_highPt_ = inputDir.make("Num2SLayersPerTP_highPt","; Number of 2S layers per TP for alg. eff.",50,-0.5,49.5); - - // Study efficiency of tightened front end-electronics cuts. - - hisStubKillFE_ = inputDir.make("StubKillFE","; barrelLayer or 10+endcapRing; Stub fraction rejected by readout chip",30,-0.5,29.5); - hisStubIneffiVsInvPt_ = inputDir.make("StubIneffiVsPt","; 1/Pt; Inefficiency of readout chip for good stubs",30,0.0,1.0); - hisStubIneffiVsEta_ = inputDir.make("StubIneffiVsEta","; |#eta|; Inefficiency of readout chip for good stubs",30,0.0,3.0); - hisStubKillDegradeBend_ = inputDir.make("StubKillDegradeBend","; barrelLayer or 10+endcapRing; Stub fraction killed by DegradeBend.h window cut",30,-0.5,29.5); - - // Study stub resolution. - - hisPtStub_ = inputDir.make("PtStub","; Stub q/Pt",50,-0.5,0.5); - hisPtResStub_ = inputDir.make("PtResStub","; Stub q/Pt minus TP q/Pt",50,-0.5,0.5); - hisBendFilterPower_ = inputDir.make("BendFilterPower","; Fraction of q/Pt range allowed",102,-0.01,1.01); - hisDelPhiStub_ = inputDir.make("DelPhiStub","; Stub bend angle",50,-0.2,0.2); - hisDelPhiResStub_ = inputDir.make("DelPhiResStub","; Stub bend angle minus TP bend angle",200,-0.2,0.2); - - hisDelPhiResStub_tilted_ = inputDir.make("DelPhiResStub_tilted","; Stub bend angle minus TP bend angle",200,-0.2,0.2); - hisDelPhiResStub_notTilted_ = inputDir.make("DelPhiResStub_notTilted","; Stub bend angle minus TP bend angle",200,-0.2,0.2); - - hisBendStub_ = inputDir.make("BendStub","; Stub bend in units of strips",57,-7.125,7.125); - hisBendResStub_ = inputDir.make("BendResStub","; Stub bend minus TP bend in units of strips",100,-5.,5.); - hisNumMergedBend_ = inputDir.make("NumMergedBend","; No. of bend values merged together by loss of bit",10,-0.5,9.5); - hisBendVsLayerOrRingPS_ = inputDir.make("BendVsLayerOrRingPS","; PS barrelLayer or 10+endcapRing; Stub bend",30,-0.5,29.5,57,-7.125,7.125); - hisBendVsLayerOrRing2S_ = inputDir.make("BendVsLayerOrRing2S","; 2S barrelLayer or 10+endcapRing; Stub bend",30,-0.5,29.5,57,-7.125,7.125); - hisBendFEVsLayerOrRingPS_ = inputDir.make("BendFEVsLayerOrRingPS","; PS barrelLayer or 10+endcapRing; Stub bend in FE chip",30,-0.5,29.5,57,-7.125,7.125); - hisBendFEVsLayerOrRing2S_ = inputDir.make("BendFEVsLayerOrRing2S","; 2S barrelLayer or 10+endcapRing; Stub bend in FE chip",30,-0.5,29.5,57,-7.125,7.125); - - hisPhiStubVsPhiTP_ = inputDir.make("PhiStubVsPhiTP","; Stub #phi minus TP #phi at stub radius",100,-0.05,0.05); - hisPhiStubVsPhi0TP_ = inputDir.make("PhiStubVsPhi0TP","; Stub #phi minus TP #phi0",100,-0.3,0.3); - hisPhi0StubVsPhi0TP_ = inputDir.make("Phi0StubVsPhi0TP","; #phi0 of Stub minus TP",100,-0.2,0.2); - hisPhi0StubVsPhi0TPres_= inputDir.make("Phi0StubVsPhi0TPres","; #phi0 of Stub minus TP / resolution",100,-5.0,5.0); - hisPhiStubVsPhi65TP_ = inputDir.make("PhiStubVsPhi65TP","; Stub #phi minus TP phitrk65",100,-0.2,0.2); - hisPhi65StubVsPhi65TP_ = inputDir.make("Phi65StubVsPhi65TP","; phitrk65 of Stub minus TP",100,-0.2,0.2); - hisPhi65StubVsPhi65TPres_ = inputDir.make("Phi65StubVsPhi65TPres","; phitrk65 of Stub minus TP / resolution",100,-5.0,5.0); - - // Note ratio of sensor pitch to separation (needed to understand how many bits this can be packed into). - hisPitchOverSep_ = inputDir.make("PitchOverSep","; ratio of sensor pitch / separation",100,0.0,0.1); - hisRhoParameter_ = inputDir.make("RhoParameter","; rho parameter",100,0.0,0.2); - // Check alpha correction. - hisAlphaCheck_ = inputDir.make("AlphaCheck", "; #phi from stub; #phi from strip",40,-0.2,0.2,40,-0.2,0.2); - // Count stubs sharing a common cluster. - hisFracStubsSharingClus0_ = inputDir.make("FracStubsSharingClus0","Fraction of stubs sharing cluster in seed sensor",102,-0.01,1.01); - hisFracStubsSharingClus1_ = inputDir.make("FracStubsSharingClus1","Fraction of stubs sharing cluster in correlation sensor",102,-0.01,1.01); - - hisStubB_ = inputDir.make("StubB","Variable B for all stubs on TP",100,0.9,10); - hisStubBApproxDiff_tilted_ = inputDir.make("StubBApproxDiff_tilted_","Difference between exact and approximate values for B",100,-1,1); - - // Histos for denominator of tracking efficiency - float maxAbsQoverPt = 1. / houghMinPt_; // Max. |q/Pt| covered by HT array. - unsigned int nPhi = numPhiSectors_; - unsigned int nEta = numEtaRegions_; - hisTPinvptForEff_ = inputDir.make("TPinvptForEff", "; 1/Pt of TP (used for effi. measurement);",24,0.,1.5*maxAbsQoverPt); - hisTPptForEff_ = inputDir.make("TPptForEff", "; Pt of TP (used for effi. measurement);",25,0.0,100.0); - hisTPetaForEff_ = inputDir.make("TPetaForEff","; #eta of TP (used for effi. measurement);",20,-3.,3.); - hisTPphiForEff_ = inputDir.make("TPphiForEff","; #phi of TP (used for effi. measurement);",20,-M_PI,M_PI); - hisTPd0ForEff_ = inputDir.make("TPd0ForEff", "; d0 of TP (used for effi. measurement);",40,0.,4.); - hisTPz0ForEff_ = inputDir.make("TPz0ForEff", "; z0 of TP (used for effi. measurement);",50,0.,25.); - // - hisTPinvptForAlgEff_ = inputDir.make("TPinvptForAlgEff", "; 1/Pt of TP (used for alg. effi. measurement);",24,0.,1.5*maxAbsQoverPt); - hisTPptForAlgEff_ = inputDir.make("TPptForAlgEff", "; Pt of TP (used for alg. effi. measurement);",25,0.0,100.0); - hisTPetaForAlgEff_ = inputDir.make("TPetaForAlgEff","; #eta of TP (used for alg. effi. measurement);",20,-3.,3.); - hisTPphiForAlgEff_ = inputDir.make("TPphiForAlgEff","; #phi of TP (used for alg. effi. measurement);",20,-M_PI,M_PI); - hisTPd0ForAlgEff_ = inputDir.make("TPd0ForAlgEff", "; d0 of TP (used for alg. effi. measurement);",40,0.,4.); - hisTPz0ForAlgEff_ = inputDir.make("TPz0ForAlgEff", "; z0 of TP (used for alg. effi. measurement);",50,0.,25.); - // - hisTPphisecForAlgEff_ = inputDir.make("TPphisecForAlgEff", "; #phi sectorof TP (used for alg. effi. measurement);",nPhi,-0.5,nPhi-0.5); - hisTPetasecForAlgEff_ = inputDir.make("TPetasecForAlgEff", "; #eta sector of TP (used for alg. effi. measurement);",nEta,-0.5,nEta-0.5); - // - hisTPinvptForAlgEff_inJetPtG30_ = inputDir.make("TPinvptForAlgEff_inJetPtG30", "; 1/Pt of TP (used for effi. measurement);",24,0.,1.5*maxAbsQoverPt); - hisTPinvptForAlgEff_inJetPtG100_ = inputDir.make("TPinvptForAlgEff_inJetPtG100", "; 1/Pt of TP (used for effi. measurement);",24,0.,1.5*maxAbsQoverPt); - hisTPinvptForAlgEff_inJetPtG200_ = inputDir.make("TPinvptForAlgEff_inJetPtG200", "; 1/Pt of TP (used for effi. measurement);",24,0.,1.5*maxAbsQoverPt); - - return inputDir; -} - -//=== Fill histograms using input stubs and tracking particles. - -void Histos::fillInputData(const InputData& inputData) { - const vector& vStubs = inputData.getStubs(); - const vector& vTPs = inputData.getTPs(); - - hisNumEvents_->Fill(0.); - - // Count stubs. - unsigned int nStubsGenuine = 0; - unsigned int nStubsWithTP = 0; - unsigned int nStubsWithTPforEff = 0; - for (const Stub* stub : vStubs) { - if (stub->genuine()) { - nStubsGenuine++; - if (stub->assocTP() != nullptr) { - nStubsWithTP++; - if (stub->assocTP()->useForEff()) nStubsWithTPforEff++; + + //=== Fill all histograms + + void Histos::fill(const InputData& inputData, + const matrix& mSectors, + const matrix& mHtRphis, + const matrix mGet3Dtrks, + const std::map>& fittedTracks) { + // Don't bother filling histograms if user didn't request them via TFileService in their cfg. + if (!this->enabled()) + return; + + // Fill histograms about input data. + this->fillInputData(inputData); + // Fill histograms checking if (eta,phi) sector definition choices are good. + this->fillEtaPhiSectors(inputData, mSectors); + // Fill histograms checking filling of r-phi HT array. + this->fillRphiHT(mHtRphis); + // Fill histograms about r-z track filters. + if (ranRZfilter_) + this->fillRZfilters(mGet3Dtrks); + // Fill histograms for studying freak, extra large events at HT. + this->fillStudyBusyEvents(inputData, mSectors, mHtRphis, mGet3Dtrks); + // Fill histograms studying 3D track candidates found after HT. + vector tracksHT; + bool withRZfilter = false; + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); + const std::vector& tracks = get3Dtrk.trackCands3D(withRZfilter); + tracksHT.insert(tracksHT.end(), tracks.begin(), tracks.end()); } + this->fillTrackCands(inputData, tracksHT, "HT"); + // Fill histograms studying 3D track candidates found after r-z track filter. + if (ranRZfilter_) { + vector tracksRZ; + bool withRZfilter = true; + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); + const std::vector& tracks = get3Dtrk.trackCands3D(withRZfilter); + tracksRZ.insert(tracksRZ.end(), tracks.begin(), tracks.end()); + } + this->fillTrackCands(inputData, tracksRZ, "RZ"); } + // Fill histograms studying track fitting performance + this->fillTrackFitting(inputData, fittedTracks); } - profNumStubs_->Fill(1, vStubs.size()); - profNumStubs_->Fill(2, nStubsGenuine); - profNumStubs_->Fill(3, nStubsWithTP); - profNumStubs_->Fill(4, nStubsWithTPforEff); - - for (const Stub* stub : vStubs) { - hisStubsVsEta_->Fill(stub->eta()); - hisStubsVsR_->Fill(stub->r()); - hisStubsVsRVsZ_->Fill( stub->z(), stub->r() ); - hisStubsModuleVsRVsZ_->Fill( stub->minZ(), stub->minR() ); - hisStubsModuleVsRVsZ_->Fill( stub->maxZ(), stub->maxR() ); - - hisStubsModuleTiltVsZ_->Fill( stub->minZ(), stub->moduleTilt() ); - hisStubsModuleTiltVsZ_->Fill( stub->maxZ(), stub->moduleTilt() ); - if ( stub->barrel() && stub->outerModuleAtSmallerR() ) { - hisStubsVsRVsZ_outerModuleAtSmallerR_->Fill( stub->z(), stub->r() ); - } - - hisStubsdPhiCorrectionVsZ_->Fill( stub->minZ(), stub->dphiOverBendCorrection() ); + //=== Book histograms using input stubs and tracking particles. + + TFileDirectory Histos::bookInputData() { + TFileDirectory inputDir = fs_->mkdir("InputData"); + + // N.B. Histograms of the kinematics and production vertex of tracking particles + // are booked in bookTrackCands(), since they are used to study the tracking efficiency. + + hisNumEvents_ = inputDir.make("NumEvents", ";; No. of events", 1, -0.5, 0.5); + + // Count stubs & tracking particles. + + profNumStubs_ = inputDir.make("NumStubs", "; Category; No. stubs in tracker", 4, 0.5, 4.5); + profNumStubs_->GetXaxis()->SetBinLabel(1, "All stubs"); + profNumStubs_->GetXaxis()->SetBinLabel(2, "Genuine stubs"); + profNumStubs_->GetXaxis()->SetBinLabel(3, "Stubs matched to TP"); + profNumStubs_->GetXaxis()->SetBinLabel(4, "Stubs matched to TP for eff"); + profNumStubs_->LabelsOption("d"); + + hisStubsVsEta_ = inputDir.make("StubsVsEta", "; #eta; No. stubs in tracker", 30, -3.0, 3.0); + hisStubsVsR_ = inputDir.make("StubsVsR", "; radius (cm); No. stubs in tracker", 1200, 0., 120.); + + hisStubsVsRVsZ_ = inputDir.make( + "StubsVsRVsZ", "; z (cm); radius (cm); No. stubs in tracker", 1000, -280, 280, 1000, 0, 130); + hisStubsModuleVsRVsZ_ = inputDir.make( + "StubsModuleVsRVsZ", "; z (cm); radius (cm); No. stubs in tracker", 1000, -280, 280, 1000, 0, 130); + hisStubsVsRVsPhi_ = inputDir.make( + "StubsVsRVsPhi", "; x (cm); y (cm); No. stubs in tracker", 1000, -130, 130, 1000, -130, 130); + hisStubsModuleVsRVsPhi_ = inputDir.make( + "StubsModuleVsRVsPhi", "; x (cm); y (cm); No. stubs in tracker", 1000, -130, 130, 1000, -130, 130); + hisStubsModuleTiltVsZ_ = + inputDir.make("StubsModuleTiltVsZ", "; z (cm); Tilt; Module tilt vs z", 1000, -280, 280, 128, -3.2, 3.2); + hisStubsdPhiCorrectionVsZ_ = inputDir.make( + "StubsdPhiCorrectionVsZ", "; z (cm); Correction; dPhi Correction vs z", 1000, -280, 280, 100, -1, 10); + + hisStubsVsRVsZ_outerModuleAtSmallerR_ = inputDir.make("StubsVsRVsZ_outerModuleAtSmallerR", + "; z (cm); radius (cm); No. stubs in tracker", + 1000, + -280, + 280, + 1000, + 0, + 130); + hisStubsVsRVsPhi_outerModuleAtSmallerR_ = inputDir.make("StubsVsRVsPhi_outerModuleAtSmallerR", + "; x (cm); y (cm); No. stubs in tracker", + 1000, + -130, + 130, + 1000, + -130, + 130); + + profNumTPs_ = inputDir.make("NumTPs", "; Category; No. of TPs in tracker", 3, 0.5, 3.5); + profNumTPs_->GetXaxis()->SetBinLabel(1, "All TPs"); + profNumTPs_->GetXaxis()->SetBinLabel(2, "TPs for eff."); + profNumTPs_->GetXaxis()->SetBinLabel(3, "TPs for alg. eff."); + profNumTPs_->LabelsOption("d"); + + hisNumStubsPerTP_ = inputDir.make("NumStubsPerTP", "; Number of stubs per TP for alg. eff.", 50, -0.5, 49.5); + hisNumPSStubsPerTP_ = + inputDir.make("NumPSStubsPerTP", "; Number of PS stubs per TP for alg. eff.", 50, -0.5, 49.5); + hisNum2SStubsPerTP_ = + inputDir.make("Num2SStubsPerTP", "; Number of 2S stubs per TP for alg. eff.", 50, -0.5, 49.5); + + hisNumLayersPerTP_ = + inputDir.make("NumLayersPerTP", "; Number of layers per TP for alg. eff.", 50, -0.5, 49.5); + hisNumPSLayersPerTP_ = + inputDir.make("NumPSLayersPerTP", "; Number of PS layers per TP for alg. eff.", 50, -0.5, 49.5); + hisNum2SLayersPerTP_ = + inputDir.make("Num2SLayersPerTP", "; Number of 2S layers per TP for alg. eff.", 50, -0.5, 49.5); + + hisNumLayersPerTP_muons_ = + inputDir.make("NumLayersPerTP_muons", "; Number of layers per TP for alg. eff.", 50, -0.5, 49.5); + hisNumPSLayersPerTP_muons_ = + inputDir.make("NumPSLayersPerTP_muons", "; Number of PS layers per TP for alg. eff.", 50, -0.5, 49.5); + hisNum2SLayersPerTP_muons_ = + inputDir.make("Num2SLayersPerTP_muons", "; Number of 2S layers per TP for alg. eff.", 50, -0.5, 49.5); + + hisNumLayersPerTP_electrons_ = + inputDir.make("NumLayersPerTP_electrons", "; Number of layers per TP for alg. eff.", 50, -0.5, 49.5); + hisNumPSLayersPerTP_electrons_ = + inputDir.make("NumPSLayersPerTP_electrons", "; Number of PS layers per TP for alg. eff.", 50, -0.5, 49.5); + hisNum2SLayersPerTP_electrons_ = + inputDir.make("Num2SLayersPerTP_electrons", "; Number of 2S layers per TP for alg. eff.", 50, -0.5, 49.5); + + hisNumLayersPerTP_pions_ = + inputDir.make("NumLayersPerTP_pions", "; Number of layers per TP for alg. eff.", 50, -0.5, 49.5); + hisNumPSLayersPerTP_pions_ = + inputDir.make("NumPSLayersPerTP_pions", "; Number of PS layers per TP for alg. eff.", 50, -0.5, 49.5); + hisNum2SLayersPerTP_pions_ = + inputDir.make("Num2SLayersPerTP_pions", "; Number of 2S layers per TP for alg. eff.", 50, -0.5, 49.5); + + hisNumLayersPerTP_lowPt_ = + inputDir.make("NumLayersPerTP_lowPt", "; Number of layers per TP for alg. eff.", 50, -0.5, 49.5); + hisNumPSLayersPerTP_lowPt_ = + inputDir.make("NumPSLayersPerTP_lowPt", "; Number of PS layers per TP for alg. eff.", 50, -0.5, 49.5); + hisNum2SLayersPerTP_lowPt_ = + inputDir.make("Num2SLayersPerTP_lowPt", "; Number of 2S layers per TP for alg. eff.", 50, -0.5, 49.5); + + hisNumLayersPerTP_mediumPt_ = + inputDir.make("NumLayersPerTP_mediumPt", "; Number of layers per TP for alg. eff.", 50, -0.5, 49.5); + hisNumPSLayersPerTP_mediumPt_ = + inputDir.make("NumPSLayersPerTP_mediumPt", "; Number of PS layers per TP for alg. eff.", 50, -0.5, 49.5); + hisNum2SLayersPerTP_mediumPt_ = + inputDir.make("Num2SLayersPerTP_mediumPt", "; Number of 2S layers per TP for alg. eff.", 50, -0.5, 49.5); + + hisNumLayersPerTP_highPt_ = + inputDir.make("NumLayersPerTP_highPt", "; Number of layers per TP for alg. eff.", 50, -0.5, 49.5); + hisNumPSLayersPerTP_highPt_ = + inputDir.make("NumPSLayersPerTP_highPt", "; Number of PS layers per TP for alg. eff.", 50, -0.5, 49.5); + hisNum2SLayersPerTP_highPt_ = + inputDir.make("Num2SLayersPerTP_highPt", "; Number of 2S layers per TP for alg. eff.", 50, -0.5, 49.5); + + // Study efficiency of tightened front end-electronics cuts. + + hisStubKillFE_ = inputDir.make( + "StubKillFE", "; barrelLayer or 10+endcapRing; Stub fraction rejected by readout chip", 30, -0.5, 29.5); + hisStubIneffiVsInvPt_ = + inputDir.make("StubIneffiVsPt", "; 1/Pt; Inefficiency of readout chip for good stubs", 30, 0.0, 1.0); + hisStubIneffiVsEta_ = inputDir.make( + "StubIneffiVsEta", "; |#eta|; Inefficiency of readout chip for good stubs", 30, 0.0, 3.0); + hisStubKillDegradeBend_ = + inputDir.make("StubKillDegradeBend", + "; barrelLayer or 10+endcapRing; Stub fraction killed by DegradeBend.h window cut", + 30, + -0.5, + 29.5); + + // Study stub resolution. + + hisPtStub_ = inputDir.make("PtStub", "; Stub q/Pt", 50, -0.5, 0.5); + hisPtResStub_ = inputDir.make("PtResStub", "; Stub q/Pt minus TP q/Pt", 50, -0.5, 0.5); + hisBendFilterPower_ = inputDir.make("BendFilterPower", "; Fraction of q/Pt range allowed", 102, -0.01, 1.01); + hisDelPhiStub_ = inputDir.make("DelPhiStub", "; Stub bend angle", 50, -0.2, 0.2); + hisDelPhiResStub_ = inputDir.make("DelPhiResStub", "; Stub bend angle minus TP bend angle", 200, -0.2, 0.2); + + hisDelPhiResStub_tilted_ = + inputDir.make("DelPhiResStub_tilted", "; Stub bend angle minus TP bend angle", 200, -0.2, 0.2); + hisDelPhiResStub_notTilted_ = + inputDir.make("DelPhiResStub_notTilted", "; Stub bend angle minus TP bend angle", 200, -0.2, 0.2); + + hisBendStub_ = inputDir.make("BendStub", "; Stub bend in units of strips", 57, -7.125, 7.125); + hisBendResStub_ = inputDir.make("BendResStub", "; Stub bend minus TP bend in units of strips", 100, -5., 5.); + hisNumMergedBend_ = + inputDir.make("NumMergedBend", "; No. of bend values merged together by loss of bit", 10, -0.5, 9.5); + hisBendVsLayerOrRingPS_ = inputDir.make( + "BendVsLayerOrRingPS", "; PS barrelLayer or 10+endcapRing; Stub bend", 30, -0.5, 29.5, 57, -7.125, 7.125); + hisBendVsLayerOrRing2S_ = inputDir.make( + "BendVsLayerOrRing2S", "; 2S barrelLayer or 10+endcapRing; Stub bend", 30, -0.5, 29.5, 57, -7.125, 7.125); + hisBendFEVsLayerOrRingPS_ = inputDir.make("BendFEVsLayerOrRingPS", + "; PS barrelLayer or 10+endcapRing; Stub bend in FE chip", + 30, + -0.5, + 29.5, + 57, + -7.125, + 7.125); + hisBendFEVsLayerOrRing2S_ = inputDir.make("BendFEVsLayerOrRing2S", + "; 2S barrelLayer or 10+endcapRing; Stub bend in FE chip", + 30, + -0.5, + 29.5, + 57, + -7.125, + 7.125); + + hisPhiStubVsPhiTP_ = + inputDir.make("PhiStubVsPhiTP", "; Stub #phi minus TP #phi at stub radius", 100, -0.05, 0.05); + hisPhiStubVsPhi0TP_ = inputDir.make("PhiStubVsPhi0TP", "; Stub #phi minus TP #phi0", 100, -0.3, 0.3); + hisPhi0StubVsPhi0TP_ = inputDir.make("Phi0StubVsPhi0TP", "; #phi0 of Stub minus TP", 100, -0.2, 0.2); + hisPhi0StubVsPhi0TPres_ = + inputDir.make("Phi0StubVsPhi0TPres", "; #phi0 of Stub minus TP / resolution", 100, -5.0, 5.0); + hisPhiStubVsPhi65TP_ = inputDir.make("PhiStubVsPhi65TP", "; Stub #phi minus TP phitrk65", 100, -0.2, 0.2); + hisPhi65StubVsPhi65TP_ = inputDir.make("Phi65StubVsPhi65TP", "; phitrk65 of Stub minus TP", 100, -0.2, 0.2); + hisPhi65StubVsPhi65TPres_ = + inputDir.make("Phi65StubVsPhi65TPres", "; phitrk65 of Stub minus TP / resolution", 100, -5.0, 5.0); - hisStubsVsRVsPhi_->Fill( stub->r() * sin( stub->phi() ), stub->r() * cos( stub->phi() ) ); - hisStubsModuleVsRVsPhi_->Fill( stub->minR() * sin( stub->minPhi() ), stub->minR() * cos( stub->minPhi() ) ); - hisStubsModuleVsRVsPhi_->Fill( stub->maxR() * sin( stub->maxPhi() ), stub->maxR() * cos( stub->maxPhi() ) ); + // Note ratio of sensor pitch to separation (needed to understand how many bits this can be packed into). + hisPitchOverSep_ = inputDir.make("PitchOverSep", "; ratio of sensor pitch / separation", 100, 0.0, 0.1); + hisRhoParameter_ = inputDir.make("RhoParameter", "; rho parameter", 100, 0.0, 0.2); + // Check alpha correction. + hisAlphaCheck_ = + inputDir.make("AlphaCheck", "; #phi from stub; #phi from strip", 40, -0.2, 0.2, 40, -0.2, 0.2); + // Count stubs sharing a common cluster. + hisFracStubsSharingClus0_ = inputDir.make( + "FracStubsSharingClus0", "Fraction of stubs sharing cluster in seed sensor", 102, -0.01, 1.01); + hisFracStubsSharingClus1_ = inputDir.make( + "FracStubsSharingClus1", "Fraction of stubs sharing cluster in correlation sensor", 102, -0.01, 1.01); + + hisStubB_ = inputDir.make("StubB", "Variable B for all stubs on TP", 100, 0.9, 10); + hisStubBApproxDiff_tilted_ = inputDir.make( + "StubBApproxDiff_tilted_", "Difference between exact and approximate values for B", 100, -1, 1); + + // Histos for denominator of tracking efficiency + float maxAbsQoverPt = 1. / houghMinPt_; // Max. |q/Pt| covered by HT array. + unsigned int nPhi = numPhiSectors_; + unsigned int nEta = numEtaRegions_; + hisTPinvptForEff_ = + inputDir.make("TPinvptForEff", "; 1/Pt of TP (used for effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); + hisTPptForEff_ = inputDir.make("TPptForEff", "; Pt of TP (used for effi. measurement);", 25, 0.0, 100.0); + hisTPetaForEff_ = inputDir.make("TPetaForEff", "; #eta of TP (used for effi. measurement);", 20, -3., 3.); + hisTPphiForEff_ = inputDir.make("TPphiForEff", "; #phi of TP (used for effi. measurement);", 20, -M_PI, M_PI); + hisTPd0ForEff_ = inputDir.make("TPd0ForEff", "; d0 of TP (used for effi. measurement);", 40, 0., 4.); + hisTPz0ForEff_ = inputDir.make("TPz0ForEff", "; z0 of TP (used for effi. measurement);", 50, 0., 25.); + // + hisTPinvptForAlgEff_ = inputDir.make( + "TPinvptForAlgEff", "; 1/Pt of TP (used for alg. effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); + hisTPptForAlgEff_ = + inputDir.make("TPptForAlgEff", "; Pt of TP (used for alg. effi. measurement);", 25, 0.0, 100.0); + hisTPetaForAlgEff_ = + inputDir.make("TPetaForAlgEff", "; #eta of TP (used for alg. effi. measurement);", 20, -3., 3.); + hisTPphiForAlgEff_ = + inputDir.make("TPphiForAlgEff", "; #phi of TP (used for alg. effi. measurement);", 20, -M_PI, M_PI); + hisTPd0ForAlgEff_ = + inputDir.make("TPd0ForAlgEff", "; d0 of TP (used for alg. effi. measurement);", 40, 0., 4.); + hisTPz0ForAlgEff_ = + inputDir.make("TPz0ForAlgEff", "; z0 of TP (used for alg. effi. measurement);", 50, 0., 25.); + // + hisTPphisecForAlgEff_ = inputDir.make( + "TPphisecForAlgEff", "; #phi sectorof TP (used for alg. effi. measurement);", nPhi, -0.5, nPhi - 0.5); + hisTPetasecForAlgEff_ = inputDir.make( + "TPetasecForAlgEff", "; #eta sector of TP (used for alg. effi. measurement);", nEta, -0.5, nEta - 0.5); + // + hisTPinvptForAlgEff_inJetPtG30_ = inputDir.make( + "TPinvptForAlgEff_inJetPtG30", "; 1/Pt of TP (used for effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); + hisTPinvptForAlgEff_inJetPtG100_ = inputDir.make( + "TPinvptForAlgEff_inJetPtG100", "; 1/Pt of TP (used for effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); + hisTPinvptForAlgEff_inJetPtG200_ = inputDir.make( + "TPinvptForAlgEff_inJetPtG200", "; 1/Pt of TP (used for effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); + + return inputDir; + } - if ( stub->barrel() && stub->outerModuleAtSmallerR() ) { - hisStubsVsRVsPhi_outerModuleAtSmallerR_->Fill( stub->r() * sin( stub->phi() ), stub->r() * cos( stub->phi() ) ); - } + //=== Fill histograms using input stubs and tracking particles. - } + void Histos::fillInputData(const InputData& inputData) { + const vector& vStubs = inputData.getStubs(); + const vector& vTPs = inputData.getTPs(); - // Count tracking particles. - unsigned int nTPforEff = 0; - unsigned int nTPforAlgEff = 0; - for (const TP& tp: vTPs) { - if (tp.useForEff()) nTPforEff++; - if (tp.useForAlgEff()) nTPforAlgEff++; - } - profNumTPs_->Fill(1, vTPs.size()); - profNumTPs_->Fill(2, nTPforEff); - profNumTPs_->Fill(3, nTPforAlgEff); - - // Study efficiency of stubs to pass front-end electronics cuts. - - const vector& vAllStubs = inputData.getAllStubs(); // Get all stubs prior to FE cuts to do this. - for (const Stub s : vAllStubs) { - unsigned int layerOrTenPlusRing = s.barrel() ? s.layerId() : 10 + s.endcapRing(); - // Fraction of all stubs (good and bad) failing tightened front-end electronics cuts. - hisStubKillFE_->Fill(layerOrTenPlusRing, (! s.frontendPass())); - // Fraction of stubs rejected by window cut in DegradeBend.h - // If it is non-zero, then encoding in DegradeBend.h should ideally be changed to make it zero. - hisStubKillDegradeBend_->Fill(layerOrTenPlusRing, s.stubFailedDegradeWindow()); - } + hisNumEvents_->Fill(0.); - // Study efficiency for good stubs of tightened front end-electronics cuts. - for (const TP& tp : vTPs) { - if (tp.useForAlgEff()) {// Only bother for stubs that are on TP that we have a chance of reconstructing. - const vector stubs = tp.assocStubs(); - for (const Stub* s : stubs) { - hisStubIneffiVsInvPt_->Fill(1./tp.pt() , (! s->frontendPass()) ); - hisStubIneffiVsEta_->Fill (fabs(tp.eta()), (! s->frontendPass()) ); + // Count stubs. + unsigned int nStubsGenuine = 0; + unsigned int nStubsWithTP = 0; + unsigned int nStubsWithTPforEff = 0; + for (const Stub* stub : vStubs) { + if (stub->genuine()) { + nStubsGenuine++; + if (stub->assocTP() != nullptr) { + nStubsWithTP++; + if (stub->assocTP()->useForEff()) + nStubsWithTPforEff++; + } } } - } - - // Plot stub bend-derived information. - for (const Stub* stub : vStubs) { - hisPtStub_->Fill(stub->qOverPt()); - hisDelPhiStub_->Fill(stub->dphi()); - hisBendStub_->Fill(stub->dphi() / stub->dphiOverBend()); - // Number of bend values merged together by loss of a bit. - hisNumMergedBend_->Fill(stub->numMergedBend()); - // Min. & max allowed q/Pt obtained from stub bend. - float minQoverPt = max(float(-1./(houghMinPt_)), stub->qOverPt() - stub->qOverPtres()); - float maxQoverPt = min(float(1./(houghMinPt_)), stub->qOverPt() + stub->qOverPtres()); - // Frac. of full q/Pt range allowed by stub bend. - float fracAllowed = (maxQoverPt - minQoverPt)/(2./(houghMinPt_)); - hisBendFilterPower_->Fill(fracAllowed); - unsigned int layerOrTenPlusRing = stub->barrel() ? stub->layerId() : 10 + stub->endcapRing(); - // Also plot bend before & after to degradation. - if (stub->psModule()) { - hisBendFEVsLayerOrRingPS_->Fill(layerOrTenPlusRing, stub->bendInFrontend()); - hisBendVsLayerOrRingPS_->Fill(layerOrTenPlusRing, stub->bend()); - } else { - hisBendFEVsLayerOrRing2S_->Fill(layerOrTenPlusRing, stub->bendInFrontend()); - hisBendVsLayerOrRing2S_->Fill(layerOrTenPlusRing, stub->bend()); - } - } - - // Look at stub resolution. - for (const TP& tp: vTPs) { - if (tp.useForAlgEff()) { - const vector& assStubs= tp.assocStubs(); - hisNumStubsPerTP_->Fill( assStubs.size() ); + profNumStubs_->Fill(1, vStubs.size()); + profNumStubs_->Fill(2, nStubsGenuine); + profNumStubs_->Fill(3, nStubsWithTP); + profNumStubs_->Fill(4, nStubsWithTPforEff); - unsigned int numPSstubs = 0; - unsigned int num2Sstubs = 0; + for (const Stub* stub : vStubs) { + hisStubsVsEta_->Fill(stub->eta()); + hisStubsVsR_->Fill(stub->r()); + hisStubsVsRVsZ_->Fill(stub->z(), stub->r()); + hisStubsModuleVsRVsZ_->Fill(stub->minZ(), stub->minR()); + hisStubsModuleVsRVsZ_->Fill(stub->maxZ(), stub->maxR()); - //cout<<"=== TP === : index="<pitchOverSep(); - if ( ! stub->barrel() ) rho *= fabs(stub->z())/stub->r(); - hisRhoParameter_->Fill(rho); - - // Check how strip number correlates with phi coordinate relative to module centre. - // (Useful for "alpha" correction for non-radial strips in endcap 2S modules). - float fracPosInModule = (float(2 * stub->iphi()) - float(stub->nstrip())) / float(stub->nstrip()); - float phiFromStrip = 0.5 * stub->width() * fracPosInModule / stub->r(); - if (stub->z() < 0 && (not stub->barrel())) phiFromStrip *= -1; - if (stub->outerModuleAtSmallerR()) phiFromStrip *= -1; // Module flipped. - float phiFromStub = reco::deltaPhi(stub->phi(), 0.5*(stub->minPhi() + stub->maxPhi())); - hisAlphaCheck_->Fill(phiFromStub, phiFromStrip); - } - - // Check fraction of stubs sharing a common cluster. - // Loop over both clusters in each stub, so looking for common clusters in seed (0) or correlation (1) sensor of module. - typedef pair< unsigned int, pair > ClusterLocation; - for (unsigned int iClus = 0; iClus <= 1; iClus++) { - map commonClusterMap; + // Plot stub bend-derived information. for (const Stub* stub : vStubs) { - // Encode detector ID & strip (or pixel) numbers in both dimensions. - const ClusterLocation loc( stub->idDet(), pair(stub->localU_cluster()[iClus], stub->localV_cluster()[iClus]) ); - if (commonClusterMap.find(loc) == commonClusterMap.end()) { - commonClusterMap[loc] = 1; + hisPtStub_->Fill(stub->qOverPt()); + hisDelPhiStub_->Fill(stub->dphi()); + hisBendStub_->Fill(stub->dphi() / stub->dphiOverBend()); + // Number of bend values merged together by loss of a bit. + hisNumMergedBend_->Fill(stub->numMergedBend()); + // Min. & max allowed q/Pt obtained from stub bend. + float minQoverPt = max(float(-1. / (houghMinPt_)), stub->qOverPt() - stub->qOverPtres()); + float maxQoverPt = min(float(1. / (houghMinPt_)), stub->qOverPt() + stub->qOverPtres()); + // Frac. of full q/Pt range allowed by stub bend. + float fracAllowed = (maxQoverPt - minQoverPt) / (2. / (houghMinPt_)); + hisBendFilterPower_->Fill(fracAllowed); + unsigned int layerOrTenPlusRing = stub->barrel() ? stub->layerId() : 10 + stub->endcapRing(); + // Also plot bend before & after to degradation. + if (stub->psModule()) { + hisBendFEVsLayerOrRingPS_->Fill(layerOrTenPlusRing, stub->bendInFrontend()); + hisBendVsLayerOrRingPS_->Fill(layerOrTenPlusRing, stub->bend()); } else { - commonClusterMap[loc]++; + hisBendFEVsLayerOrRing2S_->Fill(layerOrTenPlusRing, stub->bendInFrontend()); + hisBendVsLayerOrRing2S_->Fill(layerOrTenPlusRing, stub->bend()); } } - unsigned int nShare = 0; - for (map::const_iterator it = commonClusterMap.begin(); it != commonClusterMap.end(); it++) { - if (it->second != 1) nShare += it->second; // 2 or more stubs share a cluster at this detid*strip. - } - if (iClus == 0) { - hisFracStubsSharingClus0_->Fill(float(nShare)/float(vStubs.size())); - } else { - hisFracStubsSharingClus1_->Fill(float(nShare)/float(vStubs.size())); - } - } - // Determine r (z) range of each barrel layer (endcap wheel). + // Look at stub resolution. + for (const TP& tp : vTPs) { + if (tp.useForAlgEff()) { + const vector& assStubs = tp.assocStubs(); + hisNumStubsPerTP_->Fill(assStubs.size()); + + unsigned int numPSstubs = 0; + unsigned int num2Sstubs = 0; + + //cout<<"=== TP === : index="<pitchOverSep(); + if (!stub->barrel()) + rho *= fabs(stub->z()) / stub->r(); + hisRhoParameter_->Fill(rho); + + // Check how strip number correlates with phi coordinate relative to module centre. + // (Useful for "alpha" correction for non-radial strips in endcap 2S modules). + float fracPosInModule = (float(2 * stub->iphi()) - float(stub->nstrip())) / float(stub->nstrip()); + float phiFromStrip = 0.5 * stub->width() * fracPosInModule / stub->r(); + if (stub->z() < 0 && (not stub->barrel())) + phiFromStrip *= -1; + if (stub->outerModuleAtSmallerR()) + phiFromStrip *= -1; // Module flipped. + float phiFromStub = reco::deltaPhi(stub->phi(), 0.5 * (stub->minPhi() + stub->maxPhi())); + hisAlphaCheck_->Fill(phiFromStub, phiFromStrip); + } + + // Check fraction of stubs sharing a common cluster. + // Loop over both clusters in each stub, so looking for common clusters in seed (0) or correlation (1) sensor of module. + typedef pair> ClusterLocation; + for (unsigned int iClus = 0; iClus <= 1; iClus++) { + map commonClusterMap; + for (const Stub* stub : vStubs) { + // Encode detector ID & strip (or pixel) numbers in both dimensions. + const ClusterLocation loc(stub->idDet(), + pair(stub->localU_cluster()[iClus], stub->localV_cluster()[iClus])); + if (commonClusterMap.find(loc) == commonClusterMap.end()) { + commonClusterMap[loc] = 1; + } else { + commonClusterMap[loc]++; + } } - } else if (! stub->barrel() && (stub->layerId()%10 == 1 || stub->layerId()%10 == 2)) { // endcap wheel 1-2 - if (mapExtraCModuleTypeMinR_.find(modType) == mapExtraCModuleTypeMinR_.end()) { - mapExtraCModuleTypeMinR_[modType] = r; - mapExtraCModuleTypeMaxR_[modType] = r; - mapExtraCModuleTypeMinZ_[modType] = z; - mapExtraCModuleTypeMaxZ_[modType] = z; - } else { - if (mapExtraCModuleTypeMinR_[modType] > r) mapExtraCModuleTypeMinR_[modType] = r; - if (mapExtraCModuleTypeMaxR_[modType] < r) mapExtraCModuleTypeMaxR_[modType] = r; - if (mapExtraCModuleTypeMinZ_[modType] > z) mapExtraCModuleTypeMinZ_[modType] = z; - if (mapExtraCModuleTypeMaxZ_[modType] < z) mapExtraCModuleTypeMaxZ_[modType] = z; + unsigned int nShare = 0; + for (map::const_iterator it = commonClusterMap.begin(); + it != commonClusterMap.end(); + it++) { + if (it->second != 1) + nShare += it->second; // 2 or more stubs share a cluster at this detid*strip. } - } else if (! stub->barrel() && (stub->layerId()%10 == 3 || stub->layerId()%10 == 4)) { // endcap wheel 3-4 - if (mapExtraDModuleTypeMinR_.find(modType) == mapExtraDModuleTypeMinR_.end()) { - mapExtraDModuleTypeMinR_[modType] = r; - mapExtraDModuleTypeMaxR_[modType] = r; - mapExtraDModuleTypeMinZ_[modType] = z; - mapExtraDModuleTypeMaxZ_[modType] = z; + if (iClus == 0) { + hisFracStubsSharingClus0_->Fill(float(nShare) / float(vStubs.size())); } else { - if (mapExtraDModuleTypeMinR_[modType] > r) mapExtraDModuleTypeMinR_[modType] = r; - if (mapExtraDModuleTypeMaxR_[modType] < r) mapExtraDModuleTypeMaxR_[modType] = r; - if (mapExtraDModuleTypeMinZ_[modType] > z) mapExtraDModuleTypeMinZ_[modType] = z; - if (mapExtraDModuleTypeMaxZ_[modType] < z) mapExtraDModuleTypeMaxZ_[modType] = z; + hisFracStubsSharingClus1_->Fill(float(nShare) / float(vStubs.size())); } - } else { // barrel layer 3-6 or endcap wheel 5. - if (mapModuleTypeMinR_.find(modType) == mapModuleTypeMinR_.end()) { - mapModuleTypeMinR_[modType] = r; - mapModuleTypeMaxR_[modType] = r; - mapModuleTypeMinZ_[modType] = z; - mapModuleTypeMaxZ_[modType] = z; + } + + // Determine r (z) range of each barrel layer (endcap wheel). + + for (const Stub* stub : vStubs) { + unsigned int layer = stub->layerId(); + if (stub->barrel()) { + // Get range in r of each barrel layer. + float r = stub->r(); + if (mapBarrelLayerMinR_.find(layer) == mapBarrelLayerMinR_.end()) { + mapBarrelLayerMinR_[layer] = r; + mapBarrelLayerMaxR_[layer] = r; + } else { + if (mapBarrelLayerMinR_[layer] > r) + mapBarrelLayerMinR_[layer] = r; + if (mapBarrelLayerMaxR_[layer] < r) + mapBarrelLayerMaxR_[layer] = r; + } } else { - if (mapModuleTypeMinR_[modType] > r) mapModuleTypeMinR_[modType] = r; - if (mapModuleTypeMaxR_[modType] < r) mapModuleTypeMaxR_[modType] = r; - if (mapModuleTypeMinZ_[modType] > z) mapModuleTypeMinZ_[modType] = z; - if (mapModuleTypeMaxZ_[modType] < z) mapModuleTypeMaxZ_[modType] = z; + layer = layer % 10; + // Range in |z| of each endcap wheel. + float z = fabs(stub->z()); + if (mapEndcapWheelMinZ_.find(layer) == mapEndcapWheelMinZ_.end()) { + mapEndcapWheelMinZ_[layer] = z; + mapEndcapWheelMaxZ_[layer] = z; + } else { + if (mapEndcapWheelMinZ_[layer] > z) + mapEndcapWheelMinZ_[layer] = z; + if (mapEndcapWheelMaxZ_[layer] < z) + mapEndcapWheelMaxZ_[layer] = z; + } } } - } - //=== Make denominator of tracking efficiency plots + // Determine Range in (r,|z|) of each module type. - for (const TP& tp: vTPs) { + for (const Stub* stub : vStubs) { + float r = stub->r(); + float z = fabs(stub->z()); + unsigned int modType = stub->digitalStub().moduleType(); + // Do something ugly, as modules in 1-2nd & 3-4th endcap wheels are different to those in wheel 5 ... + // And boundary between flat & tilted modules in barrel layers 1-3 varies in z. + if (stub->barrel() && stub->layerId() == 1) { // barrel layer 1 + if (mapExtraAModuleTypeMinR_.find(modType) == mapExtraAModuleTypeMinR_.end()) { + mapExtraAModuleTypeMinR_[modType] = r; + mapExtraAModuleTypeMaxR_[modType] = r; + mapExtraAModuleTypeMinZ_[modType] = z; + mapExtraAModuleTypeMaxZ_[modType] = z; + } else { + if (mapExtraAModuleTypeMinR_[modType] > r) + mapExtraAModuleTypeMinR_[modType] = r; + if (mapExtraAModuleTypeMaxR_[modType] < r) + mapExtraAModuleTypeMaxR_[modType] = r; + if (mapExtraAModuleTypeMinZ_[modType] > z) + mapExtraAModuleTypeMinZ_[modType] = z; + if (mapExtraAModuleTypeMaxZ_[modType] < z) + mapExtraAModuleTypeMaxZ_[modType] = z; + } + } else if (stub->barrel() && stub->layerId() == 2) { // barrel layer 2 + if (mapExtraBModuleTypeMinR_.find(modType) == mapExtraBModuleTypeMinR_.end()) { + mapExtraBModuleTypeMinR_[modType] = r; + mapExtraBModuleTypeMaxR_[modType] = r; + mapExtraBModuleTypeMinZ_[modType] = z; + mapExtraBModuleTypeMaxZ_[modType] = z; + } else { + if (mapExtraBModuleTypeMinR_[modType] > r) + mapExtraBModuleTypeMinR_[modType] = r; + if (mapExtraBModuleTypeMaxR_[modType] < r) + mapExtraBModuleTypeMaxR_[modType] = r; + if (mapExtraBModuleTypeMinZ_[modType] > z) + mapExtraBModuleTypeMinZ_[modType] = z; + if (mapExtraBModuleTypeMaxZ_[modType] < z) + mapExtraBModuleTypeMaxZ_[modType] = z; + } + } else if (!stub->barrel() && (stub->layerId() % 10 == 1 || stub->layerId() % 10 == 2)) { // endcap wheel 1-2 + if (mapExtraCModuleTypeMinR_.find(modType) == mapExtraCModuleTypeMinR_.end()) { + mapExtraCModuleTypeMinR_[modType] = r; + mapExtraCModuleTypeMaxR_[modType] = r; + mapExtraCModuleTypeMinZ_[modType] = z; + mapExtraCModuleTypeMaxZ_[modType] = z; + } else { + if (mapExtraCModuleTypeMinR_[modType] > r) + mapExtraCModuleTypeMinR_[modType] = r; + if (mapExtraCModuleTypeMaxR_[modType] < r) + mapExtraCModuleTypeMaxR_[modType] = r; + if (mapExtraCModuleTypeMinZ_[modType] > z) + mapExtraCModuleTypeMinZ_[modType] = z; + if (mapExtraCModuleTypeMaxZ_[modType] < z) + mapExtraCModuleTypeMaxZ_[modType] = z; + } + } else if (!stub->barrel() && (stub->layerId() % 10 == 3 || stub->layerId() % 10 == 4)) { // endcap wheel 3-4 + if (mapExtraDModuleTypeMinR_.find(modType) == mapExtraDModuleTypeMinR_.end()) { + mapExtraDModuleTypeMinR_[modType] = r; + mapExtraDModuleTypeMaxR_[modType] = r; + mapExtraDModuleTypeMinZ_[modType] = z; + mapExtraDModuleTypeMaxZ_[modType] = z; + } else { + if (mapExtraDModuleTypeMinR_[modType] > r) + mapExtraDModuleTypeMinR_[modType] = r; + if (mapExtraDModuleTypeMaxR_[modType] < r) + mapExtraDModuleTypeMaxR_[modType] = r; + if (mapExtraDModuleTypeMinZ_[modType] > z) + mapExtraDModuleTypeMinZ_[modType] = z; + if (mapExtraDModuleTypeMaxZ_[modType] < z) + mapExtraDModuleTypeMaxZ_[modType] = z; + } + } else { // barrel layer 3-6 or endcap wheel 5. + if (mapModuleTypeMinR_.find(modType) == mapModuleTypeMinR_.end()) { + mapModuleTypeMinR_[modType] = r; + mapModuleTypeMaxR_[modType] = r; + mapModuleTypeMinZ_[modType] = z; + mapModuleTypeMaxZ_[modType] = z; + } else { + if (mapModuleTypeMinR_[modType] > r) + mapModuleTypeMinR_[modType] = r; + if (mapModuleTypeMaxR_[modType] < r) + mapModuleTypeMaxR_[modType] = r; + if (mapModuleTypeMinZ_[modType] > z) + mapModuleTypeMinZ_[modType] = z; + if (mapModuleTypeMaxZ_[modType] < z) + mapModuleTypeMaxZ_[modType] = z; + } + } + } - if (tp.useForEff()) { // Check TP is good for efficiency measurement. + //=== Make denominator of tracking efficiency plots - // Check which eta and phi sectors this TP is in. - int iPhiSec_TP = -1; - int iEtaReg_TP = -1; - Sector sectorTmp; - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - sectorTmp.init(settings_, iPhiSec, 0); - if (sectorTmp.insidePhiSec(tp)) iPhiSec_TP = iPhiSec; - } - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - sectorTmp.init(settings_, 0, iEtaReg); - if (sectorTmp.insideEtaReg(tp)) iEtaReg_TP = iEtaReg; - } + for (const TP& tp : vTPs) { + if (tp.useForEff()) { // Check TP is good for efficiency measurement. - // Plot kinematics of all good TP. - hisTPinvptForEff_->Fill(1./tp.pt()); - hisTPptForEff_->Fill(tp.pt()); - hisTPetaForEff_->Fill(tp.eta()); - hisTPphiForEff_->Fill(tp.phi0()); - // Plot also production point of all good TP. - hisTPd0ForEff_->Fill(fabs(tp.d0())); - hisTPz0ForEff_->Fill(fabs(tp.z0())); - - if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. - hisTPinvptForAlgEff_->Fill(1./tp.pt()); - hisTPptForAlgEff_->Fill(tp.pt()); - hisTPetaForAlgEff_->Fill(tp.eta()); - hisTPphiForAlgEff_->Fill(tp.phi0()); - // Plot also production point of all good TP. - hisTPd0ForAlgEff_->Fill(fabs(tp.d0())); - hisTPz0ForAlgEff_->Fill(fabs(tp.z0())); - // Plot sector nunber. - hisTPphisecForAlgEff_->Fill(iPhiSec_TP); - hisTPetasecForAlgEff_->Fill(iEtaReg_TP); - - // Plot 1/pt for TPs inside a jet - if ( tp.tpInJet() ) { - hisTPinvptForAlgEff_inJetPtG30_->Fill(1./tp.pt()); + // Check which eta and phi sectors this TP is in. + int iPhiSec_TP = -1; + int iEtaReg_TP = -1; + Sector sectorTmp; + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + sectorTmp.init(settings_, iPhiSec, 0); + if (sectorTmp.insidePhiSec(tp)) + iPhiSec_TP = iPhiSec; } - if ( tp.tpInHighPtJet() ) { - hisTPinvptForAlgEff_inJetPtG100_->Fill(1./tp.pt()); + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + sectorTmp.init(settings_, 0, iEtaReg); + if (sectorTmp.insideEtaReg(tp)) + iEtaReg_TP = iEtaReg; } - if ( tp.tpInVeryHighPtJet() ) { - hisTPinvptForAlgEff_inJetPtG200_->Fill(1./tp.pt()); + + // Plot kinematics of all good TP. + hisTPinvptForEff_->Fill(1. / tp.pt()); + hisTPptForEff_->Fill(tp.pt()); + hisTPetaForEff_->Fill(tp.eta()); + hisTPphiForEff_->Fill(tp.phi0()); + // Plot also production point of all good TP. + hisTPd0ForEff_->Fill(fabs(tp.d0())); + hisTPz0ForEff_->Fill(fabs(tp.z0())); + + if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. + hisTPinvptForAlgEff_->Fill(1. / tp.pt()); + hisTPptForAlgEff_->Fill(tp.pt()); + hisTPetaForAlgEff_->Fill(tp.eta()); + hisTPphiForAlgEff_->Fill(tp.phi0()); + // Plot also production point of all good TP. + hisTPd0ForAlgEff_->Fill(fabs(tp.d0())); + hisTPz0ForAlgEff_->Fill(fabs(tp.z0())); + // Plot sector nunber. + hisTPphisecForAlgEff_->Fill(iPhiSec_TP); + hisTPetasecForAlgEff_->Fill(iEtaReg_TP); + + // Plot 1/pt for TPs inside a jet + if (tp.tpInJet()) { + hisTPinvptForAlgEff_inJetPtG30_->Fill(1. / tp.pt()); + } + if (tp.tpInHighPtJet()) { + hisTPinvptForAlgEff_inJetPtG100_->Fill(1. / tp.pt()); + } + if (tp.tpInVeryHighPtJet()) { + hisTPinvptForAlgEff_inJetPtG200_->Fill(1. / tp.pt()); + } } } } } -} - -//=== Book histograms checking if (eta,phi) sector defis(nition choices are good. - -TFileDirectory Histos::bookEtaPhiSectors() { - TFileDirectory inputDir = fs_->mkdir("CheckSectors"); - // Check if TP lose stubs because not all in same sector. + //=== Book histograms checking if (eta,phi) sector defis(nition choices are good. - hisFracStubsInSec_ = inputDir.make("FracStubsInSec","; Fraction of stubs on TP in best (#eta,#phi) sector;",102,-0.01,1.01); - hisFracStubsInEtaSec_ = inputDir.make("FracStubsInEtaSec","; Fraction of stubs on TP in best #eta sector;",102,-0.01,1.01); - hisFracStubsInPhiSec_ = inputDir.make("FracStubsInPhiSec","; Fraction of stubs on TP in best #phi sector;",102,-0.01,1.01); + TFileDirectory Histos::bookEtaPhiSectors() { + TFileDirectory inputDir = fs_->mkdir("CheckSectors"); - // Check if stubs excessively duplicated between overlapping sectors. + // Check if TP lose stubs because not all in same sector. - hisNumSecsPerStub_ = inputDir.make("NumSecPerStub","; Number of (#eta,#phi) sectors each stub appears in",20,-0.5,19.5); - hisNumEtaSecsPerStub_ = inputDir.make("NumEtaSecPerStub","; Number of #eta sectors each stub appears in",20,-0.5,19.5); - hisNumPhiSecsPerStub_ = inputDir.make("NumPhiSecPerStub","; Number of #phi sectors each stub appears in",20,-0.5,19.5); + hisFracStubsInSec_ = inputDir.make( + "FracStubsInSec", "; Fraction of stubs on TP in best (#eta,#phi) sector;", 102, -0.01, 1.01); + hisFracStubsInEtaSec_ = + inputDir.make("FracStubsInEtaSec", "; Fraction of stubs on TP in best #eta sector;", 102, -0.01, 1.01); + hisFracStubsInPhiSec_ = + inputDir.make("FracStubsInPhiSec", "; Fraction of stubs on TP in best #phi sector;", 102, -0.01, 1.01); - // Count stubs per (eta,phi) sector. - hisNumStubsPerSec_ = inputDir.make("NumStubsPerSec","; Number of stubs per sector",250,-0.5,249.5); - // Ditto, summed over all phi. This checks if equal stubs go into each eta region, important for latency. - unsigned int nEta = numEtaRegions_; - profNumStubsPerEtaSec_ = inputDir.make("NumStubsPerEtaSec",";#eta sector; Number of stubs per #eta sector",nEta,-0.5,nEta-0.5); + // Check if stubs excessively duplicated between overlapping sectors. - // Check which tracker layers are present in each eta sector. - hisLayerIDvsEtaSec_ = inputDir.make("LayerIDvsEtaSec",";#eta sector; layer ID",nEta,-0.5,nEta-0.5,20,0.5,20.5); - hisLayerIDreducedvsEtaSec_ = inputDir.make("LayerIDreducedvsEtaSec",";#eta sector; reduced layer ID",nEta,-0.5,nEta-0.5,20,0.5,20.5); + hisNumSecsPerStub_ = + inputDir.make("NumSecPerStub", "; Number of (#eta,#phi) sectors each stub appears in", 20, -0.5, 19.5); + hisNumEtaSecsPerStub_ = + inputDir.make("NumEtaSecPerStub", "; Number of #eta sectors each stub appears in", 20, -0.5, 19.5); + hisNumPhiSecsPerStub_ = + inputDir.make("NumPhiSecPerStub", "; Number of #phi sectors each stub appears in", 20, -0.5, 19.5); - return inputDir; -} + // Count stubs per (eta,phi) sector. + hisNumStubsPerSec_ = inputDir.make("NumStubsPerSec", "; Number of stubs per sector", 250, -0.5, 249.5); + // Ditto, summed over all phi. This checks if equal stubs go into each eta region, important for latency. + unsigned int nEta = numEtaRegions_; + profNumStubsPerEtaSec_ = inputDir.make( + "NumStubsPerEtaSec", ";#eta sector; Number of stubs per #eta sector", nEta, -0.5, nEta - 0.5); -//=== Fill histograms checking if (eta,phi) sector definition choices are good. + // Check which tracker layers are present in each eta sector. + hisLayerIDvsEtaSec_ = + inputDir.make("LayerIDvsEtaSec", ";#eta sector; layer ID", nEta, -0.5, nEta - 0.5, 20, 0.5, 20.5); + hisLayerIDreducedvsEtaSec_ = inputDir.make( + "LayerIDreducedvsEtaSec", ";#eta sector; reduced layer ID", nEta, -0.5, nEta - 0.5, 20, 0.5, 20.5); -void Histos::fillEtaPhiSectors(const InputData& inputData, const matrix& mSectors) { + return inputDir; + } - const vector& vStubs = inputData.getStubs(); - const vector& vTPs = inputData.getTPs(); + //=== Fill histograms checking if (eta,phi) sector definition choices are good. - //=== Loop over good tracking particles, looking for the (eta,phi) sector in which each has the most stubs. - //=== and checking what fraction of its stubs were in this sector. - - for (const TP& tp : vTPs) { - if (tp.useForAlgEff()) { - unsigned int nStubs = tp.numAssocStubs(); // no. of stubs in this TP. + void Histos::fillEtaPhiSectors(const InputData& inputData, const matrix& mSectors) { + const vector& vStubs = inputData.getStubs(); + const vector& vTPs = inputData.getTPs(); - // Number of stubs this TP has in best (eta,phi) sector, and also just dividing sectors in phi or just in eta. - unsigned int nStubsInBestSec = 0; - unsigned int nStubsInBestEtaSec = 0; - unsigned int nStubsInBestPhiSec = 0; + //=== Loop over good tracking particles, looking for the (eta,phi) sector in which each has the most stubs. + //=== and checking what fraction of its stubs were in this sector. - // Loop over (eta, phi) sectors. - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + for (const TP& tp : vTPs) { + if (tp.useForAlgEff()) { + unsigned int nStubs = tp.numAssocStubs(); // no. of stubs in this TP. - const Sector& sector = mSectors(iPhiSec, iEtaReg); + // Number of stubs this TP has in best (eta,phi) sector, and also just dividing sectors in phi or just in eta. + unsigned int nStubsInBestSec = 0; + unsigned int nStubsInBestEtaSec = 0; + unsigned int nStubsInBestPhiSec = 0; - // Count number of stubs in given tracking particle which are inside this (phi,eta) sector; - // or inside it if only the eta cuts are applied; or inside it if only the phi cuts are applied. - unsigned int nStubsInSec, nStubsInEtaSec, nStubsInPhiSec; - sector.numStubsInside( tp, nStubsInSec, nStubsInEtaSec, nStubsInPhiSec); + // Loop over (eta, phi) sectors. + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + const Sector& sector = mSectors(iPhiSec, iEtaReg); + + // Count number of stubs in given tracking particle which are inside this (phi,eta) sector; + // or inside it if only the eta cuts are applied; or inside it if only the phi cuts are applied. + unsigned int nStubsInSec, nStubsInEtaSec, nStubsInPhiSec; + sector.numStubsInside(tp, nStubsInSec, nStubsInEtaSec, nStubsInPhiSec); + + // Note best results obtained in any sector. + nStubsInBestSec = max(nStubsInBestSec, nStubsInSec); + nStubsInBestEtaSec = max(nStubsInBestEtaSec, nStubsInEtaSec); + nStubsInBestPhiSec = max(nStubsInBestPhiSec, nStubsInPhiSec); + } + } - // Note best results obtained in any sector. - nStubsInBestSec = max( nStubsInBestSec, nStubsInSec); - nStubsInBestEtaSec = max( nStubsInBestEtaSec, nStubsInEtaSec); - nStubsInBestPhiSec = max( nStubsInBestPhiSec, nStubsInPhiSec); - } + // Plot fraction of stubs on each TP in its best sector. + hisFracStubsInSec_->Fill(float(nStubsInBestSec) / float(nStubs)); + hisFracStubsInEtaSec_->Fill(float(nStubsInBestEtaSec) / float(nStubs)); + hisFracStubsInPhiSec_->Fill(float(nStubsInBestPhiSec) / float(nStubs)); } - - // Plot fraction of stubs on each TP in its best sector. - hisFracStubsInSec_->Fill ( float(nStubsInBestSec) / float(nStubs) ); - hisFracStubsInEtaSec_->Fill( float(nStubsInBestEtaSec) / float(nStubs) ); - hisFracStubsInPhiSec_->Fill( float(nStubsInBestPhiSec) / float(nStubs) ); } - } - //=== Loop over all stubs, counting how many sectors each one appears in. - - for (const Stub* stub : vStubs) { + //=== Loop over all stubs, counting how many sectors each one appears in. - // Number of (eta,phi), phi & eta sectors containing this stub. - unsigned int nSecs = 0; - unsigned int nEtaSecs = 0; - unsigned int nPhiSecs = 0; - - // Loop over (eta, phi) sectors. - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + for (const Stub* stub : vStubs) { + // Number of (eta,phi), phi & eta sectors containing this stub. + unsigned int nSecs = 0; + unsigned int nEtaSecs = 0; + unsigned int nPhiSecs = 0; - const Sector& sector = mSectors(iPhiSec, iEtaReg); - - // Check if sector contains stub stub, and if so count it. - // Take care to just use one eta (phi) typical region when counting phi (eta) sectors. - if ( sector.inside ( stub ) ) nSecs++; - if ( iPhiSec == 0 && sector.insideEta( stub ) ) nEtaSecs++; - if ( iEtaReg == 0 && sector.insidePhi( stub ) ) nPhiSecs++; - - // Also note which tracker layers are present in each eta sector. - if (iPhiSec == 0 && sector.insideEta( stub)) { - const TP* assocTP = stub->assocTP(); - if (assocTP != nullptr) { - if (assocTP->useForAlgEff()) { - unsigned int lay = stub->layerId(); - if (lay > 20) lay -= 10; // Don't bother distinguishing two endcaps. - hisLayerIDvsEtaSec_->Fill(iEtaReg, lay); - hisLayerIDreducedvsEtaSec_->Fill(iEtaReg, stub->layerIdReduced()); // Plot also simplified layerID for hardware, which tries to avoid more than 8 ID in any given eta region. - } - } - } + // Loop over (eta, phi) sectors. + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + const Sector& sector = mSectors(iPhiSec, iEtaReg); + + // Check if sector contains stub stub, and if so count it. + // Take care to just use one eta (phi) typical region when counting phi (eta) sectors. + if (sector.inside(stub)) + nSecs++; + if (iPhiSec == 0 && sector.insideEta(stub)) + nEtaSecs++; + if (iEtaReg == 0 && sector.insidePhi(stub)) + nPhiSecs++; + + // Also note which tracker layers are present in each eta sector. + if (iPhiSec == 0 && sector.insideEta(stub)) { + const TP* assocTP = stub->assocTP(); + if (assocTP != nullptr) { + if (assocTP->useForAlgEff()) { + unsigned int lay = stub->layerId(); + if (lay > 20) + lay -= 10; // Don't bother distinguishing two endcaps. + hisLayerIDvsEtaSec_->Fill(iEtaReg, lay); + hisLayerIDreducedvsEtaSec_->Fill( + iEtaReg, + stub->layerIdReduced()); // Plot also simplified layerID for hardware, which tries to avoid more than 8 ID in any given eta region. + } + } + } + } } - } - // Plot number of sectors each stub appears in. - hisNumSecsPerStub_->Fill ( nSecs ); - hisNumEtaSecsPerStub_->Fill( nEtaSecs ); - hisNumPhiSecsPerStub_->Fill( nPhiSecs ); + // Plot number of sectors each stub appears in. + hisNumSecsPerStub_->Fill(nSecs); + hisNumEtaSecsPerStub_->Fill(nEtaSecs); + hisNumPhiSecsPerStub_->Fill(nPhiSecs); - if ( ! settings_->allowOver2EtaSecs()) { - if (nEtaSecs > 2) throw cms::Exception("Histos ERROR: Stub assigned to more than 2 eta regions. Please redefine eta regions to avoid this!")<<" stub r="<r()<<" eta="<eta()<allowOver2EtaSecs()) { + if (nEtaSecs > 2) + throw cms::Exception( + "Histos ERROR: Stub assigned to more than 2 eta regions. Please redefine eta regions to avoid this!") + << " stub r=" << stub->r() << " eta=" << stub->eta() << endl; + } } - } - //=== Loop over all sectors, counting the stubs in each one. - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - unsigned int nStubsInEtaSec = 0; // Also counts stubs in eta sector, summed over all phi. - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - const Sector& sector = mSectors(iPhiSec, iEtaReg); + //=== Loop over all sectors, counting the stubs in each one. + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + unsigned int nStubsInEtaSec = 0; // Also counts stubs in eta sector, summed over all phi. + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + const Sector& sector = mSectors(iPhiSec, iEtaReg); - unsigned int nStubs = 0; - for (const Stub* stub : vStubs) { - if ( sector.inside( stub ) ) nStubs++; + unsigned int nStubs = 0; + for (const Stub* stub : vStubs) { + if (sector.inside(stub)) + nStubs++; + } + hisNumStubsPerSec_->Fill(nStubs); + nStubsInEtaSec += nStubs; } - hisNumStubsPerSec_->Fill(nStubs); - nStubsInEtaSec += nStubs; + profNumStubsPerEtaSec_->Fill(iEtaReg, nStubsInEtaSec); } - profNumStubsPerEtaSec_->Fill(iEtaReg, nStubsInEtaSec); } -} - -//=== Book histograms checking filling of r-phi HT array. - -TFileDirectory Histos::bookRphiHT() { - - TFileDirectory inputDir = fs_->mkdir("HTrphi"); - - // The next block of code is to book a histogram to study unusual HT cell shapes. - - unsigned int shape = settings_->shape(); - float maxAbsQoverPtAxis = 1. / houghMinPt_; // Max. |q/Pt| covered by HT array. - float maxAbsPhiTrkAxis = M_PI / (float)numPhiSectors_; // Half-width of phiTrk axis in HT array. - float binSizeQoverPtAxis = 2. * maxAbsQoverPtAxis / (float)houghNbinsPt_; - if ( shape == 2 || shape == 1 || shape == 3 ) - binSizeQoverPtAxis = 2. * maxAbsQoverPtAxis / ( houghNbinsPt_ - 1. ); - float binSizePhiTrkAxis = 2. * maxAbsPhiTrkAxis / (float)houghNbinsPhi_; - if ( shape == 2 ) - binSizePhiTrkAxis = 2. * maxAbsPhiTrkAxis / ( houghNbinsPhi_ - 1. / 6. ); - else if ( shape == 1 ) - binSizePhiTrkAxis = 2. * maxAbsPhiTrkAxis / ( houghNbinsPhi_ - 1. / 2. ); - hisArrayHT_ = inputDir.make< TH2Poly >( "ArrayHT", "HT Array; m Bins; c Bins", - -maxAbsQoverPtAxis, maxAbsQoverPtAxis, -maxAbsPhiTrkAxis, maxAbsPhiTrkAxis ); - //hisStubHT_ = inputDir.make< TF1 >( "StubHT", "[0]+[1]*x", -maxAbsQoverPtAxis, maxAbsQoverPtAxis ); - //hisStubHT_->SetMinimum( -maxAbsPhiTrkAxis ); - //hisStubHT_->SetMaximum( maxAbsPhiTrkAxis ); - float xloop, yloop, xtemp; - Double_t x[7], y[7]; - switch ( shape ) { - case 0 : - xloop = - maxAbsQoverPtAxis; - yloop = - maxAbsPhiTrkAxis; - for ( unsigned int row = 0; row < houghNbinsPhi_; row++ ) { - xtemp = xloop; - for ( unsigned int column = 0; column < houghNbinsPt_; column++ ) { - // Go around the square - x[0] = xtemp; - y[0] = yloop; - x[1] = x[0]; - y[1] = y[0] + binSizePhiTrkAxis; - x[2] = x[1] + binSizeQoverPtAxis; - y[2] = y[1]; - x[3] = x[2]; - y[3] = y[0]; - x[4] = x[0]; - y[4] = y[0]; - hisArrayHT_->AddBin(5, x, y); - // Go right - xtemp += binSizeQoverPtAxis; + + //=== Book histograms checking filling of r-phi HT array. + + TFileDirectory Histos::bookRphiHT() { + TFileDirectory inputDir = fs_->mkdir("HTrphi"); + + // The next block of code is to book a histogram to study unusual HT cell shapes. + + unsigned int shape = settings_->shape(); + float maxAbsQoverPtAxis = 1. / houghMinPt_; // Max. |q/Pt| covered by HT array. + float maxAbsPhiTrkAxis = M_PI / (float)numPhiSectors_; // Half-width of phiTrk axis in HT array. + float binSizeQoverPtAxis = 2. * maxAbsQoverPtAxis / (float)houghNbinsPt_; + if (shape == 2 || shape == 1 || shape == 3) + binSizeQoverPtAxis = 2. * maxAbsQoverPtAxis / (houghNbinsPt_ - 1.); + float binSizePhiTrkAxis = 2. * maxAbsPhiTrkAxis / (float)houghNbinsPhi_; + if (shape == 2) + binSizePhiTrkAxis = 2. * maxAbsPhiTrkAxis / (houghNbinsPhi_ - 1. / 6.); + else if (shape == 1) + binSizePhiTrkAxis = 2. * maxAbsPhiTrkAxis / (houghNbinsPhi_ - 1. / 2.); + hisArrayHT_ = inputDir.make("ArrayHT", + "HT Array; m Bins; c Bins", + -maxAbsQoverPtAxis, + maxAbsQoverPtAxis, + -maxAbsPhiTrkAxis, + maxAbsPhiTrkAxis); + //hisStubHT_ = inputDir.make< TF1 >( "StubHT", "[0]+[1]*x", -maxAbsQoverPtAxis, maxAbsQoverPtAxis ); + //hisStubHT_->SetMinimum( -maxAbsPhiTrkAxis ); + //hisStubHT_->SetMaximum( maxAbsPhiTrkAxis ); + float xloop, yloop, xtemp; + Double_t x[7], y[7]; + switch (shape) { + case 0: + xloop = -maxAbsQoverPtAxis; + yloop = -maxAbsPhiTrkAxis; + for (unsigned int row = 0; row < houghNbinsPhi_; row++) { + xtemp = xloop; + for (unsigned int column = 0; column < houghNbinsPt_; column++) { + // Go around the square + x[0] = xtemp; + y[0] = yloop; + x[1] = x[0]; + y[1] = y[0] + binSizePhiTrkAxis; + x[2] = x[1] + binSizeQoverPtAxis; + y[2] = y[1]; + x[3] = x[2]; + y[3] = y[0]; + x[4] = x[0]; + y[4] = y[0]; + hisArrayHT_->AddBin(5, x, y); + // Go right + xtemp += binSizeQoverPtAxis; + } + yloop += binSizePhiTrkAxis; } - yloop += binSizePhiTrkAxis; - } - break; - case 1 : - xloop = - maxAbsQoverPtAxis - binSizeQoverPtAxis; - yloop = - maxAbsPhiTrkAxis; - for ( unsigned int row = 0; row < houghNbinsPhi_ * 2; row++ ) { - xtemp = xloop; - for ( unsigned int column = 0; column < houghNbinsPt_; column++ ) { - // Go around the square - x[0] = xtemp; - y[0] = yloop; - x[1] = x[0] + binSizeQoverPtAxis; - y[1] = y[0] + binSizePhiTrkAxis / 2.; - x[2] = x[1] + binSizeQoverPtAxis; - y[2] = y[0]; - x[3] = x[1]; - y[3] = y[0] - binSizePhiTrkAxis / 2.; - x[4] = x[0]; - y[4] = y[0]; - hisArrayHT_->AddBin(5, x, y); - // Go right - xtemp += binSizeQoverPtAxis * 2.; + break; + case 1: + xloop = -maxAbsQoverPtAxis - binSizeQoverPtAxis; + yloop = -maxAbsPhiTrkAxis; + for (unsigned int row = 0; row < houghNbinsPhi_ * 2; row++) { + xtemp = xloop; + for (unsigned int column = 0; column < houghNbinsPt_; column++) { + // Go around the square + x[0] = xtemp; + y[0] = yloop; + x[1] = x[0] + binSizeQoverPtAxis; + y[1] = y[0] + binSizePhiTrkAxis / 2.; + x[2] = x[1] + binSizeQoverPtAxis; + y[2] = y[0]; + x[3] = x[1]; + y[3] = y[0] - binSizePhiTrkAxis / 2.; + x[4] = x[0]; + y[4] = y[0]; + hisArrayHT_->AddBin(5, x, y); + // Go right + xtemp += binSizeQoverPtAxis * 2.; + } + xloop += (row % 2 == 0) ? binSizeQoverPtAxis : -binSizeQoverPtAxis; + yloop += binSizePhiTrkAxis / 2.; } - xloop += ( row % 2 == 0 ) ? binSizeQoverPtAxis : - binSizeQoverPtAxis; - yloop += binSizePhiTrkAxis / 2.; - } - break; - case 2 : - xloop = - maxAbsQoverPtAxis - binSizeQoverPtAxis; - yloop = - maxAbsPhiTrkAxis; - for ( unsigned int row = 0; row < houghNbinsPhi_ * 2; row++ ) { - xtemp = xloop; - for ( unsigned int column = 0; column < houghNbinsPt_; column++ ) { - // Go around the hexagon - x[0] = xtemp; - y[0] = yloop; - x[1] = x[0]; - y[1] = y[0] + binSizePhiTrkAxis / 3.; - x[2] = x[1] + binSizeQoverPtAxis; - y[2] = y[1] + binSizePhiTrkAxis / 6.; - x[3] = x[2] + binSizeQoverPtAxis; - y[3] = y[1]; - x[4] = x[3]; - y[4] = y[0]; - x[5] = x[2]; - y[5] = y[4] - binSizePhiTrkAxis / 6.; - x[6] = x[0]; - y[6] = y[0]; - hisArrayHT_->AddBin(7, x, y); - // Go right - xtemp += binSizeQoverPtAxis * 2.; + break; + case 2: + xloop = -maxAbsQoverPtAxis - binSizeQoverPtAxis; + yloop = -maxAbsPhiTrkAxis; + for (unsigned int row = 0; row < houghNbinsPhi_ * 2; row++) { + xtemp = xloop; + for (unsigned int column = 0; column < houghNbinsPt_; column++) { + // Go around the hexagon + x[0] = xtemp; + y[0] = yloop; + x[1] = x[0]; + y[1] = y[0] + binSizePhiTrkAxis / 3.; + x[2] = x[1] + binSizeQoverPtAxis; + y[2] = y[1] + binSizePhiTrkAxis / 6.; + x[3] = x[2] + binSizeQoverPtAxis; + y[3] = y[1]; + x[4] = x[3]; + y[4] = y[0]; + x[5] = x[2]; + y[5] = y[4] - binSizePhiTrkAxis / 6.; + x[6] = x[0]; + y[6] = y[0]; + hisArrayHT_->AddBin(7, x, y); + // Go right + xtemp += binSizeQoverPtAxis * 2.; + } + xloop += (row % 2 == 0) ? binSizeQoverPtAxis : -binSizeQoverPtAxis; + yloop += binSizePhiTrkAxis / 2.; } - xloop += ( row % 2 == 0 ) ? binSizeQoverPtAxis : - binSizeQoverPtAxis; - yloop += binSizePhiTrkAxis / 2.; - } - break; - case 3 : - xloop = - maxAbsQoverPtAxis - binSizeQoverPtAxis; - yloop = - maxAbsPhiTrkAxis; - for ( unsigned int row = 0; row < houghNbinsPhi_ * 2; row++ ) { - xtemp = xloop; - for ( unsigned int column = 0; column < houghNbinsPt_; column++ ) { - // Go around the square - x[0] = xtemp; - y[0] = yloop; - x[1] = x[0]; - y[1] = y[0] + binSizePhiTrkAxis / 2.; - x[2] = x[1] + binSizeQoverPtAxis * 2.; - y[2] = y[1]; - x[3] = x[2]; - y[3] = y[0]; - x[4] = x[0]; - y[4] = y[0]; - hisArrayHT_->AddBin(5, x, y); - // Go right - xtemp += binSizeQoverPtAxis * 2.; + break; + case 3: + xloop = -maxAbsQoverPtAxis - binSizeQoverPtAxis; + yloop = -maxAbsPhiTrkAxis; + for (unsigned int row = 0; row < houghNbinsPhi_ * 2; row++) { + xtemp = xloop; + for (unsigned int column = 0; column < houghNbinsPt_; column++) { + // Go around the square + x[0] = xtemp; + y[0] = yloop; + x[1] = x[0]; + y[1] = y[0] + binSizePhiTrkAxis / 2.; + x[2] = x[1] + binSizeQoverPtAxis * 2.; + y[2] = y[1]; + x[3] = x[2]; + y[3] = y[0]; + x[4] = x[0]; + y[4] = y[0]; + hisArrayHT_->AddBin(5, x, y); + // Go right + xtemp += binSizeQoverPtAxis * 2.; + } + xloop += (row % 2 == 0) ? binSizeQoverPtAxis : -binSizeQoverPtAxis; + yloop += binSizePhiTrkAxis / 2.; } - xloop += ( row % 2 == 0 ) ? binSizeQoverPtAxis : - binSizeQoverPtAxis; - yloop += binSizePhiTrkAxis / 2.; - } - break; - } - - hisIncStubsPerHT_ = inputDir.make("IncStubsPerHT","; Number of filtered stubs per r#phi HT array (inc. duplicates)",100,0.,-1.); - hisExcStubsPerHT_ = inputDir.make("ExcStubsPerHT","; Number of filtered stubs per r#phi HT array (exc. duplicates)",250,-0.5,249.5); - - hisNumStubsInCellVsEta_ = inputDir.make("NumStubsInCellVsEta","; no. of stubs per HT cell summed over phi sector; #eta region",100,-0.5,499.5, numEtaRegions_, -0.5, numEtaRegions_ - 0.5); - - hisStubsOnRphiTracksPerHT_ = inputDir.make("StubsOnRphiTracksPerHT","; Number of stubs assigned to tracks per r#phi HT array",500,-0.5,499.5); + break; + } - hisHTstubsPerTrack_ = inputDir.make("stubsPerTrk","No. stubs per track",25,-0.5,24.5); - hisHTmBin_ = inputDir.make("mBin","HT m bin", houghNbinsPt_, -0.5, houghNbinsPt_-0.5); - hisHTcBin_ = inputDir.make("cBin","HT c bin", houghNbinsPhi_, -0.5, houghNbinsPhi_-0.5); + hisIncStubsPerHT_ = inputDir.make( + "IncStubsPerHT", "; Number of filtered stubs per r#phi HT array (inc. duplicates)", 100, 0., -1.); + hisExcStubsPerHT_ = inputDir.make( + "ExcStubsPerHT", "; Number of filtered stubs per r#phi HT array (exc. duplicates)", 250, -0.5, 249.5); - return inputDir; -} + hisNumStubsInCellVsEta_ = inputDir.make("NumStubsInCellVsEta", + "; no. of stubs per HT cell summed over phi sector; #eta region", + 100, + -0.5, + 499.5, + numEtaRegions_, + -0.5, + numEtaRegions_ - 0.5); -//=== Fill histograms checking filling of r-phi HT array. + hisStubsOnRphiTracksPerHT_ = inputDir.make( + "StubsOnRphiTracksPerHT", "; Number of stubs assigned to tracks per r#phi HT array", 500, -0.5, 499.5); -void Histos::fillRphiHT(const matrix& mHtRphis) { + hisHTstubsPerTrack_ = inputDir.make("stubsPerTrk", "No. stubs per track", 25, -0.5, 24.5); + hisHTmBin_ = inputDir.make("mBin", "HT m bin", houghNbinsPt_, -0.5, houghNbinsPt_ - 0.5); + hisHTcBin_ = inputDir.make("cBin", "HT c bin", houghNbinsPhi_, -0.5, houghNbinsPhi_ - 0.5); - //--- Loop over (eta,phi) sectors, counting the number of stubs in the HT array of each. + return inputDir; + } - if ( plotFirst_ ) { - const HTrphi& htRphi = mHtRphis(settings_->iPhiPlot(),settings_->iEtaPlot()); - float phiCentreSector = -M_PI + ( 1. + 2. * settings_->iPhiPlot() ) * M_PI / (float)numPhiSectors_; - const matrix& htRphiMatrix = htRphi.getAllCells(); - const Stub* stub( nullptr ); - for (unsigned int i = 0; i < htRphiMatrix.size1(); i++) - for (unsigned int j = 0; j < htRphiMatrix.size2(); j++) { - std::pair< float, float > cell = htRphi.helix2Dhough(i,j); - unsigned int numStubs = htRphiMatrix(i,j).numStubs(); - hisArrayHT_->Fill(cell.first, reco::deltaPhi(cell.second, phiCentreSector), numStubs); - if ( numStubs > 0 ) - stub = htRphiMatrix(i,j).stubs().front(); - } - if ( stub != nullptr ) { - //hisStubHT_->SetParameters( reco::deltaPhi( stub->phi(), phiCentreSector ), settings_->invPtToDphi() * ( stub->r() - settings_->chosenRofPhi() ) ); - //hisStubHT_->Draw(); + //=== Fill histograms checking filling of r-phi HT array. + + void Histos::fillRphiHT(const matrix& mHtRphis) { + //--- Loop over (eta,phi) sectors, counting the number of stubs in the HT array of each. + + if (plotFirst_) { + const HTrphi& htRphi = mHtRphis(settings_->iPhiPlot(), settings_->iEtaPlot()); + float phiCentreSector = -M_PI + (1. + 2. * settings_->iPhiPlot()) * M_PI / (float)numPhiSectors_; + const matrix& htRphiMatrix = htRphi.getAllCells(); + const Stub* stub(nullptr); + for (unsigned int i = 0; i < htRphiMatrix.size1(); i++) + for (unsigned int j = 0; j < htRphiMatrix.size2(); j++) { + std::pair cell = htRphi.helix2Dhough(i, j); + unsigned int numStubs = htRphiMatrix(i, j).numStubs(); + hisArrayHT_->Fill(cell.first, reco::deltaPhi(cell.second, phiCentreSector), numStubs); + if (numStubs > 0) + stub = htRphiMatrix(i, j).stubs().front(); + } + if (stub != nullptr) { + //hisStubHT_->SetParameters( reco::deltaPhi( stub->phi(), phiCentreSector ), settings_->invPtToDphi() * ( stub->r() - settings_->chosenRofPhi() ) ); + //hisStubHT_->Draw(); + } } - } - plotFirst_ = false; + plotFirst_ = false; - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - const HTrphi& htRphi = mHtRphis (iPhiSec, iEtaReg); + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + const HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); - // Here, if a stub appears in multiple cells, it is counted multiple times. - hisIncStubsPerHT_->Fill( htRphi.numStubsInc() ); - // Here, if a stub appears in multiple cells, it is counted only once. - hisExcStubsPerHT_->Fill( htRphi.numStubsExc() ); + // Here, if a stub appears in multiple cells, it is counted multiple times. + hisIncStubsPerHT_->Fill(htRphi.numStubsInc()); + // Here, if a stub appears in multiple cells, it is counted only once. + hisExcStubsPerHT_->Fill(htRphi.numStubsExc()); + } } - } - //--- Count number of stubs in each cell of HT array, summing over all the phi sectors within a given - //--- eta region. This determines the buffer size needed to store them in the firmware. - - // Loop over eta regions. - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - // Get dimensions of HT array (assumed same for all phi sectors) - unsigned int iPhiSecDummy = 0; - const matrix& rphiHTcellsDummy = mHtRphis(iPhiSecDummy, iEtaReg).getAllCells(); - const unsigned int nbins1 = rphiHTcellsDummy.size1(); - const unsigned int nbins2 = rphiHTcellsDummy.size2(); - // Loop over cells inside HT array - for (unsigned int m = 0; m < nbins1; m++) { - for (unsigned int n = 0; n < nbins2; n++) { - // Loop over phi sectors - unsigned int nStubsInCellPhiSum = 0; - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - const HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); - const matrix& rphiHTcells = htRphi.getAllCells(); - nStubsInCellPhiSum += rphiHTcells(m,n).numStubs(); - } - // Plot total number of stubs in this cell, summed over all phi sectors. - hisNumStubsInCellVsEta_->Fill( nStubsInCellPhiSum, iEtaReg ); + //--- Count number of stubs in each cell of HT array, summing over all the phi sectors within a given + //--- eta region. This determines the buffer size needed to store them in the firmware. + + // Loop over eta regions. + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + // Get dimensions of HT array (assumed same for all phi sectors) + unsigned int iPhiSecDummy = 0; + const matrix& rphiHTcellsDummy = mHtRphis(iPhiSecDummy, iEtaReg).getAllCells(); + const unsigned int nbins1 = rphiHTcellsDummy.size1(); + const unsigned int nbins2 = rphiHTcellsDummy.size2(); + // Loop over cells inside HT array + for (unsigned int m = 0; m < nbins1; m++) { + for (unsigned int n = 0; n < nbins2; n++) { + // Loop over phi sectors + unsigned int nStubsInCellPhiSum = 0; + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + const HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); + const matrix& rphiHTcells = htRphi.getAllCells(); + nStubsInCellPhiSum += rphiHTcells(m, n).numStubs(); + } + // Plot total number of stubs in this cell, summed over all phi sectors. + hisNumStubsInCellVsEta_->Fill(nStubsInCellPhiSum, iEtaReg); + } } } - } - //--- Count number of cells assigned to track candidates by r-phi HT (before any rz filtering - //--- or rz HT has been run). - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - const HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); - hisStubsOnRphiTracksPerHT_->Fill(htRphi.numStubsOnTrackCands2D()); - // Also note cell location of HT tracks. - for (const L1track2D& trk : htRphi.trackCands2D()) { - hisHTstubsPerTrack_->Fill(trk.getNumStubs()); - hisHTmBin_->Fill(trk.getCellLocationHT().first); - hisHTcBin_->Fill(trk.getCellLocationHT().second); + //--- Count number of cells assigned to track candidates by r-phi HT (before any rz filtering + //--- or rz HT has been run). + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + const HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); + hisStubsOnRphiTracksPerHT_->Fill(htRphi.numStubsOnTrackCands2D()); + // Also note cell location of HT tracks. + for (const L1track2D& trk : htRphi.trackCands2D()) { + hisHTstubsPerTrack_->Fill(trk.getNumStubs()); + hisHTmBin_->Fill(trk.getCellLocationHT().first); + hisHTcBin_->Fill(trk.getCellLocationHT().second); + } } } } -} -//=== Book histograms about r-z track filters (or other filters applied after r-phi HT array). + //=== Book histograms about r-z track filters (or other filters applied after r-phi HT array). -TFileDirectory Histos::bookRZfilters() { + TFileDirectory Histos::bookRZfilters() { + TFileDirectory inputDir = fs_->mkdir("RZfilters"); - TFileDirectory inputDir = fs_->mkdir("RZfilters"); - - //--- Histograms for Seed Filter - if (settings_->rzFilterName() == "SeedFilter") { - // Check number of track seeds that r-z filters must check. - hisNumSeedCombinations_ = inputDir.make("NumSeedCombinations_","; Number of seed combinations per track cand; no. seeds ; ", 50, -0.5 , 49.5); - hisNumGoodSeedCombinations_ = inputDir.make("NumGoodSeedCombinations_","; Number of good seed combinations per track cand; ", 30, -0.5 , 29.5); + //--- Histograms for Seed Filter + if (settings_->rzFilterName() == "SeedFilter") { + // Check number of track seeds that r-z filters must check. + hisNumSeedCombinations_ = inputDir.make( + "NumSeedCombinations_", "; Number of seed combinations per track cand; no. seeds ; ", 50, -0.5, 49.5); + hisNumGoodSeedCombinations_ = inputDir.make( + "NumGoodSeedCombinations_", "; Number of good seed combinations per track cand; ", 30, -0.5, 29.5); + } + return inputDir; } - return inputDir; -} - -//=== Fill histograms about r-z track filters. - -void Histos::fillRZfilters(const matrix& mGet3Dtrks) { - - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); - - //--- Histograms for Seed Filter - if (settings_->rzFilterName() == "SeedFilter") { - // Check number of track seeds per sector that r-z "seed" filter checked. - const vector numSeedComb = get3Dtrk.getRZfilter().numSeedCombsPerTrk(); - for (const unsigned int& num : numSeedComb) { - hisNumSeedCombinations_->Fill(num) ; - } - // Same again, but this time only considering seeds the r-z filters defined as "good". - const vector numGoodSeedComb = get3Dtrk.getRZfilter().numGoodSeedCombsPerTrk(); - for (const unsigned int& num : numGoodSeedComb) { - hisNumGoodSeedCombinations_->Fill(num) ; - } + + //=== Fill histograms about r-z track filters. + + void Histos::fillRZfilters(const matrix& mGet3Dtrks) { + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); + + //--- Histograms for Seed Filter + if (settings_->rzFilterName() == "SeedFilter") { + // Check number of track seeds per sector that r-z "seed" filter checked. + const vector numSeedComb = get3Dtrk.getRZfilter().numSeedCombsPerTrk(); + for (const unsigned int& num : numSeedComb) { + hisNumSeedCombinations_->Fill(num); + } + // Same again, but this time only considering seeds the r-z filters defined as "good". + const vector numGoodSeedComb = get3Dtrk.getRZfilter().numGoodSeedCombsPerTrk(); + for (const unsigned int& num : numGoodSeedComb) { + hisNumGoodSeedCombinations_->Fill(num); + } + } } } } -} -//=== Book histograms studying track candidates found by Hough Transform. + //=== Book histograms studying track candidates found by Hough Transform. -TFileDirectory Histos::bookTrackCands(string tName) { + TFileDirectory Histos::bookTrackCands(string tName) { + // Now book histograms for studying tracking in general. - // Now book histograms for studying tracking in general. + // Define lambda function to facilitate adding "tName" to directory & histogram names. + //auto addn = [tName](string s){ return TString::Format("%s_%s", s.c_str(), tName.c_str()).Data(); }; + auto addn = [tName](string s) { return TString::Format("%s_%s", s.c_str(), tName.c_str()); }; - // Define lambda function to facilitate adding "tName" to directory & histogram names. - //auto addn = [tName](string s){ return TString::Format("%s_%s", s.c_str(), tName.c_str()).Data(); }; - auto addn = [tName](string s){ return TString::Format("%s_%s", s.c_str(), tName.c_str()); }; + TFileDirectory inputDir = fs_->mkdir(addn("TrackCands").Data()); - TFileDirectory inputDir = fs_->mkdir(addn("TrackCands").Data()); + bool TMTT = (tName == "HT" || tName == "RZ"); - bool TMTT = (tName == "HT" || tName == "RZ"); + // Count tracks in various ways (including/excluding duplicates, excluding fakes ...) + profNumTrackCands_[tName] = + inputDir.make(addn("NumTrackCands"), "; class; N. of tracks in tracker", 7, 0.5, 7.5); + profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(7, "TP for eff recoed"); + profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(6, "TP recoed"); + profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(5, "TP recoed x #eta sector dups"); + profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(4, "TP recoed x sector dups"); + profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(2, "TP recoed x track dups"); + profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(1, "reco tracks including fakes"); + profNumTrackCands_[tName]->LabelsOption("d"); - // Count tracks in various ways (including/excluding duplicates, excluding fakes ...) - profNumTrackCands_[tName] = inputDir.make(addn("NumTrackCands"),"; class; N. of tracks in tracker",7,0.5,7.5); - profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(7,"TP for eff recoed"); - profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(6,"TP recoed"); - profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(5,"TP recoed x #eta sector dups"); - profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(4,"TP recoed x sector dups"); - profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(2,"TP recoed x track dups"); - profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(1,"reco tracks including fakes"); - profNumTrackCands_[tName]->LabelsOption("d"); + unsigned int nPhi = numPhiSectors_; + unsigned int nEta = numEtaRegions_; + float maxAbsQoverPt = 1. / houghMinPt_; // Max. |q/Pt| covered by HT array. + hisNumTracksVsQoverPt_[tName] = inputDir.make( + addn("NumTracksVsQoverPt"), "; Q/Pt; No. of tracks in tracker", 100, -maxAbsQoverPt, maxAbsQoverPt); + hisNumTrksPerNon_[tName] = inputDir.make(addn("NumTrksPerNon"), "; No. tracks per nonant;", 200, -0.5, 199.5); + if (TMTT) { + profNumTracksVsEta_[tName] = inputDir.make( + addn("NumTracksVsEta"), "; #eta region; No. of tracks in tracker", nEta, -0.5, nEta - 0.5); + hisNumTrksPerSect_[tName] = + inputDir.make(addn("NumTrksPerSect"), "; No. tracks per sector;", 100, -0.5, 99.5); + } - unsigned int nPhi = numPhiSectors_; - unsigned int nEta = numEtaRegions_; - float maxAbsQoverPt = 1./houghMinPt_; // Max. |q/Pt| covered by HT array. - hisNumTracksVsQoverPt_[tName] = inputDir.make(addn("NumTracksVsQoverPt"),"; Q/Pt; No. of tracks in tracker",100, -maxAbsQoverPt, maxAbsQoverPt); - hisNumTrksPerNon_[tName] = inputDir.make(addn("NumTrksPerNon"), "; No. tracks per nonant;",200,-0.5,199.5); - if (TMTT) { - profNumTracksVsEta_[tName] = inputDir.make(addn("NumTracksVsEta"),"; #eta region; No. of tracks in tracker", nEta, -0.5, nEta - 0.5); - hisNumTrksPerSect_[tName] = inputDir.make(addn("NumTrksPerSect"),"; No. tracks per sector;",100,-0.5,99.5); - } + // Count stubs per event assigned to tracks (determines HT data output rate) - // Count stubs per event assigned to tracks (determines HT data output rate) + profStubsOnTracks_[tName] = + inputDir.make(addn("StubsOnTracks"), "; ; No. of stubs on tracks per event", 1, 0.5, 1.5); + hisStubsOnTracksPerNon_[tName] = + inputDir.make(addn("StubsOnTracksPerNon"), "; No. of stubs on tracks per nonant", 1000, -0.5, 999.5); + hisUniqueStubsOnTrksPerNon_[tName] = inputDir.make( + addn("UniqueStubsOnTrksPerNon"), "; No. of unique stubs on tracks per nonant", 500, -0.5, 499.5); + if (TMTT) { + profStubsOnTracksVsEta_[tName] = inputDir.make( + addn("StubsOnTracksVsEta"), "; #eta region; No. of stubs on tracks per event", nEta, -0.5, nEta - 0.5); + hisStubsOnTracksPerSect_[tName] = + inputDir.make(addn("StubsOnTracksPerSect"), "; No. of stubs on tracks per sector", 500, -0.5, 499.5); + hisUniqueStubsOnTrksPerSect_[tName] = inputDir.make( + addn("UniqueStubsOnTrksPerSect"), "; No. of unique stubs on tracks per sector", 500, -0.5, 499.5); + } - profStubsOnTracks_[tName] = inputDir.make(addn("StubsOnTracks"),"; ; No. of stubs on tracks per event",1,0.5,1.5); - hisStubsOnTracksPerNon_[tName] = inputDir.make(addn("StubsOnTracksPerNon"),"; No. of stubs on tracks per nonant", 1000,-0.5,999.5); - hisUniqueStubsOnTrksPerNon_[tName] = inputDir.make(addn("UniqueStubsOnTrksPerNon"),"; No. of unique stubs on tracks per nonant", 500,-0.5,499.5); - if (TMTT) { - profStubsOnTracksVsEta_[tName] = inputDir.make(addn("StubsOnTracksVsEta"),"; #eta region; No. of stubs on tracks per event", nEta, -0.5, nEta - 0.5); - hisStubsOnTracksPerSect_[tName] = inputDir.make(addn("StubsOnTracksPerSect"),"; No. of stubs on tracks per sector", 500,-0.5,499.5); - hisUniqueStubsOnTrksPerSect_[tName] = inputDir.make(addn("UniqueStubsOnTrksPerSect"),"; No. of unique stubs on tracks per sector", 500,-0.5,499.5); - } + hisStubsPerTrack_[tName] = inputDir.make(addn("StubsPerTrack"), ";No. of stubs per track;", 50, -0.5, 49.5); + hisLayersPerTrack_[tName] = + inputDir.make(addn("LayersPerTrack"), ";No. of layers with stubs per track;", 20, -0.5, 19.5); + hisPSLayersPerTrack_[tName] = + inputDir.make(addn("PSLayersPerTrack"), ";No. of PS layers with stubs per track;", 20, -0.5, 19.5); + hisLayersPerTrueTrack_[tName] = + inputDir.make(addn("LayersPerTrueTrack"), ";No. of layers with stubs per genuine track;", 20, -0.5, 19.5); + hisPSLayersPerTrueTrack_[tName] = inputDir.make( + addn("PSLayersPerTrueTrack"), ";No. of PS layers with stubs per genuine track;", 20, -0.5, 19.5); - hisStubsPerTrack_[tName] = inputDir.make(addn("StubsPerTrack"),";No. of stubs per track;",50,-0.5,49.5); - hisLayersPerTrack_[tName] = inputDir.make(addn("LayersPerTrack"),";No. of layers with stubs per track;",20,-0.5,19.5); - hisPSLayersPerTrack_[tName] = inputDir.make(addn("PSLayersPerTrack"),";No. of PS layers with stubs per track;",20,-0.5,19.5); - hisLayersPerTrueTrack_[tName] = inputDir.make(addn("LayersPerTrueTrack"),";No. of layers with stubs per genuine track;",20,-0.5,19.5); - hisPSLayersPerTrueTrack_[tName] = inputDir.make(addn("PSLayersPerTrueTrack"),";No. of PS layers with stubs per genuine track;",20,-0.5,19.5); - - if (TMTT) { - hisNumStubsPerLink_[tName] = inputDir.make(addn("NumStubsPerLink"), "; Mean #stubs per MHT output opto-link;", 50,-0.5,199.5); - hisNumStubsVsLink_[tName] = inputDir.make(addn("NumStubsVsLink"), "; MHT output opto-link; No. stubs/event", 36, -0.5, 35.5, 20,-0.5,199.5); - profMeanStubsPerLink_[tName] = inputDir.make(addn("MeanStubsPerLink"), "; Mean #stubs per MHT output opto-link;", 36,-0.5,35.5); - hisNumTrksPerLink_[tName] = inputDir.make(addn("NumTrksPerLink"), "; Mean #tracks per MHT output opto-link;", 50,-0.5,49.5); - hisNumTrksVsLink_[tName] = inputDir.make(addn("NumTrksVsLink"), "; MHT output opto-link; No. tracks/event", 72, -0.5, 71.5, 20,-0.5,49.5); - profMeanTrksPerLink_[tName] = inputDir.make(addn("MeanTrksPerLink"), "; Mean #tracks per MHT output opto-link;", 36,-0.5,35.5); - } + if (TMTT) { + hisNumStubsPerLink_[tName] = + inputDir.make(addn("NumStubsPerLink"), "; Mean #stubs per MHT output opto-link;", 50, -0.5, 199.5); + hisNumStubsVsLink_[tName] = inputDir.make( + addn("NumStubsVsLink"), "; MHT output opto-link; No. stubs/event", 36, -0.5, 35.5, 20, -0.5, 199.5); + profMeanStubsPerLink_[tName] = + inputDir.make(addn("MeanStubsPerLink"), "; Mean #stubs per MHT output opto-link;", 36, -0.5, 35.5); + hisNumTrksPerLink_[tName] = + inputDir.make(addn("NumTrksPerLink"), "; Mean #tracks per MHT output opto-link;", 50, -0.5, 49.5); + hisNumTrksVsLink_[tName] = inputDir.make( + addn("NumTrksVsLink"), "; MHT output opto-link; No. tracks/event", 72, -0.5, 71.5, 20, -0.5, 49.5); + profMeanTrksPerLink_[tName] = + inputDir.make(addn("MeanTrksPerLink"), "; Mean #tracks per MHT output opto-link;", 36, -0.5, 35.5); + } - if (TMTT) { - // Checks if tracks have too many stubs to be stored in memory in each cell. - profExcessStubsPerTrackVsPt_[tName] = inputDir.make(addn("ExcessStubsPerTrackVsPt"),";q/Pt; Prob. of too many stubs per track",16,0.,maxAbsQoverPt); - } + if (TMTT) { + // Checks if tracks have too many stubs to be stored in memory in each cell. + profExcessStubsPerTrackVsPt_[tName] = inputDir.make( + addn("ExcessStubsPerTrackVsPt"), ";q/Pt; Prob. of too many stubs per track", 16, 0., maxAbsQoverPt); + } - hisFracMatchStubsOnTracks_[tName] = inputDir.make(addn("FracMatchStubsOnTracks"),"; Fraction of stubs on tracks matching best TP;",101,-0.005,1.005); + hisFracMatchStubsOnTracks_[tName] = inputDir.make( + addn("FracMatchStubsOnTracks"), "; Fraction of stubs on tracks matching best TP;", 101, -0.005, 1.005); - profFracTrueStubsVsLayer_[tName] = inputDir.make(addn("FracTrueStubsVsLayer"),";Layer ID; fraction of true stubs",30,0.5,30.5); + profFracTrueStubsVsLayer_[tName] = + inputDir.make(addn("FracTrueStubsVsLayer"), ";Layer ID; fraction of true stubs", 30, 0.5, 30.5); - // Check how much stub bend differs from predicted one. - hisDeltaBendTrue_[tName] = inputDir.make(addn("DeltaBendTrue"),"True stubs; stub bend minus true bend / resolution;",100,-2.,2.); - hisDeltaBendFake_[tName] = inputDir.make(addn("DeltaBendFake"),"Fake stubs; stub bend minus true bend / resolution;",100,-2.,2.); + // Check how much stub bend differs from predicted one. + hisDeltaBendTrue_[tName] = + inputDir.make(addn("DeltaBendTrue"), "True stubs; stub bend minus true bend / resolution;", 100, -2., 2.); + hisDeltaBendFake_[tName] = + inputDir.make(addn("DeltaBendFake"), "Fake stubs; stub bend minus true bend / resolution;", 100, -2., 2.); - if (TMTT) { - // Study duplication of tracks within HT. - profDupTracksVsEta_[tName] = inputDir.make(addn("DupTracksVsTPeta"), "; #eta; No. of duplicate tracks per TP in individual HT array;",15,0.0,3.0); - profDupTracksVsInvPt_[tName] = inputDir.make(addn("DupTracksVsInvPt"), "; 1/Pt; No. of duplicate tracks per TP",16,0.,maxAbsQoverPt); - } + if (TMTT) { + // Study duplication of tracks within HT. + profDupTracksVsEta_[tName] = inputDir.make( + addn("DupTracksVsTPeta"), "; #eta; No. of duplicate tracks per TP in individual HT array;", 15, 0.0, 3.0); + profDupTracksVsInvPt_[tName] = inputDir.make( + addn("DupTracksVsInvPt"), "; 1/Pt; No. of duplicate tracks per TP", 16, 0., maxAbsQoverPt); + } - // Histos of track params. - hisQoverPt_[tName] = inputDir.make(addn("QoverPt"),"; track q/Pt", 100,-0.5,0.5); - hisPhi0_[tName] = inputDir.make(addn("Phi0"), "; track #phi0",70,-3.5,3.5); - hisEta_[tName] = inputDir.make(addn("Eta"), "; track #eta", 70,-3.5,3.5); - hisZ0_[tName] = inputDir.make(addn("Z0"), "; track z0", 100,-25.0,25.0); - - // Histos of track parameter resolution - hisQoverPtRes_[tName] = inputDir.make(addn("QoverPtRes"),"; track resolution in q/Pt", 100,-0.06,0.06); - hisPhi0Res_[tName] = inputDir.make(addn("Phi0Res"), "; track resolution in #phi0",100,-0.04,0.04); - hisEtaRes_[tName] = inputDir.make(addn("EtaRes"), "; track resolution in #eta", 100,-1.0,1.0); - hisZ0Res_[tName] = inputDir.make(addn("Z0Res"), "; track resolution in z0", 100,-10.0,10.0); - - hisRecoVsTrueQinvPt_[tName] = inputDir.make(addn("RecoVsTrueQinvPt"), "; TP q/p_{T}; Reco q/p_{T} (good #chi^{2})", 60, -0.6, 0.6, 240, -0.6, 0.6 ); - hisRecoVsTruePhi0_[tName] = inputDir.make(addn("RecoVsTruePhi0"), "; TP #phi_{0}; Reco #phi_{0} (good #chi^{2})", 70, -3.5, 3.5, 280, -3.5, 3.5 ); - hisRecoVsTrueD0_[tName] = inputDir.make(addn("RecoVsTrueD0"), "; TP d_{0}; Reco d_{0} (good #chi^{2})", 100, -2., 2., 100, -2., 2. ); - hisRecoVsTrueZ0_[tName] = inputDir.make(addn("RecoVsTrueZ0"), "; TP z_{0}; Reco z_{0} (good #chi^{2})" , 100, -25., 25., 100, -25., 25. ); - hisRecoVsTrueEta_[tName] = inputDir.make(addn("RecoVsTrueEta"), "; TP #eta; Reco #eta (good #chi^{2})", 70, -3.5, 3.5, 70, -3.5, 3.5 ); - - // Histos for tracking efficiency vs. TP kinematics - hisRecoTPinvptForEff_[tName] = inputDir.make(addn("RecoTPinvptForEff"), "; 1/Pt of TP (used for effi. measurement);",24,0.,1.5*maxAbsQoverPt); - hisRecoTPptForEff_[tName] = inputDir.make(addn("RecoTPptForEff"), "; Pt of TP (used for effi. measurement);",25,0.0,100.0); - hisRecoTPetaForEff_[tName] = inputDir.make(addn("RecoTPetaForEff"),"; #eta of TP (used for effi. measurement);",20,-3.,3.); - hisRecoTPphiForEff_[tName] = inputDir.make(addn("RecoTPphiForEff"),"; #phi of TP (used for effi. measurement);",20,-M_PI,M_PI); - - // Histo for efficiency to reconstruct track perfectly (no incorrect hits). - hisPerfRecoTPinvptForEff_[tName] = inputDir.make(addn("PerfRecoTPinvptForEff"), "; 1/Pt of TP (used for perf. effi. measurement);",24,0.,1.5*maxAbsQoverPt); - hisPerfRecoTPptForEff_[tName] = inputDir.make(addn("PerfRecoTPptForEff"), "; Pt of TP (used for perf. effi. measurement);",25,0.0,100.0); - hisPerfRecoTPetaForEff_[tName] = inputDir.make(addn("PerfRecoTPetaForEff"),"; #eta of TP (used for perf. effi. measurement);",20,-3.,3.); - - // Histos for tracking efficiency vs. TP production point - hisRecoTPd0ForEff_[tName] = inputDir.make(addn("RecoTPd0ForEff"), "; d0 of TP (used for effi. measurement);",40,0.,4.); - hisRecoTPz0ForEff_[tName] = inputDir.make(addn("RecoTPz0ForEff"), "; z0 of TP (used for effi. measurement);",50,0.,25.); - - // Histos for algorithmic tracking efficiency vs. TP kinematics - hisRecoTPinvptForAlgEff_[tName] = inputDir.make(addn("RecoTPinvptForAlgEff"), "; 1/Pt of TP (used for alg. effi. measurement);",24,0.,1.5*maxAbsQoverPt); - hisRecoTPptForAlgEff_[tName] = inputDir.make(addn("RecoTPptForAlgEff"), "; Pt of TP (used for alg. effi. measurement);",25,0.0,100.0); - hisRecoTPetaForAlgEff_[tName] = inputDir.make(addn("RecoTPetaForAlgEff"),"; #eta of TP (used for alg. effi. measurement);",20,-3.,3.); - hisRecoTPphiForAlgEff_[tName] = inputDir.make(addn("RecoTPphiForAlgEff"),"; #phi of TP (used for alg. effi. measurement);",20,-M_PI,M_PI); - - // Histos for algorithmic tracking efficiency in jets. - hisRecoTPinvptForAlgEff_inJetPtG30_[tName] = inputDir.make(addn("RecoTPinvptForAlgEff_inJetPtG30"), "; 1/Pt of TP (used for effi. measurement);",24,0.,1.5*maxAbsQoverPt); - hisRecoTPinvptForAlgEff_inJetPtG100_[tName] = inputDir.make(addn("RecoTPinvptForAlgEff_inJetPtG100"), "; 1/Pt of TP (used for effi. measurement);",24,0.,1.5*maxAbsQoverPt); - hisRecoTPinvptForAlgEff_inJetPtG200_[tName] = inputDir.make(addn("RecoTPinvptForAlgEff_inJetPtG200"), "; 1/Pt of TP (used for effi. measurement);",24,0.,1.5*maxAbsQoverPt); - - // Histo for efficiency to reconstruct track perfectly (no incorrect hits). - hisPerfRecoTPinvptForAlgEff_[tName] = inputDir.make(addn("PerfRecoTPinvptForAlgEff"), "; 1/Pt of TP (used for perf. alg. effi. measurement);",24,0.,1.5*maxAbsQoverPt); - hisPerfRecoTPptForAlgEff_[tName] = inputDir.make(addn("PerfRecoTPptForAlgEff"), "; Pt of TP (used for perf. alg. effi. measurement);",25,0.0,100.0); - hisPerfRecoTPetaForAlgEff_[tName] = inputDir.make(addn("PerfRecoTPetaForAlgEff"),"; #eta of TP (used for perf. alg. effi. measurement);",20,-3.,3.); - - // Histos for algorithmic tracking efficiency vs. TP production point - hisRecoTPd0ForAlgEff_[tName] = inputDir.make(addn("RecoTPd0ForAlgEff"), "; d0 of TP (used for alg. effi. measurement);",40,0.,4.); - hisRecoTPz0ForAlgEff_[tName] = inputDir.make(addn("RecoTPz0ForAlgEff"), "; z0 of TP (used for alg. effi. measurement);",50,0.,25.); - - // Histos for algorithmic tracking efficiency vs sector number (to check if looser cuts are needed in certain regions) - hisRecoTPphisecForAlgEff_[tName] = inputDir.make(addn("RecoTPphisecForAlgEff"), "; #phi sector of TP (used for alg. effi. measurement);",nPhi,-0.5,nPhi-0.5); - hisRecoTPetasecForAlgEff_[tName] = inputDir.make(addn("RecoTPetasecForAlgEff"), "; #eta sector of TP (used for alg. effi. measurement);",nEta,-0.5,nEta-0.5); - - // Histo for efficiency to reconstruct tracks perfectly (no incorrect hits). - hisPerfRecoTPphisecForAlgEff_[tName] = inputDir.make(addn("PerfRecoTPphisecForAlgEff"), "; #phi sector of TP (used for perf. alg. effi. measurement);",nPhi,-0.5,nPhi-0.5); - hisPerfRecoTPetasecForAlgEff_[tName] = inputDir.make(addn("PerfRecoTPetasecForAlgEff"), "; #eta sector of TP (used for perf. alg. effi. measurement);",nEta,-0.5,nEta-0.5); - - if (TMTT) { - // For those tracking particles causing the algorithmic efficiency to be below 100%, plot a flag indicating why. - hisRecoFailureReason_[tName] = inputDir.make(addn("RecoFailureReason"),"; Reason TP (used for alg. effi.) not reconstructed;",1,-0.5,0.5); - //hisRecoFailureLayer_[tName] = inputDir.make(addn("RecoFailureLayer"),"; Layer ID of lost stubs on unreconstructed TP;",30,-0.5,29.5); - } + // Histos of track params. + hisQoverPt_[tName] = inputDir.make(addn("QoverPt"), "; track q/Pt", 100, -0.5, 0.5); + hisPhi0_[tName] = inputDir.make(addn("Phi0"), "; track #phi0", 70, -3.5, 3.5); + hisEta_[tName] = inputDir.make(addn("Eta"), "; track #eta", 70, -3.5, 3.5); + hisZ0_[tName] = inputDir.make(addn("Z0"), "; track z0", 100, -25.0, 25.0); + + // Histos of track parameter resolution + hisQoverPtRes_[tName] = inputDir.make(addn("QoverPtRes"), "; track resolution in q/Pt", 100, -0.06, 0.06); + hisPhi0Res_[tName] = inputDir.make(addn("Phi0Res"), "; track resolution in #phi0", 100, -0.04, 0.04); + hisEtaRes_[tName] = inputDir.make(addn("EtaRes"), "; track resolution in #eta", 100, -1.0, 1.0); + hisZ0Res_[tName] = inputDir.make(addn("Z0Res"), "; track resolution in z0", 100, -10.0, 10.0); + + hisRecoVsTrueQinvPt_[tName] = inputDir.make( + addn("RecoVsTrueQinvPt"), "; TP q/p_{T}; Reco q/p_{T} (good #chi^{2})", 60, -0.6, 0.6, 240, -0.6, 0.6); + hisRecoVsTruePhi0_[tName] = inputDir.make( + addn("RecoVsTruePhi0"), "; TP #phi_{0}; Reco #phi_{0} (good #chi^{2})", 70, -3.5, 3.5, 280, -3.5, 3.5); + hisRecoVsTrueD0_[tName] = + inputDir.make(addn("RecoVsTrueD0"), "; TP d_{0}; Reco d_{0} (good #chi^{2})", 100, -2., 2., 100, -2., 2.); + hisRecoVsTrueZ0_[tName] = inputDir.make( + addn("RecoVsTrueZ0"), "; TP z_{0}; Reco z_{0} (good #chi^{2})", 100, -25., 25., 100, -25., 25.); + hisRecoVsTrueEta_[tName] = inputDir.make( + addn("RecoVsTrueEta"), "; TP #eta; Reco #eta (good #chi^{2})", 70, -3.5, 3.5, 70, -3.5, 3.5); + + // Histos for tracking efficiency vs. TP kinematics + hisRecoTPinvptForEff_[tName] = inputDir.make( + addn("RecoTPinvptForEff"), "; 1/Pt of TP (used for effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); + hisRecoTPptForEff_[tName] = + inputDir.make(addn("RecoTPptForEff"), "; Pt of TP (used for effi. measurement);", 25, 0.0, 100.0); + hisRecoTPetaForEff_[tName] = + inputDir.make(addn("RecoTPetaForEff"), "; #eta of TP (used for effi. measurement);", 20, -3., 3.); + hisRecoTPphiForEff_[tName] = + inputDir.make(addn("RecoTPphiForEff"), "; #phi of TP (used for effi. measurement);", 20, -M_PI, M_PI); + + // Histo for efficiency to reconstruct track perfectly (no incorrect hits). + hisPerfRecoTPinvptForEff_[tName] = inputDir.make( + addn("PerfRecoTPinvptForEff"), "; 1/Pt of TP (used for perf. effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); + hisPerfRecoTPptForEff_[tName] = inputDir.make( + addn("PerfRecoTPptForEff"), "; Pt of TP (used for perf. effi. measurement);", 25, 0.0, 100.0); + hisPerfRecoTPetaForEff_[tName] = inputDir.make( + addn("PerfRecoTPetaForEff"), "; #eta of TP (used for perf. effi. measurement);", 20, -3., 3.); + + // Histos for tracking efficiency vs. TP production point + hisRecoTPd0ForEff_[tName] = + inputDir.make(addn("RecoTPd0ForEff"), "; d0 of TP (used for effi. measurement);", 40, 0., 4.); + hisRecoTPz0ForEff_[tName] = + inputDir.make(addn("RecoTPz0ForEff"), "; z0 of TP (used for effi. measurement);", 50, 0., 25.); + + // Histos for algorithmic tracking efficiency vs. TP kinematics + hisRecoTPinvptForAlgEff_[tName] = inputDir.make( + addn("RecoTPinvptForAlgEff"), "; 1/Pt of TP (used for alg. effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); + hisRecoTPptForAlgEff_[tName] = + inputDir.make(addn("RecoTPptForAlgEff"), "; Pt of TP (used for alg. effi. measurement);", 25, 0.0, 100.0); + hisRecoTPetaForAlgEff_[tName] = + inputDir.make(addn("RecoTPetaForAlgEff"), "; #eta of TP (used for alg. effi. measurement);", 20, -3., 3.); + hisRecoTPphiForAlgEff_[tName] = inputDir.make( + addn("RecoTPphiForAlgEff"), "; #phi of TP (used for alg. effi. measurement);", 20, -M_PI, M_PI); + + // Histos for algorithmic tracking efficiency in jets. + hisRecoTPinvptForAlgEff_inJetPtG30_[tName] = inputDir.make(addn("RecoTPinvptForAlgEff_inJetPtG30"), + "; 1/Pt of TP (used for effi. measurement);", + 24, + 0., + 1.5 * maxAbsQoverPt); + hisRecoTPinvptForAlgEff_inJetPtG100_[tName] = inputDir.make(addn("RecoTPinvptForAlgEff_inJetPtG100"), + "; 1/Pt of TP (used for effi. measurement);", + 24, + 0., + 1.5 * maxAbsQoverPt); + hisRecoTPinvptForAlgEff_inJetPtG200_[tName] = inputDir.make(addn("RecoTPinvptForAlgEff_inJetPtG200"), + "; 1/Pt of TP (used for effi. measurement);", + 24, + 0., + 1.5 * maxAbsQoverPt); + + // Histo for efficiency to reconstruct track perfectly (no incorrect hits). + hisPerfRecoTPinvptForAlgEff_[tName] = inputDir.make(addn("PerfRecoTPinvptForAlgEff"), + "; 1/Pt of TP (used for perf. alg. effi. measurement);", + 24, + 0., + 1.5 * maxAbsQoverPt); + hisPerfRecoTPptForAlgEff_[tName] = inputDir.make( + addn("PerfRecoTPptForAlgEff"), "; Pt of TP (used for perf. alg. effi. measurement);", 25, 0.0, 100.0); + hisPerfRecoTPetaForAlgEff_[tName] = inputDir.make( + addn("PerfRecoTPetaForAlgEff"), "; #eta of TP (used for perf. alg. effi. measurement);", 20, -3., 3.); + + // Histos for algorithmic tracking efficiency vs. TP production point + hisRecoTPd0ForAlgEff_[tName] = + inputDir.make(addn("RecoTPd0ForAlgEff"), "; d0 of TP (used for alg. effi. measurement);", 40, 0., 4.); + hisRecoTPz0ForAlgEff_[tName] = + inputDir.make(addn("RecoTPz0ForAlgEff"), "; z0 of TP (used for alg. effi. measurement);", 50, 0., 25.); + + // Histos for algorithmic tracking efficiency vs sector number (to check if looser cuts are needed in certain regions) + hisRecoTPphisecForAlgEff_[tName] = inputDir.make( + addn("RecoTPphisecForAlgEff"), "; #phi sector of TP (used for alg. effi. measurement);", nPhi, -0.5, nPhi - 0.5); + hisRecoTPetasecForAlgEff_[tName] = inputDir.make( + addn("RecoTPetasecForAlgEff"), "; #eta sector of TP (used for alg. effi. measurement);", nEta, -0.5, nEta - 0.5); + + // Histo for efficiency to reconstruct tracks perfectly (no incorrect hits). + hisPerfRecoTPphisecForAlgEff_[tName] = + inputDir.make(addn("PerfRecoTPphisecForAlgEff"), + "; #phi sector of TP (used for perf. alg. effi. measurement);", + nPhi, + -0.5, + nPhi - 0.5); + hisPerfRecoTPetasecForAlgEff_[tName] = + inputDir.make(addn("PerfRecoTPetasecForAlgEff"), + "; #eta sector of TP (used for perf. alg. effi. measurement);", + nEta, + -0.5, + nEta - 0.5); - //hisWrongSignStubRZ_pBend_[tName] = inputDir.make(addn("WrongSignStubRZ_pBend"),"RZ of stubs with positive bend, but with wrong sign; z (cm); radius (cm); No. stubs in tracker",100,-280,280,100,0,130); - //hisWrongSignStubRZ_nBend_[tName] = inputDir.make(addn("WrongSignStubRZ_nBend"),"RZ of stubs with negative bend, but with wrong sign; z (cm); radius (cm); No. stubs in tracker",100,-280,280,100,0,130); + if (TMTT) { + // For those tracking particles causing the algorithmic efficiency to be below 100%, plot a flag indicating why. + hisRecoFailureReason_[tName] = inputDir.make( + addn("RecoFailureReason"), "; Reason TP (used for alg. effi.) not reconstructed;", 1, -0.5, 0.5); + //hisRecoFailureLayer_[tName] = inputDir.make(addn("RecoFailureLayer"),"; Layer ID of lost stubs on unreconstructed TP;",30,-0.5,29.5); + } - hisNumStubsOnLayer_[tName] = inputDir.make(addn("NumStubsOnLayer"),"; Layer occupancy;",16,1,17); + //hisWrongSignStubRZ_pBend_[tName] = inputDir.make(addn("WrongSignStubRZ_pBend"),"RZ of stubs with positive bend, but with wrong sign; z (cm); radius (cm); No. stubs in tracker",100,-280,280,100,0,130); + //hisWrongSignStubRZ_nBend_[tName] = inputDir.make(addn("WrongSignStubRZ_nBend"),"RZ of stubs with negative bend, but with wrong sign; z (cm); radius (cm); No. stubs in tracker",100,-280,280,100,0,130); - return inputDir; -} + hisNumStubsOnLayer_[tName] = inputDir.make(addn("NumStubsOnLayer"), "; Layer occupancy;", 16, 1, 17); -//=== Fill histograms studying track candidates found before track fit is run. + return inputDir; + } -void Histos::fillTrackCands(const InputData& inputData, const vector& tracks, string tName) { + //=== Fill histograms studying track candidates found before track fit is run. - bool withRZfilter = (tName == "RZ"); + void Histos::fillTrackCands(const InputData& inputData, const vector& tracks, string tName) { + bool withRZfilter = (tName == "RZ"); - bool TMTT = (tName == "HT" || tName == "RZ"); + bool TMTT = (tName == "HT" || tName == "RZ"); - // Now fill histograms for studying tracking in general. + // Now fill histograms for studying tracking in general. - const vector& vTPs = inputData.getTPs(); + const vector& vTPs = inputData.getTPs(); - // Debug histogram for LR track fitter. - for (const L1track3D& t : tracks) { - const std::vector< const Stub* > stubs = t.getStubs(); - std::map< unsigned int, unsigned int > layerMap; - for ( auto s : stubs ) - layerMap[ s->layerIdReduced() ]++; - for ( auto l : layerMap ) - hisNumStubsOnLayer_[tName]->Fill( l.second ); - } + // Debug histogram for LR track fitter. + for (const L1track3D& t : tracks) { + const std::vector stubs = t.getStubs(); + std::map layerMap; + for (auto s : stubs) + layerMap[s->layerIdReduced()]++; + for (auto l : layerMap) + hisNumStubsOnLayer_[tName]->Fill(l.second); + } - //=== Count track candidates found in the tracker. - - const unsigned int numPhiNonants = settings_->numPhiNonants();; - matrix nTrksPerSec(numPhiSectors_, numEtaRegions_, 0); - vector nTrksPerEtaReg(numEtaRegions_, 0); - vector nTrksPerNonant(numPhiNonants, 0); - for (const L1track3D& t : tracks) { - unsigned int iNonant = floor((t.iPhiSec())*numPhiNonants/(numPhiSectors_)); // phi nonant number - nTrksPerSec(t.iPhiSec(), t.iEtaReg())++; - nTrksPerEtaReg[t.iEtaReg()]++; - nTrksPerNonant[iNonant]++; - } + //=== Count track candidates found in the tracker. - profNumTrackCands_[tName]->Fill(1.0, tracks.size()); // Plot mean number of tracks/event. - if (TMTT) { - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - hisNumTrksPerSect_[tName]->Fill(nTrksPerSec(iPhiSec, iEtaReg)); + const unsigned int numPhiNonants = settings_->numPhiNonants(); + ; + matrix nTrksPerSec(numPhiSectors_, numEtaRegions_, 0); + vector nTrksPerEtaReg(numEtaRegions_, 0); + vector nTrksPerNonant(numPhiNonants, 0); + for (const L1track3D& t : tracks) { + unsigned int iNonant = floor((t.iPhiSec()) * numPhiNonants / (numPhiSectors_)); // phi nonant number + nTrksPerSec(t.iPhiSec(), t.iEtaReg())++; + nTrksPerEtaReg[t.iEtaReg()]++; + nTrksPerNonant[iNonant]++; + } + + profNumTrackCands_[tName]->Fill(1.0, tracks.size()); // Plot mean number of tracks/event. + if (TMTT) { + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + hisNumTrksPerSect_[tName]->Fill(nTrksPerSec(iPhiSec, iEtaReg)); + } + profNumTracksVsEta_[tName]->Fill(iEtaReg, nTrksPerEtaReg[iEtaReg]); } - profNumTracksVsEta_[tName]->Fill(iEtaReg, nTrksPerEtaReg[iEtaReg]); } - } - for (unsigned int iNonant = 0; iNonant < numPhiNonants; iNonant++) { - hisNumTrksPerNon_[tName]->Fill(nTrksPerNonant[iNonant]); - } - - //=== Count stubs per event assigned to track candidates in the Tracker - - unsigned int nStubsOnTracks = 0; - matrix nStubsOnTracksInSec(numPhiSectors_,numEtaRegions_,0); - vector nStubsOnTracksInEtaReg(numEtaRegions_, 0); - vector nStubsOnTracksInNonant(numPhiNonants, 0); - map< pair, set > uniqueStubsOnTracksInSect; - map< unsigned int, set > uniqueStubsOnTracksInNonant; - - matrix nStubsOnTrksInSec(numPhiSectors_, numEtaRegions_, 0); - for (const L1track3D& t : tracks) { - const vector& stubs = t.getStubs(); - unsigned int nStubs = stubs.size(); - unsigned int iNonant = floor((t.iPhiSec())*numPhiNonants/(numPhiSectors_)); // phi nonant number - // Count stubs on all tracks in this sector & nonant. - nStubsOnTracks+= nStubs; - nStubsOnTrksInSec(t.iPhiSec(), t.iEtaReg()) += nStubs; - nStubsOnTracksInEtaReg[t.iEtaReg()] += nStubs; - nStubsOnTracksInNonant[iNonant] += nStubs; - // Note unique stubs in sector & nonant. - uniqueStubsOnTracksInSect[pair(t.iPhiSec(), t.iEtaReg())].insert(stubs.begin(), stubs.end()); - uniqueStubsOnTracksInNonant[iNonant].insert(stubs.begin(), stubs.end()); - } + for (unsigned int iNonant = 0; iNonant < numPhiNonants; iNonant++) { + hisNumTrksPerNon_[tName]->Fill(nTrksPerNonant[iNonant]); + } - profStubsOnTracks_[tName]->Fill(1.0, nStubsOnTracks); - if (TMTT) { - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - hisStubsOnTracksPerSect_[tName]->Fill(nStubsOnTrksInSec(iPhiSec, iEtaReg)); - // Plot number of stubs assigned to tracks per sector, never counting each individual stub more than once. - hisUniqueStubsOnTrksPerSect_[tName]->Fill(uniqueStubsOnTracksInSect[pair(iPhiSec, iEtaReg)].size()); + //=== Count stubs per event assigned to track candidates in the Tracker + + unsigned int nStubsOnTracks = 0; + matrix nStubsOnTracksInSec(numPhiSectors_, numEtaRegions_, 0); + vector nStubsOnTracksInEtaReg(numEtaRegions_, 0); + vector nStubsOnTracksInNonant(numPhiNonants, 0); + map, set> uniqueStubsOnTracksInSect; + map> uniqueStubsOnTracksInNonant; + + matrix nStubsOnTrksInSec(numPhiSectors_, numEtaRegions_, 0); + for (const L1track3D& t : tracks) { + const vector& stubs = t.getStubs(); + unsigned int nStubs = stubs.size(); + unsigned int iNonant = floor((t.iPhiSec()) * numPhiNonants / (numPhiSectors_)); // phi nonant number + // Count stubs on all tracks in this sector & nonant. + nStubsOnTracks += nStubs; + nStubsOnTrksInSec(t.iPhiSec(), t.iEtaReg()) += nStubs; + nStubsOnTracksInEtaReg[t.iEtaReg()] += nStubs; + nStubsOnTracksInNonant[iNonant] += nStubs; + // Note unique stubs in sector & nonant. + uniqueStubsOnTracksInSect[pair(t.iPhiSec(), t.iEtaReg())].insert(stubs.begin(), + stubs.end()); + uniqueStubsOnTracksInNonant[iNonant].insert(stubs.begin(), stubs.end()); + } + + profStubsOnTracks_[tName]->Fill(1.0, nStubsOnTracks); + if (TMTT) { + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + hisStubsOnTracksPerSect_[tName]->Fill(nStubsOnTrksInSec(iPhiSec, iEtaReg)); + // Plot number of stubs assigned to tracks per sector, never counting each individual stub more than once. + hisUniqueStubsOnTrksPerSect_[tName]->Fill(uniqueStubsOnTracksInSect[pair(iPhiSec, iEtaReg)].size()); + } + profStubsOnTracksVsEta_[tName]->Fill(iEtaReg, nStubsOnTracksInEtaReg[iEtaReg]); } - profStubsOnTracksVsEta_[tName]->Fill(iEtaReg, nStubsOnTracksInEtaReg[iEtaReg]); } - } - for (unsigned int iNonant = 0; iNonant < numPhiNonants; iNonant++) { - hisStubsOnTracksPerNon_[tName]->Fill(nStubsOnTracksInNonant[iNonant]); - // Plot number of stubs assigned to tracks per nonant, never counting each individual stub more than once. - hisUniqueStubsOnTrksPerNon_[tName]->Fill(uniqueStubsOnTracksInNonant[iNonant].size()); - } - - // Plot number of tracks & number of stubs per output HT opto-link. - - if (TMTT && not withRZfilter) { - static bool firstMess = true; - const unsigned int numPhiSecPerNon = numPhiSectors_/numPhiNonants; - // Hard-wired bodge - const unsigned int nLinks = houghNbinsPt_/2; // Hard-wired to number of course HT bins. Check. - - for (unsigned int iPhiNon = 0; iPhiNon < numPhiNonants; iPhiNon++) { - // Each nonant has a separate set of links. - vector stubsToLinkCount(nLinks, 0); // Must use vectors to count links with zero entries. - vector trksToLinkCount(nLinks, 0); - for (const L1track3D& trk : tracks) { - unsigned int iNonantTrk = floor((trk.iPhiSec())*numPhiNonants/(numPhiSectors_)); // phi nonant number - if (iPhiNon == iNonantTrk) { - unsigned int link = trk.optoLinkID(); - if (link < nLinks) { - stubsToLinkCount[link] += trk.getNumStubs(); - trksToLinkCount[link] += 1; - } else if (firstMess) { - firstMess = false; - cout<Fill(nStubsOnTracksInNonant[iNonant]); + // Plot number of stubs assigned to tracks per nonant, never counting each individual stub more than once. + hisUniqueStubsOnTrksPerNon_[tName]->Fill(uniqueStubsOnTracksInNonant[iNonant].size()); + } + + // Plot number of tracks & number of stubs per output HT opto-link. + + if (TMTT && not withRZfilter) { + static bool firstMess = true; + const unsigned int numPhiSecPerNon = numPhiSectors_ / numPhiNonants; + // Hard-wired bodge + const unsigned int nLinks = houghNbinsPt_ / 2; // Hard-wired to number of course HT bins. Check. + + for (unsigned int iPhiNon = 0; iPhiNon < numPhiNonants; iPhiNon++) { + // Each nonant has a separate set of links. + vector stubsToLinkCount(nLinks, 0); // Must use vectors to count links with zero entries. + vector trksToLinkCount(nLinks, 0); + for (const L1track3D& trk : tracks) { + unsigned int iNonantTrk = floor((trk.iPhiSec()) * numPhiNonants / (numPhiSectors_)); // phi nonant number + if (iPhiNon == iNonantTrk) { + unsigned int link = trk.optoLinkID(); + if (link < nLinks) { + stubsToLinkCount[link] += trk.getNumStubs(); + trksToLinkCount[link] += 1; + } else if (firstMess) { + firstMess = false; + cout << endl << "===== HISTOS MESS UP: Increase size of nLinks ===== " << link << endl << endl; + } } } - } - for (unsigned int link = 0; link < nLinks; link++) { - unsigned int nstbs = stubsToLinkCount[link]; - hisNumStubsPerLink_[tName]->Fill(nstbs); - hisNumStubsVsLink_[tName]->Fill(link, nstbs); - profMeanStubsPerLink_[tName]->Fill(link, nstbs); + for (unsigned int link = 0; link < nLinks; link++) { + unsigned int nstbs = stubsToLinkCount[link]; + hisNumStubsPerLink_[tName]->Fill(nstbs); + hisNumStubsVsLink_[tName]->Fill(link, nstbs); + profMeanStubsPerLink_[tName]->Fill(link, nstbs); + } + + for (unsigned int link = 0; link < nLinks; link++) { + unsigned int ntrks = trksToLinkCount[link]; + hisNumTrksPerLink_[tName]->Fill(ntrks); + hisNumTrksVsLink_[tName]->Fill(link, ntrks); + profMeanTrksPerLink_[tName]->Fill(link, ntrks); + } } + } - for (unsigned int link = 0; link < nLinks; link++) { - unsigned int ntrks = trksToLinkCount[link]; - hisNumTrksPerLink_[tName]->Fill(ntrks); - hisNumTrksVsLink_[tName]->Fill(link, ntrks); - profMeanTrksPerLink_[tName]->Fill(link, ntrks); + // Plot q/pt spectrum of track candidates, and number of stubs/tracks + for (const L1track3D& trk : tracks) { + hisNumTracksVsQoverPt_[tName]->Fill(trk.qOverPt()); // Plot reconstructed q/Pt of track cands. + hisStubsPerTrack_[tName]->Fill(trk.getNumStubs()); // Stubs per track. + const TP* tp = trk.getMatchedTP(); + if (TMTT) { + // For genuine tracks, check how often they have too many stubs to be stored in cell memory. (Perhaps worse for high Pt particles in jets?). + if (tp != nullptr) { + if (tp->useForAlgEff()) + profExcessStubsPerTrackVsPt_[tName]->Fill(1. / tp->pt(), trk.getNumStubs() > 16); + } + } + hisLayersPerTrack_[tName]->Fill(trk.getNumLayers()); // Number of reduced layers with stubs per track. + hisPSLayersPerTrack_[tName]->Fill(Utility::countLayers( + settings_, trk.getStubs(), false, true)); // Number of reduced PS layers with stubs per track. + // Also plot just for genuine tracks. + if (tp != nullptr && tp->useForAlgEff()) { + hisLayersPerTrueTrack_[tName]->Fill(trk.getNumLayers()); // Number of reduced layers with stubs per track. + hisPSLayersPerTrueTrack_[tName]->Fill(Utility::countLayers( + settings_, trk.getStubs(), false, true)); // Number of reduced PS layers with stubs per track. } } - } + // Count fraction of stubs on each track matched to a TP that are from same TP. - // Plot q/pt spectrum of track candidates, and number of stubs/tracks - for (const L1track3D& trk : tracks) { - hisNumTracksVsQoverPt_[tName]->Fill(trk.qOverPt()); // Plot reconstructed q/Pt of track cands. - hisStubsPerTrack_[tName]->Fill(trk.getNumStubs()); // Stubs per track. - const TP* tp = trk.getMatchedTP(); - if (TMTT) { - // For genuine tracks, check how often they have too many stubs to be stored in cell memory. (Perhaps worse for high Pt particles in jets?). + for (const L1track3D& trk : tracks) { + // Only consider tracks that match a tracking particle used for the alg. efficiency measurement. + const TP* tp = trk.getMatchedTP(); if (tp != nullptr) { - if (tp->useForAlgEff()) profExcessStubsPerTrackVsPt_[tName]->Fill(1./tp->pt(), trk.getNumStubs() > 16); - } - } - hisLayersPerTrack_[tName]->Fill(trk.getNumLayers()); // Number of reduced layers with stubs per track. - hisPSLayersPerTrack_[tName]->Fill( Utility::countLayers(settings_, trk.getStubs(), false, true) ); // Number of reduced PS layers with stubs per track. - // Also plot just for genuine tracks. - if (tp != nullptr && tp->useForAlgEff()) { - hisLayersPerTrueTrack_[tName]->Fill(trk.getNumLayers()); // Number of reduced layers with stubs per track. - hisPSLayersPerTrueTrack_[tName]->Fill( Utility::countLayers(settings_, trk.getStubs(), false, true) ); // Number of reduced PS layers with stubs per track. - } - } - - // Count fraction of stubs on each track matched to a TP that are from same TP. - - for (const L1track3D& trk : tracks) { - // Only consider tracks that match a tracking particle used for the alg. efficiency measurement. - const TP* tp = trk.getMatchedTP(); - if (tp != nullptr) { - if (tp->useForAlgEff()) { - hisFracMatchStubsOnTracks_[tName]->Fill( trk.getPurity() ); - - const vector stubs = trk.getStubs(); - for (const Stub* s : stubs) { - // Was this stub produced by correct truth particle? - const set stubTPs = s->assocTPs(); - bool trueStub = (stubTPs.find(tp) != stubTPs.end()); - - // Fraction of wrong stubs vs. tracker layer. - profFracTrueStubsVsLayer_[tName]->Fill(s->layerId(), trueStub); - - // Check how much stub bend differs from predicted one, relative to nominal bend resolution. - float diffBend = (s->qOverPt() - trk.qOverPt()) / s->qOverPtOverBend(); - if (trueStub) { - hisDeltaBendTrue_[tName]->Fill(diffBend/s->bendRes()); - } else { - hisDeltaBendFake_[tName]->Fill(diffBend/s->bendRes()); - } - - // Debug printout to understand for matched tracks, how far stubs lie from true particle trajectory - // Only prints for tracks with huge number of stubs, to also understand why these tracks exist. - //if (trk.getNumStubs() > 20) { - /* + if (tp->useForAlgEff()) { + hisFracMatchStubsOnTracks_[tName]->Fill(trk.getPurity()); + + const vector stubs = trk.getStubs(); + for (const Stub* s : stubs) { + // Was this stub produced by correct truth particle? + const set stubTPs = s->assocTPs(); + bool trueStub = (stubTPs.find(tp) != stubTPs.end()); + + // Fraction of wrong stubs vs. tracker layer. + profFracTrueStubsVsLayer_[tName]->Fill(s->layerId(), trueStub); + + // Check how much stub bend differs from predicted one, relative to nominal bend resolution. + float diffBend = (s->qOverPt() - trk.qOverPt()) / s->qOverPtOverBend(); + if (trueStub) { + hisDeltaBendTrue_[tName]->Fill(diffBend / s->bendRes()); + } else { + hisDeltaBendFake_[tName]->Fill(diffBend / s->bendRes()); + } + + // Debug printout to understand for matched tracks, how far stubs lie from true particle trajectory + // Only prints for tracks with huge number of stubs, to also understand why these tracks exist. + //if (trk.getNumStubs() > 20) { + /* if (trk.pt() > 20) { cout<<"--- Checking how far stubs on matched tracks lie from true particle trajectory. ---"<pt()<<" "<d0()<& cout<<" module="<minR()<<" "<minPhi()<<" "<minZ()< matchedTrks; - for (const L1track3D& trk : tracks) { - const TP* tpAssoc = trk.getMatchedTP(); - if (tpAssoc != nullptr) { - if (tpAssoc->index() == tp.index()) matchedTrks.push_back(&trk); + for (const TP& tp : vTPs) { + vector matchedTrks; + for (const L1track3D& trk : tracks) { + const TP* tpAssoc = trk.getMatchedTP(); + if (tpAssoc != nullptr) { + if (tpAssoc->index() == tp.index()) + matchedTrks.push_back(&trk); + } } - } - unsigned int nTrk = matchedTrks.size(); - - bool tpRecoed = false; - - if (nTrk > 0) { - tpRecoed = true; // This TP was reconstructed at least once in tracker. - nTrksMatchingTPs += nTrk; // Increment sum by no. of tracks this TP was reconstructed as - - set iEtaRegRecoed; - for (const L1track3D* trk : matchedTrks) iEtaRegRecoed.insert(trk->iEtaReg()); - nEtaSecsMatchingTPs = iEtaRegRecoed.size(); - - set< pair > iSecRecoed; - for (const L1track3D* trk : matchedTrks) iSecRecoed.insert({trk->iPhiSec(), trk->iEtaReg()}); - nSecsMatchingTPs = iSecRecoed.size(); + unsigned int nTrk = matchedTrks.size(); + bool tpRecoed = false; - if (TMTT) { - for (const auto& p : iSecRecoed) { - unsigned int nTrkInSec = 0; - for (const L1track3D* trk : matchedTrks) { - if (trk->iPhiSec() == p.first && trk->iEtaReg() == p.second) nTrkInSec++; - } - if (nTrkInSec > 0) { - profDupTracksVsEta_[tName]->Fill(fabs(tp.eta()), nTrkInSec - 1); // Study duplication of tracks within an individual HT array. - profDupTracksVsInvPt_[tName]->Fill(fabs(tp.qOverPt()), nTrkInSec - 1); // Study duplication of tracks within an individual HT array. - } - } + if (nTrk > 0) { + tpRecoed = true; // This TP was reconstructed at least once in tracker. + nTrksMatchingTPs += nTrk; // Increment sum by no. of tracks this TP was reconstructed as + + set iEtaRegRecoed; + for (const L1track3D* trk : matchedTrks) + iEtaRegRecoed.insert(trk->iEtaReg()); + nEtaSecsMatchingTPs = iEtaRegRecoed.size(); + + set> iSecRecoed; + for (const L1track3D* trk : matchedTrks) + iSecRecoed.insert({trk->iPhiSec(), trk->iEtaReg()}); + nSecsMatchingTPs = iSecRecoed.size(); + + if (TMTT) { + for (const auto& p : iSecRecoed) { + unsigned int nTrkInSec = 0; + for (const L1track3D* trk : matchedTrks) { + if (trk->iPhiSec() == p.first && trk->iEtaReg() == p.second) + nTrkInSec++; + } + if (nTrkInSec > 0) { + profDupTracksVsEta_[tName]->Fill( + fabs(tp.eta()), nTrkInSec - 1); // Study duplication of tracks within an individual HT array. + profDupTracksVsInvPt_[tName]->Fill( + fabs(tp.qOverPt()), nTrkInSec - 1); // Study duplication of tracks within an individual HT array. + } + } + } } - } - if (tpRecoed) { - // Increment sum each time a TP is reconstructed at least once inside Tracker - if (tp.useForEff()) nRecoedTPsForEff++; - nRecoedTPs++; + if (tpRecoed) { + // Increment sum each time a TP is reconstructed at least once inside Tracker + if (tp.useForEff()) + nRecoedTPsForEff++; + nRecoedTPs++; + } } - } - - //--- Plot mean number of tracks/event, counting number due to different kinds of duplicates - - // Plot number of TPs used for the efficiency measurement that are reconstructed. - profNumTrackCands_[tName]->Fill(7.0, nRecoedTPsForEff); - // Plot number of TPs that are reconstructed. - profNumTrackCands_[tName]->Fill(6.0, nRecoedTPs); - // Plot number of TPs that are reconstructed. Count +1 for each eta sector they are reconstructed in. - profNumTrackCands_[tName]->Fill(5.0, nEtaSecsMatchingTPs); - // Plot number of TPs that are reconstructed. Count +1 for each (eta,phi) sector they are reconstructed in. - profNumTrackCands_[tName]->Fill(4.0, nSecsMatchingTPs); - // Plot number of TP that are reconstructed. Count +1 for each track they are reconstructed as. - profNumTrackCands_[tName]->Fill(2.0, nTrksMatchingTPs); - - // Histos of track helix params. - for (const L1track3D& trk : tracks) { - hisQoverPt_[tName]->Fill(trk.qOverPt()); - hisPhi0_[tName]->Fill(trk.phi0()); - hisEta_[tName]->Fill(trk.eta()); - hisZ0_[tName]->Fill(trk.z0()); - } - // Histos of track parameter resolution + //--- Plot mean number of tracks/event, counting number due to different kinds of duplicates - for (const TP& tp: vTPs) { + // Plot number of TPs used for the efficiency measurement that are reconstructed. + profNumTrackCands_[tName]->Fill(7.0, nRecoedTPsForEff); + // Plot number of TPs that are reconstructed. + profNumTrackCands_[tName]->Fill(6.0, nRecoedTPs); + // Plot number of TPs that are reconstructed. Count +1 for each eta sector they are reconstructed in. + profNumTrackCands_[tName]->Fill(5.0, nEtaSecsMatchingTPs); + // Plot number of TPs that are reconstructed. Count +1 for each (eta,phi) sector they are reconstructed in. + profNumTrackCands_[tName]->Fill(4.0, nSecsMatchingTPs); + // Plot number of TP that are reconstructed. Count +1 for each track they are reconstructed as. + profNumTrackCands_[tName]->Fill(2.0, nTrksMatchingTPs); - if ((resPlotOpt_ && tp.useForAlgEff()) || (not resPlotOpt_)) { // Check TP is good for efficiency measurement (& also comes from signal event if requested) + // Histos of track helix params. + for (const L1track3D& trk : tracks) { + hisQoverPt_[tName]->Fill(trk.qOverPt()); + hisPhi0_[tName]->Fill(trk.phi0()); + hisEta_[tName]->Fill(trk.eta()); + hisZ0_[tName]->Fill(trk.z0()); + } - // For each tracking particle, find the corresponding reconstructed track(s). - for (const L1track3D& trk : tracks) { - const TP* tpAssoc = trk.getMatchedTP(); - if (tpAssoc != nullptr) { - if (tpAssoc->index() == tp.index()) { - hisQoverPtRes_[tName]->Fill(trk.qOverPt() - tp.qOverPt()); - hisPhi0Res_[tName]->Fill(reco::deltaPhi(trk.phi0(), tp.phi0())); - hisEtaRes_[tName]->Fill(trk.eta() - tp.eta()); - hisZ0Res_[tName]->Fill(trk.z0() - tp.z0()); - - hisRecoVsTrueQinvPt_[tName]->Fill( tp.qOverPt(), trk.qOverPt() ); - hisRecoVsTruePhi0_[tName]->Fill( tp.phi0(), trk.phi0( )); - hisRecoVsTrueD0_[tName]->Fill( tp.d0(), trk.d0() ); - hisRecoVsTrueZ0_[tName]->Fill( tp.z0(), trk.z0() ); - hisRecoVsTrueEta_[tName]->Fill( tp.eta(), trk.eta() ); - } - } + // Histos of track parameter resolution + + for (const TP& tp : vTPs) { + if ((resPlotOpt_ && tp.useForAlgEff()) || + (not resPlotOpt_)) { // Check TP is good for efficiency measurement (& also comes from signal event if requested) + + // For each tracking particle, find the corresponding reconstructed track(s). + for (const L1track3D& trk : tracks) { + const TP* tpAssoc = trk.getMatchedTP(); + if (tpAssoc != nullptr) { + if (tpAssoc->index() == tp.index()) { + hisQoverPtRes_[tName]->Fill(trk.qOverPt() - tp.qOverPt()); + hisPhi0Res_[tName]->Fill(reco::deltaPhi(trk.phi0(), tp.phi0())); + hisEtaRes_[tName]->Fill(trk.eta() - tp.eta()); + hisZ0Res_[tName]->Fill(trk.z0() - tp.z0()); + + hisRecoVsTrueQinvPt_[tName]->Fill(tp.qOverPt(), trk.qOverPt()); + hisRecoVsTruePhi0_[tName]->Fill(tp.phi0(), trk.phi0()); + hisRecoVsTrueD0_[tName]->Fill(tp.d0(), trk.d0()); + hisRecoVsTrueZ0_[tName]->Fill(tp.z0(), trk.z0()); + hisRecoVsTrueEta_[tName]->Fill(tp.eta(), trk.eta()); + } + } + } } } - } - //=== Study tracking efficiency by looping over tracking particles. - - for (const TP& tp: vTPs) { + //=== Study tracking efficiency by looping over tracking particles. - if (tp.useForEff()) { // Check TP is good for efficiency measurement. + for (const TP& tp : vTPs) { + if (tp.useForEff()) { // Check TP is good for efficiency measurement. - // Check which eta and phi sectors this TP is in. - int iPhiSec_TP = -1; - int iEtaReg_TP = -1; - Sector sectorTmp; - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - sectorTmp.init(settings_, iPhiSec, 0); - if (sectorTmp.insidePhiSec(tp)) iPhiSec_TP = iPhiSec; - } - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - sectorTmp.init(settings_, 0, iEtaReg); - if (sectorTmp.insideEtaReg(tp)) iEtaReg_TP = iEtaReg; - } + // Check which eta and phi sectors this TP is in. + int iPhiSec_TP = -1; + int iEtaReg_TP = -1; + Sector sectorTmp; + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + sectorTmp.init(settings_, iPhiSec, 0); + if (sectorTmp.insidePhiSec(tp)) + iPhiSec_TP = iPhiSec; + } + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + sectorTmp.init(settings_, 0, iEtaReg); + if (sectorTmp.insideEtaReg(tp)) + iEtaReg_TP = iEtaReg; + } - // Check if this TP was reconstructed anywhere in the tracker.. - bool tpRecoed = false; - bool tpRecoedPerfect = false; - for (const L1track3D& trk : tracks) { - const TP* tpAssoc = trk.getMatchedTP(); - if (tpAssoc != nullptr) { - if (tpAssoc->index() == tp.index()) { - tpRecoed = true; - if (trk.getPurity() == 1.) tpRecoedPerfect = true; - } - } - } + // Check if this TP was reconstructed anywhere in the tracker.. + bool tpRecoed = false; + bool tpRecoedPerfect = false; + for (const L1track3D& trk : tracks) { + const TP* tpAssoc = trk.getMatchedTP(); + if (tpAssoc != nullptr) { + if (tpAssoc->index() == tp.index()) { + tpRecoed = true; + if (trk.getPurity() == 1.) + tpRecoedPerfect = true; + } + } + } - // If TP was reconstucted by HT, then plot its kinematics. - if (tpRecoed) { - hisRecoTPinvptForEff_[tName]->Fill(1./tp.pt()); - hisRecoTPptForEff_[tName]->Fill(tp.pt()); - hisRecoTPetaForEff_[tName]->Fill(tp.eta()); - hisRecoTPphiForEff_[tName]->Fill(tp.phi0()); - // Plot also production point of all good reconstructed TP. - hisRecoTPd0ForEff_[tName]->Fill(fabs(tp.d0())); - hisRecoTPz0ForEff_[tName]->Fill(fabs(tp.z0())); - // Also plot efficiency to perfectly reconstruct the track (no fake hits) - if (tpRecoedPerfect) { - hisPerfRecoTPinvptForEff_[tName]->Fill(1./tp.pt()); - hisPerfRecoTPptForEff_[tName]->Fill(tp.pt()); - hisPerfRecoTPetaForEff_[tName]->Fill(tp.eta()); - } - if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. - hisRecoTPinvptForAlgEff_[tName]->Fill(1./tp.pt()); - hisRecoTPptForAlgEff_[tName]->Fill(tp.pt()); - hisRecoTPetaForAlgEff_[tName]->Fill(tp.eta()); - hisRecoTPphiForAlgEff_[tName]->Fill(tp.phi0()); - // Plot also production point of all good reconstructed TP. - hisRecoTPd0ForAlgEff_[tName]->Fill(fabs(tp.d0())); - hisRecoTPz0ForAlgEff_[tName]->Fill(fabs(tp.z0())); - // Plot sector number to understand if looser cuts are needed in certain eta regions. - hisRecoTPphisecForAlgEff_[tName]->Fill(iPhiSec_TP); - hisRecoTPetasecForAlgEff_[tName]->Fill(iEtaReg_TP); - - // Plot efficiency in jets - if ( tp.tpInJet() ) { - hisRecoTPinvptForAlgEff_inJetPtG30_[tName]->Fill(1./tp.pt()); - } - if ( tp.tpInHighPtJet() ) { - hisRecoTPinvptForAlgEff_inJetPtG100_[tName]->Fill(1./tp.pt()); - } - if ( tp.tpInVeryHighPtJet() ) { - hisRecoTPinvptForAlgEff_inJetPtG200_[tName]->Fill(1./tp.pt()); - } - - // Also plot efficiency to perfectly reconstruct the track (no fake hits) - if (tpRecoedPerfect) { - hisPerfRecoTPinvptForAlgEff_[tName]->Fill(1./tp.pt()); - hisPerfRecoTPptForAlgEff_[tName]->Fill(tp.pt()); - hisPerfRecoTPetaForAlgEff_[tName]->Fill(tp.eta()); - hisPerfRecoTPphisecForAlgEff_[tName]->Fill(iPhiSec_TP); - hisPerfRecoTPetasecForAlgEff_[tName]->Fill(iEtaReg_TP); - } - } + // If TP was reconstucted by HT, then plot its kinematics. + if (tpRecoed) { + hisRecoTPinvptForEff_[tName]->Fill(1. / tp.pt()); + hisRecoTPptForEff_[tName]->Fill(tp.pt()); + hisRecoTPetaForEff_[tName]->Fill(tp.eta()); + hisRecoTPphiForEff_[tName]->Fill(tp.phi0()); + // Plot also production point of all good reconstructed TP. + hisRecoTPd0ForEff_[tName]->Fill(fabs(tp.d0())); + hisRecoTPz0ForEff_[tName]->Fill(fabs(tp.z0())); + // Also plot efficiency to perfectly reconstruct the track (no fake hits) + if (tpRecoedPerfect) { + hisPerfRecoTPinvptForEff_[tName]->Fill(1. / tp.pt()); + hisPerfRecoTPptForEff_[tName]->Fill(tp.pt()); + hisPerfRecoTPetaForEff_[tName]->Fill(tp.eta()); + } + if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. + hisRecoTPinvptForAlgEff_[tName]->Fill(1. / tp.pt()); + hisRecoTPptForAlgEff_[tName]->Fill(tp.pt()); + hisRecoTPetaForAlgEff_[tName]->Fill(tp.eta()); + hisRecoTPphiForAlgEff_[tName]->Fill(tp.phi0()); + // Plot also production point of all good reconstructed TP. + hisRecoTPd0ForAlgEff_[tName]->Fill(fabs(tp.d0())); + hisRecoTPz0ForAlgEff_[tName]->Fill(fabs(tp.z0())); + // Plot sector number to understand if looser cuts are needed in certain eta regions. + hisRecoTPphisecForAlgEff_[tName]->Fill(iPhiSec_TP); + hisRecoTPetasecForAlgEff_[tName]->Fill(iEtaReg_TP); + + // Plot efficiency in jets + if (tp.tpInJet()) { + hisRecoTPinvptForAlgEff_inJetPtG30_[tName]->Fill(1. / tp.pt()); + } + if (tp.tpInHighPtJet()) { + hisRecoTPinvptForAlgEff_inJetPtG100_[tName]->Fill(1. / tp.pt()); + } + if (tp.tpInVeryHighPtJet()) { + hisRecoTPinvptForAlgEff_inJetPtG200_[tName]->Fill(1. / tp.pt()); + } + + // Also plot efficiency to perfectly reconstruct the track (no fake hits) + if (tpRecoedPerfect) { + hisPerfRecoTPinvptForAlgEff_[tName]->Fill(1. / tp.pt()); + hisPerfRecoTPptForAlgEff_[tName]->Fill(tp.pt()); + hisPerfRecoTPetaForAlgEff_[tName]->Fill(tp.eta()); + hisPerfRecoTPphisecForAlgEff_[tName]->Fill(iPhiSec_TP); + hisPerfRecoTPetasecForAlgEff_[tName]->Fill(iEtaReg_TP); + } + } + } } } - } - if (TMTT) { - // Diagnose reason why not all viable tracking particles were reconstructed. - const map diagnosis = this->diagnoseTracking(inputData.getTPs(), tracks, withRZfilter); - for (const auto& iter: diagnosis) { - hisRecoFailureReason_[tName]->Fill(iter.second.c_str(), 1.); // Stores flag indicating failure reason. + if (TMTT) { + // Diagnose reason why not all viable tracking particles were reconstructed. + const map diagnosis = this->diagnoseTracking(inputData.getTPs(), tracks, withRZfilter); + for (const auto& iter : diagnosis) { + hisRecoFailureReason_[tName]->Fill(iter.second.c_str(), 1.); // Stores flag indicating failure reason. + } } } -} - -//=== Understand why not all tracking particles were reconstructed. -//=== Returns list of tracking particles that were not reconstructed and an string indicating why. -//=== Only considers TP used for algorithmic efficiency measurement. - -// (If string = "mystery", reason for loss unknown. This may be a result of reconstruction of one -// track candidate preventing reconstruction of another. e.g. Due to duplicate track removal). -map Histos::diagnoseTracking(const vector& allTPs, const vector& tracks, - bool withRZfilter) const -{ - map diagnosis; + //=== Understand why not all tracking particles were reconstructed. + //=== Returns list of tracking particles that were not reconstructed and an string indicating why. + //=== Only considers TP used for algorithmic efficiency measurement. - for (const TP& tp: allTPs) { + // (If string = "mystery", reason for loss unknown. This may be a result of reconstruction of one + // track candidate preventing reconstruction of another. e.g. Due to duplicate track removal). - string recoFlag = "unknown"; + map Histos::diagnoseTracking(const vector& allTPs, + const vector& tracks, + bool withRZfilter) const { + map diagnosis; - if ( tp.useForAlgEff()) { //--- Only consider TP that are reconstructable. - - //--- Check if this TP was reconstructed anywhere in the tracker.. - bool tpRecoed = false; - for (const L1track3D& trk : tracks) { - const TP* tpAssoc = trk.getMatchedTP(); - if (tpAssoc != nullptr) { - if (tpAssoc->index() == tp.index()) tpRecoed = true; - } - } + for (const TP& tp : allTPs) { + string recoFlag = "unknown"; - if ( tpRecoed) { - - recoFlag = "success"; // successfully reconstructed so don't bother studying. + if (tp.useForAlgEff()) { //--- Only consider TP that are reconstructable. - } else { - - //--- Check if TP was still reconstructable after cuts applied to stubs by front-end electronics. - vector fePassStubs; - for (const Stub* s : tp.assocStubs()) { - if (s->frontendPass()) fePassStubs.push_back(s); + //--- Check if this TP was reconstructed anywhere in the tracker.. + bool tpRecoed = false; + for (const L1track3D& trk : tracks) { + const TP* tpAssoc = trk.getMatchedTP(); + if (tpAssoc != nullptr) { + if (tpAssoc->index() == tp.index()) + tpRecoed = true; + } } - bool fePass = ( Utility::countLayers(settings_, fePassStubs) >= genMinStubLayers_ ); - - if ( ! fePass) { - - recoFlag = "FE electronics"; // Tracking failed because of front-end electronics cuts. - - } else { - - //--- Check if assignment to (eta,phi) sectors prevented this TP being reconstruted. - bool insideSecPass = false; - bool insidePhiSecPass = false; - bool insideEtaRegPass = false; - unsigned int nLayers = 0; - // The next to variables are vectors in case track could be recontructed in more than one sector. - vector< vector > insideSecStubs; - vector sectorBest; - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - - Sector sectorTmp; - sectorTmp.init(settings_, iPhiSec, iEtaReg); - - // Get stubs on given tracking particle which are inside this (phi,eta) sector; - vector insideSecStubsTmp; - vector insidePhiSecStubsTmp; - vector insideEtaRegStubsTmp; - for (const Stub* s: fePassStubs) { - if (sectorTmp.inside(s)) insideSecStubsTmp.push_back(s); - if (sectorTmp.insidePhi(s)) insidePhiSecStubsTmp.push_back(s); - if (sectorTmp.insideEta(s)) insideEtaRegStubsTmp.push_back(s); - } - // Check if TP could be reconstructed in this (phi,eta) sector. - unsigned int nLayersTmp = Utility::countLayers(settings_, insideSecStubsTmp); - if ( nLayersTmp >= genMinStubLayers_ ) { - insideSecPass = true; - if (nLayers <= nLayersTmp) { - if (nLayers < nLayersTmp) { - nLayers = nLayersTmp; - insideSecStubs.clear(); - sectorBest.clear(); - } - insideSecStubs.push_back( insideSecStubsTmp ); - sectorBest.push_back( sectorTmp ); - } - } - // Check if TP could be reconstructed in this (phi) sector. - unsigned int nLayersPhiTmp = Utility::countLayers(settings_, insidePhiSecStubsTmp); - if ( nLayersPhiTmp >= genMinStubLayers_ ) insidePhiSecPass = true; - // Check if TP could be reconstructed in this (eta) region. - unsigned int nLayersEtaTmp = Utility::countLayers(settings_, insideEtaRegStubsTmp); - if ( nLayersEtaTmp >= genMinStubLayers_ ) insideEtaRegPass = true; - } - } - - if ( ! insideSecPass) { - - // Tracking failed because of stub to sector assignment. - if ( ! insideEtaRegPass) { - recoFlag = "#eta sector"; // failed because of stub assignment to eta region. - } else if ( ! insidePhiSecPass) { - recoFlag = "#phi sector"; // failed because of stub assignment to phi sector. - } else { - recoFlag = "sector"; // failed because of stub assignment to (eta,phi) sector. - } - - } else { - - //--- Check if TP was reconstructed by r-phi Hough transform with its bend filted turned off. - - // Consider all sectors in which the track might be reconstructed. - bool rphiHTunfilteredPass = false; - for (unsigned int iSec = 0; iSec < sectorBest.size(); iSec++) { - const Sector& secBest = sectorBest[iSec]; - HTrphi htRphiUnfiltered; - htRphiUnfiltered.init(settings_, secBest.iPhiSec(), secBest.iEtaReg(), - secBest.etaMin(), secBest.etaMax(), secBest.phiCentre()); - htRphiUnfiltered.disableBendFilter(); // Switch off bend filter - for (const Stub* s: insideSecStubs[iSec]) { - // Check which eta subsectors within the sector the stub is compatible with (if subsectors being used). - const vector inEtaSubSecs = secBest.insideEtaSubSecs( s ); - htRphiUnfiltered.store(s, inEtaSubSecs); - } - htRphiUnfiltered.end(); - // Check if r-phi HT with its filters switched off found the track - if (htRphiUnfiltered.numTrackCands2D() > 0) rphiHTunfilteredPass = true; - } - - if ( ! rphiHTunfilteredPass ) { - recoFlag = "r-#phi HT UNfiltered"; // Tracking failed r-phi HT even with its bend filter turned off. + if (tpRecoed) { + recoFlag = "success"; // successfully reconstructed so don't bother studying. - } else { - - //--- Check if TP was reconstructed by filtered r-phi HT. - - // Consider all sectors in which the track might be reconstructed. - bool rphiHTpass = false; - bool rzFilterPass = false; - for (unsigned int iSec = 0; iSec < sectorBest.size(); iSec++) { - const Sector& secBest = sectorBest[iSec]; - HTrphi htRphiTmp; - htRphiTmp.init(settings_, secBest.iPhiSec(), secBest.iEtaReg(), - secBest.etaMin(), secBest.etaMax(), secBest.phiCentre()); - for (const Stub* s: insideSecStubs[iSec]) { - // Check which eta subsectors within the sector the stub is compatible with (if subsectors being used). - const vector inEtaSubSecs = secBest.insideEtaSubSecs( s ); - htRphiTmp.store(s, inEtaSubSecs); - } - htRphiTmp.end(); - - // Check if r-phi HT found the track - if (htRphiTmp.numTrackCands2D() > 0) rphiHTpass = true; - // Check if track r-z filters run after r-phi HT kept track. - if (rphiHTpass) { - // Do so by getting tracks found by r-phi HT and running them through r-z filter. - const vector& trksRphi = htRphiTmp.trackCands2D(); - - // Initialize utility for making 3D tracks from 2S ones. - Get3Dtracks get3DtrkTmp; - get3DtrkTmp.init(settings_, secBest.iPhiSec(), secBest.iEtaReg(), - secBest.etaMin(), secBest.etaMax(), secBest.phiCentre()); - // Convert 2D tracks found by HT to 3D tracks (optionally by running r-z filters & duplicate track removal) - get3DtrkTmp.run(trksRphi); - if (get3DtrkTmp.trackCands3D(withRZfilter).size() > 0) rzFilterPass = true; - } - } - - if ( ! rphiHTpass) { - - recoFlag = "r-#phi HT BENDfiltered"; // Tracking failed r-phi HT with its bend filter on. - - //--- Debug printout to understand stubs failing bend filter. - - - // cout<<"TRACK FAILING BEND FILTER: pt="<bend(); - // float bendRes = s->bendRes(); - // float theory = tp.qOverPt()/s->qOverPtOverBend(); - // cout<<" BEND: measured="<z() << " " << s->layerId()<<" PS="<psModule()<<" Barrel="<barrel() << endl; - - // if (fabs(bend - theory) > bendRes) { - // bool cluster0_OK = false; - // if (s->genuineCluster()[0]) cluster0_OK = (s->assocTPofCluster()[0]->index() == tp.index()); - // bool cluster1_OK = false; - // if (s->genuineCluster()[1]) cluster1_OK = (s->assocTPofCluster()[1]->index() == tp.index()); - // cout<< " STUB FAILED: layer="<layerId()<<" PS="<psModule()<<" clusters match="<bend() << " " << s->stripPitch() << " " << s->stripPitch() / s->pitchOverSep() << " " << s->dphiOverBend() << " " << s->dphi() << std::endl; - // cout << "Min R, Z : " << s->minR() << " " << s->minZ() << std::endl; - - // if ( fabs( bend * -1.0 - theory ) > bendRes ) { - // okIfBendMinus1 = false; - // } - // else { - // if ( bend > 0 ) hisWrongSignStubRZ_pBend_->Fill( s->z(), s->r() ); - // else if ( bend < 0 ) hisWrongSignStubRZ_nBend_->Fill( s->z(), s->r() ); - // } - // } - // } - // } - - // if ( okIfBendMinus1 ) { - // recoFlag = "BEND WRONG SIGN"; // Tracking failed r-phi HT with its bend filter on, but would have passed if bend of stubs had opposite sign. - // } - - - } else { - - - if ( ! rzFilterPass) { - - recoFlag = "r-z filter"; // Tracking failed r-z filter. - - } else { - - recoFlag = "mystery"; // Mystery: logically this tracking particle should have been reconstructed. This may be a result of a duplicate track removal algorithm (or something else where finding one track candidate prevents another being found). - } - } - } - } - } - diagnosis[&tp] = recoFlag; + } else { + //--- Check if TP was still reconstructable after cuts applied to stubs by front-end electronics. + vector fePassStubs; + for (const Stub* s : tp.assocStubs()) { + if (s->frontendPass()) + fePassStubs.push_back(s); + } + bool fePass = (Utility::countLayers(settings_, fePassStubs) >= genMinStubLayers_); + + if (!fePass) { + recoFlag = "FE electronics"; // Tracking failed because of front-end electronics cuts. + + } else { + //--- Check if assignment to (eta,phi) sectors prevented this TP being reconstruted. + bool insideSecPass = false; + bool insidePhiSecPass = false; + bool insideEtaRegPass = false; + unsigned int nLayers = 0; + // The next to variables are vectors in case track could be recontructed in more than one sector. + vector> insideSecStubs; + vector sectorBest; + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + Sector sectorTmp; + sectorTmp.init(settings_, iPhiSec, iEtaReg); + + // Get stubs on given tracking particle which are inside this (phi,eta) sector; + vector insideSecStubsTmp; + vector insidePhiSecStubsTmp; + vector insideEtaRegStubsTmp; + for (const Stub* s : fePassStubs) { + if (sectorTmp.inside(s)) + insideSecStubsTmp.push_back(s); + if (sectorTmp.insidePhi(s)) + insidePhiSecStubsTmp.push_back(s); + if (sectorTmp.insideEta(s)) + insideEtaRegStubsTmp.push_back(s); + } + // Check if TP could be reconstructed in this (phi,eta) sector. + unsigned int nLayersTmp = Utility::countLayers(settings_, insideSecStubsTmp); + if (nLayersTmp >= genMinStubLayers_) { + insideSecPass = true; + if (nLayers <= nLayersTmp) { + if (nLayers < nLayersTmp) { + nLayers = nLayersTmp; + insideSecStubs.clear(); + sectorBest.clear(); + } + insideSecStubs.push_back(insideSecStubsTmp); + sectorBest.push_back(sectorTmp); + } + } + // Check if TP could be reconstructed in this (phi) sector. + unsigned int nLayersPhiTmp = Utility::countLayers(settings_, insidePhiSecStubsTmp); + if (nLayersPhiTmp >= genMinStubLayers_) + insidePhiSecPass = true; + // Check if TP could be reconstructed in this (eta) region. + unsigned int nLayersEtaTmp = Utility::countLayers(settings_, insideEtaRegStubsTmp); + if (nLayersEtaTmp >= genMinStubLayers_) + insideEtaRegPass = true; + } + } + + if (!insideSecPass) { + // Tracking failed because of stub to sector assignment. + if (!insideEtaRegPass) { + recoFlag = "#eta sector"; // failed because of stub assignment to eta region. + } else if (!insidePhiSecPass) { + recoFlag = "#phi sector"; // failed because of stub assignment to phi sector. + } else { + recoFlag = "sector"; // failed because of stub assignment to (eta,phi) sector. + } + + } else { + //--- Check if TP was reconstructed by r-phi Hough transform with its bend filted turned off. + + // Consider all sectors in which the track might be reconstructed. + bool rphiHTunfilteredPass = false; + for (unsigned int iSec = 0; iSec < sectorBest.size(); iSec++) { + const Sector& secBest = sectorBest[iSec]; + HTrphi htRphiUnfiltered; + htRphiUnfiltered.init(settings_, + secBest.iPhiSec(), + secBest.iEtaReg(), + secBest.etaMin(), + secBest.etaMax(), + secBest.phiCentre()); + htRphiUnfiltered.disableBendFilter(); // Switch off bend filter + for (const Stub* s : insideSecStubs[iSec]) { + // Check which eta subsectors within the sector the stub is compatible with (if subsectors being used). + const vector inEtaSubSecs = secBest.insideEtaSubSecs(s); + htRphiUnfiltered.store(s, inEtaSubSecs); + } + htRphiUnfiltered.end(); + // Check if r-phi HT with its filters switched off found the track + if (htRphiUnfiltered.numTrackCands2D() > 0) + rphiHTunfilteredPass = true; + } + + if (!rphiHTunfilteredPass) { + recoFlag = "r-#phi HT UNfiltered"; // Tracking failed r-phi HT even with its bend filter turned off. + + } else { + //--- Check if TP was reconstructed by filtered r-phi HT. + + // Consider all sectors in which the track might be reconstructed. + bool rphiHTpass = false; + bool rzFilterPass = false; + for (unsigned int iSec = 0; iSec < sectorBest.size(); iSec++) { + const Sector& secBest = sectorBest[iSec]; + HTrphi htRphiTmp; + htRphiTmp.init(settings_, + secBest.iPhiSec(), + secBest.iEtaReg(), + secBest.etaMin(), + secBest.etaMax(), + secBest.phiCentre()); + for (const Stub* s : insideSecStubs[iSec]) { + // Check which eta subsectors within the sector the stub is compatible with (if subsectors being used). + const vector inEtaSubSecs = secBest.insideEtaSubSecs(s); + htRphiTmp.store(s, inEtaSubSecs); + } + htRphiTmp.end(); + + // Check if r-phi HT found the track + if (htRphiTmp.numTrackCands2D() > 0) + rphiHTpass = true; + // Check if track r-z filters run after r-phi HT kept track. + if (rphiHTpass) { + // Do so by getting tracks found by r-phi HT and running them through r-z filter. + const vector& trksRphi = htRphiTmp.trackCands2D(); + + // Initialize utility for making 3D tracks from 2S ones. + Get3Dtracks get3DtrkTmp; + get3DtrkTmp.init(settings_, + secBest.iPhiSec(), + secBest.iEtaReg(), + secBest.etaMin(), + secBest.etaMax(), + secBest.phiCentre()); + // Convert 2D tracks found by HT to 3D tracks (optionally by running r-z filters & duplicate track removal) + get3DtrkTmp.run(trksRphi); + if (get3DtrkTmp.trackCands3D(withRZfilter).size() > 0) + rzFilterPass = true; + } + } + + if (!rphiHTpass) { + recoFlag = "r-#phi HT BENDfiltered"; // Tracking failed r-phi HT with its bend filter on. + + //--- Debug printout to understand stubs failing bend filter. + + // cout<<"TRACK FAILING BEND FILTER: pt="<bend(); + // float bendRes = s->bendRes(); + // float theory = tp.qOverPt()/s->qOverPtOverBend(); + // cout<<" BEND: measured="<z() << " " << s->layerId()<<" PS="<psModule()<<" Barrel="<barrel() << endl; + + // if (fabs(bend - theory) > bendRes) { + // bool cluster0_OK = false; + // if (s->genuineCluster()[0]) cluster0_OK = (s->assocTPofCluster()[0]->index() == tp.index()); + // bool cluster1_OK = false; + // if (s->genuineCluster()[1]) cluster1_OK = (s->assocTPofCluster()[1]->index() == tp.index()); + // cout<< " STUB FAILED: layer="<layerId()<<" PS="<psModule()<<" clusters match="<bend() << " " << s->stripPitch() << " " << s->stripPitch() / s->pitchOverSep() << " " << s->dphiOverBend() << " " << s->dphi() << std::endl; + // cout << "Min R, Z : " << s->minR() << " " << s->minZ() << std::endl; + + // if ( fabs( bend * -1.0 - theory ) > bendRes ) { + // okIfBendMinus1 = false; + // } + // else { + // if ( bend > 0 ) hisWrongSignStubRZ_pBend_->Fill( s->z(), s->r() ); + // else if ( bend < 0 ) hisWrongSignStubRZ_nBend_->Fill( s->z(), s->r() ); + // } + // } + // } + // } + + // if ( okIfBendMinus1 ) { + // recoFlag = "BEND WRONG SIGN"; // Tracking failed r-phi HT with its bend filter on, but would have passed if bend of stubs had opposite sign. + // } + + } else { + if (!rzFilterPass) { + recoFlag = "r-z filter"; // Tracking failed r-z filter. + + } else { + recoFlag = + "mystery"; // Mystery: logically this tracking particle should have been reconstructed. This may be a result of a duplicate track removal algorithm (or something else where finding one track candidate prevents another being found). + } + } + } + } + } + diagnosis[&tp] = recoFlag; + } } } + return diagnosis; } - return diagnosis; -} - -//=== Book histograms studying freak, large events with too many stubs. - -TFileDirectory Histos::bookStudyBusyEvents() { - - TFileDirectory inputDir = fs_->mkdir("BusyEvents"); - - // Look at (eta, phi) sectors with too many input stubs or too many output (= assigned to tracks) stubs. - - unsigned int nEta = numEtaRegions_; - - hisNumBusySecsInPerEvent_ = inputDir.make("NumBusySecsInPerEvent" ,"; No. sectors with too many input stubs/event" , 20, -0.5, 19.5); - hisNumBusySecsOutPerEvent_ = inputDir.make("NumBusySecsOutPerEvent","; No. sectors with too many output stubs/event", 20, -0.5, 19.5); - profFracBusyInVsEtaReg_ = inputDir.make("FracBusyInVsEtaReg" ,"; #eta region; Frac. of sectors with too many input stubs" , nEta, -0.5, nEta-0.5); - profFracBusyOutVsEtaReg_ = inputDir.make("FracBusyOutVsEtaReg","; #eta region; Frac. of sectors with too many output stubs", nEta, -0.5, nEta-0.5); - profFracStubsKilledVsEtaReg_ = inputDir.make("FracStubsKilledInVsEtaReg" ,"; #eta region; Frac. of input stubs killed" , nEta, -0.5, nEta-0.5); - profFracTracksKilledVsEtaReg_ = inputDir.make("FracTracksKilledInVsEtaReg" ,"; #eta region; Frac. of track killed" , nEta, -0.5, nEta-0.5); - profFracTracksKilledVsInvPt_ = inputDir.make("FracTracksKilledInVsInvPt" ,";1/Pt; Frac. of track killed" , 16, 0., 1./houghMinPt_); - profFracTPKilledVsEta_ = inputDir.make("FracTPKilledInVsEta" ,";#eta; Efficiency loss due to busy sectors" , 16, 0., settings_->maxStubEta()); - profFracTPKilledVsInvPt_ = inputDir.make("FracTPKilledInVsInvPt" ,";1/Pt; Efficiency loss due to busy sectors" , 16, 0., 1./houghMinPt_); - hisNumTPkilledBusySec_ = inputDir.make("NumTPkilledBusySec","; No. of TP killed in each busy sector",30,-0.5,29.5); - - // Compare properties of sectors with/without too many output stubs. - - const vector tnames = {"BusyOutSec", "QuietOutSec"}; - const vector enames = {" in busy output sector", " in quiet output sector"}; - for (unsigned int i = 0; i <= 1; i++) { - const string tn = tnames[i]; - const string en = enames[i]; - - hisNumInputStubs_[tn] = inputDir.make(("NumInputStubs"+(tn)).c_str(), ("; No. input stubs"+(en)).c_str(), 250, -0.5, 249.5); - hisQoverPtInputStubs_[tn] = inputDir.make(("QoverPtInputStubs"+(tn)).c_str(), ("; q/Pt of input stubs"+(en)).c_str(), 30, 0., 1./houghMinPt_); - hisNumOutputStubs_[tn] = inputDir.make(("NumOutputStubs"+(tn)).c_str(), ("; No. output stubs"+(en)).c_str(), 1000, -0.5, 999.5); - hisNumTracks_[tn] = inputDir.make(("NumTracks"+(tn)).c_str(), ("; No. tracks"+(en)).c_str(), 200, -0.5, 199.5); - hisNumStubsPerTrack_[tn] = inputDir.make(("NumStubsPerTrack"+(tn)).c_str(), ("; No. stubs/track"+(en)).c_str(), 50, -0.5, 49.5); - hisTrackQoverPt_[tn] = inputDir.make(("TrackQoverPt"+(tn)).c_str(), ("; Track q/pt"+(en)).c_str(), 30, 0., 1./houghMinPt_); - hisTrackPurity_[tn] = inputDir.make(("TrackPurity"+(tn)).c_str(), ("; Track purity"+(en)).c_str(), 102, -0.01, 1.01); - hisNumTPphysics_[tn] = inputDir.make(("NumTPphysics"+(tn)).c_str(), ("; No. physics TP"+(en)).c_str(), 30, -0.5, 29.5); - hisNumTPpileup_[tn] = inputDir.make(("NumTPpileup"+(tn)).c_str(), ("; No. pileup TP"+(en)).c_str(), 30, -0.5, 29.5); - hisSumPtTPphysics_[tn] = inputDir.make(("SumPtTPphysics"+(tn)).c_str(), ("; Sum Pt physics TP"+(en)).c_str(), 100, 0.0, 100.); - hisSumPtTPpileup_[tn] = inputDir.make(("SumPtTPpileup"+(tn)).c_str(), ("; Sum Pt pileup TP"+(en)).c_str(), 100, 0.0, 100.); - } - - return inputDir; -} - -//=== Fill histograms studying freak, large events with too many stubs at HT. -void Histos::fillStudyBusyEvents(const InputData& inputData, const matrix& mSectors, const matrix& mHtRphis, - const matrix& mGet3Dtrks) { + //=== Book histograms studying freak, large events with too many stubs. - const bool withRZfilter = false; // Care about events at HT. + TFileDirectory Histos::bookStudyBusyEvents() { + TFileDirectory inputDir = fs_->mkdir("BusyEvents"); - const unsigned int numStubsCut = settings_->busySectorNumStubs(); // No. of stubs per HT array the hardware can output. + // Look at (eta, phi) sectors with too many input stubs or too many output (= assigned to tracks) stubs. - const vector& vStubs = inputData.getStubs(); - const vector& vTPs = inputData.getTPs(); - - // Create map containing L1 tracks found in whole of tracker together with flag indicating if the - // track was killed because it was in a busy sector. - map trksInEntireTracker; + unsigned int nEta = numEtaRegions_; - unsigned int nBusySecIn = 0; - unsigned int nBusySecOut = 0; + hisNumBusySecsInPerEvent_ = + inputDir.make("NumBusySecsInPerEvent", "; No. sectors with too many input stubs/event", 20, -0.5, 19.5); + hisNumBusySecsOutPerEvent_ = + inputDir.make("NumBusySecsOutPerEvent", "; No. sectors with too many output stubs/event", 20, -0.5, 19.5); + profFracBusyInVsEtaReg_ = inputDir.make( + "FracBusyInVsEtaReg", "; #eta region; Frac. of sectors with too many input stubs", nEta, -0.5, nEta - 0.5); + profFracBusyOutVsEtaReg_ = inputDir.make( + "FracBusyOutVsEtaReg", "; #eta region; Frac. of sectors with too many output stubs", nEta, -0.5, nEta - 0.5); + profFracStubsKilledVsEtaReg_ = inputDir.make( + "FracStubsKilledInVsEtaReg", "; #eta region; Frac. of input stubs killed", nEta, -0.5, nEta - 0.5); + profFracTracksKilledVsEtaReg_ = inputDir.make( + "FracTracksKilledInVsEtaReg", "; #eta region; Frac. of track killed", nEta, -0.5, nEta - 0.5); + profFracTracksKilledVsInvPt_ = + inputDir.make("FracTracksKilledInVsInvPt", ";1/Pt; Frac. of track killed", 16, 0., 1. / houghMinPt_); + profFracTPKilledVsEta_ = inputDir.make( + "FracTPKilledInVsEta", ";#eta; Efficiency loss due to busy sectors", 16, 0., settings_->maxStubEta()); + profFracTPKilledVsInvPt_ = inputDir.make( + "FracTPKilledInVsInvPt", ";1/Pt; Efficiency loss due to busy sectors", 16, 0., 1. / houghMinPt_); + hisNumTPkilledBusySec_ = + inputDir.make("NumTPkilledBusySec", "; No. of TP killed in each busy sector", 30, -0.5, 29.5); + + // Compare properties of sectors with/without too many output stubs. + + const vector tnames = {"BusyOutSec", "QuietOutSec"}; + const vector enames = {" in busy output sector", " in quiet output sector"}; + for (unsigned int i = 0; i <= 1; i++) { + const string tn = tnames[i]; + const string en = enames[i]; + + hisNumInputStubs_[tn] = + inputDir.make(("NumInputStubs" + (tn)).c_str(), ("; No. input stubs" + (en)).c_str(), 250, -0.5, 249.5); + hisQoverPtInputStubs_[tn] = inputDir.make( + ("QoverPtInputStubs" + (tn)).c_str(), ("; q/Pt of input stubs" + (en)).c_str(), 30, 0., 1. / houghMinPt_); + hisNumOutputStubs_[tn] = inputDir.make( + ("NumOutputStubs" + (tn)).c_str(), ("; No. output stubs" + (en)).c_str(), 1000, -0.5, 999.5); + hisNumTracks_[tn] = + inputDir.make(("NumTracks" + (tn)).c_str(), ("; No. tracks" + (en)).c_str(), 200, -0.5, 199.5); + hisNumStubsPerTrack_[tn] = inputDir.make( + ("NumStubsPerTrack" + (tn)).c_str(), ("; No. stubs/track" + (en)).c_str(), 50, -0.5, 49.5); + hisTrackQoverPt_[tn] = inputDir.make( + ("TrackQoverPt" + (tn)).c_str(), ("; Track q/pt" + (en)).c_str(), 30, 0., 1. / houghMinPt_); + hisTrackPurity_[tn] = + inputDir.make(("TrackPurity" + (tn)).c_str(), ("; Track purity" + (en)).c_str(), 102, -0.01, 1.01); + hisNumTPphysics_[tn] = + inputDir.make(("NumTPphysics" + (tn)).c_str(), ("; No. physics TP" + (en)).c_str(), 30, -0.5, 29.5); + hisNumTPpileup_[tn] = + inputDir.make(("NumTPpileup" + (tn)).c_str(), ("; No. pileup TP" + (en)).c_str(), 30, -0.5, 29.5); + hisSumPtTPphysics_[tn] = inputDir.make( + ("SumPtTPphysics" + (tn)).c_str(), ("; Sum Pt physics TP" + (en)).c_str(), 100, 0.0, 100.); + hisSumPtTPpileup_[tn] = + inputDir.make(("SumPtTPpileup" + (tn)).c_str(), ("; Sum Pt pileup TP" + (en)).c_str(), 100, 0.0, 100.); + } - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - const Sector& sector = mSectors(iPhiSec, iEtaReg); - const HTrphi& htRphi = mHtRphis (iPhiSec, iEtaReg); - const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); - const vector& tracks = get3Dtrk.trackCands3D(withRZfilter); + return inputDir; + } - //--- Look for too many stubs input to sector. + //=== Fill histograms studying freak, large events with too many stubs at HT. - unsigned int nStubsIn = htRphi.nReceivedStubs(); - // Plot fraction of input stubs that would be killed by 36BX period. - for (unsigned int j = 0; j < nStubsIn; j++) { - bool kill = (j >= numStubsCut); - profFracStubsKilledVsEtaReg_->Fill(iEtaReg, kill); - } - bool tooBusyIn = (nStubsIn > numStubsCut); - if (tooBusyIn) nBusySecIn++; - profFracBusyInVsEtaReg_->Fill(iEtaReg, tooBusyIn); // Sector had too many input stubs. - - //--- Look for too many stubs assigned to output tracks. - - // Order tracks in increasing order of abs(q/Pt). - // Use multimap rather than map to do this, as some tracks may have identical q/Pt, and it will store all of them, unlike map. - multimap orderedTrks; - for (const L1track3D& trk : tracks) { - orderedTrks.insert( pair( fabs(trk.qOverPt()), &trk) ); - } + void Histos::fillStudyBusyEvents(const InputData& inputData, + const matrix& mSectors, + const matrix& mHtRphis, + const matrix& mGet3Dtrks) { + const bool withRZfilter = false; // Care about events at HT. - // Create map containing L1 tracks found in whole of tracker together with flag indicating if the - // track was killed because it was in a busy sector. - map trksInSector; + const unsigned int numStubsCut = + settings_->busySectorNumStubs(); // No. of stubs per HT array the hardware can output. - // Check how many tracks would be killed by 36BX period, assuming we kill preferentially low Pt ones. - bool tooBusyOut = false; - unsigned int nStubsOut = 0; + const vector& vStubs = inputData.getStubs(); + const vector& vTPs = inputData.getTPs(); - for (const auto& oTrk : orderedTrks) { - float ptInv = oTrk.first; - const L1track3D* trk = oTrk.second; - bool kill = false; - nStubsOut += trk->getNumStubs(); - if (nStubsOut > numStubsCut) kill = true; + // Create map containing L1 tracks found in whole of tracker together with flag indicating if the + // track was killed because it was in a busy sector. + map trksInEntireTracker; - if (kill) tooBusyOut = true; // Note that some tracks were killed in this sector. + unsigned int nBusySecIn = 0; + unsigned int nBusySecOut = 0; - profFracTracksKilledVsEtaReg_->Fill(iEtaReg, kill); - profFracTracksKilledVsInvPt_->Fill(ptInv, kill); + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + const Sector& sector = mSectors(iPhiSec, iEtaReg); + const HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); + const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); + const vector& tracks = get3Dtrk.trackCands3D(withRZfilter); + + //--- Look for too many stubs input to sector. + + unsigned int nStubsIn = htRphi.nReceivedStubs(); + // Plot fraction of input stubs that would be killed by 36BX period. + for (unsigned int j = 0; j < nStubsIn; j++) { + bool kill = (j >= numStubsCut); + profFracStubsKilledVsEtaReg_->Fill(iEtaReg, kill); + } + bool tooBusyIn = (nStubsIn > numStubsCut); + if (tooBusyIn) + nBusySecIn++; + profFracBusyInVsEtaReg_->Fill(iEtaReg, tooBusyIn); // Sector had too many input stubs. + + //--- Look for too many stubs assigned to output tracks. + + // Order tracks in increasing order of abs(q/Pt). + // Use multimap rather than map to do this, as some tracks may have identical q/Pt, and it will store all of them, unlike map. + multimap orderedTrks; + for (const L1track3D& trk : tracks) { + orderedTrks.insert(pair(fabs(trk.qOverPt()), &trk)); + } - // Form a map of all tracks in the entire tracker & also just in this sector, with a flag indicating if they were killed as in a busy sector. - trksInEntireTracker[trk] = kill; - trksInSector[trk] = kill; - } + // Create map containing L1 tracks found in whole of tracker together with flag indicating if the + // track was killed because it was in a busy sector. + map trksInSector; - if (tooBusyOut) nBusySecOut++; - profFracBusyOutVsEtaReg_->Fill(iEtaReg, tooBusyOut); // Sector had too many output stubs. + // Check how many tracks would be killed by 36BX period, assuming we kill preferentially low Pt ones. + bool tooBusyOut = false; + unsigned int nStubsOut = 0; - //--- Compare properties of sectors with/without too many output stubs. + for (const auto& oTrk : orderedTrks) { + float ptInv = oTrk.first; + const L1track3D* trk = oTrk.second; + bool kill = false; + nStubsOut += trk->getNumStubs(); + if (nStubsOut > numStubsCut) + kill = true; - const vector tnames = {"BusyOutSec", "QuietOutSec"}; + if (kill) + tooBusyOut = true; // Note that some tracks were killed in this sector. - // Loop over sectors with too many/not too many output stubs. - for (const string& tn : tnames) { - if ((tn == "BusyOutSec" && tooBusyOut) || (tn == "QuietOutSec" && (! tooBusyOut))) { + profFracTracksKilledVsEtaReg_->Fill(iEtaReg, kill); + profFracTracksKilledVsInvPt_->Fill(ptInv, kill); - hisNumInputStubs_[tn]->Fill(nStubsIn); + // Form a map of all tracks in the entire tracker & also just in this sector, with a flag indicating if they were killed as in a busy sector. + trksInEntireTracker[trk] = kill; + trksInSector[trk] = kill; + } - // Check if q/Pt estimated from stub bend differs in busy & quiet sectors. - for (const Stub* stub : vStubs) { - if ( sector.inside( stub ) ) hisQoverPtInputStubs_[tn]->Fill(abs(stub->qOverPt())); + if (tooBusyOut) + nBusySecOut++; + profFracBusyOutVsEtaReg_->Fill(iEtaReg, tooBusyOut); // Sector had too many output stubs. + + //--- Compare properties of sectors with/without too many output stubs. + + const vector tnames = {"BusyOutSec", "QuietOutSec"}; + + // Loop over sectors with too many/not too many output stubs. + for (const string& tn : tnames) { + if ((tn == "BusyOutSec" && tooBusyOut) || (tn == "QuietOutSec" && (!tooBusyOut))) { + hisNumInputStubs_[tn]->Fill(nStubsIn); + + // Check if q/Pt estimated from stub bend differs in busy & quiet sectors. + for (const Stub* stub : vStubs) { + if (sector.inside(stub)) + hisQoverPtInputStubs_[tn]->Fill(abs(stub->qOverPt())); + } + + // Look at reconstructed tracks in this sector. + hisNumOutputStubs_[tn]->Fill(nStubsOut); + hisNumTracks_[tn]->Fill(tracks.size()); + for (const L1track3D& trk : tracks) { + hisNumStubsPerTrack_[tn]->Fill(trk.getNumStubs()); + hisTrackQoverPt_[tn]->Fill(trk.qOverPt()); + hisTrackPurity_[tn]->Fill(trk.getPurity()); + } + + // Look at total Pt of truth particles in this sector to understand if it contains a jet. + unsigned int num_TP_physics = 0; + unsigned int num_TP_pileup = 0; + float sumPt_TP_physics = 0.; + float sumPt_TP_pileup = 0.; + for (const TP& tp : vTPs) { + bool tpInSector = + (fabs(tp.trkPhiAtR(settings_->chosenRofPhi()) - sector.phiCentre()) < sector.sectorHalfWidth() && + tp.trkZAtR(chosenRofZ_) > sector.zAtChosenR_Min() && + tp.trkZAtR(chosenRofZ_) < sector.zAtChosenR_Max()); + if (tpInSector) { + if (tp.physicsCollision()) { // distinguish truth particles from physics collision vs from pileup. + num_TP_physics++; + sumPt_TP_physics += tp.pt(); + } else { + num_TP_pileup++; + sumPt_TP_pileup += tp.pt(); + } + } + } + hisNumTPphysics_[tn]->Fill(num_TP_physics); + hisNumTPpileup_[tn]->Fill(num_TP_pileup); + hisSumPtTPphysics_[tn]->Fill(sumPt_TP_physics); + hisSumPtTPpileup_[tn]->Fill(sumPt_TP_pileup); } + } - // Look at reconstructed tracks in this sector. - hisNumOutputStubs_[tn]->Fill(nStubsOut); - hisNumTracks_[tn]->Fill(tracks.size()); - for (const L1track3D& trk : tracks) { - hisNumStubsPerTrack_[tn]->Fill(trk.getNumStubs()); - hisTrackQoverPt_[tn]->Fill(trk.qOverPt()); - hisTrackPurity_[tn]->Fill(trk.getPurity()); - } - - // Look at total Pt of truth particles in this sector to understand if it contains a jet. - unsigned int num_TP_physics = 0; - unsigned int num_TP_pileup = 0; - float sumPt_TP_physics = 0.; - float sumPt_TP_pileup = 0.; - for (const TP& tp : vTPs) { - bool tpInSector = (fabs(tp.trkPhiAtR(settings_->chosenRofPhi()) - sector.phiCentre()) < sector.sectorHalfWidth() && - tp.trkZAtR(chosenRofZ_) > sector.zAtChosenR_Min() && - tp.trkZAtR(chosenRofZ_) < sector.zAtChosenR_Max()); - if (tpInSector) { - if (tp.physicsCollision()) { // distinguish truth particles from physics collision vs from pileup. - num_TP_physics++; - sumPt_TP_physics += tp.pt(); - } else { - num_TP_pileup++; - sumPt_TP_pileup += tp.pt(); - } - } - } - hisNumTPphysics_[tn]->Fill(num_TP_physics); - hisNumTPpileup_[tn]->Fill(num_TP_pileup); - hisSumPtTPphysics_[tn]->Fill(sumPt_TP_physics); - hisSumPtTPpileup_[tn]->Fill(sumPt_TP_pileup); - } - } - - //--- Count tracking particles lost by killing tracks in individual busy sectors. - if (tooBusyOut) { - unsigned int nTPkilled = 0; - for (const TP& tp: vTPs) { - if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. - - bool tpRecoed = false; - bool tpRecoedSurvived = false; - for (const auto& trkm : trksInSector) { - const L1track3D* trk = trkm.first; - bool kill = trkm.second; - if (trk->getMatchedTP() == &tp) { - tpRecoed = true; // Truth particle was reconstructed - if (! kill) tpRecoedSurvived = true; // Ditto & reconstructed track wasn't killed by busy sector. - } - } - - bool tpKilled = tpRecoed && ( ! tpRecoedSurvived ); - if (tpKilled) nTPkilled++; - } - } - hisNumTPkilledBusySec_->Fill(nTPkilled); + //--- Count tracking particles lost by killing tracks in individual busy sectors. + if (tooBusyOut) { + unsigned int nTPkilled = 0; + for (const TP& tp : vTPs) { + if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. + + bool tpRecoed = false; + bool tpRecoedSurvived = false; + for (const auto& trkm : trksInSector) { + const L1track3D* trk = trkm.first; + bool kill = trkm.second; + if (trk->getMatchedTP() == &tp) { + tpRecoed = true; // Truth particle was reconstructed + if (!kill) + tpRecoedSurvived = true; // Ditto & reconstructed track wasn't killed by busy sector. + } + } + + bool tpKilled = tpRecoed && (!tpRecoedSurvived); + if (tpKilled) + nTPkilled++; + } + } + hisNumTPkilledBusySec_->Fill(nTPkilled); + } } } - } - hisNumBusySecsInPerEvent_->Fill(nBusySecIn); // No. of sectors per event with too many input stubs. - hisNumBusySecsOutPerEvent_->Fill(nBusySecOut); // No. of sectors per event with too many output stubs. + hisNumBusySecsInPerEvent_->Fill(nBusySecIn); // No. of sectors per event with too many input stubs. + hisNumBusySecsOutPerEvent_->Fill(nBusySecOut); // No. of sectors per event with too many output stubs. - //--- Check loss in tracking efficiency caused by killing tracks in busy sectors. + //--- Check loss in tracking efficiency caused by killing tracks in busy sectors. - for (const TP& tp: vTPs) { - if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. + for (const TP& tp : vTPs) { + if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. - bool tpRecoed = false; - bool tpRecoedSurvived = false; - for (const auto& trkm : trksInEntireTracker) { - const L1track3D* trk = trkm.first; - bool kill = trkm.second; - if (trk->getMatchedTP() == &tp) { - tpRecoed = true; // Truth particle was reconstructed - if (! kill) tpRecoedSurvived = true; // Ditto & reconstructed track wasn't killed by busy sector. - } + bool tpRecoed = false; + bool tpRecoedSurvived = false; + for (const auto& trkm : trksInEntireTracker) { + const L1track3D* trk = trkm.first; + bool kill = trkm.second; + if (trk->getMatchedTP() == &tp) { + tpRecoed = true; // Truth particle was reconstructed + if (!kill) + tpRecoedSurvived = true; // Ditto & reconstructed track wasn't killed by busy sector. + } + } + bool tpKilled = tpRecoed && (!tpRecoedSurvived); + profFracTPKilledVsEta_->Fill(fabs(tp.eta()), tpKilled); + profFracTPKilledVsInvPt_->Fill(fabs(tp.qOverPt()), tpKilled); } - bool tpKilled = tpRecoed && ( ! tpRecoedSurvived ); - profFracTPKilledVsEta_->Fill(fabs(tp.eta()), tpKilled); - profFracTPKilledVsInvPt_->Fill(fabs(tp.qOverPt()), tpKilled); } } -} - -//=== Book histograms for studying track fitting. - -map Histos::bookTrackFitting() { - - const float maxEta = settings_->maxStubEta(); - const float maxAbsQoverPt = 1./houghMinPt_; // Max. |q/Pt| covered by HT array. - - // Book histograms for 4 and 5 parameter helix fits. - - map inputDirMap; - - for (const string& fitName : trackFitters_ ) { - - // Define lambda function to facilitate adding "fitName" histogram names. - auto addn = [fitName](string s){ return TString::Format("%s_%s", s.c_str(), fitName.c_str()); }; - - //std::cout << "Booking histograms for " << fitName << std::endl; - TFileDirectory inputDir = fs_->mkdir( fitName ); - inputDirMap[fitName] = inputDir; - - profNumFitTracks_[fitName] = inputDir.make(addn("NumFitTracks"), "; class; # of fitted tracks", 11, 0.5, 11.5, -0.5, 9.9e6); - profNumFitTracks_[fitName]->GetXaxis()->SetBinLabel(7, "TP for eff fitted"); - profNumFitTracks_[fitName]->GetXaxis()->SetBinLabel(6, "TP fitted"); - profNumFitTracks_[fitName]->GetXaxis()->SetBinLabel(2, "Fit tracks that are genuine"); - profNumFitTracks_[fitName]->GetXaxis()->SetBinLabel(1, "Fit tracks including fakes"); - profNumFitTracks_[fitName]->LabelsOption("d"); - - hisNumFitTrks_[fitName] = inputDir.make(addn("NumFitTrks"), "; No. fitted tracks in tracker;",200,-0.5,399.5); - hisNumFitTrksPerNon_[fitName] = inputDir.make(addn("NumFitTrksPerNon"), "; No. fitted tracks per nonant;",200,-0.5,199.5); - hisNumFitTrksPerSect_[fitName] = inputDir.make(addn("NumFitTrksPerSect"), "; No. fitted tracks per sector;",100,-0.5,99.5); - - hisStubsPerFitTrack_[fitName] = inputDir.make(addn("StubsPerFitTrack"), "; No. of stubs per fitted track",20,-0.5,19.5); - profStubsOnFitTracks_[fitName] = inputDir.make(addn("StubsOnFitTracks"), "; ; No. of stubs on all fitted tracks per event",1,0.5,1.5); - - hisFitQinvPtMatched_[fitName] = inputDir.make(addn("FitQinvPtMatched"),"Fitted q/p_{T} for matched tracks", 120, -0.6, 0.6 ); - hisFitPhi0Matched_[fitName] = inputDir.make(addn("FitPhi0Matched"), "Fitted #phi_{0} for matched tracks", 70, -3.5, 3.5 ); - hisFitD0Matched_[fitName] = inputDir.make(addn("FitD0Matched"), "Fitted d_{0} for matched tracks", 100, -2., 2. ); - hisFitZ0Matched_[fitName] = inputDir.make(addn("FitZ0Matched"), "Fitted z_{0} for matched tracks", 100, -25., 25. ); - hisFitEtaMatched_[fitName] = inputDir.make(addn("FitEtaMatched"), "Fitted #eta for matched tracks", 70, -3.5, 3.5 ); - - hisFitQinvPtUnmatched_[fitName] = inputDir.make(addn("FitQinvPtUnmatched"), "Fitted q/p_{T} for unmatched tracks", 120, -0.6, 0.6 ); - hisFitPhi0Unmatched_[fitName] = inputDir.make(addn("FitPhi0Unmatched"), "Fitted #phi_{0} for unmatched tracks", 70, -3.5, 3.5 ); - hisFitD0Unmatched_[fitName] = inputDir.make(addn("FitD0Unmatched"), "Fitted d_{0} for unmatched tracks", 100, -2., 2. ); - hisFitZ0Unmatched_[fitName] = inputDir.make(addn("FitZ0Unmatched"), "Fitted z_{0} for unmatched tracks", 100, -25., 25. ); - hisFitEtaUnmatched_[fitName] = inputDir.make(addn("FitEtaUnmatched"), "Fitted #eta for unmatched tracks", 70, -3.5, 3.5 ); - - const unsigned int nBinsChi2 = 29; - const float chi2dofBins[nBinsChi2+1] = - {0.0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8,2.0,2.4,2.8,3.2,3.6,4.0,4.5,5.0,6.0,7.0,8.0,9.0,10.0,12.0,14.0,16.0,18.0,20.0,25.0,30.0}; - float chi2Bins[nBinsChi2+1]; - for (unsigned int k = 0; k < nBinsChi2+1; k++) chi2Bins[k] = chi2dofBins[k]*6; - - hisFitChi2Matched_[fitName] = inputDir.make(addn("FitChi2Matched"), ";#chi^{2};", nBinsChi2, chi2Bins ); - hisFitChi2DofMatched_[fitName] = inputDir.make(addn("FitChi2DofMatched"), ";#chi^{2}/DOF;", nBinsChi2, chi2dofBins ); - hisFitChi2DofRphiMatched_[fitName] = inputDir.make(addn("FitChi2DofRphiMatched"), ";#chi^{2}rphi;", nBinsChi2, chi2Bins ); - hisFitChi2DofRzMatched_[fitName] = inputDir.make(addn("FitChi2DofRzMatched"), ";#chi^{2}rz/DOF;", nBinsChi2, chi2Bins ); - if (settings_->kalmanAddBeamConstr() && fitName.find("KF5") != string::npos) { // Histograms of chi2 with beam-spot constraint only make sense for 5 param fit. - hisFitBeamChi2Matched_[fitName] = inputDir.make(addn("FitBeamChi2Matched"), "; Beam constr #chi^{2};", nBinsChi2, chi2Bins); - hisFitBeamChi2DofMatched_[fitName] = inputDir.make(addn("FitBeamChi2DofMatched"), ";Beam constr #chi^{2}/DOF;", nBinsChi2, chi2dofBins ); - } - profFitChi2VsEtaMatched_[fitName] = inputDir.make(addn("FitChi2VsEtaMatched"), "; #eta; Fit #chi^{2}", 24, 0., maxEta ); - profFitChi2DofVsEtaMatched_[fitName] = inputDir.make(addn("FitChi2DofVsEtaMatched"), "; #eta; Fit #chi^{2}/dof", 24, 0., maxEta ); - profFitChi2VsInvPtMatched_[fitName] = inputDir.make(addn("FitChi2VsInvPtMatched"), "; 1/p_{T}; Fit #chi^{2}", 25, 0., maxAbsQoverPt ); - profFitChi2DofVsInvPtMatched_[fitName] = inputDir.make(addn("FitChi2DofVsInvPtMatched"), "; 1/p_{T}; Fit #chi^{2}/dof", 25, 0., maxAbsQoverPt ); - const unsigned int nBinsD0 = 8; - const float d0Bins[nBinsD0+1]={0.0,0.05,0.10,0.15,0.20,0.3,0.5,1.0,2.0}; - profFitChi2VsTrueD0Matched_[fitName] = inputDir.make(addn("FitChi2VsTrueD0Matched"), "; true d0 (cm); Fit #chi^{2}", nBinsD0, d0Bins ); - profFitChi2DofVsTrueD0Matched_[fitName] = inputDir.make(addn("FitChi2DofVsTrueD0Matched"), "; true d0 (cm); Fit #chi^{2}/dof", nBinsD0, d0Bins); - - hisFitChi2PerfMatched_[fitName] = inputDir.make(addn("FitChi2PerfMatched"), ";#chi^{2};", nBinsChi2, chi2Bins ); - hisFitChi2DofPerfMatched_[fitName] = inputDir.make(addn("FitChi2DofPerfMatched"), ";#chi^{2}/DOF;", nBinsChi2, chi2dofBins ); - - hisFitChi2Unmatched_[fitName] = inputDir.make(addn("FitChi2Unmatched"), ";#chi^{2};", nBinsChi2, chi2Bins ); - hisFitChi2DofUnmatched_[fitName] = inputDir.make(addn("FitChi2DofUnmatched"), ";#chi^{2}/DOF;", nBinsChi2, chi2dofBins ); - hisFitChi2DofRphiUnmatched_[fitName] = inputDir.make(addn("FitChi2DofRphiUnmatched"), ";#chi^{2}rphi/DOF;", nBinsChi2, chi2Bins ); - hisFitChi2DofRzUnmatched_[fitName] = inputDir.make(addn("FitChi2DofRzUnmatched"), ";#chi^{2}rz/DOF;", nBinsChi2, chi2Bins ); - if (settings_->kalmanAddBeamConstr() && fitName.find("KF5") != string::npos) { // Histograms of chi2 with beam-spot constraint only make sense for 5 param fit. - hisFitBeamChi2Unmatched_[fitName] = inputDir.make(addn("FitBeamChi2Unmatched"), "; Beam constr #Chi^{2};", nBinsChi2, chi2Bins ); - hisFitBeamChi2DofUnmatched_[fitName] = inputDir.make(addn("FitBeamChi2DofUnmatched"), "; Beam constr #Chi^{2}/DOF;", nBinsChi2, chi2dofBins ); - } - profFitChi2VsEtaUnmatched_[fitName] = inputDir.make(addn("FitChi2VsEtaUnmatched"), "; #eta; Fit #chi2", 24, 0., maxEta ); - profFitChi2DofVsEtaUnmatched_[fitName] = inputDir.make(addn("FitChi2DofVsEtaUnmatched"), "; #eta; Fit #chi2/dof", 24, 0., maxEta ); - profFitChi2VsInvPtUnmatched_[fitName] = inputDir.make(addn("FitChi2VsInvPtUnmatched"), "; 1/p_{T}; Fit #chi2", 25, 0., maxAbsQoverPt ); - profFitChi2DofVsInvPtUnmatched_[fitName] = inputDir.make(addn("FitChi2DofVsInvPtUnmatched"), "; 1/p_{T}; Fit #chi2/dof", 25, 0., maxAbsQoverPt ); - - profFitChi2VsPurity_[fitName] = inputDir.make(addn("FitChi2VsPurity"), "#Chi^{2} vs stub purity", 102, -0.01, 1.01 ); - profFitChi2DofVsPurity_[fitName] = inputDir.make(addn("FitChi2DofVsPurity"), "#Chi^{2}/DOF vs stub purity", 102, -0.01, 1.01 ); - - // Monitoring specific track fit algorithms. - if (fitName.find("KF") != string::npos) { - hisKalmanNumUpdateCalls_[fitName] = inputDir.make(addn("KalmanNumUpdateCalls"), "; Calls to KF updator;",100,-0.5,99.5); - hisKalmanChi2DofSkipLay0Matched_[fitName] = inputDir.make(addn("KalmanChi2DofSkipLay0Matched"), ";#chi^{2} for nSkippedLayers = 0;", nBinsChi2, chi2Bins ); - hisKalmanChi2DofSkipLay1Matched_[fitName] = inputDir.make(addn("KalmanChi2DofSkipLay1Matched"), ";#chi^{2} for nSkippedLayers = 1;", nBinsChi2, chi2Bins ); - hisKalmanChi2DofSkipLay2Matched_[fitName] = inputDir.make(addn("KalmanChi2DofSkipLay2Matched"), ";#chi^{2} for nSkippedLayers = 2;", nBinsChi2, chi2Bins ); - hisKalmanChi2DofSkipLay0Unmatched_[fitName] = inputDir.make(addn("KalmanChi2DofSkipLay0Unmatched"), ";#chi^{2} for nSkippedLayers = 0;", nBinsChi2, chi2Bins ); - hisKalmanChi2DofSkipLay1Unmatched_[fitName] = inputDir.make(addn("KalmanChi2DofSkipLay1Unmatched"), ";#chi^{2} for nSkippedLayers = 1;", nBinsChi2, chi2Bins ); - hisKalmanChi2DofSkipLay2Unmatched_[fitName] = inputDir.make(addn("KalmanChi2DofSkipLay2Unmatched"), ";#chi^{2} for nSkippedLayers = 2;", nBinsChi2, chi2Bins ); - } - - // See how far stubs lie from fitted (or true) trajectory - hisDeltaPhitruePSbarrel_[fitName] = inputDir.make(addn("DeltaPhitruePSbarrel"),"PS modules; ##sigma of true stubs from true traj. in phi;",100,-5.0,5.0); - hisDeltaRorZtruePSbarrel_[fitName] = inputDir.make(addn("DeltaRorZtruePSbarrel"),"PS modules; ##sigma of true stubs from true traj. in r-z;",100,-5.0,5.0); - hisDeltaPhitrue2Sbarrel_[fitName] = inputDir.make(addn("DeltaPhitrue2Sbarrel"),"2S modules; ##sigma of true stubs from true traj. in phi;",100,-5.0,5.0); - hisDeltaRorZtrue2Sbarrel_[fitName] = inputDir.make(addn("DeltaRorZtrue2Sbarrel"),"2S modules; ##sigma of true stubs from true traj. in r-z;",100,-5.0,5.0); - hisDeltaPhitruePSendcap_[fitName] = inputDir.make(addn("DeltaPhitruePSendcap"),"PS modules; ##sigma of true stubs from true traj. in phi;",100,-5.0,5.0); - hisDeltaRorZtruePSendcap_[fitName] = inputDir.make(addn("DeltaRorZtruePSendcap"),"PS modules; ##sigma of true stubs from true traj. in r-z;",100,-5.0,5.0); - hisDeltaPhitrue2Sendcap_[fitName] = inputDir.make(addn("DeltaPhitrue2Sendcap"),"2S modules; ##sigma of true stubs from true traj. in phi;",100,-5.0,5.0); - hisDeltaRorZtrue2Sendcap_[fitName] = inputDir.make(addn("DeltaRorZtrue2Sendcap"),"2S modules; ##sigma of true stubs from true traj. in r-z;",100,-5.0,5.0); - hisDeltaPhifakePSbarrel_[fitName] = inputDir.make(addn("DeltaPhifakePSbarrel"),"PS modules; ##sigma of fake stubs from true traj. in phi;",100,-5.0,5.0); - hisDeltaRorZfakePSbarrel_[fitName] = inputDir.make(addn("DeltaRorZfakePSbarrel"),"PS modules; ##sigma of fake stubs from true traj. in r-z;",100,-5.0,5.0); - hisDeltaPhifake2Sbarrel_[fitName] = inputDir.make(addn("DeltaPhifake2Sbarrel"),"2S modules; ##sigma of fake stubs from true traj. in phi;",100,-5.0,5.0); - hisDeltaRorZfake2Sbarrel_[fitName] = inputDir.make(addn("DeltaRorZfake2Sbarrel"),"2S modules; ##sigma of fake stubs from true traj. in r-z;",100,-5.0,5.0); - hisDeltaPhifakePSendcap_[fitName] = inputDir.make(addn("DeltaPhifakePSendcap"),"PS modules; ##sigma of fake stubs from true traj. in phi;",100,-5.0,5.0); - hisDeltaRorZfakePSendcap_[fitName] = inputDir.make(addn("DeltaRorZfakePSendcap"),"PS modules; ##sigma of fake stubs from true traj. in r-z;",100,-5.0,5.0); - hisDeltaPhifake2Sendcap_[fitName] = inputDir.make(addn("DeltaPhifake2Sendcap"),"2S modules; ##sigma of fake stubs from true traj. in phi;",100,-5.0,5.0); - hisDeltaRorZfake2Sendcap_[fitName] = inputDir.make(addn("DeltaRorZfake2Sendcap"),"2S modules; ##sigma of fake stubs from true traj. in r-z;",100,-5.0,5.0); - profRecalcRphiChi2VsEtaTrue1_[fitName] = inputDir.make(addn("RecalcRphiChi2VsEtaTrue1"), "; #eta; Recalculated r-#phi #chi2 method 1 for matched tracks", 24, 0., maxEta ); - profRecalcRzChi2VsEtaTrue1_[fitName] = inputDir.make(addn("RecalcRzChi2VsEtaTrue1"), "; #eta; Recalculated r-z #chi2 method 1 for matched tracks", 24, 0., maxEta ); - profRecalcChi2VsEtaTrue1_[fitName] = inputDir.make(addn("RecalcChi2VsEtaTrue1"), "; #eta; Recalculated #chi2 method 1 for matched tracks", 24, 0., maxEta ); - profRecalcChi2VsEtaTrue2_[fitName] = inputDir.make(addn("RecalcChi2VsEtaTrue2"), "; #eta; Recalculated #chi2 method 2 for matched tracks", 24, 0., maxEta ); - profNsigmaPhivsInvPt_[fitName] = inputDir.make(addn("NsigmaPhivsInvPt"),"; 1/Pt; Num #sigma of true stubs from true traj.",16,0.,maxAbsQoverPt); - profNsigmaPhivsR_[fitName] = inputDir.make(addn("NsigmaPhivsR"),"; r; Num #sigma of true stubs from true traj.",22,0.,110.); - profNsigmaPhivsTanl_[fitName] = inputDir.make(addn("NsigmaPhivsTanl"),"; tan #lambda; Num #sigma of true stubs from true traj.",20,0.,6.); - - hisFitVsSeedQinvPtMatched_[fitName] = inputDir.make(addn("FitVsSeedQinvPtMatched"), "; Seed q/p_{T} (Genuine Cand); Fitted q/p_{T}", 120, -0.6, 0.6, 120, -0.6, 0.6 ); - hisFitVsSeedPhi0Matched_[fitName] = inputDir.make(addn("FitVsSeedPhi0Matched"), "; Seed #phi_{0} (Genuine Cand); Fitted #phi_{0}", 70, -3.5, 3.5, 70, -3.5, 3.5 ); - hisFitVsSeedD0Matched_[fitName] = inputDir.make(addn("FitVsSeedD0Matched"), "; Seed d_{0} (Genuine Cand); Fitted d_{0}", 100, -2., 2., 100, -2., 2. ); - hisFitVsSeedZ0Matched_[fitName] = inputDir.make(addn("FitVsSeedZ0Matched"), "; Seed z_{0} (Genuine Cand); Fitted z_{0}", 100, -25., 25., 100, -25., 25. ); - hisFitVsSeedEtaMatched_[fitName] = inputDir.make(addn("FitVsSeedEtaMatched"), "; Seed #eta (Genuine Cand); Fitted #eta", 70, -3.5, 3.5, 70, -3.5, 3.5 ); - - hisFitVsSeedQinvPtUnmatched_[fitName] = inputDir.make(addn("FitVsSeedQinvPtUnmatched"), "; Seed q/p_{T} (Fake Cand); Fitted q/p_{T}", 120, -0.6, 0.6, 120, -0.6, 0.6 ); - hisFitVsSeedPhi0Unmatched_[fitName] = inputDir.make(addn("FitVsSeedPhi0Unmatched"), "; Seed #phi_{0} (Fake Cand); Fitted #phi_{0}", 70, -3.5, 3.5, 70, -3.5, 3.5 ); - hisFitVsSeedD0Unmatched_[fitName] = inputDir.make(addn("FitVsSeedD0Unmatched"), "; Seed d_{0} (Fake Cand); Fitted d_{0}", 100, -2., 2., 100, -2., 2. ); - hisFitVsSeedZ0Unmatched_[fitName] = inputDir.make(addn("FitVsSeedZ0Unmatched"), "; Seed z_{0} (Fake Cand); Fitted z_{0}", 100, -25., 25., 100, -25., 25. ); - hisFitVsSeedEtaUnmatched_[fitName] = inputDir.make(addn("FitVsSeedEtaUnmatched"), "; Seed #eta (Fake Cand); Fitted #eta", 70, -3.5, 3.5, 70, -3.5, 3.5 ); - - hisNumStubsVsPurityMatched_[fitName] = inputDir.make(addn("NumStubsVsPurityMatched"), "; Purity; Number of stubs", 102, -0.01, 1.01, 30, 0.0, 30.0); - profFitFracTrueStubsVsLayerMatched_[fitName] = inputDir.make(addn("FitFracTrueStubsVsLayerMatched") ,";Layer ID; fraction of true stubs",30,0.5,30.5); - profFitFracTrueStubsVsEtaMatched_[fitName] = inputDir.make(addn("FitFracTrueStubsVsEtaMatched") ,";#eta; fraction of true stubs",24,0.,3.); - - // Plots of helix param resolution. - - hisFitVsTrueQinvPt_[fitName] = inputDir.make(addn("FitVsTrueQinvPt"), "; TP q/p_{T}; Fitted q/p_{T} (good #chi^{2})", 120, -0.6, 0.6, 120, -0.6, 0.6 ); - hisFitVsTruePhi0_[fitName] = inputDir.make(addn("FitVsTruePhi0"), "; TP #phi_{0}; Fitted #phi_{0} (good #chi^{2})", 70, -3.5, 3.5, 70, -3.5, 3.5 ); - hisFitVsTrueD0_[fitName] = inputDir.make(addn("FitVsTrueD0"), "; TP d_{0}; Fitted d_{0} (good #chi^{2})", 100, -2., 2., 100, -2., 2. ); - hisFitVsTrueZ0_[fitName] = inputDir.make(addn("FitVsTrueZ0"), "; TP z_{0}; Fitted z_{0} (good #chi^{2})" , 100, -25., 25., 100, -25., 25. ); - hisFitVsTrueEta_[fitName] = inputDir.make(addn("FitVsTrueEta"), "; TP #eta; Fitted #eta (good #chi^{2})", 70, -3.5, 3.5, 70, -3.5, 3.5 ); - - hisFitQinvPtRes_[fitName] = inputDir.make(addn("FitQinvPtRes"), "Fitted minus true q/p_{T} (good #chi^{2})", 100, -0.1, 0.1 ); - hisFitPhi0Res_[fitName] = inputDir.make(addn("FitPhi0Res"), "Fitted minus true #phi_{0} (good #chi^{2})", 100, -0.02, 0.02 ); - hisFitD0Res_[fitName] = inputDir.make(addn("FitD0Res"), "Fitted minus true d_{0} (good #chi^{2})", 100, -0.2, 0.2 ); - hisFitZ0Res_[fitName] = inputDir.make(addn("FitZ0Res"), "Fitted minus true z_{0} (good #chi^{2})", 100, -2., 2. ); - hisFitEtaRes_[fitName] = inputDir.make(addn("FitEtaRes"), "Fitted minus true #eta (good #chi^{2})", 100, -0.02, 0.02 ); - - hisQoverPtResVsTrueEta_[fitName] = inputDir.make(addn("QoverPtResVsTrueEta"), "q/p_{T} resolution; |#eta|; q/p_{T} resolution", 24, 0.0, maxEta); - hisPhi0ResVsTrueEta_[fitName] = inputDir.make(addn("PhiResVsTrueEta"), "#phi_{0} resolution; |#eta|; #phi_{0} resolution", 24, 0.0, maxEta); - hisEtaResVsTrueEta_[fitName] = inputDir.make(addn("EtaResVsTrueEta"), "#eta resolution; |#eta|; #eta resolution", 24, 0.0, maxEta); - hisZ0ResVsTrueEta_[fitName] = inputDir.make(addn("Z0ResVsTrueEta"), "z_{0} resolution; |#eta|; z_{0} resolution", 24, 0.0, maxEta); - hisD0ResVsTrueEta_[fitName] = inputDir.make(addn("D0ResVsTrueEta"), "d_{0} resolution; |#eta|; d_{0} resolution", 24, 0.0, maxEta); - - hisQoverPtResVsTrueInvPt_[fitName] = inputDir.make(addn("QoverPtResVsTrueInvPt"), "q/p_{T} resolution; 1/p_{T}; q/p_{T} resolution", 25, 0.0, maxAbsQoverPt); - hisPhi0ResVsTrueInvPt_[fitName] = inputDir.make(addn("PhiResVsTrueInvPt"), "#phi_{0} resolution; 1/p_{T}; #phi_{0} resolution", 25, 0.0, maxAbsQoverPt); - hisEtaResVsTrueInvPt_[fitName] = inputDir.make(addn("EtaResVsTrueInvPt"), "#eta resolution; 1/p_{T}; #eta resolution", 25, 0.0, maxAbsQoverPt); - hisZ0ResVsTrueInvPt_[fitName] = inputDir.make(addn("Z0ResVsTrueInvPt"), "z_{0} resolution; 1/p_{T}; z_{0} resolution", 25, 0.0, maxAbsQoverPt); - hisD0ResVsTrueInvPt_[fitName] = inputDir.make(addn("D0ResVsTrueInvPt"), "d_{0} resolution; 1/p_{T}; d_{0} resolution", 25, 0.0, maxAbsQoverPt); - - if (settings_->kalmanAddBeamConstr() && fitName.find("KF5") != string::npos) { // Histograms of resolution with beam-spot constraint only make sense for 5 param fit. - hisQoverPtResBeamVsTrueEta_[fitName] = inputDir.make(addn("QoverPtResBeamVsTrueEta"), "q/p_{T} resolution with beam constr; |#eta|; q/p_{T} resolution", 24, 0.0, maxEta); - hisPhi0ResBeamVsTrueEta_[fitName] = inputDir.make(addn("PhiResBeamVsTrueEta"), "#phi_{0} resolution with beam constr; |#eta|; #phi_{0} resolution", 24, 0.0, maxEta); - - hisQoverPtResBeamVsTrueInvPt_[fitName] = inputDir.make(addn("QoverPtResBeamVsTrueInvPt"), "q/p_{T} resolution with beam constr; 1/p_{T}; q/p_{T} resolution", 25, 0.0, maxAbsQoverPt); - hisPhi0ResBeamVsTrueInvPt_[fitName] = inputDir.make(addn("PhiResBeamVsTrueInvPt"), "#phi_{0} resolution with beam constr; 1/p_{T}; #phi_{0} resolution", 25, 0.0, maxAbsQoverPt); - } - - // Duplicate track histos. - profDupFitTrksVsEta_[fitName] = inputDir.make(addn("DupFitTrksVsEta") ,"; #eta; No. of duplicate tracks per TP",12,0.,3.); - profDupFitTrksVsInvPt_[fitName] = inputDir.make(addn("DupFitTrksVsInvPt") ,"; 1/Pt; No. of duplicate tracks per TP",houghNbinsPt_,0.,maxAbsQoverPt); - - // Histos for tracking efficiency vs. TP kinematics. (Binning must match similar histos in bookTrackCands()). - hisFitTPinvptForEff_[fitName] = inputDir.make(addn("FitTPinvptForEff") ,"; 1/Pt of TP (used for effi. measurement);",24,0.,1.5*maxAbsQoverPt); - hisFitTPptForEff_[fitName] = inputDir.make(addn("FitTPptForEff") ,"; Pt of TP (used for effi. measurement);",25,0.0,100.0); - hisFitTPetaForEff_[fitName] = inputDir.make(addn("FitTPetaForEff"),"; #eta of TP (used for effi. measurement);",20,-3.,3.); - hisFitTPphiForEff_[fitName] = inputDir.make(addn("FitTPphiForEff"),"; #phi of TP (used for effi. measurement);",20,-M_PI,M_PI); - - // Histo for efficiency to reconstruct track perfectly (no incorrect hits). (Binning must match similar histos in bookTrackCands()). - hisPerfFitTPinvptForEff_[fitName] = inputDir.make(addn("PerfFitTPinvptForEff") ,"; 1/Pt of TP (used for perf. effi. measurement);",24,0.,1.5*maxAbsQoverPt); - hisPerfFitTPptForEff_[fitName] = inputDir.make(addn("PerfFitTPptForEff") ,"; Pt of TP (used for perf. effi. measurement);",25,0.0,100.0); - hisPerfFitTPetaForEff_[fitName] = inputDir.make(addn("PerfFitTPetaForEff"),"; #eta of TP (used for perfect effi. measurement);",20,-3.,3.); - - // Histos for tracking efficiency vs. TP production point. (Binning must match similar histos in bookTrackCands()). - hisFitTPd0ForEff_[fitName] = inputDir.make(addn("FitTPd0ForEff"),"; d0 of TP (used for effi. measurement);",40, 0.,4.); - hisFitTPz0ForEff_[fitName] = inputDir.make(addn("FitTPz0ForEff"),"; z0 of TP (used for effi. measurement);",50,0.,25.); - - // Histos for algorithmic tracking efficiency vs. TP kinematics. (Binning must match similar histos in bookTrackCands()). - hisFitTPinvptForAlgEff_[fitName] = inputDir.make(addn("FitTPinvptForAlgEff") ,"; 1/Pt of TP (used for alg. effi. measurement);",24,0.,1.5*maxAbsQoverPt); - hisFitTPptForAlgEff_[fitName] = inputDir.make(addn("FitTPptForAlgEff") ,"; Pt of TP (used for alg. effi. measurement);",25,0.0,100.0); - hisFitTPetaForAlgEff_[fitName] = inputDir.make(addn("FitTPetaForAlgEff"),"; #eta of TP (used for alg. effi. measurement);",20,-3.,3.); - hisFitTPphiForAlgEff_[fitName] = inputDir.make(addn("FitTPphiForAlgEff"),"; #phi of TP (used for alg. effi. measurement);",20,-M_PI,M_PI); - - // Histo for efficiency to reconstruct track perfectly (no incorrect hits). (Binning must match similar histos in bookTrackCands()). - hisPerfFitTPinvptForAlgEff_[fitName] = inputDir.make(addn("PerfFitTPinvptForAlgEff") ,"; 1/Pt of TP (used for perf. alg. effi. measurement);",24,0.,1.5*maxAbsQoverPt); - hisPerfFitTPptForAlgEff_[fitName] = inputDir.make(addn("PerfFitTPptForAlgEff") ,"; Pt of TP (used for perf. alg. effi. measurement);",25,0.0,100.0); - hisPerfFitTPetaForAlgEff_[fitName] = inputDir.make(addn("PerfFitTPetaForAlgEff"),"; #eta of TP (used for perf. alg. effi. measurement);",20,-3.,3.); - - // Ditto for tracks inside jets. - hisPerfFitTPinvptForAlgEff_inJetPtG30_[fitName] = inputDir.make(addn("PerfFitTPinvptForAlgEff_inJetPtG30") ,"; 1/Pt of TP (used for perf. alg. effi. measurement);",24,0.,1.5*maxAbsQoverPt); - hisPerfFitTPinvptForAlgEff_inJetPtG100_[fitName] = inputDir.make(addn("PerfFitTPinvptForAlgEff_inJetPtG100") ,"; 1/Pt of TP (used for perf. alg. effi. measurement);",24,0.,1.5*maxAbsQoverPt); - hisPerfFitTPinvptForAlgEff_inJetPtG200_[fitName] = inputDir.make(addn("PerfFitTPinvptForAlgEff_inJetPtG200") ,"; 1/Pt of TP (used for perf. alg. effi. measurement);",24,0.,1.5*maxAbsQoverPt); - - // Histos for algorithmic tracking efficiency vs. TP production point. (Binning must match similar histos in bookTrackCands()). - hisFitTPd0ForAlgEff_[fitName] = inputDir.make(addn("FitTPd0ForAlgEff") ,"; d0 of TP (used for alg. effi. measurement);",40,0.,4.); - hisFitTPz0ForAlgEff_[fitName] = inputDir.make(addn("FitTPz0ForAlgEff") ,"; z0 of TP (used for alg. effi. measurement);",50,0.,25.); - - // Histo for algorithmic tracking efficiency vs sector number (to check if looser cuts are needed in certain regions) - unsigned int nPhi = numPhiSectors_; - unsigned int nEta = numEtaRegions_; - hisFitTPphisecForAlgEff_[fitName] = inputDir.make(addn("FitTPphisecForAlgEff") ,"; #phi sector of TP (used for alg. effi. measurement);",nPhi,-0.5,nPhi-0.5); - hisFitTPetasecForAlgEff_[fitName] = inputDir.make(addn("FitTPetasecForAlgEff") ,"; #eta sector of TP (used for alg. effi. measurement);",nEta,-0.5,nEta-0.5); - hisPerfFitTPphisecForAlgEff_[fitName] = inputDir.make(addn("PerfFitTPphisecForAlgEff") ,"; #phi sector of TP (used for perf. alg. effi. measurement);",nPhi,-0.5,nPhi-0.5); - hisPerfFitTPetasecForAlgEff_[fitName] = inputDir.make(addn("PerfFitTPetasecForAlgEff") ,"; #eta sector of TP (used for perf. alg. effi. measurement);",nEta,-0.5,nEta-0.5); - } - return inputDirMap; -} - -//=== Fill histograms for studying track fitting. - -void Histos::fillTrackFitting( const InputData& inputData, const map>& mFittedTracks) { - - const vector& vTPs = inputData.getTPs(); - - // Loop over all the fitting algorithms we are trying. - for (const string& fitName : trackFitters_) { + //=== Book histograms for studying track fitting. + + map Histos::bookTrackFitting() { + const float maxEta = settings_->maxStubEta(); + const float maxAbsQoverPt = 1. / houghMinPt_; // Max. |q/Pt| covered by HT array. + + // Book histograms for 4 and 5 parameter helix fits. + + map inputDirMap; + + for (const string& fitName : trackFitters_) { + // Define lambda function to facilitate adding "fitName" histogram names. + auto addn = [fitName](string s) { return TString::Format("%s_%s", s.c_str(), fitName.c_str()); }; + + //std::cout << "Booking histograms for " << fitName << std::endl; + TFileDirectory inputDir = fs_->mkdir(fitName); + inputDirMap[fitName] = inputDir; + + profNumFitTracks_[fitName] = + inputDir.make(addn("NumFitTracks"), "; class; # of fitted tracks", 11, 0.5, 11.5, -0.5, 9.9e6); + profNumFitTracks_[fitName]->GetXaxis()->SetBinLabel(7, "TP for eff fitted"); + profNumFitTracks_[fitName]->GetXaxis()->SetBinLabel(6, "TP fitted"); + profNumFitTracks_[fitName]->GetXaxis()->SetBinLabel(2, "Fit tracks that are genuine"); + profNumFitTracks_[fitName]->GetXaxis()->SetBinLabel(1, "Fit tracks including fakes"); + profNumFitTracks_[fitName]->LabelsOption("d"); + + hisNumFitTrks_[fitName] = + inputDir.make(addn("NumFitTrks"), "; No. fitted tracks in tracker;", 200, -0.5, 399.5); + hisNumFitTrksPerNon_[fitName] = + inputDir.make(addn("NumFitTrksPerNon"), "; No. fitted tracks per nonant;", 200, -0.5, 199.5); + hisNumFitTrksPerSect_[fitName] = + inputDir.make(addn("NumFitTrksPerSect"), "; No. fitted tracks per sector;", 100, -0.5, 99.5); + + hisStubsPerFitTrack_[fitName] = + inputDir.make(addn("StubsPerFitTrack"), "; No. of stubs per fitted track", 20, -0.5, 19.5); + profStubsOnFitTracks_[fitName] = inputDir.make( + addn("StubsOnFitTracks"), "; ; No. of stubs on all fitted tracks per event", 1, 0.5, 1.5); + + hisFitQinvPtMatched_[fitName] = + inputDir.make(addn("FitQinvPtMatched"), "Fitted q/p_{T} for matched tracks", 120, -0.6, 0.6); + hisFitPhi0Matched_[fitName] = + inputDir.make(addn("FitPhi0Matched"), "Fitted #phi_{0} for matched tracks", 70, -3.5, 3.5); + hisFitD0Matched_[fitName] = + inputDir.make(addn("FitD0Matched"), "Fitted d_{0} for matched tracks", 100, -2., 2.); + hisFitZ0Matched_[fitName] = + inputDir.make(addn("FitZ0Matched"), "Fitted z_{0} for matched tracks", 100, -25., 25.); + hisFitEtaMatched_[fitName] = + inputDir.make(addn("FitEtaMatched"), "Fitted #eta for matched tracks", 70, -3.5, 3.5); + + hisFitQinvPtUnmatched_[fitName] = + inputDir.make(addn("FitQinvPtUnmatched"), "Fitted q/p_{T} for unmatched tracks", 120, -0.6, 0.6); + hisFitPhi0Unmatched_[fitName] = + inputDir.make(addn("FitPhi0Unmatched"), "Fitted #phi_{0} for unmatched tracks", 70, -3.5, 3.5); + hisFitD0Unmatched_[fitName] = + inputDir.make(addn("FitD0Unmatched"), "Fitted d_{0} for unmatched tracks", 100, -2., 2.); + hisFitZ0Unmatched_[fitName] = + inputDir.make(addn("FitZ0Unmatched"), "Fitted z_{0} for unmatched tracks", 100, -25., 25.); + hisFitEtaUnmatched_[fitName] = + inputDir.make(addn("FitEtaUnmatched"), "Fitted #eta for unmatched tracks", 70, -3.5, 3.5); + + const unsigned int nBinsChi2 = 29; + const float chi2dofBins[nBinsChi2 + 1] = {0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, + 2.0, 2.4, 2.8, 3.2, 3.6, 4.0, 4.5, 5.0, 6.0, 7.0, + 8.0, 9.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 25.0, 30.0}; + float chi2Bins[nBinsChi2 + 1]; + for (unsigned int k = 0; k < nBinsChi2 + 1; k++) + chi2Bins[k] = chi2dofBins[k] * 6; + + hisFitChi2Matched_[fitName] = inputDir.make(addn("FitChi2Matched"), ";#chi^{2};", nBinsChi2, chi2Bins); + hisFitChi2DofMatched_[fitName] = + inputDir.make(addn("FitChi2DofMatched"), ";#chi^{2}/DOF;", nBinsChi2, chi2dofBins); + hisFitChi2DofRphiMatched_[fitName] = + inputDir.make(addn("FitChi2DofRphiMatched"), ";#chi^{2}rphi;", nBinsChi2, chi2Bins); + hisFitChi2DofRzMatched_[fitName] = + inputDir.make(addn("FitChi2DofRzMatched"), ";#chi^{2}rz/DOF;", nBinsChi2, chi2Bins); + if (settings_->kalmanAddBeamConstr() && + fitName.find("KF5") != + string::npos) { // Histograms of chi2 with beam-spot constraint only make sense for 5 param fit. + hisFitBeamChi2Matched_[fitName] = + inputDir.make(addn("FitBeamChi2Matched"), "; Beam constr #chi^{2};", nBinsChi2, chi2Bins); + hisFitBeamChi2DofMatched_[fitName] = + inputDir.make(addn("FitBeamChi2DofMatched"), ";Beam constr #chi^{2}/DOF;", nBinsChi2, chi2dofBins); + } + profFitChi2VsEtaMatched_[fitName] = + inputDir.make(addn("FitChi2VsEtaMatched"), "; #eta; Fit #chi^{2}", 24, 0., maxEta); + profFitChi2DofVsEtaMatched_[fitName] = + inputDir.make(addn("FitChi2DofVsEtaMatched"), "; #eta; Fit #chi^{2}/dof", 24, 0., maxEta); + profFitChi2VsInvPtMatched_[fitName] = + inputDir.make(addn("FitChi2VsInvPtMatched"), "; 1/p_{T}; Fit #chi^{2}", 25, 0., maxAbsQoverPt); + profFitChi2DofVsInvPtMatched_[fitName] = inputDir.make( + addn("FitChi2DofVsInvPtMatched"), "; 1/p_{T}; Fit #chi^{2}/dof", 25, 0., maxAbsQoverPt); + const unsigned int nBinsD0 = 8; + const float d0Bins[nBinsD0 + 1] = {0.0, 0.05, 0.10, 0.15, 0.20, 0.3, 0.5, 1.0, 2.0}; + profFitChi2VsTrueD0Matched_[fitName] = + inputDir.make(addn("FitChi2VsTrueD0Matched"), "; true d0 (cm); Fit #chi^{2}", nBinsD0, d0Bins); + profFitChi2DofVsTrueD0Matched_[fitName] = inputDir.make( + addn("FitChi2DofVsTrueD0Matched"), "; true d0 (cm); Fit #chi^{2}/dof", nBinsD0, d0Bins); + + hisFitChi2PerfMatched_[fitName] = + inputDir.make(addn("FitChi2PerfMatched"), ";#chi^{2};", nBinsChi2, chi2Bins); + hisFitChi2DofPerfMatched_[fitName] = + inputDir.make(addn("FitChi2DofPerfMatched"), ";#chi^{2}/DOF;", nBinsChi2, chi2dofBins); + + hisFitChi2Unmatched_[fitName] = inputDir.make(addn("FitChi2Unmatched"), ";#chi^{2};", nBinsChi2, chi2Bins); + hisFitChi2DofUnmatched_[fitName] = + inputDir.make(addn("FitChi2DofUnmatched"), ";#chi^{2}/DOF;", nBinsChi2, chi2dofBins); + hisFitChi2DofRphiUnmatched_[fitName] = + inputDir.make(addn("FitChi2DofRphiUnmatched"), ";#chi^{2}rphi/DOF;", nBinsChi2, chi2Bins); + hisFitChi2DofRzUnmatched_[fitName] = + inputDir.make(addn("FitChi2DofRzUnmatched"), ";#chi^{2}rz/DOF;", nBinsChi2, chi2Bins); + if (settings_->kalmanAddBeamConstr() && + fitName.find("KF5") != + string::npos) { // Histograms of chi2 with beam-spot constraint only make sense for 5 param fit. + hisFitBeamChi2Unmatched_[fitName] = + inputDir.make(addn("FitBeamChi2Unmatched"), "; Beam constr #Chi^{2};", nBinsChi2, chi2Bins); + hisFitBeamChi2DofUnmatched_[fitName] = + inputDir.make(addn("FitBeamChi2DofUnmatched"), "; Beam constr #Chi^{2}/DOF;", nBinsChi2, chi2dofBins); + } + profFitChi2VsEtaUnmatched_[fitName] = + inputDir.make(addn("FitChi2VsEtaUnmatched"), "; #eta; Fit #chi2", 24, 0., maxEta); + profFitChi2DofVsEtaUnmatched_[fitName] = + inputDir.make(addn("FitChi2DofVsEtaUnmatched"), "; #eta; Fit #chi2/dof", 24, 0., maxEta); + profFitChi2VsInvPtUnmatched_[fitName] = + inputDir.make(addn("FitChi2VsInvPtUnmatched"), "; 1/p_{T}; Fit #chi2", 25, 0., maxAbsQoverPt); + profFitChi2DofVsInvPtUnmatched_[fitName] = inputDir.make( + addn("FitChi2DofVsInvPtUnmatched"), "; 1/p_{T}; Fit #chi2/dof", 25, 0., maxAbsQoverPt); + + profFitChi2VsPurity_[fitName] = + inputDir.make(addn("FitChi2VsPurity"), "#Chi^{2} vs stub purity", 102, -0.01, 1.01); + profFitChi2DofVsPurity_[fitName] = + inputDir.make(addn("FitChi2DofVsPurity"), "#Chi^{2}/DOF vs stub purity", 102, -0.01, 1.01); + + // Monitoring specific track fit algorithms. + if (fitName.find("KF") != string::npos) { + hisKalmanNumUpdateCalls_[fitName] = + inputDir.make(addn("KalmanNumUpdateCalls"), "; Calls to KF updator;", 100, -0.5, 99.5); + hisKalmanChi2DofSkipLay0Matched_[fitName] = inputDir.make( + addn("KalmanChi2DofSkipLay0Matched"), ";#chi^{2} for nSkippedLayers = 0;", nBinsChi2, chi2Bins); + hisKalmanChi2DofSkipLay1Matched_[fitName] = inputDir.make( + addn("KalmanChi2DofSkipLay1Matched"), ";#chi^{2} for nSkippedLayers = 1;", nBinsChi2, chi2Bins); + hisKalmanChi2DofSkipLay2Matched_[fitName] = inputDir.make( + addn("KalmanChi2DofSkipLay2Matched"), ";#chi^{2} for nSkippedLayers = 2;", nBinsChi2, chi2Bins); + hisKalmanChi2DofSkipLay0Unmatched_[fitName] = inputDir.make( + addn("KalmanChi2DofSkipLay0Unmatched"), ";#chi^{2} for nSkippedLayers = 0;", nBinsChi2, chi2Bins); + hisKalmanChi2DofSkipLay1Unmatched_[fitName] = inputDir.make( + addn("KalmanChi2DofSkipLay1Unmatched"), ";#chi^{2} for nSkippedLayers = 1;", nBinsChi2, chi2Bins); + hisKalmanChi2DofSkipLay2Unmatched_[fitName] = inputDir.make( + addn("KalmanChi2DofSkipLay2Unmatched"), ";#chi^{2} for nSkippedLayers = 2;", nBinsChi2, chi2Bins); + } - const vector& fittedTracks = mFittedTracks.at(fitName); // Get fitted tracks. + // See how far stubs lie from fitted (or true) trajectory + hisDeltaPhitruePSbarrel_[fitName] = inputDir.make( + addn("DeltaPhitruePSbarrel"), "PS modules; ##sigma of true stubs from true traj. in phi;", 100, -5.0, 5.0); + hisDeltaRorZtruePSbarrel_[fitName] = inputDir.make( + addn("DeltaRorZtruePSbarrel"), "PS modules; ##sigma of true stubs from true traj. in r-z;", 100, -5.0, 5.0); + hisDeltaPhitrue2Sbarrel_[fitName] = inputDir.make( + addn("DeltaPhitrue2Sbarrel"), "2S modules; ##sigma of true stubs from true traj. in phi;", 100, -5.0, 5.0); + hisDeltaRorZtrue2Sbarrel_[fitName] = inputDir.make( + addn("DeltaRorZtrue2Sbarrel"), "2S modules; ##sigma of true stubs from true traj. in r-z;", 100, -5.0, 5.0); + hisDeltaPhitruePSendcap_[fitName] = inputDir.make( + addn("DeltaPhitruePSendcap"), "PS modules; ##sigma of true stubs from true traj. in phi;", 100, -5.0, 5.0); + hisDeltaRorZtruePSendcap_[fitName] = inputDir.make( + addn("DeltaRorZtruePSendcap"), "PS modules; ##sigma of true stubs from true traj. in r-z;", 100, -5.0, 5.0); + hisDeltaPhitrue2Sendcap_[fitName] = inputDir.make( + addn("DeltaPhitrue2Sendcap"), "2S modules; ##sigma of true stubs from true traj. in phi;", 100, -5.0, 5.0); + hisDeltaRorZtrue2Sendcap_[fitName] = inputDir.make( + addn("DeltaRorZtrue2Sendcap"), "2S modules; ##sigma of true stubs from true traj. in r-z;", 100, -5.0, 5.0); + hisDeltaPhifakePSbarrel_[fitName] = inputDir.make( + addn("DeltaPhifakePSbarrel"), "PS modules; ##sigma of fake stubs from true traj. in phi;", 100, -5.0, 5.0); + hisDeltaRorZfakePSbarrel_[fitName] = inputDir.make( + addn("DeltaRorZfakePSbarrel"), "PS modules; ##sigma of fake stubs from true traj. in r-z;", 100, -5.0, 5.0); + hisDeltaPhifake2Sbarrel_[fitName] = inputDir.make( + addn("DeltaPhifake2Sbarrel"), "2S modules; ##sigma of fake stubs from true traj. in phi;", 100, -5.0, 5.0); + hisDeltaRorZfake2Sbarrel_[fitName] = inputDir.make( + addn("DeltaRorZfake2Sbarrel"), "2S modules; ##sigma of fake stubs from true traj. in r-z;", 100, -5.0, 5.0); + hisDeltaPhifakePSendcap_[fitName] = inputDir.make( + addn("DeltaPhifakePSendcap"), "PS modules; ##sigma of fake stubs from true traj. in phi;", 100, -5.0, 5.0); + hisDeltaRorZfakePSendcap_[fitName] = inputDir.make( + addn("DeltaRorZfakePSendcap"), "PS modules; ##sigma of fake stubs from true traj. in r-z;", 100, -5.0, 5.0); + hisDeltaPhifake2Sendcap_[fitName] = inputDir.make( + addn("DeltaPhifake2Sendcap"), "2S modules; ##sigma of fake stubs from true traj. in phi;", 100, -5.0, 5.0); + hisDeltaRorZfake2Sendcap_[fitName] = inputDir.make( + addn("DeltaRorZfake2Sendcap"), "2S modules; ##sigma of fake stubs from true traj. in r-z;", 100, -5.0, 5.0); + profRecalcRphiChi2VsEtaTrue1_[fitName] = + inputDir.make(addn("RecalcRphiChi2VsEtaTrue1"), + "; #eta; Recalculated r-#phi #chi2 method 1 for matched tracks", + 24, + 0., + maxEta); + profRecalcRzChi2VsEtaTrue1_[fitName] = inputDir.make( + addn("RecalcRzChi2VsEtaTrue1"), "; #eta; Recalculated r-z #chi2 method 1 for matched tracks", 24, 0., maxEta); + profRecalcChi2VsEtaTrue1_[fitName] = inputDir.make( + addn("RecalcChi2VsEtaTrue1"), "; #eta; Recalculated #chi2 method 1 for matched tracks", 24, 0., maxEta); + profRecalcChi2VsEtaTrue2_[fitName] = inputDir.make( + addn("RecalcChi2VsEtaTrue2"), "; #eta; Recalculated #chi2 method 2 for matched tracks", 24, 0., maxEta); + profNsigmaPhivsInvPt_[fitName] = inputDir.make( + addn("NsigmaPhivsInvPt"), "; 1/Pt; Num #sigma of true stubs from true traj.", 16, 0., maxAbsQoverPt); + profNsigmaPhivsR_[fitName] = + inputDir.make(addn("NsigmaPhivsR"), "; r; Num #sigma of true stubs from true traj.", 22, 0., 110.); + profNsigmaPhivsTanl_[fitName] = inputDir.make( + addn("NsigmaPhivsTanl"), "; tan #lambda; Num #sigma of true stubs from true traj.", 20, 0., 6.); + + hisFitVsSeedQinvPtMatched_[fitName] = inputDir.make(addn("FitVsSeedQinvPtMatched"), + "; Seed q/p_{T} (Genuine Cand); Fitted q/p_{T}", + 120, + -0.6, + 0.6, + 120, + -0.6, + 0.6); + hisFitVsSeedPhi0Matched_[fitName] = inputDir.make( + addn("FitVsSeedPhi0Matched"), "; Seed #phi_{0} (Genuine Cand); Fitted #phi_{0}", 70, -3.5, 3.5, 70, -3.5, 3.5); + hisFitVsSeedD0Matched_[fitName] = inputDir.make( + addn("FitVsSeedD0Matched"), "; Seed d_{0} (Genuine Cand); Fitted d_{0}", 100, -2., 2., 100, -2., 2.); + hisFitVsSeedZ0Matched_[fitName] = inputDir.make( + addn("FitVsSeedZ0Matched"), "; Seed z_{0} (Genuine Cand); Fitted z_{0}", 100, -25., 25., 100, -25., 25.); + hisFitVsSeedEtaMatched_[fitName] = inputDir.make( + addn("FitVsSeedEtaMatched"), "; Seed #eta (Genuine Cand); Fitted #eta", 70, -3.5, 3.5, 70, -3.5, 3.5); + + hisFitVsSeedQinvPtUnmatched_[fitName] = inputDir.make(addn("FitVsSeedQinvPtUnmatched"), + "; Seed q/p_{T} (Fake Cand); Fitted q/p_{T}", + 120, + -0.6, + 0.6, + 120, + -0.6, + 0.6); + hisFitVsSeedPhi0Unmatched_[fitName] = inputDir.make( + addn("FitVsSeedPhi0Unmatched"), "; Seed #phi_{0} (Fake Cand); Fitted #phi_{0}", 70, -3.5, 3.5, 70, -3.5, 3.5); + hisFitVsSeedD0Unmatched_[fitName] = inputDir.make( + addn("FitVsSeedD0Unmatched"), "; Seed d_{0} (Fake Cand); Fitted d_{0}", 100, -2., 2., 100, -2., 2.); + hisFitVsSeedZ0Unmatched_[fitName] = inputDir.make( + addn("FitVsSeedZ0Unmatched"), "; Seed z_{0} (Fake Cand); Fitted z_{0}", 100, -25., 25., 100, -25., 25.); + hisFitVsSeedEtaUnmatched_[fitName] = inputDir.make( + addn("FitVsSeedEtaUnmatched"), "; Seed #eta (Fake Cand); Fitted #eta", 70, -3.5, 3.5, 70, -3.5, 3.5); + + hisNumStubsVsPurityMatched_[fitName] = inputDir.make( + addn("NumStubsVsPurityMatched"), "; Purity; Number of stubs", 102, -0.01, 1.01, 30, 0.0, 30.0); + profFitFracTrueStubsVsLayerMatched_[fitName] = inputDir.make( + addn("FitFracTrueStubsVsLayerMatched"), ";Layer ID; fraction of true stubs", 30, 0.5, 30.5); + profFitFracTrueStubsVsEtaMatched_[fitName] = + inputDir.make(addn("FitFracTrueStubsVsEtaMatched"), ";#eta; fraction of true stubs", 24, 0., 3.); + + // Plots of helix param resolution. + + hisFitVsTrueQinvPt_[fitName] = inputDir.make( + addn("FitVsTrueQinvPt"), "; TP q/p_{T}; Fitted q/p_{T} (good #chi^{2})", 120, -0.6, 0.6, 120, -0.6, 0.6); + hisFitVsTruePhi0_[fitName] = inputDir.make( + addn("FitVsTruePhi0"), "; TP #phi_{0}; Fitted #phi_{0} (good #chi^{2})", 70, -3.5, 3.5, 70, -3.5, 3.5); + hisFitVsTrueD0_[fitName] = inputDir.make( + addn("FitVsTrueD0"), "; TP d_{0}; Fitted d_{0} (good #chi^{2})", 100, -2., 2., 100, -2., 2.); + hisFitVsTrueZ0_[fitName] = inputDir.make( + addn("FitVsTrueZ0"), "; TP z_{0}; Fitted z_{0} (good #chi^{2})", 100, -25., 25., 100, -25., 25.); + hisFitVsTrueEta_[fitName] = inputDir.make( + addn("FitVsTrueEta"), "; TP #eta; Fitted #eta (good #chi^{2})", 70, -3.5, 3.5, 70, -3.5, 3.5); + + hisFitQinvPtRes_[fitName] = + inputDir.make(addn("FitQinvPtRes"), "Fitted minus true q/p_{T} (good #chi^{2})", 100, -0.1, 0.1); + hisFitPhi0Res_[fitName] = + inputDir.make(addn("FitPhi0Res"), "Fitted minus true #phi_{0} (good #chi^{2})", 100, -0.02, 0.02); + hisFitD0Res_[fitName] = + inputDir.make(addn("FitD0Res"), "Fitted minus true d_{0} (good #chi^{2})", 100, -0.2, 0.2); + hisFitZ0Res_[fitName] = + inputDir.make(addn("FitZ0Res"), "Fitted minus true z_{0} (good #chi^{2})", 100, -2., 2.); + hisFitEtaRes_[fitName] = + inputDir.make(addn("FitEtaRes"), "Fitted minus true #eta (good #chi^{2})", 100, -0.02, 0.02); + + hisQoverPtResVsTrueEta_[fitName] = inputDir.make( + addn("QoverPtResVsTrueEta"), "q/p_{T} resolution; |#eta|; q/p_{T} resolution", 24, 0.0, maxEta); + hisPhi0ResVsTrueEta_[fitName] = inputDir.make( + addn("PhiResVsTrueEta"), "#phi_{0} resolution; |#eta|; #phi_{0} resolution", 24, 0.0, maxEta); + hisEtaResVsTrueEta_[fitName] = + inputDir.make(addn("EtaResVsTrueEta"), "#eta resolution; |#eta|; #eta resolution", 24, 0.0, maxEta); + hisZ0ResVsTrueEta_[fitName] = inputDir.make( + addn("Z0ResVsTrueEta"), "z_{0} resolution; |#eta|; z_{0} resolution", 24, 0.0, maxEta); + hisD0ResVsTrueEta_[fitName] = inputDir.make( + addn("D0ResVsTrueEta"), "d_{0} resolution; |#eta|; d_{0} resolution", 24, 0.0, maxEta); + + hisQoverPtResVsTrueInvPt_[fitName] = inputDir.make( + addn("QoverPtResVsTrueInvPt"), "q/p_{T} resolution; 1/p_{T}; q/p_{T} resolution", 25, 0.0, maxAbsQoverPt); + hisPhi0ResVsTrueInvPt_[fitName] = inputDir.make( + addn("PhiResVsTrueInvPt"), "#phi_{0} resolution; 1/p_{T}; #phi_{0} resolution", 25, 0.0, maxAbsQoverPt); + hisEtaResVsTrueInvPt_[fitName] = inputDir.make( + addn("EtaResVsTrueInvPt"), "#eta resolution; 1/p_{T}; #eta resolution", 25, 0.0, maxAbsQoverPt); + hisZ0ResVsTrueInvPt_[fitName] = inputDir.make( + addn("Z0ResVsTrueInvPt"), "z_{0} resolution; 1/p_{T}; z_{0} resolution", 25, 0.0, maxAbsQoverPt); + hisD0ResVsTrueInvPt_[fitName] = inputDir.make( + addn("D0ResVsTrueInvPt"), "d_{0} resolution; 1/p_{T}; d_{0} resolution", 25, 0.0, maxAbsQoverPt); + + if (settings_->kalmanAddBeamConstr() && + fitName.find("KF5") != + string::npos) { // Histograms of resolution with beam-spot constraint only make sense for 5 param fit. + hisQoverPtResBeamVsTrueEta_[fitName] = + inputDir.make(addn("QoverPtResBeamVsTrueEta"), + "q/p_{T} resolution with beam constr; |#eta|; q/p_{T} resolution", + 24, + 0.0, + maxEta); + hisPhi0ResBeamVsTrueEta_[fitName] = + inputDir.make(addn("PhiResBeamVsTrueEta"), + "#phi_{0} resolution with beam constr; |#eta|; #phi_{0} resolution", + 24, + 0.0, + maxEta); + + hisQoverPtResBeamVsTrueInvPt_[fitName] = + inputDir.make(addn("QoverPtResBeamVsTrueInvPt"), + "q/p_{T} resolution with beam constr; 1/p_{T}; q/p_{T} resolution", + 25, + 0.0, + maxAbsQoverPt); + hisPhi0ResBeamVsTrueInvPt_[fitName] = + inputDir.make(addn("PhiResBeamVsTrueInvPt"), + "#phi_{0} resolution with beam constr; 1/p_{T}; #phi_{0} resolution", + 25, + 0.0, + maxAbsQoverPt); + } - // Count tracks - unsigned int nFitTracks = 0; - unsigned int nFitsMatchingTP = 0; + // Duplicate track histos. + profDupFitTrksVsEta_[fitName] = + inputDir.make(addn("DupFitTrksVsEta"), "; #eta; No. of duplicate tracks per TP", 12, 0., 3.); + profDupFitTrksVsInvPt_[fitName] = inputDir.make( + addn("DupFitTrksVsInvPt"), "; 1/Pt; No. of duplicate tracks per TP", houghNbinsPt_, 0., maxAbsQoverPt); + + // Histos for tracking efficiency vs. TP kinematics. (Binning must match similar histos in bookTrackCands()). + hisFitTPinvptForEff_[fitName] = inputDir.make( + addn("FitTPinvptForEff"), "; 1/Pt of TP (used for effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); + hisFitTPptForEff_[fitName] = + inputDir.make(addn("FitTPptForEff"), "; Pt of TP (used for effi. measurement);", 25, 0.0, 100.0); + hisFitTPetaForEff_[fitName] = + inputDir.make(addn("FitTPetaForEff"), "; #eta of TP (used for effi. measurement);", 20, -3., 3.); + hisFitTPphiForEff_[fitName] = + inputDir.make(addn("FitTPphiForEff"), "; #phi of TP (used for effi. measurement);", 20, -M_PI, M_PI); + + // Histo for efficiency to reconstruct track perfectly (no incorrect hits). (Binning must match similar histos in bookTrackCands()). + hisPerfFitTPinvptForEff_[fitName] = inputDir.make( + addn("PerfFitTPinvptForEff"), "; 1/Pt of TP (used for perf. effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); + hisPerfFitTPptForEff_[fitName] = inputDir.make( + addn("PerfFitTPptForEff"), "; Pt of TP (used for perf. effi. measurement);", 25, 0.0, 100.0); + hisPerfFitTPetaForEff_[fitName] = inputDir.make( + addn("PerfFitTPetaForEff"), "; #eta of TP (used for perfect effi. measurement);", 20, -3., 3.); + + // Histos for tracking efficiency vs. TP production point. (Binning must match similar histos in bookTrackCands()). + hisFitTPd0ForEff_[fitName] = + inputDir.make(addn("FitTPd0ForEff"), "; d0 of TP (used for effi. measurement);", 40, 0., 4.); + hisFitTPz0ForEff_[fitName] = + inputDir.make(addn("FitTPz0ForEff"), "; z0 of TP (used for effi. measurement);", 50, 0., 25.); + + // Histos for algorithmic tracking efficiency vs. TP kinematics. (Binning must match similar histos in bookTrackCands()). + hisFitTPinvptForAlgEff_[fitName] = inputDir.make( + addn("FitTPinvptForAlgEff"), "; 1/Pt of TP (used for alg. effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); + hisFitTPptForAlgEff_[fitName] = inputDir.make( + addn("FitTPptForAlgEff"), "; Pt of TP (used for alg. effi. measurement);", 25, 0.0, 100.0); + hisFitTPetaForAlgEff_[fitName] = inputDir.make( + addn("FitTPetaForAlgEff"), "; #eta of TP (used for alg. effi. measurement);", 20, -3., 3.); + hisFitTPphiForAlgEff_[fitName] = inputDir.make( + addn("FitTPphiForAlgEff"), "; #phi of TP (used for alg. effi. measurement);", 20, -M_PI, M_PI); + + // Histo for efficiency to reconstruct track perfectly (no incorrect hits). (Binning must match similar histos in bookTrackCands()). + hisPerfFitTPinvptForAlgEff_[fitName] = + inputDir.make(addn("PerfFitTPinvptForAlgEff"), + "; 1/Pt of TP (used for perf. alg. effi. measurement);", + 24, + 0., + 1.5 * maxAbsQoverPt); + hisPerfFitTPptForAlgEff_[fitName] = inputDir.make( + addn("PerfFitTPptForAlgEff"), "; Pt of TP (used for perf. alg. effi. measurement);", 25, 0.0, 100.0); + hisPerfFitTPetaForAlgEff_[fitName] = inputDir.make( + addn("PerfFitTPetaForAlgEff"), "; #eta of TP (used for perf. alg. effi. measurement);", 20, -3., 3.); + + // Ditto for tracks inside jets. + hisPerfFitTPinvptForAlgEff_inJetPtG30_[fitName] = + inputDir.make(addn("PerfFitTPinvptForAlgEff_inJetPtG30"), + "; 1/Pt of TP (used for perf. alg. effi. measurement);", + 24, + 0., + 1.5 * maxAbsQoverPt); + hisPerfFitTPinvptForAlgEff_inJetPtG100_[fitName] = + inputDir.make(addn("PerfFitTPinvptForAlgEff_inJetPtG100"), + "; 1/Pt of TP (used for perf. alg. effi. measurement);", + 24, + 0., + 1.5 * maxAbsQoverPt); + hisPerfFitTPinvptForAlgEff_inJetPtG200_[fitName] = + inputDir.make(addn("PerfFitTPinvptForAlgEff_inJetPtG200"), + "; 1/Pt of TP (used for perf. alg. effi. measurement);", + 24, + 0., + 1.5 * maxAbsQoverPt); + + // Histos for algorithmic tracking efficiency vs. TP production point. (Binning must match similar histos in bookTrackCands()). + hisFitTPd0ForAlgEff_[fitName] = + inputDir.make(addn("FitTPd0ForAlgEff"), "; d0 of TP (used for alg. effi. measurement);", 40, 0., 4.); + hisFitTPz0ForAlgEff_[fitName] = + inputDir.make(addn("FitTPz0ForAlgEff"), "; z0 of TP (used for alg. effi. measurement);", 50, 0., 25.); + + // Histo for algorithmic tracking efficiency vs sector number (to check if looser cuts are needed in certain regions) + unsigned int nPhi = numPhiSectors_; + unsigned int nEta = numEtaRegions_; + hisFitTPphisecForAlgEff_[fitName] = inputDir.make(addn("FitTPphisecForAlgEff"), + "; #phi sector of TP (used for alg. effi. measurement);", + nPhi, + -0.5, + nPhi - 0.5); + hisFitTPetasecForAlgEff_[fitName] = inputDir.make(addn("FitTPetasecForAlgEff"), + "; #eta sector of TP (used for alg. effi. measurement);", + nEta, + -0.5, + nEta - 0.5); + hisPerfFitTPphisecForAlgEff_[fitName] = + inputDir.make(addn("PerfFitTPphisecForAlgEff"), + "; #phi sector of TP (used for perf. alg. effi. measurement);", + nPhi, + -0.5, + nPhi - 0.5); + hisPerfFitTPetasecForAlgEff_[fitName] = + inputDir.make(addn("PerfFitTPetasecForAlgEff"), + "; #eta sector of TP (used for perf. alg. effi. measurement);", + nEta, + -0.5, + nEta - 0.5); + } - const unsigned int numPhiNonants = settings_->numPhiNonants(); - vector nFitTracksPerNonant(numPhiNonants,0); - map, unsigned int> nFitTracksPerSector; + return inputDirMap; + } - for (const L1fittedTrack& fitTrk : fittedTracks) { - nFitTracks++; - // Get matched truth particle, if any. - const TP* tp = fitTrk.getMatchedTP(); - if (tp != nullptr) nFitsMatchingTP++; - // Count fitted tracks per nonant. - unsigned int iNonant = ( numPhiSectors_ > 0 ) ? floor(fitTrk.iPhiSec()*numPhiNonants/(numPhiSectors_)) : 0; // phi nonant number - nFitTracksPerNonant[iNonant]++; - nFitTracksPerSector[pair(fitTrk.iPhiSec(), fitTrk.iEtaReg())]++; - } + //=== Fill histograms for studying track fitting. - profNumFitTracks_[fitName]->Fill(1, nFitTracks); - profNumFitTracks_[fitName]->Fill(2, nFitsMatchingTP); + void Histos::fillTrackFitting(const InputData& inputData, const map>& mFittedTracks) { + const vector& vTPs = inputData.getTPs(); - hisNumFitTrks_[fitName]->Fill(nFitTracks); - for (const unsigned int& num : nFitTracksPerNonant) { - hisNumFitTrksPerNon_[fitName]->Fill(num); - } - for (const auto& p : nFitTracksPerSector) { - hisNumFitTrksPerSect_[fitName]->Fill(p.second); - } + // Loop over all the fitting algorithms we are trying. + for (const string& fitName : trackFitters_) { + const vector& fittedTracks = mFittedTracks.at(fitName); // Get fitted tracks. - // Count stubs assigned to fitted tracks. - unsigned int nTotStubs = 0; - for (const L1fittedTrack& fitTrk : fittedTracks) { - unsigned int nStubs = fitTrk.getNumStubs(); - hisStubsPerFitTrack_[fitName]->Fill(nStubs); - nTotStubs += nStubs; - } - profStubsOnFitTracks_[fitName]->Fill(1., nTotStubs); + // Count tracks + unsigned int nFitTracks = 0; + unsigned int nFitsMatchingTP = 0; - // Note truth particles that are successfully fitted. And which give rise to duplicate tracks. + const unsigned int numPhiNonants = settings_->numPhiNonants(); + vector nFitTracksPerNonant(numPhiNonants, 0); + map, unsigned int> nFitTracksPerSector; - map tpRecoedMap; // Note which truth particles were successfully fitted. - map tpPerfRecoedMap; // Note which truth particles were successfully fitted with no incorrect hits. - map tpRecoedDup; // Note that this TP gave rise to duplicate tracks. - for (const TP& tp: vTPs) { - tpRecoedMap[&tp] = false; - tpPerfRecoedMap[&tp] = false; - unsigned int nMatch = 0; for (const L1fittedTrack& fitTrk : fittedTracks) { - const TP* assocTP = fitTrk.getMatchedTP(); // Get the TP the fitted track matches to, if any. - if (assocTP == &tp) { - tpRecoedMap[&tp] = true; - if (fitTrk.getPurity() == 1.) tpPerfRecoedMap[&tp] = true; - nMatch++; - } + nFitTracks++; + // Get matched truth particle, if any. + const TP* tp = fitTrk.getMatchedTP(); + if (tp != nullptr) + nFitsMatchingTP++; + // Count fitted tracks per nonant. + unsigned int iNonant = + (numPhiSectors_ > 0) ? floor(fitTrk.iPhiSec() * numPhiNonants / (numPhiSectors_)) : 0; // phi nonant number + nFitTracksPerNonant[iNonant]++; + nFitTracksPerSector[pair(fitTrk.iPhiSec(), fitTrk.iEtaReg())]++; } - tpRecoedDup[&tp] = nMatch; - } - // Count truth particles that are successfully fitted. + profNumFitTracks_[fitName]->Fill(1, nFitTracks); + profNumFitTracks_[fitName]->Fill(2, nFitsMatchingTP); - unsigned int nFittedTPs = 0; - unsigned int nFittedTPsForEff = 0; - for (const TP& tp: vTPs) { - if (tpRecoedMap[&tp]) { // Was this truth particle successfully fitted? - nFittedTPs++; - if (tp.useForEff()) nFittedTPsForEff++; - } - } - - profNumFitTracks_[fitName]->Fill(6, nFittedTPs); - profNumFitTracks_[fitName]->Fill(7, nFittedTPsForEff); + hisNumFitTrks_[fitName]->Fill(nFitTracks); + for (const unsigned int& num : nFitTracksPerNonant) { + hisNumFitTrksPerNon_[fitName]->Fill(num); + } + for (const auto& p : nFitTracksPerSector) { + hisNumFitTrksPerSect_[fitName]->Fill(p.second); + } - // Loop over fitted tracks again. + // Count stubs assigned to fitted tracks. + unsigned int nTotStubs = 0; + for (const L1fittedTrack& fitTrk : fittedTracks) { + unsigned int nStubs = fitTrk.getNumStubs(); + hisStubsPerFitTrack_[fitName]->Fill(nStubs); + nTotStubs += nStubs; + } + profStubsOnFitTracks_[fitName]->Fill(1., nTotStubs); + + // Note truth particles that are successfully fitted. And which give rise to duplicate tracks. + + map tpRecoedMap; // Note which truth particles were successfully fitted. + map + tpPerfRecoedMap; // Note which truth particles were successfully fitted with no incorrect hits. + map tpRecoedDup; // Note that this TP gave rise to duplicate tracks. + for (const TP& tp : vTPs) { + tpRecoedMap[&tp] = false; + tpPerfRecoedMap[&tp] = false; + unsigned int nMatch = 0; + for (const L1fittedTrack& fitTrk : fittedTracks) { + const TP* assocTP = fitTrk.getMatchedTP(); // Get the TP the fitted track matches to, if any. + if (assocTP == &tp) { + tpRecoedMap[&tp] = true; + if (fitTrk.getPurity() == 1.) + tpPerfRecoedMap[&tp] = true; + nMatch++; + } + } + tpRecoedDup[&tp] = nMatch; + } - for (const L1fittedTrack& fitTrk : fittedTracks) { + // Count truth particles that are successfully fitted. - // Info for specific track fit algorithms. - unsigned int nSkippedLayers = 0; - unsigned int numUpdateCalls = 0; - if (fitName.find("KF") != string::npos) { - fitTrk.getInfoKF(nSkippedLayers, numUpdateCalls); - hisKalmanNumUpdateCalls_[fitName]->Fill(numUpdateCalls); + unsigned int nFittedTPs = 0; + unsigned int nFittedTPsForEff = 0; + for (const TP& tp : vTPs) { + if (tpRecoedMap[&tp]) { // Was this truth particle successfully fitted? + nFittedTPs++; + if (tp.useForEff()) + nFittedTPsForEff++; + } } - //--- Compare fitted tracks that match truth particles to those that don't. + profNumFitTracks_[fitName]->Fill(6, nFittedTPs); + profNumFitTracks_[fitName]->Fill(7, nFittedTPsForEff); - // Get original HT track candidate prior to fit for comparison. - const L1track3D& htTrk = fitTrk.getL1track3D(); + // Loop over fitted tracks again. - // Get matched truth particle, if any. - const TP* tp = fitTrk.getMatchedTP(); + for (const L1fittedTrack& fitTrk : fittedTracks) { + // Info for specific track fit algorithms. + unsigned int nSkippedLayers = 0; + unsigned int numUpdateCalls = 0; + if (fitName.find("KF") != string::npos) { + fitTrk.getInfoKF(nSkippedLayers, numUpdateCalls); + hisKalmanNumUpdateCalls_[fitName]->Fill(numUpdateCalls); + } - if (tp != nullptr) { - hisFitQinvPtMatched_[fitName]->Fill( fitTrk.qOverPt() ); - hisFitPhi0Matched_[fitName]->Fill( fitTrk.phi0() ); - hisFitD0Matched_[fitName]->Fill( fitTrk.d0() ); - hisFitZ0Matched_[fitName]->Fill( fitTrk.z0() ); - hisFitEtaMatched_[fitName]->Fill( fitTrk.eta() ); - - hisFitChi2Matched_[fitName]->Fill( fitTrk.chi2() ); - hisFitChi2DofMatched_[fitName]->Fill( fitTrk.chi2dof() ); - hisFitChi2DofRphiMatched_[fitName]->Fill( fitTrk.chi2rphi() / fitTrk.numDOFrphi()); - hisFitChi2DofRzMatched_[fitName]->Fill( fitTrk.chi2rz() / fitTrk.numDOFrz()); - if (settings_->kalmanAddBeamConstr() && fitName.find("KF5") != string::npos) { // Histograms of chi2 with beam-spot constraint only make sense for 5 param fit. - hisFitBeamChi2Matched_[fitName]->Fill( fitTrk.chi2_bcon() ); - hisFitBeamChi2DofMatched_[fitName]->Fill( fitTrk.chi2dof_bcon() ); - } - profFitChi2VsEtaMatched_[fitName]->Fill( fabs(fitTrk.eta()), fitTrk.chi2() ); - profFitChi2DofVsEtaMatched_[fitName]->Fill( fabs(fitTrk.eta()), fitTrk.chi2dof() ); - profFitChi2VsInvPtMatched_[fitName]->Fill( fabs(fitTrk.qOverPt()), fitTrk.chi2() ); - profFitChi2DofVsInvPtMatched_[fitName]->Fill( fabs(fitTrk.qOverPt()), fitTrk.chi2dof() ); - profFitChi2VsTrueD0Matched_[fitName]->Fill( fabs(tp->d0()), fitTrk.chi2() ); - profFitChi2DofVsTrueD0Matched_[fitName]->Fill( fabs(tp->d0()), fitTrk.chi2dof() ); - - // Check chi2/dof for perfectly reconstructed tracks. - if (fitTrk.getPurity() == 1.) { - hisFitChi2PerfMatched_[fitName]->Fill( fitTrk.chi2() ); - hisFitChi2DofPerfMatched_[fitName]->Fill( fitTrk.chi2dof() ); - } - - if (fitName.find("KF") != string::npos) { - // No. of skipped layers on track during Kalman track fit. - if (nSkippedLayers == 0) { - hisKalmanChi2DofSkipLay0Matched_[fitName]->Fill(fitTrk.chi2dof()); - } else if (nSkippedLayers == 1) { - hisKalmanChi2DofSkipLay1Matched_[fitName]->Fill(fitTrk.chi2dof()); - } else if (nSkippedLayers >= 2) { - hisKalmanChi2DofSkipLay2Matched_[fitName]->Fill(fitTrk.chi2dof()); - } - } - - // Compared fitted track helix params with seed track from HT. - hisFitVsSeedQinvPtMatched_[fitName]->Fill( htTrk.qOverPt(), fitTrk.qOverPt() ); - hisFitVsSeedPhi0Matched_[fitName]->Fill( htTrk.phi0(), fitTrk.phi0() ); - hisFitVsSeedD0Matched_[fitName]->Fill( htTrk.d0(), fitTrk.d0() ); - hisFitVsSeedZ0Matched_[fitName]->Fill( htTrk.z0(), fitTrk.z0() ); - hisFitVsSeedEtaMatched_[fitName]->Fill( htTrk.eta(), fitTrk.eta() ); - - // Study incorrect hits on matched tracks. - hisNumStubsVsPurityMatched_[fitName]->Fill( fitTrk.getNumStubs(), fitTrk.getPurity() ); - - const vector stubs = fitTrk.getStubs(); - for (const Stub* s : stubs) { - // Was this stub produced by correct truth particle? - const set stubTPs = s->assocTPs(); - bool trueStub = (stubTPs.find(tp) != stubTPs.end()); - profFitFracTrueStubsVsLayerMatched_[fitName]->Fill(s->layerId(), trueStub); - profFitFracTrueStubsVsEtaMatched_[fitName]->Fill(fabs(s->eta()), trueStub); - } + //--- Compare fitted tracks that match truth particles to those that don't. + + // Get original HT track candidate prior to fit for comparison. + const L1track3D& htTrk = fitTrk.getL1track3D(); + + // Get matched truth particle, if any. + const TP* tp = fitTrk.getMatchedTP(); + + if (tp != nullptr) { + hisFitQinvPtMatched_[fitName]->Fill(fitTrk.qOverPt()); + hisFitPhi0Matched_[fitName]->Fill(fitTrk.phi0()); + hisFitD0Matched_[fitName]->Fill(fitTrk.d0()); + hisFitZ0Matched_[fitName]->Fill(fitTrk.z0()); + hisFitEtaMatched_[fitName]->Fill(fitTrk.eta()); + + hisFitChi2Matched_[fitName]->Fill(fitTrk.chi2()); + hisFitChi2DofMatched_[fitName]->Fill(fitTrk.chi2dof()); + hisFitChi2DofRphiMatched_[fitName]->Fill(fitTrk.chi2rphi() / fitTrk.numDOFrphi()); + hisFitChi2DofRzMatched_[fitName]->Fill(fitTrk.chi2rz() / fitTrk.numDOFrz()); + if (settings_->kalmanAddBeamConstr() && + fitName.find("KF5") != + string::npos) { // Histograms of chi2 with beam-spot constraint only make sense for 5 param fit. + hisFitBeamChi2Matched_[fitName]->Fill(fitTrk.chi2_bcon()); + hisFitBeamChi2DofMatched_[fitName]->Fill(fitTrk.chi2dof_bcon()); + } + profFitChi2VsEtaMatched_[fitName]->Fill(fabs(fitTrk.eta()), fitTrk.chi2()); + profFitChi2DofVsEtaMatched_[fitName]->Fill(fabs(fitTrk.eta()), fitTrk.chi2dof()); + profFitChi2VsInvPtMatched_[fitName]->Fill(fabs(fitTrk.qOverPt()), fitTrk.chi2()); + profFitChi2DofVsInvPtMatched_[fitName]->Fill(fabs(fitTrk.qOverPt()), fitTrk.chi2dof()); + profFitChi2VsTrueD0Matched_[fitName]->Fill(fabs(tp->d0()), fitTrk.chi2()); + profFitChi2DofVsTrueD0Matched_[fitName]->Fill(fabs(tp->d0()), fitTrk.chi2dof()); + + // Check chi2/dof for perfectly reconstructed tracks. + if (fitTrk.getPurity() == 1.) { + hisFitChi2PerfMatched_[fitName]->Fill(fitTrk.chi2()); + hisFitChi2DofPerfMatched_[fitName]->Fill(fitTrk.chi2dof()); + } - } else { - hisFitQinvPtUnmatched_[fitName]->Fill( fitTrk.qOverPt() ); - hisFitPhi0Unmatched_[fitName]->Fill( fitTrk.phi0() ); - hisFitD0Unmatched_[fitName]->Fill( fitTrk.d0() ); - hisFitZ0Unmatched_[fitName]->Fill( fitTrk.z0() ); - hisFitEtaUnmatched_[fitName]->Fill( fitTrk.eta() ); - - hisFitChi2Unmatched_[fitName]->Fill( fitTrk.chi2() ); - hisFitChi2DofUnmatched_[fitName]->Fill( fitTrk.chi2dof() ); - hisFitChi2DofRphiUnmatched_[fitName]->Fill( fitTrk.chi2rphi() / fitTrk.numDOFrphi()); - hisFitChi2DofRzUnmatched_[fitName]->Fill( fitTrk.chi2rz() / fitTrk.numDOFrz()); - if (settings_->kalmanAddBeamConstr() && fitName.find("KF5") != string::npos) { // Histograms of chi2 with beam-spot constraint only make sense for 5 param fit. - hisFitBeamChi2Unmatched_[fitName]->Fill( fitTrk.chi2_bcon() ); - hisFitBeamChi2DofUnmatched_[fitName]->Fill( fitTrk.chi2dof_bcon() ); - } - profFitChi2VsEtaUnmatched_[fitName]->Fill( fabs(fitTrk.eta()), fitTrk.chi2() ); - profFitChi2DofVsEtaUnmatched_[fitName]->Fill( fabs(fitTrk.eta()), fitTrk.chi2dof() ); - profFitChi2VsInvPtUnmatched_[fitName]->Fill( fabs(fitTrk.qOverPt()), fitTrk.chi2() ); - profFitChi2DofVsInvPtUnmatched_[fitName]->Fill( fabs(fitTrk.qOverPt()), fitTrk.chi2dof() ); - - if (fitName.find("KF") != string::npos) { - // No. of skipped layers on track during Kalman track fit. - if (nSkippedLayers == 0) { - hisKalmanChi2DofSkipLay0Unmatched_[fitName]->Fill(fitTrk.chi2dof()); - } else if (nSkippedLayers == 1) { - hisKalmanChi2DofSkipLay1Unmatched_[fitName]->Fill(fitTrk.chi2dof()); - } else if (nSkippedLayers >= 2) { - hisKalmanChi2DofSkipLay2Unmatched_[fitName]->Fill(fitTrk.chi2dof()); - } - } - - hisFitVsSeedQinvPtUnmatched_[fitName]->Fill( htTrk.qOverPt(), fitTrk.qOverPt() ); - hisFitVsSeedPhi0Unmatched_[fitName]->Fill( htTrk.phi0(), fitTrk.phi0() ); - hisFitVsSeedD0Unmatched_[fitName]->Fill( htTrk.d0(), fitTrk.d0() ); - hisFitVsSeedZ0Unmatched_[fitName]->Fill( htTrk.z0(), fitTrk.z0() ); - hisFitVsSeedEtaUnmatched_[fitName]->Fill( htTrk.eta(), fitTrk.eta() ); - } + if (fitName.find("KF") != string::npos) { + // No. of skipped layers on track during Kalman track fit. + if (nSkippedLayers == 0) { + hisKalmanChi2DofSkipLay0Matched_[fitName]->Fill(fitTrk.chi2dof()); + } else if (nSkippedLayers == 1) { + hisKalmanChi2DofSkipLay1Matched_[fitName]->Fill(fitTrk.chi2dof()); + } else if (nSkippedLayers >= 2) { + hisKalmanChi2DofSkipLay2Matched_[fitName]->Fill(fitTrk.chi2dof()); + } + } - // Study how incorrect stubs on track affect fit chi2. - profFitChi2VsPurity_[fitName]->Fill( fitTrk.getPurity(), fitTrk.chi2()); - profFitChi2DofVsPurity_[fitName]->Fill( fitTrk.getPurity(), fitTrk.chi2dof()); + // Compared fitted track helix params with seed track from HT. + hisFitVsSeedQinvPtMatched_[fitName]->Fill(htTrk.qOverPt(), fitTrk.qOverPt()); + hisFitVsSeedPhi0Matched_[fitName]->Fill(htTrk.phi0(), fitTrk.phi0()); + hisFitVsSeedD0Matched_[fitName]->Fill(htTrk.d0(), fitTrk.d0()); + hisFitVsSeedZ0Matched_[fitName]->Fill(htTrk.z0(), fitTrk.z0()); + hisFitVsSeedEtaMatched_[fitName]->Fill(htTrk.eta(), fitTrk.eta()); + + // Study incorrect hits on matched tracks. + hisNumStubsVsPurityMatched_[fitName]->Fill(fitTrk.getNumStubs(), fitTrk.getPurity()); + + const vector stubs = fitTrk.getStubs(); + for (const Stub* s : stubs) { + // Was this stub produced by correct truth particle? + const set stubTPs = s->assocTPs(); + bool trueStub = (stubTPs.find(tp) != stubTPs.end()); + profFitFracTrueStubsVsLayerMatched_[fitName]->Fill(s->layerId(), trueStub); + profFitFracTrueStubsVsEtaMatched_[fitName]->Fill(fabs(s->eta()), trueStub); + } - // Look at stub residuals w.r.t. fitted (or true) track. - if (tp != nullptr) { - //if (tp != nullptr && tp->pt() > 50 && fabs(tp->pdgId()) == 13 && tp->charge() > 0) { - //if (tp != nullptr && tp->pt() > 2 && tp->pt() < 2.5 && fabs(tp->pdgId()) == 13 && tp->charge() > 0) { - // --- Options for recalc histograms - // Choose to get residuals from truth particle or fitted track? - // (Only applies to chi2 method 2 below). - const bool recalc_useTP = false; - // debug printout - const bool recalc_debug = false; - // In residual plots, use residuals from method 2. (Imperfect, as neglects r-phi to r-z correlation). - const bool recalc_method2 = true; - - float recalcChiSquared_1_rphi = 0.; - float recalcChiSquared_1_rz = 0.; - float recalcChiSquared_2 = 0.; - const vector stubs = fitTrk.getStubs(); - if (recalc_debug) cout<<"RECALC loop stubs : HT cell=("<Fill(fitTrk.chi2_bcon()); + hisFitBeamChi2DofUnmatched_[fitName]->Fill(fitTrk.chi2dof_bcon()); + } + profFitChi2VsEtaUnmatched_[fitName]->Fill(fabs(fitTrk.eta()), fitTrk.chi2()); + profFitChi2DofVsEtaUnmatched_[fitName]->Fill(fabs(fitTrk.eta()), fitTrk.chi2dof()); + profFitChi2VsInvPtUnmatched_[fitName]->Fill(fabs(fitTrk.qOverPt()), fitTrk.chi2()); + profFitChi2DofVsInvPtUnmatched_[fitName]->Fill(fabs(fitTrk.qOverPt()), fitTrk.chi2dof()); + + if (fitName.find("KF") != string::npos) { + // No. of skipped layers on track during Kalman track fit. + if (nSkippedLayers == 0) { + hisKalmanChi2DofSkipLay0Unmatched_[fitName]->Fill(fitTrk.chi2dof()); + } else if (nSkippedLayers == 1) { + hisKalmanChi2DofSkipLay1Unmatched_[fitName]->Fill(fitTrk.chi2dof()); + } else if (nSkippedLayers >= 2) { + hisKalmanChi2DofSkipLay2Unmatched_[fitName]->Fill(fitTrk.chi2dof()); + } + } - if (settings_->kalmanHOalpha() == 1) { - // Add alpha correction for non-radial 2S endcap strips.. - deltaPhi_proj += s->alpha() * rShift; - } - } - - float sigmaZ2_proj = (s->barrel()) ? sigmaZ2 : sigmaZ2*pow(tp->tanLambda(), 2); - float beta = 0.; - if (not s->barrel()) { - // Add correlation term related to conversion of stub residuals from (r,phi) to (z,phi). - if (settings_->kalmanHOprojZcorr() == 2) beta += -inv2R_proj; - // Add alpha correction for non-radial 2S endcap strips.. - if (settings_->kalmanHOalpha() == 2) beta += -s->alpha(); - } - float beta2 = beta*beta; - float sigmaPhi2_proj = sigmaPhi2_raw + sigmaZ2_raw * beta2; - // Add scatterign uncertainty - if (recalc_useTP) { - sigmaPhi2_proj += phiExtra2; - } else { - // Fit uses Pt of L1track3D to estimate scattering. - double phiExtra_fit = settings_->kalmanMultiScattTerm()/(fitTrk.getL1track3D().pt()); - double phiExtra2_fit = phiExtra_fit * phiExtra_fit; - sigmaPhi2_proj += phiExtra2_fit; - } - // Correlation of stub phi & stub z coordinates. - float sigmaCorr = (s->barrel()) ? 0.0 : sigmaZ2_raw * beta * tp->tanLambda(); - - // Invert covariance matrix in stub position uncertainty. - float det = sigmaPhi2_proj * sigmaZ2_proj - sigmaCorr * sigmaCorr; - float V00 = sigmaZ2_proj / det; - float V01 = -sigmaCorr / det; - float V11 = sigmaPhi2_proj / det; - if (trueStub) { - recalcChiSquared_2 += V00 * pow(deltaPhi_proj, 2) + V11 * pow(deltaZ_proj, 2) + 2 * V01 * deltaPhi_proj * deltaZ_proj; - if (recalc_debug) { - cout<<" RECALC BARREL="<barrel()<<" PS="<psModule()<<" ID="<index()<Fill( std::abs(tp->eta()), std::abs( fitTrk.qOverPt_bcon() - tp->qOverPt() ) ); - hisPhi0ResBeamVsTrueEta_[fitName]->Fill( std::abs(tp->eta()), std::abs(reco::deltaPhi(fitTrk.phi0_bcon(), tp->phi0()) ) ); - - hisQoverPtResBeamVsTrueInvPt_[fitName]->Fill( std::abs(tp->qOverPt()), std::abs( fitTrk.qOverPt_bcon() - tp->qOverPt() ) ); - hisPhi0ResBeamVsTrueInvPt_[fitName]->Fill( std::abs(tp->qOverPt()), std::abs(reco::deltaPhi(fitTrk.phi0_bcon(), tp->phi0()) ) ); - } - } + // Study how incorrect stubs on track affect fit chi2. + profFitChi2VsPurity_[fitName]->Fill(fitTrk.getPurity(), fitTrk.chi2()); + profFitChi2DofVsPurity_[fitName]->Fill(fitTrk.getPurity(), fitTrk.chi2dof()); + + // Look at stub residuals w.r.t. fitted (or true) track. + if (tp != nullptr) { + //if (tp != nullptr && tp->pt() > 50 && fabs(tp->pdgId()) == 13 && tp->charge() > 0) { + //if (tp != nullptr && tp->pt() > 2 && tp->pt() < 2.5 && fabs(tp->pdgId()) == 13 && tp->charge() > 0) { + // --- Options for recalc histograms + // Choose to get residuals from truth particle or fitted track? + // (Only applies to chi2 method 2 below). + const bool recalc_useTP = false; + // debug printout + const bool recalc_debug = false; + // In residual plots, use residuals from method 2. (Imperfect, as neglects r-phi to r-z correlation). + const bool recalc_method2 = true; + + float recalcChiSquared_1_rphi = 0.; + float recalcChiSquared_1_rz = 0.; + float recalcChiSquared_2 = 0.; + const vector stubs = fitTrk.getStubs(); + if (recalc_debug) + cout << "RECALC loop stubs : HT cell=(" << fitTrk.getCellLocationHT().first << "," + << fitTrk.getCellLocationHT().second << ") TP PDG_ID=" << tp->pdgId() << endl; + for (const Stub* s : stubs) { + // Was this stub produced by correct truth particle? + const set stubTPs = s->assocTPs(); + bool trueStub = (stubTPs.find(tp) != stubTPs.end()); + + //--- Calculation of chi2 (method 1 -- works with residuals in (z,phi) in barrel & (r,phi) in endcap & allows for non-radial 2S endcap strips by shifting stub phi coords.) + + //--- Calculate residuals + // Distance of stub from true trajectory in z (barrel) or r (endcap) + float deltaRorZ = s->barrel() ? (s->z() - tp->trkZAtStub(s)) : (s->r() - tp->trkRAtStub(s)); + // Distance of stub from true trajectory in phi. + float deltaPhi = reco::deltaPhi(s->phi(), tp->trkPhiAtStub(s)); + + // Nasty correction to stub phi coordinate to take into account non-radial strips in endcap 2S modules. + float phiCorr = (tp->trkRAtStub(s) - s->r()) * s->alpha(); + deltaPhi += phiCorr; + + // Local calculation of chi2, to check that from fitter. + float sigmaPhi2_raw = pow(s->sigmaPerp() / s->r(), 2); + float sigmaZ2_raw = s->sigmaPar() * s->sigmaPar(); + float sigmaZ2 = sigmaZ2_raw; + // Scattering term scaling as 1/Pt. + double phiExtra = settings_->kalmanMultiScattTerm() / (tp->pt()); + double phiExtra2 = phiExtra * phiExtra; + float sigmaPhi2 = sigmaPhi2_raw + phiExtra2; + if (s->tiltedBarrel()) { + float tilt = s->moduleTilt(); + float scaleTilted = sin(tilt) + cos(tilt) * (tp->tanLambda()); + float scaleTilted2 = scaleTilted * scaleTilted; + sigmaZ2 *= scaleTilted2; + } + if (trueStub) { + recalcChiSquared_1_rphi += pow((deltaPhi), 2) / sigmaPhi2; + recalcChiSquared_1_rz += pow(deltaRorZ, 2) / sigmaZ2; + } + + //--- Calculation of chi2 (method 2 -- works with residuals in (z,phi) everywhere & allows for non-radial 2S endcap strips via correlation matrix in stub coords - copied from KF4ParamsComb.cc) + + //--- Calculate residuals + float deltaZ_proj, deltaPhi_proj; + float inv2R_proj, tanL_proj, z0_proj; + if (recalc_useTP) { + inv2R_proj = tp->qOverPt() * (0.5 * settings_->invPtToInvR()); + tanL_proj = tp->tanLambda(); + z0_proj = tp->z0(); + // Distance of stub from true trajectory in z, evalulated at nominal radius of stub. + //deltaZ_proj = s->z() - tp->trkZAtR(s->r()); + deltaZ_proj = s->z() - (tp->z0() + tp->tanLambda() * s->r()); + // Distance of stub from true trajectory in r*phi, evaluated at nominal radius of stub. + //deltaPhi_proj = reco::deltaPhi(s->phi(), tp->trkPhiAtR(s->r())); + deltaPhi_proj = reco::deltaPhi(s->phi(), tp->phi0() - (s->r() * inv2R_proj)); + } else { + inv2R_proj = fitTrk.qOverPt() * (0.5 * settings_->invPtToInvR()); + tanL_proj = fitTrk.tanLambda(); + z0_proj = fitTrk.z0(); + deltaZ_proj = s->z() - (fitTrk.z0() + fitTrk.tanLambda() * s->r()); + deltaPhi_proj = reco::deltaPhi(s->phi(), fitTrk.phi0() - (s->r() * inv2R_proj)); + } + + // Higher order correction correction to circle expansion for improved accuracy at low Pt. + float corr = s->r() * inv2R_proj; // = r/2R + deltaPhi_proj += (1. / 6.) * pow(corr, 3); + + if ((not s->barrel()) && not(s->psModule())) { + // These corrections rely on inside --> outside tracking, so r-z track params in 2S modules known. + float rShift = (s->z() - z0_proj) / tanL_proj - s->r(); + + if (settings_->kalmanHOprojZcorr() == 1) { + // Add correlation term related to conversion of stub residuals from (r,phi) to (z,phi). + deltaPhi_proj += inv2R_proj * rShift; + } + + if (settings_->kalmanHOalpha() == 1) { + // Add alpha correction for non-radial 2S endcap strips.. + deltaPhi_proj += s->alpha() * rShift; + } + } + + float sigmaZ2_proj = (s->barrel()) ? sigmaZ2 : sigmaZ2 * pow(tp->tanLambda(), 2); + float beta = 0.; + if (not s->barrel()) { + // Add correlation term related to conversion of stub residuals from (r,phi) to (z,phi). + if (settings_->kalmanHOprojZcorr() == 2) + beta += -inv2R_proj; + // Add alpha correction for non-radial 2S endcap strips.. + if (settings_->kalmanHOalpha() == 2) + beta += -s->alpha(); + } + float beta2 = beta * beta; + float sigmaPhi2_proj = sigmaPhi2_raw + sigmaZ2_raw * beta2; + // Add scatterign uncertainty + if (recalc_useTP) { + sigmaPhi2_proj += phiExtra2; + } else { + // Fit uses Pt of L1track3D to estimate scattering. + double phiExtra_fit = settings_->kalmanMultiScattTerm() / (fitTrk.getL1track3D().pt()); + double phiExtra2_fit = phiExtra_fit * phiExtra_fit; + sigmaPhi2_proj += phiExtra2_fit; + } + // Correlation of stub phi & stub z coordinates. + float sigmaCorr = (s->barrel()) ? 0.0 : sigmaZ2_raw * beta * tp->tanLambda(); + + // Invert covariance matrix in stub position uncertainty. + float det = sigmaPhi2_proj * sigmaZ2_proj - sigmaCorr * sigmaCorr; + float V00 = sigmaZ2_proj / det; + float V01 = -sigmaCorr / det; + float V11 = sigmaPhi2_proj / det; + if (trueStub) { + recalcChiSquared_2 += + V00 * pow(deltaPhi_proj, 2) + V11 * pow(deltaZ_proj, 2) + 2 * V01 * deltaPhi_proj * deltaZ_proj; + if (recalc_debug) { + cout << " RECALC BARREL=" << s->barrel() << " PS=" << s->psModule() << " ID=" << s->index() << endl; + cout << " RECALC RESID: 1000*rphi=" << 1000 * deltaPhi_proj << " rz=" << deltaZ_proj << endl; + cout << " RECALC SIGMA: 1000*rphi=" << 1000 * sqrt(sigmaPhi2_proj) << " rz=" << sqrt(sigmaZ2_proj) + << endl; + cout << " RECALC CHI2=" << recalcChiSquared_2 << " & DELTA CHI2: rphi=" << V00 * pow(deltaPhi_proj, 2) + << " rz=" << V11 * pow(deltaZ_proj, 2) << endl + << endl; + } + } + + float sigmaPhi = sqrt(sigmaPhi2); + float sigmaZ = sqrt(sigmaZ2); + + if (recalc_method2) { + // Plot residuals from method 2. + // (Neglects effect of correlation term sigmaCorr). + deltaPhi = deltaPhi_proj; + deltaRorZ = deltaZ_proj; + sigmaPhi = sqrt(sigmaPhi2_proj); + sigmaZ = sqrt(sigmaZ2_proj); + } + + if (trueStub) { + if (s->psModule()) { + if (s->barrel()) { + hisDeltaPhitruePSbarrel_[fitName]->Fill(deltaPhi / sigmaPhi); + hisDeltaRorZtruePSbarrel_[fitName]->Fill(deltaRorZ / sigmaZ); + } else { + hisDeltaPhitruePSendcap_[fitName]->Fill(deltaPhi / sigmaPhi); + hisDeltaRorZtruePSendcap_[fitName]->Fill(deltaRorZ / sigmaZ); + } + } else { + if (s->barrel()) { + hisDeltaPhitrue2Sbarrel_[fitName]->Fill(deltaPhi / sigmaPhi); + hisDeltaRorZtrue2Sbarrel_[fitName]->Fill(deltaRorZ / sigmaZ); + } else { + hisDeltaPhitrue2Sendcap_[fitName]->Fill(deltaPhi / sigmaPhi); + hisDeltaRorZtrue2Sendcap_[fitName]->Fill(deltaRorZ / sigmaZ); + } + } + // More detailed plots for true stubs to study effect of multiple scattering. + profNsigmaPhivsInvPt_[fitName]->Fill(1. / tp->pt(), fabs(deltaPhi / sigmaPhi)); + profNsigmaPhivsR_[fitName]->Fill(s->r(), fabs(deltaPhi / sigmaPhi)); + profNsigmaPhivsTanl_[fitName]->Fill(fabs(tp->tanLambda()), fabs(deltaPhi / sigmaPhi)); + } else { + if (s->psModule()) { + if (s->barrel()) { + hisDeltaPhifakePSbarrel_[fitName]->Fill(deltaPhi / sigmaPhi); + hisDeltaRorZfakePSbarrel_[fitName]->Fill(deltaRorZ / sigmaZ); + } else { + hisDeltaPhifakePSendcap_[fitName]->Fill(deltaPhi / sigmaPhi); + hisDeltaRorZfakePSendcap_[fitName]->Fill(deltaRorZ / sigmaZ); + } + } else { + if (s->barrel()) { + hisDeltaPhifake2Sbarrel_[fitName]->Fill(deltaPhi / sigmaPhi); + hisDeltaRorZfake2Sbarrel_[fitName]->Fill(deltaRorZ / sigmaZ); + } else { + hisDeltaPhifake2Sendcap_[fitName]->Fill(deltaPhi / sigmaPhi); + hisDeltaRorZfake2Sendcap_[fitName]->Fill(deltaRorZ / sigmaZ); + } + } + } + } + // Plot recalculated chi2 for correct stubs on matched tracks. + profRecalcRphiChi2VsEtaTrue1_[fitName]->Fill(fabs(fitTrk.eta()), recalcChiSquared_1_rphi); + profRecalcRzChi2VsEtaTrue1_[fitName]->Fill(fabs(fitTrk.eta()), recalcChiSquared_1_rz); + float recalcChiSquared_1 = recalcChiSquared_1_rphi + recalcChiSquared_1_rz; + profRecalcChi2VsEtaTrue1_[fitName]->Fill(fabs(fitTrk.eta()), recalcChiSquared_1); + profRecalcChi2VsEtaTrue2_[fitName]->Fill(fabs(fitTrk.eta()), recalcChiSquared_2); + } } - } - //=== Study duplicate tracks. + // Study helix param resolution. - for (const TP& tp: vTPs) { - if (tpRecoedMap[&tp]) { // Was this truth particle successfully fitted? - profDupFitTrksVsEta_[fitName]->Fill(fabs(tp.eta()), tpRecoedDup[&tp] - 1); - profDupFitTrksVsInvPt_[fitName]->Fill(fabs(tp.qOverPt()), tpRecoedDup[&tp] - 1); + for (const L1fittedTrack& fitTrk : fittedTracks) { + const TP* tp = fitTrk.getMatchedTP(); + if (tp != nullptr) { + // IRT + if ((resPlotOpt_ && tp->useForAlgEff()) || + (not resPlotOpt_)) { // Check TP is good for efficiency measurement (& also comes from signal event if requested) + //if (not (abs(tp->pdgId()) == 11)) continue; + //if (not (abs(tp->pdgId()) == 13) || (abs(tp->pdgId()) == 211) || (abs(tp->pdgId()) == 321) || (abs(tp->pdgId()) == 2212)) continue; + // Fitted vs True parameter distribution 2D plots + hisFitVsTrueQinvPt_[fitName]->Fill(tp->qOverPt(), fitTrk.qOverPt()); + hisFitVsTruePhi0_[fitName]->Fill(tp->phi0(), fitTrk.phi0()); + hisFitVsTrueD0_[fitName]->Fill(tp->d0(), fitTrk.d0()); + hisFitVsTrueZ0_[fitName]->Fill(tp->z0(), fitTrk.z0()); + hisFitVsTrueEta_[fitName]->Fill(tp->eta(), fitTrk.eta()); + + // Residuals between fitted and true helix params as 1D plot. + hisFitQinvPtRes_[fitName]->Fill(fitTrk.qOverPt() - tp->qOverPt()); + hisFitPhi0Res_[fitName]->Fill(reco::deltaPhi(fitTrk.phi0(), tp->phi0())); + hisFitD0Res_[fitName]->Fill(fitTrk.d0() - tp->d0()); + hisFitZ0Res_[fitName]->Fill(fitTrk.z0() - tp->z0()); + hisFitEtaRes_[fitName]->Fill(fitTrk.eta() - tp->eta()); + + // Plot helix parameter resolution against eta or Pt. + hisQoverPtResVsTrueEta_[fitName]->Fill(std::abs(tp->eta()), std::abs(fitTrk.qOverPt() - tp->qOverPt())); + hisPhi0ResVsTrueEta_[fitName]->Fill(std::abs(tp->eta()), + std::abs(reco::deltaPhi(fitTrk.phi0(), tp->phi0()))); + hisEtaResVsTrueEta_[fitName]->Fill(std::abs(tp->eta()), std::abs(fitTrk.eta() - tp->eta())); + hisZ0ResVsTrueEta_[fitName]->Fill(std::abs(tp->eta()), std::abs(fitTrk.z0() - tp->z0())); + hisD0ResVsTrueEta_[fitName]->Fill(std::abs(tp->eta()), std::abs(fitTrk.d0() - tp->d0())); + + hisQoverPtResVsTrueInvPt_[fitName]->Fill(std::abs(tp->qOverPt()), + std::abs(fitTrk.qOverPt() - tp->qOverPt())); + hisPhi0ResVsTrueInvPt_[fitName]->Fill(std::abs(tp->qOverPt()), + std::abs(reco::deltaPhi(fitTrk.phi0(), tp->phi0()))); + hisEtaResVsTrueInvPt_[fitName]->Fill(std::abs(tp->qOverPt()), std::abs(fitTrk.eta() - tp->eta())); + hisZ0ResVsTrueInvPt_[fitName]->Fill(std::abs(tp->qOverPt()), std::abs(fitTrk.z0() - tp->z0())); + hisD0ResVsTrueInvPt_[fitName]->Fill(std::abs(tp->qOverPt()), std::abs(fitTrk.d0() - tp->d0())); + + // Also plot resolution for 5 parameter fits after beam-spot constraint it applied post-fit. + if (settings_->kalmanAddBeamConstr() && fitName.find("KF5") != string::npos) { + hisQoverPtResBeamVsTrueEta_[fitName]->Fill(std::abs(tp->eta()), + std::abs(fitTrk.qOverPt_bcon() - tp->qOverPt())); + hisPhi0ResBeamVsTrueEta_[fitName]->Fill(std::abs(tp->eta()), + std::abs(reco::deltaPhi(fitTrk.phi0_bcon(), tp->phi0()))); + + hisQoverPtResBeamVsTrueInvPt_[fitName]->Fill(std::abs(tp->qOverPt()), + std::abs(fitTrk.qOverPt_bcon() - tp->qOverPt())); + hisPhi0ResBeamVsTrueInvPt_[fitName]->Fill(std::abs(tp->qOverPt()), + std::abs(reco::deltaPhi(fitTrk.phi0_bcon(), tp->phi0()))); + } + } + } } - } - //=== Study tracking efficiency by looping over tracking particles. + //=== Study duplicate tracks. - for (const TP& tp: vTPs) { - - if (tp.useForEff()) { // Check TP is good for efficiency measurement. - - // Check which phi & eta sectors this TP is in. - int iEtaReg_TP = -1; - int iPhiSec_TP = -1; - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - Sector secTmp; - secTmp.init(settings_, iPhiSec, 0); - if (secTmp.insidePhiSec(tp)) iPhiSec_TP = iPhiSec; - } - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - Sector secTmp; - secTmp.init(settings_, 0, iEtaReg); - if (secTmp.insideEtaReg(tp)) iEtaReg_TP = iEtaReg; - } - - // If TP was reconstucted by HT, then plot its kinematics. - if (tpRecoedMap[&tp]) { // This truth particle was successfully fitted. - hisFitTPinvptForEff_[fitName]->Fill(1./tp.pt()); - hisFitTPptForEff_[fitName]->Fill(tp.pt()); - hisFitTPetaForEff_[fitName]->Fill(tp.eta()); - hisFitTPphiForEff_[fitName]->Fill(tp.phi0()); - // Plot also production point of all good reconstructed TP. - hisFitTPd0ForEff_[fitName]->Fill(fabs(tp.d0())); - hisFitTPz0ForEff_[fitName]->Fill(fabs(tp.z0())); - // Also plot efficiency to perfectly reconstruct the track (no fake hits) - if (tpPerfRecoedMap[&tp]) { // This truth particle was successfully fitted with no incorrect hits. - hisPerfFitTPinvptForEff_[fitName]->Fill(1./tp.pt()); - hisPerfFitTPptForEff_[fitName]->Fill(tp.pt()); - hisPerfFitTPetaForEff_[fitName]->Fill(tp.eta()); - } - if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. - hisFitTPinvptForAlgEff_[fitName]->Fill(1./tp.pt()); - hisFitTPptForAlgEff_[fitName]->Fill(tp.pt()); - hisFitTPetaForAlgEff_[fitName]->Fill(tp.eta()); - hisFitTPphiForAlgEff_[fitName]->Fill(tp.phi0()); - // Plot also production point of all good reconstructed TP. - hisFitTPd0ForAlgEff_[fitName]->Fill(fabs(tp.d0())); - hisFitTPz0ForAlgEff_[fitName]->Fill(fabs(tp.z0())); - // Plot sector number to understand if looser cuts are needed in certain regions. - hisFitTPphisecForAlgEff_[fitName]->Fill(iPhiSec_TP); - hisFitTPetasecForAlgEff_[fitName]->Fill(iEtaReg_TP); - // Also plot efficiency to perfectly reconstruct the track (no fake hits) - if (tpPerfRecoedMap[&tp]) { - hisPerfFitTPinvptForAlgEff_[fitName]->Fill(1./tp.pt()); - hisPerfFitTPptForAlgEff_[fitName]->Fill(tp.pt()); - hisPerfFitTPetaForAlgEff_[fitName]->Fill(tp.eta()); - hisPerfFitTPphisecForAlgEff_[fitName]->Fill(iPhiSec_TP); - hisPerfFitTPetasecForAlgEff_[fitName]->Fill(iEtaReg_TP); - // Efficiency inside jets. - if ( tp.tpInJet() ) { - hisPerfFitTPinvptForAlgEff_inJetPtG30_[fitName]->Fill(1./tp.pt()); - } - if ( tp.tpInHighPtJet() ) { - hisPerfFitTPinvptForAlgEff_inJetPtG100_[fitName]->Fill(1./tp.pt()); - } - if ( tp.tpInVeryHighPtJet() ) { - hisPerfFitTPinvptForAlgEff_inJetPtG200_[fitName]->Fill(1./tp.pt()); - } - } - } - } + for (const TP& tp : vTPs) { + if (tpRecoedMap[&tp]) { // Was this truth particle successfully fitted? + profDupFitTrksVsEta_[fitName]->Fill(fabs(tp.eta()), tpRecoedDup[&tp] - 1); + profDupFitTrksVsInvPt_[fitName]->Fill(fabs(tp.qOverPt()), tpRecoedDup[&tp] - 1); + } } - } - } -} - -//=== Produce plots of tracking efficiency after HT or after r-z track filter (run at end of job). - -TFileDirectory Histos::plotTrackEfficiency(string tName) { - - // Define lambda function to facilitate adding "tName" to directory & histogram names. - auto addn = [tName](string s){ return TString::Format("%s_%s", s.c_str(), tName.c_str()); }; - - TFileDirectory inputDir = fs_->mkdir(addn("Effi").Data()); - // Plot tracking efficiency - makeEfficiencyPlot(inputDir, teffEffVsInvPt_[tName], hisRecoTPinvptForEff_[tName], hisTPinvptForEff_, - addn("EffVsInvPt"), "; 1/Pt; Tracking efficiency" ); - makeEfficiencyPlot(inputDir, teffEffVsPt_[tName], hisRecoTPptForEff_[tName], hisTPptForEff_, - addn("EffVsPt"), "; Pt; Tracking efficiency" ); - makeEfficiencyPlot(inputDir, teffEffVsEta_[tName], hisRecoTPetaForEff_[tName], hisTPetaForEff_, - addn("EffVsEta"), "; #eta; Tracking efficiency" ); - - // std::cout << "Made first graph" << std::endl; - // graphEffVsEta_[tName] = inputDir.make(hisRecoTPetaForEff_[tName], hisTPetaForEff_); - // graphEffVsEta_[tName]->SetNameTitle("EffVsEta","; #eta; Tracking efficiency"); - makeEfficiencyPlot(inputDir, teffEffVsPhi_[tName], hisRecoTPphiForEff_[tName], hisTPphiForEff_, - addn("EffVsPhi"), "; #phi; Tracking efficiency"); - - makeEfficiencyPlot( inputDir, teffEffVsD0_[tName], hisRecoTPd0ForEff_[tName], hisTPd0ForEff_, - addn("EffVsD0"),"; d0 (cm); Tracking efficiency"); - makeEfficiencyPlot( inputDir, teffEffVsZ0_[tName], hisRecoTPz0ForEff_[tName], hisTPz0ForEff_, - addn("EffVsZ0"),"; z0 (cm); Tracking efficiency"); - - // Also plot efficiency to reconstruct track perfectly. - makeEfficiencyPlot( inputDir, teffPerfEffVsInvPt_[tName], hisPerfRecoTPinvptForEff_[tName], hisTPinvptForEff_, - addn("PerfEffVsInvPt"),"; 1/Pt; Tracking perfect efficiency"); - makeEfficiencyPlot( inputDir, teffPerfEffVsPt_[tName], hisPerfRecoTPptForEff_[tName], hisTPptForEff_, - addn("PerfEffVsPt"),"; Pt; Tracking perfect efficiency"); - makeEfficiencyPlot( inputDir, teffPerfEffVsEta_[tName], hisPerfRecoTPetaForEff_[tName], hisTPetaForEff_, - addn("PerfEffVsEta"),"; #eta; Tracking perfect efficiency"); - - // Plot algorithmic tracking efficiency - makeEfficiencyPlot( inputDir, teffAlgEffVsInvPt_[tName], hisRecoTPinvptForAlgEff_[tName], hisTPinvptForAlgEff_, - addn("AlgEffVsInvPt"),"; 1/Pt; Tracking efficiency"); - makeEfficiencyPlot( inputDir, teffAlgEffVsPt_[tName], hisRecoTPptForAlgEff_[tName], hisTPptForAlgEff_, - addn("AlgEffVsPt"),"; Pt; Tracking efficiency"); - makeEfficiencyPlot( inputDir, teffAlgEffVsEta_[tName], hisRecoTPetaForAlgEff_[tName], hisTPetaForAlgEff_, - addn("AlgEffVsEta"),"; #eta; Tracking efficiency"); - makeEfficiencyPlot( inputDir, teffAlgEffVsPhi_[tName], hisRecoTPphiForAlgEff_[tName], hisTPphiForAlgEff_, - addn("AlgEffVsPhi"),"; #phi; Tracking efficiency"); - - makeEfficiencyPlot( inputDir, teffAlgEffVsD0_[tName], hisRecoTPd0ForAlgEff_[tName], hisTPd0ForAlgEff_, - addn("AlgEffVsD0"),"; d0 (cm); Tracking efficiency"); - makeEfficiencyPlot( inputDir, teffAlgEffVsZ0_[tName], hisRecoTPz0ForAlgEff_[tName], hisTPz0ForAlgEff_, - addn("AlgEffVsZ0"),"; z0 (cm); Tracking efficiency"); - - makeEfficiencyPlot( inputDir, teffAlgEffVsPhiSec_[tName], hisRecoTPphisecForAlgEff_[tName], hisTPphisecForAlgEff_, - addn("AlgEffVsPhiSec"),"; #phi sector; Tracking efficiency"); - makeEfficiencyPlot( inputDir, teffAlgEffVsEtaSec_[tName], hisRecoTPetasecForAlgEff_[tName], hisTPetasecForAlgEff_, - addn("AlgEffVsEtaSec"),"; #eta sector; Tracking efficiency"); - - makeEfficiencyPlot( inputDir, teffAlgEffVsInvPt_inJetPtG30_[tName], hisRecoTPinvptForAlgEff_inJetPtG30_[tName], hisTPinvptForAlgEff_inJetPtG30_, - addn("AlgEffVsInvPt_inJetPtG30"),"; 1/Pt; Tracking efficiency"); - - makeEfficiencyPlot( inputDir, teffAlgEffVsInvPt_inJetPtG100_[tName], hisRecoTPinvptForAlgEff_inJetPtG100_[tName], hisTPinvptForAlgEff_inJetPtG100_, - addn("AlgEffVsInvPt_inJetPtG100"),"; 1/Pt; Tracking efficiency"); - - makeEfficiencyPlot( inputDir, teffAlgEffVsInvPt_inJetPtG200_[tName], hisRecoTPinvptForAlgEff_inJetPtG200_[tName], hisTPinvptForAlgEff_inJetPtG200_, - addn("AlgEffVsInvPt_inJetPtG200"),"; 1/Pt; Tracking efficiency"); - - // Also plot algorithmic efficiency to reconstruct track perfectly. - makeEfficiencyPlot( inputDir, teffPerfAlgEffVsInvPt_[tName], hisPerfRecoTPinvptForAlgEff_[tName], hisTPinvptForAlgEff_, - addn("PerfAlgEffVsInvPt"),"; 1/Pt; Tracking perfect efficiency"); - makeEfficiencyPlot( inputDir, teffPerfAlgEffVsPt_[tName], hisPerfRecoTPptForAlgEff_[tName], hisTPptForAlgEff_, - addn("PerfAlgEffVsPt"),"; Pt; Tracking perfect efficiency"); - makeEfficiencyPlot( inputDir, teffPerfAlgEffVsEta_[tName], hisPerfRecoTPetaForAlgEff_[tName], hisTPetaForAlgEff_, - addn("PerfAlgEffVsEta"),"; #eta; Tracking perfect efficiency"); - - makeEfficiencyPlot( inputDir, teffPerfAlgEffVsPhiSec_[tName], hisPerfRecoTPphisecForAlgEff_[tName], hisTPphisecForAlgEff_, - addn("PerfAlgEffVsPhiSec"),"; #phi sector; Tracking perfect efficiency"); - makeEfficiencyPlot( inputDir, teffPerfAlgEffVsEtaSec_[tName], hisPerfRecoTPetasecForAlgEff_[tName], hisTPetasecForAlgEff_, - addn("PerfAlgEffVsEtaSec"),"; #eta sector; Tracking perfect efficiency"); - - return inputDir; -} - -//=== Produce plots of tracking efficiency after track fit (run at end of job). - -TFileDirectory Histos::plotTrackEffAfterFit(string fitName) { - - // Define lambda function to facilitate adding "fitName" to directory & histogram names. - auto addn = [fitName](string s){ return TString::Format("%s_%s", s.c_str(), fitName.c_str()); }; - - TFileDirectory inputDir = fs_->mkdir(addn("Effi").Data()); - // Plot tracking efficiency - makeEfficiencyPlot( inputDir, teffEffFitVsInvPt_[fitName], hisFitTPinvptForEff_[fitName], hisTPinvptForEff_, - addn("EffFitVsInvPt"),"; 1/Pt; Tracking efficiency"); - makeEfficiencyPlot( inputDir, teffEffFitVsPt_[fitName], hisFitTPptForEff_[fitName], hisTPptForEff_, - addn("EffFitVsPt"),"; Pt; Tracking efficiency"); - makeEfficiencyPlot( inputDir, teffEffFitVsEta_[fitName], hisFitTPetaForEff_[fitName], hisTPetaForEff_, - addn("EffFitVsEta"),"; #eta; Tracking efficiency"); - makeEfficiencyPlot( inputDir, teffEffFitVsPhi_[fitName], hisFitTPphiForEff_[fitName], hisTPphiForEff_, - addn("EffFitVsPhi"),"; #phi; Tracking efficiency"); - - makeEfficiencyPlot( inputDir, teffEffFitVsD0_[fitName], hisFitTPd0ForEff_[fitName], hisTPd0ForEff_, - addn("EffFitVsD0"),"; d0 (cm); Tracking efficiency"); - makeEfficiencyPlot( inputDir, teffEffFitVsZ0_[fitName], hisFitTPz0ForEff_[fitName], hisTPz0ForEff_, - addn("EffFitVsZ0"),"; z0 (cm); Tracking efficiency"); - - // Also plot efficiency to reconstruct track perfectly. - makeEfficiencyPlot( inputDir, teffPerfEffFitVsInvPt_[fitName], hisPerfFitTPinvptForEff_[fitName], hisTPinvptForEff_, - addn("PerfEffFitVsInvPt"),"; 1/Pt; Tracking perfect efficiency"); - makeEfficiencyPlot( inputDir, teffPerfEffFitVsPt_[fitName], hisPerfFitTPptForEff_[fitName], hisTPptForEff_, - addn("PerfEffFitVsPt"),"; Pt; Tracking perfect efficiency"); - makeEfficiencyPlot( inputDir, teffPerfEffFitVsEta_[fitName], hisPerfFitTPetaForEff_[fitName], hisTPetaForEff_, - addn("PerfEffFitVsEta"),"; #eta; Tracking perfect efficiency"); - - // Plot algorithmic tracking efficiency - makeEfficiencyPlot( inputDir, teffAlgEffFitVsInvPt_[fitName], hisFitTPinvptForAlgEff_[fitName], hisTPinvptForAlgEff_, - addn("AlgEffFitVsInvPt"),"; 1/Pt; Tracking efficiency"); - makeEfficiencyPlot( inputDir, teffAlgEffFitVsPt_[fitName], hisFitTPptForAlgEff_[fitName], hisTPptForAlgEff_, - addn("AlgEffFitVsPt"),"; Pt; Tracking efficiency"); - makeEfficiencyPlot( inputDir, teffAlgEffFitVsEta_[fitName], hisFitTPetaForAlgEff_[fitName], hisTPetaForAlgEff_, - addn("AlgEffFitVsEta"),"; #eta; Tracking efficiency"); - makeEfficiencyPlot( inputDir, teffAlgEffFitVsPhi_[fitName], hisFitTPphiForAlgEff_[fitName], hisTPphiForAlgEff_, - addn("AlgEffFitVsPhi"),"; #phi; Tracking efficiency"); - - makeEfficiencyPlot( inputDir, teffAlgEffFitVsD0_[fitName], hisFitTPd0ForAlgEff_[fitName], hisTPd0ForAlgEff_, - addn("AlgEffFitVsD0"),"; d0 (cm); Tracking efficiency"); - makeEfficiencyPlot( inputDir, teffAlgEffFitVsZ0_[fitName], hisFitTPz0ForAlgEff_[fitName], hisTPz0ForAlgEff_, - addn("AlgEffFitVsZ0"),"; z0 (cm); Tracking efficiency"); - - makeEfficiencyPlot( inputDir, teffAlgEffFitVsPhiSec_[fitName], hisFitTPphisecForAlgEff_[fitName], hisTPphisecForAlgEff_, - addn("AlgEffFitVsPhiSec"),"; #phi sector; Tracking efficiency"); - makeEfficiencyPlot( inputDir, teffAlgEffFitVsEtaSec_[fitName], hisFitTPetasecForAlgEff_[fitName], hisTPetasecForAlgEff_, - addn("AlgEffFitVsEtaSec"),"; #eta sector; Tracking efficiency"); - - // Also plot algorithmic efficiency to reconstruct track perfectly. - makeEfficiencyPlot( inputDir, teffPerfAlgEffFitVsInvPt_[fitName], hisPerfFitTPinvptForAlgEff_[fitName], hisTPinvptForAlgEff_, - addn("PerfAlgEffFitVsInvPt"),"; 1/Pt; Tracking perfect efficiency"); - makeEfficiencyPlot( inputDir, teffPerfAlgEffFitVsPt_[fitName], hisPerfFitTPptForAlgEff_[fitName], hisTPptForAlgEff_, - addn("PerfAlgEffFitVsPt"),"; Pt; Tracking perfect efficiency"); - makeEfficiencyPlot( inputDir, teffPerfAlgEffFitVsEta_[fitName], hisPerfFitTPetaForAlgEff_[fitName], hisTPetaForAlgEff_, - addn("Perf AlgEffFitVsEta"),"; #eta; Tracking perfect efficiency"); - makeEfficiencyPlot( inputDir, teffPerfAlgEffFitVsInvPt_inJetPtG30_[fitName], hisPerfFitTPinvptForAlgEff_inJetPtG30_[fitName], hisTPinvptForAlgEff_inJetPtG30_, - addn("PerfAlgEffFitVsInvPt_inJetPtG30"),"; 1/Pt; Tracking perfect efficiency"); - makeEfficiencyPlot( inputDir, teffPerfAlgEffFitVsInvPt_inJetPtG100_[fitName], hisPerfFitTPinvptForAlgEff_inJetPtG100_[fitName], hisTPinvptForAlgEff_inJetPtG100_, - addn("PerfAlgEffFitVsInvPt_inJetPtG100"),"; 1/Pt; Tracking perfect efficiency"); - makeEfficiencyPlot( inputDir, teffPerfAlgEffFitVsInvPt_inJetPtG200_[fitName], hisPerfFitTPinvptForAlgEff_inJetPtG200_[fitName], hisTPinvptForAlgEff_inJetPtG200_, - addn("PerfAlgEffFitVsInvPt_inJetPtG200"),"; 1/Pt; Tracking perfect efficiency"); - - makeEfficiencyPlot( inputDir, teffPerfAlgEffFitVsPhiSec_[fitName], hisPerfFitTPphisecForAlgEff_[fitName], hisTPphisecForAlgEff_, - addn("PerfAlgEffFitVsPhiSec"),"; #phi sector; Tracking perfect efficiency"); - makeEfficiencyPlot( inputDir, teffPerfAlgEffFitVsEtaSec_[fitName], hisPerfFitTPetasecForAlgEff_[fitName], hisTPetasecForAlgEff_, - addn("PerfAlgEffFitVsEtaSec"),"; #eta sector; Tracking perfect efficiency"); - - return inputDir; -} - -void Histos::makeEfficiencyPlot( TFileDirectory &inputDir, TEfficiency* outputEfficiency, TH1F* pass, TH1F* all, TString name, TString title ) { - - outputEfficiency = inputDir.make(*pass, *all); - outputEfficiency->SetName(name); - outputEfficiency->SetTitle(title); -} - -//=== Print summary of track-finding performance after track pattern reco. - -void Histos::printTrackPerformance(string tName) { - - float numTrackCands = profNumTrackCands_[tName]->GetBinContent(1); // No. of track cands - float numTrackCandsErr = profNumTrackCands_[tName]->GetBinError(1); // No. of track cands uncertainty - float numMatchedTrackCandsIncDups = profNumTrackCands_[tName]->GetBinContent(2); // Ditto, counting only those matched to TP - float numMatchedTrackCandsExcDups = profNumTrackCands_[tName]->GetBinContent(6); // Ditto, but excluding duplicates - float numFakeTracks = numTrackCands - numMatchedTrackCandsIncDups; - float numExtraDupTracks = numMatchedTrackCandsIncDups - numMatchedTrackCandsExcDups; - float fracFake = numFakeTracks/(numTrackCands + 1.0e-6); - float fracDup = numExtraDupTracks/(numTrackCands + 1.0e-6); - - float numStubsOnTracks = profStubsOnTracks_[tName]->GetBinContent(1); - float meanStubsPerTrack = numStubsOnTracks/(numTrackCands + 1.0e-6); //protection against demoninator equals zero. - unsigned int numRecoTPforAlg = hisRecoTPinvptForAlgEff_[tName]->GetEntries(); - // Histograms of input truth particles (e.g. hisTPinvptForAlgEff_), used for denominator of efficiencies, are identical, - // irrespective of whether made after HT or after r-z track filter, so always use the former. - unsigned int numTPforAlg = hisTPinvptForAlgEff_->GetEntries(); - unsigned int numPerfRecoTPforAlg = hisPerfRecoTPinvptForAlgEff_[tName]->GetEntries(); - float algEff = float(numRecoTPforAlg)/(numTPforAlg + 1.0e-6); //protection against demoninator equals zero. - float algEffErr = sqrt(algEff*(1-algEff)/(numTPforAlg + 1.0e-6)); // uncertainty - float algPerfEff = float(numPerfRecoTPforAlg)/(numTPforAlg + 1.0e-6); //protection against demoninator equals zero. - float algPerfEffErr = sqrt(algPerfEff*(1-algPerfEff)/(numTPforAlg + 1.0e-6)); // uncertainty - - cout.setf(ios::fixed, ios::floatfield); - cout.precision(4); - - cout<<"========================================================================="<GetBinContent(1); // No. of track cands - float numFitTracksErr = profNumFitTracks_[fitName]->GetBinError(1); // No. of track cands uncertainty - float numMatchedFitTracksIncDups = profNumFitTracks_[fitName]->GetBinContent(2); // Ditto, counting only those matched to TP - float numMatchedFitTracksExcDups = profNumFitTracks_[fitName]->GetBinContent(6); // Ditto, but excluding duplicates - float numFakeFitTracks = numFitTracks - numMatchedFitTracksIncDups; - float numExtraDupFitTracks = numMatchedFitTracksIncDups - numMatchedFitTracksExcDups; - float fracFakeFit = numFakeFitTracks/(numFitTracks + 1.0e-6); - float fracDupFit = numExtraDupFitTracks/(numFitTracks + 1.0e-6); - - float numStubsOnFitTracks = profStubsOnFitTracks_[fitName]->GetBinContent(1); - float meanStubsPerFitTrack = numStubsOnFitTracks/(numFitTracks + 1.0e-6); //protection against demoninator equals zero. - unsigned int numFitTPforAlg = hisFitTPinvptForAlgEff_[fitName]->GetEntries(); - // Histograms of input truth particles (e.g. hisTPinvptForAlgEff_), used for denominator of efficiencies, are identical, - // irrespective of whether made after HT or after r-z track filter, so always use the former. - unsigned int numTPforAlg = hisTPinvptForAlgEff_->GetEntries(); - unsigned int numPerfFitTPforAlg = hisPerfFitTPinvptForAlgEff_[fitName]->GetEntries(); - float fitEff = float(numFitTPforAlg)/(numTPforAlg + 1.0e-6); //protection against demoninator equals zero. - float fitEffErr = sqrt(fitEff*(1-fitEff)/(numTPforAlg + 1.0e-6)); // uncertainty - float fitPerfEff = float(numPerfFitTPforAlg)/(numTPforAlg + 1.0e-6); //protection against demoninator equals zero. - float fitPerfEffErr = sqrt(fitPerfEff*(1-fitPerfEff)/(numTPforAlg + 1.0e-6)); // uncertainty - - // Does this fitter require r-z track filter to be run before it? - bool useRZfilt = (std::count(useRZfilter_.begin(), useRZfilter_.end(), fitName) > 0); - - cout<<"========================================================================="<rzFilterName()<<"' r-z track filter.)"<detailedFitOutput() ){ - cout << endl<< "More detailed information about helix fit:"<enabled() ) return; - - // Protection when running in wierd mixed hybrid-TMTT modes. - bool wierdMixedMode = (hisRecoTPinvptForEff_.find("TRACKLET") == hisRecoTPinvptForEff_.end()); - if (settings_->hybrid() && not wierdMixedMode) { + //=== Study tracking efficiency by looping over tracking particles. - // Produce plots of tracking efficieny after tracklet pattern reco. - this->plotTrackletSeedEfficiency(); - this->plotTrackEfficiency("TRACKLET"); - this->plotHybridDupRemovalEfficiency(); + for (const TP& tp : vTPs) { + if (tp.useForEff()) { // Check TP is good for efficiency measurement. - } else { - - // Produce plots of tracking efficiency using track candidates found after HT. - this->plotTrackEfficiency("HT"); + // Check which phi & eta sectors this TP is in. + int iEtaReg_TP = -1; + int iPhiSec_TP = -1; + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + Sector secTmp; + secTmp.init(settings_, iPhiSec, 0); + if (secTmp.insidePhiSec(tp)) + iPhiSec_TP = iPhiSec; + } + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + Sector secTmp; + secTmp.init(settings_, 0, iEtaReg); + if (secTmp.insideEtaReg(tp)) + iEtaReg_TP = iEtaReg; + } - // Optionally produce plots of tracking efficiency using track candidates found after r-z track filter. - if (ranRZfilter_) this->plotTrackEfficiency("RZ"); + // If TP was reconstucted by HT, then plot its kinematics. + if (tpRecoedMap[&tp]) { // This truth particle was successfully fitted. + hisFitTPinvptForEff_[fitName]->Fill(1. / tp.pt()); + hisFitTPptForEff_[fitName]->Fill(tp.pt()); + hisFitTPetaForEff_[fitName]->Fill(tp.eta()); + hisFitTPphiForEff_[fitName]->Fill(tp.phi0()); + // Plot also production point of all good reconstructed TP. + hisFitTPd0ForEff_[fitName]->Fill(fabs(tp.d0())); + hisFitTPz0ForEff_[fitName]->Fill(fabs(tp.z0())); + // Also plot efficiency to perfectly reconstruct the track (no fake hits) + if (tpPerfRecoedMap[&tp]) { // This truth particle was successfully fitted with no incorrect hits. + hisPerfFitTPinvptForEff_[fitName]->Fill(1. / tp.pt()); + hisPerfFitTPptForEff_[fitName]->Fill(tp.pt()); + hisPerfFitTPetaForEff_[fitName]->Fill(tp.eta()); + } + if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. + hisFitTPinvptForAlgEff_[fitName]->Fill(1. / tp.pt()); + hisFitTPptForAlgEff_[fitName]->Fill(tp.pt()); + hisFitTPetaForAlgEff_[fitName]->Fill(tp.eta()); + hisFitTPphiForAlgEff_[fitName]->Fill(tp.phi0()); + // Plot also production point of all good reconstructed TP. + hisFitTPd0ForAlgEff_[fitName]->Fill(fabs(tp.d0())); + hisFitTPz0ForAlgEff_[fitName]->Fill(fabs(tp.z0())); + // Plot sector number to understand if looser cuts are needed in certain regions. + hisFitTPphisecForAlgEff_[fitName]->Fill(iPhiSec_TP); + hisFitTPetasecForAlgEff_[fitName]->Fill(iEtaReg_TP); + // Also plot efficiency to perfectly reconstruct the track (no fake hits) + if (tpPerfRecoedMap[&tp]) { + hisPerfFitTPinvptForAlgEff_[fitName]->Fill(1. / tp.pt()); + hisPerfFitTPptForAlgEff_[fitName]->Fill(tp.pt()); + hisPerfFitTPetaForAlgEff_[fitName]->Fill(tp.eta()); + hisPerfFitTPphisecForAlgEff_[fitName]->Fill(iPhiSec_TP); + hisPerfFitTPetasecForAlgEff_[fitName]->Fill(iEtaReg_TP); + // Efficiency inside jets. + if (tp.tpInJet()) { + hisPerfFitTPinvptForAlgEff_inJetPtG30_[fitName]->Fill(1. / tp.pt()); + } + if (tp.tpInHighPtJet()) { + hisPerfFitTPinvptForAlgEff_inJetPtG100_[fitName]->Fill(1. / tp.pt()); + } + if (tp.tpInVeryHighPtJet()) { + hisPerfFitTPinvptForAlgEff_inJetPtG200_[fitName]->Fill(1. / tp.pt()); + } + } + } + } + } + } + } } - // Produce more plots of tracking efficiency using track candidates after track fit. - for (auto &fitName : trackFitters_) { - this->plotTrackEffAfterFit(fitName); + //=== Produce plots of tracking efficiency after HT or after r-z track filter (run at end of job). + + TFileDirectory Histos::plotTrackEfficiency(string tName) { + // Define lambda function to facilitate adding "tName" to directory & histogram names. + auto addn = [tName](string s) { return TString::Format("%s_%s", s.c_str(), tName.c_str()); }; + + TFileDirectory inputDir = fs_->mkdir(addn("Effi").Data()); + // Plot tracking efficiency + makeEfficiencyPlot(inputDir, + teffEffVsInvPt_[tName], + hisRecoTPinvptForEff_[tName], + hisTPinvptForEff_, + addn("EffVsInvPt"), + "; 1/Pt; Tracking efficiency"); + makeEfficiencyPlot(inputDir, + teffEffVsPt_[tName], + hisRecoTPptForEff_[tName], + hisTPptForEff_, + addn("EffVsPt"), + "; Pt; Tracking efficiency"); + makeEfficiencyPlot(inputDir, + teffEffVsEta_[tName], + hisRecoTPetaForEff_[tName], + hisTPetaForEff_, + addn("EffVsEta"), + "; #eta; Tracking efficiency"); + + // std::cout << "Made first graph" << std::endl; + // graphEffVsEta_[tName] = inputDir.make(hisRecoTPetaForEff_[tName], hisTPetaForEff_); + // graphEffVsEta_[tName]->SetNameTitle("EffVsEta","; #eta; Tracking efficiency"); + makeEfficiencyPlot(inputDir, + teffEffVsPhi_[tName], + hisRecoTPphiForEff_[tName], + hisTPphiForEff_, + addn("EffVsPhi"), + "; #phi; Tracking efficiency"); + + makeEfficiencyPlot(inputDir, + teffEffVsD0_[tName], + hisRecoTPd0ForEff_[tName], + hisTPd0ForEff_, + addn("EffVsD0"), + "; d0 (cm); Tracking efficiency"); + makeEfficiencyPlot(inputDir, + teffEffVsZ0_[tName], + hisRecoTPz0ForEff_[tName], + hisTPz0ForEff_, + addn("EffVsZ0"), + "; z0 (cm); Tracking efficiency"); + + // Also plot efficiency to reconstruct track perfectly. + makeEfficiencyPlot(inputDir, + teffPerfEffVsInvPt_[tName], + hisPerfRecoTPinvptForEff_[tName], + hisTPinvptForEff_, + addn("PerfEffVsInvPt"), + "; 1/Pt; Tracking perfect efficiency"); + makeEfficiencyPlot(inputDir, + teffPerfEffVsPt_[tName], + hisPerfRecoTPptForEff_[tName], + hisTPptForEff_, + addn("PerfEffVsPt"), + "; Pt; Tracking perfect efficiency"); + makeEfficiencyPlot(inputDir, + teffPerfEffVsEta_[tName], + hisPerfRecoTPetaForEff_[tName], + hisTPetaForEff_, + addn("PerfEffVsEta"), + "; #eta; Tracking perfect efficiency"); + + // Plot algorithmic tracking efficiency + makeEfficiencyPlot(inputDir, + teffAlgEffVsInvPt_[tName], + hisRecoTPinvptForAlgEff_[tName], + hisTPinvptForAlgEff_, + addn("AlgEffVsInvPt"), + "; 1/Pt; Tracking efficiency"); + makeEfficiencyPlot(inputDir, + teffAlgEffVsPt_[tName], + hisRecoTPptForAlgEff_[tName], + hisTPptForAlgEff_, + addn("AlgEffVsPt"), + "; Pt; Tracking efficiency"); + makeEfficiencyPlot(inputDir, + teffAlgEffVsEta_[tName], + hisRecoTPetaForAlgEff_[tName], + hisTPetaForAlgEff_, + addn("AlgEffVsEta"), + "; #eta; Tracking efficiency"); + makeEfficiencyPlot(inputDir, + teffAlgEffVsPhi_[tName], + hisRecoTPphiForAlgEff_[tName], + hisTPphiForAlgEff_, + addn("AlgEffVsPhi"), + "; #phi; Tracking efficiency"); + + makeEfficiencyPlot(inputDir, + teffAlgEffVsD0_[tName], + hisRecoTPd0ForAlgEff_[tName], + hisTPd0ForAlgEff_, + addn("AlgEffVsD0"), + "; d0 (cm); Tracking efficiency"); + makeEfficiencyPlot(inputDir, + teffAlgEffVsZ0_[tName], + hisRecoTPz0ForAlgEff_[tName], + hisTPz0ForAlgEff_, + addn("AlgEffVsZ0"), + "; z0 (cm); Tracking efficiency"); + + makeEfficiencyPlot(inputDir, + teffAlgEffVsPhiSec_[tName], + hisRecoTPphisecForAlgEff_[tName], + hisTPphisecForAlgEff_, + addn("AlgEffVsPhiSec"), + "; #phi sector; Tracking efficiency"); + makeEfficiencyPlot(inputDir, + teffAlgEffVsEtaSec_[tName], + hisRecoTPetasecForAlgEff_[tName], + hisTPetasecForAlgEff_, + addn("AlgEffVsEtaSec"), + "; #eta sector; Tracking efficiency"); + + makeEfficiencyPlot(inputDir, + teffAlgEffVsInvPt_inJetPtG30_[tName], + hisRecoTPinvptForAlgEff_inJetPtG30_[tName], + hisTPinvptForAlgEff_inJetPtG30_, + addn("AlgEffVsInvPt_inJetPtG30"), + "; 1/Pt; Tracking efficiency"); + + makeEfficiencyPlot(inputDir, + teffAlgEffVsInvPt_inJetPtG100_[tName], + hisRecoTPinvptForAlgEff_inJetPtG100_[tName], + hisTPinvptForAlgEff_inJetPtG100_, + addn("AlgEffVsInvPt_inJetPtG100"), + "; 1/Pt; Tracking efficiency"); + + makeEfficiencyPlot(inputDir, + teffAlgEffVsInvPt_inJetPtG200_[tName], + hisRecoTPinvptForAlgEff_inJetPtG200_[tName], + hisTPinvptForAlgEff_inJetPtG200_, + addn("AlgEffVsInvPt_inJetPtG200"), + "; 1/Pt; Tracking efficiency"); + + // Also plot algorithmic efficiency to reconstruct track perfectly. + makeEfficiencyPlot(inputDir, + teffPerfAlgEffVsInvPt_[tName], + hisPerfRecoTPinvptForAlgEff_[tName], + hisTPinvptForAlgEff_, + addn("PerfAlgEffVsInvPt"), + "; 1/Pt; Tracking perfect efficiency"); + makeEfficiencyPlot(inputDir, + teffPerfAlgEffVsPt_[tName], + hisPerfRecoTPptForAlgEff_[tName], + hisTPptForAlgEff_, + addn("PerfAlgEffVsPt"), + "; Pt; Tracking perfect efficiency"); + makeEfficiencyPlot(inputDir, + teffPerfAlgEffVsEta_[tName], + hisPerfRecoTPetaForAlgEff_[tName], + hisTPetaForAlgEff_, + addn("PerfAlgEffVsEta"), + "; #eta; Tracking perfect efficiency"); + + makeEfficiencyPlot(inputDir, + teffPerfAlgEffVsPhiSec_[tName], + hisPerfRecoTPphisecForAlgEff_[tName], + hisTPphisecForAlgEff_, + addn("PerfAlgEffVsPhiSec"), + "; #phi sector; Tracking perfect efficiency"); + makeEfficiencyPlot(inputDir, + teffPerfAlgEffVsEtaSec_[tName], + hisPerfRecoTPetasecForAlgEff_[tName], + hisTPetasecForAlgEff_, + addn("PerfAlgEffVsEtaSec"), + "; #eta sector; Tracking perfect efficiency"); + + return inputDir; } - cout << "=========================================================================" << endl; - - // Print r (z) range in which each barrel layer (endcap wheel) appears. - // (Needed by firmware). - cout<mkdir(addn("Effi").Data()); + // Plot tracking efficiency + makeEfficiencyPlot(inputDir, + teffEffFitVsInvPt_[fitName], + hisFitTPinvptForEff_[fitName], + hisTPinvptForEff_, + addn("EffFitVsInvPt"), + "; 1/Pt; Tracking efficiency"); + makeEfficiencyPlot(inputDir, + teffEffFitVsPt_[fitName], + hisFitTPptForEff_[fitName], + hisTPptForEff_, + addn("EffFitVsPt"), + "; Pt; Tracking efficiency"); + makeEfficiencyPlot(inputDir, + teffEffFitVsEta_[fitName], + hisFitTPetaForEff_[fitName], + hisTPetaForEff_, + addn("EffFitVsEta"), + "; #eta; Tracking efficiency"); + makeEfficiencyPlot(inputDir, + teffEffFitVsPhi_[fitName], + hisFitTPphiForEff_[fitName], + hisTPphiForEff_, + addn("EffFitVsPhi"), + "; #phi; Tracking efficiency"); + + makeEfficiencyPlot(inputDir, + teffEffFitVsD0_[fitName], + hisFitTPd0ForEff_[fitName], + hisTPd0ForEff_, + addn("EffFitVsD0"), + "; d0 (cm); Tracking efficiency"); + makeEfficiencyPlot(inputDir, + teffEffFitVsZ0_[fitName], + hisFitTPz0ForEff_[fitName], + hisTPz0ForEff_, + addn("EffFitVsZ0"), + "; z0 (cm); Tracking efficiency"); + + // Also plot efficiency to reconstruct track perfectly. + makeEfficiencyPlot(inputDir, + teffPerfEffFitVsInvPt_[fitName], + hisPerfFitTPinvptForEff_[fitName], + hisTPinvptForEff_, + addn("PerfEffFitVsInvPt"), + "; 1/Pt; Tracking perfect efficiency"); + makeEfficiencyPlot(inputDir, + teffPerfEffFitVsPt_[fitName], + hisPerfFitTPptForEff_[fitName], + hisTPptForEff_, + addn("PerfEffFitVsPt"), + "; Pt; Tracking perfect efficiency"); + makeEfficiencyPlot(inputDir, + teffPerfEffFitVsEta_[fitName], + hisPerfFitTPetaForEff_[fitName], + hisTPetaForEff_, + addn("PerfEffFitVsEta"), + "; #eta; Tracking perfect efficiency"); + + // Plot algorithmic tracking efficiency + makeEfficiencyPlot(inputDir, + teffAlgEffFitVsInvPt_[fitName], + hisFitTPinvptForAlgEff_[fitName], + hisTPinvptForAlgEff_, + addn("AlgEffFitVsInvPt"), + "; 1/Pt; Tracking efficiency"); + makeEfficiencyPlot(inputDir, + teffAlgEffFitVsPt_[fitName], + hisFitTPptForAlgEff_[fitName], + hisTPptForAlgEff_, + addn("AlgEffFitVsPt"), + "; Pt; Tracking efficiency"); + makeEfficiencyPlot(inputDir, + teffAlgEffFitVsEta_[fitName], + hisFitTPetaForAlgEff_[fitName], + hisTPetaForAlgEff_, + addn("AlgEffFitVsEta"), + "; #eta; Tracking efficiency"); + makeEfficiencyPlot(inputDir, + teffAlgEffFitVsPhi_[fitName], + hisFitTPphiForAlgEff_[fitName], + hisTPphiForAlgEff_, + addn("AlgEffFitVsPhi"), + "; #phi; Tracking efficiency"); + + makeEfficiencyPlot(inputDir, + teffAlgEffFitVsD0_[fitName], + hisFitTPd0ForAlgEff_[fitName], + hisTPd0ForAlgEff_, + addn("AlgEffFitVsD0"), + "; d0 (cm); Tracking efficiency"); + makeEfficiencyPlot(inputDir, + teffAlgEffFitVsZ0_[fitName], + hisFitTPz0ForAlgEff_[fitName], + hisTPz0ForAlgEff_, + addn("AlgEffFitVsZ0"), + "; z0 (cm); Tracking efficiency"); + + makeEfficiencyPlot(inputDir, + teffAlgEffFitVsPhiSec_[fitName], + hisFitTPphisecForAlgEff_[fitName], + hisTPphisecForAlgEff_, + addn("AlgEffFitVsPhiSec"), + "; #phi sector; Tracking efficiency"); + makeEfficiencyPlot(inputDir, + teffAlgEffFitVsEtaSec_[fitName], + hisFitTPetasecForAlgEff_[fitName], + hisTPetasecForAlgEff_, + addn("AlgEffFitVsEtaSec"), + "; #eta sector; Tracking efficiency"); + + // Also plot algorithmic efficiency to reconstruct track perfectly. + makeEfficiencyPlot(inputDir, + teffPerfAlgEffFitVsInvPt_[fitName], + hisPerfFitTPinvptForAlgEff_[fitName], + hisTPinvptForAlgEff_, + addn("PerfAlgEffFitVsInvPt"), + "; 1/Pt; Tracking perfect efficiency"); + makeEfficiencyPlot(inputDir, + teffPerfAlgEffFitVsPt_[fitName], + hisPerfFitTPptForAlgEff_[fitName], + hisTPptForAlgEff_, + addn("PerfAlgEffFitVsPt"), + "; Pt; Tracking perfect efficiency"); + makeEfficiencyPlot(inputDir, + teffPerfAlgEffFitVsEta_[fitName], + hisPerfFitTPetaForAlgEff_[fitName], + hisTPetaForAlgEff_, + addn("Perf AlgEffFitVsEta"), + "; #eta; Tracking perfect efficiency"); + makeEfficiencyPlot(inputDir, + teffPerfAlgEffFitVsInvPt_inJetPtG30_[fitName], + hisPerfFitTPinvptForAlgEff_inJetPtG30_[fitName], + hisTPinvptForAlgEff_inJetPtG30_, + addn("PerfAlgEffFitVsInvPt_inJetPtG30"), + "; 1/Pt; Tracking perfect efficiency"); + makeEfficiencyPlot(inputDir, + teffPerfAlgEffFitVsInvPt_inJetPtG100_[fitName], + hisPerfFitTPinvptForAlgEff_inJetPtG100_[fitName], + hisTPinvptForAlgEff_inJetPtG100_, + addn("PerfAlgEffFitVsInvPt_inJetPtG100"), + "; 1/Pt; Tracking perfect efficiency"); + makeEfficiencyPlot(inputDir, + teffPerfAlgEffFitVsInvPt_inJetPtG200_[fitName], + hisPerfFitTPinvptForAlgEff_inJetPtG200_[fitName], + hisTPinvptForAlgEff_inJetPtG200_, + addn("PerfAlgEffFitVsInvPt_inJetPtG200"), + "; 1/Pt; Tracking perfect efficiency"); + + makeEfficiencyPlot(inputDir, + teffPerfAlgEffFitVsPhiSec_[fitName], + hisPerfFitTPphisecForAlgEff_[fitName], + hisTPphisecForAlgEff_, + addn("PerfAlgEffFitVsPhiSec"), + "; #phi sector; Tracking perfect efficiency"); + makeEfficiencyPlot(inputDir, + teffPerfAlgEffFitVsEtaSec_[fitName], + hisPerfFitTPetasecForAlgEff_[fitName], + hisTPetasecForAlgEff_, + addn("PerfAlgEffFitVsEtaSec"), + "; #eta sector; Tracking perfect efficiency"); + + return inputDir; } - // Print (r,|z|) range in which each module type (defined in DigitalStub) appears. - // (Needed by firmware). - cout<hybrid() && not wierdMixedMode) { - //--- Print summary of tracklet pattern reco - this->printTrackletSeedFindingPerformance(); - this->printTrackPerformance("TRACKLET"); - this->printHybridDupRemovalPerformance(); - } else { - //--- Print summary of track-finding performance after HT - this->printTrackPerformance("HT"); - //--- Optionally print summary of track-finding performance after r-z track filter. - if (ranRZfilter_) this->printTrackPerformance("RZ"); + void Histos::makeEfficiencyPlot( + TFileDirectory& inputDir, TEfficiency* outputEfficiency, TH1F* pass, TH1F* all, TString name, TString title) { + outputEfficiency = inputDir.make(*pass, *all); + outputEfficiency->SetName(name); + outputEfficiency->SetTitle(title); } - //--- Print summary of track-finding performance after helix fit, for each track fitting algorithm used. - for (const string& fitName : trackFitters_) { - this->printFitTrackPerformance(fitName); + //=== Print summary of track-finding performance after track pattern reco. + + void Histos::printTrackPerformance(string tName) { + float numTrackCands = profNumTrackCands_[tName]->GetBinContent(1); // No. of track cands + float numTrackCandsErr = profNumTrackCands_[tName]->GetBinError(1); // No. of track cands uncertainty + float numMatchedTrackCandsIncDups = + profNumTrackCands_[tName]->GetBinContent(2); // Ditto, counting only those matched to TP + float numMatchedTrackCandsExcDups = profNumTrackCands_[tName]->GetBinContent(6); // Ditto, but excluding duplicates + float numFakeTracks = numTrackCands - numMatchedTrackCandsIncDups; + float numExtraDupTracks = numMatchedTrackCandsIncDups - numMatchedTrackCandsExcDups; + float fracFake = numFakeTracks / (numTrackCands + 1.0e-6); + float fracDup = numExtraDupTracks / (numTrackCands + 1.0e-6); + + float numStubsOnTracks = profStubsOnTracks_[tName]->GetBinContent(1); + float meanStubsPerTrack = + numStubsOnTracks / (numTrackCands + 1.0e-6); //protection against demoninator equals zero. + unsigned int numRecoTPforAlg = hisRecoTPinvptForAlgEff_[tName]->GetEntries(); + // Histograms of input truth particles (e.g. hisTPinvptForAlgEff_), used for denominator of efficiencies, are identical, + // irrespective of whether made after HT or after r-z track filter, so always use the former. + unsigned int numTPforAlg = hisTPinvptForAlgEff_->GetEntries(); + unsigned int numPerfRecoTPforAlg = hisPerfRecoTPinvptForAlgEff_[tName]->GetEntries(); + float algEff = float(numRecoTPforAlg) / (numTPforAlg + 1.0e-6); //protection against demoninator equals zero. + float algEffErr = sqrt(algEff * (1 - algEff) / (numTPforAlg + 1.0e-6)); // uncertainty + float algPerfEff = + float(numPerfRecoTPforAlg) / (numTPforAlg + 1.0e-6); //protection against demoninator equals zero. + float algPerfEffErr = sqrt(algPerfEff * (1 - algPerfEff) / (numTPforAlg + 1.0e-6)); // uncertainty + + cout.setf(ios::fixed, ios::floatfield); + cout.precision(4); + + cout << "=========================================================================" << endl; + if (tName == "HT") { + cout << " TRACK-FINDING SUMMARY AFTER HOUGH TRANSFORM " << endl; + } else if (tName == "RZ") { + cout << " TRACK-FINDING SUMMARY AFTER R-Z TRACK FILTER " << endl; + } else if (tName == "TRACKLET") { + cout << " TRACK-FINDING SUMMARY AFTER TRACKLET PATTERN RECO " << endl; + } + cout << "Number of track candidates found per event = " << numTrackCands << " +- " << numTrackCandsErr << endl; + cout << " with mean stubs/track = " << meanStubsPerTrack << endl; + cout << "Fraction of track cands that are fake = " << fracFake << endl; + cout << "Fraction of track cands that are genuine, but extra duplicates = " << fracDup << endl; + cout << "Algorithmic tracking efficiency = " << numRecoTPforAlg << "/" << numTPforAlg << " = " << algEff << " +- " + << algEffErr << endl; + cout << "Perfect algorithmic tracking efficiency = " << numPerfRecoTPforAlg << "/" << numTPforAlg << " = " + << algPerfEff << " +- " << algPerfEffErr << " (no incorrect hits)" << endl; } - cout << "=========================================================================" << endl; - if (not settings_->hybrid()) { - // Check that stub filling was consistent with known limitations of HT firmware design. + //=== Print summary of track-finding performance after helix fit for given track fitter. + + void Histos::printFitTrackPerformance(string fitName) { + float numFitTracks = profNumFitTracks_[fitName]->GetBinContent(1); // No. of track cands + float numFitTracksErr = profNumFitTracks_[fitName]->GetBinError(1); // No. of track cands uncertainty + float numMatchedFitTracksIncDups = + profNumFitTracks_[fitName]->GetBinContent(2); // Ditto, counting only those matched to TP + float numMatchedFitTracksExcDups = profNumFitTracks_[fitName]->GetBinContent(6); // Ditto, but excluding duplicates + float numFakeFitTracks = numFitTracks - numMatchedFitTracksIncDups; + float numExtraDupFitTracks = numMatchedFitTracksIncDups - numMatchedFitTracksExcDups; + float fracFakeFit = numFakeFitTracks / (numFitTracks + 1.0e-6); + float fracDupFit = numExtraDupFitTracks / (numFitTracks + 1.0e-6); + + float numStubsOnFitTracks = profStubsOnFitTracks_[fitName]->GetBinContent(1); + float meanStubsPerFitTrack = + numStubsOnFitTracks / (numFitTracks + 1.0e-6); //protection against demoninator equals zero. + unsigned int numFitTPforAlg = hisFitTPinvptForAlgEff_[fitName]->GetEntries(); + // Histograms of input truth particles (e.g. hisTPinvptForAlgEff_), used for denominator of efficiencies, are identical, + // irrespective of whether made after HT or after r-z track filter, so always use the former. + unsigned int numTPforAlg = hisTPinvptForAlgEff_->GetEntries(); + unsigned int numPerfFitTPforAlg = hisPerfFitTPinvptForAlgEff_[fitName]->GetEntries(); + float fitEff = float(numFitTPforAlg) / (numTPforAlg + 1.0e-6); //protection against demoninator equals zero. + float fitEffErr = sqrt(fitEff * (1 - fitEff) / (numTPforAlg + 1.0e-6)); // uncertainty + float fitPerfEff = + float(numPerfFitTPforAlg) / (numTPforAlg + 1.0e-6); //protection against demoninator equals zero. + float fitPerfEffErr = sqrt(fitPerfEff * (1 - fitPerfEff) / (numTPforAlg + 1.0e-6)); // uncertainty + + // Does this fitter require r-z track filter to be run before it? + bool useRZfilt = (std::count(useRZfilter_.begin(), useRZfilter_.end(), fitName) > 0); + + cout << "=========================================================================" << endl; + cout << " TRACK FIT SUMMARY FOR: " << fitName << endl; + cout << "Number of fitted track candidates found per event = " << numFitTracks << " +- " << numFitTracksErr << endl; + cout << " with mean stubs/track = " << meanStubsPerFitTrack << endl; + cout << "Fraction of fitted tracks that are fake = " << fracFakeFit << endl; + cout << "Fraction of fitted tracks that are genuine, but extra duplicates = " << fracDupFit << endl; + cout << "Algorithmic fitting efficiency = " << numFitTPforAlg << "/" << numTPforAlg << " = " << fitEff << " +- " + << fitEffErr << endl; + cout << "Perfect algorithmic fitting efficiency = " << numPerfFitTPforAlg << "/" << numTPforAlg << " = " + << fitPerfEff << " +- " << fitPerfEffErr << " (no incorrect hits)" << endl; + if (useRZfilt) + cout << "(The above fitter used the '" << settings_->rzFilterName() << "' r-z track filter.)" << endl; + + /* + if ( settings_->detailedFitOutput() ){ + cout << endl<< "More detailed information about helix fit:"< 0.) { + if (settings_->hybrid() && not wierdMixedMode) { + // Produce plots of tracking efficieny after tracklet pattern reco. + this->plotTrackletSeedEfficiency(); + this->plotTrackEfficiency("TRACKLET"); + this->plotHybridDupRemovalEfficiency(); - cout<<"WARNING: Despite line gradients being less than one, some fraction of HT columns have filled cells with no filled neighbours in W, SW or NW direction. Firmware will object to this! "; - cout<<"This fraction = "<plotTrackEfficiency("HT"); - } else if (HTrphi::fracErrorsTypeB() > 0.) { + // Optionally produce plots of tracking efficiency using track candidates found after r-z track filter. + if (ranRZfilter_) + this->plotTrackEfficiency("RZ"); + } - cout<<"WARNING: Despite line gradients being less than one, some fraction of HT columns recorded individual stubs being added to more than two cells! Thomas firmware will object to this! "; - cout<<"This fraction = "<plotTrackEffAfterFit(fitName); } - } - // Check for presence of common MC bug. + cout << "=========================================================================" << endl; - float meanShared = hisFracStubsSharingClus0_->GetMean(); - if (meanShared > 0.01) cout<GetMean(2); - if (meanFracStubsLost > 0.001) cout<hybrid() && not wierdMixedMode) { + //--- Print summary of tracklet pattern reco + this->printTrackletSeedFindingPerformance(); + this->printTrackPerformance("TRACKLET"); + this->printHybridDupRemovalPerformance(); + } else { + //--- Print summary of track-finding performance after HT + this->printTrackPerformance("HT"); + //--- Optionally print summary of track-finding performance after r-z track filter. + if (ranRZfilter_) + this->printTrackPerformance("RZ"); + } -//=== Determine "B" parameter, used in GP firmware to allow for tilted modules. + //--- Print summary of track-finding performance after helix fit, for each track fitting algorithm used. + for (const string& fitName : trackFitters_) { + this->printFitTrackPerformance(fitName); + } + cout << "=========================================================================" << endl; -void Histos::trackerGeometryAnalysis( const TrackerGeometryInfo trackerGeometryInfo ) { + if (not settings_->hybrid()) { + // Check that stub filling was consistent with known limitations of HT firmware design. - // Don't bother producing summary if user didn't request histograms via TFileService in their cfg. - if ( ! this->enabled() ) return; + cout << endl << "Max. |gradients| of stub lines in HT array is: r-phi = " << HTrphi::maxLineGrad() << endl; - cout << endl << "=========================================================================" << endl; - cout << "--- Fit to cfg params for FPGA-friendly approximation to B parameter in GP & KF ---" << endl; - cout << "--- (used to allowed for tilted barrel modules) ---" << endl; - // Check that info on the correct number of modules has been stored - if ( trackerGeometryInfo.moduleZoR().size() != trackerGeometryInfo.barrelNTiltedModules() * trackerGeometryInfo.barrelNLayersWithTiltedModules() * 2 ) { - cout << "WARNING : Expected " << trackerGeometryInfo.barrelNTiltedModules() * trackerGeometryInfo.barrelNLayersWithTiltedModules() * 2 << " modules, but only recorded info on " << trackerGeometryInfo.moduleZoR().size() << endl; - } + if (HTrphi::maxLineGrad() > 1.) { + cout << "WARNING: Line |gradient| exceeds 1, which firmware will not be able to cope with! Please adjust HT " + "array size to avoid this." + << endl; + + } else if (HTrphi::fracErrorsTypeA() > 0.) { + cout << "WARNING: Despite line gradients being less than one, some fraction of HT columns have filled cells " + "with no filled neighbours in W, SW or NW direction. Firmware will object to this! "; + cout << "This fraction = " << HTrphi::fracErrorsTypeA() << " for r-phi HT" << endl; - TFileDirectory inputDir = fs_->mkdir("InputData"); - graphBVsZoverR_ = inputDir.make( trackerGeometryInfo.moduleZoR().size(), &trackerGeometryInfo.moduleZoR()[0], &trackerGeometryInfo.moduleB()[0] ); - graphBVsZoverR_->SetNameTitle("B vs module Z/R","; Module Z/R; B"); - graphBVsZoverR_->Fit("pol1","q"); - TF1* fittedFunction = graphBVsZoverR_->GetFunction("pol1"); - double gradient = fittedFunction->GetParameter(1); - double intercept = fittedFunction->GetParameter(0); - cout << " BApprox_gradient (fitted) = " << gradient << endl; - cout << " BApprox_intercept (fitted) = " << intercept << endl; - // Check fitted params consistent with those assumed in cfg file. - if (settings_->useApproxB()) { - double gradientDiff = fabs( gradient - settings_->bApprox_gradient() ); - double interceptDiff = fabs( intercept - settings_->bApprox_intercept() ); - if ( gradientDiff > 0.001 || interceptDiff > 0.001 ) { // Uncertainty independent of number of events - cout << endl << "WARNING: fitted parameters inconsistent with those specified in cfg file:" << endl; - cout << " BApprox_gradient (cfg) = " << settings_->bApprox_gradient() << endl; - cout << " BApprox_intercept (cfg) = " << settings_->bApprox_intercept() << endl; - bApproxMistake_ = true; // Note that problem has occurred. + } else if (HTrphi::fracErrorsTypeB() > 0.) { + cout << "WARNING: Despite line gradients being less than one, some fraction of HT columns recorded individual " + "stubs being added to more than two cells! Thomas firmware will object to this! "; + cout << "This fraction = " << HTrphi::fracErrorsTypeB() << " for r-phi HT" << endl; + } } + + // Check for presence of common MC bug. + + float meanShared = hisFracStubsSharingClus0_->GetMean(); + if (meanShared > 0.01) + cout << endl + << "WARNING: You are using buggy MC. A fraction " << meanShared + << " of stubs share clusters in the module seed sensor, which front-end electronics forbids." << endl; + + // Check that the constants in class DegradeBend are up to date. + float meanFracStubsLost = hisStubKillDegradeBend_->GetMean(2); + if (meanFracStubsLost > 0.001) + cout << endl + << "WARNING: You should update the constants in class DegradeBend, since some stubs had bend outside the " + "expected window range." + << endl; + + // Check if GP B approximation cfg params are inconsistent. + if (bApproxMistake_) + cout << endl << "WARNING: BApprox cfg params are inconsistent - see printout above." << endl; } -} + //=== Determine "B" parameter, used in GP firmware to allow for tilted modules. + + void Histos::trackerGeometryAnalysis(const TrackerGeometryInfo trackerGeometryInfo) { + // Don't bother producing summary if user didn't request histograms via TFileService in their cfg. + if (!this->enabled()) + return; + + cout << endl << "=========================================================================" << endl; + cout << "--- Fit to cfg params for FPGA-friendly approximation to B parameter in GP & KF ---" << endl; + cout << "--- (used to allowed for tilted barrel modules) ---" << endl; + // Check that info on the correct number of modules has been stored + if (trackerGeometryInfo.moduleZoR().size() != + trackerGeometryInfo.barrelNTiltedModules() * trackerGeometryInfo.barrelNLayersWithTiltedModules() * 2) { + cout << "WARNING : Expected " + << trackerGeometryInfo.barrelNTiltedModules() * trackerGeometryInfo.barrelNLayersWithTiltedModules() * 2 + << " modules, but only recorded info on " << trackerGeometryInfo.moduleZoR().size() << endl; + } + TFileDirectory inputDir = fs_->mkdir("InputData"); + graphBVsZoverR_ = inputDir.make( + trackerGeometryInfo.moduleZoR().size(), &trackerGeometryInfo.moduleZoR()[0], &trackerGeometryInfo.moduleB()[0]); + graphBVsZoverR_->SetNameTitle("B vs module Z/R", "; Module Z/R; B"); + graphBVsZoverR_->Fit("pol1", "q"); + TF1* fittedFunction = graphBVsZoverR_->GetFunction("pol1"); + double gradient = fittedFunction->GetParameter(1); + double intercept = fittedFunction->GetParameter(0); + cout << " BApprox_gradient (fitted) = " << gradient << endl; + cout << " BApprox_intercept (fitted) = " << intercept << endl; + // Check fitted params consistent with those assumed in cfg file. + if (settings_->useApproxB()) { + double gradientDiff = fabs(gradient - settings_->bApprox_gradient()); + double interceptDiff = fabs(intercept - settings_->bApprox_intercept()); + if (gradientDiff > 0.001 || interceptDiff > 0.001) { // Uncertainty independent of number of events + cout << endl << "WARNING: fitted parameters inconsistent with those specified in cfg file:" << endl; + cout << " BApprox_gradient (cfg) = " << settings_->bApprox_gradient() << endl; + cout << " BApprox_intercept (cfg) = " << settings_->bApprox_intercept() << endl; + bApproxMistake_ = true; // Note that problem has occurred. + } + } + } -} +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/InputData.cc b/L1Trigger/TrackFindingTMTT/src/InputData.cc index bc6fcb907231f..39283e8a10a1f 100644 --- a/L1Trigger/TrackFindingTMTT/src/InputData.cc +++ b/L1Trigger/TrackFindingTMTT/src/InputData.cc @@ -28,122 +28,123 @@ using namespace std; namespace TMTT { - -InputData::InputData(const edm::Event& iEvent, const edm::EventSetup& iSetup, Settings* settings, - const edm::EDGetTokenT tpInputTag, - const edm::EDGetTokenT stubInputTag, - const edm::EDGetTokenT stubTruthInputTag, - const edm::EDGetTokenT clusterTruthInputTag, - const edm::EDGetTokenT< reco::GenJetCollection > genJetInputTag - ) - { - - vTPs_.reserve(2500); - vStubs_.reserve(35000); - vAllStubs_.reserve(35000); - - // Note if job will use MC truth info (or skip it to save CPU). - enableMCtruth_ = settings->enableMCtruth(); - - // Get TrackingParticle info - - edm::Handle tpHandle; - - if (enableMCtruth_) { - iEvent.getByToken(tpInputTag, tpHandle ); - - unsigned int tpCount = 0; - for (unsigned int i = 0; i < tpHandle->size(); i++) { - const TrackingParticle& tPart = tpHandle->at(i); - // Creating Ptr uses CPU, so apply Pt cut here, copied from TP::fillUse(), to avoid doing it too often. - const float ptMin = min(settings->genMinPt(), 0.7*settings->houghMinPt()); - if (tPart.pt() > ptMin) { - TrackingParticlePtr tpPtr(tpHandle, i); - // Store the TrackingParticle info, using class TP to provide easy access to the most useful info. - TP tp(tpPtr, tpCount, settings); - // Only bother storing tp if it could be useful for tracking efficiency or fake rate measurements. - if (tp.use()) { - - edm::Handle< reco::GenJetCollection > genJetHandle; - iEvent.getByToken(genJetInputTag, genJetHandle); - if ( genJetHandle.isValid() ) { - tp.fillNearestJetInfo( genJetHandle.product() ); - } - vTPs_.push_back( tp ); - tpCount++; - } + InputData::InputData(const edm::Event& iEvent, + const edm::EventSetup& iSetup, + Settings* settings, + const edm::EDGetTokenT tpInputTag, + const edm::EDGetTokenT stubInputTag, + const edm::EDGetTokenT stubTruthInputTag, + const edm::EDGetTokenT clusterTruthInputTag, + const edm::EDGetTokenT genJetInputTag) { + vTPs_.reserve(2500); + vStubs_.reserve(35000); + vAllStubs_.reserve(35000); + + // Note if job will use MC truth info (or skip it to save CPU). + enableMCtruth_ = settings->enableMCtruth(); + + // Get TrackingParticle info + + edm::Handle tpHandle; + + if (enableMCtruth_) { + iEvent.getByToken(tpInputTag, tpHandle); + + unsigned int tpCount = 0; + for (unsigned int i = 0; i < tpHandle->size(); i++) { + const TrackingParticle& tPart = tpHandle->at(i); + // Creating Ptr uses CPU, so apply Pt cut here, copied from TP::fillUse(), to avoid doing it too often. + const float ptMin = min(settings->genMinPt(), 0.7 * settings->houghMinPt()); + if (tPart.pt() > ptMin) { + TrackingParticlePtr tpPtr(tpHandle, i); + // Store the TrackingParticle info, using class TP to provide easy access to the most useful info. + TP tp(tpPtr, tpCount, settings); + // Only bother storing tp if it could be useful for tracking efficiency or fake rate measurements. + if (tp.use()) { + edm::Handle genJetHandle; + iEvent.getByToken(genJetInputTag, genJetHandle); + if (genJetHandle.isValid()) { + tp.fillNearestJetInfo(genJetHandle.product()); + } + + vTPs_.push_back(tp); + tpCount++; + } + } } } - } - // Also create map relating edm::Ptr to TP. + // Also create map relating edm::Ptr to TP. - map, const TP* > translateTP; + map, const TP*> translateTP; - if (enableMCtruth_) { - for (const TP& tp : vTPs_) { - TrackingParticlePtr tpPtr(tp); - translateTP[tpPtr] = &tp; + if (enableMCtruth_) { + for (const TP& tp : vTPs_) { + TrackingParticlePtr tpPtr(tp); + translateTP[tpPtr] = &tp; + } } - } - // Get the tracker geometry info needed to unpack the stub info. + // Get the tracker geometry info needed to unpack the stub info. - edm::ESHandle trackerGeometryHandle; - iSetup.get().get( trackerGeometryHandle ); + edm::ESHandle trackerGeometryHandle; + iSetup.get().get(trackerGeometryHandle); - const TrackerGeometry* trackerGeometry = trackerGeometryHandle.product(); + const TrackerGeometry* trackerGeometry = trackerGeometryHandle.product(); - edm::ESHandle trackerTopologyHandle; - iSetup.get().get(trackerTopologyHandle); + edm::ESHandle trackerTopologyHandle; + iSetup.get().get(trackerTopologyHandle); - const TrackerTopology* trackerTopology = trackerTopologyHandle.product(); + const TrackerTopology* trackerTopology = trackerTopologyHandle.product(); - // Get stub info, by looping over modules and then stubs inside each module. - // Also get the association map from stubs to tracking particles. + // Get stub info, by looping over modules and then stubs inside each module. + // Also get the association map from stubs to tracking particles. - edm::Handle ttStubHandle; - edm::Handle mcTruthTTStubHandle; - edm::Handle mcTruthTTClusterHandle; - iEvent.getByToken(stubInputTag, ttStubHandle ); - if (enableMCtruth_) { - iEvent.getByToken(stubTruthInputTag, mcTruthTTStubHandle ); - iEvent.getByToken(clusterTruthInputTag, mcTruthTTClusterHandle ); - } + edm::Handle ttStubHandle; + edm::Handle mcTruthTTStubHandle; + edm::Handle mcTruthTTClusterHandle; + iEvent.getByToken(stubInputTag, ttStubHandle); + if (enableMCtruth_) { + iEvent.getByToken(stubTruthInputTag, mcTruthTTStubHandle); + iEvent.getByToken(clusterTruthInputTag, mcTruthTTClusterHandle); + } - unsigned int stubCount = 0; + unsigned int stubCount = 0; - for (DetSetVec::const_iterator p_module = ttStubHandle->begin(); p_module != ttStubHandle->end(); p_module++) { - for (DetSet::const_iterator p_ttstub = p_module->begin(); p_ttstub != p_module->end(); p_ttstub++) { - TTStubRef ttStubRef = edmNew::makeRefTo(ttStubHandle, p_ttstub ); + for (DetSetVec::const_iterator p_module = ttStubHandle->begin(); p_module != ttStubHandle->end(); p_module++) { + for (DetSet::const_iterator p_ttstub = p_module->begin(); p_ttstub != p_module->end(); p_ttstub++) { + TTStubRef ttStubRef = edmNew::makeRefTo(ttStubHandle, p_ttstub); - // Store the Stub info, using class Stub to provide easy access to the most useful info. - Stub stub(ttStubRef, stubCount, settings, trackerGeometry, trackerTopology ); - // Also fill truth associating stubs to tracking particles. - if (enableMCtruth_) stub.fillTruth(translateTP, mcTruthTTStubHandle, mcTruthTTClusterHandle); - vAllStubs_.push_back( stub ); - stubCount++; + // Store the Stub info, using class Stub to provide easy access to the most useful info. + Stub stub(ttStubRef, stubCount, settings, trackerGeometry, trackerTopology); + // Also fill truth associating stubs to tracking particles. + if (enableMCtruth_) + stub.fillTruth(translateTP, mcTruthTTStubHandle, mcTruthTTClusterHandle); + vAllStubs_.push_back(stub); + stubCount++; + } } - } - // Produced reduced list containing only the subset of stubs that the user has declared will be - // output by the front-end readout electronics. - for (const Stub& s : vAllStubs_) { - if (s.frontendPass()) vStubs_.push_back( &s ); - } - // Optionally sort stubs according to bend, so highest Pt ones are sent from DTC to GP first. - if (settings->orderStubsByBend()) std::sort(vStubs_.begin(), vStubs_.end(), SortStubsInBend()); - - // Note list of stubs produced by each tracking particle. - // (By passing vAllStubs_ here instead of vStubs_, it means that any algorithmic efficiencies - // measured will be reduced if the tightened frontend electronics cuts, specified in section StubCuts - // of Analyze_Defaults_cfi.py, are not 100% efficient). - if (enableMCtruth_) { - for (unsigned int j = 0; j < vTPs_.size(); j++) { - vTPs_[j].fillTruth(vAllStubs_); + // Produced reduced list containing only the subset of stubs that the user has declared will be + // output by the front-end readout electronics. + for (const Stub& s : vAllStubs_) { + if (s.frontendPass()) + vStubs_.push_back(&s); + } + // Optionally sort stubs according to bend, so highest Pt ones are sent from DTC to GP first. + if (settings->orderStubsByBend()) + std::sort(vStubs_.begin(), vStubs_.end(), SortStubsInBend()); + + // Note list of stubs produced by each tracking particle. + // (By passing vAllStubs_ here instead of vStubs_, it means that any algorithmic efficiencies + // measured will be reduced if the tightened frontend electronics cuts, specified in section StubCuts + // of Analyze_Defaults_cfi.py, are not 100% efficient). + if (enableMCtruth_) { + for (unsigned int j = 0; j < vTPs_.size(); j++) { + vTPs_[j].fillTruth(vAllStubs_); + } } } -} -} +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc b/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc index 8ffef3f2345b9..8bc760b5c6693 100644 --- a/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc +++ b/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc @@ -1,6 +1,5 @@ ///=== This is the Kalman Combinatorial Filter for 4 helix parameters track fit algorithm. - - + #include "L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h" #include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" #include "L1Trigger/TrackFindingTMTT/interface/StubCluster.h" @@ -9,8 +8,7 @@ namespace TMTT { - -/* + /* // Scattering constants - HISTORIC NOT USED. static unsigned nlayer_eta[25] = @@ -35,319 +33,311 @@ static double matx_inner[25] = { }; */ -KFParamsComb::KFParamsComb(const Settings* settings, const uint nPar, const string &fitterName ) : L1KalmanComb(settings, nPar, fitterName ){ - - hdxmin[INV2R] = -1.1e-4; - hdxmax[INV2R] = +1.1e-4; - hdxmin[PHI0] = -6.e-3; - hdxmax[PHI0] = +6.e-3; - hdxmin[Z0] = -4.1; - hdxmax[Z0] = +4.1; - hdxmin[T] = -6.; - hdxmax[T] = +6.; - if (nPar_ == 5) { - hdxmin[D0] = -1.001; - hdxmax[D0] = +1.001; - } + KFParamsComb::KFParamsComb(const Settings* settings, const uint nPar, const string& fitterName) + : L1KalmanComb(settings, nPar, fitterName) { + hdxmin[INV2R] = -1.1e-4; + hdxmax[INV2R] = +1.1e-4; + hdxmin[PHI0] = -6.e-3; + hdxmax[PHI0] = +6.e-3; + hdxmin[Z0] = -4.1; + hdxmax[Z0] = +4.1; + hdxmin[T] = -6.; + hdxmax[T] = +6.; + if (nPar_ == 5) { + hdxmin[D0] = -1.001; + hdxmax[D0] = +1.001; + } - hxmin[INV2R] = -0.3 * 0.0057; - hxmax[INV2R] = +0.3 * 0.0057; - hxmin[PHI0] = -0.3; - hxmax[PHI0] = +0.3; - hxmin[Z0] = -120; - hxmax[Z0] = +120; - hxmin[T] = -6.; - hxmax[T] = +6.; - if (nPar_ == 5) { - hxmin[D0] = -3.5; - hxmax[D0] = +3.5; - } + hxmin[INV2R] = -0.3 * 0.0057; + hxmax[INV2R] = +0.3 * 0.0057; + hxmin[PHI0] = -0.3; + hxmax[PHI0] = +0.3; + hxmin[Z0] = -120; + hxmax[Z0] = +120; + hxmin[T] = -6.; + hxmax[T] = +6.; + if (nPar_ == 5) { + hxmin[D0] = -3.5; + hxmax[D0] = +3.5; + } - hddMeasmin[PHI0] = -1.e1; - hddMeasmax[PHI0] = +1.e1; - - hresmin[PHI0] = -0.5; - hresmax[PHI0] = +0.5; - - hresmin[PHI0] = -10.; - hresmax[PHI0] = +10.; - - hxaxtmin[INV2R] = -1.e-3; - hxaxtmax[INV2R] = +1.e-3; - hxaxtmin[PHI0] = -1.e-1; - hxaxtmax[PHI0] = +1.e-1; - hxaxtmin[Z0] = -10.; - hxaxtmax[Z0] = +10.; - hxaxtmin[T] = -1.e-0; - hxaxtmax[T] = +1.e-0; - if (nPar_ == 5) { - hxaxtmin[D0] = -1.001; - hxaxtmax[D0] = +1.001; - } -} + hddMeasmin[PHI0] = -1.e1; + hddMeasmax[PHI0] = +1.e1; + hresmin[PHI0] = -0.5; + hresmax[PHI0] = +0.5; -std::map KFParamsComb::getTrackParams(const KalmanState *state )const{ + hresmin[PHI0] = -10.; + hresmax[PHI0] = +10.; - std::vector x = state->xa(); - std::map y; - y["qOverPt"] = 2. * x.at(INV2R) / getSettings()->invPtToInvR(); - y["phi0"] = reco::deltaPhi( x.at(PHI0) + sectorPhi(), 0. ); - y["z0"] = x.at(Z0); - y["t"] = x.at(T); - if (nPar_ == 5) { - y["d0"] = x.at(D0); + hxaxtmin[INV2R] = -1.e-3; + hxaxtmax[INV2R] = +1.e-3; + hxaxtmin[PHI0] = -1.e-1; + hxaxtmax[PHI0] = +1.e-1; + hxaxtmin[Z0] = -10.; + hxaxtmax[Z0] = +10.; + hxaxtmin[T] = -1.e-0; + hxaxtmax[T] = +1.e-0; + if (nPar_ == 5) { + hxaxtmin[D0] = -1.001; + hxaxtmax[D0] = +1.001; + } } - return y; -} - -/* If using 5 param helix fit, get track params with beam-spot constraint & track fit chi2 from applying it. */ -/* (N.B. chi2rz unchanged by constraint) */ -std::map KFParamsComb::getTrackParams_BeamConstr( const KalmanState *state, double& chi2rphi ) const { - if (nPar_ == 5) { - std::map y; + std::map KFParamsComb::getTrackParams(const KalmanState* state) const { std::vector x = state->xa(); - TMatrixD cov_xa = state->pxxa(); - double deltaChi2rphi = (x.at(D0) * x.at(D0)) / cov_xa[D0][D0]; - chi2rphi = state->chi2rphi() + deltaChi2rphi; - // Apply beam-spot constraint to helix params in transverse plane only, as most sensitive to it. - x[INV2R] -= x.at(D0) * (cov_xa[INV2R][D0] / cov_xa[D0][D0]); - x[PHI0 ] -= x.at(D0) * (cov_xa[PHI0 ][D0] / cov_xa[D0][D0]); - x[D0 ] = 0.0; - y["qOverPt"] = 2. * x.at(INV2R) / getSettings()->invPtToInvR(); - y["phi0"] = reco::deltaPhi( x.at(PHI0) + sectorPhi(), 0. ); - y["z0"] = x.at(Z0); - y["t"] = x.at(T); - y["d0"] = x.at(D0); + std::map y; + y["qOverPt"] = 2. * x.at(INV2R) / getSettings()->invPtToInvR(); + y["phi0"] = reco::deltaPhi(x.at(PHI0) + sectorPhi(), 0.); + y["z0"] = x.at(Z0); + y["t"] = x.at(T); + if (nPar_ == 5) { + y["d0"] = x.at(D0); + } return y; - } else { - return (this->getTrackParams(state)); } -} - -/* The Kalman measurement matrix = derivative of helix intercept w.r.t. helix params - * Here I always measure phi(r), and z(r) */ -TMatrixD KFParamsComb::H(const StubCluster* stubCluster)const{ - TMatrixD h(2, nPar_); - double r = stubCluster->r(); - h(PHI,INV2R) = -r; - h(PHI,PHI0) = 1; - if (nPar_ == 5) { - h(PHI,D0) = -1./r; + /* If using 5 param helix fit, get track params with beam-spot constraint & track fit chi2 from applying it. */ + /* (N.B. chi2rz unchanged by constraint) */ + + std::map KFParamsComb::getTrackParams_BeamConstr(const KalmanState* state, + double& chi2rphi) const { + if (nPar_ == 5) { + std::map y; + std::vector x = state->xa(); + TMatrixD cov_xa = state->pxxa(); + double deltaChi2rphi = (x.at(D0) * x.at(D0)) / cov_xa[D0][D0]; + chi2rphi = state->chi2rphi() + deltaChi2rphi; + // Apply beam-spot constraint to helix params in transverse plane only, as most sensitive to it. + x[INV2R] -= x.at(D0) * (cov_xa[INV2R][D0] / cov_xa[D0][D0]); + x[PHI0] -= x.at(D0) * (cov_xa[PHI0][D0] / cov_xa[D0][D0]); + x[D0] = 0.0; + y["qOverPt"] = 2. * x.at(INV2R) / getSettings()->invPtToInvR(); + y["phi0"] = reco::deltaPhi(x.at(PHI0) + sectorPhi(), 0.); + y["z0"] = x.at(Z0); + y["t"] = x.at(T); + y["d0"] = x.at(D0); + return y; + } else { + return (this->getTrackParams(state)); + } } - h(Z,Z0) = 1; - h(Z,T) = r; - return h; -} -// Not used? + /* The Kalman measurement matrix = derivative of helix intercept w.r.t. helix params + * Here I always measure phi(r), and z(r) */ + TMatrixD KFParamsComb::H(const StubCluster* stubCluster) const { + TMatrixD h(2, nPar_); + double r = stubCluster->r(); + h(PHI, INV2R) = -r; + h(PHI, PHI0) = 1; + if (nPar_ == 5) { + h(PHI, D0) = -1. / r; + } + h(Z, Z0) = 1; + h(Z, T) = r; + return h; + } -TMatrixD KFParamsComb::dH(const StubCluster* stubCluster)const{ + // Not used? - double dr(0); - if(stubCluster->layerId() > 10){ - dr = stubCluster->sigmaZ(); - } + TMatrixD KFParamsComb::dH(const StubCluster* stubCluster) const { + double dr(0); + if (stubCluster->layerId() > 10) { + dr = stubCluster->sigmaZ(); + } - double r = stubCluster->r(); + double r = stubCluster->r(); - TMatrixD h(2, nPar_); - h(PHI,INV2R) = -dr; - if (nPar_ == 5) { - h(PHI,D0) = dr/(r*r); - } - h(Z,T) = dr; - - return h; -} - -/* Seed the state vector */ -std::vector KFParamsComb::seedx(const L1track3D& l1track3D)const{ - - std::vector x(nPar_); - x[INV2R] = getSettings()->invPtToInvR() * l1track3D.qOverPt()/2; - x[PHI0] = reco::deltaPhi( l1track3D.phi0() - sectorPhi(), 0. ); - x[Z0] = l1track3D.z0(); - x[T] = l1track3D.tanLambda(); - if (nPar_ == 5) { - x[D0] = l1track3D.d0(); - } - - return x; -} - -/* Seed the covariance matrix */ -TMatrixD KFParamsComb::seedP(const L1track3D& l1track3D)const{ - TMatrixD p(nPar_,nPar_); - - double invPtToInv2R = getSettings()->invPtToInvR() / 2; - - // Assumed track seed (from HT) uncertainty in transverse impact parameter. - const float d0Sigma = 1.0; - - if (getSettings()->hybrid()) { - - p(INV2R,INV2R) = 0.0157 * 0.0157 * invPtToInv2R * invPtToInv2R * 4; - p(PHI0,PHI0) = 0.0051 * 0.0051 * 4; - p(Z0,Z0) = 5.0 * 5.0; - p(T,T) = 0.25 * 0.25 * 4; - // N.B. (z0, tanL, d0) seed uncertainties could be smaller for hybrid, if seeded in PS? -- not tried - //if (l1track3D.seedPS() > 0) { // Tracklet seed used PS layers - // p(Z0,Z0) /= (4.*4.).; - // p(T,T) /= (4.*4.); - // } + TMatrixD h(2, nPar_); + h(PHI, INV2R) = -dr; if (nPar_ == 5) { - p(D0,D0) = d0Sigma * d0Sigma; - } + h(PHI, D0) = dr / (r * r); + } + h(Z, T) = dr; - } else { + return h; + } - // optimised for 18x2 with additional error factor in pt/phi to avoid pulling towards wrong HT params - p(INV2R,INV2R) = 0.0157 * 0.0157 * invPtToInv2R * invPtToInv2R * 4; // Base on HT cell size - p(PHI0,PHI0) = 0.0051 * 0.0051 * 4; // Based on HT cell size. - p(Z0,Z0) = 5.0 * 5.0; - p(T,T) = 0.25 * 0.25 * 4; // IRT: increased by factor 4, as was affecting fit chi2. + /* Seed the state vector */ + std::vector KFParamsComb::seedx(const L1track3D& l1track3D) const { + std::vector x(nPar_); + x[INV2R] = getSettings()->invPtToInvR() * l1track3D.qOverPt() / 2; + x[PHI0] = reco::deltaPhi(l1track3D.phi0() - sectorPhi(), 0.); + x[Z0] = l1track3D.z0(); + x[T] = l1track3D.tanLambda(); if (nPar_ == 5) { - p(D0,D0) = d0Sigma * d0Sigma; - } - - if ( getSettings()->numEtaRegions() <= 12 ) { - // Inflate eta errors - p(T,T) = p(T,T) * 2 * 2; + x[D0] = l1track3D.d0(); } - } - return p; -} + return x; + } -/* The forecast matrix - * (here equals identity matrix) */ -TMatrixD KFParamsComb::F(const StubCluster* stubCluster, const KalmanState *state )const{ - TMatrixD F(nPar_,nPar_); - for(unsigned int n = 0; n < nPar_; n++) - F(n, n) = 1; - return F; -} - -/* the vector of measurements */ -std::vector KFParamsComb::d(const StubCluster* stubCluster )const{ - std::vector meas; - meas.resize(2); - meas[PHI] = reco::deltaPhi( stubCluster->phi(), sectorPhi() ); - meas[Z] = stubCluster->z(); - return meas; -} - -// Assumed hit resolution in (phi,z) -TMatrixD KFParamsComb::PddMeas(const StubCluster* stubCluster, const KalmanState *state )const{ - - double inv2R = (getSettings()->invPtToInvR()) * 0.5 * state->candidate().qOverPt(); // alternatively use state->xa().at(INV2R) - double inv2R2 = inv2R * inv2R; - - double tanl = state->xa().at(T); // factor of 0.9 improves rejection - double tanl2 = tanl * tanl; - - TMatrixD p(2,2); - - double vphi(0); - double vz(0); - double vcorr(0); - - // consider error due to integerisation only for z (r in encap) coord when enabled - double err_digi2(0); - if (getSettings()->enableDigitize()) err_digi2 = 0.15625 * 0.15625 / 12.0; - - double a = stubCluster->sigmaX() * stubCluster->sigmaX(); - double b = stubCluster->sigmaZ() * stubCluster->sigmaZ() + err_digi2; - double r2 = stubCluster->r() * stubCluster->r(); - double invr2 = 1./r2; - - // Scattering term scaling as 1/Pt. - double sigmaScat = getSettings()->kalmanMultiScattTerm()/(state->candidate().pt()); - double sigmaScat2 = sigmaScat * sigmaScat; - - if ( stubCluster->barrel() ) { - - vphi = (a * invr2) + sigmaScat2; - - if (stubCluster->tiltedBarrel()) { - // Convert uncertainty in (r,phi) to (z,phi). - float scaleTilted = 1.; - if (getSettings()->kalmanHOtilted()) { - if ( getSettings()->useApproxB() ) { // Simple firmware approximation - scaleTilted = getApproxB(stubCluster->z(), stubCluster->r()); - } else { // Exact C++ implementation. - float tilt = stubCluster->moduleTilt(); - scaleTilted = sin(tilt) + cos(tilt)*tanl; - } + /* Seed the covariance matrix */ + TMatrixD KFParamsComb::seedP(const L1track3D& l1track3D) const { + TMatrixD p(nPar_, nPar_); + + double invPtToInv2R = getSettings()->invPtToInvR() / 2; + + // Assumed track seed (from HT) uncertainty in transverse impact parameter. + const float d0Sigma = 1.0; + + if (getSettings()->hybrid()) { + p(INV2R, INV2R) = 0.0157 * 0.0157 * invPtToInv2R * invPtToInv2R * 4; + p(PHI0, PHI0) = 0.0051 * 0.0051 * 4; + p(Z0, Z0) = 5.0 * 5.0; + p(T, T) = 0.25 * 0.25 * 4; + // N.B. (z0, tanL, d0) seed uncertainties could be smaller for hybrid, if seeded in PS? -- not tried + //if (l1track3D.seedPS() > 0) { // Tracklet seed used PS layers + // p(Z0,Z0) /= (4.*4.).; + // p(T,T) /= (4.*4.); + // } + if (nPar_ == 5) { + p(D0, D0) = d0Sigma * d0Sigma; } - float scaleTilted2 = scaleTilted*scaleTilted; - // This neglects the non-radial strip effect, assumed negligeable for PS. - vz = b * scaleTilted2; + } else { - vz = b; - } + // optimised for 18x2 with additional error factor in pt/phi to avoid pulling towards wrong HT params + p(INV2R, INV2R) = 0.0157 * 0.0157 * invPtToInv2R * invPtToInv2R * 4; // Base on HT cell size + p(PHI0, PHI0) = 0.0051 * 0.0051 * 4; // Based on HT cell size. + p(Z0, Z0) = 5.0 * 5.0; + p(T, T) = 0.25 * 0.25 * 4; // IRT: increased by factor 4, as was affecting fit chi2. + if (nPar_ == 5) { + p(D0, D0) = d0Sigma * d0Sigma; + } - if (getSettings()->kalmanHOdodgy()) { - // Use original (Dec. 2016) dodgy implementation was this. - vz = b; + if (getSettings()->numEtaRegions() <= 12) { + // Inflate eta errors + p(T, T) = p(T, T) * 2 * 2; + } } - } else { - - vphi = a * invr2 + sigmaScat2; - vz = (b * tanl2); - - if (not stubCluster->psModule()) { // Neglect these terms in PS - double beta = 0.; - // Add correlation term related to conversion of stub residuals from (r,phi) to (z,phi). - if (getSettings()->kalmanHOprojZcorr() == 2) beta += -inv2R; - // Add alpha correction for non-radial 2S endcap strips.. - if (getSettings()->kalmanHOalpha() == 2) beta += -stubCluster->alpha(); // alpha is 0 except in endcap 2S disks + return p; + } - double beta2 = beta * beta; - vphi += b * beta2; - vcorr = b * (beta * tanl); + /* The forecast matrix + * (here equals identity matrix) */ + TMatrixD KFParamsComb::F(const StubCluster* stubCluster, const KalmanState* state) const { + TMatrixD F(nPar_, nPar_); + for (unsigned int n = 0; n < nPar_; n++) + F(n, n) = 1; + return F; + } - // IRT - for checking efficiency of removing phi-z correlation from projection. - // "ultimate_off1" - //vphi = a * invr2 + b * pow(-stubCluster->alpha(), 2) + b * inv2R2 + sigmaScat2; - //vcorr = b * ((-stubCluster->alpha()) * tanl); + /* the vector of measurements */ + std::vector KFParamsComb::d(const StubCluster* stubCluster) const { + std::vector meas; + meas.resize(2); + meas[PHI] = reco::deltaPhi(stubCluster->phi(), sectorPhi()); + meas[Z] = stubCluster->z(); + return meas; + } - // IRT - This higher order correction doesn't significantly improve the track fit performance, so commented out. - //if (getSettings()->kalmanHOhelixExp()) { - // float dsByDr = 1. + (1./2.)*r2*inv2R2; // Allows for z = z0 + s*tanL, where s is not exactly r due to circle. - // vcorr *= dsByDr; - // vz *= dsByDr * dsByDr; - //} + // Assumed hit resolution in (phi,z) + TMatrixD KFParamsComb::PddMeas(const StubCluster* stubCluster, const KalmanState* state) const { + double inv2R = + (getSettings()->invPtToInvR()) * 0.5 * state->candidate().qOverPt(); // alternatively use state->xa().at(INV2R) + double inv2R2 = inv2R * inv2R; + + double tanl = state->xa().at(T); // factor of 0.9 improves rejection + double tanl2 = tanl * tanl; + + TMatrixD p(2, 2); + + double vphi(0); + double vz(0); + double vcorr(0); + + // consider error due to integerisation only for z (r in encap) coord when enabled + double err_digi2(0); + if (getSettings()->enableDigitize()) + err_digi2 = 0.15625 * 0.15625 / 12.0; + + double a = stubCluster->sigmaX() * stubCluster->sigmaX(); + double b = stubCluster->sigmaZ() * stubCluster->sigmaZ() + err_digi2; + double r2 = stubCluster->r() * stubCluster->r(); + double invr2 = 1. / r2; + + // Scattering term scaling as 1/Pt. + double sigmaScat = getSettings()->kalmanMultiScattTerm() / (state->candidate().pt()); + double sigmaScat2 = sigmaScat * sigmaScat; + + if (stubCluster->barrel()) { + vphi = (a * invr2) + sigmaScat2; + + if (stubCluster->tiltedBarrel()) { + // Convert uncertainty in (r,phi) to (z,phi). + float scaleTilted = 1.; + if (getSettings()->kalmanHOtilted()) { + if (getSettings()->useApproxB()) { // Simple firmware approximation + scaleTilted = getApproxB(stubCluster->z(), stubCluster->r()); + } else { // Exact C++ implementation. + float tilt = stubCluster->moduleTilt(); + scaleTilted = sin(tilt) + cos(tilt) * tanl; + } + } + float scaleTilted2 = scaleTilted * scaleTilted; + // This neglects the non-radial strip effect, assumed negligeable for PS. + vz = b * scaleTilted2; + } else { + vz = b; + } if (getSettings()->kalmanHOdodgy()) { // Use original (Dec. 2016) dodgy implementation was this. - vphi = (a * invr2) + (b * inv2R2) + sigmaScat2; - vcorr = 0.; - vz = (b * tanl2); + vz = b; } - } - } - p(PHI, PHI) = vphi; - p(Z, Z) = vz; - p(PHI, Z) = vcorr; - p(Z, PHI) = vcorr; - - return p; + } else { + vphi = a * invr2 + sigmaScat2; + vz = (b * tanl2); + + if (not stubCluster->psModule()) { // Neglect these terms in PS + double beta = 0.; + // Add correlation term related to conversion of stub residuals from (r,phi) to (z,phi). + if (getSettings()->kalmanHOprojZcorr() == 2) + beta += -inv2R; + // Add alpha correction for non-radial 2S endcap strips.. + if (getSettings()->kalmanHOalpha() == 2) + beta += -stubCluster->alpha(); // alpha is 0 except in endcap 2S disks + + double beta2 = beta * beta; + vphi += b * beta2; + vcorr = b * (beta * tanl); + + // IRT - for checking efficiency of removing phi-z correlation from projection. + // "ultimate_off1" + //vphi = a * invr2 + b * pow(-stubCluster->alpha(), 2) + b * inv2R2 + sigmaScat2; + //vcorr = b * ((-stubCluster->alpha()) * tanl); + + // IRT - This higher order correction doesn't significantly improve the track fit performance, so commented out. + //if (getSettings()->kalmanHOhelixExp()) { + // float dsByDr = 1. + (1./2.)*r2*inv2R2; // Allows for z = z0 + s*tanL, where s is not exactly r due to circle. + // vcorr *= dsByDr; + // vz *= dsByDr * dsByDr; + //} + + if (getSettings()->kalmanHOdodgy()) { + // Use original (Dec. 2016) dodgy implementation was this. + vphi = (a * invr2) + (b * inv2R2) + sigmaScat2; + vcorr = 0.; + vz = (b * tanl2); + } + } + } -} + p(PHI, PHI) = vphi; + p(Z, Z) = vz; + p(PHI, Z) = vcorr; + p(Z, PHI) = vcorr; -// State uncertainty due to scattering -- HISTORIC NOT USED -TMatrixD KFParamsComb::PxxModel( const KalmanState *state, const StubCluster *stubCluster )const -{ + return p; + } - TMatrixD p(nPar_,nPar_); + // State uncertainty due to scattering -- HISTORIC NOT USED + TMatrixD KFParamsComb::PxxModel(const KalmanState* state, const StubCluster* stubCluster) const { + TMatrixD p(nPar_, nPar_); - /* + /* if( getSettings()->kalmanMultiScattFactor() ){ unsigned i_eta = abs( stubCluster->eta() / 0.1 ); @@ -370,91 +360,106 @@ TMatrixD KFParamsComb::PxxModel( const KalmanState *state, const StubCluster *st } */ - return p; -} - -bool KFParamsComb::isGoodState( const KalmanState &state )const -{ - // Cut values. (Layer 0 entry here is dummy). -- todo : make configurable - - vector z0Cut, ptTolerance, d0Cut, chi2Cut; - // Layer = 0 1 2 3 4 5 6 - ptTolerance = { 999., 999., 0.1, 0.1, 0.05, 0.05, 0.05}; - d0Cut = { 999., 999., 999., 10., 10., 10., 10.}; // Only used for 5 param fit. - if (nPar_ == 5) { // specific cuts for displaced tracking case. - // Layer = 0 1 2 3 4 5 6 - z0Cut = { 999., 999., 1.7*15., 1.7*15., 1.7*15., 1.7*15., 1.7*15.}; // Larger values require digisation change. - chi2Cut = { 999., 999., 10., 30., 80., 120., 160.}; // Maybe loosen for high d0 ? - } else { // specific cuts for prompt tracking case. - // Layer = 0 1 2 3 4 5 6 - z0Cut = { 999., 999., 15., 15., 15., 15., 15.}; - chi2Cut = { 999., 999., 10., 30., 80., 120., 160.}; - } - - unsigned nStubLayers = state.nStubLayers(); - bool goodState( true ); - - std::map y = getTrackParams( &state ); - double qOverPt = y["qOverPt"]; - double pt=fabs( 1/qOverPt ); - double z0=fabs( y["z0"] ); - - // state parameter selections - - if (z0 > z0Cut[nStubLayers] ) goodState = false; - if( pt < getSettings()->houghMinPt() - ptTolerance[nStubLayers] ) goodState = false; - if (nPar_ == 5) { - double d0=fabs( state.xa()[D0] ); - if( d0 > d0Cut[nStubLayers] ) goodState = false; + return p; } - // chi2 selection + bool KFParamsComb::isGoodState(const KalmanState& state) const { + // Cut values. (Layer 0 entry here is dummy). -- todo : make configurable + + vector z0Cut, ptTolerance, d0Cut, chi2Cut; + // Layer = 0 1 2 3 4 5 6 + ptTolerance = {999., 999., 0.1, 0.1, 0.05, 0.05, 0.05}; + d0Cut = {999., 999., 999., 10., 10., 10., 10.}; // Only used for 5 param fit. + if (nPar_ == 5) { // specific cuts for displaced tracking case. + // Layer = 0 1 2 3 4 5 6 + z0Cut = { + 999., 999., 1.7 * 15., 1.7 * 15., 1.7 * 15., 1.7 * 15., 1.7 * 15.}; // Larger values require digisation change. + chi2Cut = {999., 999., 10., 30., 80., 120., 160.}; // Maybe loosen for high d0 ? + } else { // specific cuts for prompt tracking case. + // Layer = 0 1 2 3 4 5 6 + z0Cut = {999., 999., 15., 15., 15., 15., 15.}; + chi2Cut = {999., 999., 10., 30., 80., 120., 160.}; + } - double chi2scaled = state.chi2scaled(); // chi2(r-phi) scaled down to improve electron performance. + unsigned nStubLayers = state.nStubLayers(); + bool goodState(true); - if (getSettings()->kalmanMultiScattTerm() > 0.0001) { // Scattering taken into account + std::map y = getTrackParams(&state); + double qOverPt = y["qOverPt"]; + double pt = fabs(1 / qOverPt); + double z0 = fabs(y["z0"]); - if (chi2scaled > chi2Cut[nStubLayers]) goodState=false; // No separate pT selection needed + // state parameter selections - } else { // scattering ignored - HISTORIC + if (z0 > z0Cut[nStubLayers]) + goodState = false; + if (pt < getSettings()->houghMinPt() - ptTolerance[nStubLayers]) + goodState = false; + if (nPar_ == 5) { + double d0 = fabs(state.xa()[D0]); + if (d0 > d0Cut[nStubLayers]) + goodState = false; + } - // N.B. Code below changed by Alexander Morton to allow tracking down to Pt = 2 GeV. - if( nStubLayers == 2 ) { - if (chi2scaled > 15.0) goodState=false; // No separate pT selection needed - } else if ( nStubLayers == 3 ) { - if (chi2scaled > 100.0 && pt > 2.7) goodState=false; - if (chi2scaled > 120.0 && pt <= 2.7) goodState=false; - } else if ( nStubLayers == 4 ) { - if (chi2scaled > 320.0 && pt > 2.7) goodState=false; - if (chi2scaled > 1420.0 && pt <= 2.7) goodState=false; - } else if ( nStubLayers == 5 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! - if (chi2scaled > 480.0 && pt > 2.7) goodState=false; - if (chi2scaled > 2130.0 && pt <= 2.7) goodState=false; - } else if ( nStubLayers >= 6 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! - if (chi2scaled > 640.0 && pt > 2.7) goodState=false; - if (chi2scaled > 2840.0 && pt <= 2.7) goodState=false; + // chi2 selection + + double chi2scaled = state.chi2scaled(); // chi2(r-phi) scaled down to improve electron performance. + + if (getSettings()->kalmanMultiScattTerm() > 0.0001) { // Scattering taken into account + + if (chi2scaled > chi2Cut[nStubLayers]) + goodState = false; // No separate pT selection needed + + } else { // scattering ignored - HISTORIC + + // N.B. Code below changed by Alexander Morton to allow tracking down to Pt = 2 GeV. + if (nStubLayers == 2) { + if (chi2scaled > 15.0) + goodState = false; // No separate pT selection needed + } else if (nStubLayers == 3) { + if (chi2scaled > 100.0 && pt > 2.7) + goodState = false; + if (chi2scaled > 120.0 && pt <= 2.7) + goodState = false; + } else if (nStubLayers == 4) { + if (chi2scaled > 320.0 && pt > 2.7) + goodState = false; + if (chi2scaled > 1420.0 && pt <= 2.7) + goodState = false; + } else if (nStubLayers == 5) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! + if (chi2scaled > 480.0 && pt > 2.7) + goodState = false; + if (chi2scaled > 2130.0 && pt <= 2.7) + goodState = false; + } else if (nStubLayers >= 6) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! + if (chi2scaled > 640.0 && pt > 2.7) + goodState = false; + if (chi2scaled > 2840.0 && pt <= 2.7) + goodState = false; + } } - } + const bool countUpdateCalls = false; // Print statement to count calls to Updator. + + if (countUpdateCalls || (getSettings()->kalmanDebugLevel() >= 2 && tpa_ != nullptr) || + (getSettings()->kalmanDebugLevel() >= 2 && getSettings()->hybrid())) { + if (not goodState) + cout << "State veto:"; + if (goodState) + cout << "State kept:"; + cout << " nlay=" << nStubLayers << " nskip=" << state.nSkippedLayers() << " chi2_scaled=" << chi2scaled; + if (tpa_ != nullptr) + cout << " pt(mc)=" << tpa_->pt(); + cout << " pt=" << pt << " q/pt=" << qOverPt << " tanL=" << y["t"] << " z0=" << y["z0"] << " phi0=" << y["phi0"]; + if (nPar_ == 5) + cout << " d0=" << y["d0"]; + cout << " fake" << (tpa_ == nullptr); + if (tpa_ != nullptr) + cout << " pt(mc)=" << tpa_->pt(); + cout << endl; + } - const bool countUpdateCalls = false; // Print statement to count calls to Updator. - - if ( countUpdateCalls || - (getSettings()->kalmanDebugLevel() >= 2 && tpa_ != nullptr) || - (getSettings()->kalmanDebugLevel() >= 2 && getSettings()->hybrid()) ) { - if (not goodState) cout<<"State veto:"; - if (goodState) cout<<"State kept:"; - cout<<" nlay="<qOverPt(); - tp_x["phi0"] = tp->phi0(); - tp_x["z0"] = tp->z0(); - tp_x["t"] = tp->tanLambda(); - tp_x["d0"] = tp->d0(); + if (tp) { + useForAlgEff = tp->useForAlgEff(); + tp_x["qOverPt"] = tp->qOverPt(); + tp_x["phi0"] = tp->phi0(); + tp_x["z0"] = tp->z0(); + tp_x["t"] = tp->tanLambda(); + tp_x["d0"] = tp->d0(); } - std::map y = fXtoTrackParams_( fitter_, this ); + std::map y = fXtoTrackParams_(fitter_, this); os << "KalmanState : "; os << "next Kalman layer = " << kLayerNext_ << ", "; @@ -185,69 +207,69 @@ void KalmanState::dump( ostream &os, const TP *tp, bool all )const os << " n_skipped = " << n_skipped_ << ", "; os << "barrel = " << barrel_ << ", "; os << "endcapRing = " << endcapRing_ << ", "; - os << "r = " << r_ << ", "; + os << "r = " << r_ << ", "; os << "z = " << z_ << ", "; - for( auto pair : y ){ - os << pair.first << ":" << y[pair.first] << " "; + for (auto pair : y) { + os << pair.first << ":" << y[pair.first] << " "; } os << endl; os << "xa = ( "; - for( unsigned i=0; iindex() << " "; - os << "layerId : " << stub->layerId() << " "; - os << "[r,phi,z] = "; - os << "[" << stub->r() << ", " << stub->phi() << ", " << stub->z() << "] "; - os << " assoc TP indices = [ "; - std::set tps = stub->assocTPs(); - for( auto tp : tps ) os << tp->index() << " "; - os << "] "; - os << endl; + for (auto &stub : stub_list) { + os << " stub "; + // os << "[" << stub << "] "; + os << "index : " << stub->index() << " "; + os << "layerId : " << stub->layerId() << " "; + os << "[r,phi,z] = "; + os << "[" << stub->r() << ", " << stub->phi() << ", " << stub->z() << "] "; + os << " assoc TP indices = [ "; + std::set tps = stub->assocTPs(); + for (auto tp : tps) + os << tp->index() << " "; + os << "] "; + os << endl; } - if( tp ){ - os << "\tTP index = " << tp->index() << " useForAlgEff = " << useForAlgEff << " "; - os << "rel. residual "; - for( auto pair : tp_x ){ - os << pair.first << ":" << ( y[pair.first] - pair.second ) / pair.second << " "; - } - } - else{ - os << "\tTP index = "; + if (tp) { + os << "\tTP index = " << tp->index() << " useForAlgEff = " << useForAlgEff << " "; + os << "rel. residual "; + for (auto pair : tp_x) { + os << pair.first << ":" << (y[pair.first] - pair.second) / pair.second << " "; + } + } else { + os << "\tTP index = "; } os << endl; - if( stubCluster_ ){ - os << "\tstub [r,phi,z] = "; - os << "[" << stubCluster_->r() << ", " << stubCluster_->phi() << ", " << stubCluster_->z() << "] "; - os << " assoc TP indices = [ "; - std::set tps = stubCluster_->assocTPs(); - for( auto tp : tps ) os << tp->index() << " "; - os << "] "; - } - else{ - os << "\tvirtual stub"; + if (stubCluster_) { + os << "\tstub [r,phi,z] = "; + os << "[" << stubCluster_->r() << ", " << stubCluster_->phi() << ", " << stubCluster_->z() << "] "; + os << " assoc TP indices = [ "; + std::set tps = stubCluster_->assocTPs(); + for (auto tp : tps) + os << tp->index() << " "; + os << "] "; + } else { + os << "\tvirtual stub"; } os << endl; - if( all ){ - const KalmanState *state = last_state(); - if( state ){ - state->dump( os, tp, all ); - // state = state->last_state(); - } - else return; + if (all) { + const KalmanState *state = last_state(); + if (state) { + state->dump(os, tp, all); + // state = state->last_state(); + } else + return; } -} - -} + } +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/KillDupFitTrks.cc b/L1Trigger/TrackFindingTMTT/src/KillDupFitTrks.cc index c2cd0eb771a52..761422d88b086 100644 --- a/L1Trigger/TrackFindingTMTT/src/KillDupFitTrks.cc +++ b/L1Trigger/TrackFindingTMTT/src/KillDupFitTrks.cc @@ -5,239 +5,271 @@ namespace TMTT { -//=== Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. + //=== Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. -void KillDupFitTrks::init(const Settings* settings, unsigned int dupTrkAlg) -{ - settings_ = settings; - dupTrkAlg_ = dupTrkAlg; - killDupTrks_.init(settings, dupTrkAlg); // Initialise duplicate removal algorithms that are common to all tracks. -} - -//=== Eliminate duplicate tracks from the input collection, and so return a reduced list of tracks. - -vector KillDupFitTrks::filter(const vector& vecTracks) const -{ - if (dupTrkAlg_ == 0) { - - // We are not running duplicate removal, so return original fitted track collection. - return vecTracks; + void KillDupFitTrks::init(const Settings* settings, unsigned int dupTrkAlg) { + settings_ = settings; + dupTrkAlg_ = dupTrkAlg; + killDupTrks_.init(settings, dupTrkAlg); // Initialise duplicate removal algorithms that are common to all tracks. + } - } else { + //=== Eliminate duplicate tracks from the input collection, and so return a reduced list of tracks. + + vector KillDupFitTrks::filter(const vector& vecTracks) const { + if (dupTrkAlg_ == 0) { + // We are not running duplicate removal, so return original fitted track collection. + return vecTracks; + + } else { + // Choose which algorithm to run, based on parameter dupTrkAlg_. + switch (dupTrkAlg_) { + // Run filters that only work on fitted tracks. + case 50: + return filterAlg50(vecTracks); + break; + case 51: + return filterAlg51(vecTracks); + break; + // Run filters that work on any type of track (l1track2d, l1track3d, l1fittedtrack). + default: + return killDupTrks_.filter(vecTracks); + } - // Choose which algorithm to run, based on parameter dupTrkAlg_. - switch (dupTrkAlg_) { - // Run filters that only work on fitted tracks. - case 50: return filterAlg50( vecTracks ) ; break; - case 51: return filterAlg51( vecTracks ); break; - // Run filters that work on any type of track (l1track2d, l1track3d, l1fittedtrack). - default: return killDupTrks_.filter(vecTracks); + // Should never get here ... } - - // Should never get here ... } -} - -//=== Duplicate removal algorithm designed to run after the track helix fit, which eliminates duplicates -//=== simply by requiring that the fitted (q/Pt, phi0) of the track correspond to the same HT cell in -//=== which the track was originally found by the HT. -//=== N.B. This code runs on tracks in a single sector. It could be extended to run on tracks in entire -//=== tracker by adding the track's sector number to memory "htCellUsed" below. - - -vector KillDupFitTrks::filterAlg50(const vector& tracks) const -{ - // Hard-wired options to play with. - const bool debug = false; - const bool doRecoveryStep = true; // Do 2nd pass through rejected tracks to see if any should be rescued. - const bool reduceDups = true; // Option attempting to reduce duplicate tracks during 2nd pass. - const bool memorizeAllHTcells = false; // First pass stores in memory all cells that the HT found tracks in, not just those of tracks accepted by the first pass. - const bool doSectorCheck = false; // Require fitted helix to lie within sector. - const bool usePtAndZ0Cuts = false; - // IRT - was false - const bool goOutsideArray = true; // Also store in memory stubs outside the HT array during 2nd pass. - // IRT - was false - const bool limitDiff = true; // Limit allowed diff. between HT & Fit cell to <= 1. - - if (debug && tracks.size() > 0) cout<<"START "< tracksFiltered; - - // Make a first pass through the tracks, doing initial identification of duplicate tracks. - // N.B. BY FILLING THIS WITH CELLS AROUND SELECTED TRACKS, RATHER THAN JUST THE CELL CONTAINING THE - // TRACK, ONE CAN REDUCE THE DUPLICATE RATE FURTHER, AT COST TO EFFICIENCY. - set< pair > htCellUsed; - vector tracksRejected; - - // For checking if multiple tracks corresponding to same TP are accepted by duplicate removal. - map> tpFound; - map tpFoundAtPass; - - for (const L1fittedTrack& trk : tracks) { - - // Only consider tracks whose fitted helix parameters are in the same sector as the HT originally used to find the track. - if ( ( ! doSectorCheck) || trk.consistentSector() ) { - if ( ( ! usePtAndZ0Cuts) || ( fabs(trk.z0()) < settings_->beamWindowZ() && trk.pt() > settings_->houghMinPt() - 0.2) ) { - - // For debugging. - const TP* tp = trk.getMatchedTP(); - - // Check if this track's fitted (q/pt, phi0) helix parameters correspond to the same HT cell as the HT originally found the track in. - bool consistentCell = trk.consistentHTcell(); - if (consistentCell) { - // This track is probably not a duplicate, so keep & and store its HT cell location (which equals the HT cell corresponding to the fitted track). - tracksFiltered.push_back(trk); - // Memorize HT cell location corresponding to this track (identical for HT track & fitted track). - if ( ! memorizeAllHTcells) { - pair htCell = trk.getCellLocationHT(); - htCellUsed.insert( htCell ); - if (trk.getL1track3D().mergedHTcell()) { - // If this is a merged cell, block the other elements too, in case a track found by the HT in an unmerged cell - // has a fitted cell there. - pair htCell10( htCell.first + 1, htCell.second); - pair htCell01( htCell.first , htCell.second + 1); - pair htCell11( htCell.first + 1, htCell.second + 1); - htCellUsed.insert( htCell10 ); - htCellUsed.insert( htCell01 ); - htCellUsed.insert( htCell11 ); - } - } - - if (debug && tp != nullptr) { - cout<<"FIRST PASS: m="<index()].first<<","<index()].second<<") dup="<index()]<index()) != tpFound.end()) tpFound[tp->index()] = trk.getCellLocationFit(); - tpFoundAtPass[tp->index()] = 1; - } - - } else { - - if (limitDiff) { - const unsigned int maxDiff = 1; - if (abs(int(trk.getCellLocationHT().first) - int(trk.getCellLocationFit().first)) <= maxDiff && - abs(int(trk.getCellLocationHT().second) - int(trk.getCellLocationFit().second)) <= maxDiff) tracksRejected.push_back(&trk); - } else { - tracksRejected.push_back(&trk); - } - if (debug && tp != nullptr) { - cout<<"FIRST REJECT: m="<index()].first<<","<index()].second<<") dup="<index()]< htCell = trk.getCellLocationFit(); // Intentionally used fit instead of HT here. - htCellUsed.insert( htCell ); - if (trk.getL1track3D().mergedHTcell()) { - // If this is a merged cell, block the other elements too, in case a track found by the HT in an unmerged cell - // has a fitted cell there. - // N.B. NO GOOD REASON WHY "-1" IS NOT DONE HERE TOO. MIGHT REDUCE DUPLICATE RATE? - pair htCell10( htCell.first + 1, htCell.second); - pair htCell01( htCell.first , htCell.second + 1); - pair htCell11( htCell.first + 1, htCell.second + 1); - htCellUsed.insert( htCell10 ); - htCellUsed.insert( htCell01 ); - htCellUsed.insert( htCell11 ); - } - } + //=== Duplicate removal algorithm designed to run after the track helix fit, which eliminates duplicates + //=== simply by requiring that the fitted (q/Pt, phi0) of the track correspond to the same HT cell in + //=== which the track was originally found by the HT. + //=== N.B. This code runs on tracks in a single sector. It could be extended to run on tracks in entire + //=== tracker by adding the track's sector number to memory "htCellUsed" below. + + vector KillDupFitTrks::filterAlg50(const vector& tracks) const { + // Hard-wired options to play with. + const bool debug = false; + const bool doRecoveryStep = true; // Do 2nd pass through rejected tracks to see if any should be rescued. + const bool reduceDups = true; // Option attempting to reduce duplicate tracks during 2nd pass. + const bool memorizeAllHTcells = + false; // First pass stores in memory all cells that the HT found tracks in, not just those of tracks accepted by the first pass. + const bool doSectorCheck = false; // Require fitted helix to lie within sector. + const bool usePtAndZ0Cuts = false; + // IRT - was false + const bool goOutsideArray = true; // Also store in memory stubs outside the HT array during 2nd pass. + // IRT - was false + const bool limitDiff = true; // Limit allowed diff. between HT & Fit cell to <= 1. + + if (debug && tracks.size() > 0) + cout << "START " << tracks.size() << endl; + + vector tracksFiltered; + + // Make a first pass through the tracks, doing initial identification of duplicate tracks. + // N.B. BY FILLING THIS WITH CELLS AROUND SELECTED TRACKS, RATHER THAN JUST THE CELL CONTAINING THE + // TRACK, ONE CAN REDUCE THE DUPLICATE RATE FURTHER, AT COST TO EFFICIENCY. + set> htCellUsed; + vector tracksRejected; + + // For checking if multiple tracks corresponding to same TP are accepted by duplicate removal. + map> tpFound; + map tpFoundAtPass; + + for (const L1fittedTrack& trk : tracks) { + // Only consider tracks whose fitted helix parameters are in the same sector as the HT originally used to find the track. + if ((!doSectorCheck) || trk.consistentSector()) { + if ((!usePtAndZ0Cuts) || + (fabs(trk.z0()) < settings_->beamWindowZ() && trk.pt() > settings_->houghMinPt() - 0.2)) { + // For debugging. + const TP* tp = trk.getMatchedTP(); + + // Check if this track's fitted (q/pt, phi0) helix parameters correspond to the same HT cell as the HT originally found the track in. + bool consistentCell = trk.consistentHTcell(); + if (consistentCell) { + // This track is probably not a duplicate, so keep & and store its HT cell location (which equals the HT cell corresponding to the fitted track). + tracksFiltered.push_back(trk); + // Memorize HT cell location corresponding to this track (identical for HT track & fitted track). + if (!memorizeAllHTcells) { + pair htCell = trk.getCellLocationHT(); + htCellUsed.insert(htCell); + if (trk.getL1track3D().mergedHTcell()) { + // If this is a merged cell, block the other elements too, in case a track found by the HT in an unmerged cell + // has a fitted cell there. + pair htCell10(htCell.first + 1, htCell.second); + pair htCell01(htCell.first, htCell.second + 1); + pair htCell11(htCell.first + 1, htCell.second + 1); + htCellUsed.insert(htCell10); + htCellUsed.insert(htCell01); + htCellUsed.insert(htCell11); + } + } + + if (debug && tp != nullptr) { + cout << "FIRST PASS: m=" << trk.getCellLocationHT().first << "/" << trk.getCellLocationFit().first + << " c=" << trk.getCellLocationHT().second << "/" << trk.getCellLocationFit().second + << " Delta(m,c)=(" << int(trk.getCellLocationHT().first) - int(trk.getCellLocationFit().first) << "," + << int(trk.getCellLocationHT().second) - int(trk.getCellLocationFit().second) + << ") pure=" << trk.getPurity() << " merged=" << trk.getL1track3D().mergedHTcell() + << " #layers=" << trk.getL1track3D().getNumLayers() << " tp=" << tp->index() << " dupCell=(" + << tpFound[tp->index()].first << "," << tpFound[tp->index()].second + << ") dup=" << tpFoundAtPass[tp->index()] << endl; + // If the following two variables are non-zero in printout, then track has already been found, + // so we have mistakenly kept a duplicate. + if (tpFound.find(tp->index()) != tpFound.end()) + tpFound[tp->index()] = trk.getCellLocationFit(); + tpFoundAtPass[tp->index()] = 1; + } + + } else { + if (limitDiff) { + const unsigned int maxDiff = 1; + if (abs(int(trk.getCellLocationHT().first) - int(trk.getCellLocationFit().first)) <= maxDiff && + abs(int(trk.getCellLocationHT().second) - int(trk.getCellLocationFit().second)) <= maxDiff) + tracksRejected.push_back(&trk); + } else { + tracksRejected.push_back(&trk); + } + + if (debug && tp != nullptr) { + cout << "FIRST REJECT: m=" << trk.getCellLocationHT().first << "/" << trk.getCellLocationFit().first + << " c=" << trk.getCellLocationHT().second << "/" << trk.getCellLocationFit().second + << " Delta(m,c)=(" << int(trk.getCellLocationHT().first) - int(trk.getCellLocationFit().first) << "," + << int(trk.getCellLocationHT().second) - int(trk.getCellLocationFit().second) + << ") pure=" << trk.getPurity() << " merged=" << trk.getL1track3D().mergedHTcell() + << " #layers=" << trk.getL1track3D().getNumLayers() << " tp=" << tp->index() << " dupCell=(" + << tpFound[tp->index()].first << "," << tpFound[tp->index()].second + << ") dup=" << tpFoundAtPass[tp->index()] << endl; + } + } + // Memorize HT cell location corresponding to this track, even if it was not accepted by first pass.. + if (memorizeAllHTcells) { + pair htCell = + trk.getCellLocationFit(); // Intentionally used fit instead of HT here. + htCellUsed.insert(htCell); + if (trk.getL1track3D().mergedHTcell()) { + // If this is a merged cell, block the other elements too, in case a track found by the HT in an unmerged cell + // has a fitted cell there. + // N.B. NO GOOD REASON WHY "-1" IS NOT DONE HERE TOO. MIGHT REDUCE DUPLICATE RATE? + pair htCell10(htCell.first + 1, htCell.second); + pair htCell01(htCell.first, htCell.second + 1); + pair htCell11(htCell.first + 1, htCell.second + 1); + htCellUsed.insert(htCell10); + htCellUsed.insert(htCell01); + htCellUsed.insert(htCell11); + } + } + } } } - } - - if (doRecoveryStep) { - // Making a second pass through the rejected tracks, checking if any should be rescued. - for (const L1fittedTrack* trk : tracksRejected) { - - // Get location in HT array corresponding to fitted track helix parameters. - pair htCell = trk->getCellLocationFit(); - // If this HT cell was not already memorized, rescue this track, since it is probably not a duplicate, - // but just a track whose fitted helix parameters are a bit wierd for some reason. - if (std::count(htCellUsed.begin(), htCellUsed.end(), htCell) == 0) { - tracksFiltered.push_back(*trk); // Rescue track. - // Optionally store cell location to avoid rescuing other tracks at the same location, which may be duplicates of this track. - bool outsideCheck =( goOutsideArray || trk->pt() > settings_->houghMinPt() ); - if (reduceDups && outsideCheck) htCellUsed.insert( htCell ); - - // For debugging. - const TP* tp = trk->getMatchedTP(); - - if (debug && tp != nullptr) { - cout<<"SECOND PASS: m="<getCellLocationHT().first<<"/"<getCellLocationFit().first<<" c="<getCellLocationHT().second<<"/"<getCellLocationFit().second<<" Delta(m,c)=("<getCellLocationHT().first) - int(trk->getCellLocationFit().first)<<","<getCellLocationHT().second) - int(trk->getCellLocationFit().second)<<") pure="<getPurity()<<" merged="<getL1track3D().mergedHTcell()<<" #layers="<getL1track3D().getNumLayers()<<" tp="<index()<<" dupCell=("<index()].first<<","<index()].second<<") dup="<index()]<index()) != tpFound.end()) tpFound[tp->index()] = htCell; - tpFoundAtPass[tp->index()] = 2; - } + if (doRecoveryStep) { + // Making a second pass through the rejected tracks, checking if any should be rescued. + for (const L1fittedTrack* trk : tracksRejected) { + // Get location in HT array corresponding to fitted track helix parameters. + pair htCell = trk->getCellLocationFit(); + // If this HT cell was not already memorized, rescue this track, since it is probably not a duplicate, + // but just a track whose fitted helix parameters are a bit wierd for some reason. + if (std::count(htCellUsed.begin(), htCellUsed.end(), htCell) == 0) { + tracksFiltered.push_back(*trk); // Rescue track. + // Optionally store cell location to avoid rescuing other tracks at the same location, which may be duplicates of this track. + bool outsideCheck = (goOutsideArray || trk->pt() > settings_->houghMinPt()); + if (reduceDups && outsideCheck) + htCellUsed.insert(htCell); + + // For debugging. + const TP* tp = trk->getMatchedTP(); + + if (debug && tp != nullptr) { + cout << "SECOND PASS: m=" << trk->getCellLocationHT().first << "/" << trk->getCellLocationFit().first + << " c=" << trk->getCellLocationHT().second << "/" << trk->getCellLocationFit().second + << " Delta(m,c)=(" << int(trk->getCellLocationHT().first) - int(trk->getCellLocationFit().first) << "," + << int(trk->getCellLocationHT().second) - int(trk->getCellLocationFit().second) + << ") pure=" << trk->getPurity() << " merged=" << trk->getL1track3D().mergedHTcell() + << " #layers=" << trk->getL1track3D().getNumLayers() << " tp=" << tp->index() << " dupCell=(" + << tpFound[tp->index()].first << "," << tpFound[tp->index()].second + << ") dup=" << tpFoundAtPass[tp->index()] << endl; + if (tpFound.find(tp->index()) != tpFound.end()) + tpFound[tp->index()] = htCell; + tpFoundAtPass[tp->index()] = 2; + } + } } } - } - // Debug printout to identify duplicate tracks that survived. - if (debug) this->printDuplicateTracks(tracksFiltered); + // Debug printout to identify duplicate tracks that survived. + if (debug) + this->printDuplicateTracks(tracksFiltered); - return tracksFiltered; -} -//=== Duplicate removal algorithm designed to run after the track helix fit, which eliminates duplicates -//=== simply by requiring that no two tracks should have fitted (q/Pt, phi0) that correspond to the same HT -//=== cell. If they do, then only the first to arrive is kept. -//=== N.B. This code runs on tracks in a single sector. It could be extended to run on tracks in entire -//=== tracker by adding the track's sector number to memory "htCellUsed" below. + return tracksFiltered; + } + //=== Duplicate removal algorithm designed to run after the track helix fit, which eliminates duplicates + //=== simply by requiring that no two tracks should have fitted (q/Pt, phi0) that correspond to the same HT + //=== cell. If they do, then only the first to arrive is kept. + //=== N.B. This code runs on tracks in a single sector. It could be extended to run on tracks in entire + //=== tracker by adding the track's sector number to memory "htCellUsed" below. -vector KillDupFitTrks::filterAlg51(const vector& tracks) const -{ - // Hard-wired options to play with. - const bool debug = false; + vector KillDupFitTrks::filterAlg51(const vector& tracks) const { + // Hard-wired options to play with. + const bool debug = false; - if (debug && tracks.size() > 0) cout<<"START "< 0) + cout << "START " << tracks.size() << endl; - vector tracksFiltered; - set< pair > htCellUsed; + vector tracksFiltered; + set> htCellUsed; - for (const L1fittedTrack& trk : tracks) { + for (const L1fittedTrack& trk : tracks) { // Get location in HT array corresponding to fitted track helix parameters. pair htCell = trk.getCellLocationFit(); // If this HT cell was not already memorized, rescue this track, since it is probably not a duplicate, // but just a track whose fitted helix parameters are a bit wierd for some reason. if (std::count(htCellUsed.begin(), htCellUsed.end(), htCell) == 0) { - tracksFiltered.push_back(trk); // Rescue track. - // Store cell location to avoid rescuing other tracks at the same location, which may be duplicates of this track. - htCellUsed.insert( htCell ); - if (debug) { - const TP* tp = trk.getMatchedTP(); - int tpIndex = (tp != nullptr) ? tp->index() : -999; - cout<<"ALG51: m="<getCellLocationFit().first<<" c="<getCellLocationHT().second<<"/"<getCellLocationFit().second<<" tp="<index()<<" tp_pt="<pt()<<" fit_pt="<pt()<<" pure="<getPurity()< vecTrk = p.second; + if (vecTrk.size() > 1) { + for (const L1fittedTrack* trk : vecTrk) { + cout << " MESS UP : m=" << trk->getCellLocationHT().first << "/" << trk->getCellLocationFit().first + << " c=" << trk->getCellLocationHT().second << "/" << trk->getCellLocationFit().second + << " tp=" << tp->index() << " tp_pt=" << tp->pt() << " fit_pt=" << trk->pt() + << " pure=" << trk->getPurity() << endl; + cout << " stubs = "; + for (const Stub* s : trk->getStubs()) + cout << s->index() << " "; + cout << endl; + } } } + if (tracks.size() > 0) + cout << "FOUND " << tracks.size() << endl; } - if (tracks.size() > 0) cout<<"FOUND "< #include #include - + namespace TMTT { -template -std::vector operator-(const std::vector& a, const std::vector& b){ + template + std::vector operator-(const std::vector& a, const std::vector& b) { assert(a.size() == b.size()); std::vector result; result.reserve(a.size()); std::transform(a.begin(), a.end(), b.begin(), std::back_inserter(result), std::minus()); return result; -} - -L1ChiSquared::L1ChiSquared(const Settings* settings, const uint nPar) : TrackFitGeneric(settings), chiSq_ (0.0){ - // Bad stub killing settings - numFittingIterations_ = getSettings()->numTrackFitIterations(); - killTrackFitWorstHit_ = getSettings()->killTrackFitWorstHit(); - generalResidualCut_ = getSettings()->generalResidualCut(); // The cut used to remove bad stubs (if nStubs > minLayers) - killingResidualCut_ = getSettings()->killingResidualCut(); // The cut used to kill off tracks entirely - - //--- These two parameters are used to check if after the fit, there are still enough stubs on the track - minStubLayers_ = getSettings()->minStubLayers(); - nPar_ = nPar; -} - -void L1ChiSquared::calculateChiSq( std::vector resids ){ - chiSq_ = 0.0; - uint j=0; - for ( uint i=0; i delX, std::vector covX ){ - for ( uint i=0; inumTrackFitIterations(); + killTrackFitWorstHit_ = getSettings()->killTrackFitWorstHit(); + generalResidualCut_ = + getSettings()->generalResidualCut(); // The cut used to remove bad stubs (if nStubs > minLayers) + killingResidualCut_ = getSettings()->killingResidualCut(); // The cut used to kill off tracks entirely + + //--- These two parameters are used to check if after the fit, there are still enough stubs on the track + minStubLayers_ = getSettings()->minStubLayers(); + nPar_ = nPar; } -} - -L1fittedTrack L1ChiSquared::fit(const L1track3D& l1track3D){ - - stubs_ = l1track3D.getStubs(); - - // Get cut on number of layers including variation due to dead sectors, pt dependence etc. - minStubLayersRed_ = Utility::numLayerCut("FIT", getSettings(), l1track3D.iPhiSec(), l1track3D.iEtaReg(), fabs(l1track3D.qOverPt()), l1track3D.eta()); - - std::vector x = seed(l1track3D); - - Matrix d = D(x); - Matrix dtVinv = d.transpose() * Vinv(); -// Matrix M = dtVinv * d; - Matrix M = dtVinv * (dtVinv.transpose()); //TODO this match tracklet code, but not literature:w - - std::vector resids = residuals(x); -// std::cout << "resids.size(): " << resids.size() << std::endl; - std::vector deltaX = M.inverse() * dtVinv * resids; - x = x - deltaX; - std::vector covX = d.transpose() * Vinv() * resids; - - calculateChiSq(resids); - calculateDeltaChiSq (deltaX, covX); - resids = residuals(x); // update resids. - - for (int i=1;i1) { - /* + + void L1ChiSquared::calculateChiSq(std::vector resids) { + chiSq_ = 0.0; + uint j = 0; + for (uint i = 0; i < stubs_.size(); i++) { + chiSq_ += resids[j] * resids[j] + resids[j + 1] * resids[j + 1]; + j = j + 2; + } + } + + void L1ChiSquared::calculateDeltaChiSq(std::vector delX, std::vector covX) { + for (uint i = 0; i < covX.size(); i++) { + chiSq_ += (-delX[i]) * covX[i]; + } + } + + L1fittedTrack L1ChiSquared::fit(const L1track3D& l1track3D) { + stubs_ = l1track3D.getStubs(); + + // Get cut on number of layers including variation due to dead sectors, pt dependence etc. + minStubLayersRed_ = Utility::numLayerCut( + "FIT", getSettings(), l1track3D.iPhiSec(), l1track3D.iEtaReg(), fabs(l1track3D.qOverPt()), l1track3D.eta()); + + std::vector x = seed(l1track3D); + + Matrix d = D(x); + Matrix dtVinv = d.transpose() * Vinv(); + // Matrix M = dtVinv * d; + Matrix M = dtVinv * (dtVinv.transpose()); //TODO this match tracklet code, but not literature:w + + std::vector resids = residuals(x); + // std::cout << "resids.size(): " << resids.size() << std::endl; + std::vector deltaX = M.inverse() * dtVinv * resids; + x = x - deltaX; + std::vector covX = d.transpose() * Vinv() * resids; + + calculateChiSq(resids); + calculateDeltaChiSq(deltaX, covX); + resids = residuals(x); // update resids. + + for (int i = 1; i < numFittingIterations_ + 1; ++i) { + if (i > 1) { + /* // Original buggy code of 18th April 2018 if ( killTrackFitWorstHit_ && (largestresid_ > killingResidualCut_ || (largestresid_ > generalResidualCut_ && Utility::countLayers( getSettings(), stubs_ ) > minStubLayersRed_)) ) { cout<<"RATS KILLED STUB "< "< "< killingResidualCut_) { - killWorstStub = true; - } else if (largestresid_ > generalResidualCut_) { - std::vector stubsTmp = stubs_; - stubsTmp.erase(stubsTmp.begin()+ilargestresid_); - if (Utility::countLayers( getSettings(), stubsTmp ) >= minStubLayersRed_) killWorstStub = true; - } else { - // Get better apparent tracking performance by always killing worst stub until only 4 layers left. - if (Utility::countLayers( getSettings(), stubs_ ) > minStubLayersRed_) killWorstStub = true; + // IRT - Debugged code of 19th April 2018 + bool killWorstStub = false; + if (killTrackFitWorstHit_) { + if (largestresid_ > killingResidualCut_) { + killWorstStub = true; + } else if (largestresid_ > generalResidualCut_) { + std::vector stubsTmp = stubs_; + stubsTmp.erase(stubsTmp.begin() + ilargestresid_); + if (Utility::countLayers(getSettings(), stubsTmp) >= minStubLayersRed_) + killWorstStub = true; + } else { + // Get better apparent tracking performance by always killing worst stub until only 4 layers left. + if (Utility::countLayers(getSettings(), stubs_) > minStubLayersRed_) + killWorstStub = true; + } } - } - - if (killWorstStub) { - stubs_.erase(stubs_.begin()+ilargestresid_); - if (getSettings()->debug() == 6) std::cout << __FILE__ " : Killed stub " << ilargestresid_ << "." << std::endl; - // Reject tracks with too many killed stubs & stop iterating. - unsigned int nLayers = Utility::countLayers( getSettings(), stubs_ ); // Count tracker layers with stubs - bool valid = nLayers >= minStubLayersRed_; + if (killWorstStub) { + stubs_.erase(stubs_.begin() + ilargestresid_); + if (getSettings()->debug() == 6) + std::cout << __FILE__ " : Killed stub " << ilargestresid_ << "." << std::endl; + + // Reject tracks with too many killed stubs & stop iterating. + unsigned int nLayers = Utility::countLayers(getSettings(), stubs_); // Count tracker layers with stubs + bool valid = nLayers >= minStubLayersRed_; + + if (!valid) { + const unsigned int hitPattern = 0; // FIX: Needs setting + return L1fittedTrack(getSettings(), + l1track3D, + stubs_, + hitPattern, + l1track3D.qOverPt(), + 0., + l1track3D.phi0(), + l1track3D.z0(), + l1track3D.tanLambda(), + 999999., + 4, + valid); + } + } - if ( ! valid ){ - const unsigned int hitPattern = 0; // FIX: Needs setting - return L1fittedTrack (getSettings(), l1track3D, stubs_, hitPattern, l1track3D.qOverPt(), 0., l1track3D.phi0(), l1track3D.z0(), l1track3D.tanLambda(), 999999., 4, valid); - } + d = D(x); // Calculate derivatives + dtVinv = d.transpose() * Vinv(); + M = dtVinv * (dtVinv.transpose()); + resids = residuals(x); // Calculate new residuals + std::vector deltaX = M.inverse() * dtVinv * resids; + x = x - deltaX; + std::vector covX = d.transpose() * Vinv() * resids; + resids = residuals(x); // update resids. + + calculateChiSq(resids); + calculateDeltaChiSq(deltaX, covX); } - - d = D(x); // Calculate derivatives - dtVinv = d.transpose() * Vinv(); - M = dtVinv * (dtVinv.transpose()); - resids = residuals(x); // Calculate new residuals - std::vector deltaX = M.inverse() * dtVinv * resids; - x = x - deltaX; - std::vector covX = d.transpose() * Vinv() * resids; - resids = residuals(x); // update resids. - - calculateChiSq(resids); - calculateDeltaChiSq (deltaX, covX); } - } - - std::map tp = convertParams(x); // tp = track params - // Reject tracks with too many killed stubs - unsigned int nLayers = Utility::countLayers( getSettings(), stubs_ ); // Count tracker layers with stubs - bool valid4par = nLayers >= minStubLayersRed_; - - const unsigned int hitPattern = 0; // FIX: Needs setting - if ( valid4par ){ - return L1fittedTrack(getSettings(), l1track3D, stubs_, hitPattern, tp["qOverPt"], 0, tp["phi0"], tp["z0"], tp["t"], chiSq_, nPar_, valid4par); - } - else{ - return L1fittedTrack (getSettings(), l1track3D, stubs_, hitPattern, l1track3D.qOverPt(), 0., l1track3D.phi0(), l1track3D.z0(), l1track3D.tanLambda(), 999999., 4, valid4par); + std::map tp = convertParams(x); // tp = track params + + // Reject tracks with too many killed stubs + unsigned int nLayers = Utility::countLayers(getSettings(), stubs_); // Count tracker layers with stubs + bool valid4par = nLayers >= minStubLayersRed_; + + const unsigned int hitPattern = 0; // FIX: Needs setting + if (valid4par) { + return L1fittedTrack(getSettings(), + l1track3D, + stubs_, + hitPattern, + tp["qOverPt"], + 0, + tp["phi0"], + tp["z0"], + tp["t"], + chiSq_, + nPar_, + valid4par); + } else { + return L1fittedTrack(getSettings(), + l1track3D, + stubs_, + hitPattern, + l1track3D.qOverPt(), + 0., + l1track3D.phi0(), + l1track3D.z0(), + l1track3D.tanLambda(), + 999999., + 4, + valid4par); + } } -} - -} +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc b/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc index 56cd7bd154560..f5010e3d59ccd 100644 --- a/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc +++ b/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc @@ -5,7 +5,7 @@ #include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" #include "L1Trigger/TrackFindingTMTT/interface/Utility.h" -#include +#include #include "L1Trigger/TrackFindingTMTT/interface/TP.h" #include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" #include "L1Trigger/TrackFindingTMTT/interface/StubCluster.h" @@ -27,205 +27,206 @@ namespace TMTT { -unsigned LayerId[16] = { 1, 2, 3, 4, 5, 6, 11, 12, 13, 14, 15, 21, 22, 23, 24, 25 }; + unsigned LayerId[16] = {1, 2, 3, 4, 5, 6, 11, 12, 13, 14, 15, 21, 22, 23, 24, 25}; -static bool orderStubsByLayer(const Stub* a, const Stub* b){ - return (a->layerId() < b->layerId()); -} + static bool orderStubsByLayer(const Stub *a, const Stub *b) { return (a->layerId() < b->layerId()); } #ifdef MERGE_STUBS -static bool orderStubsByZ(const Stub* a, const Stub* b){ - return (a->z() < b->z()); -} + static bool orderStubsByZ(const Stub *a, const Stub *b) { return (a->z() < b->z()); } -static bool orderStubsByR(const Stub* a, const Stub* b){ - return (a->r() < b->r()); -} + static bool orderStubsByR(const Stub *a, const Stub *b) { return (a->r() < b->r()); } #endif -void L1KalmanComb::printTPSummary( std::ostream &os, const TP *tp, bool addReturn) const { - - if( tp ){ - - os << "TP "; - // os << "addr=" << tp << " "; - os << "index=" << tp->index() << " "; - os << "qOverPt=" << tp->qOverPt() << " "; - os << "phi0=" << tp->phi0() << " "; - os << "z0=" << tp->z0() << " "; - os << "t=" << tp->tanLambda() << " "; - os << "d0=" << tp->d0(); - if( addReturn ) os << endl; - else os << " | "; - } -} - -void L1KalmanComb::printTP( std::ostream &os, const TP *tp ) const { - - std::map tpParams; - bool useForAlgEff(false); - if( tp ){ - useForAlgEff = tp->useForAlgEff(); - tpParams["qOverPt"] = tp->qOverPt(); - tpParams["phi0"] = tp->phi0(); - tpParams["z0"] = tp->z0(); - tpParams["t"] = tp->tanLambda(); - tpParams["d0"] = tp->d0(); - } - if( tp ){ - os << " TP index = " << tp->index() << " useForAlgEff = " << useForAlgEff << " "; - for( auto pair : tpParams ){ - os << pair.first << ":" << pair.second << ", "; + void L1KalmanComb::printTPSummary(std::ostream &os, const TP *tp, bool addReturn) const { + if (tp) { + os << "TP "; + // os << "addr=" << tp << " "; + os << "index=" << tp->index() << " "; + os << "qOverPt=" << tp->qOverPt() << " "; + os << "phi0=" << tp->phi0() << " "; + os << "z0=" << tp->z0() << " "; + os << "t=" << tp->tanLambda() << " "; + os << "d0=" << tp->d0(); + if (addReturn) + os << endl; + else + os << " | "; } - os << " inv2R = " << tp->qOverPt() * getSettings()->invPtToInvR() * 0.5; - } - else{ - os << " Fake"; } - os << endl; -} -void L1KalmanComb::printStubLayers( std::ostream &os, std::vector &stubs, unsigned int iEtaReg ) const { - - if( stubs.size() == 0 ) os << "stub layers = []" << endl; - else{ - os << "stub layers = [ "; - for( unsigned i=0; ilayerId(); - if (i != stubs.size() - 1) os << ", "; + void L1KalmanComb::printTP(std::ostream &os, const TP *tp) const { + std::map tpParams; + bool useForAlgEff(false); + if (tp) { + useForAlgEff = tp->useForAlgEff(); + tpParams["qOverPt"] = tp->qOverPt(); + tpParams["phi0"] = tp->phi0(); + tpParams["z0"] = tp->z0(); + tpParams["t"] = tp->tanLambda(); + tpParams["d0"] = tp->d0(); } - os << " ] "; - os << "KF stub layers = [ "; - for( unsigned j=0; jgetKalmanLayer(iEtaReg, stubs[j]->layerIdReduced(), stubs[j]->barrel(), stubs[j]->r(), stubs[j]->z()); - os << kalmanLayer; - if (j != stubs.size() - 1) os << ", "; + if (tp) { + os << " TP index = " << tp->index() << " useForAlgEff = " << useForAlgEff << " "; + for (auto pair : tpParams) { + os << pair.first << ":" << pair.second << ", "; + } + os << " inv2R = " << tp->qOverPt() * getSettings()->invPtToInvR() * 0.5; + } else { + os << " Fake"; } - os << " ]" << endl; + os << endl; + } + void L1KalmanComb::printStubLayers(std::ostream &os, std::vector &stubs, unsigned int iEtaReg) const { + if (stubs.size() == 0) + os << "stub layers = []" << endl; + else { + os << "stub layers = [ "; + for (unsigned i = 0; i < stubs.size(); i++) { + os << stubs[i]->layerId(); + if (i != stubs.size() - 1) + os << ", "; + } + os << " ] "; + os << "KF stub layers = [ "; + for (unsigned j = 0; j < stubs.size(); j++) { + unsigned int kalmanLayer = + this->getKalmanLayer(iEtaReg, stubs[j]->layerIdReduced(), stubs[j]->barrel(), stubs[j]->r(), stubs[j]->z()); + os << kalmanLayer; + if (j != stubs.size() - 1) + os << ", "; + } + os << " ]" << endl; + } } -} - -void L1KalmanComb::printStubCluster( std::ostream &os, const StubCluster * stubCluster, bool addReturn ) const { - os << "stub: "; - // os << "addr=" << stub << " "; - os << "index=" << stubCluster->stubs()[0]->index() << " "; - os << "layer=" << stubCluster->layerId() << " "; - os << "ring=" << stubCluster->endcapRing() << " "; - os << "r=" << stubCluster->r() << " "; - os << "phi=" << stubCluster->phi() << " "; - os << "z=" << stubCluster->z() << " "; - os << "sigmaX=" << stubCluster->sigmaX() << " "; - os << "sigmaZ=" << stubCluster->sigmaZ() << " "; - os << "dphi_dr=" << stubCluster->dphi_dr() << " "; - os << "#stubs= " << stubCluster->nStubs() << " "; - os << "TPids="; - std::set tps = stubCluster->assocTPs(); - for( auto tp : tps ) os << tp->index() << ","; - if( addReturn ) os << endl; - else os << " | "; -} - -void L1KalmanComb::printStubClusters( std::ostream &os, std::vector &stubClusters ) const { - - for( auto &stubcl : stubClusters ){ - printStubCluster( os, stubcl ); + + void L1KalmanComb::printStubCluster(std::ostream &os, const StubCluster *stubCluster, bool addReturn) const { + os << "stub: "; + // os << "addr=" << stub << " "; + os << "index=" << stubCluster->stubs()[0]->index() << " "; + os << "layer=" << stubCluster->layerId() << " "; + os << "ring=" << stubCluster->endcapRing() << " "; + os << "r=" << stubCluster->r() << " "; + os << "phi=" << stubCluster->phi() << " "; + os << "z=" << stubCluster->z() << " "; + os << "sigmaX=" << stubCluster->sigmaX() << " "; + os << "sigmaZ=" << stubCluster->sigmaZ() << " "; + os << "dphi_dr=" << stubCluster->dphi_dr() << " "; + os << "#stubs= " << stubCluster->nStubs() << " "; + os << "TPids="; + std::set tps = stubCluster->assocTPs(); + for (auto tp : tps) + os << tp->index() << ","; + if (addReturn) + os << endl; + else + os << " | "; } -} - -void L1KalmanComb::printStub( std::ostream &os, const Stub * stub, bool addReturn ) const { - os << "stub "; - // os << "addr=" << stub << " "; - os << "index=" << stub->index() << " "; - os << "layerId=" << stub->layerId() << " "; - os << "endcapRing=" << stub->endcapRing() << " "; - os << "r=" << stub->r() << " "; - os << "phi=" << stub->phi() << " "; - os << "z=" << stub->z() << " "; - os << "sigmaX=" << stub->sigmaX() << " "; - os << "sigmaZ=" << stub->sigmaZ() << " "; - os << "TPids="; - std::set tps = stub->assocTPs(); - for( auto tp : tps ) os << tp->index() << ","; - if( addReturn ) os << endl; - else os << " | "; - -} - -void L1KalmanComb::printStubs( std::ostream &os, std::vector &stubs ) const { - - for( auto &stub : stubs ){ - printStub( os, stub ); + + void L1KalmanComb::printStubClusters(std::ostream &os, std::vector &stubClusters) const { + for (auto &stubcl : stubClusters) { + printStubCluster(os, stubcl); + } } -} -//=== Get Kalman layer mapping (i.e. layer order in which stubs should be processed) + void L1KalmanComb::printStub(std::ostream &os, const Stub *stub, bool addReturn) const { + os << "stub "; + // os << "addr=" << stub << " "; + os << "index=" << stub->index() << " "; + os << "layerId=" << stub->layerId() << " "; + os << "endcapRing=" << stub->endcapRing() << " "; + os << "r=" << stub->r() << " "; + os << "phi=" << stub->phi() << " "; + os << "z=" << stub->z() << " "; + os << "sigmaX=" << stub->sigmaX() << " "; + os << "sigmaZ=" << stub->sigmaZ() << " "; + os << "TPids="; + std::set tps = stub->assocTPs(); + for (auto tp : tps) + os << tp->index() << ","; + if (addReturn) + os << endl; + else + os << " | "; + } -unsigned int L1KalmanComb::getKalmanLayer(unsigned int iEtaReg, unsigned int layerIDreduced, bool barrel, float r, float z) const { + void L1KalmanComb::printStubs(std::ostream &os, std::vector &stubs) const { + for (auto &stub : stubs) { + printStub(os, stub); + } + } - // index across is GP encoded layer ID (where barrel layers=1,2,7,5,4,3 & endcap wheels=3,4,5,6,7 & 0 never occurs) - // index down is eta reg - // element is kalman layer, where 7 is invalid + //=== Get Kalman layer mapping (i.e. layer order in which stubs should be processed) - // If stub with given GP encoded layer ID can have different KF layer ID depending on whether it - // is barrel or endcap, then in layerMap, the the barrel case is assumed. - // The endcap case is fixed by hand later in this function. + unsigned int L1KalmanComb::getKalmanLayer( + unsigned int iEtaReg, unsigned int layerIDreduced, bool barrel, float r, float z) const { + // index across is GP encoded layer ID (where barrel layers=1,2,7,5,4,3 & endcap wheels=3,4,5,6,7 & 0 never occurs) + // index down is eta reg + // element is kalman layer, where 7 is invalid + // If stub with given GP encoded layer ID can have different KF layer ID depending on whether it + // is barrel or endcap, then in layerMap, the the barrel case is assumed. + // The endcap case is fixed by hand later in this function. - const unsigned int nEta = 16; - const unsigned int nGPlayID = 7; + const unsigned int nEta = 16; + const unsigned int nGPlayID = 7; - if (nEta != numEtaRegions_) throw cms::Exception("ERROR L1KalmanComb::getKalmanLayer hardwired value of nEta differs from NumEtaRegions cfg param"); + if (nEta != numEtaRegions_) + throw cms::Exception( + "ERROR L1KalmanComb::getKalmanLayer hardwired value of nEta differs from NumEtaRegions cfg param"); - // In cases where identical GP encoded layer ID present in this sector from both barrel & endcap, this array filled considering barrel. The endcap is fixed by subsequent code. + // In cases where identical GP encoded layer ID present in this sector from both barrel & endcap, this array filled considering barrel. The endcap is fixed by subsequent code. - static const unsigned layerMap[nEta/2][nGPlayID+1] = - { - { 7, 0, 1, 5, 4, 3, 7, 2 }, // B1 B2 B3 B4 B5 B6 - { 7, 0, 1, 5, 4, 3, 7, 2 }, // B1 B2 B3 B4 B5 B6 - { 7, 0, 1, 5, 4, 3, 7, 2 }, // B1 B2 B3 B4 B5 B6 - { 7, 0, 1, 5, 4, 3, 7, 2 }, // B1 B2 B3 B4 B5 B6 - { 7, 0, 1, 5, 4, 3, 7, 2 }, // B1 B2 B3 B4(/D3) B5(/D2) B6(/D1) + static const unsigned layerMap[nEta / 2][nGPlayID + 1] = { + {7, 0, 1, 5, 4, 3, 7, 2}, // B1 B2 B3 B4 B5 B6 + {7, 0, 1, 5, 4, 3, 7, 2}, // B1 B2 B3 B4 B5 B6 + {7, 0, 1, 5, 4, 3, 7, 2}, // B1 B2 B3 B4 B5 B6 + {7, 0, 1, 5, 4, 3, 7, 2}, // B1 B2 B3 B4 B5 B6 + {7, 0, 1, 5, 4, 3, 7, 2}, // B1 B2 B3 B4(/D3) B5(/D2) B6(/D1) - { 7, 0, 1, 3, 4, 2, 6, 2 }, // B1 B2 B3(/D5)+B4(/D3) D1 D2 X D4 -- current FW - //{ 7, 0, 1, 3, 4, 3, 6, 2 }, // B1 B2 B3(/D5) D1+B4(/D3) D2 X D4 -- for use with "Fix cases" below. + {7, 0, 1, 3, 4, 2, 6, 2}, // B1 B2 B3(/D5)+B4(/D3) D1 D2 X D4 -- current FW + //{ 7, 0, 1, 3, 4, 3, 6, 2 }, // B1 B2 B3(/D5) D1+B4(/D3) D2 X D4 -- for use with "Fix cases" below. - { 7, 0, 1, 1, 2, 3, 4, 5 }, // B1 B2+D1 D2 D3 D5 D6 + {7, 0, 1, 1, 2, 3, 4, 5}, // B1 B2+D1 D2 D3 D5 D6 - //{ 7, 0, 7, 1, 2, 3, 4, 5 }, // B1 D1 D2 D3 D4 D5 = current FW (or when Ambiguous function used) - { 7, 0, 7, 0, 1, 2, 3, 4 }, // Avoid effi loss for eta > 2.3 when Ambiguous function not used. + //{ 7, 0, 7, 1, 2, 3, 4, 5 }, // B1 D1 D2 D3 D4 D5 = current FW (or when Ambiguous function used) + {7, 0, 7, 0, 1, 2, 3, 4}, // Avoid effi loss for eta > 2.3 when Ambiguous function not used. }; - unsigned int kfEtaReg; // KF VHDL eta sector def: small in barrel & large in endcap. - if (iEtaReg < numEtaRegions_/2) { - kfEtaReg = numEtaRegions_/2 - 1 - iEtaReg; - } else { - kfEtaReg = iEtaReg - numEtaRegions_/2; - } - - unsigned int kalmanLayer = layerMap[kfEtaReg][layerIDreduced]; - - // Fixes to endcap stubs, for cases where identical GP encoded layer ID present in this sector from both barrel & endcap. + unsigned int kfEtaReg; // KF VHDL eta sector def: small in barrel & large in endcap. + if (iEtaReg < numEtaRegions_ / 2) { + kfEtaReg = numEtaRegions_ / 2 - 1 - iEtaReg; + } else { + kfEtaReg = iEtaReg - numEtaRegions_ / 2; + } - if ( not barrel ) { - - switch ( kfEtaReg ) { - case 4: // B1 B2 B3 B4 B5/D1 B6/D2 D3 - if (layerIDreduced==3) kalmanLayer = 4; - if (layerIDreduced==4) kalmanLayer = 5; - if (layerIDreduced==5) kalmanLayer = 6; - break; - //case 5: // B1 B2 B3+B4 D1 D2 D3 D4/D5 - case 5: // B1 B2 B3 D1+B4 D2 D3 D4/D5 - if (layerIDreduced==5) kalmanLayer = 5; - if (layerIDreduced==7) kalmanLayer = 6; - break; - default: - break; - } - } + unsigned int kalmanLayer = layerMap[kfEtaReg][layerIDreduced]; + + // Fixes to endcap stubs, for cases where identical GP encoded layer ID present in this sector from both barrel & endcap. + + if (not barrel) { + switch (kfEtaReg) { + case 4: // B1 B2 B3 B4 B5/D1 B6/D2 D3 + if (layerIDreduced == 3) + kalmanLayer = 4; + if (layerIDreduced == 4) + kalmanLayer = 5; + if (layerIDreduced == 5) + kalmanLayer = 6; + break; + //case 5: // B1 B2 B3+B4 D1 D2 D3 D4/D5 + case 5: // B1 B2 B3 D1+B4 D2 D3 D4/D5 + if (layerIDreduced == 5) + kalmanLayer = 5; + if (layerIDreduced == 7) + kalmanLayer = 6; + break; + default: + break; + } + } - /* + /* // Fix cases where a barrel layer only partially crosses the eta sector. // (Logically should work, but actually reduces efficiency). @@ -257,18 +258,16 @@ unsigned int L1KalmanComb::getKalmanLayer(unsigned int iEtaReg, unsigned int lay } */ - return kalmanLayer; - -} - -//=== Check if particles in given eta sector are uncertain to go through the given KF layer. -//=== (If so, count layer for numbers of hit layers, but not for number of skipped layers). + return kalmanLayer; + } -bool L1KalmanComb::getKalmanAmbiguousLayer(unsigned int iEtaReg, unsigned int kfLayer) { + //=== Check if particles in given eta sector are uncertain to go through the given KF layer. + //=== (If so, count layer for numbers of hit layers, but not for number of skipped layers). - // Only helps in extreme forward sector, and there not significantly. + bool L1KalmanComb::getKalmanAmbiguousLayer(unsigned int iEtaReg, unsigned int kfLayer) { + // Only helps in extreme forward sector, and there not significantly. - /* + /* const unsigned int nEta = 16; const unsigned int nKFlayer = 7; static const bool ambiguityMap[nEta/2][nKFlayer] = @@ -293,336 +292,360 @@ bool L1KalmanComb::getKalmanAmbiguousLayer(unsigned int iEtaReg, unsigned int kf bool ambiguous = ambiguityMap[kfEtaReg][kfLayer]; */ - bool ambiguous = false; - return ambiguous; -} - -L1KalmanComb::L1KalmanComb(const Settings* settings, const uint nPar, const string &fitterName, const uint nMeas ) : TrackFitGeneric(settings, fitterName ){ - nPar_ = nPar; - nMeas_ = nMeas; - numEtaRegions_ = settings->numEtaRegions(); - - hymin = vector( nPar_, -1 ); - hymax = vector( nPar_, 1 ); - hymin[0] = -0.05; - hymax[0] = +0.05; - hymin[1] = -3.2; - hymax[1] = +3.2; - hymin[2] = -20; - hymax[2] = +20; - hymin[3] = -6; - hymax[3] = +6; - if (nPar_ == 5) { - hymin[4] = -5; - hymax[4] = +5; + bool ambiguous = false; + return ambiguous; } - hxmin = vector( nPar_, -1 ); - hxmax = vector( nPar_, 1 ); - - hddMeasmin = vector( 2, -1e-3 ); - hddMeasmax = vector( 2, 1e-3 ); + L1KalmanComb::L1KalmanComb(const Settings *settings, const uint nPar, const string &fitterName, const uint nMeas) + : TrackFitGeneric(settings, fitterName) { + nPar_ = nPar; + nMeas_ = nMeas; + numEtaRegions_ = settings->numEtaRegions(); + + hymin = vector(nPar_, -1); + hymax = vector(nPar_, 1); + hymin[0] = -0.05; + hymax[0] = +0.05; + hymin[1] = -3.2; + hymax[1] = +3.2; + hymin[2] = -20; + hymax[2] = +20; + hymin[3] = -6; + hymax[3] = +6; + if (nPar_ == 5) { + hymin[4] = -5; + hymax[4] = +5; + } - hresmin = vector( 2, -1e-2 ); - hresmax = vector( 2, 1e-2 ); + hxmin = vector(nPar_, -1); + hxmax = vector(nPar_, 1); - hxaxtmin = vector( nPar_, -1 ); - hxaxtmax = vector( nPar_, 1 ); + hddMeasmin = vector(2, -1e-3); + hddMeasmax = vector(2, 1e-3); - hdxmin = vector( nPar_, -1 ); - hdxmax = vector( nPar_, 1 ); + hresmin = vector(2, -1e-2); + hresmax = vector(2, 1e-2); - hchi2min = 0; - hchi2max = 50; + hxaxtmin = vector(nPar_, -1); + hxaxtmax = vector(nPar_, 1); - maxNfitForDump_ = 10; - dump_ = false; + hdxmin = vector(nPar_, -1); + hdxmax = vector(nPar_, 1); - iLastPhiSec_ = 999; - iLastEtaReg_ = 999; -} + hchi2min = 0; + hchi2max = 50; + maxNfitForDump_ = 10; + dump_ = false; -L1fittedTrack L1KalmanComb::fit(const L1track3D& l1track3D){ + iLastPhiSec_ = 999; + iLastEtaReg_ = 999; + } - iLastPhiSec_ = iCurrentPhiSec_; - iLastEtaReg_ = iCurrentEtaReg_; - iCurrentPhiSec_ = l1track3D.iPhiSec(); - iCurrentEtaReg_ = l1track3D.iEtaReg(); - resetStates(); - deleteStubClusters(); - numUpdateCalls_ = 0; + L1fittedTrack L1KalmanComb::fit(const L1track3D &l1track3D) { + iLastPhiSec_ = iCurrentPhiSec_; + iLastEtaReg_ = iCurrentEtaReg_; + iCurrentPhiSec_ = l1track3D.iPhiSec(); + iCurrentEtaReg_ = l1track3D.iEtaReg(); + resetStates(); + deleteStubClusters(); + numUpdateCalls_ = 0; + + // Get cut on number of layers including variation due to dead sectors, pt dependence etc. + minStubLayersRed_ = Utility::numLayerCut( + "FIT", getSettings(), l1track3D.iPhiSec(), l1track3D.iEtaReg(), fabs(l1track3D.qOverPt()), l1track3D.eta()); + + //TP + const TP *tpa(0); + if (l1track3D.getMatchedTP()) { + tpa = l1track3D.getMatchedTP(); + } + tpa_ = tpa; - // Get cut on number of layers including variation due to dead sectors, pt dependence etc. - minStubLayersRed_ = Utility::numLayerCut("FIT", getSettings(), l1track3D.iPhiSec(), l1track3D.iEtaReg(), fabs(l1track3D.qOverPt()), l1track3D.eta()); + //dump flag + static unsigned nthFit(0); + nthFit++; + if (getSettings()->kalmanDebugLevel() >= 3 && nthFit <= maxNfitForDump_) { + if (tpa) + dump_ = true; + else + dump_ = false; + } else + dump_ = false; - //TP - const TP* tpa(0); - if( l1track3D.getMatchedTP() ){ - tpa = l1track3D.getMatchedTP(); - } - tpa_ = tpa; - - //dump flag - static unsigned nthFit(0); - nthFit++; - if( getSettings()->kalmanDebugLevel() >= 3 && nthFit <= maxNfitForDump_ ){ - if( tpa ) dump_ = true; - else dump_ = false; - } - else dump_ = false; + //stub list from L1track3D, sorted in layer order - necessary for clustering only + std::vector stubs = l1track3D.getStubs(); - //stub list from L1track3D, sorted in layer order - necessary for clustering only - std::vector stubs = l1track3D.getStubs(); - - sort(stubs.begin(), stubs.end(), orderStubsByLayer); // Unnecessary? + sort(stubs.begin(), stubs.end(), orderStubsByLayer); // Unnecessary? #ifdef MERGE_STUBS - // Eliminate identical duplicate stubs. - for(unsigned i=0; i < stubs.size(); i++ ){ - const Stub *stub_a = stubs.at(i); - for(unsigned j=i+1; j < stubs.size(); j++ ){ - const Stub *stub_b = stubs.at(j); - if( stub_a->r() == stub_b->r() && stub_a->phi() == stub_b->phi() && stub_a->z() == stub_b->z() ){ - stubs.erase( stubs.begin() + j ); - if( getSettings()->kalmanFillInternalHists() ) - hndupStub_->Fill(1); - j--; + // Eliminate identical duplicate stubs. + for (unsigned i = 0; i < stubs.size(); i++) { + const Stub *stub_a = stubs.at(i); + for (unsigned j = i + 1; j < stubs.size(); j++) { + const Stub *stub_b = stubs.at(j); + if (stub_a->r() == stub_b->r() && stub_a->phi() == stub_b->phi() && stub_a->z() == stub_b->z()) { + stubs.erase(stubs.begin() + j); + if (getSettings()->kalmanFillInternalHists()) + hndupStub_->Fill(1); + j--; + } } } - } #endif - std::vector stubcls; + std::vector stubcls; - for( unsigned j_layer=0; j_layer < 16; j_layer++ ){ - - std::vector layer_stubs; - for(unsigned i=0; i < stubs.size(); i++ ){ - const Stub *stub = stubs.at(i); - if( stub->layerId() == LayerId[j_layer] ){ - layer_stubs.push_back( stub ); + for (unsigned j_layer = 0; j_layer < 16; j_layer++) { + std::vector layer_stubs; + for (unsigned i = 0; i < stubs.size(); i++) { + const Stub *stub = stubs.at(i); + if (stub->layerId() == LayerId[j_layer]) { + layer_stubs.push_back(stub); + } } - } #ifdef MERGE_STUBS - if( LayerId[j_layer] < 10 ) - sort( layer_stubs.begin(), layer_stubs.end(), orderStubsByZ ); // barrel - else - sort( layer_stubs.begin(), layer_stubs.end(), orderStubsByR ); // endcap + if (LayerId[j_layer] < 10) + sort(layer_stubs.begin(), layer_stubs.end(), orderStubsByZ); // barrel + else + sort(layer_stubs.begin(), layer_stubs.end(), orderStubsByR); // endcap #endif - for(unsigned i=0; i < layer_stubs.size(); i++ ){ // Stubs in single layer, ordered by z or r. + for (unsigned i = 0; i < layer_stubs.size(); i++) { // Stubs in single layer, ordered by z or r. - std::vector stubs_for_cls; - stubs_for_cls.push_back(layer_stubs.at(i)); + std::vector stubs_for_cls; + stubs_for_cls.push_back(layer_stubs.at(i)); #ifdef MERGE_STUBS - while( layer_stubs.at(i) != layer_stubs.back() ){ - if( isOverlap( layer_stubs.at(i), layer_stubs.at(i+1), TYPE_NORMAL ) ){ - stubs_for_cls.push_back( layer_stubs.at(i+1) ); - if( getSettings()->kalmanFillInternalHists() ) - hnmergeStub_->Fill(0); - i++; - } - else break; - } + while (layer_stubs.at(i) != layer_stubs.back()) { + if (isOverlap(layer_stubs.at(i), layer_stubs.at(i + 1), TYPE_NORMAL)) { + stubs_for_cls.push_back(layer_stubs.at(i + 1)); + if (getSettings()->kalmanFillInternalHists()) + hnmergeStub_->Fill(0); + i++; + } else + break; + } #endif - if( getSettings()->kalmanFillInternalHists() ) { - - if( tpa && tpa->useForAlgEff() ){ - - if( stubs_for_cls.size() > 1 ){ - - std::set s_tps = stubs_for_cls.at(0)->assocTPs(); - if( s_tps.find( tpa ) != s_tps.end() ){ - - const Stub *sa = stubs_for_cls.front(); - const Stub *sb = stubs_for_cls.back(); - - double drphi = fabs( sa->r() * reco::deltaPhi( sa->phi(), sectorPhi() ) - sb->r() * reco::deltaPhi( sb->phi(), sectorPhi() ) ); - double dz = fabs( sa->z() - sb->z() ); - double dr = fabs( sa->r() - sb->r() ); - TString hname; - if( LayerId[j_layer] < 10 ){ - - hname = Form( "hBarrelStubMaxDistanceLayer%02d", LayerId[j_layer] ); - - if( hBarrelStubMaxDistanceMap.find( hname ) == hBarrelStubMaxDistanceMap.end() ){ - cout << hname << " does not exist." << endl; - } - else{ - hBarrelStubMaxDistanceMap[hname]->Fill( drphi, dz ); - } - } - else{ - hname = Form( "hEndcapStubMaxDistanceRing%02d", sa->endcapRing() ); - - if( hEndcapStubMaxDistanceMap.find( hname ) == hEndcapStubMaxDistanceMap.end() ){ - cout << hname << " does not exist." << endl; - } - else{ - hEndcapStubMaxDistanceMap[hname]->Fill( drphi, dr ); - } - } - } - } - } - } + if (getSettings()->kalmanFillInternalHists()) { + if (tpa && tpa->useForAlgEff()) { + if (stubs_for_cls.size() > 1) { + std::set s_tps = stubs_for_cls.at(0)->assocTPs(); + if (s_tps.find(tpa) != s_tps.end()) { + const Stub *sa = stubs_for_cls.front(); + const Stub *sb = stubs_for_cls.back(); + + double drphi = fabs(sa->r() * reco::deltaPhi(sa->phi(), sectorPhi()) - + sb->r() * reco::deltaPhi(sb->phi(), sectorPhi())); + double dz = fabs(sa->z() - sb->z()); + double dr = fabs(sa->r() - sb->r()); + TString hname; + if (LayerId[j_layer] < 10) { + hname = Form("hBarrelStubMaxDistanceLayer%02d", LayerId[j_layer]); + + if (hBarrelStubMaxDistanceMap.find(hname) == hBarrelStubMaxDistanceMap.end()) { + cout << hname << " does not exist." << endl; + } else { + hBarrelStubMaxDistanceMap[hname]->Fill(drphi, dz); + } + } else { + hname = Form("hEndcapStubMaxDistanceRing%02d", sa->endcapRing()); + + if (hEndcapStubMaxDistanceMap.find(hname) == hEndcapStubMaxDistanceMap.end()) { + cout << hname << " does not exist." << endl; + } else { + hEndcapStubMaxDistanceMap[hname]->Fill(drphi, dr); + } + } + } + } + } + } - // dl error now disabled - StubCluster *stbcl = new StubCluster( stubs_for_cls, sectorPhi(), 0 ); - stbcl_list_.push_back( stbcl ); - stubcls.push_back( stbcl ); - - if( getSettings()->kalmanFillInternalHists() ) { - if( !stbcl->barrel() ){ - TString hname = Form( "hphiErrorRatioRing%d", stbcl->endcapRing() ); - if( hphiErrorRatioMap.find(hname) == hphiErrorRatioMap.end() ){ - cout << hname << " does not exist." << endl; - } - else{ - hphiErrorRatioMap[hname]->Fill( fabs( stbcl->deltai() + 0.5 ), fabs( stbcl->dphi_dr() ) / stbcl->dphi_dl() ); - } - } + // dl error now disabled + StubCluster *stbcl = new StubCluster(stubs_for_cls, sectorPhi(), 0); + stbcl_list_.push_back(stbcl); + stubcls.push_back(stbcl); + + if (getSettings()->kalmanFillInternalHists()) { + if (!stbcl->barrel()) { + TString hname = Form("hphiErrorRatioRing%d", stbcl->endcapRing()); + if (hphiErrorRatioMap.find(hname) == hphiErrorRatioMap.end()) { + cout << hname << " does not exist." << endl; + } else { + hphiErrorRatioMap[hname]->Fill(fabs(stbcl->deltai() + 0.5), fabs(stbcl->dphi_dr()) / stbcl->dphi_dl()); + } + } + } } } - } - if( getSettings()->kalmanFillInternalHists() ){ - if( tpa && tpa->useForAlgEff() ){ - hTrackEta_->Fill( tpa->eta() ); - static set set_tp; - if( iCurrentPhiSec_ < iLastPhiSec_ && iCurrentEtaReg_ < iLastEtaReg_ ) set_tp.clear(); - if( set_tp.find( tpa ) == set_tp.end() ){ - hUniqueTrackEta_->Fill( tpa->eta() ); + if (getSettings()->kalmanFillInternalHists()) { + if (tpa && tpa->useForAlgEff()) { + hTrackEta_->Fill(tpa->eta()); + static set set_tp; + if (iCurrentPhiSec_ < iLastPhiSec_ && iCurrentEtaReg_ < iLastEtaReg_) + set_tp.clear(); + if (set_tp.find(tpa) == set_tp.end()) { + hUniqueTrackEta_->Fill(tpa->eta()); + } + set_tp.insert(tpa); } - set_tp.insert( tpa ); } - } - - - //track information dump - if( getSettings()->kalmanDebugLevel() >= 1 ){ - - std::cout << "===============================================================================" << endl; - std::cout << "Input track cand: [phiSec,etaReg]=[" << l1track3D.iPhiSec() << "," << l1track3D.iEtaReg() << "]"; - std::cout <<" HT(m,c)=("<chi2rphi(), cand->chi2rz(), nPar_, true); - - bool consistentHLS = false; // No longer used - // if (this->isHLS()) { - // unsigned int mBinHelixHLS, cBinHelixHLS; - // cand->getHLSselect(mBinHelixHLS, cBinHelixHLS, consistentHLS); - // if( getSettings()->kalmanDebugLevel() >= 3 ){ - // // Check if (m,c) corresponding to helix params are correctly calculated by HLS code. - // bool HLS_OK = ((mBinHelixHLS == returnTrk.getCellLocationFit().first) && (cBinHelixHLS == returnTrk.getCellLocationFit().second)); - // if (not HLS_OK) std::cout<<"WARNING HLS mBinHelix disagrees with C++:" - // <<" (HLS,C++) m=("<isHLS() && nPar_ == 4) { - returnTrk.setInfoKF( cand->nSkippedLayers(), numUpdateCalls_, consistentHLS ); - } else { - returnTrk.setInfoKF( cand->nSkippedLayers(), numUpdateCalls_ ); - } - - // If doing 5 parameter fit, optionally also calculate helix params & chi2 with beam-spot constraint applied, - // and store inside L1fittedTrack object. - if (getSettings()->kalmanAddBeamConstr()) { - if (nPar_ == 5) { - double chi2rphi_bcon = 0.; - std::map trackParams_bcon = getTrackParams_BeamConstr(cand, chi2rphi_bcon); - returnTrk.setBeamConstr(trackParams_bcon["qOverPt"], trackParams_bcon["phi0"], chi2rphi_bcon); + //track information dump + if (getSettings()->kalmanDebugLevel() >= 1) { + std::cout << "===============================================================================" << endl; + std::cout << "Input track cand: [phiSec,etaReg]=[" << l1track3D.iPhiSec() << "," << l1track3D.iEtaReg() << "]"; + std::cout << " HT(m,c)=(" << l1track3D.getCellLocationHT().first << "," << l1track3D.getCellLocationHT().second + << ") q/pt=" << l1track3D.qOverPt() << " tanL=" << l1track3D.tanLambda() << " z0=" << l1track3D.z0() + << " phi0=" << l1track3D.phi0() << " nStubs=" << l1track3D.getNumStubs() << " d0=" << l1track3D.d0() + << std::endl; + if (not getSettings()->hybrid()) + printTP(cout, tpa); + if (getSettings()->kalmanDebugLevel() >= 2) { + printStubLayers(cout, stubs, l1track3D.iEtaReg()); + printStubClusters(cout, stubcls); } } - // Fitted track params must lie in same sector as HT originally found track in. - if (! getSettings()->hybrid() ) { // consistentSector() function not yet working for Hybrid. - - // Bodge to take into account digitisation in sector consistency check. - if (getSettings()->enableDigitize()) returnTrk.digitizeTrack("KF4ParamsComb"); + //Kalman Filter + std::vector cands = doKF(l1track3D, stubcls, tpa); + + //return L1fittedTrk for the selected state (if KF produced one it was happy with). + if (cands.size()) { + const KalmanState *cand = cands[0]; + + //cout<<"Final KF candidate eta="<candidate().iEtaReg()<<" ns="<nSkippedLayers()<<" klid="<nextLayer()-1<<" n="<nStubLayers()< trackParams = getTrackParams(cand); + + L1fittedTrack returnTrk(getSettings(), + l1track3D, + cand->stubs(), + cand->hitPattern(), + trackParams["qOverPt"], + trackParams["d0"], + trackParams["phi0"], + trackParams["z0"], + trackParams["t"], + cand->chi2rphi(), + cand->chi2rz(), + nPar_, + true); + + bool consistentHLS = false; // No longer used + // if (this->isHLS()) { + // unsigned int mBinHelixHLS, cBinHelixHLS; + // cand->getHLSselect(mBinHelixHLS, cBinHelixHLS, consistentHLS); + // if( getSettings()->kalmanDebugLevel() >= 3 ){ + // // Check if (m,c) corresponding to helix params are correctly calculated by HLS code. + // bool HLS_OK = ((mBinHelixHLS == returnTrk.getCellLocationFit().first) && (cBinHelixHLS == returnTrk.getCellLocationFit().second)); + // if (not HLS_OK) std::cout<<"WARNING HLS mBinHelix disagrees with C++:" + // <<" (HLS,C++) m=("<isHLS() && nPar_ == 4) { + returnTrk.setInfoKF(cand->nSkippedLayers(), numUpdateCalls_, consistentHLS); + } else { + returnTrk.setInfoKF(cand->nSkippedLayers(), numUpdateCalls_); + } - if (! returnTrk.consistentSector()) { - L1fittedTrack failedTrk(getSettings(), l1track3D, cand->stubs(), cand->hitPattern(), trackParams["qOverPt"], trackParams["d0"], trackParams["phi0"], trackParams["z0"], trackParams["t"], cand->chi2rphi(), cand->chi2rz(), nPar_, false); - if(this->isHLS() && nPar_ == 4) { - failedTrk.setInfoKF( cand->nSkippedLayers(), numUpdateCalls_, consistentHLS ); - } else { - failedTrk.setInfoKF( cand->nSkippedLayers(), numUpdateCalls_ ); + // If doing 5 parameter fit, optionally also calculate helix params & chi2 with beam-spot constraint applied, + // and store inside L1fittedTrack object. + if (getSettings()->kalmanAddBeamConstr()) { + if (nPar_ == 5) { + double chi2rphi_bcon = 0.; + std::map trackParams_bcon = getTrackParams_BeamConstr(cand, chi2rphi_bcon); + returnTrk.setBeamConstr(trackParams_bcon["qOverPt"], trackParams_bcon["phi0"], chi2rphi_bcon); } - if ( getSettings()->kalmanDebugLevel() >= 1 ) cout<<"Track rejected by sector consistency test"<kalmanDebugLevel() >= 3 ){ - cout << "------------------------------------" << endl; - if( tpa && tpa->useForAlgEff() ){ - cout << "TP for eff. : index " << tpa->index() << endl; - } - cout << "Candidate : " << endl; - if( tpa && tpa->useForAlgEff() && returnTrk.getPurity() != 1 ){ - cout << "The candidate is not pure" << endl; + // Fitted track params must lie in same sector as HT originally found track in. + if (!getSettings()->hybrid()) { // consistentSector() function not yet working for Hybrid. + + // Bodge to take into account digitisation in sector consistency check. + if (getSettings()->enableDigitize()) + returnTrk.digitizeTrack("KF4ParamsComb"); + + if (!returnTrk.consistentSector()) { + L1fittedTrack failedTrk(getSettings(), + l1track3D, + cand->stubs(), + cand->hitPattern(), + trackParams["qOverPt"], + trackParams["d0"], + trackParams["phi0"], + trackParams["z0"], + trackParams["t"], + cand->chi2rphi(), + cand->chi2rz(), + nPar_, + false); + if (this->isHLS() && nPar_ == 4) { + failedTrk.setInfoKF(cand->nSkippedLayers(), numUpdateCalls_, consistentHLS); + } else { + failedTrk.setInfoKF(cand->nSkippedLayers(), numUpdateCalls_); + } + if (getSettings()->kalmanDebugLevel() >= 1) + cout << "Track rejected by sector consistency test" << endl; + return failedTrk; + } } - cand->dump( cout, tpa, true ); - cout << "------------------------------------" << endl; - } - - //fill histograms for the selected state with TP for algEff - if( getSettings()->kalmanFillInternalHists() ) fillCandHists( *cand, tpa ); - return returnTrk; + //candidate dump + if (getSettings()->kalmanDebugLevel() >= 3) { + cout << "------------------------------------" << endl; + if (tpa && tpa->useForAlgEff()) { + cout << "TP for eff. : index " << tpa->index() << endl; + } + cout << "Candidate : " << endl; + if (tpa && tpa->useForAlgEff() && returnTrk.getPurity() != 1) { + cout << "The candidate is not pure" << endl; + } + cand->dump(cout, tpa, true); + cout << "------------------------------------" << endl; + } - } else { + //fill histograms for the selected state with TP for algEff + if (getSettings()->kalmanFillInternalHists()) + fillCandHists(*cand, tpa); - if (getSettings()->kalmanDebugLevel() >= 1) { - bool goodTrack = ( tpa && tpa->useForAlgEff() ); // Matches truth particle. - if(goodTrack) { - // Debug printout for Mark to understand why tracks are lost. + return returnTrk; - int tpin=tpa->index(); - cout<<"TRACK LOST: eta="<index(); - cout<assocTPs().size()==0) cout<<" none"<kalmanDebugLevel() >= 1) { + bool goodTrack = (tpa && tpa->useForAlgEff()); // Matches truth particle. + if (goodTrack) { + // Debug printout for Mark to understand why tracks are lost. + + int tpin = tpa->index(); + cout << "TRACK LOST: eta=" << l1track3D.iEtaReg() << " pt=" << l1track3D.pt() << " tp=" << tpin << endl; + + for (auto stubCluster : stubcls) { + int kalmanLayer = this->getKalmanLayer(l1track3D.iEtaReg(), + stubCluster->layerIdReduced(), + stubCluster->barrel(), + stubCluster->r(), + stubCluster->z()); + cout << " Stub: lay_red=" << stubCluster->layerIdReduced() << " KFlay=" << kalmanLayer + << " r=" << stubCluster->r() << " z=" << stubCluster->z() << " assoc TPs ="; + std::vector stubs = stubCluster->stubs(); + for (auto stub : stubs) { + for (const TP *tp_i : stub->assocTPs()) + cout << " " << tp_i->index(); + cout << endl; + if (stub->assocTPs().size() == 0) + cout << " none" << endl; + } + } + cout << "---------------------" << endl; + /* for( it_last = last_states.begin(); it_last != last_states.end(); it_last++ ){ const KalmanState *state = *it_last; @@ -644,297 +667,312 @@ L1fittedTrack L1KalmanComb::fit(const L1track3D& l1track3D){ } */ - cout<<"====================="<kalmanDebugLevel() >= 3 ){ - if( tpa && tpa->useForAlgEff() ){ - cout << "TP for eff. missed addr. index : " << tpa << " " << tpa->index() << endl; - printStubClusters( cout, stubcls ); - printStubs( cout, stubs ); + + //dump on the missed TP for efficiency calculation. + if (getSettings()->kalmanDebugLevel() >= 3) { + if (tpa && tpa->useForAlgEff()) { + cout << "TP for eff. missed addr. index : " << tpa << " " << tpa->index() << endl; + printStubClusters(cout, stubcls); + printStubs(cout, stubs); + } } - } - L1fittedTrack returnTrk(getSettings(), l1track3D, l1track3D.getStubs(), 0, l1track3D.qOverPt(), 0, l1track3D.phi0(), l1track3D.z0(), l1track3D.tanLambda(), 9999, 9999, nPar_, false); - returnTrk.setInfoKF( 0, numUpdateCalls_ ); - return returnTrk; + L1fittedTrack returnTrk(getSettings(), + l1track3D, + l1track3D.getStubs(), + 0, + l1track3D.qOverPt(), + 0, + l1track3D.phi0(), + l1track3D.z0(), + l1track3D.tanLambda(), + 9999, + 9999, + nPar_, + false); + returnTrk.setInfoKF(0, numUpdateCalls_); + return returnTrk; + } } -} + std::vector L1KalmanComb::doKF(const L1track3D &l1track3D, + const std::vector &stubClusters, + const TP *tpa) { +#ifdef RECALC_DEBUG + cout << "FITTER new track: HT cell=(" << l1track3D.getCellLocationHT().first << "," + << l1track3D.getCellLocationHT().second << ")" << endl; +#endif + // output container (contains 0 or 1 states). + std::vector finished_states; -std::vector L1KalmanComb::doKF( const L1track3D& l1track3D, const std::vector &stubClusters, const TP *tpa ){ + std::map> + best_state_by_nstubs; // Best state (if any) for each viable no. of stubs on track value. -#ifdef RECALC_DEBUG - cout<<"FITTER new track: HT cell=("< x0 = seedx(l1track3D); + TMatrixD pxx0 = seedP(l1track3D); + TMatrixD K(nPar_, 2); + TMatrixD dcov(2, 2); - // output container (contains 0 or 1 states). - std::vector finished_states; - - std::map > best_state_by_nstubs; // Best state (if any) for each viable no. of stubs on track value. - - // seed helix params & their covariance. - std::vector x0 = seedx(l1track3D); - TMatrixD pxx0 = seedP(l1track3D); - TMatrixD K( nPar_, 2 ); - TMatrixD dcov( 2, 2 ); - - const KalmanState *state0 = mkState( l1track3D, 0, 0, 0, nullptr, x0, pxx0, K, dcov, nullptr, 0, 0 ); - - if( getSettings()->kalmanFillInternalHists() ) fillSeedHists( state0, tpa ); - - - // internal containers - i.e. the state FIFO. Contains estimate of helix params in last/next layer, with multiple entries if there were multiple stubs, yielding multiple states. - std::vector new_states; - std::vector prev_states; - prev_states.push_back( state0 ); - - // arrange stubs into Kalman layers according to eta region - int etaReg = l1track3D.iEtaReg(); - std::map > layerStubs; - - // Get dead layers, if any. - // They are assumed to be idetnical to those defined in StubKiller.cc - bool remove2PSCut = getSettings()->kalmanRemove2PScut(); - set kalmanDeadLayers = getKalmanDeadLayers( remove2PSCut ); - - for( auto stubCluster : stubClusters ){ - - // Get Kalman encoded layer ID for this stub. - int kalmanLayer = this->getKalmanLayer(etaReg, stubCluster->layerIdReduced(), stubCluster->barrel(), stubCluster->r(), stubCluster->z()); - - if (kalmanLayer != 7) { - const_cast(stubCluster)->setLayerKF(kalmanLayer); // Ugly trick to store KF layer inside stub cluster. - if (layerStubs[kalmanLayer].size() < getSettings()->kalmanMaxStubsPerLayer()) { - layerStubs[kalmanLayer].push_back( stubCluster ); - } else { - // If too many stubs, FW keeps the last stub. - layerStubs[kalmanLayer].back() = stubCluster; + const KalmanState *state0 = mkState(l1track3D, 0, 0, 0, nullptr, x0, pxx0, K, dcov, nullptr, 0, 0); + + if (getSettings()->kalmanFillInternalHists()) + fillSeedHists(state0, tpa); + + // internal containers - i.e. the state FIFO. Contains estimate of helix params in last/next layer, with multiple entries if there were multiple stubs, yielding multiple states. + std::vector new_states; + std::vector prev_states; + prev_states.push_back(state0); + + // arrange stubs into Kalman layers according to eta region + int etaReg = l1track3D.iEtaReg(); + std::map> layerStubs; + + // Get dead layers, if any. + // They are assumed to be idetnical to those defined in StubKiller.cc + bool remove2PSCut = getSettings()->kalmanRemove2PScut(); + set kalmanDeadLayers = getKalmanDeadLayers(remove2PSCut); + + for (auto stubCluster : stubClusters) { + // Get Kalman encoded layer ID for this stub. + int kalmanLayer = this->getKalmanLayer( + etaReg, stubCluster->layerIdReduced(), stubCluster->barrel(), stubCluster->r(), stubCluster->z()); + + if (kalmanLayer != 7) { + const_cast(stubCluster) + ->setLayerKF(kalmanLayer); // Ugly trick to store KF layer inside stub cluster. + if (layerStubs[kalmanLayer].size() < getSettings()->kalmanMaxStubsPerLayer()) { + layerStubs[kalmanLayer].push_back(stubCluster); + } else { + // If too many stubs, FW keeps the last stub. + layerStubs[kalmanLayer].back() = stubCluster; + } } } - } - // iterate using state->nextLayer() to determine next Kalman layer(s) to add stubs from - const unsigned int maxIterations = 6; // Increase if you want to allow 7 stubs per fitted track. - for( unsigned iteration = 0; iteration < maxIterations; iteration++ ){ - - int combinations_per_iteration = 0; - - bool easy = (l1track3D.getNumStubs() < getSettings()->kalmanMaxStubsEasy()); - unsigned int kalmanMaxSkipLayers = easy ? getSettings()->kalmanMaxSkipLayersEasy() : getSettings()->kalmanMaxSkipLayersHard(); - - // update each state from previous iteration (or seed) using stubs in next Kalman layer - std::vector::const_iterator i_state = prev_states.begin(); - for(; i_state != prev_states.end(); i_state++ ){ - - const KalmanState *the_state = *i_state; - - unsigned int layer = the_state->nextLayer(); - unsigned skipped = the_state->nSkippedLayers(); - - // If this layer is known to be dead, skip to the next layer (layer+1) - // The next_states_skipped will then look at layer+2 - // However, if there are stubs in this layer, then don't skip (e.g. our phi/eta boundaries might not line up exactly with a dead region) - // Continue to skip until you reach a functioning layer (or a layer with stubs) - unsigned nSkippedDeadLayers = 0; - unsigned nSkippedAmbiguousLayers = 0; - while ( kalmanDeadLayers.find(layer) != kalmanDeadLayers.end() && layerStubs[layer].size() == 0 ) { - layer += 1; - ++nSkippedDeadLayers; - } - while ( this->getKalmanAmbiguousLayer(etaReg, layer) && layerStubs[layer].size() == 0 ) { - layer += 1; - ++nSkippedAmbiguousLayers; - } + // iterate using state->nextLayer() to determine next Kalman layer(s) to add stubs from + const unsigned int maxIterations = 6; // Increase if you want to allow 7 stubs per fitted track. + for (unsigned iteration = 0; iteration < maxIterations; iteration++) { + int combinations_per_iteration = 0; + + bool easy = (l1track3D.getNumStubs() < getSettings()->kalmanMaxStubsEasy()); + unsigned int kalmanMaxSkipLayers = + easy ? getSettings()->kalmanMaxSkipLayersEasy() : getSettings()->kalmanMaxSkipLayersHard(); + + // update each state from previous iteration (or seed) using stubs in next Kalman layer + std::vector::const_iterator i_state = prev_states.begin(); + for (; i_state != prev_states.end(); i_state++) { + const KalmanState *the_state = *i_state; + + unsigned int layer = the_state->nextLayer(); + unsigned skipped = the_state->nSkippedLayers(); + + // If this layer is known to be dead, skip to the next layer (layer+1) + // The next_states_skipped will then look at layer+2 + // However, if there are stubs in this layer, then don't skip (e.g. our phi/eta boundaries might not line up exactly with a dead region) + // Continue to skip until you reach a functioning layer (or a layer with stubs) + unsigned nSkippedDeadLayers = 0; + unsigned nSkippedAmbiguousLayers = 0; + while (kalmanDeadLayers.find(layer) != kalmanDeadLayers.end() && layerStubs[layer].size() == 0) { + layer += 1; + ++nSkippedDeadLayers; + } + while (this->getKalmanAmbiguousLayer(etaReg, layer) && layerStubs[layer].size() == 0) { + layer += 1; + ++nSkippedAmbiguousLayers; + } - // containers for updated state+stub combinations - std::vector next_states; - std::vector next_states_skipped; - - // find stubs for this layer - std::vector stubs = layerStubs[layer]; // If layer > 6, this will return empty vector, so safe. - - // find stubs for next layer if we skip a layer, except when we are on the penultimate layer, - // or we have exceeded the max skipped layers - std::vector next_stubs ; - - // If the next layer (layer+1) is a dead layer, then proceed to the layer after next (layer+2), if possible - // Also note if we need to increase "skipped" by one more for these states - unsigned nSkippedDeadLayers_nextStubs = 0; - unsigned nSkippedAmbiguousLayers_nextStubs = 0; - if ( skipped < kalmanMaxSkipLayers ) { - if ( kalmanDeadLayers.find(layer+1) != kalmanDeadLayers.end() && layerStubs[layer+1].size() == 0 ) { - next_stubs = layerStubs[layer+2]; - nSkippedDeadLayers_nextStubs++; - } else if ( this->getKalmanAmbiguousLayer(etaReg, layer) && layerStubs[layer+1].size() == 0 ) { - next_stubs = layerStubs[layer+2]; - nSkippedAmbiguousLayers_nextStubs++; - } else { - next_stubs = layerStubs[layer+1]; - } - } + // containers for updated state+stub combinations + std::vector next_states; + std::vector next_states_skipped; + + // find stubs for this layer + std::vector stubs = + layerStubs[layer]; // If layer > 6, this will return empty vector, so safe. + + // find stubs for next layer if we skip a layer, except when we are on the penultimate layer, + // or we have exceeded the max skipped layers + std::vector next_stubs; + + // If the next layer (layer+1) is a dead layer, then proceed to the layer after next (layer+2), if possible + // Also note if we need to increase "skipped" by one more for these states + unsigned nSkippedDeadLayers_nextStubs = 0; + unsigned nSkippedAmbiguousLayers_nextStubs = 0; + if (skipped < kalmanMaxSkipLayers) { + if (kalmanDeadLayers.find(layer + 1) != kalmanDeadLayers.end() && layerStubs[layer + 1].size() == 0) { + next_stubs = layerStubs[layer + 2]; + nSkippedDeadLayers_nextStubs++; + } else if (this->getKalmanAmbiguousLayer(etaReg, layer) && layerStubs[layer + 1].size() == 0) { + next_stubs = layerStubs[layer + 2]; + nSkippedAmbiguousLayers_nextStubs++; + } else { + next_stubs = layerStubs[layer + 1]; + } + } - // If track was not rejected by isGoodState() is previous iteration, failure here usually means the tracker ran out of layers to explore. - // (Due to "kalmanLayer" not having unique ID for each layer within a given eta sector). - if ( getSettings()->kalmanDebugLevel() >= 2 && best_state_by_nstubs.size() == 0 && stubs.size() == 0 && next_stubs.size() == 0) cout<<"State is lost by start of iteration "< temp_stubs; - std::vector temp_nextstubs; - for (auto stub : stubs) { - if (stub->r()<60.0) temp_stubs.push_back(stub); - } - for (auto stub : next_stubs) { - if (stub->r()<60.0) temp_nextstubs.push_back(stub); - } - stubs = temp_stubs; - next_stubs = temp_nextstubs; - } - - combinations_per_iteration += stubs.size() + next_stubs.size(); - - - // loop over each stub in this layer and check for compatibility with this state - for( unsigned i=0; i < stubs.size() ; i++ ){ - - const StubCluster * next_stubCluster = stubs[i]; - - // Update helix params by adding this stub. - const KalmanState * new_state = kalmanUpdate( skipped, layer+1, next_stubCluster, *the_state, tpa ); - - if( getSettings()->kalmanFillInternalHists() ) fillStepHists( tpa, iteration, new_state ); - - // Cut on track chi2, pt etc. - if(isGoodState( *new_state ) ) next_states.push_back( new_state ); - } + // If track was not rejected by isGoodState() is previous iteration, failure here usually means the tracker ran out of layers to explore. + // (Due to "kalmanLayer" not having unique ID for each layer within a given eta sector). + if (getSettings()->kalmanDebugLevel() >= 2 && best_state_by_nstubs.size() == 0 && stubs.size() == 0 && + next_stubs.size() == 0) + cout << "State is lost by start of iteration " << iteration << " : #stubs=" << stubs.size() + << " #next_stubs=" << next_stubs.size() << " layer=" << layer << " eta=" << l1track3D.iEtaReg() << endl; + + // If we skipped over a dead layer, only increment "skipped" after the stubs in next+1 layer have been obtained + skipped += nSkippedDeadLayers; + skipped += nSkippedAmbiguousLayers; + + // check to guarantee no fewer than 2PS hits per state at iteration 1 (r<60cm) + // iteration 0 will always include a PS hit, but iteration 1 could use 2S hits unless we include this + if (iteration == 1 && !remove2PSCut) { + std::vector temp_stubs; + std::vector temp_nextstubs; + for (auto stub : stubs) { + if (stub->r() < 60.0) + temp_stubs.push_back(stub); + } + for (auto stub : next_stubs) { + if (stub->r() < 60.0) + temp_nextstubs.push_back(stub); + } + stubs = temp_stubs; + next_stubs = temp_nextstubs; + } - // loop over each stub in next layer if we skip, and check for compatibility with this state - for( unsigned i=0; i < next_stubs.size() ; i++ ){ - - const StubCluster * next_stubCluster = next_stubs[i]; - - const KalmanState * new_state = kalmanUpdate( skipped+1+nSkippedDeadLayers_nextStubs+nSkippedAmbiguousLayers_nextStubs, layer+2+nSkippedDeadLayers_nextStubs+nSkippedAmbiguousLayers_nextStubs, next_stubCluster, *the_state, tpa ); - - if( getSettings()->kalmanFillInternalHists() ) fillStepHists( tpa, iteration, new_state ); - - if(isGoodState( *new_state ) ) next_states_skipped.push_back( new_state ); - } - - // post Kalman filter local sorting per state - sort( next_states.begin(), next_states.end(), KalmanState::orderChi2); - sort( next_states_skipped.begin(), next_states_skipped.end(), KalmanState::orderChi2); - - - int i, max_states, max_states_skip; - - // If layer contained several stubs, so several states now exist, select only the best ones. - // -- Disable this by setting to large values, as not used in latest KF firmware. - // (But not too big as this wastes CPU). - - switch ( iteration ) { - case 0: - max_states = 15; - max_states_skip = 15; - break; - case 1: - max_states = 15; - max_states_skip = 15; - break; - case 2: - max_states = 15; - max_states_skip = 15; - break; - case 3: - max_states = 15; - max_states_skip = 15; - break; - case 4: - max_states = 15; - max_states_skip = 15; - break; - case 5: - max_states = 15; - max_states_skip = 15; - break; - default: - max_states = 15; - max_states_skip = 15; - break; - } - - - i = 0; - for( auto state : next_states ){ - - if( i < max_states ){ - new_states.push_back( state ); - } else { - break; - } - i++; - - } - - i = 0; - for( auto state : next_states_skipped ){ - - if( i < max_states_skip ){ - new_states.push_back( state ); - } else { - break; - } - i++; - - } - - } //end of state loop + combinations_per_iteration += stubs.size() + next_stubs.size(); + + // loop over each stub in this layer and check for compatibility with this state + for (unsigned i = 0; i < stubs.size(); i++) { + const StubCluster *next_stubCluster = stubs[i]; + // Update helix params by adding this stub. + const KalmanState *new_state = kalmanUpdate(skipped, layer + 1, next_stubCluster, *the_state, tpa); - if( getSettings()->kalmanFillInternalHists() ) { - TString hname = Form( "hstubComb_itr%d", iteration ); - if( hstubCombMap.find(hname) == hstubCombMap.end() ){ - cout << hname << " does not exist." << endl; + if (getSettings()->kalmanFillInternalHists()) + fillStepHists(tpa, iteration, new_state); + + // Cut on track chi2, pt etc. + if (isGoodState(*new_state)) + next_states.push_back(new_state); + } + + // loop over each stub in next layer if we skip, and check for compatibility with this state + for (unsigned i = 0; i < next_stubs.size(); i++) { + const StubCluster *next_stubCluster = next_stubs[i]; + + const KalmanState *new_state = + kalmanUpdate(skipped + 1 + nSkippedDeadLayers_nextStubs + nSkippedAmbiguousLayers_nextStubs, + layer + 2 + nSkippedDeadLayers_nextStubs + nSkippedAmbiguousLayers_nextStubs, + next_stubCluster, + *the_state, + tpa); + + if (getSettings()->kalmanFillInternalHists()) + fillStepHists(tpa, iteration, new_state); + + if (isGoodState(*new_state)) + next_states_skipped.push_back(new_state); + } + + // post Kalman filter local sorting per state + sort(next_states.begin(), next_states.end(), KalmanState::orderChi2); + sort(next_states_skipped.begin(), next_states_skipped.end(), KalmanState::orderChi2); + + int i, max_states, max_states_skip; + + // If layer contained several stubs, so several states now exist, select only the best ones. + // -- Disable this by setting to large values, as not used in latest KF firmware. + // (But not too big as this wastes CPU). + + switch (iteration) { + case 0: + max_states = 15; + max_states_skip = 15; + break; + case 1: + max_states = 15; + max_states_skip = 15; + break; + case 2: + max_states = 15; + max_states_skip = 15; + break; + case 3: + max_states = 15; + max_states_skip = 15; + break; + case 4: + max_states = 15; + max_states_skip = 15; + break; + case 5: + max_states = 15; + max_states_skip = 15; + break; + default: + max_states = 15; + max_states_skip = 15; + break; + } + + i = 0; + for (auto state : next_states) { + if (i < max_states) { + new_states.push_back(state); + } else { + break; + } + i++; + } + + i = 0; + for (auto state : next_states_skipped) { + if (i < max_states_skip) { + new_states.push_back(state); + } else { + break; + } + i++; + } + + } //end of state loop + + if (getSettings()->kalmanFillInternalHists()) { + TString hname = Form("hstubComb_itr%d", iteration); + if (hstubCombMap.find(hname) == hstubCombMap.end()) { + cout << hname << " does not exist." << endl; + } else { + hstubCombMap[hname]->Fill(combinations_per_iteration); + } } - else{ - hstubCombMap[hname]->Fill( combinations_per_iteration ); + + // copy new_states into prev_states for next iteration or end if we are on + // last iteration by clearing all states and making final state selection + + sort(new_states.begin(), new_states.end(), KalmanState::orderMinSkipChi2); // Sort by chi2*(skippedLayers+1) + + unsigned int nStubs = iteration + 1; + // Success. We have at least one state that passes all cuts. Save best state found with this number of stubs. + if (nStubs >= getSettings()->kalmanMinNumStubs() && new_states.size() > 0) + best_state_by_nstubs[nStubs] = new_states[0]; + + //if ( getSettings()->kalmanDebugLevel() >= 1 && best_state_by_nstubs.size() == 0 && new_states.size() == 0) cout<<"Track is lost by end iteration "<chi2()<<" "<reducedChi2()<<" "<path()<<" chose instead "<chi2()<<" "<reducedChi2()<<" "<path()<second; // First element has largest number of stubs. - finished_states.push_back(stateFinal); - if ( getSettings()->kalmanDebugLevel() >= 1 ) { - cout<<"Track found! final state selection: nLay="<nStubLayers()<<" hitPattern="<hitPattern()< y = getTrackParams( stateFinal ); - cout<<" q/pt="<chi2()<<"/"<nStubLayers(); - cout<kalmanDebugLevel() >= 1 ) { - cout<<"Track lost"<second; // First element has largest number of stubs. + finished_states.push_back(stateFinal); + if (getSettings()->kalmanDebugLevel() >= 1) { + cout << "Track found! final state selection: nLay=" << stateFinal->nStubLayers() << " hitPattern=" << std::hex + << stateFinal->hitPattern() << std::dec << " phiSec=" << l1track3D.iPhiSec() + << " etaReg=" << l1track3D.iEtaReg() << " HT(m,c)=(" << l1track3D.getCellLocationHT().first << "," + << l1track3D.getCellLocationHT().second << ")"; + std::map y = getTrackParams(stateFinal); + cout << " q/pt=" << y["qOverPt"] << " tanL=" << y["t"] << " z0=" << y["z0"] << " phi0=" << y["phi0"]; + if (nPar_ == 5) + cout << " d0=" << y["d0"]; + cout << " chosen from states:"; + for (const auto &p : best_state_by_nstubs) + cout << " " << p.second->chi2() << "/" << p.second->nStubLayers(); + cout << endl; + } + } else { + if (getSettings()->kalmanDebugLevel() >= 1) { + cout << "Track lost" << endl; + } } + + return finished_states; } - return finished_states; -} + //--- Update a helix state by adding a stub. + //--- ("layer" is not the layer of the stub being added now, but rather the next layer that will be searched after this stub has been added). + const KalmanState *L1KalmanComb::kalmanUpdate( + unsigned skipped, unsigned layer, const StubCluster *stubCluster, const KalmanState &state, const TP *tpa) { + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "---------------" << endl; + cout << "kalmanUpdate" << endl; + cout << "---------------" << endl; + printStubCluster(cout, stubCluster); + } -//--- Update a helix state by adding a stub. -//--- ("layer" is not the layer of the stub being added now, but rather the next layer that will be searched after this stub has been added). + numUpdateCalls_++; // For monitoring, count calls to updator per track. + + // Helix params & their covariance. + std::vector xa = state.xa(); + TMatrixD cov_xa = state.pxxa(); + if (state.barrel() && !stubCluster->barrel()) { + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "STATE BARREL TO ENDCAP BEFORE " << endl; + cout << "state : " << xa.at(0) << " " << xa.at(1) << " " << xa.at(2) << " " << xa.at(3) << endl; + cout << "cov(x): " << endl; + cov_xa.Print(); + } + barrelToEndcap(state.r(), stubCluster, xa, cov_xa); + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "STATE BARREL TO ENDCAP AFTER " << endl; + cout << "state : " << xa.at(0) << " " << xa.at(1) << " " << xa.at(2) << " " << xa.at(3) << endl; + cout << "cov(x): " << endl; + cov_xa.Print(); + } + } + // Matrix to propagate helix params from one layer to next (=identity matrix). + TMatrixD f = F(stubCluster, &state); + TMatrixD ft(TMatrixD::kTransposed, f); + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "f" << endl; + f.Print(); + cout << "ft" << endl; + ft.Print(); + } -const KalmanState *L1KalmanComb::kalmanUpdate( unsigned skipped, unsigned layer, const StubCluster *stubCluster, const KalmanState &state, const TP *tpa ){ + std::vector fx = Fx(f, xa); // Multiply matrices to get helix params at next layer. + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "fx = ["; + for (unsigned i = 0; i < nPar_; i++) + cout << fx.at(i) << ", "; + cout << "]" << endl; + } - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "---------------" << endl; - cout << "kalmanUpdate" << endl; - cout << "---------------" << endl; - printStubCluster( cout, stubCluster ); - } + std::vector delta = residual(stubCluster, fx, state.candidate().qOverPt()); + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "delta = " << delta[0] << ", " << delta[1] << endl; + } - numUpdateCalls_++; // For monitoring, count calls to updator per track. + // Derivative of predicted (phi,z) intercept with layer w.r.t. helix params. + TMatrixD h = H(stubCluster); + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "h" << endl; + h.Print(); + } - // Helix params & their covariance. - std::vector xa = state.xa(); - TMatrixD cov_xa = state.pxxa(); - if( state.barrel() && !stubCluster->barrel() ){ - if( getSettings()->kalmanDebugLevel() >= 4 ) { - cout << "STATE BARREL TO ENDCAP BEFORE " << endl; - cout << "state : " << xa.at(0) << " " << xa.at(1) << " " << xa.at(2) << " " << xa.at(3) << endl; - cout << "cov(x): " << endl; + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "previous state covariance" << endl; cov_xa.Print(); } - barrelToEndcap( state.r(), stubCluster, xa, cov_xa ); - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "STATE BARREL TO ENDCAP AFTER " << endl; - cout << "state : " << xa.at(0) << " " << xa.at(1) << " " << xa.at(2) << " " << xa.at(3) << endl; - cout << "cov(x): " << endl; - cov_xa.Print(); + // Get contribution to helix parameter covariance from scattering (NOT USED). + TMatrixD pxxm = PxxModel(&state, stubCluster); + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "model xcov" << endl; + pxxm.Print(); + } + // Get covariance on helix parameters. + TMatrixD pxcov = f * cov_xa * ft + pxxm; + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "forcast xcov + model xcov" << endl; + pxcov.Print(); + } + // Get hit position covariance matrix. + TMatrixD dcov = PddMeas(stubCluster, &state); + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "dcov" << endl; + dcov.Print(); + } + // Calculate Kalman Gain matrix. + TMatrixD k = GetKalmanMatrix(h, pxcov, dcov); + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "k" << endl; + k.Print(); } - } - // Matrix to propagate helix params from one layer to next (=identity matrix). - TMatrixD f = F(stubCluster, &state ); - TMatrixD ft(TMatrixD::kTransposed, f ); - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "f" << endl; - f.Print(); - cout << "ft" << endl; - ft.Print(); - } - - std::vector fx = Fx( f, xa ); // Multiply matrices to get helix params at next layer. - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "fx = ["; - for( unsigned i = 0; i < nPar_; i++ ) cout << fx.at(i) << ", "; - cout << "]" << endl; - } - - std::vector delta = residual(stubCluster, fx, state.candidate().qOverPt() ); - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "delta = " << delta[0] << ", " << delta[1] << endl; - } - - // Derivative of predicted (phi,z) intercept with layer w.r.t. helix params. - TMatrixD h = H(stubCluster); - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "h" << endl; - h.Print(); - } + std::vector new_xa(nPar_); + TMatrixD new_pxxa; + GetAdjustedState(k, pxcov, fx, stubCluster, delta, new_xa, new_pxxa); + if (getSettings()->kalmanDebugLevel() >= 4) { + if (nPar_ == 4) + cout << "adjusted x = " << new_xa[0] << ", " << new_xa[1] << ", " << new_xa[2] << ", " << new_xa[3] << endl; + else if (nPar_ == 5) + cout << "adjusted x = " << new_xa[0] << ", " << new_xa[1] << ", " << new_xa[2] << ", " << new_xa[3] << ", " + << new_xa[4] << endl; + cout << "adjusted covx " << endl; + new_pxxa.Print(); + } - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "previous state covariance" << endl; - cov_xa.Print(); - } - // Get contribution to helix parameter covariance from scattering (NOT USED). - TMatrixD pxxm = PxxModel( &state, stubCluster ); - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "model xcov" << endl; - pxxm.Print(); - } - // Get covariance on helix parameters. - TMatrixD pxcov = f * cov_xa * ft + pxxm; - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "forcast xcov + model xcov" << endl; - pxcov.Print(); - } - // Get hit position covariance matrix. - TMatrixD dcov = PddMeas( stubCluster, &state ); - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "dcov" << endl; - dcov.Print(); - } - // Calculate Kalman Gain matrix. - TMatrixD k = GetKalmanMatrix( h, pxcov, dcov ); - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "k" << endl; - k.Print(); - } - - std::vector new_xa(nPar_); - TMatrixD new_pxxa; - GetAdjustedState( k, pxcov, fx, stubCluster, delta, new_xa, new_pxxa ); - if( getSettings()->kalmanDebugLevel() >= 4 ){ - if( nPar_ == 4 ) - cout << "adjusted x = " << new_xa[0] << ", " << new_xa[1] << ", " << new_xa[2] << ", " << new_xa[3] << endl; - else if( nPar_ == 5 ) - cout << "adjusted x = " << new_xa[0] << ", " << new_xa[1] << ", " << new_xa[2] << ", " << new_xa[3] << ", " << new_xa[4] << endl; - cout << "adjusted covx " << endl; - new_pxxa.Print(); - } + const KalmanState *new_state = mkState( + state.candidate(), skipped, layer, stubCluster->layerId(), &state, new_xa, new_pxxa, k, dcov, stubCluster, 0, 0); + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "new state" << endl; + new_state->dump(cout, tpa); + } - const KalmanState *new_state = mkState( state.candidate(), skipped, layer, stubCluster->layerId(), &state, new_xa, new_pxxa, k, dcov, stubCluster, 0, 0 ); - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "new state" << endl; - new_state->dump( cout, tpa ); + return new_state; } + void L1KalmanComb::calcChi2(const KalmanState &state, double &chi2rphi, double &chi2rz) const { + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "calcChi2 " << endl; + } + double deltaChi2rphi(0), deltaChi2rz; - return new_state; -} - - -void L1KalmanComb::calcChi2( const KalmanState &state, double& chi2rphi, double& chi2rz )const{ + if (state.last_state()) { + const StubCluster *stubCluster = state.stubCluster(); - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "calcChi2 " << endl; - } - double deltaChi2rphi(0), deltaChi2rz; - - if( state.last_state() ) { - - const StubCluster *stubCluster = state.stubCluster(); - #ifdef RECALC_DEBUG - unsigned int ID = (stubCluster != nullptr) ? stubCluster->stubs()[0]->index() : 99999; + unsigned int ID = (stubCluster != nullptr) ? stubCluster->stubs()[0]->index() : 99999; #endif - if( stubCluster ){ - - std::vector delta = residual( stubCluster, state.last_state()->xa(), state.last_state()->candidate().qOverPt() ); - TMatrixD dcov = PddMeas( stubCluster, &state ); + if (stubCluster) { + std::vector delta = + residual(stubCluster, state.last_state()->xa(), state.last_state()->candidate().qOverPt()); + TMatrixD dcov = PddMeas(stubCluster, &state); #ifdef RECALC_DEBUG - cout<<" FITTER SIGMA: rphi="<<1000*sqrt(dcov(0,0))<<" rz="<pxxa().Print(); - } - TMatrixD h = H(stubCluster); - TMatrixD hxxh = HxxH( h, state.last_state()->pxxa() ); - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "h" << endl; - h.Print(); - cout << "hxcovh" << endl; - hxxh.Print(); - } - TMatrixD covR = dcov + hxxh; - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "covR" << endl; - covR.Print(); - cout << "---" << endl; - cout << scientific << "delta = " << delta[0] << ", " << delta[1] << endl; + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "dcov" << endl; + dcov.Print(); + cout << "xcov" << endl; + state.last_state()->pxxa().Print(); + } + TMatrixD h = H(stubCluster); + TMatrixD hxxh = HxxH(h, state.last_state()->pxxa()); + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "h" << endl; + h.Print(); + cout << "hxcovh" << endl; + hxxh.Print(); + } + TMatrixD covR = dcov + hxxh; + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "covR" << endl; + covR.Print(); + cout << "---" << endl; + cout << scientific << "delta = " << delta[0] << ", " << delta[1] << endl; + } + this->getDeltaChi2(covR, delta, false, deltaChi2rphi, deltaChi2rz); } - this->getDeltaChi2( covR, delta, false, deltaChi2rphi, deltaChi2rz ); - - } - chi2rphi = state.last_state()->chi2rphi() + deltaChi2rphi; - chi2rz = state.last_state()->chi2rz() + deltaChi2rz; + chi2rphi = state.last_state()->chi2rphi() + deltaChi2rphi; + chi2rz = state.last_state()->chi2rz() + deltaChi2rz; #ifdef RECALC_DEBUG - cout<<" FITTER CHI2 UPDATE = "<<(chi2rphi+chi2rz)<<" delta chi2="<<(deltaChi2rphi+deltaChi2rz)<<" ID="< &delta, + bool debug, + double &deltaChi2rphi, + double &deltaChi2rz) const { + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "dcov" << endl; + dcov.Print(); + } + if (dcov.Determinant() == 0) { + deltaChi2rphi = 999; + deltaChi2rz = 999; + return; + }; - TMatrixD dcovi( dcov ); - dcovi.Invert(); + TMatrixD dcovi(dcov); + dcovi.Invert(); - // Change in chi2 (with r-phi/r-z correlation term included in r-phi component) - deltaChi2rphi = delta.at(0) * delta.at(0) * dcovi(0,0) + 2 * delta.at(0) * delta.at(1) * dcovi(0,1); - deltaChi2rz = delta.at(1) * delta.at(1) * dcovi(1,1); + // Change in chi2 (with r-phi/r-z correlation term included in r-phi component) + deltaChi2rphi = delta.at(0) * delta.at(0) * dcovi(0, 0) + 2 * delta.at(0) * delta.at(1) * dcovi(0, 1); + deltaChi2rz = delta.at(1) * delta.at(1) * dcovi(1, 1); #ifdef RECALC_DEBUG - cout<<" FITTER DELTA CHI2: rphi="< L1KalmanComb::getTrackParams( const L1KalmanComb *p, const KalmanState *state ) -{ - return p->getTrackParams( state ); -} - -std::vector L1KalmanComb::Hx( const TMatrixD &pH, const std::vector &x )const -{ - std::vector m( (unsigned) pH.GetNrows(), 0 ); - if( pH.GetNcols() != (int) x.size() ) { cerr << "Hx() : H and x have different dimensions" << endl; } - else{ + std::map L1KalmanComb::getTrackParams(const L1KalmanComb *p, const KalmanState *state) { + return p->getTrackParams(state); + } - for( int i=0; i < pH.GetNcols(); i++ ){ - for( int j=0; j < pH.GetNrows(); j++ ){ - m.at(j) += pH(j,i) * x.at(i); + std::vector L1KalmanComb::Hx(const TMatrixD &pH, const std::vector &x) const { + std::vector m((unsigned)pH.GetNrows(), 0); + if (pH.GetNcols() != (int)x.size()) { + cerr << "Hx() : H and x have different dimensions" << endl; + } else { + for (int i = 0; i < pH.GetNcols(); i++) { + for (int j = 0; j < pH.GetNrows(); j++) { + m.at(j) += pH(j, i) * x.at(i); + } } } + return m; } - return m; -} - - -std::vector L1KalmanComb::Fx( const TMatrixD &pF, const std::vector &x )const -{ - return Hx( pF, x ); -} + std::vector L1KalmanComb::Fx(const TMatrixD &pF, const std::vector &x) const { return Hx(pF, x); } -TMatrixD L1KalmanComb::HxxH( const TMatrixD &pH, const TMatrixD &xx )const -{ - int nd = (unsigned) pH.GetNrows(); - TMatrixD tmp(nd,nPar_); - TMatrixD mHxxH(nd,nd); - if( pH.GetNcols() != xx.GetNcols() || pH.GetNcols() != xx.GetNrows() ) { cerr << "HxxH() : H and xx have different dimensions" << endl; } - else{ - - for( int i=0; i < pH.GetNrows(); i++ ){ - for( int j=0; j < xx.GetNrows(); j++ ){ - for( int k=0; k < xx.GetNcols(); k++ ){ - tmp(i,k) += pH(i,j) * xx(j,k); - } + TMatrixD L1KalmanComb::HxxH(const TMatrixD &pH, const TMatrixD &xx) const { + int nd = (unsigned)pH.GetNrows(); + TMatrixD tmp(nd, nPar_); + TMatrixD mHxxH(nd, nd); + if (pH.GetNcols() != xx.GetNcols() || pH.GetNcols() != xx.GetNrows()) { + cerr << "HxxH() : H and xx have different dimensions" << endl; + } else { + for (int i = 0; i < pH.GetNrows(); i++) { + for (int j = 0; j < xx.GetNrows(); j++) { + for (int k = 0; k < xx.GetNcols(); k++) { + tmp(i, k) += pH(i, j) * xx(j, k); + } + } } - } - for( int i=0; i < tmp.GetNrows(); i++ ){ - for( int j=0; j < pH.GetNcols(); j++ ){ - for( int k=0; k < pH.GetNrows(); k++ ){ - mHxxH(i,k) += tmp(i,j) * pH(k,j); - } + for (int i = 0; i < tmp.GetNrows(); i++) { + for (int j = 0; j < pH.GetNcols(); j++) { + for (int k = 0; k < pH.GetNrows(); k++) { + mHxxH(i, k) += tmp(i, j) * pH(k, j); + } + } } } + return mHxxH; } - return mHxxH; - -} - -TMatrixD L1KalmanComb::GetKalmanMatrix( const TMatrixD &h, const TMatrixD &pxcov, const TMatrixD &dcov )const -{ - - TMatrixD pxcovht(pxcov.GetNrows(),2); - for( int i=0; ikalmanDebugLevel() >= 4 ){ - cout << "pxcovht" << endl; - pxcovht.Print(); - } + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "pxcovht" << endl; + pxcovht.Print(); + } - TMatrixD tmp(dcov.GetNrows(), dcov.GetNcols() ); - TMatrixD hxxh = HxxH( h, pxcov ); - tmp = dcov + hxxh; + TMatrixD tmp(dcov.GetNrows(), dcov.GetNcols()); + TMatrixD hxxh = HxxH(h, pxcov); + tmp = dcov + hxxh; - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "hxxh" << endl; - hxxh.Print(); - cout << "dcov + hxxh " << endl; - tmp.Print(); - } + if (getSettings()->kalmanDebugLevel() >= 4) { + cout << "hxxh" << endl; + hxxh.Print(); + cout << "dcov + hxxh " << endl; + tmp.Print(); + } - TMatrixD K( pxcovht.GetNrows(), tmp.GetNcols() ); + TMatrixD K(pxcovht.GetNrows(), tmp.GetNcols()); - if(tmp.Determinant() == 0 ) return K; - tmp.Invert(); + if (tmp.Determinant() == 0) + return K; + tmp.Invert(); - for( int i=0; i &x, const StubCluster *stubCluster, - const std::vector& delta, - std::vector &new_x, TMatrixD &new_xcov )const -{ - TMatrixD h = H(stubCluster); - for( int i=0; i < K.GetNrows(); i++ ){ - new_x.at(i) = x.at(i); - for( int j=0; j < K.GetNcols(); j++ ){ - new_x.at(i) += K(i,j) * delta.at(j); + void L1KalmanComb::GetAdjustedState(const TMatrixD &K, + const TMatrixD &pxcov, + const std::vector &x, + const StubCluster *stubCluster, + const std::vector &delta, + std::vector &new_x, + TMatrixD &new_xcov) const { + TMatrixD h = H(stubCluster); + + for (int i = 0; i < K.GetNrows(); i++) { + new_x.at(i) = x.at(i); + for (int j = 0; j < K.GetNcols(); j++) { + new_x.at(i) += K(i, j) * delta.at(j); + } } - } - TMatrixD tmp(K.GetNrows(), h.GetNcols() ); - for( int i=0; i< K.GetNrows(); i++ ){ - tmp(i,i) = 1; - } - for( int i=0; i< K.GetNrows(); i++ ){ - for( int j=0; j< K.GetNcols(); j++ ){ - for( int k=0; k< h.GetNcols(); k++ ){ - tmp(i,k) += -1 * K(i,j) * h(j,k); + TMatrixD tmp(K.GetNrows(), h.GetNcols()); + for (int i = 0; i < K.GetNrows(); i++) { + tmp(i, i) = 1; + } + for (int i = 0; i < K.GetNrows(); i++) { + for (int j = 0; j < K.GetNcols(); j++) { + for (int k = 0; k < h.GetNcols(); k++) { + tmp(i, k) += -1 * K(i, j) * h(j, k); + } } } - } - new_xcov.Clear(); - new_xcov.ResizeTo(pxcov.GetNrows(), pxcov.GetNcols()); - for( int i=0; i< tmp.GetNrows(); i++ ){ - for( int j=0; j< tmp.GetNcols(); j++ ){ - for( int k=0; k< pxcov.GetNcols(); k++ ){ - new_xcov(i,k) += tmp(i,j) * pxcov(j,k); + new_xcov.Clear(); + new_xcov.ResizeTo(pxcov.GetNrows(), pxcov.GetNcols()); + for (int i = 0; i < tmp.GetNrows(); i++) { + for (int j = 0; j < tmp.GetNcols(); j++) { + for (int k = 0; k < pxcov.GetNcols(); k++) { + new_xcov(i, k) += tmp(i, j) * pxcov(j, k); + } } } } -} + void L1KalmanComb::resetStates() { + for (unsigned int i = 0; i < state_list_.size(); i++) { + delete state_list_.at(i); + } + state_list_.clear(); + } -void L1KalmanComb::resetStates() -{ - for( unsigned int i=0; i < state_list_.size(); i++ ){ + const KalmanState *L1KalmanComb::mkState(const L1track3D &candidate, + unsigned skipped, + unsigned layer, + unsigned layerId, + const KalmanState *last_state, + const std::vector &x, + const TMatrixD &pxx, + const TMatrixD &K, + const TMatrixD &dcov, + const StubCluster *stubCluster, + double chi2rphi, + double chi2rz) { + KalmanState *new_state = new KalmanState(candidate, + skipped, + layer, + layerId, + last_state, + x, + pxx, + K, + dcov, + stubCluster, + chi2rphi, + chi2rz, + this, + &getTrackParams); + + if (chi2rphi + chi2rz == 0) { + double new_state_chi2rphi = 0., new_state_chi2rz = 0.; + this->calcChi2(*new_state, new_state_chi2rphi, new_state_chi2rz); + new_state->setChi2(new_state_chi2rphi, new_state_chi2rz); + } - delete state_list_.at(i); + state_list_.push_back(new_state); + return new_state; } - state_list_.clear(); -} - -const KalmanState *L1KalmanComb::mkState( const L1track3D &candidate, unsigned skipped, unsigned layer, unsigned layerId, const KalmanState *last_state, - const std::vector &x, const TMatrixD &pxx, const TMatrixD &K, const TMatrixD &dcov, const StubCluster* stubCluster, double chi2rphi, double chi2rz ) -{ + std::vector L1KalmanComb::residual(const StubCluster *stubCluster, + const std::vector &x, + double candQoverPt) const { + std::vector vd = d(stubCluster); // Get (phi relative to sector, z) of hit. + std::vector hx = + Hx(H(stubCluster), x); // Ditto for intercept of helix with layer, in linear approximation. + std::vector delta(2); + for (unsigned i = 0; i < 2; i++) + delta.at(i) = vd.at(i) - hx.at(i); - KalmanState *new_state = new KalmanState( candidate, skipped, layer, layerId, last_state, x, pxx, K, dcov, stubCluster, chi2rphi, chi2rz, this, &getTrackParams ); + // Calculate higher order corrections to residuals. - if( chi2rphi + chi2rz == 0 ){ - double new_state_chi2rphi = 0., new_state_chi2rz = 0.; - this->calcChi2( *new_state, new_state_chi2rphi, new_state_chi2rz ); - new_state->setChi2( new_state_chi2rphi, new_state_chi2rz ); - } + if (not getSettings()->kalmanHOdodgy()) { + std::vector correction = {0., 0.}; - state_list_.push_back( new_state ); - return new_state; -} + float inv2R = (getSettings()->invPtToInvR()) * 0.5 * candQoverPt; // alternatively use x().at(0) + float tanL = x.at(2); + float z0 = x.at(3); + float deltaS = 0.; + if (getSettings()->kalmanHOhelixExp()) { + // Higher order correction correction to circle expansion for improved accuracy at low Pt. + double corr = stubCluster->r() * inv2R; -std::vector L1KalmanComb::residual(const StubCluster* stubCluster, const std::vector &x, double candQoverPt )const{ + // N.B. In endcap 2S, this correction to correction[0] is exactly cancelled by the deltaS-dependent correction to it below. + correction[0] += (1. / 6.) * pow(corr, 3); - std::vector vd = d(stubCluster); // Get (phi relative to sector, z) of hit. - std::vector hx = Hx( H(stubCluster), x ); // Ditto for intercept of helix with layer, in linear approximation. - std::vector delta(2); - for( unsigned i=0; i<2; i++ ) delta.at(i) = vd.at(i) - hx.at(i); + deltaS = (1. / 6.) * (stubCluster->r()) * pow(corr, 2); + correction[1] -= deltaS * tanL; + } - // Calculate higher order corrections to residuals. + if ((not stubCluster->barrel()) && not(stubCluster->psModule())) { + // These corrections rely on inside --> outside tracking, so r-z track params in 2S modules known. + float rShift = (stubCluster->z() - z0) / tanL - stubCluster->r(); - if (not getSettings()->kalmanHOdodgy()) { + // The above calc of rShift is approximate, so optionally check it with MC truth. + // if (tpa_ != nullptr) rShift = (stubCluster->z() - tpa_->z0())/tpa_->tanLambda() - stubCluster->r(); - std::vector correction = {0.,0.}; + if (getSettings()->kalmanHOhelixExp()) + rShift -= deltaS; - float inv2R = (getSettings()->invPtToInvR()) * 0.5 * candQoverPt; // alternatively use x().at(0) - float tanL = x.at(2); - float z0 = x.at(3); + if (getSettings()->kalmanHOprojZcorr() == 1) { + // Add correlation term related to conversion of stub residuals from (r,phi) to (z,phi). + correction[0] += inv2R * rShift; + } - float deltaS = 0.; - if (getSettings()->kalmanHOhelixExp()) { - // Higher order correction correction to circle expansion for improved accuracy at low Pt. - double corr = stubCluster->r() * inv2R; + if (getSettings()->kalmanHOalpha() == 1) { + // Add alpha correction for non-radial 2S endcap strips.. + correction[0] += stubCluster->alpha() * rShift; + } - // N.B. In endcap 2S, this correction to correction[0] is exactly cancelled by the deltaS-dependent correction to it below. - correction[0] += (1./6.)*pow(corr, 3); + //cout<<"ENDCAP 2S STUB: (r,z)=("<r()<<","<z()<<") r*delta="<r() * correction[0]<<" r*alphaCorr="<r() * stubCluster->alpha() * rShift<<" rShift="<r())*pow(corr, 2); - correction[1] -= deltaS * tanL; + // Apply correction to residuals. + delta[0] += correction[0]; + delta[1] += correction[1]; } - if ( (not stubCluster->barrel()) && not (stubCluster->psModule())) { - // These corrections rely on inside --> outside tracking, so r-z track params in 2S modules known. - float rShift = (stubCluster->z() - z0)/tanL - stubCluster->r(); + delta.at(0) = reco::deltaPhi(delta.at(0), 0.); - // The above calc of rShift is approximate, so optionally check it with MC truth. - // if (tpa_ != nullptr) rShift = (stubCluster->z() - tpa_->z0())/tpa_->tanLambda() - stubCluster->r(); + return delta; + } - if (getSettings()->kalmanHOhelixExp()) rShift -= deltaS; + void L1KalmanComb::bookHists() { + if (getSettings()->kalmanFillInternalHists()) { + edm::Service fs_; + string dirName; + if (fitterName_.compare("") == 0) + dirName = "L1KalmanCombInternal"; + else + dirName = fitterName_ + "Internal"; + + TFileDirectory inputDir = fs_->mkdir(dirName.c_str()); + + TString hname; + hTrackEta_ = inputDir.make("hTrackEta", "Track #eta; #eta", 50, -2.5, 2.5); + hUniqueTrackEta_ = inputDir.make("hUniqueTrackEta", "Unique Track #eta; #eta", 50, -2.5, 2.5); + hndupStub_ = inputDir.make("hndupStub", "# of duplicated stubs", 1, 0, 1); + hnmergeStub_ = inputDir.make("hnmergeStub", "# of merged stubs", 1, 0, 1); + + for (unsigned j_layer = 0; j_layer < 6; j_layer++) { + hname = Form("hBarrelStubMaxDistanceLayer%02d", LayerId[j_layer]); + hBarrelStubMaxDistanceMap[hname] = + inputDir.make(hname, + Form("max distance of stubs in barrel Layer %02d; dr#phi; dz", LayerId[j_layer]), + 100, + 0, + 1., + 100, + 0, + 10); + } - if (getSettings()->kalmanHOprojZcorr() == 1) { - // Add correlation term related to conversion of stub residuals from (r,phi) to (z,phi). - correction[0] += inv2R * rShift; + for (unsigned j_ecring = 1; j_ecring < 16; j_ecring++) { + hname = Form("hEndcapStubMaxDistanceRing%02d", j_ecring); + hEndcapStubMaxDistanceMap[hname] = inputDir.make( + hname, Form("max distance of stubs in endcap Ring %02d; dr#phi; dr", j_ecring), 100, 0, 1., 100, 0, 10); + hname = Form("hphiErrorRatioRing%d", j_ecring); + hphiErrorRatioMap[hname] = + inputDir.make(hname, + Form("; fabs( strip id - 0.5 x nStrips + 0.5 ); #delta #phi_{r} / #delta #phi_{l}"), + 508, + 0.0, + 508.0, + 50, + -0.5, + 49.5); } - if (getSettings()->kalmanHOalpha() == 1) { - // Add alpha correction for non-radial 2S endcap strips.. - correction[0] += stubCluster->alpha() * rShift; + float nbins(2002); + for (unsigned i = 0; i < nPar_; i++) { + hname = Form("hyt_%d", i); + hytMap[hname] = + inputDir.make(hname, Form("; true track parameter values %d", i), nbins, hymin[i], hymax[i]); + hname = Form("hy0_%d", i); + hy0Map[hname] = + inputDir.make(hname, Form("; after HT track parameter values %d", i), nbins, hymin[i], hymax[i]); + hname = Form("hyf_%d", i); + hyfMap[hname] = + inputDir.make(hname, Form("; after KF track parameter values %d", i), nbins, hymin[i], hymax[i]); + hname = Form("hx_%d", i); + hxMap[hname] = inputDir.make(hname, Form("; x values %d", i), nbins, hxmin[i], hxmax[i]); } - //cout<<"ENDCAP 2S STUB: (r,z)=("<r()<<","<z()<<") r*delta="<r() * correction[0]<<" r*alphaCorr="<r() * stubCluster->alpha() * rShift<<" rShift="<(hname, Form("; #state+stub combinations, iteration %d ", itr), 100, 0., 100.); + + for (unsigned i = 0; i < nPar_; i++) { + for (unsigned j = 0; j <= i; j++) { + hname = Form("hxcov_itr%d_%d_%d", itr, i, j); + hxcovMap[hname] = + inputDir.make(hname, + Form("; state covariance adjusted values, iteration %d (%d,%d)", itr, i, j), + nbins, + -1 * hdxmin[i] * hdxmin[j], + hdxmax[i] * hdxmax[j]); + } + } + for (unsigned i = 0; i < nPar_; i++) { + for (unsigned j = 0; j < nMeas_; j++) { + hname = Form("hk_itr%d_%d_%d", itr, i, j); + hkMap[hname] = inputDir.make(hname, Form("; K(%d,%d), Iteration %d", i, j, itr), 200, -1., 1.); + } + } + for (unsigned i = 0; i < nMeas_; i++) { + hname = Form("hres_itr%d_%d", itr, i); + hresMap[hname] = inputDir.make( + hname, Form("; residual values, iteration %d (%d)", itr, i), nbins, hresmin[i], hresmax[i]); + for (unsigned j = 0; j <= i; j++) { + hname = Form("hmcov_itr%d_%d_%d", itr, i, j); + hmcovMap[hname] = + inputDir.make(hname, + Form("; measurement covariance values, iteration %d (%d,%d)", itr, i, j), + nbins, + -1 * hddMeasmin[i] * hddMeasmin[i], + hddMeasmax[i] * hddMeasmax[j]); + } + } + } } - - // Apply correction to residuals. - delta[0] += correction[0]; - delta[1] += correction[1]; } - delta.at(0) = reco::deltaPhi(delta.at(0), 0.); - - return delta; -} - - -void L1KalmanComb::bookHists(){ - - if ( getSettings()->kalmanFillInternalHists() ) { - - edm::Service fs_; - string dirName; - if( fitterName_.compare("") == 0 ) dirName = "L1KalmanCombInternal"; - else dirName = fitterName_ + "Internal"; - - TFileDirectory inputDir = fs_->mkdir(dirName.c_str()); - - - TString hname; - hTrackEta_ = inputDir.make( "hTrackEta", "Track #eta; #eta", 50, -2.5, 2.5 ); - hUniqueTrackEta_ = inputDir.make( "hUniqueTrackEta", "Unique Track #eta; #eta", 50, -2.5, 2.5 ); - hndupStub_ = inputDir.make( "hndupStub", "# of duplicated stubs", 1, 0, 1 ); - hnmergeStub_ = inputDir.make( "hnmergeStub", "# of merged stubs", 1, 0, 1 ); - - - for( unsigned j_layer=0; j_layer < 6; j_layer++ ){ - hname = Form( "hBarrelStubMaxDistanceLayer%02d", LayerId[j_layer] ); - hBarrelStubMaxDistanceMap[hname] = inputDir.make( hname, Form( "max distance of stubs in barrel Layer %02d; dr#phi; dz", LayerId[j_layer] ), - 100, 0, 1., 100, 0, 10 ); - } - - for( unsigned j_ecring=1; j_ecring < 16; j_ecring++ ){ - hname = Form( "hEndcapStubMaxDistanceRing%02d", j_ecring ); - hEndcapStubMaxDistanceMap[hname] = inputDir.make( hname, Form( "max distance of stubs in endcap Ring %02d; dr#phi; dr", j_ecring ), - 100, 0, 1., 100, 0, 10 ); - hname = Form( "hphiErrorRatioRing%d", j_ecring ); - hphiErrorRatioMap[hname] = inputDir.make( hname, Form( "; fabs( strip id - 0.5 x nStrips + 0.5 ); #delta #phi_{r} / #delta #phi_{l}" ), 508, 0.0, 508.0 , 50, -0.5, 49.5 ); - } - - - - float nbins(2002); - for( unsigned i=0; i < nPar_; i++ ){ - hname = Form( "hyt_%d", i ); - hytMap[hname] = inputDir.make( hname, Form( "; true track parameter values %d", i ), nbins, hymin[i], hymax[i] ); - hname = Form( "hy0_%d", i ); - hy0Map[hname] = inputDir.make( hname, Form( "; after HT track parameter values %d", i ), nbins, hymin[i], hymax[i] ); - hname = Form( "hyf_%d", i ); - hyfMap[hname] = inputDir.make( hname, Form( "; after KF track parameter values %d", i ), nbins, hymin[i], hymax[i] ); - hname = Form( "hx_%d", i ); - hxMap[hname] = inputDir.make( hname, Form( "; x values %d", i ), nbins, hxmin[i], hxmax[i] ); - } - - - for( unsigned itr=0; itr<=5; itr++ ){ - - hname = Form( "hstubComb_itr%d", itr ); - hstubCombMap[hname] = inputDir.make( hname, Form( "; #state+stub combinations, iteration %d ", itr ), 100, 0., 100.); - - for( unsigned i=0; i < nPar_; i++ ){ - for( unsigned j=0; j <= i; j++ ){ - - hname = Form( "hxcov_itr%d_%d_%d", itr, i, j ); - hxcovMap[hname] = inputDir.make( hname, Form( "; state covariance adjusted values, iteration %d (%d,%d)", itr, i, j ), - nbins, -1 * hdxmin[i]*hdxmin[j], hdxmax[i]*hdxmax[j] ); - } - } - for( unsigned i=0; i < nPar_; i++ ){ - for( unsigned j=0; j < nMeas_; j++ ){ - hname = Form( "hk_itr%d_%d_%d", itr, i, j ); - hkMap[hname] = inputDir.make( hname, Form( "; K(%d,%d), Iteration %d", i, j, itr ), 200, -1., 1. ); - } - } - for( unsigned i=0; i < nMeas_; i++ ){ - hname = Form( "hres_itr%d_%d", itr, i ); - hresMap[hname] = inputDir.make( hname, Form( "; residual values, iteration %d (%d)", itr, i ), - nbins, hresmin[i], hresmax[i] ); - for( unsigned j=0; j <= i; j++ ){ - hname = Form( "hmcov_itr%d_%d_%d", itr, i, j ); - hmcovMap[hname] = inputDir.make( hname, Form( "; measurement covariance values, iteration %d (%d,%d)", itr, i, j ), - nbins, -1 * hddMeasmin[i]*hddMeasmin[i], hddMeasmax[i]*hddMeasmax[j] ); - } - } - } - } -} - - -void L1KalmanComb::fillCandHists( const KalmanState &state, const TP *tpa ) -{ - if( tpa && tpa->useForAlgEff() ){ - - const KalmanState *the_state = &state; - while( the_state ){ - if( the_state->stubCluster() ){ - std::vector x = the_state->xa(); - for( unsigned i=0; i < nPar_; i++ ){ - TString hname = Form( "hx_%d", i ); - if( hxMap.find(hname) == hxMap.end() ){ - cout << hname << " does not exist." << endl; - } - else hxMap[hname]->Fill(x.at(i)); - } + void L1KalmanComb::fillCandHists(const KalmanState &state, const TP *tpa) { + if (tpa && tpa->useForAlgEff()) { + const KalmanState *the_state = &state; + while (the_state) { + if (the_state->stubCluster()) { + std::vector x = the_state->xa(); + for (unsigned i = 0; i < nPar_; i++) { + TString hname = Form("hx_%d", i); + if (hxMap.find(hname) == hxMap.end()) { + cout << hname << " does not exist." << endl; + } else + hxMap[hname]->Fill(x.at(i)); + } + } + the_state = the_state->last_state(); } - the_state = the_state->last_state(); - } - - std::map mx = getTrackParams( &state ); - std::vector vx(nPar_); - vx[0] = mx["qOverPt"]; - vx[1] = mx["phi0"]; - vx[2] = mx["z0"]; - vx[3] = mx["t"]; - if( nPar_ == 5 ) vx[4] = mx["d0"]; - for( unsigned i=0; i < nPar_; i++ ){ - TString hname = Form( "hyf_%d", i ); - if( hyfMap.find(hname) == hyfMap.end() ){ - cout << hname << " does not exist." << endl; + std::map mx = getTrackParams(&state); + std::vector vx(nPar_); + vx[0] = mx["qOverPt"]; + vx[1] = mx["phi0"]; + vx[2] = mx["z0"]; + vx[3] = mx["t"]; + if (nPar_ == 5) + vx[4] = mx["d0"]; + for (unsigned i = 0; i < nPar_; i++) { + TString hname = Form("hyf_%d", i); + if (hyfMap.find(hname) == hyfMap.end()) { + cout << hname << " does not exist." << endl; + } else + hyfMap[hname]->Fill(vx[i]); } - else hyfMap[hname]->Fill(vx[i]); } } -} - -void L1KalmanComb::fillSeedHists( const KalmanState *state, const TP *tpa ){ - - std::vector x0 = state->xa(); - TMatrixD pxx0 = state->pxxa(); - //Histogram Fill : seed pxxa - for( unsigned i=0; i < nPar_; i++ ){ - for( unsigned j=0; j <= i; j++ ){ - TString hname = Form( "hxcov_itr%d_%d_%d", 0, i, j ); - if( hxcovMap.find( hname ) == hxcovMap.end() ){ - cout << hname << " does not exist." << endl; + void L1KalmanComb::fillSeedHists(const KalmanState *state, const TP *tpa) { + std::vector x0 = state->xa(); + TMatrixD pxx0 = state->pxxa(); + //Histogram Fill : seed pxxa + for (unsigned i = 0; i < nPar_; i++) { + for (unsigned j = 0; j <= i; j++) { + TString hname = Form("hxcov_itr%d_%d_%d", 0, i, j); + if (hxcovMap.find(hname) == hxcovMap.end()) { + cout << hname << " does not exist." << endl; + } else + hxcovMap[hname]->Fill(pxx0(i, j)); } - else hxcovMap[hname]->Fill( pxx0(i,j) ); } - } - if( tpa && tpa->useForAlgEff() ){ - std::vector tpParams(nPar_); - tpParams[0] = tpa->qOverPt(); - tpParams[1] = tpa->phi0(); - tpParams[2] = tpa->z0(); - tpParams[3] = tpa->tanLambda(); - if( nPar_ == 5 ) tpParams[4] = tpa->d0(); - for( unsigned i=0; i < nPar_; i++ ){ - TString hname = Form( "hyt_%d", i ); - if( hytMap.find(hname) == hytMap.end() ){ - cout << hname << " does not exist." << endl; + if (tpa && tpa->useForAlgEff()) { + std::vector tpParams(nPar_); + tpParams[0] = tpa->qOverPt(); + tpParams[1] = tpa->phi0(); + tpParams[2] = tpa->z0(); + tpParams[3] = tpa->tanLambda(); + if (nPar_ == 5) + tpParams[4] = tpa->d0(); + for (unsigned i = 0; i < nPar_; i++) { + TString hname = Form("hyt_%d", i); + if (hytMap.find(hname) == hytMap.end()) { + cout << hname << " does not exist." << endl; + } else + hytMap[hname]->Fill(tpParams[i]); } - else hytMap[hname]->Fill(tpParams[i]); - } - //Histogram Fill : Seed state - std::map trackParams = getTrackParams( state ); - std::vector trackParVec(nPar_); - trackParVec[0] = trackParams["qOverPt"]; - trackParVec[1] = trackParams["phi0"]; - trackParVec[2] = trackParams["z0"]; - trackParVec[3] = trackParams["t"]; - if( nPar_ == 5 ) trackParVec[4] = trackParams["d0"]; - for( unsigned i=0; i < nPar_; i++ ){ - TString hname = Form( "hy0_%d", i ); - if( hy0Map.find(hname) == hy0Map.end() ){ - cout << hname << " does not exist." << endl; + //Histogram Fill : Seed state + std::map trackParams = getTrackParams(state); + std::vector trackParVec(nPar_); + trackParVec[0] = trackParams["qOverPt"]; + trackParVec[1] = trackParams["phi0"]; + trackParVec[2] = trackParams["z0"]; + trackParVec[3] = trackParams["t"]; + if (nPar_ == 5) + trackParVec[4] = trackParams["d0"]; + for (unsigned i = 0; i < nPar_; i++) { + TString hname = Form("hy0_%d", i); + if (hy0Map.find(hname) == hy0Map.end()) { + cout << hname << " does not exist." << endl; + } else + hy0Map[hname]->Fill(trackParVec[i]); } - else hy0Map[hname]->Fill(trackParVec[i]); } } -} + void L1KalmanComb::fillStepHists(const TP *tpa, unsigned nItr, const KalmanState *new_state) { + unsigned path = 0; -void L1KalmanComb::fillStepHists( const TP *tpa, unsigned nItr, const KalmanState *new_state ) -{ - unsigned path = 0; + const std::vector &xa = new_state->xa(); + const StubCluster *stubCluster = new_state->stubCluster(); + const TMatrixD &pxxa = new_state->pxxa(); - const std::vector &xa = new_state->xa(); - const StubCluster *stubCluster = new_state->stubCluster(); - const TMatrixD &pxxa = new_state->pxxa(); - - TString hname; - - for( unsigned i=0; i < nPar_; i++ ){ + TString hname; - for( unsigned j=0; j <= i; j++ ){ - hname = Form( "hxcov_itr%d_%d_%d", nItr, i, j ); - if( hxcovMap.find( hname ) == hxcovMap.end() ){ - cout << hname << " does not exist." << endl; + for (unsigned i = 0; i < nPar_; i++) { + for (unsigned j = 0; j <= i; j++) { + hname = Form("hxcov_itr%d_%d_%d", nItr, i, j); + if (hxcovMap.find(hname) == hxcovMap.end()) { + cout << hname << " does not exist." << endl; + } else + hxcovMap[hname]->Fill(pxxa(i, j)); } - else hxcovMap[hname]->Fill( pxxa(i,j) ); } - } - for( unsigned i=0; i < nPar_; i++ ){ - for( int j=0; j < 2; j++ ){ - TString hname = Form( "hk_itr%d_%d_%d", nItr, i, j ); - if( hkMap.find( hname ) == hkMap.end() ){ - cout << hname << " does not exist." << endl; + for (unsigned i = 0; i < nPar_; i++) { + for (int j = 0; j < 2; j++) { + TString hname = Form("hk_itr%d_%d_%d", nItr, i, j); + if (hkMap.find(hname) == hkMap.end()) { + cout << hname << " does not exist." << endl; + } else + hkMap[hname]->Fill(new_state->K()(i, j)); } - else hkMap[hname]->Fill( new_state->K()(i,j) ); } - } - std::vector delta_new = residual(stubCluster, xa, new_state->candidate().qOverPt() ); - for( unsigned int i=0; i < delta_new.size(); i++ ){ - TString hname = Form( "hres_itr%d_%d", nItr, i ); - if( hresMap.find(hname) == hresMap.end() ){ - cout << hname << " does not exist." << endl; + std::vector delta_new = residual(stubCluster, xa, new_state->candidate().qOverPt()); + for (unsigned int i = 0; i < delta_new.size(); i++) { + TString hname = Form("hres_itr%d_%d", nItr, i); + if (hresMap.find(hname) == hresMap.end()) { + cout << hname << " does not exist." << endl; + } else + hresMap[hname]->Fill(delta_new[i]); } - else hresMap[hname]->Fill( delta_new[i] ); - } - for( int i=0; i < 2; i++ ){ - for( int j=0; j < i; j++ ){ - TString hname = Form( "hmcov_itr%d_%d_%d", nItr, i, j ); - if( hmcovMap.find( hname ) == hmcovMap.end() ){ - cout << hname << " does not exist." << endl; + for (int i = 0; i < 2; i++) { + for (int j = 0; j < i; j++) { + TString hname = Form("hmcov_itr%d_%d_%d", nItr, i, j); + if (hmcovMap.find(hname) == hmcovMap.end()) { + cout << hname << " does not exist." << endl; + } else + hmcovMap[hname]->Fill(new_state->dcov()(i, j)); } - else hmcovMap[hname]->Fill( new_state->dcov()(i,j) ); } } -} - -void L1KalmanComb::deleteStubClusters() -{ - for( unsigned int i=0; i < stbcl_list_.size(); i++ ){ - delete stbcl_list_.at(i); + void L1KalmanComb::deleteStubClusters() { + for (unsigned int i = 0; i < stbcl_list_.size(); i++) { + delete stbcl_list_.at(i); + } + stbcl_list_.clear(); } - stbcl_list_.clear(); -} - -double L1KalmanComb::DeltaRphiForClustering( unsigned layerId, unsigned endcapRing ) -{ - static double barrel_drphi[6] = { 0.05, 0.04, 0.05, 0.12, 0.13, 0.19 }; - if( layerId < 10 ) return barrel_drphi[layerId - 1]; - - static double ec_drphi[16] = - { 0.04, 0.05, 0.04, 0.06, 0.06, 0.04, 0.06, 0.07, 0.15, 0.08, 0.27, 0.08, 0.27, 0.12, 0.09 }; - return ec_drphi[endcapRing - 1]; -}; - - -double L1KalmanComb::DeltaRForClustering( unsigned endcapRing ) -{ - static double ec_dr[16] = - { 0.52, 0.56, 0.59, 0.86, 0.66, 0.47, 0.55, 0.72, 1.53, 1.10, 2.72, 0.91, 2.69, 0.67, 0.09 }; - return ec_dr[endcapRing - 1]; - -} + double L1KalmanComb::DeltaRphiForClustering(unsigned layerId, unsigned endcapRing) { + static double barrel_drphi[6] = {0.05, 0.04, 0.05, 0.12, 0.13, 0.19}; + if (layerId < 10) + return barrel_drphi[layerId - 1]; + static double ec_drphi[16] = { + 0.04, 0.05, 0.04, 0.06, 0.06, 0.04, 0.06, 0.07, 0.15, 0.08, 0.27, 0.08, 0.27, 0.12, 0.09}; + return ec_drphi[endcapRing - 1]; + }; -bool L1KalmanComb::isOverlap( const Stub* a, const Stub*b, OVERLAP_TYPE type ){ + double L1KalmanComb::DeltaRForClustering(unsigned endcapRing) { + static double ec_dr[16] = { + 0.52, 0.56, 0.59, 0.86, 0.66, 0.47, 0.55, 0.72, 1.53, 1.10, 2.72, 0.91, 2.69, 0.67, 0.09}; + return ec_dr[endcapRing - 1]; + } - std::set a_tps = a->assocTPs(); - std::set b_tps = b->assocTPs(); - double drphi = DeltaRphiForClustering( a->layerId(), a->endcapRing() ); - double dr(0); - switch ( type ){ + bool L1KalmanComb::isOverlap(const Stub *a, const Stub *b, OVERLAP_TYPE type) { + std::set a_tps = a->assocTPs(); + std::set b_tps = b->assocTPs(); + double drphi = DeltaRphiForClustering(a->layerId(), a->endcapRing()); + double dr(0); + switch (type) { + case TYPE_NORMAL: + if (a->layerId() != b->layerId()) + return false; + + if (a->layerId() < 7) { + if (fabs(b->z() - a->z()) > 0.5 * b->stripLength() || + fabs(reco::deltaPhi(b->phi(), sectorPhi()) * b->r() - reco::deltaPhi(a->phi(), sectorPhi()) * a->r()) > + 0.5 * b->stripPitch()) + return false; + } else { + if (fabs(b->r() - a->r()) > 0.5 * b->stripLength() || + fabs(reco::deltaPhi(b->phi(), sectorPhi()) * b->r() - reco::deltaPhi(a->phi(), sectorPhi()) * a->r()) > + 0.5 * b->stripPitch()) + return false; + } + return true; + case TYPE_V2: + if (a->layerId() != b->layerId()) + return false; + + if (a->layerId() < 7) { + if (fabs(b->z() - a->z()) > 0.5 * b->stripLength() || + fabs(reco::deltaPhi(b->phi(), sectorPhi()) * b->r() - reco::deltaPhi(a->phi(), sectorPhi()) * a->r()) > + drphi) + return false; + } else { + dr = DeltaRForClustering(a->endcapRing()); + if (fabs(b->r() - a->r()) > dr || fabs(reco::deltaPhi(b->phi(), sectorPhi()) * b->r() - + reco::deltaPhi(a->phi(), sectorPhi()) * a->r()) > drphi) + return false; + } + return true; - case TYPE_NORMAL: - if( a->layerId() != b->layerId() ) return false; + case TYPE_NOCLUSTERING: + return false; - if( a->layerId() < 7 ){ - if( fabs( b->z() - a->z() ) > 0.5 * b->stripLength() || fabs( reco::deltaPhi( b->phi(), sectorPhi() ) * b->r() - reco::deltaPhi( a->phi(), sectorPhi() ) * a->r() ) > 0.5 * b->stripPitch() ) return false; - } - else{ - if( fabs( b->r() - a->r() ) > 0.5 * b->stripLength() || fabs( reco::deltaPhi( b->phi(), sectorPhi() ) * b->r() - reco::deltaPhi( a->phi(), sectorPhi() ) * a->r() ) > 0.5 * b->stripPitch() ) return false; - } - return true; - case TYPE_V2: - if( a->layerId() != b->layerId() ) return false; - - if( a->layerId() < 7 ){ - if( fabs( b->z() - a->z() ) > 0.5 * b->stripLength() || fabs( reco::deltaPhi( b->phi(), sectorPhi() ) * b->r() - reco::deltaPhi( a->phi(), sectorPhi() ) * a->r() ) > drphi ) return false; - } - else{ - dr = DeltaRForClustering( a->endcapRing() ); - if( fabs( b->r() - a->r() ) > dr || fabs( reco::deltaPhi( b->phi(), sectorPhi() ) * b->r() - reco::deltaPhi( a->phi(), sectorPhi() ) * a->r() ) > drphi ) return false; + case TYPE_TP: + for (auto a_tp : a_tps) + if (b_tps.find(a_tp) != b_tps.end()) + return true; + return false; + default: + return false; } - return true; - - case TYPE_NOCLUSTERING: - return false; - - case TYPE_TP: - for( auto a_tp : a_tps ) - if( b_tps.find( a_tp ) != b_tps.end() ) return true; - return false; - default: - return false; } -} -set L1KalmanComb::getKalmanDeadLayers( bool& remove2PSCut ) const { + set L1KalmanComb::getKalmanDeadLayers(bool &remove2PSCut) const { + // Kill scenarios described in https://github.com/EmyrClement/StubKiller/blob/master/README.md - // Kill scenarios described in https://github.com/EmyrClement/StubKiller/blob/master/README.md + // By which Stress Test scenario (if any) are dead modules being emulated? + const unsigned int killScenario = getSettings()->killScenario(); + // Should TMTT tracking be modified to reduce efficiency loss due to dead modules? + const bool killRecover = getSettings()->killRecover(); - // By which Stress Test scenario (if any) are dead modules being emulated? - const unsigned int killScenario = getSettings()->killScenario(); - // Should TMTT tracking be modified to reduce efficiency loss due to dead modules? - const bool killRecover = getSettings()->killRecover(); + set> deadLayers; // GP layer ID & boolean indicating if in barrel. - set> deadLayers; // GP layer ID & boolean indicating if in barrel. - - if (killRecover) { - if ( killScenario == 1 ) { // barrel layer 5 - deadLayers.insert(pair(4,true)); - if ( iCurrentEtaReg_ < 5 || iCurrentEtaReg_ > 8 || iCurrentPhiSec_ < 8 || iCurrentPhiSec_ > 11 ) { - deadLayers.clear(); - } + if (killRecover) { + if (killScenario == 1) { // barrel layer 5 + deadLayers.insert(pair(4, true)); + if (iCurrentEtaReg_ < 5 || iCurrentEtaReg_ > 8 || iCurrentPhiSec_ < 8 || iCurrentPhiSec_ > 11) { + deadLayers.clear(); + } - } - else if ( killScenario == 2 ) { // barrel layer 1 - deadLayers.insert(pair(1,true)); - if ( iCurrentEtaReg_ > 8 || iCurrentPhiSec_ < 8 || iCurrentPhiSec_ > 11 ) { - deadLayers.clear(); - } - remove2PSCut = true; - } - else if ( killScenario == 3 ) { // barrel layers 1 & 2 - deadLayers.insert(pair(1,true)); - deadLayers.insert(pair(2,true)); - if ( iCurrentEtaReg_ > 8 || iCurrentPhiSec_ < 8 || iCurrentPhiSec_ > 11 ) { - deadLayers.clear(); - } - else if ( iCurrentEtaReg_ < 1 ) { - deadLayers.insert(pair(0,true)); // What is this doing? + } else if (killScenario == 2) { // barrel layer 1 + deadLayers.insert(pair(1, true)); + if (iCurrentEtaReg_ > 8 || iCurrentPhiSec_ < 8 || iCurrentPhiSec_ > 11) { + deadLayers.clear(); + } + remove2PSCut = true; + } else if (killScenario == 3) { // barrel layers 1 & 2 + deadLayers.insert(pair(1, true)); + deadLayers.insert(pair(2, true)); + if (iCurrentEtaReg_ > 8 || iCurrentPhiSec_ < 8 || iCurrentPhiSec_ > 11) { + deadLayers.clear(); + } else if (iCurrentEtaReg_ < 1) { + deadLayers.insert(pair(0, true)); // What is this doing? + } + remove2PSCut = true; + } else if (killScenario == 4) { // barrel layer 1 & disk 1 + deadLayers.insert(pair(1, true)); + deadLayers.insert(pair(3, false)); + if (iCurrentEtaReg_ > 8 || iCurrentPhiSec_ < 8 || iCurrentPhiSec_ > 11) { + deadLayers.clear(); + } else if (iCurrentEtaReg_ > 3) { + deadLayers.insert(pair(0, true)); + } + remove2PSCut = true; } - remove2PSCut = true; } - else if ( killScenario == 4 ) { // barrel layer 1 & disk 1 - deadLayers.insert(pair(1,true)); - deadLayers.insert(pair(3,false)); - if ( iCurrentEtaReg_ > 8 || iCurrentPhiSec_ < 8 || iCurrentPhiSec_ > 11 ) { - deadLayers.clear(); - } - else if ( iCurrentEtaReg_ > 3 ) { - deadLayers.insert(pair(0,true)); - } - remove2PSCut = true; + + set kalmanDeadLayers; + for (const auto &p : deadLayers) { + unsigned int layer = p.first; + bool barrel = p.second; + float r = 0.; // This fails for r-dependent parts of getKalmanLayer(). FIX + float z = 999.; + unsigned int kalmanLayer = this->getKalmanLayer(iCurrentEtaReg_, layer, barrel, r, z); + kalmanDeadLayers.insert(kalmanLayer); } - } - set kalmanDeadLayers; - for ( const auto& p : deadLayers ) { - unsigned int layer = p.first; - bool barrel = p.second; - float r = 0.; // This fails for r-dependent parts of getKalmanLayer(). FIX - float z = 999.; - unsigned int kalmanLayer = this->getKalmanLayer(iCurrentEtaReg_, layer, barrel, r, z); - kalmanDeadLayers.insert( kalmanLayer ); + return kalmanDeadLayers; } - return kalmanDeadLayers; -} + //=== Function to calculate approximation for tilted barrel modules (aka B) copied from Stub class. -//=== Function to calculate approximation for tilted barrel modules (aka B) copied from Stub class. - -float L1KalmanComb::getApproxB(float z, float r) const { - return getSettings()->bApprox_gradient() * fabs(z)/r + getSettings()->bApprox_intercept(); -} + float L1KalmanComb::getApproxB(float z, float r) const { + return getSettings()->bApprox_gradient() * fabs(z) / r + getSettings()->bApprox_intercept(); + } -} +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/L1fittedTrack.cc b/L1Trigger/TrackFindingTMTT/src/L1fittedTrack.cc index 5dbccbba490a4..207ae9c5d76aa 100644 --- a/L1Trigger/TrackFindingTMTT/src/L1fittedTrack.cc +++ b/L1Trigger/TrackFindingTMTT/src/L1fittedTrack.cc @@ -2,61 +2,114 @@ namespace TMTT { -// Digitize track and degrade helix parameter resolution according to effect of digitisation. - -void L1fittedTrack::digitizeTrack(const string& fitterName){ - if (settings_->enableDigitize()) { - if (! digitizedTrack_ ) { - digitizedTrack_ = true; - - bool consistent = this->consistentHTcell(); - bool consistentSect = this->consistentSector(); - int mbinhelix = int(this->getCellLocationFit().first) - floor(settings_->houghNbinsPt()/2); - int cbinhelix = int(this->getCellLocationFit().second) - floor(settings_->houghNbinsPhi()/2); - int mBinHT = int(this->getCellLocationHT().first) - floor(settings_->houghNbinsPt()/2); - int cBinHT = int(this->getCellLocationHT().second) - floor(settings_->houghNbinsPhi()/2); - - if(matchedTP_ != nullptr){ - digitalTrack_.init(fitterName, nHelixParam_, - iPhiSec_, iEtaReg_, mBinHT, cBinHT, mbinhelix, cbinhelix, hitPattern_, - qOverPt_, d0_, phi0_,tanLambda_, z0_, chi2rphi_, chi2rz_, - qOverPt_bcon_, phi0_bcon_, chi2rphi_bcon_, - nLayers_, consistent, consistentSect, this->accepted(), - matchedTP_->qOverPt(), matchedTP_->d0(), matchedTP_->phi0(), matchedTP_->tanLambda(), matchedTP_->z0(), matchedTP_->eta(), - matchedTP_->index(), matchedTP_->useForAlgEff(), matchedTP_->useForEff(), matchedTP_->pdgId()); - } else { - digitalTrack_.init(fitterName, nHelixParam_, - iPhiSec_, iEtaReg_, mBinHT, cBinHT, mbinhelix, cbinhelix, hitPattern_, - qOverPt_, d0_, phi0_, tanLambda_, z0_, chi2rphi_, chi2rz_, - qOverPt_bcon_, phi0_bcon_, chi2rphi_bcon_, - nLayers_, consistent, consistentSect, this->accepted(), - 0, 0, 0, 0, 0, 0, - -1, 0, 0, 0); - } + // Digitize track and degrade helix parameter resolution according to effect of digitisation. - // Digitize track - digitalTrack_.makeDigitalTrack(); - - // Convert digitized track params back to floating point with degraded resolution. - qOverPt_ = digitalTrack_.qOverPt(); - if (nHelixParam_ == 5) d0_ = digitalTrack_.d0(); - phi0_ = digitalTrack_.phi0(); - z0_ = digitalTrack_.z0(); - tanLambda_ = digitalTrack_.tanLambda(); - chi2rphi_ = digitalTrack_.chisquaredRphi(); - chi2rz_ = digitalTrack_.chisquaredRz(); - - // Ditto for beam-spot constrained values. - if (nHelixParam_ == 5) { - qOverPt_bcon_ = digitalTrack_.qOverPt_bcon(); - phi0_bcon_ = digitalTrack_.phi0_bcon(); - chi2rphi_bcon_ = digitalTrack_.chisquaredRphi_bcon(); - } + void L1fittedTrack::digitizeTrack(const string& fitterName) { + if (settings_->enableDigitize()) { + if (!digitizedTrack_) { + digitizedTrack_ = true; + + bool consistent = this->consistentHTcell(); + bool consistentSect = this->consistentSector(); + int mbinhelix = int(this->getCellLocationFit().first) - floor(settings_->houghNbinsPt() / 2); + int cbinhelix = int(this->getCellLocationFit().second) - floor(settings_->houghNbinsPhi() / 2); + int mBinHT = int(this->getCellLocationHT().first) - floor(settings_->houghNbinsPt() / 2); + int cBinHT = int(this->getCellLocationHT().second) - floor(settings_->houghNbinsPhi() / 2); + + if (matchedTP_ != nullptr) { + digitalTrack_.init(fitterName, + nHelixParam_, + iPhiSec_, + iEtaReg_, + mBinHT, + cBinHT, + mbinhelix, + cbinhelix, + hitPattern_, + qOverPt_, + d0_, + phi0_, + tanLambda_, + z0_, + chi2rphi_, + chi2rz_, + qOverPt_bcon_, + phi0_bcon_, + chi2rphi_bcon_, + nLayers_, + consistent, + consistentSect, + this->accepted(), + matchedTP_->qOverPt(), + matchedTP_->d0(), + matchedTP_->phi0(), + matchedTP_->tanLambda(), + matchedTP_->z0(), + matchedTP_->eta(), + matchedTP_->index(), + matchedTP_->useForAlgEff(), + matchedTP_->useForEff(), + matchedTP_->pdgId()); + } else { + digitalTrack_.init(fitterName, + nHelixParam_, + iPhiSec_, + iEtaReg_, + mBinHT, + cBinHT, + mbinhelix, + cbinhelix, + hitPattern_, + qOverPt_, + d0_, + phi0_, + tanLambda_, + z0_, + chi2rphi_, + chi2rz_, + qOverPt_bcon_, + phi0_bcon_, + chi2rphi_bcon_, + nLayers_, + consistent, + consistentSect, + this->accepted(), + 0, + 0, + 0, + 0, + 0, + 0, + -1, + 0, + 0, + 0); + } - // Recalculate consistency flag using updated helix params. - this->setConsistentHTcell(); + // Digitize track + digitalTrack_.makeDigitalTrack(); + + // Convert digitized track params back to floating point with degraded resolution. + qOverPt_ = digitalTrack_.qOverPt(); + if (nHelixParam_ == 5) + d0_ = digitalTrack_.d0(); + phi0_ = digitalTrack_.phi0(); + z0_ = digitalTrack_.z0(); + tanLambda_ = digitalTrack_.tanLambda(); + chi2rphi_ = digitalTrack_.chisquaredRphi(); + chi2rz_ = digitalTrack_.chisquaredRz(); + + // Ditto for beam-spot constrained values. + if (nHelixParam_ == 5) { + qOverPt_bcon_ = digitalTrack_.qOverPt_bcon(); + phi0_bcon_ = digitalTrack_.phi0_bcon(); + chi2rphi_bcon_ = digitalTrack_.chisquaredRphi_bcon(); + } + + // Recalculate consistency flag using updated helix params. + this->setConsistentHTcell(); + } } } -} -} +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/Matrix.cc b/L1Trigger/TrackFindingTMTT/src/Matrix.cc index 4613fdba969e5..75f127dc27c0a 100644 --- a/L1Trigger/TrackFindingTMTT/src/Matrix.cc +++ b/L1Trigger/TrackFindingTMTT/src/Matrix.cc @@ -3,369 +3,370 @@ * Derived from: https://www.cs.rochester.edu/~brown/Crypto/assts/projects/adj.html * and https://www.quantstart.com/articles/Matrix-Classes-in-C-The-Source-File * --- */ - + #include "L1Trigger/TrackFindingTMTT/interface/Matrix.h" #include "FWCore/Utilities/interface/Exception.h" #include #include - + namespace TMTT { -// Parameter Constructor -template -Matrix::Matrix(){ + // Parameter Constructor + template + Matrix::Matrix() { mat.resize(0); rows = 0; cols = 0; -} -template -Matrix::Matrix(unsigned _rows, unsigned _cols, const T& _initial) { - mat.resize(_rows); - for (unsigned i=0; i -Matrix::Matrix(const Matrix& rhs) { - mat = rhs.mat; - rows = rhs.get_rows(); - cols = rhs.get_cols(); -} - -// (Virtual) Destructor -template -Matrix::~Matrix() {} - -// Assignment Operator -template -Matrix& Matrix::operator=(const Matrix& rhs) { - if (&rhs == this) + template + Matrix::Matrix(unsigned _rows, unsigned _cols, const T& _initial) { + mat.resize(_rows); + for (unsigned i = 0; i < mat.size(); i++) { + mat[i].resize(_cols, _initial); + } + rows = _rows; + cols = _cols; + } + + // Copy Constructor + template + Matrix::Matrix(const Matrix& rhs) { + mat = rhs.mat; + rows = rhs.get_rows(); + cols = rhs.get_cols(); + } + + // (Virtual) Destructor + template + Matrix::~Matrix() {} + + // Assignment Operator + template + Matrix& Matrix::operator=(const Matrix& rhs) { + if (&rhs == this) + return *this; + + unsigned new_rows = rhs.get_rows(); + unsigned new_cols = rhs.get_cols(); + + mat.resize(new_rows); + for (unsigned i = 0; i < mat.size(); i++) { + mat[i].resize(new_cols); + } + + for (unsigned i = 0; i < new_rows; i++) { + for (unsigned j = 0; j < new_cols; j++) { + mat[i][j] = rhs(i, j); + } + } + rows = new_rows; + cols = new_cols; + return *this; - - unsigned new_rows = rhs.get_rows(); - unsigned new_cols = rhs.get_cols(); - - mat.resize(new_rows); - for (unsigned i=0; i + Matrix Matrix::operator+(const Matrix& rhs) { + Matrix result(rows, cols, 0.0); + + for (unsigned i = 0; i < rows; i++) { + for (unsigned j = 0; j < cols; j++) { + result(i, j) = this->mat[i][j] + rhs(i, j); + } } + + return result; } - rows = new_rows; - cols = new_cols; - - return *this; -} - -// Addition of two matrices -template -Matrix Matrix::operator+(const Matrix& rhs) { - Matrix result(rows, cols, 0.0); - - for (unsigned i=0; imat[i][j] + rhs(i,j); + + // Cumulative addition of this matrix and another + template + Matrix& Matrix::operator+=(const Matrix& rhs) { + unsigned rows = rhs.get_rows(); + unsigned cols = rhs.get_cols(); + + for (unsigned i = 0; i < rows; i++) { + for (unsigned j = 0; j < cols; j++) { + this->mat[i][j] += rhs(i, j); + } } + + return *this; } - - return result; -} - -// Cumulative addition of this matrix and another -template -Matrix& Matrix::operator+=(const Matrix& rhs) { - unsigned rows = rhs.get_rows(); - unsigned cols = rhs.get_cols(); - - for (unsigned i=0; imat[i][j] += rhs(i,j); + + // Subtraction of this matrix and another + template + Matrix Matrix::operator-(const Matrix& rhs) { + unsigned rows = rhs.get_rows(); + unsigned cols = rhs.get_cols(); + Matrix result(rows, cols, 0.0); + + for (unsigned i = 0; i < rows; i++) { + for (unsigned j = 0; j < cols; j++) { + result(i, j) = this->mat[i][j] - rhs(i, j); + } } + + return result; } - - return *this; -} - -// Subtraction of this matrix and another -template -Matrix Matrix::operator-(const Matrix& rhs) { - unsigned rows = rhs.get_rows(); - unsigned cols = rhs.get_cols(); - Matrix result(rows, cols, 0.0); - - for (unsigned i=0; imat[i][j] - rhs(i,j); + + // Cumulative subtraction of this matrix and another + template + Matrix& Matrix::operator-=(const Matrix& rhs) { + unsigned rows = rhs.get_rows(); + unsigned cols = rhs.get_cols(); + + for (unsigned i = 0; i < rows; i++) { + for (unsigned j = 0; j < cols; j++) { + this->mat[i][j] -= rhs(i, j); + } } + + return *this; } - - return result; -} - -// Cumulative subtraction of this matrix and another -template -Matrix& Matrix::operator-=(const Matrix& rhs) { - unsigned rows = rhs.get_rows(); - unsigned cols = rhs.get_cols(); - - for (unsigned i=0; imat[i][j] -= rhs(i,j); + + // Left multiplication of this matrix and another + template + Matrix Matrix::operator*(const Matrix& rhs) { + assert(this->cols == rhs.get_rows()); + unsigned rRows = rhs.get_rows(); + unsigned rCols = rhs.get_cols(); + unsigned lRows = this->rows; + unsigned lCols = this->cols; + Matrix result(lRows, rCols, 0.0); + for (unsigned i = 0; i < lRows; i++) { + for (unsigned j = 0; j < rCols; j++) { + for (unsigned k = 0; k < lCols; k++) { + result(i, j) += this->mat[i][k] * rhs.mat[k][j]; + } + } } + return result; + } + + // Cumulative left multiplication of this matrix and another + template + Matrix& Matrix::operator*=(const Matrix& rhs) { + Matrix result = (*this) * rhs; + (*this) = result; + return *this; } - - return *this; -} - -// Left multiplication of this matrix and another -template -Matrix Matrix::operator*(const Matrix& rhs) { - assert(this->cols == rhs.get_rows()); - unsigned rRows = rhs.get_rows(); - unsigned rCols = rhs.get_cols(); - unsigned lRows = this->rows; - unsigned lCols = this->cols; - Matrix result(lRows, rCols, 0.0); - for(unsigned i=0; i < lRows; i++){ - for(unsigned j = 0; j < rCols; j++){ - for(unsigned k = 0; k < lCols; k++){ - result(i,j) += this->mat[i][k] * rhs.mat[k][j]; + + // Calculate a transpose of this matrix + template + Matrix Matrix::transpose() { + Matrix result(cols, rows, 0.0); + + for (unsigned i = 0; i < cols; i++) { + for (unsigned j = 0; j < rows; j++) { + result(i, j) = this->mat[j][i]; } } + + return result; } - return result; -} - -// Cumulative left multiplication of this matrix and another -template -Matrix& Matrix::operator*=(const Matrix& rhs) { - Matrix result = (*this) * rhs; - (*this) = result; - return *this; -} - -// Calculate a transpose of this matrix -template -Matrix Matrix::transpose() { - Matrix result(cols, rows, 0.0); - - for (unsigned i=0; imat[j][i]; + + // Recursively calculate the determinant + template + T Matrix::determinant() { + T det = 0; + if (rows < 1) { + std::cerr << "Can't have determinant of matrix with " << rows << " rows." << std::endl; + } else if (rows == 1) { + det = this->mat[0][0]; + } else if (rows == 2) { + det = this->mat[0][0] * this->mat[1][1] - this->mat[1][0] * this->mat[0][1]; + } else { + for (unsigned i = 0; i < rows; i++) { + Matrix m(rows - 1, cols - 1, 0); + for (unsigned j = 1; j < rows; j++) { + unsigned k = 0; + for (unsigned l = 0; l < rows; l++) { + if (l == i) + continue; + m(j - 1, k) = this->mat[j][l]; + k++; + } + } + T sign; + if ((i + 2) % 2 == 0) + sign = 1; + else + sign = -1; + det += sign * this->mat[0][i] * m.determinant(); + } } + return (det); } - - return result; -} - -// Recursively calculate the determinant -template -T Matrix::determinant(){ - T det = 0; - if(rows < 1){ - std::cerr << "Can't have determinant of matrix with " << rows << " rows." << std::endl; - } else if (rows == 1){ - det = this->mat[0][0]; - } else if (rows == 2){ - det = this->mat[0][0] * this->mat[1][1] - this->mat[1][0] * this->mat[0][1]; - }else{ - for(unsigned i = 0; i < rows; i++){ - Matrix m(rows-1, cols-1, 0); - for(unsigned j = 1; j < rows; j++){ - unsigned k = 0; - for(unsigned l =0; l < rows; l++){ - if(l == i) + + template + Matrix Matrix::cofactor() { + Matrix result(rows, cols, 0); + Matrix c(rows - 1, cols - 1, 0); + if (rows != cols) { + std::cerr << "Can only compute cofactor of square matrix." << std::endl; + return result; + } + for (unsigned j = 0; j < rows; j++) { + for (unsigned i = 0; i < rows; i++) { + unsigned i1 = 0; + for (unsigned ii = 0; ii < rows; ii++) { + if (ii == i) continue; - m(j-1,k) = this->mat[j][l]; - k++; + unsigned j1 = 0; + for (unsigned jj = 0; jj < rows; jj++) { + if (jj == j) + continue; + c(i1, j1) = this->mat[ii][jj]; + j1++; + } + i1++; } + + T det = c.determinant(); + T sign; + if ((i + j + 2) % 2 == 0) + sign = 1; + else + sign = -1; + result(i, j) = sign * det; } - T sign; - if ((i+2)%2 == 0) - sign = 1; - else - sign = -1; - det += sign * this->mat[0][i] * m.determinant(); } + return result; } - return(det); -} - -template -Matrix Matrix::cofactor(){ - Matrix result(rows, cols, 0); - Matrix c(rows-1, cols-1, 0); - if(rows != cols){ - std::cerr << "Can only compute cofactor of square matrix." << std::endl; + + template + Matrix Matrix::inverse() { + if (rows != cols) { + std::cerr << "Matrix: cannot invert matrix with " << rows << " rows and " << cols << "cols" << std::endl; + } + if (this->determinant() == 0) + std::cerr << "Matrix with 0 determinant has no inverse." << std::endl; + Matrix result = this->cofactor().transpose() / this->determinant(); return result; } - for(unsigned j = 0; j < rows; j++){ - for(unsigned i = 0; i < rows; i++){ - unsigned i1 = 0; - for(unsigned ii = 0; ii < rows; ii++){ - if(ii==i) - continue; - unsigned j1 = 0; - for(unsigned jj = 0; jj< rows; jj++){ - if(jj == j) - continue; - c(i1,j1) = this->mat[ii][jj]; - j1++; - } - i1++; + + // Matrix/scalar addition + template + Matrix Matrix::operator+(const T& rhs) { + Matrix result(rows, cols, 0.0); + + for (unsigned i = 0; i < rows; i++) { + for (unsigned j = 0; j < cols; j++) { + result(i, j) = this->mat[i][j] + rhs; } - - T det = c.determinant(); - T sign; - if ((i+j+2)%2 == 0) - sign = 1; - else - sign = -1; - result(i,j) = sign * det; } + + return result; } - return result; -} - -template -Matrix Matrix::inverse(){ - if(rows != cols){ - std::cerr << "Matrix: cannot invert matrix with " << rows << " rows and " << cols << "cols" << std::endl; - } - if(this->determinant() == 0) - std::cerr << "Matrix with 0 determinant has no inverse." << std::endl; - Matrix result = this->cofactor().transpose() / this->determinant(); - return result; -} - -// Matrix/scalar addition -template -Matrix Matrix::operator+(const T& rhs) { - Matrix result(rows, cols, 0.0); - - for (unsigned i=0; imat[i][j] + rhs; + + // Matrix/scalar subtraction + template + Matrix Matrix::operator-(const T& rhs) { + Matrix result(rows, cols, 0.0); + + for (unsigned i = 0; i < rows; i++) { + for (unsigned j = 0; j < cols; j++) { + result(i, j) = this->mat[i][j] - rhs; + } } + + return result; } - - return result; -} - -// Matrix/scalar subtraction -template -Matrix Matrix::operator-(const T& rhs) { - Matrix result(rows, cols, 0.0); - - for (unsigned i=0; imat[i][j] - rhs; + + // Matrix/scalar multiplication + template + Matrix Matrix::operator*(const T& rhs) { + Matrix result(rows, cols, 0.0); + + for (unsigned i = 0; i < rows; i++) { + for (unsigned j = 0; j < cols; j++) { + result(i, j) = this->mat[i][j] * rhs; + } } + + return result; } - - return result; -} - -// Matrix/scalar multiplication -template -Matrix Matrix::operator*(const T& rhs) { - Matrix result(rows, cols, 0.0); - - for (unsigned i=0; imat[i][j] * rhs; + + // Matrix/scalar division + template + Matrix Matrix::operator/(const T& rhs) { + Matrix result(rows, cols, 0.0); + + if (rhs == 0) + throw cms::Exception("Matrix.cc: Trying to divide (matrix/scalar) by zero"); + + for (unsigned i = 0; i < rows; i++) { + for (unsigned j = 0; j < cols; j++) { + result(i, j) = this->mat[i][j] / rhs; + } } + + return result; } - - return result; -} - -// Matrix/scalar division -template -Matrix Matrix::operator/(const T& rhs) { - Matrix result(rows, cols, 0.0); - - if ( rhs == 0 ) throw cms::Exception("Matrix.cc: Trying to divide (matrix/scalar) by zero"); - - for (unsigned i=0; imat[i][j] / rhs; + + // Multiply a matrix with a vector + template + std::vector Matrix::operator*(const std::vector& rhs) { + std::vector result(this->rows, 0.0); + + for (unsigned i = 0; i < rows; i++) { + for (unsigned j = 0; j < cols; j++) { + result[i] += this->mat[i][j] * rhs[j]; + } } + + return result; } - - return result; -} - -// Multiply a matrix with a vector -template -std::vector Matrix::operator*(const std::vector& rhs) { - std::vector result(this->rows, 0.0); - - for (unsigned i=0; imat[i][j] * rhs[j]; + + // Obtain a vector of the diagonal elements + template + std::vector Matrix::diag_vec() { + std::vector result(rows, 0.0); + + for (unsigned i = 0; i < rows; i++) { + result[i] = this->mat[i][i]; } + + return result; } - - return result; -} - -// Obtain a vector of the diagonal elements -template -std::vector Matrix::diag_vec() { - std::vector result(rows, 0.0); - - for (unsigned i=0; imat[i][i]; + + // Access the individual elements + template + T& Matrix::operator()(const unsigned& row, const unsigned& col) { + return this->mat[row][col]; } - - return result; -} - -// Access the individual elements -template -T& Matrix::operator()(const unsigned& row, const unsigned& col) { - return this->mat[row][col]; -} - -// Access the individual elements (const) -template -const T& Matrix::operator()(const unsigned& row, const unsigned& col) const { - return this->mat[row][col]; -} - -// Get the number of rows of the matrix -template -unsigned Matrix::get_rows() const { - return this->rows; -} - -// Get the number of columns of the matrix -template -unsigned Matrix::get_cols() const { - return this->cols; -} - -template -void Matrix::print(){ - for(unsigned i=0; i < this->rows; i++){ - for(unsigned j=0; j < this->cols; j++){ - std::cout << this->mat[i][j] << ", "; - } - std::cout << std::endl; + + // Access the individual elements (const) + template + const T& Matrix::operator()(const unsigned& row, const unsigned& col) const { + return this->mat[row][col]; + } + + // Get the number of rows of the matrix + template + unsigned Matrix::get_rows() const { + return this->rows; + } + + // Get the number of columns of the matrix + template + unsigned Matrix::get_cols() const { + return this->cols; + } + + template + void Matrix::print() { + for (unsigned i = 0; i < this->rows; i++) { + for (unsigned j = 0; j < this->cols; j++) { + std::cout << this->mat[i][j] << ", "; + } + std::cout << std::endl; } -} - -template class Matrix; -template class Matrix; -template class Matrix; - -} + } + + template class Matrix; + template class Matrix; + template class Matrix; + +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc b/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc index 5b1fb6b186851..41af5b5bd046e 100644 --- a/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc +++ b/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc @@ -5,105 +5,123 @@ namespace TMTT { -MiniHTstage::MiniHTstage( const Settings* settings ) : - settings_( settings ), - miniHTstage_( settings_->miniHTstage() ), - muxOutputsHT_( settings_->muxOutputsHT() ), - houghNbinsPt_( settings_->houghNbinsPt() ), - houghNbinsPhi_( settings_->houghNbinsPhi() ), - miniHoughLoadBalance_( settings_->miniHoughLoadBalance() ), - miniHoughNbinsPt_( settings_->miniHoughNbinsPt() ), - miniHoughNbinsPhi_( settings_->miniHoughNbinsPhi() ), - miniHoughMinPt_( settings_->miniHoughMinPt() ), - miniHoughDontKill_( settings_->miniHoughDontKill() ), - miniHoughDontKillMinPt_( settings_->miniHoughDontKillMinPt() ), - numSubSecsEta_( settings_->numSubSecsEta() ), - numPhiNonants_( settings_->numPhiNonants() ), - numPhiSecPerNon_( settings_->numPhiSectors() / numPhiNonants_ ), - numEtaRegions_( settings_->numEtaRegions() ), - busySectorKill_( settings_->busySectorKill() ), - busySectorNumStubs_( settings_->busySectorNumStubs()), - busySectorMbinRanges_( settings_->busySectorMbinRanges() ), - chosenRofPhi_( settings_->chosenRofPhi() ), -// Get size of 1st stage HT cells. - binSizeQoverPtAxis_( miniHoughNbinsPt_ * 2. / (float)settings->houghMinPt() / (float)houghNbinsPt_ ), - binSizePhiTrkAxis_( miniHoughNbinsPhi_ * 2. * M_PI / (float)settings->numPhiSectors() / (float)houghNbinsPhi_ ), - invPtToDphi_( settings_->invPtToDphi() ), - nHTlinksPerNonant_(0) -{ - nMiniHTcells_ = miniHoughNbinsPt_*miniHoughNbinsPhi_; - - if (miniHoughLoadBalance_ > 0) { - if (muxOutputsHT_ == 3) { - nHTlinksPerNonant_ = busySectorMbinRanges_.size() - 1; - } else if (muxOutputsHT_ == 2) { - nHTlinksPerNonant_ = (busySectorMbinRanges_.size() - 1) * numPhiSecPerNon_; - } else { - throw cms::Exception("MiniHTState: hard-wired MHT load balancing can't be enabled as assumes HT output MUX scheme >= 2"); + MiniHTstage::MiniHTstage(const Settings* settings) + : settings_(settings), + miniHTstage_(settings_->miniHTstage()), + muxOutputsHT_(settings_->muxOutputsHT()), + houghNbinsPt_(settings_->houghNbinsPt()), + houghNbinsPhi_(settings_->houghNbinsPhi()), + miniHoughLoadBalance_(settings_->miniHoughLoadBalance()), + miniHoughNbinsPt_(settings_->miniHoughNbinsPt()), + miniHoughNbinsPhi_(settings_->miniHoughNbinsPhi()), + miniHoughMinPt_(settings_->miniHoughMinPt()), + miniHoughDontKill_(settings_->miniHoughDontKill()), + miniHoughDontKillMinPt_(settings_->miniHoughDontKillMinPt()), + numSubSecsEta_(settings_->numSubSecsEta()), + numPhiNonants_(settings_->numPhiNonants()), + numPhiSecPerNon_(settings_->numPhiSectors() / numPhiNonants_), + numEtaRegions_(settings_->numEtaRegions()), + busySectorKill_(settings_->busySectorKill()), + busySectorNumStubs_(settings_->busySectorNumStubs()), + busySectorMbinRanges_(settings_->busySectorMbinRanges()), + chosenRofPhi_(settings_->chosenRofPhi()), + // Get size of 1st stage HT cells. + binSizeQoverPtAxis_(miniHoughNbinsPt_ * 2. / (float)settings->houghMinPt() / (float)houghNbinsPt_), + binSizePhiTrkAxis_(miniHoughNbinsPhi_ * 2. * M_PI / (float)settings->numPhiSectors() / (float)houghNbinsPhi_), + invPtToDphi_(settings_->invPtToDphi()), + nHTlinksPerNonant_(0) { + nMiniHTcells_ = miniHoughNbinsPt_ * miniHoughNbinsPhi_; + + if (miniHoughLoadBalance_ > 0) { + if (muxOutputsHT_ == 3) { + nHTlinksPerNonant_ = busySectorMbinRanges_.size() - 1; + } else if (muxOutputsHT_ == 2) { + nHTlinksPerNonant_ = (busySectorMbinRanges_.size() - 1) * numPhiSecPerNon_; + } else { + throw cms::Exception( + "MiniHTState: hard-wired MHT load balancing can't be enabled as assumes HT output MUX scheme >= 2"); + } } } -} - -void MiniHTstage::exec( matrix< HTrphi >& mHtRphis ) { - - for ( unsigned int iPhiNon = 0; iPhiNon < numPhiNonants_; iPhiNon++ ) { - map< pair, unsigned int> numStubsPerLinkStage1; // Indices are ([link ID, MHT cell], #stubs). - map< pair, unsigned int> numStubsPerLinkStage2; // Indices are ([link ID, MHT cell], #stubs). - map< unsigned int, unsigned int> numStubsPerLink; // Indices are ([link ID, MHT cell], #stubs). - for ( unsigned int iSecInNon = 0; iSecInNon < numPhiSecPerNon_; iSecInNon++ ) { - unsigned int iPhiSec = iPhiNon * numPhiSecPerNon_ + iSecInNon; - for ( unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++ ) { - - Sector sector; - sector.init( settings_, iPhiSec, iEtaReg ); - const float& phiCentre = sector.phiCentre(); - HTrphi& htRphi = mHtRphis( iPhiSec, iEtaReg ); - const vector< L1track2D >& roughTracks = htRphi.trackCands2D(); - vector< L1track2D > fineTracks; - - for (const L1track2D& roughTrk : roughTracks) { - - float roughTrkPhi = reco::deltaPhi( roughTrk.phi0() - chosenRofPhi_ * invPtToDphi_ * roughTrk.qOverPt() - phiCentre, 0. ); - const pair< unsigned int, unsigned int >& cell = roughTrk.getCellLocationHT(); - const vector< const Stub* >& stubs = roughTrk.getStubs(); - bool fineTrksFound = false; - bool storeCoarseTrack = false; - const unsigned int& link = roughTrk.optoLinkID(); - - if (fabs(roughTrk.qOverPt()) < 1./miniHoughMinPt_) { // Not worth using mini-HT at low Pt due to scattering. - - for ( unsigned int mBin = 0; mBin < miniHoughNbinsPt_; mBin++ ) { - float qOverPtBin = roughTrk.qOverPt() - binSizeQoverPtAxis_ / 2. + ( mBin + .5 ) * binSizeQoverPtAxis_ / settings_->miniHoughNbinsPt(); - for ( unsigned int cBin = 0; cBin < miniHoughNbinsPhi_; cBin++ ){ - float phiBin = reco::deltaPhi( roughTrkPhi - binSizePhiTrkAxis_ / 2. + ( cBin + .5 ) * binSizePhiTrkAxis_ / settings_->miniHoughNbinsPhi(), 0. ); - HTcell htCell; - const bool mergedCell = false; // This represents mini cell. - const bool miniHTcell = true; - htCell.init( settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), qOverPtBin, cell.first + mBin, mergedCell, miniHTcell ); - // Firmware doesn't use bend filter in MHT. - htCell.disableBendFilter(); - - for ( auto& stub: stubs ) { - // Ensure stubs are digitized with respect to the current phi sector. - if ( settings_->enableDigitize() ) - ( const_cast< Stub* >( stub ) )->digitizeForHTinput( iPhiSec ); - float phiStub = reco::deltaPhi( stub->phi() + invPtToDphi_ * qOverPtBin * ( stub->r() - chosenRofPhi_ ) - phiCentre, 0. ); - float dPhi = reco::deltaPhi( phiBin - phiStub, 0. ); - float dPhiMax = binSizePhiTrkAxis_ / miniHoughNbinsPhi_ / 2. + invPtToDphi_ * binSizeQoverPtAxis_ / (float)miniHoughNbinsPt_ * fabs( stub->r() - chosenRofPhi_ ) / 2.; - if ( fabs( dPhi ) <= fabs( reco::deltaPhi( dPhiMax, 0. ) ) ) htCell.store( stub, sector.insideEtaSubSecs( stub ) ); - } - htCell.end(); - if ( htCell.trackCandFound() ) { - - // Do load balancing. - unsigned int trueLinkID = linkIDLoadBalanced(link, mBin, cBin, htCell.numStubs(), numStubsPerLinkStage1, numStubsPerLinkStage2); - - pair< unsigned int, unsigned int > cellLocation( cell.first + mBin, cell.second + cBin ); - pair< float, float > helix2D( qOverPtBin, reco::deltaPhi( phiBin + chosenRofPhi_ * invPtToDphi_ * qOverPtBin + phiCentre, 0. ) ); - L1track2D fineTrk( settings_, htCell.stubs(), cellLocation, helix2D, iPhiSec, iEtaReg, trueLinkID, mergedCell ); - // Truncation due to output opto-link bandwidth. - bool keep( true ); - /* + + void MiniHTstage::exec(matrix& mHtRphis) { + for (unsigned int iPhiNon = 0; iPhiNon < numPhiNonants_; iPhiNon++) { + map, unsigned int> + numStubsPerLinkStage1; // Indices are ([link ID, MHT cell], #stubs). + map, unsigned int> + numStubsPerLinkStage2; // Indices are ([link ID, MHT cell], #stubs). + map numStubsPerLink; // Indices are ([link ID, MHT cell], #stubs). + for (unsigned int iSecInNon = 0; iSecInNon < numPhiSecPerNon_; iSecInNon++) { + unsigned int iPhiSec = iPhiNon * numPhiSecPerNon_ + iSecInNon; + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + Sector sector; + sector.init(settings_, iPhiSec, iEtaReg); + const float& phiCentre = sector.phiCentre(); + HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); + const vector& roughTracks = htRphi.trackCands2D(); + vector fineTracks; + + for (const L1track2D& roughTrk : roughTracks) { + float roughTrkPhi = + reco::deltaPhi(roughTrk.phi0() - chosenRofPhi_ * invPtToDphi_ * roughTrk.qOverPt() - phiCentre, 0.); + const pair& cell = roughTrk.getCellLocationHT(); + const vector& stubs = roughTrk.getStubs(); + bool fineTrksFound = false; + bool storeCoarseTrack = false; + const unsigned int& link = roughTrk.optoLinkID(); + + if (fabs(roughTrk.qOverPt()) < + 1. / miniHoughMinPt_) { // Not worth using mini-HT at low Pt due to scattering. + + for (unsigned int mBin = 0; mBin < miniHoughNbinsPt_; mBin++) { + float qOverPtBin = roughTrk.qOverPt() - binSizeQoverPtAxis_ / 2. + + (mBin + .5) * binSizeQoverPtAxis_ / settings_->miniHoughNbinsPt(); + for (unsigned int cBin = 0; cBin < miniHoughNbinsPhi_; cBin++) { + float phiBin = reco::deltaPhi(roughTrkPhi - binSizePhiTrkAxis_ / 2. + + (cBin + .5) * binSizePhiTrkAxis_ / settings_->miniHoughNbinsPhi(), + 0.); + HTcell htCell; + const bool mergedCell = false; // This represents mini cell. + const bool miniHTcell = true; + htCell.init(settings_, + iPhiSec, + iEtaReg, + sector.etaMin(), + sector.etaMax(), + qOverPtBin, + cell.first + mBin, + mergedCell, + miniHTcell); + // Firmware doesn't use bend filter in MHT. + htCell.disableBendFilter(); + + for (auto& stub : stubs) { + // Ensure stubs are digitized with respect to the current phi sector. + if (settings_->enableDigitize()) + (const_cast(stub))->digitizeForHTinput(iPhiSec); + float phiStub = reco::deltaPhi( + stub->phi() + invPtToDphi_ * qOverPtBin * (stub->r() - chosenRofPhi_) - phiCentre, 0.); + float dPhi = reco::deltaPhi(phiBin - phiStub, 0.); + float dPhiMax = binSizePhiTrkAxis_ / miniHoughNbinsPhi_ / 2. + + invPtToDphi_ * binSizeQoverPtAxis_ / (float)miniHoughNbinsPt_ * + fabs(stub->r() - chosenRofPhi_) / 2.; + if (fabs(dPhi) <= fabs(reco::deltaPhi(dPhiMax, 0.))) + htCell.store(stub, sector.insideEtaSubSecs(stub)); + } + htCell.end(); + if (htCell.trackCandFound()) { + // Do load balancing. + unsigned int trueLinkID = linkIDLoadBalanced( + link, mBin, cBin, htCell.numStubs(), numStubsPerLinkStage1, numStubsPerLinkStage2); + + pair cellLocation(cell.first + mBin, cell.second + cBin); + pair helix2D( + qOverPtBin, reco::deltaPhi(phiBin + chosenRofPhi_ * invPtToDphi_ * qOverPtBin + phiCentre, 0.)); + L1track2D fineTrk( + settings_, htCell.stubs(), cellLocation, helix2D, iPhiSec, iEtaReg, trueLinkID, mergedCell); + // Truncation due to output opto-link bandwidth. + bool keep(true); + /* pair encodedLink; if (miniHoughLoadBalance_ > 0) { encodedLink = pair(newererLink, mhtCell); @@ -113,43 +131,49 @@ void MiniHTstage::exec( matrix< HTrphi >& mHtRphis ) { numStubsPerLink[ encodedLink ] += htCell.numStubs(); if ( busySectorKill_ && numStubsPerLink[ encodedLink ] > busySectorNumStubs_ ) keep = false; */ - numStubsPerLink[ trueLinkID ] += htCell.numStubs(); - if ( busySectorKill_ && numStubsPerLink[ trueLinkID ] > busySectorNumStubs_ ) keep = false; - if ( keep ) { - fineTracks.push_back( fineTrk ); - fineTrksFound = true; - } - } - } - } - - } else { - - // Keep rough track if below Pt threshold where mini-HT in use. - storeCoarseTrack = true; - - } - - if ( storeCoarseTrack || ( (not fineTrksFound) && miniHoughDontKill_ && fabs(roughTrk.qOverPt()) < 1./miniHoughDontKillMinPt_ ) ) { - // Keeping original track instead of mini-HTtracks. - // Invent dummy miniHT cells so as to be able to reuse load balancing, trying all combinations to identify the least used link. - pair bestCell = {0,0}; - unsigned int bestNumStubsPerLink = 999999; - for ( unsigned int mBin = 0; mBin < miniHoughNbinsPt_; mBin++ ) { - for ( unsigned int cBin = 0; cBin < miniHoughNbinsPhi_; cBin++ ){ - unsigned int testLinkID = linkIDLoadBalanced(link, mBin, cBin, roughTrk.getNumStubs(), numStubsPerLinkStage1, numStubsPerLinkStage2, true); - if (numStubsPerLink[ testLinkID ] < bestNumStubsPerLink) { - bestCell = {mBin, cBin}; - bestNumStubsPerLink = numStubsPerLink[ testLinkID ]; - } - } - } - - // Repeat for best link, this time incremementing stub counters. - unsigned int trueLinkID = linkIDLoadBalanced(link, bestCell.first, bestCell.second, roughTrk.getNumStubs(), numStubsPerLinkStage1, numStubsPerLinkStage2); - - bool keep( true ); - /* + numStubsPerLink[trueLinkID] += htCell.numStubs(); + if (busySectorKill_ && numStubsPerLink[trueLinkID] > busySectorNumStubs_) + keep = false; + if (keep) { + fineTracks.push_back(fineTrk); + fineTrksFound = true; + } + } + } + } + + } else { + // Keep rough track if below Pt threshold where mini-HT in use. + storeCoarseTrack = true; + } + + if (storeCoarseTrack || ((not fineTrksFound) && miniHoughDontKill_ && + fabs(roughTrk.qOverPt()) < 1. / miniHoughDontKillMinPt_)) { + // Keeping original track instead of mini-HTtracks. + // Invent dummy miniHT cells so as to be able to reuse load balancing, trying all combinations to identify the least used link. + pair bestCell = {0, 0}; + unsigned int bestNumStubsPerLink = 999999; + for (unsigned int mBin = 0; mBin < miniHoughNbinsPt_; mBin++) { + for (unsigned int cBin = 0; cBin < miniHoughNbinsPhi_; cBin++) { + unsigned int testLinkID = linkIDLoadBalanced( + link, mBin, cBin, roughTrk.getNumStubs(), numStubsPerLinkStage1, numStubsPerLinkStage2, true); + if (numStubsPerLink[testLinkID] < bestNumStubsPerLink) { + bestCell = {mBin, cBin}; + bestNumStubsPerLink = numStubsPerLink[testLinkID]; + } + } + } + + // Repeat for best link, this time incremementing stub counters. + unsigned int trueLinkID = linkIDLoadBalanced(link, + bestCell.first, + bestCell.second, + roughTrk.getNumStubs(), + numStubsPerLinkStage1, + numStubsPerLinkStage2); + + bool keep(true); + /* pair encodedLink; if (miniHoughLoadBalance_ > 0) { encodedLink = pair(link/nMiniHTcells_, link%nMiniHTcells_); @@ -159,81 +183,90 @@ void MiniHTstage::exec( matrix< HTrphi >& mHtRphis ) { numStubsPerLink[ encodedLink ] += roughTrk.getNumStubs(); if ( busySectorKill_ && numStubsPerLink[ encodedLink ] > busySectorNumStubs_ ) keep = false; */ - numStubsPerLink[ trueLinkID ] += roughTrk.getNumStubs(); - if ( busySectorKill_ && numStubsPerLink[ trueLinkID ] > busySectorNumStubs_ ) keep = false; - if ( keep ) { - fineTracks.push_back( roughTrk ); - fineTracks.back().setOptoLinkID(trueLinkID); - } + numStubsPerLink[trueLinkID] += roughTrk.getNumStubs(); + if (busySectorKill_ && numStubsPerLink[trueLinkID] > busySectorNumStubs_) + keep = false; + if (keep) { + fineTracks.push_back(roughTrk); + fineTracks.back().setOptoLinkID(trueLinkID); + } + } } + // Replace all existing tracks inside HT array with new ones. + htRphi.replaceTrackCands2D(fineTracks); } - // Replace all existing tracks inside HT array with new ones. - htRphi.replaceTrackCands2D( fineTracks ); } } } -} - -//=== Do load balancing -//=== (numStubs is stubs on this track, "link" is link ID before load balancing, and return argument is link ID after load balancing). -//=== (numStubsPerLinkStage* are stub counters per link used to determine best balance. If test=true, then these counters are not to be incrememented). -unsigned int MiniHTstage::linkIDLoadBalanced(unsigned int link, unsigned int mBin, unsigned int cBin, unsigned int numStubs, map< pair, unsigned int>& numStubsPerLinkStage1, map< pair, unsigned int>& numStubsPerLinkStage2, bool test) const { - - unsigned int mhtCell = miniHoughNbinsPhi_*mBin + cBin; // Send each mini-cell to a different output link - - // Number of output links after static load balancing roughly same as number of - // input links with this, with nSep per MHT cell. - unsigned int nSep = std::ceil(float(nHTlinksPerNonant_)/float(nMiniHTcells_)); - - unsigned int newLink, newerLink, newererLink; - - if (miniHoughLoadBalance_ >= 1) { - // Static load balancing, 4 -> 1, with each MHT cell sent to seperate output link. - newLink = link%nSep; // newLink in range 0 to nSep-1. - } else { - newLink = link; - } + //=== Do load balancing + //=== (numStubs is stubs on this track, "link" is link ID before load balancing, and return argument is link ID after load balancing). + //=== (numStubsPerLinkStage* are stub counters per link used to determine best balance. If test=true, then these counters are not to be incrememented). + + unsigned int MiniHTstage::linkIDLoadBalanced( + unsigned int link, + unsigned int mBin, + unsigned int cBin, + unsigned int numStubs, + map, unsigned int>& numStubsPerLinkStage1, + map, unsigned int>& numStubsPerLinkStage2, + bool test) const { + unsigned int mhtCell = miniHoughNbinsPhi_ * mBin + cBin; // Send each mini-cell to a different output link + + // Number of output links after static load balancing roughly same as number of + // input links with this, with nSep per MHT cell. + unsigned int nSep = std::ceil(float(nHTlinksPerNonant_) / float(nMiniHTcells_)); + + unsigned int newLink, newerLink, newererLink; + + if (miniHoughLoadBalance_ >= 1) { + // Static load balancing, 4 -> 1, with each MHT cell sent to seperate output link. + newLink = link % nSep; // newLink in range 0 to nSep-1. + } else { + newLink = link; + } - if (miniHoughLoadBalance_ >= 2) { + if (miniHoughLoadBalance_ >= 2) { + // 2-stage dynamic load balancing amongst links corresponding to same MHT cell. - // 2-stage dynamic load balancing amongst links corresponding to same MHT cell. + // Dynamically mix pairs of neighbouring links. + unsigned int balancedLinkA = 2 * (newLink / 2); + unsigned int balancedLinkB = balancedLinkA + 1; - // Dynamically mix pairs of neighbouring links. - unsigned int balancedLinkA = 2*(newLink/2); - unsigned int balancedLinkB = balancedLinkA + 1; + pair encodedLinkA(balancedLinkA, + mhtCell); // balancedLink* here in range 0 to nSep-1. + pair encodedLinkB(balancedLinkB, mhtCell); + if (numStubsPerLinkStage1[encodedLinkA] < numStubsPerLinkStage1[encodedLinkB]) { + newerLink = balancedLinkA; + } else { + newerLink = balancedLinkB; + } + pair encodedLinkAB(newerLink, mhtCell); + if (not test) + numStubsPerLinkStage1[encodedLinkAB] += numStubs; + + // Dynamically mix pairs of next-to-neighbouring links. + unsigned int balancedLinkY = newerLink; + //unsigned int balancedLinkZ = (newerLink%4<=1) ? balancedLinkY + 2 : balancedLinkY - 2; + unsigned int balancedLinkZ = (newerLink + 2) % nSep; + + pair encodedLinkY(balancedLinkY, mhtCell); + pair encodedLinkZ(balancedLinkZ, mhtCell); + if (numStubsPerLinkStage2[encodedLinkY] < numStubsPerLinkStage2[encodedLinkZ]) { + newererLink = balancedLinkY; + } else { + newererLink = balancedLinkZ; + } + pair encodedLinkYZ(newererLink, mhtCell); + if (not test) + numStubsPerLinkStage2[encodedLinkYZ] += numStubs; - pair encodedLinkA(balancedLinkA, mhtCell); // balancedLink* here in range 0 to nSep-1. - pair encodedLinkB(balancedLinkB, mhtCell); - if (numStubsPerLinkStage1[encodedLinkA] < numStubsPerLinkStage1[encodedLinkB]) { - newerLink = balancedLinkA; } else { - newerLink = balancedLinkB; - } - pair encodedLinkAB(newerLink, mhtCell); - if (not test) numStubsPerLinkStage1[ encodedLinkAB ] += numStubs; - - // Dynamically mix pairs of next-to-neighbouring links. - unsigned int balancedLinkY = newerLink; - //unsigned int balancedLinkZ = (newerLink%4<=1) ? balancedLinkY + 2 : balancedLinkY - 2; - unsigned int balancedLinkZ = (newerLink+2)%nSep; - - pair encodedLinkY(balancedLinkY, mhtCell); - pair encodedLinkZ(balancedLinkZ, mhtCell); - if (numStubsPerLinkStage2[encodedLinkY] < numStubsPerLinkStage2[encodedLinkZ]) { - newererLink = balancedLinkY; - } else { - newererLink = balancedLinkZ; - } - pair encodedLinkYZ(newererLink, mhtCell); - if (not test) numStubsPerLinkStage2[ encodedLinkYZ ] += numStubs; - - } else { - newerLink = newLink; - newererLink = newLink; + newerLink = newLink; + newererLink = newLink; + } + unsigned int trueLinkID = (miniHoughLoadBalance_ > 0) ? nMiniHTcells_ * newererLink + mhtCell : newererLink; + return trueLinkID; } - unsigned int trueLinkID = (miniHoughLoadBalance_ > 0) ? nMiniHTcells_ * newererLink + mhtCell : newererLink; - return trueLinkID; -} -} +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc b/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc index e746c7882c988..03ca046f2e65e 100644 --- a/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc +++ b/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc @@ -1,5 +1,5 @@ -//--- Note that the word "link" appearing in the C++ or comments in this class actually corresponds +//--- Note that the word "link" appearing in the C++ or comments in this class actually corresponds //--- to a pair of links in the hardware. #include "L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h" @@ -9,182 +9,184 @@ namespace TMTT { -//=== Initialize constants from configuration parameters. - -MuxHToutputs::MuxHToutputs(const Settings* settings) : - settings_(settings), - muxOutputsHT_( settings_->muxOutputsHT() ), - numPhiNonants_( settings_->numPhiNonants() ), - numPhiSectors_( settings_->numPhiSectors() ), - numPhiSecPerNon_( numPhiSectors_ / numPhiNonants_ ), - numEtaRegions_( settings_->numEtaRegions() ), - busySectorKill_( settings_->busySectorKill() ), // Kill excess tracks flowing out of HT? - busySectorNumStubs_( settings_->busySectorNumStubs()), // Max. num. of stubs that can be sent within TM period - busySectorMbinRanges_( settings_->busySectorMbinRanges() ), // Individual m bin (=q/Pt) ranges to be output to opto-links. - busySectorUseMbinRanges_( busySectorMbinRanges_.size() > 0) // m bin ranges option disabled if vector empty. -{ - // Implemented MUX algorithm relies on same number of sectors per nonant. - if (numPhiSectors_%numPhiNonants_ != 0) throw cms::Exception("MuxHToutputs: Number of phi sectors is not a multiple of number of nonants!"); - - if ( ! busySectorUseMbinRanges_) throw cms::Exception("MuxHToutputs: The implemented MUX algorithm requires you to be using the busySectorMbinRanges cfg option!"); - - // Check that the MUX algorithm implemented in linkID() is not obviously wrong. - this->sanityCheck(); - - bool static first = true; - if (first) { - first = false; - cout<<"=== The R-PHI HT output is multiplexed onto "<numLinksPerNonant()<<" pairs of opto-links per nonant."<muxOutputsHT()), + numPhiNonants_(settings_->numPhiNonants()), + numPhiSectors_(settings_->numPhiSectors()), + numPhiSecPerNon_(numPhiSectors_ / numPhiNonants_), + numEtaRegions_(settings_->numEtaRegions()), + busySectorKill_(settings_->busySectorKill()), // Kill excess tracks flowing out of HT? + busySectorNumStubs_(settings_->busySectorNumStubs()), // Max. num. of stubs that can be sent within TM period + busySectorMbinRanges_( + settings_->busySectorMbinRanges()), // Individual m bin (=q/Pt) ranges to be output to opto-links. + busySectorUseMbinRanges_(busySectorMbinRanges_.size() > 0) // m bin ranges option disabled if vector empty. + { + // Implemented MUX algorithm relies on same number of sectors per nonant. + if (numPhiSectors_ % numPhiNonants_ != 0) + throw cms::Exception("MuxHToutputs: Number of phi sectors is not a multiple of number of nonants!"); + + if (!busySectorUseMbinRanges_) + throw cms::Exception( + "MuxHToutputs: The implemented MUX algorithm requires you to be using the busySectorMbinRanges cfg option!"); + + // Check that the MUX algorithm implemented in linkID() is not obviously wrong. + this->sanityCheck(); + + bool static first = true; + if (first) { + first = false; + cout << "=== The R-PHI HT output is multiplexed onto " << this->numLinksPerNonant() + << " pairs of opto-links per nonant." << endl; + } } -} - -//=== Determine which tracks are transmitted on each HT output optical link, taking into account the multiplexing -//=== of multiple (eta,phi) sectors onto single links and the truncation of the tracks caused by the requirement -//=== to output all the tracks within the time-multiplexed period. -//=== This function replaces the 2D track collection in the r-phi HT with the subset surviving the TM cut. - -void MuxHToutputs::exec(matrix& mHtRphis) const { - - // As this loops over sectors in order of increasing sector number, this MUX algorithm always transmits tracks - // from the lowest sector numbers on each link first. So the highest sector numbers are more likely to be - // truncated by the TM period. The algorithm assumes that two or more m-bin ranges from the same sector will never - // be transmitted down the same link, as if this happens, it does not predict the order in which they will be - // transmitted. - - for (unsigned int iPhiNon = 0; iPhiNon < numPhiNonants_; iPhiNon++) { - vector numStubsPerLink( this->numLinksPerNonant(), 0 ); - - for (unsigned int iSecInNon = 0; iSecInNon < numPhiSecPerNon_; iSecInNon++) { - unsigned int iPhiSec = iPhiNon * numPhiSecPerNon_ + iSecInNon; - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - - HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); // Get a mutable version of the r-phi HT. - - vector keptTracks; - vector tracks = htRphi.trackCands2D(); - - for (L1track2D& trk : tracks) { - unsigned int nStubs = trk.getNumStubs(); // #stubs on this track. - unsigned int mBinRange = htRphi.getMbinRange(trk); // Which m bin range is this track in? - // Get the output optical link corresponding to this sector & m-bin range. - unsigned int link = this->linkID(iSecInNon, iEtaReg, mBinRange); - // Make a note of opto-link number inside track object. - trk.setOptoLinkID(link); - - numStubsPerLink[ link ] += nStubs; - // Check if this track can be output within the time-multiplexed period. - bool keep = ( (not busySectorKill_) || (numStubsPerLink[ link ] <= busySectorNumStubs_)); - // FIX: with 2 GeV threshold, this causes significant truncation. - // Consider using one output link for each phi sector in nonant - if (keep) keptTracks.push_back(&trk); - } - - // Replace the collection of 2D tracks in the r-phi HT with the subset of them surviving the TM cut. - htRphi.replaceTrackCands2D(keptTracks); + //=== Determine which tracks are transmitted on each HT output optical link, taking into account the multiplexing + //=== of multiple (eta,phi) sectors onto single links and the truncation of the tracks caused by the requirement + //=== to output all the tracks within the time-multiplexed period. + //=== This function replaces the 2D track collection in the r-phi HT with the subset surviving the TM cut. + + void MuxHToutputs::exec(matrix& mHtRphis) const { + // As this loops over sectors in order of increasing sector number, this MUX algorithm always transmits tracks + // from the lowest sector numbers on each link first. So the highest sector numbers are more likely to be + // truncated by the TM period. The algorithm assumes that two or more m-bin ranges from the same sector will never + // be transmitted down the same link, as if this happens, it does not predict the order in which they will be + // transmitted. + + for (unsigned int iPhiNon = 0; iPhiNon < numPhiNonants_; iPhiNon++) { + vector numStubsPerLink(this->numLinksPerNonant(), 0); + + for (unsigned int iSecInNon = 0; iSecInNon < numPhiSecPerNon_; iSecInNon++) { + unsigned int iPhiSec = iPhiNon * numPhiSecPerNon_ + iSecInNon; + + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); // Get a mutable version of the r-phi HT. + + vector keptTracks; + vector tracks = htRphi.trackCands2D(); + + for (L1track2D& trk : tracks) { + unsigned int nStubs = trk.getNumStubs(); // #stubs on this track. + unsigned int mBinRange = htRphi.getMbinRange(trk); // Which m bin range is this track in? + // Get the output optical link corresponding to this sector & m-bin range. + unsigned int link = this->linkID(iSecInNon, iEtaReg, mBinRange); + // Make a note of opto-link number inside track object. + trk.setOptoLinkID(link); + + numStubsPerLink[link] += nStubs; + // Check if this track can be output within the time-multiplexed period. + bool keep = ((not busySectorKill_) || (numStubsPerLink[link] <= busySectorNumStubs_)); + // FIX: with 2 GeV threshold, this causes significant truncation. + // Consider using one output link for each phi sector in nonant + if (keep) + keptTracks.push_back(&trk); + } + + // Replace the collection of 2D tracks in the r-phi HT with the subset of them surviving the TM cut. + htRphi.replaceTrackCands2D(keptTracks); + } } - } + } } -} -//=== Define the number of (eta,phi) sectors that each output opto-link takes tracks from. (Depends on MUX scheme). + //=== Define the number of (eta,phi) sectors that each output opto-link takes tracks from. (Depends on MUX scheme). -unsigned int MuxHToutputs::muxFactor() const { - if (muxOutputsHT_ == 1) { - return 6; - } else if (muxOutputsHT_ == 2) { - return numEtaRegions_; - } else { - return numEtaRegions_*numPhiSecPerNon_; + unsigned int MuxHToutputs::muxFactor() const { + if (muxOutputsHT_ == 1) { + return 6; + } else if (muxOutputsHT_ == 2) { + return numEtaRegions_; + } else { + return numEtaRegions_ * numPhiSecPerNon_; + } } -} - -//=== Define the MUX algorithm by which tracks from the specified m-bin range in the HT for a given (phi,eta) -//=== sector within a phi nonant are multiplexed onto a single output optical link. - -unsigned int MuxHToutputs::linkID(unsigned int iSecInNon, unsigned int iEtaReg, unsigned int mBinRange) const { - unsigned int link; - // This algorithm multiplexes tracks from different eta sectors onto the a single optical link. + //=== Define the MUX algorithm by which tracks from the specified m-bin range in the HT for a given (phi,eta) + //=== sector within a phi nonant are multiplexed onto a single output optical link. - if (muxOutputsHT_ == 1) { + unsigned int MuxHToutputs::linkID(unsigned int iSecInNon, unsigned int iEtaReg, unsigned int mBinRange) const { + unsigned int link; - //--- This is Mux used for the Dec. 2016 demonstrator. + // This algorithm multiplexes tracks from different eta sectors onto the a single optical link. - // Link 0 contains eta sectors 0, 3, 6, 9, 12 & 15, whilst Link 1 contains eta sectors 1, 4, 7, 10, 13 & 16 etc. - // The multiplexing is independent of the phi sector or m-bin range, except in that two tracks that - // differ in either of these quantities will always be sent to different Links. + if (muxOutputsHT_ == 1) { + //--- This is Mux used for the Dec. 2016 demonstrator. - if (numEtaRegions_ == 18) { - link = iEtaReg%3; // In range 0 to 2 - link += 3*iSecInNon; // In range 0 to (3*numPhiSecPerNon - 1) - link += 3*numPhiSecPerNon_ * mBinRange; // In range 0 to (3*numPhiSecsPerNon*numMbinRanges - 1) - } else { - throw cms::Exception("MuxHToutputs: MUX algorithm only implemented for 18 eta sectors!"); - } + // Link 0 contains eta sectors 0, 3, 6, 9, 12 & 15, whilst Link 1 contains eta sectors 1, 4, 7, 10, 13 & 16 etc. + // The multiplexing is independent of the phi sector or m-bin range, except in that two tracks that + // differ in either of these quantities will always be sent to different Links. - } else if (muxOutputsHT_ == 2) { + if (numEtaRegions_ == 18) { + link = iEtaReg % 3; // In range 0 to 2 + link += 3 * iSecInNon; // In range 0 to (3*numPhiSecPerNon - 1) + link += 3 * numPhiSecPerNon_ * mBinRange; // In range 0 to (3*numPhiSecsPerNon*numMbinRanges - 1) + } else { + throw cms::Exception("MuxHToutputs: MUX algorithm only implemented for 18 eta sectors!"); + } + } else if (muxOutputsHT_ == 2) { //--- This is the Mar. 2018 Mux for the transverse HT readout organised by m-bin. (Each phi sector & m bin range go to a different link). - link = 0; - //link += iSecInNon; - //link += numPhiSecPerNon_ * mBinRange; + link = 0; + //link += iSecInNon; + //link += numPhiSecPerNon_ * mBinRange; // IRT - match firmware, taking into account that fw uses mBin = -mBin relative to sw. // NOT NEEDED ANYMORE, AS NOW FW USES MBIN SAME SIGN AS Q/PT. // unsigned int iCorr = (settings_->miniHTstage()) ? 1 : 0; - // Sign flip for FW using opposite - //link += (busySectorMbinRanges_.size() - iCorr) - mBinRange - 1; - link += mBinRange; + // Sign flip for FW using opposite + //link += (busySectorMbinRanges_.size() - iCorr) - mBinRange - 1; + link += mBinRange; link += iSecInNon * (busySectorMbinRanges_.size() - 1); - } else if (muxOutputsHT_ == 3) { - + } else if (muxOutputsHT_ == 3) { //--- This is the Sept. 2019 Mux for the transverse HT readout organised by m-bin. (Each m bin in entire nonant goes to a different link). - link = 0; - //link += iSecInNon; - //link += numPhiSecPerNon_ * mBinRange; + link = 0; + //link += iSecInNon; + //link += numPhiSecPerNon_ * mBinRange; // IRT - match firmware, taking into account that fw uses mBin = -mBin relative to sw. // NOT NEEDED ANYMORE, AS NOW FW USES MBIN SAME SIGN AS Q/PT. // unsigned int iCorr = (settings_->miniHTstage()) ? 1 : 0; - // Sign flip for FW using opposite - //link += (busySectorMbinRanges_.size() - iCorr) - mBinRange - 1; - link += mBinRange; + // Sign flip for FW using opposite + //link += (busySectorMbinRanges_.size() - iCorr) - mBinRange - 1; + link += mBinRange; - } else { - - throw cms::Exception("MuxHToutputs: Unknown MuxOutputsHT configuration option!"); + } else { + throw cms::Exception("MuxHToutputs: Unknown MuxOutputsHT configuration option!"); + } + if (link >= this->numLinksPerNonant()) + throw cms::Exception("MuxHToutputs: Calculated link ID exceeded expected number of links! ") + << link << " " << this->numLinksPerNonant() << endl; + return link; } - if (link >= this->numLinksPerNonant() ) throw cms::Exception("MuxHToutputs: Calculated link ID exceeded expected number of links! ")<numLinksPerNonant()<muxFactor() != 0) + throw cms::Exception("MuxHToutputs: Number of sectors per phi nonant is not a multiple of muxFactor()."); -void MuxHToutputs::sanityCheck() { - if ( numPhiSecPerNon_ * numEtaRegions_ % this->muxFactor() != 0) throw cms::Exception("MuxHToutputs: Number of sectors per phi nonant is not a multiple of muxFactor()."); - - vector nObsElementsPerLink ( this->numLinksPerNonant(), 0 ); - for (unsigned int iSecInNon = 0; iSecInNon < numPhiSecPerNon_; iSecInNon++) { - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - // IRT - unsigned int iCorr = (settings_->miniHTstage()) ? 1 : 0; - for (unsigned int mBinRange = 0; mBinRange < busySectorMbinRanges_.size() - iCorr; mBinRange++) { - unsigned int link = this->linkID(iSecInNon, iEtaReg, mBinRange); - nObsElementsPerLink[ link ] += 1; + vector nObsElementsPerLink(this->numLinksPerNonant(), 0); + for (unsigned int iSecInNon = 0; iSecInNon < numPhiSecPerNon_; iSecInNon++) { + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + // IRT + unsigned int iCorr = (settings_->miniHTstage()) ? 1 : 0; + for (unsigned int mBinRange = 0; mBinRange < busySectorMbinRanges_.size() - iCorr; mBinRange++) { + unsigned int link = this->linkID(iSecInNon, iEtaReg, mBinRange); + nObsElementsPerLink[link] += 1; + } } } + for (const unsigned int& n : nObsElementsPerLink) { + // Assume good algorithms will distribute sectors & m-bin ranges equally across links. + // IRT + // if (n != this->muxFactor()) throw cms::Exception("MuxHToutputs: MUX algorithm is not assigning equal numbers of elements per link! ")<muxFactor()<muxFactor()) throw cms::Exception("MuxHToutputs: MUX algorithm is not assigning equal numbers of elements per link! ")<muxFactor()<handleStripsPhiSec(); - handleStripsEtaSec_ = settings->handleStripsEtaSec(); - - //=== Characteristics of this eta region. - - iPhiSec_ = iPhiSec; - iEtaReg_ = iEtaReg; - // Using lines of specified rapidity drawn from centre of CMS, determine the z coords at which - // they cross the radius rChosenRofZ_. - etaMin_ = settings->etaRegions()[iEtaReg]; - etaMax_ = settings->etaRegions()[iEtaReg + 1]; - chosenRofZ_ = settings->chosenRofZ(); - // Get range in z of tracks covered by this sector at chosen radius from beam-line - zOuterMin_ = chosenRofZ_ / tan( 2. * atan(exp(-etaMin_)) ); - zOuterMax_ = chosenRofZ_ / tan( 2. * atan(exp(-etaMax_)) ); - beamWindowZ_ = settings->beamWindowZ(); // Assumed half-length of beam-spot - - // If rapidity line leaves tracker endcap before reaching r = rChosenOfZ_, try something different. - /* + //=== Initialise + + void Sector::init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg) { + settings_ = settings; + + // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when assigning stubs to sectors? + handleStripsPhiSec_ = settings->handleStripsPhiSec(); + handleStripsEtaSec_ = settings->handleStripsEtaSec(); + + //=== Characteristics of this eta region. + + iPhiSec_ = iPhiSec; + iEtaReg_ = iEtaReg; + // Using lines of specified rapidity drawn from centre of CMS, determine the z coords at which + // they cross the radius rChosenRofZ_. + etaMin_ = settings->etaRegions()[iEtaReg]; + etaMax_ = settings->etaRegions()[iEtaReg + 1]; + chosenRofZ_ = settings->chosenRofZ(); + // Get range in z of tracks covered by this sector at chosen radius from beam-line + zOuterMin_ = chosenRofZ_ / tan(2. * atan(exp(-etaMin_))); + zOuterMax_ = chosenRofZ_ / tan(2. * atan(exp(-etaMax_))); + beamWindowZ_ = settings->beamWindowZ(); // Assumed half-length of beam-spot + + // If rapidity line leaves tracker endcap before reaching r = rChosenOfZ_, try something different. + /* trackerOuterRadius_ = settings->trackerOuterRadius(); trackerInnerRadius_ = settings->trackerInnerRadius(); trackerHalfLength_ = settings->trackerHalfLength(); @@ -48,23 +48,24 @@ void Sector::init(const Settings* settings, unsigned int iPhiSec, unsigned int i } */ - //=== Characteristics of this phi region. - unsigned int numPhiSecPerNonant = (settings->numPhiSectors()) / (settings->numPhiNonants()); - // Centre of phi (tracking) nonant zero must be along x-axis to be consistent with tracker cabling map. - // Define phi sector zero to start at lower end of phi range in nonant 0. - float phiCentreSec0 = -M_PI/float(settings->numPhiNonants()) + M_PI/float(settings->numPhiSectors()); - phiCentre_ = 2.*M_PI * float(iPhiSec) / float(settings->numPhiSectors()) + phiCentreSec0; // Centre of sector in phi - sectorHalfWidth_ = M_PI / float(settings->numPhiSectors()); // Sector half width excluding overlaps. - chosenRofPhi_ = settings->chosenRofPhi(); - useStubPhi_ = settings->useStubPhi(); - minPt_ = settings->houghMinPt(); // Min Pt covered by HT array. - useStubPhiTrk_ = settings->useStubPhiTrk(); - assumedPhiTrkRes_ = settings->assumedPhiTrkRes(); - calcPhiTrkRes_ = settings->calcPhiTrkRes(); - - //=== Check if subsectors in eta are being used within each sector. - numSubSecsEta_ = settings->numSubSecsEta(); - /* + //=== Characteristics of this phi region. + unsigned int numPhiSecPerNonant = (settings->numPhiSectors()) / (settings->numPhiNonants()); + // Centre of phi (tracking) nonant zero must be along x-axis to be consistent with tracker cabling map. + // Define phi sector zero to start at lower end of phi range in nonant 0. + float phiCentreSec0 = -M_PI / float(settings->numPhiNonants()) + M_PI / float(settings->numPhiSectors()); + phiCentre_ = + 2. * M_PI * float(iPhiSec) / float(settings->numPhiSectors()) + phiCentreSec0; // Centre of sector in phi + sectorHalfWidth_ = M_PI / float(settings->numPhiSectors()); // Sector half width excluding overlaps. + chosenRofPhi_ = settings->chosenRofPhi(); + useStubPhi_ = settings->useStubPhi(); + minPt_ = settings->houghMinPt(); // Min Pt covered by HT array. + useStubPhiTrk_ = settings->useStubPhiTrk(); + assumedPhiTrkRes_ = settings->assumedPhiTrkRes(); + calcPhiTrkRes_ = settings->calcPhiTrkRes(); + + //=== Check if subsectors in eta are being used within each sector. + numSubSecsEta_ = settings->numSubSecsEta(); + /* // If subsectors have equal width in z50, do this. float subSecWidth = (zOuterMax_ - zOuterMin_)/float(numSubSecsEta_); for (unsigned int i = 0; i < numSubSecsEta_; i++) { @@ -72,247 +73,278 @@ void Sector::init(const Settings* settings, unsigned int iPhiSec, unsigned int i zOuterMaxSub_.push_back( zOuterMin_ + (i + 1)*subSecWidth); } */ - // If subsectors have equal width in rapidity, do this. - float subSecWidth = (etaMax_ - etaMin_)/float(numSubSecsEta_); - for (unsigned int i = 0; i < numSubSecsEta_; i++) { - float subSecEtaMin = etaMin_ + i * subSecWidth; - float subSecEtaMax = subSecEtaMin + subSecWidth; - float subSecZmin = chosenRofZ_ / tan( 2. * atan(exp(-subSecEtaMin)) ); - float subSecZmax = chosenRofZ_ / tan( 2. * atan(exp(-subSecEtaMax)) ); - zOuterMinSub_.push_back( subSecZmin ); - zOuterMaxSub_.push_back( subSecZmax ); + // If subsectors have equal width in rapidity, do this. + float subSecWidth = (etaMax_ - etaMin_) / float(numSubSecsEta_); + for (unsigned int i = 0; i < numSubSecsEta_; i++) { + float subSecEtaMin = etaMin_ + i * subSecWidth; + float subSecEtaMax = subSecEtaMin + subSecWidth; + float subSecZmin = chosenRofZ_ / tan(2. * atan(exp(-subSecEtaMin))); + float subSecZmax = chosenRofZ_ / tan(2. * atan(exp(-subSecEtaMax))); + zOuterMinSub_.push_back(subSecZmin); + zOuterMaxSub_.push_back(subSecZmax); + } } -} -//=== Check if stub is inside this eta region. + //=== Check if stub is inside this eta region. -bool Sector::insideEta( const Stub* stub ) const { - // Lower edge of this eta region defined by line from (r,z) = (0,-beamWindowZ) to (chosenRofZ_, zOuterMin_). - // Upper edge of this eta region defined by line from (r,z) = (0, beamWindowZ) to (chosenRofZ_, zOuterMax_). - - bool inside = this->insideEtaRange(stub, zOuterMin_, zOuterMax_); - return inside; -} + bool Sector::insideEta(const Stub* stub) const { + // Lower edge of this eta region defined by line from (r,z) = (0,-beamWindowZ) to (chosenRofZ_, zOuterMin_). + // Upper edge of this eta region defined by line from (r,z) = (0, beamWindowZ) to (chosenRofZ_, zOuterMax_). + bool inside = this->insideEtaRange(stub, zOuterMin_, zOuterMax_); + return inside; + } -//=== Check if stub is within subsectors in eta that sector may be divided into. + //=== Check if stub is within subsectors in eta that sector may be divided into. -vector Sector::insideEtaSubSecs( const Stub* stub) const { + vector Sector::insideEtaSubSecs(const Stub* stub) const { + if (settings_->enableDigitize() && numSubSecsEta_ == 2) { + // Use (complicated) digitized firmware emulation + return subEtaFwCalc(stub->digitalStub().iDigi_Rt(), stub->digitalStub().iDigi_Z()); - if (settings_->enableDigitize() && numSubSecsEta_ == 2) { - // Use (complicated) digitized firmware emulation - return subEtaFwCalc(stub->digitalStub().iDigi_Rt(), stub->digitalStub().iDigi_Z()); + } else { + // Use (simpler) floating point calculation. - } else { - // Use (simpler) floating point calculation. + vector insideVec; - vector insideVec; + // Loop over subsectors. + for (unsigned int i = 0; i < numSubSecsEta_; i++) { + bool inside = this->insideEtaRange(stub, zOuterMinSub_[i], zOuterMaxSub_[i]); + insideVec.push_back(inside); + } - // Loop over subsectors. - for (unsigned int i = 0; i < numSubSecsEta_; i++) { - bool inside = this->insideEtaRange(stub, zOuterMinSub_[i], zOuterMaxSub_[i]); - insideVec.push_back(inside); + return insideVec; } - - return insideVec; } -} -//=== Check if stub is within eta sector or subsector that is delimated by specified zTrk range. + //=== Check if stub is within eta sector or subsector that is delimated by specified zTrk range. + + bool Sector::insideEtaRange(const Stub* stub, float zRangeMin, float zRangeMax) const { + // Lower edge of this eta region defined by line from (r,z) = (0,-beamWindowZ) to (chosenRofZ_, zRangeMin). + // Upper edge of this eta region defined by line from (r,z) = (0, beamWindowZ) to (chosenRofZ_, zRangeMax). -bool Sector::insideEtaRange( const Stub* stub, float zRangeMin, float zRangeMax) const { - // Lower edge of this eta region defined by line from (r,z) = (0,-beamWindowZ) to (chosenRofZ_, zRangeMin). - // Upper edge of this eta region defined by line from (r,z) = (0, beamWindowZ) to (chosenRofZ_, zRangeMax). + float zMin, zMax; - float zMin, zMax; + bool inside; - bool inside; + if (!handleStripsEtaSec_) { + //--- Don't modify algorithm to allow for uncertainty in stub (r,z) coordinates caused by 2S module strip length? - if ( ! handleStripsEtaSec_) { - //--- Don't modify algorithm to allow for uncertainty in stub (r,z) coordinates caused by 2S module strip length? + // Calculate z coordinate of lower edge of this eta region, evaluated at radius of stub. + zMin = (zRangeMin * stub->r() - beamWindowZ_ * fabs(stub->r() - chosenRofZ_)) / chosenRofZ_; + // Calculate z coordinate of upper edge of this eta region, evaluated at radius of stub. + zMax = (zRangeMax * stub->r() + beamWindowZ_ * fabs(stub->r() - chosenRofZ_)) / chosenRofZ_; - // Calculate z coordinate of lower edge of this eta region, evaluated at radius of stub. - zMin = ( zRangeMin * stub->r() - beamWindowZ_ * fabs(stub->r() - chosenRofZ_) ) / chosenRofZ_; - // Calculate z coordinate of upper edge of this eta region, evaluated at radius of stub. - zMax = ( zRangeMax * stub->r() + beamWindowZ_ * fabs(stub->r() - chosenRofZ_) ) / chosenRofZ_; + // zMin = ( zRangeMin * stub->r() - beamWindowZ_ * fabs(stub->r() - rOuterMin_) ) / rOuterMin_; + // zMax = ( zRangeMax * stub->r() + beamWindowZ_ * fabs(stub->r() - rOuterMax_) ) / rOuterMax_; - // zMin = ( zRangeMin * stub->r() - beamWindowZ_ * fabs(stub->r() - rOuterMin_) ) / rOuterMin_; - // zMax = ( zRangeMax * stub->r() + beamWindowZ_ * fabs(stub->r() - rOuterMax_) ) / rOuterMax_; + inside = (stub->z() > zMin && stub->z() < zMax); - inside = (stub->z() > zMin && stub->z() < zMax); + } else { + //--- Do modify algorithm to allow for uncertainty in stub (r,z) coordinates caused by 2S module strip length? - } else { - //--- Do modify algorithm to allow for uncertainty in stub (r,z) coordinates caused by 2S module strip length? + float stubMinR = stub->r() - stub->rErr(); + float stubMaxR = stub->r() + stub->rErr(); + float stubMinZ = stub->z() - stub->zErr(); + float stubMaxZ = stub->z() + stub->zErr(); - float stubMinR = stub->r() - stub->rErr(); - float stubMaxR = stub->r() + stub->rErr(); - float stubMinZ = stub->z() - stub->zErr(); - float stubMaxZ = stub->z() + stub->zErr(); + // Calculate z coordinate of lower edge of this eta region, evaluated at radius of stub. + float rStubA = + (zRangeMin + beamWindowZ_) >= 0 + ? stubMinR + : stubMaxR; // stub r coordinate uncertain (especially in endcap), so use one which gives most -ve zMin. + zMin = -beamWindowZ_ + (rStubA / chosenRofZ_) * (zRangeMin + beamWindowZ_); - // Calculate z coordinate of lower edge of this eta region, evaluated at radius of stub. - float rStubA = (zRangeMin + beamWindowZ_) >= 0 ? stubMinR : stubMaxR; // stub r coordinate uncertain (especially in endcap), so use one which gives most -ve zMin. - zMin = -beamWindowZ_ + (rStubA / chosenRofZ_) * (zRangeMin + beamWindowZ_); + // Calculate z coordinate of upper edge of this eta region, evaluated at radius of stub. + float rStubB = + (zRangeMax - beamWindowZ_) >= 0 + ? stubMaxR + : stubMinR; // stub r coordinate uncertain (especially in endcap), so use one which gives most +ve zMax. + zMax = beamWindowZ_ + (rStubB / chosenRofZ_) * (zRangeMax - beamWindowZ_); - // Calculate z coordinate of upper edge of this eta region, evaluated at radius of stub. - float rStubB = (zRangeMax - beamWindowZ_) >= 0 ? stubMaxR : stubMinR; // stub r coordinate uncertain (especially in endcap), so use one which gives most +ve zMax. - zMax = beamWindowZ_ + (rStubB / chosenRofZ_) * (zRangeMax - beamWindowZ_); + inside = (stubMaxZ > zMin && stubMinZ < zMax); + } - inside = (stubMaxZ > zMin && stubMinZ < zMax); + return inside; } - return inside; -} + //=== Check if stub is inside this phi region. -//=== Check if stub is inside this phi region. + bool Sector::insidePhi(const Stub* stub) const { + // N.B. The logic here for preventing a stub being assigned to > 2 sectors seems overly agressive. + // But attempts at improving it have failed ... -bool Sector::insidePhi( const Stub* stub ) const { + bool okPhi = true; + bool okPhiTrk = true; - // N.B. The logic here for preventing a stub being assigned to > 2 sectors seems overly agressive. - // But attempts at improving it have failed ... + if (useStubPhi_) { + float delPhi = + reco::deltaPhi(stub->phi(), phiCentre_); // Phi difference between stub & sector in range -PI to +PI. + float tolerancePhi = stub->phiDiff( + chosenRofPhi_, minPt_); // How much stub phi might differ from track phi because of track curvature. + float outsidePhi = fabs(delPhi) - sectorHalfWidth_ - + tolerancePhi; // If > 0, then stub is not compatible with being inside this sector. + if (outsidePhi > 0) + okPhi = false; + } - bool okPhi = true; - bool okPhiTrk = true; + if (useStubPhiTrk_) { + // Estimate either phi0 of track from stub info, or phi of the track at radius chosenRofPhi_. + float phiTrk = stub->trkPhiAtR(chosenRofPhi_).first; // N.B. This equals stub->beta() if chosenRofPhi_ = 0. + float delPhiTrk = + reco::deltaPhi(phiTrk, phiCentre_); // Phi difference between stub & sector in range -PI to +PI. + float tolerancePhiTrk = + assumedPhiTrkRes_ * (2 * sectorHalfWidth_); // Set tolerance equal to nominal resolution assumed in phiTrk + if (calcPhiTrkRes_) { + // Calculate uncertainty in phiTrk due to poor resolution in stub bend + float phiTrkRes = stub->trkPhiAtRres(chosenRofPhi_); + // Reduce tolerance if this is smaller than the nominal assumed resolution. + tolerancePhiTrk = min(tolerancePhiTrk, phiTrkRes); + } + float outsidePhiTrk = fabs(delPhiTrk) - sectorHalfWidth_ - + tolerancePhiTrk; // If > 0, then stub is not compatible with being inside this sector. + + // Modify algorithm to allow for uncertainty due to 2S module strip length, if requested. + if (handleStripsPhiSec_) { + float chosenStubPhiErr = + stub->trkPhiAtR(chosenRofPhi_).second; // The "Err" here is uncertainty due to 2S strip length. + outsidePhiTrk -= chosenStubPhiErr; + } + + if (outsidePhiTrk > 0) + okPhiTrk = false; + } - if (useStubPhi_) { - float delPhi = reco::deltaPhi(stub->phi(), phiCentre_); // Phi difference between stub & sector in range -PI to +PI. - float tolerancePhi = stub->phiDiff(chosenRofPhi_, minPt_); // How much stub phi might differ from track phi because of track curvature. - float outsidePhi = fabs(delPhi) - sectorHalfWidth_ - tolerancePhi; // If > 0, then stub is not compatible with being inside this sector. - if (outsidePhi > 0) okPhi = false; + return (okPhi && okPhiTrk); } - if (useStubPhiTrk_) { - // Estimate either phi0 of track from stub info, or phi of the track at radius chosenRofPhi_. - float phiTrk = stub->trkPhiAtR( chosenRofPhi_ ).first; // N.B. This equals stub->beta() if chosenRofPhi_ = 0. - float delPhiTrk = reco::deltaPhi(phiTrk, phiCentre_); // Phi difference between stub & sector in range -PI to +PI. - float tolerancePhiTrk = assumedPhiTrkRes_ * (2*sectorHalfWidth_); // Set tolerance equal to nominal resolution assumed in phiTrk - if (calcPhiTrkRes_) { - // Calculate uncertainty in phiTrk due to poor resolution in stub bend - float phiTrkRes = stub->trkPhiAtRres( chosenRofPhi_ ); - // Reduce tolerance if this is smaller than the nominal assumed resolution. - tolerancePhiTrk = min(tolerancePhiTrk, phiTrkRes); + //=== For performance studies, note which stubs on given tracking particle are inside the sector. + //=== Returns two booleans for each stub, indicating if they are in phi & eta sectors respectively. + //=== AND them together to get (eta,phi) sector decision. + + unordered_map > Sector::stubsInside(const TP& tp) const { + unordered_map > inside; + // Loop over stubs produced by tracking particle + const vector& assStubs = tp.assocStubs(); + for (const Stub* stub : assStubs) { + // Check if this stub is inside sector + inside[stub] = pair(this->insidePhi(stub), this->insideEta(stub)); } - float outsidePhiTrk = fabs(delPhiTrk) - sectorHalfWidth_ - tolerancePhiTrk; // If > 0, then stub is not compatible with being inside this sector. + return inside; + } - // Modify algorithm to allow for uncertainty due to 2S module strip length, if requested. - if (handleStripsPhiSec_) { - float chosenStubPhiErr = stub->trkPhiAtR( chosenRofPhi_ ).second; // The "Err" here is uncertainty due to 2S strip length. - outsidePhiTrk -= chosenStubPhiErr; + //=== Count number of stubs in given tracking particle which are inside this (phi,eta) sector; + //=== or inside it if only the eta cuts are applied; or inside it if only the phi cuts are applied. + //=== The results are returned as the 3 last arguments of the function. + + void Sector::numStubsInside(const TP& tp, + unsigned int& nStubsInsideEtaPhi, + unsigned int& nStubsInsideEta, + unsigned int& nStubsInsidePhi) const { + nStubsInsideEtaPhi = 0; + nStubsInsideEta = 0; + nStubsInsidePhi = 0; + for (const auto& iter : this->stubsInside(tp)) { + bool insidePhi = iter.second.first; + bool insideEta = iter.second.second; + if (insidePhi && insideEta) + nStubsInsideEtaPhi++; + if (insideEta) + nStubsInsideEta++; + if (insidePhi) + nStubsInsidePhi++; } - - if (outsidePhiTrk > 0) okPhiTrk = false; } - return (okPhi && okPhiTrk); -} + // Digitize a floating point number to 2s complement integer, dropping anything after the decimal point. (Kristian Harder) + + Long64_t Sector::forceBitWidth(const float value, const UInt_t nBits) const { + // slightly hand-waving treatment of 2s complement + Long64_t sign = 1; + if (value < 0) + sign = -1; + Long64_t iValue = Long64_t(fabs(value)); + Long64_t mask = (Long64_t(1) << nBits) - Long64_t(1); + Long64_t result = sign * (iValue & mask); + if (fabs(result - value) > 1) + throw cms::Exception("Sector::forceBitWidth is messing by using too few bits to digitize number") + << " nBits=" << nBits << " Input float=" << value << " Output digi = " << result << endl; + return result; + // Check that result is compatible with value. Throw error if not. + } -//=== For performance studies, note which stubs on given tracking particle are inside the sector. -//=== Returns two booleans for each stub, indicating if they are in phi & eta sectors respectively. -//=== AND them together to get (eta,phi) sector decision. + //=== Check if stub is within subsectors in eta that sector may be divided into. Uses digitized calculation corresponding to GP firmware. (Kristian Harder) + //=== Modified to configurable number of rT and z digisation bits by Ian, with advice from Luis. + + vector Sector::subEtaFwCalc(const int rT, const int z) const { + // Note number of reference bits used to digitize rT and z, used when GP authors determined some constants below. + unsigned int rtBitsRef = 10; + unsigned int zBitsRef = 12; + + // This replaces Kristian's hard-wired constants with configurable ones. + unsigned int rtBits = settings_->rtBits(); + unsigned int zBits = settings_->zBits(); + float rtRange = settings_->rtRange(); + float zRange = settings_->zRange(); + const float cm_to_mm = 10.; // firwmare is in mm and CMSSW in cm. + float zBase = cm_to_mm / (pow(2, zBits) / zRange); + float rTBase = cm_to_mm / (pow(2, rtBits) / rtRange); + + // Number of bits used by DSP in Virtex7 FPGA (where DSP does D = A*B + C) + const unsigned int nDSPa = 25; + const unsigned int nDSPb = 18; + const unsigned int nDSPc = 48; + const unsigned int nDSPd = 48; + + // unit transformations: firmware uses mm, software uses cm + float BeamWindow = cm_to_mm * beamWindowZ_; + float T_rphi = cm_to_mm * chosenRofPhi_; + float T_rz = cm_to_mm * chosenRofZ_; + + // actual algorithm as used in firmware, mostly using same variable names + float Beam_over_T = BeamWindow / T_rz; + unsigned int nShiftA = + 24; // Chosen by hand so that number digitized below when calculating "bot" uses most of the nDSPa bits, without overflowing them. This is done assuming reference number of bits for rT and z mentioned above. + nShiftA += + (rtBits - rtBitsRef) - + (zBits - + zBitsRef); // Guess from Ian & Luis to keep "bot" in correct range (nDSPa) if number of digitsation bits are changed. + float Beam_over_T_base = 1. / (1 << nShiftA); + Long64_t bot = forceBitWidth(Beam_over_T * rTBase / zBase / Beam_over_T_base, nDSPa); + Long64_t bw = forceBitWidth(BeamWindow / zBase / Beam_over_T_base, nDSPc); + float etaSecMid = (settings_->etaRegions()[iEtaReg_] + settings_->etaRegions()[iEtaReg_ + 1]) / 2.0; + float tanlSecMid = 1.0 / tan(2.0 * atan(exp(-etaSecMid))); + unsigned int nShiftB = + 16; // Chosen by hand so that number digitized below when calculating "tanlSec_Mid" uses most of the nDSPa bits, without overflowing them. This is done assuming reference number of bits for rT and z mentioned above. + nShiftB += + (rtBits - rtBitsRef) - + (zBits - + zBitsRef); // Guess from Ian & Luis to keep "tanlSec_Mid" in correct range (nDSPa) if number of digitsation bits are changed. + float tanlSecBase = 1. / (1 << nShiftB); + Long64_t tanlSec_Mid = + forceBitWidth(int(tanlSecMid * rTBase / zBase / tanlSecBase), nDSPa); // 25 is a constant due to DSP + + const unsigned int nExtraBitsR = + 2; // Number of extra bits used to digitise r instead of rT within GP code, if both encoded as signed int. + const unsigned int rBits = rtBits + nExtraBitsR; + Long64_t r = forceBitWidth(rT + T_rphi / rTBase, rBits); + Long64_t g = forceBitWidth(bot * r - bw, nDSPd); + Long64_t absg = abs(g); + const unsigned nBitsRemainingA = + nDSPd - + nShiftA; // Number of useful bits left of the nDSPd assigned to "absg" after right-shifting by nShiftA bits. + Long64_t shift_g = forceBitWidth((absg >> nShiftA), nBitsRemainingA); + Long64_t tlsr = forceBitWidth(tanlSec_Mid * r, + nDSPa + rBits); // Number of bits is sum of those in two numbers being multiplied. + const unsigned nBitsRemainingB = + (nDSPa + rBits) - + nShiftB; // Number of useful bits left of (nDSPa + rBits) assigned to "tlsr" after right-shifting by nShiftB bits. + Long64_t shift_tlsr = forceBitWidth((tlsr >> nShiftB), nBitsRemainingB); -unordered_map > Sector::stubsInside ( const TP& tp) const { - unordered_map > inside; - // Loop over stubs produced by tracking particle - const vector& assStubs= tp.assocStubs(); - for (const Stub* stub: assStubs) { - // Check if this stub is inside sector - inside[stub] = pair(this->insidePhi(stub), this->insideEta(stub)); - } - return inside; -} - -//=== Count number of stubs in given tracking particle which are inside this (phi,eta) sector; -//=== or inside it if only the eta cuts are applied; or inside it if only the phi cuts are applied. -//=== The results are returned as the 3 last arguments of the function. - -void Sector::numStubsInside( const TP& tp, - unsigned int& nStubsInsideEtaPhi, unsigned int& nStubsInsideEta, - unsigned int& nStubsInsidePhi) const -{ - nStubsInsideEtaPhi = 0; - nStubsInsideEta = 0; - nStubsInsidePhi = 0; - for (const auto& iter: this->stubsInside(tp) ) { - bool insidePhi = iter.second.first; - bool insideEta = iter.second.second; - if (insidePhi && insideEta) nStubsInsideEtaPhi++; - if (insideEta) nStubsInsideEta++; - if (insidePhi) nStubsInsidePhi++; + vector insideVec; + insideVec.push_back(z <= (shift_tlsr + shift_g)); + insideVec.push_back(z >= (shift_tlsr - shift_g)); + return insideVec; } -} - -// Digitize a floating point number to 2s complement integer, dropping anything after the decimal point. (Kristian Harder) - -Long64_t Sector::forceBitWidth( const float value, const UInt_t nBits) const { - - // slightly hand-waving treatment of 2s complement - Long64_t sign = 1; - if (value<0) sign = -1; - Long64_t iValue = Long64_t(fabs(value)); - Long64_t mask = (Long64_t(1)< 1) throw cms::Exception("Sector::forceBitWidth is messing by using too few bits to digitize number")<<" nBits="<etaRegions()[iEtaReg_] + settings_->etaRegions()[iEtaReg_ + 1]) / 2.0; - float tanlSecMid = 1.0 / tan(2.0*atan(exp(-etaSecMid))); - unsigned int nShiftB = 16; // Chosen by hand so that number digitized below when calculating "tanlSec_Mid" uses most of the nDSPa bits, without overflowing them. This is done assuming reference number of bits for rT and z mentioned above. - nShiftB += (rtBits - rtBitsRef) - (zBits - zBitsRef); // Guess from Ian & Luis to keep "tanlSec_Mid" in correct range (nDSPa) if number of digitsation bits are changed. - float tanlSecBase=1./(1<>nShiftA), nBitsRemainingA); - Long64_t tlsr=forceBitWidth(tanlSec_Mid*r, nDSPa + rBits); // Number of bits is sum of those in two numbers being multiplied. - const unsigned nBitsRemainingB = (nDSPa + rBits) - nShiftB; // Number of useful bits left of (nDSPa + rBits) assigned to "tlsr" after right-shifting by nShiftB bits. - Long64_t shift_tlsr = forceBitWidth((tlsr>>nShiftB), nBitsRemainingB); - - vector insideVec; - insideVec.push_back(z<=(shift_tlsr+shift_g)); - insideVec.push_back(z>=(shift_tlsr-shift_g)); - return insideVec; -} - -} + +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/Settings.cc b/L1Trigger/TrackFindingTMTT/src/Settings.cc index 02b9f5bbbdfc7..36e0f8a3ba089 100644 --- a/L1Trigger/TrackFindingTMTT/src/Settings.cc +++ b/L1Trigger/TrackFindingTMTT/src/Settings.cc @@ -5,455 +5,504 @@ namespace TMTT { -// Set config params for HYBRID TRACKING via hard-wired consts to allow use outside CMSSW. - -Settings::Settings() { - // - // TMTT related configuration parameters, including Kalman Filter. - // Meaning of these parameters explained in TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py - // - reduceLayerID_=true; - useLayerID_=true; - minFracMatchStubsOnReco_=-99; - minFracMatchStubsOnTP_=-99; - minNumMatchLayers_=4; - minNumMatchPSLayers_=0; - stubMatchStrict_=false; - minStubLayers_=4; - minPtToReduceLayers_=99999.; - deadReduceLayers_=false; - kalmanMinNumStubs_=4; - kalmanMaxNumStubs_=6; - numPhiNonants_=9; - numPhiSectors_=9; - 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}; // Used by KF - kalmanRemove2PScut_=true; - killScenario_=0; - kalmanMaxSkipLayersHard_=1; // On "hard" input tracks - kalmanMaxSkipLayersEasy_=2; // On "easy" input tracks - kalmanMaxStubsEasy_=10; // Max. #stubs an input track can have to be defined "easy" - kalmanMaxStubsPerLayer_=4; // To save resources, consider at most this many stubs per layer per track. - kalmanDebugLevel_=0; - //kalmanDebugLevel_=2; // Good for debugging - enableDigitize_=false; - houghMinPt_=2.0; - chosenRofPhi_=67.240; - chosenRofZ_=50.0; - houghNbinsPt_=48; // Mini HT bins in 2 GeV HT array - handleStripsPhiSec_=1; - useApproxB_=true; - kalmanHOtilted_=true; - kalmanHOhelixExp_=true; - kalmanHOalpha_=1; - kalmanHOdodgy_=false; - kalmanHOprojZcorr_=1; - bApprox_gradient_=0.886454; - bApprox_intercept_=0.504148; - handleStripsEtaSec_=false; - kalmanFillInternalHists_=false; - kalmanMultiScattTerm_=0.00075; - kalmanChi2RphiScale_ = 8; - // - // Cfg params & constants required only for HYBRID tracking (as taken from DB for TMTT). - // - hybrid_=true; - psStripPitch_=0.01; - psNStrips_=960; - psPixelLength_=0.1467; - ssStripPitch_=0.009; - ssNStrips_=1016; - ssStripLength_=5.0250; - zMaxNonTilted_[1] = 15.3; // max z at which non-tilted modules are found in inner 3 barrel layers. - zMaxNonTilted_[2] = 24.6; - zMaxNonTilted_[3] = 33.9; - - bField_=3.81120228767395; - - // Stub digitization params for hybrid (copied from TrackFindingTMTT/interface/HLS/KFconstants.h - double rMult_hybrid = 1. / 0.02929688; - double phiSMult_hybrid = 1. / (7.828293e-6 * 8); - double zMult_hybrid = rMult_hybrid / 2; // In KF VHDL, z/r mult = 1/2, whereas in HLS, they are identical. - // Number of bits copied from TrackFindingTMTT/interface/HLS/KFstub.h (BR1, BPHI, BZ) - rtBits_ = 12; - phiSBits_ = 14; - zBits_ = 14; - rtRange_ = pow(2,rtBits_)/rMult_hybrid; - phiSRange_ = pow(2,phiSBits_)/phiSMult_hybrid; - zRange_ = pow(2,zBits_)/zMult_hybrid; - - if (hybrid_) { - if (not useApproxB_) { - std::cout<<"TMTT Settings Error: module tilt angle unknown, so must set useApproxB = true"< ( "GenCuts" ) ), - stubCuts_ ( iConfig.getParameter< edm::ParameterSet > ( "StubCuts" ) ), - stubDigitize_ ( iConfig.getParameter< edm::ParameterSet > ( "StubDigitize" ) ), - geometricProc_ ( iConfig.getParameter< edm::ParameterSet > ( "GeometricProc" ) ), - phiSectors_ ( iConfig.getParameter< edm::ParameterSet > ( "PhiSectors" ) ), - etaSectors_ ( iConfig.getParameter< edm::ParameterSet > ( "EtaSectors" ) ), - htArraySpecRphi_ ( iConfig.getParameter< edm::ParameterSet > ( "HTArraySpecRphi" ) ), - htFillingRphi_ ( iConfig.getParameter< edm::ParameterSet > ( "HTFillingRphi" ) ), - rzFilterOpts_ ( iConfig.getParameter< edm::ParameterSet > ( "RZfilterOpts" ) ), - l1TrackDef_ ( iConfig.getParameter< edm::ParameterSet > ( "L1TrackDef" ) ), - dupTrkRemoval_ ( iConfig.getParameter< edm::ParameterSet > ( "DupTrkRemoval" ) ), - trackMatchDef_ ( iConfig.getParameter< edm::ParameterSet > ( "TrackMatchDef" ) ), - trackFitSettings_ ( iConfig.getParameter< edm::ParameterSet > ( "TrackFitSettings" ) ), - deadModuleOpts_ ( iConfig.getParameter< edm::ParameterSet > ( "DeadModuleOpts" ) ), - trackDigi_ ( iConfig.getParameter< edm::ParameterSet > ( "TrackDigi" ) ), - - //=== General settings - - enableMCtruth_ ( iConfig.getParameter ( "EnableMCtruth" ) ), - enableHistos_ ( iConfig.getParameter ( "EnableHistos" ) ), - - //=== Cuts on MC truth tracks used for tracking efficiency measurements. - - genMinPt_ ( genCuts_.getParameter ( "GenMinPt" ) ), - genMaxAbsEta_ ( genCuts_.getParameter ( "GenMaxAbsEta" ) ), - genMaxVertR_ ( genCuts_.getParameter ( "GenMaxVertR" ) ), - genMaxVertZ_ ( genCuts_.getParameter ( "GenMaxVertZ" ) ), - genMaxD0_ ( genCuts_.getParameter ( "GenMaxD0" ) ), - genMaxZ0_ ( genCuts_.getParameter ( "GenMaxZ0" ) ), - genMinStubLayers_ ( genCuts_.getParameter ( "GenMinStubLayers" ) ), - - //=== Cuts applied to stubs before arriving in L1 track finding board. - - degradeBendRes_ ( stubCuts_.getParameter ( "DegradeBendRes" ) ), - maxStubEta_ ( stubCuts_.getParameter ( "MaxStubEta" ) ), - killLowPtStubs_ ( stubCuts_.getParameter ( "KillLowPtStubs" ) ), - printStubWindows_ ( stubCuts_.getParameter ( "PrintStubWindows" ) ), - bendResolution_ ( stubCuts_.getParameter ( "BendResolution" ) ), - bendResolutionExtra_ ( stubCuts_.getParameter ( "BendResolutionExtra" ) ), - orderStubsByBend_ ( stubCuts_.getParameter ( "OrderStubsByBend" ) ), - - //=== Optional stub digitization. - - enableDigitize_ ( stubDigitize_.getParameter ( "EnableDigitize" ) ), - - //--- Parameters available in MP board. - phiSectorBits_ ( stubDigitize_.getParameter ( "PhiSectorBits" ) ), - phiSBits_ ( stubDigitize_.getParameter ( "PhiSBits" ) ), - phiSRange_ ( stubDigitize_.getParameter ( "PhiSRange" ) ), - rtBits_ ( stubDigitize_.getParameter ( "RtBits" ) ), - rtRange_ ( stubDigitize_.getParameter ( "RtRange" ) ), - zBits_ ( stubDigitize_.getParameter ( "ZBits" ) ), - zRange_ ( stubDigitize_.getParameter ( "ZRange" ) ), - //--- Parameters available in GP board (excluding any in common with MP specified above). - phiOBits_ ( stubDigitize_.getParameter ( "PhiOBits" ) ), - phiORange_ ( stubDigitize_.getParameter ( "PhiORange" ) ), - bendBits_ ( stubDigitize_.getParameter ( "BendBits" ) ), - - //=== Configuration of Geometric Processor. - useApproxB_ ( geometricProc_.getParameter ( "UseApproxB" ) ), - bApprox_gradient_ ( geometricProc_.getParameter ( "BApprox_gradient" ) ), - bApprox_intercept_ ( geometricProc_.getParameter ( "BApprox_intercept" ) ), - - //=== Division of Tracker into phi sectors. - numPhiNonants_ ( phiSectors_.getParameter ( "NumPhiNonants" ) ), - numPhiSectors_ ( phiSectors_.getParameter ( "NumPhiSectors" ) ), - chosenRofPhi_ ( phiSectors_.getParameter ( "ChosenRofPhi" ) ), - useStubPhi_ ( phiSectors_.getParameter ( "UseStubPhi" ) ), - useStubPhiTrk_ ( phiSectors_.getParameter ( "UseStubPhiTrk" ) ), - assumedPhiTrkRes_ ( phiSectors_.getParameter ( "AssumedPhiTrkRes" ) ), - calcPhiTrkRes_ ( phiSectors_.getParameter ( "CalcPhiTrkRes" ) ), - handleStripsPhiSec_ ( phiSectors_.getParameter ( "HandleStripsPhiSec" ) ), - - //=== Division of Tracker into eta sectors. - etaRegions_ ( etaSectors_.getParameter > ( "EtaRegions" ) ), - chosenRofZ_ ( etaSectors_.getParameter ( "ChosenRofZ" ) ), - beamWindowZ_ ( etaSectors_.getParameter ( "BeamWindowZ" ) ), - handleStripsEtaSec_ ( etaSectors_.getParameter ( "HandleStripsEtaSec" ) ), - allowOver2EtaSecs_ ( etaSectors_.getParameter ( "AllowOver2EtaSecs" ) ), - - //=== r-phi Hough transform array specifications. - houghMinPt_ ( htArraySpecRphi_.getParameter ( "HoughMinPt" ) ), - houghNbinsPt_ ( htArraySpecRphi_.getParameter ( "HoughNbinsPt" ) ), - houghNbinsPhi_ ( htArraySpecRphi_.getParameter ( "HoughNbinsPhi" ) ), - houghNcellsRphi_ ( htArraySpecRphi_.getParameter ( "HoughNcellsRphi" ) ), - enableMerge2x2_ ( htArraySpecRphi_.getParameter ( "EnableMerge2x2" ) ), - maxPtToMerge2x2_ ( htArraySpecRphi_.getParameter ( "MaxPtToMerge2x2" ) ), - numSubSecsEta_ ( htArraySpecRphi_.getParameter ( "NumSubSecsEta" ) ), - shape_ ( htArraySpecRphi_.getParameter ( "Shape" ) ), - miniHTstage_ ( htArraySpecRphi_.getParameter ( "MiniHTstage" ) ), - miniHoughNbinsPt_ ( htArraySpecRphi_.getParameter ( "MiniHoughNbinsPt" ) ), - miniHoughNbinsPhi_ ( htArraySpecRphi_.getParameter ( "MiniHoughNbinsPhi" ) ), - miniHoughMinPt_ ( htArraySpecRphi_.getParameter ( "MiniHoughMinPt" ) ), - miniHoughDontKill_ ( htArraySpecRphi_.getParameter ( "MiniHoughDontKill" ) ), - miniHoughDontKillMinPt_ ( htArraySpecRphi_.getParameter ( "MiniHoughDontKillMinPt" ) ), - miniHoughLoadBalance_ ( htArraySpecRphi_.getParameter ( "MiniHoughLoadBalance" ) ), - - //=== Rules governing how stubs are filled into the r-phi Hough Transform array. - handleStripsRphiHT_ ( htFillingRphi_.getParameter ( "HandleStripsRphiHT" ) ), - killSomeHTCellsRphi_ ( htFillingRphi_.getParameter ( "KillSomeHTCellsRphi" ) ), - useBendFilter_ ( htFillingRphi_.getParameter ( "UseBendFilter" ) ), - maxStubsInCell_ ( htFillingRphi_.getParameter ( "MaxStubsInCell" ) ), - maxStubsInCellMiniHough_( htFillingRphi_.getParameter ( "MaxStubsInCellMiniHough") ), - busySectorKill_ ( htFillingRphi_.getParameter ( "BusySectorKill" ) ), - busySectorNumStubs_ ( htFillingRphi_.getParameter ( "BusySectorNumStubs" ) ), - busySectorMbinRanges_ ( htFillingRphi_.getParameter> ( "BusySectorMbinRanges" ) ), - busySectorMbinOrder_ ( htFillingRphi_.getParameter> ( "BusySectorMbinOrder" ) ), - busyInputSectorKill_ ( htFillingRphi_.getParameter ( "BusyInputSectorKill" ) ), - busyInputSectorNumStubs_( htFillingRphi_.getParameter ( "BusyInputSectorNumStubs") ), - muxOutputsHT_ ( htFillingRphi_.getParameter ( "MuxOutputsHT" ) ), - etaRegWhitelist_ ( htFillingRphi_.getParameter< vector > ( "EtaRegWhitelist" ) ), - - //=== Options controlling r-z track filters (or any other track filters run after the Hough transform, as opposed to inside it). - - rzFilterName_ ( rzFilterOpts_.getParameter ( "RZFilterName" ) ), - seedResolution_ ( rzFilterOpts_.getParameter ( "SeedResolution" ) ), - keepAllSeed_ ( rzFilterOpts_.getParameter ( "KeepAllSeed" ) ), - maxSeedCombinations_ ( rzFilterOpts_.getParameter ( "MaxSeedCombinations" ) ), - maxGoodSeedCombinations_( rzFilterOpts_.getParameter ( "MaxGoodSeedCombinations") ), - maxSeedsPerStub_ ( rzFilterOpts_.getParameter ( "MaxSeedsPerStub" ) ), - zTrkSectorCheck_ ( rzFilterOpts_.getParameter ( "zTrkSectorCheck" ) ), - minFilterLayers_ ( rzFilterOpts_.getParameter ( "MinFilterLayers" ) ), - - //=== Rules for deciding when the track finding has found an L1 track candidate - - minStubLayers_ ( l1TrackDef_.getParameter ( "MinStubLayers" ) ), - minPtToReduceLayers_ ( l1TrackDef_.getParameter ( "MinPtToReduceLayers" ) ), - etaSecsReduceLayers_ ( l1TrackDef_.getParameter> ( "EtaSecsReduceLayers" ) ), - useLayerID_ ( l1TrackDef_.getParameter ( "UseLayerID" ) ), - reduceLayerID_ ( l1TrackDef_.getParameter ( "ReducedLayerID" ) ), - - //=== Specification of algorithm to eliminate duplicate tracks. - - dupTrkAlgRphi_ ( dupTrkRemoval_.getParameter ( "DupTrkAlgRphi" ) ), - dupTrkAlg3D_ ( dupTrkRemoval_.getParameter ( "DupTrkAlg3D" ) ), - dupTrkAlgFit_ ( dupTrkRemoval_.getParameter ( "DupTrkAlgFit" ) ), - dupTrkMinCommonHitsLayers_ ( dupTrkRemoval_.getParameter ( "DupTrkMinCommonHitsLayers" ) ), - - //=== Rules for deciding when a reconstructed L1 track matches a MC truth particle (i.e. tracking particle). - - minFracMatchStubsOnReco_( trackMatchDef_.getParameter ( "MinFracMatchStubsOnReco") ), - minFracMatchStubsOnTP_ ( trackMatchDef_.getParameter ( "MinFracMatchStubsOnTP" ) ), - minNumMatchLayers_ ( trackMatchDef_.getParameter ( "MinNumMatchLayers" ) ), - minNumMatchPSLayers_ ( trackMatchDef_.getParameter ( "MinNumMatchPSLayers" ) ), - stubMatchStrict_ ( trackMatchDef_.getParameter ( "StubMatchStrict" ) ), - - //=== Track Fitting Settings - - trackFitters_ ( trackFitSettings_.getParameter> ( "TrackFitters" ) ), - useRZfilter_ ( trackFitSettings_.getParameter> ( "UseRZfilter" ) ), - detailedFitOutput_ ( trackFitSettings_.getParameter < bool > ( "DetailedFitOutput" ) ), - trackFitCheat_ ( trackFitSettings_.getParameter < bool > ( "TrackFitCheat" ) ), - // - numTrackFitIterations_ ( trackFitSettings_.getParameter ( "NumTrackFitIterations" ) ), - killTrackFitWorstHit_ ( trackFitSettings_.getParameter ( "KillTrackFitWorstHit" ) ), - generalResidualCut_ ( trackFitSettings_.getParameter ( "GeneralResidualCut" ) ), - killingResidualCut_ ( trackFitSettings_.getParameter ( "KillingResidualCut" ) ), - maxIterationsLR_ ( trackFitSettings_.getParameter ( "MaxIterationsLR" ) ), - LRFillInternalHists_ ( trackFitSettings_.getParameter ( "LRFillInternalHists" ) ), - combineResiduals_ ( trackFitSettings_.getParameter< bool > ( "CombineResiduals" ) ), - lineariseStubPosition_ ( trackFitSettings_.getParameter< bool > ( "LineariseStubPosition" ) ), - checkSectorConsistency_ ( trackFitSettings_.getParameter< bool > ( "CheckSectorConsistency" ) ), - checkHTCellConsistency_ ( trackFitSettings_.getParameter< bool > ( "CheckHTCellConsistency" ) ), - minPSLayers_ ( trackFitSettings_.getParameter< unsigned int > ( "MinPSLayers" ) ), - digitizeLR_ ( trackFitSettings_.getParameter< bool > ( "DigitizeLR" ) ), - PhiPrecision_ ( trackFitSettings_.getParameter< double > ( "PhiPrecision" ) ), - RPrecision_ ( trackFitSettings_.getParameter< double > ( "RPrecision" ) ), - ZPrecision_ ( trackFitSettings_.getParameter< double > ( "ZPrecision" ) ), - ZSlopeWidth_ ( trackFitSettings_.getParameter< unsigned int > ( "ZSlopeWidth" ) ), - ZInterceptWidth_ ( trackFitSettings_.getParameter< unsigned int > ( "ZInterceptWidth" ) ), - // - digitizeSLR_ ( trackFitSettings_.getParameter ( "DigitizeSLR" ) ), - dividerBitsHelix_ ( trackFitSettings_.getParameter ( "DividerBitsHelix" ) ), - dividerBitsHelixZ_ ( trackFitSettings_.getParameter ( "DividerBitsHelixZ" ) ), - ShiftingBitsDenRPhi_ ( trackFitSettings_.getParameter ( "ShiftingBitsDenRPhi" ) ), - ShiftingBitsDenRZ_ ( trackFitSettings_.getParameter ( "ShiftingBitsDenRZ" ) ), - ShiftingBitsPt_ ( trackFitSettings_.getParameter ( "ShiftingBitsPt" ) ), - ShiftingBitsPhi_ ( trackFitSettings_.getParameter ( "ShiftingBitsPhi" ) ), - - ShiftingBitsLambda_ ( trackFitSettings_.getParameter ( "ShiftingBitsLambda" ) ), - ShiftingBitsZ0_ ( trackFitSettings_.getParameter ( "ShiftingBitsZ0" ) ), - slr_chi2cut_ ( trackFitSettings_.getParameter ( "SLR_chi2cut" ) ), - residualCut_ ( trackFitSettings_.getParameter ( "ResidualCut" ) ), - // - kalmanDebugLevel_ ( trackFitSettings_.getParameter ( "KalmanDebugLevel" ) ), - kalmanFillInternalHists_ ( trackFitSettings_.getParameter ( "KalmanFillInternalHists") ), - kalmanMinNumStubs_ ( trackFitSettings_.getParameter ( "KalmanMinNumStubs" ) ), - kalmanMaxNumStubs_ ( trackFitSettings_.getParameter ( "KalmanMaxNumStubs" ) ), - kalmanAddBeamConstr_ ( trackFitSettings_.getParameter ( "KalmanAddBeamConstr" ) ), - kalmanRemove2PScut_ ( trackFitSettings_.getParameter ( "KalmanRemove2PScut" ) ), - kalmanMaxSkipLayersHard_ ( trackFitSettings_.getParameter ( "KalmanMaxSkipLayersHard") ), - kalmanMaxSkipLayersEasy_ ( trackFitSettings_.getParameter ( "KalmanMaxSkipLayersEasy") ), - kalmanMaxStubsEasy_ ( trackFitSettings_.getParameter ( "KalmanMaxStubsEasy" ) ), - kalmanMaxStubsPerLayer_ ( trackFitSettings_.getParameter ( "KalmanMaxStubsPerLayer" ) ), - kalmanMultiScattTerm_ ( trackFitSettings_.getParameter ( "KalmanMultiScattTerm" ) ), - kalmanChi2RphiScale_ ( trackFitSettings_.getParameter ( "KalmanChi2RphiScale" ) ), - kalmanHOtilted_ ( trackFitSettings_.getParameter ( "KalmanHOtilted" ) ), - kalmanHOhelixExp_ ( trackFitSettings_.getParameter ( "KalmanHOhelixExp" ) ), - kalmanHOalpha_ ( trackFitSettings_.getParameter ( "KalmanHOalpha" ) ), - kalmanHOprojZcorr_ ( trackFitSettings_.getParameter ( "KalmanHOprojZcorr" ) ), - kalmanHOdodgy_ ( trackFitSettings_.getParameter ( "KalmanHOdodgy" ) ), - - //=== Treatment of dead modules. - - deadReduceLayers_ (deadModuleOpts_.getParameter ( "DeadReduceLayers" ) ), - deadSimulateFrac_ (deadModuleOpts_.getParameter ( "DeadSimulateFrac" ) ), - killScenario_ (deadModuleOpts_.getParameter ( "KillScenario" ) ), - killRecover_ (deadModuleOpts_.getParameter ( "KillRecover" ) ), - - //=== Track digitisation configuration for various track fitters - - slr_skipTrackDigi_ (trackDigi_.getParameter ( "SLR_skipTrackDigi" ) ), - slr_oneOver2rBits_ (trackDigi_.getParameter ( "SLR_oneOver2rBits" ) ), - slr_oneOver2rRange_ (trackDigi_.getParameter ( "SLR_oneOver2rRange" ) ), - slr_d0Bits_ (trackDigi_.getParameter ( "SLR_d0Bits" ) ), - slr_d0Range_ (trackDigi_.getParameter ( "SLR_d0Range" ) ), - slr_phi0Bits_ (trackDigi_.getParameter ( "SLR_phi0Bits" ) ), - slr_phi0Range_ (trackDigi_.getParameter ( "SLR_phi0Range" ) ), - slr_z0Bits_ (trackDigi_.getParameter ( "SLR_z0Bits" ) ), - slr_z0Range_ (trackDigi_.getParameter ( "SLR_z0Range" ) ), - slr_tanlambdaBits_ (trackDigi_.getParameter ( "SLR_tanlambdaBits" ) ), - slr_tanlambdaRange_ (trackDigi_.getParameter ( "SLR_tanlambdaRange" ) ), - slr_chisquaredBits_ (trackDigi_.getParameter ( "SLR_chisquaredBits" ) ), - slr_chisquaredRange_ (trackDigi_.getParameter ( "SLR_chisquaredRange" ) ), - // - kf_skipTrackDigi_ (trackDigi_.getParameter ( "KF_skipTrackDigi" ) ), - kf_oneOver2rBits_ (trackDigi_.getParameter ( "KF_oneOver2rBits" ) ), - kf_oneOver2rRange_ (trackDigi_.getParameter ( "KF_oneOver2rRange" ) ), - kf_d0Bits_ (trackDigi_.getParameter ( "KF_d0Bits" ) ), - kf_d0Range_ (trackDigi_.getParameter ( "KF_d0Range" ) ), - kf_phi0Bits_ (trackDigi_.getParameter ( "KF_phi0Bits" ) ), - kf_phi0Range_ (trackDigi_.getParameter ( "KF_phi0Range" ) ), - kf_z0Bits_ (trackDigi_.getParameter ( "KF_z0Bits" ) ), - kf_z0Range_ (trackDigi_.getParameter ( "KF_z0Range" ) ), - kf_tanlambdaBits_ (trackDigi_.getParameter ( "KF_tanlambdaBits" ) ), - kf_tanlambdaRange_ (trackDigi_.getParameter ( "KF_tanlambdaRange" ) ), - kf_chisquaredBits_ (trackDigi_.getParameter ( "KF_chisquaredBits" ) ), - kf_chisquaredRange_ (trackDigi_.getParameter ( "KF_chisquaredRange" ) ), - kf_chisquaredBinEdges_ (trackDigi_.getParameter > ( "KF_chisquaredBinEdges" ) ), - // - other_skipTrackDigi_ (trackDigi_.getParameter ( "Other_skipTrackDigi" ) ), - - // Debug printout - debug_ ( iConfig.getParameter ( "Debug" ) ), - resPlotOpt_ ( iConfig.getParameter ( "ResPlotOpt" ) ), - iPhiPlot_ ( iConfig.getParameter ( "iPhiPlot" ) ), - iEtaPlot_ ( iConfig.getParameter ( "iEtaPlot" ) ), - - // Name of output EDM file if any. - // N.B. This parameter does not appear inside TMTrackProducer_Defaults_cfi.py . It is created inside - // tmtt_tf_analysis_cfg.py . - writeOutEdmFile_ ( iConfig.getUntrackedParameter ( "WriteOutEdmFile", true) ), - - // Bfield in Tesla. (Unknown at job initiation. Set to true value for each event - bField_ (0.), - - // Hybrid tracking - hybrid_ ( iConfig.getParameter ( "Hybrid" ) ), - psStripPitch_ (0.), - psNStrips_ (0.), - psPixelLength_ (0.), - ssStripPitch_ (0.), - ssNStrips_ (0.), - ssStripLength_ (0.) -{ - // If user didn't specify any PDG codes, use e,mu,pi,K,p, to avoid picking up unstable particles like Xi-. - vector genPdgIdsUnsigned( genCuts_.getParameter > ( "GenPdgIds" ) ); - if (genPdgIdsUnsigned.empty()) { - genPdgIdsUnsigned = {11, 13, 211, 321, 2212}; - } - - // For simplicity, user need not distinguish particles from antiparticles in configuration file. - // But here we must store both explicitely in Settings, since TrackingParticleSelector expects them. - for (unsigned int i = 0; i < genPdgIdsUnsigned.size(); i++) { - genPdgIds_.push_back( genPdgIdsUnsigned[i] ); - genPdgIds_.push_back( -genPdgIdsUnsigned[i] ); - } - - // Clean up list of fitters that require the r-z track filter to be run before them, - // by removing those fitters that are not to be run. - vector useRZfilterTmp; - for (const string& name : useRZfilter_) { - if (std::count(trackFitters_.begin(), trackFitters_.end(), name) > 0) useRZfilterTmp.push_back(name); - } - useRZfilter_ = useRZfilterTmp; - //--- Sanity checks + ///=== Get configuration parameters from python cfg for TMTT tracking. + + Settings::Settings(const edm::ParameterSet& iConfig) + : + + // See either Analyze_Defaults_cfi.py or Settings.h for description of these parameters. + + //=== Parameter sets for differents types of configuration parameter. + genCuts_(iConfig.getParameter("GenCuts")), + stubCuts_(iConfig.getParameter("StubCuts")), + stubDigitize_(iConfig.getParameter("StubDigitize")), + geometricProc_(iConfig.getParameter("GeometricProc")), + phiSectors_(iConfig.getParameter("PhiSectors")), + etaSectors_(iConfig.getParameter("EtaSectors")), + htArraySpecRphi_(iConfig.getParameter("HTArraySpecRphi")), + htFillingRphi_(iConfig.getParameter("HTFillingRphi")), + rzFilterOpts_(iConfig.getParameter("RZfilterOpts")), + l1TrackDef_(iConfig.getParameter("L1TrackDef")), + dupTrkRemoval_(iConfig.getParameter("DupTrkRemoval")), + trackMatchDef_(iConfig.getParameter("TrackMatchDef")), + trackFitSettings_(iConfig.getParameter("TrackFitSettings")), + deadModuleOpts_(iConfig.getParameter("DeadModuleOpts")), + trackDigi_(iConfig.getParameter("TrackDigi")), + + //=== General settings + + enableMCtruth_(iConfig.getParameter("EnableMCtruth")), + enableHistos_(iConfig.getParameter("EnableHistos")), + + //=== Cuts on MC truth tracks used for tracking efficiency measurements. + + genMinPt_(genCuts_.getParameter("GenMinPt")), + genMaxAbsEta_(genCuts_.getParameter("GenMaxAbsEta")), + genMaxVertR_(genCuts_.getParameter("GenMaxVertR")), + genMaxVertZ_(genCuts_.getParameter("GenMaxVertZ")), + genMaxD0_(genCuts_.getParameter("GenMaxD0")), + genMaxZ0_(genCuts_.getParameter("GenMaxZ0")), + genMinStubLayers_(genCuts_.getParameter("GenMinStubLayers")), + + //=== Cuts applied to stubs before arriving in L1 track finding board. + + degradeBendRes_(stubCuts_.getParameter("DegradeBendRes")), + maxStubEta_(stubCuts_.getParameter("MaxStubEta")), + killLowPtStubs_(stubCuts_.getParameter("KillLowPtStubs")), + printStubWindows_(stubCuts_.getParameter("PrintStubWindows")), + bendResolution_(stubCuts_.getParameter("BendResolution")), + bendResolutionExtra_(stubCuts_.getParameter("BendResolutionExtra")), + orderStubsByBend_(stubCuts_.getParameter("OrderStubsByBend")), + + //=== Optional stub digitization. + + enableDigitize_(stubDigitize_.getParameter("EnableDigitize")), + + //--- Parameters available in MP board. + phiSectorBits_(stubDigitize_.getParameter("PhiSectorBits")), + phiSBits_(stubDigitize_.getParameter("PhiSBits")), + phiSRange_(stubDigitize_.getParameter("PhiSRange")), + rtBits_(stubDigitize_.getParameter("RtBits")), + rtRange_(stubDigitize_.getParameter("RtRange")), + zBits_(stubDigitize_.getParameter("ZBits")), + zRange_(stubDigitize_.getParameter("ZRange")), + //--- Parameters available in GP board (excluding any in common with MP specified above). + phiOBits_(stubDigitize_.getParameter("PhiOBits")), + phiORange_(stubDigitize_.getParameter("PhiORange")), + bendBits_(stubDigitize_.getParameter("BendBits")), + + //=== Configuration of Geometric Processor. + useApproxB_(geometricProc_.getParameter("UseApproxB")), + bApprox_gradient_(geometricProc_.getParameter("BApprox_gradient")), + bApprox_intercept_(geometricProc_.getParameter("BApprox_intercept")), + + //=== Division of Tracker into phi sectors. + numPhiNonants_(phiSectors_.getParameter("NumPhiNonants")), + numPhiSectors_(phiSectors_.getParameter("NumPhiSectors")), + chosenRofPhi_(phiSectors_.getParameter("ChosenRofPhi")), + useStubPhi_(phiSectors_.getParameter("UseStubPhi")), + useStubPhiTrk_(phiSectors_.getParameter("UseStubPhiTrk")), + assumedPhiTrkRes_(phiSectors_.getParameter("AssumedPhiTrkRes")), + calcPhiTrkRes_(phiSectors_.getParameter("CalcPhiTrkRes")), + handleStripsPhiSec_(phiSectors_.getParameter("HandleStripsPhiSec")), + + //=== Division of Tracker into eta sectors. + etaRegions_(etaSectors_.getParameter>("EtaRegions")), + chosenRofZ_(etaSectors_.getParameter("ChosenRofZ")), + beamWindowZ_(etaSectors_.getParameter("BeamWindowZ")), + handleStripsEtaSec_(etaSectors_.getParameter("HandleStripsEtaSec")), + allowOver2EtaSecs_(etaSectors_.getParameter("AllowOver2EtaSecs")), + + //=== r-phi Hough transform array specifications. + houghMinPt_(htArraySpecRphi_.getParameter("HoughMinPt")), + houghNbinsPt_(htArraySpecRphi_.getParameter("HoughNbinsPt")), + houghNbinsPhi_(htArraySpecRphi_.getParameter("HoughNbinsPhi")), + houghNcellsRphi_(htArraySpecRphi_.getParameter("HoughNcellsRphi")), + enableMerge2x2_(htArraySpecRphi_.getParameter("EnableMerge2x2")), + maxPtToMerge2x2_(htArraySpecRphi_.getParameter("MaxPtToMerge2x2")), + numSubSecsEta_(htArraySpecRphi_.getParameter("NumSubSecsEta")), + shape_(htArraySpecRphi_.getParameter("Shape")), + miniHTstage_(htArraySpecRphi_.getParameter("MiniHTstage")), + miniHoughNbinsPt_(htArraySpecRphi_.getParameter("MiniHoughNbinsPt")), + miniHoughNbinsPhi_(htArraySpecRphi_.getParameter("MiniHoughNbinsPhi")), + miniHoughMinPt_(htArraySpecRphi_.getParameter("MiniHoughMinPt")), + miniHoughDontKill_(htArraySpecRphi_.getParameter("MiniHoughDontKill")), + miniHoughDontKillMinPt_(htArraySpecRphi_.getParameter("MiniHoughDontKillMinPt")), + miniHoughLoadBalance_(htArraySpecRphi_.getParameter("MiniHoughLoadBalance")), + + //=== Rules governing how stubs are filled into the r-phi Hough Transform array. + handleStripsRphiHT_(htFillingRphi_.getParameter("HandleStripsRphiHT")), + killSomeHTCellsRphi_(htFillingRphi_.getParameter("KillSomeHTCellsRphi")), + useBendFilter_(htFillingRphi_.getParameter("UseBendFilter")), + maxStubsInCell_(htFillingRphi_.getParameter("MaxStubsInCell")), + maxStubsInCellMiniHough_(htFillingRphi_.getParameter("MaxStubsInCellMiniHough")), + busySectorKill_(htFillingRphi_.getParameter("BusySectorKill")), + busySectorNumStubs_(htFillingRphi_.getParameter("BusySectorNumStubs")), + busySectorMbinRanges_(htFillingRphi_.getParameter>("BusySectorMbinRanges")), + busySectorMbinOrder_(htFillingRphi_.getParameter>("BusySectorMbinOrder")), + busyInputSectorKill_(htFillingRphi_.getParameter("BusyInputSectorKill")), + busyInputSectorNumStubs_(htFillingRphi_.getParameter("BusyInputSectorNumStubs")), + muxOutputsHT_(htFillingRphi_.getParameter("MuxOutputsHT")), + etaRegWhitelist_(htFillingRphi_.getParameter>("EtaRegWhitelist")), + + //=== Options controlling r-z track filters (or any other track filters run after the Hough transform, as opposed to inside it). + + rzFilterName_(rzFilterOpts_.getParameter("RZFilterName")), + seedResolution_(rzFilterOpts_.getParameter("SeedResolution")), + keepAllSeed_(rzFilterOpts_.getParameter("KeepAllSeed")), + maxSeedCombinations_(rzFilterOpts_.getParameter("MaxSeedCombinations")), + maxGoodSeedCombinations_(rzFilterOpts_.getParameter("MaxGoodSeedCombinations")), + maxSeedsPerStub_(rzFilterOpts_.getParameter("MaxSeedsPerStub")), + zTrkSectorCheck_(rzFilterOpts_.getParameter("zTrkSectorCheck")), + minFilterLayers_(rzFilterOpts_.getParameter("MinFilterLayers")), + + //=== Rules for deciding when the track finding has found an L1 track candidate + + minStubLayers_(l1TrackDef_.getParameter("MinStubLayers")), + minPtToReduceLayers_(l1TrackDef_.getParameter("MinPtToReduceLayers")), + etaSecsReduceLayers_(l1TrackDef_.getParameter>("EtaSecsReduceLayers")), + useLayerID_(l1TrackDef_.getParameter("UseLayerID")), + reduceLayerID_(l1TrackDef_.getParameter("ReducedLayerID")), + + //=== Specification of algorithm to eliminate duplicate tracks. + + dupTrkAlgRphi_(dupTrkRemoval_.getParameter("DupTrkAlgRphi")), + dupTrkAlg3D_(dupTrkRemoval_.getParameter("DupTrkAlg3D")), + dupTrkAlgFit_(dupTrkRemoval_.getParameter("DupTrkAlgFit")), + dupTrkMinCommonHitsLayers_(dupTrkRemoval_.getParameter("DupTrkMinCommonHitsLayers")), + + //=== Rules for deciding when a reconstructed L1 track matches a MC truth particle (i.e. tracking particle). + + minFracMatchStubsOnReco_(trackMatchDef_.getParameter("MinFracMatchStubsOnReco")), + minFracMatchStubsOnTP_(trackMatchDef_.getParameter("MinFracMatchStubsOnTP")), + minNumMatchLayers_(trackMatchDef_.getParameter("MinNumMatchLayers")), + minNumMatchPSLayers_(trackMatchDef_.getParameter("MinNumMatchPSLayers")), + stubMatchStrict_(trackMatchDef_.getParameter("StubMatchStrict")), + + //=== Track Fitting Settings + + trackFitters_(trackFitSettings_.getParameter>("TrackFitters")), + useRZfilter_(trackFitSettings_.getParameter>("UseRZfilter")), + detailedFitOutput_(trackFitSettings_.getParameter("DetailedFitOutput")), + trackFitCheat_(trackFitSettings_.getParameter("TrackFitCheat")), + // + numTrackFitIterations_(trackFitSettings_.getParameter("NumTrackFitIterations")), + killTrackFitWorstHit_(trackFitSettings_.getParameter("KillTrackFitWorstHit")), + generalResidualCut_(trackFitSettings_.getParameter("GeneralResidualCut")), + killingResidualCut_(trackFitSettings_.getParameter("KillingResidualCut")), + maxIterationsLR_(trackFitSettings_.getParameter("MaxIterationsLR")), + LRFillInternalHists_(trackFitSettings_.getParameter("LRFillInternalHists")), + combineResiduals_(trackFitSettings_.getParameter("CombineResiduals")), + lineariseStubPosition_(trackFitSettings_.getParameter("LineariseStubPosition")), + checkSectorConsistency_(trackFitSettings_.getParameter("CheckSectorConsistency")), + checkHTCellConsistency_(trackFitSettings_.getParameter("CheckHTCellConsistency")), + minPSLayers_(trackFitSettings_.getParameter("MinPSLayers")), + digitizeLR_(trackFitSettings_.getParameter("DigitizeLR")), + PhiPrecision_(trackFitSettings_.getParameter("PhiPrecision")), + RPrecision_(trackFitSettings_.getParameter("RPrecision")), + ZPrecision_(trackFitSettings_.getParameter("ZPrecision")), + ZSlopeWidth_(trackFitSettings_.getParameter("ZSlopeWidth")), + ZInterceptWidth_(trackFitSettings_.getParameter("ZInterceptWidth")), + // + digitizeSLR_(trackFitSettings_.getParameter("DigitizeSLR")), + dividerBitsHelix_(trackFitSettings_.getParameter("DividerBitsHelix")), + dividerBitsHelixZ_(trackFitSettings_.getParameter("DividerBitsHelixZ")), + ShiftingBitsDenRPhi_(trackFitSettings_.getParameter("ShiftingBitsDenRPhi")), + ShiftingBitsDenRZ_(trackFitSettings_.getParameter("ShiftingBitsDenRZ")), + ShiftingBitsPt_(trackFitSettings_.getParameter("ShiftingBitsPt")), + ShiftingBitsPhi_(trackFitSettings_.getParameter("ShiftingBitsPhi")), + + ShiftingBitsLambda_(trackFitSettings_.getParameter("ShiftingBitsLambda")), + ShiftingBitsZ0_(trackFitSettings_.getParameter("ShiftingBitsZ0")), + slr_chi2cut_(trackFitSettings_.getParameter("SLR_chi2cut")), + residualCut_(trackFitSettings_.getParameter("ResidualCut")), + // + kalmanDebugLevel_(trackFitSettings_.getParameter("KalmanDebugLevel")), + kalmanFillInternalHists_(trackFitSettings_.getParameter("KalmanFillInternalHists")), + kalmanMinNumStubs_(trackFitSettings_.getParameter("KalmanMinNumStubs")), + kalmanMaxNumStubs_(trackFitSettings_.getParameter("KalmanMaxNumStubs")), + kalmanAddBeamConstr_(trackFitSettings_.getParameter("KalmanAddBeamConstr")), + kalmanRemove2PScut_(trackFitSettings_.getParameter("KalmanRemove2PScut")), + kalmanMaxSkipLayersHard_(trackFitSettings_.getParameter("KalmanMaxSkipLayersHard")), + kalmanMaxSkipLayersEasy_(trackFitSettings_.getParameter("KalmanMaxSkipLayersEasy")), + kalmanMaxStubsEasy_(trackFitSettings_.getParameter("KalmanMaxStubsEasy")), + kalmanMaxStubsPerLayer_(trackFitSettings_.getParameter("KalmanMaxStubsPerLayer")), + kalmanMultiScattTerm_(trackFitSettings_.getParameter("KalmanMultiScattTerm")), + kalmanChi2RphiScale_(trackFitSettings_.getParameter("KalmanChi2RphiScale")), + kalmanHOtilted_(trackFitSettings_.getParameter("KalmanHOtilted")), + kalmanHOhelixExp_(trackFitSettings_.getParameter("KalmanHOhelixExp")), + kalmanHOalpha_(trackFitSettings_.getParameter("KalmanHOalpha")), + kalmanHOprojZcorr_(trackFitSettings_.getParameter("KalmanHOprojZcorr")), + kalmanHOdodgy_(trackFitSettings_.getParameter("KalmanHOdodgy")), + + //=== Treatment of dead modules. + + deadReduceLayers_(deadModuleOpts_.getParameter("DeadReduceLayers")), + deadSimulateFrac_(deadModuleOpts_.getParameter("DeadSimulateFrac")), + killScenario_(deadModuleOpts_.getParameter("KillScenario")), + killRecover_(deadModuleOpts_.getParameter("KillRecover")), + + //=== Track digitisation configuration for various track fitters + + slr_skipTrackDigi_(trackDigi_.getParameter("SLR_skipTrackDigi")), + slr_oneOver2rBits_(trackDigi_.getParameter("SLR_oneOver2rBits")), + slr_oneOver2rRange_(trackDigi_.getParameter("SLR_oneOver2rRange")), + slr_d0Bits_(trackDigi_.getParameter("SLR_d0Bits")), + slr_d0Range_(trackDigi_.getParameter("SLR_d0Range")), + slr_phi0Bits_(trackDigi_.getParameter("SLR_phi0Bits")), + slr_phi0Range_(trackDigi_.getParameter("SLR_phi0Range")), + slr_z0Bits_(trackDigi_.getParameter("SLR_z0Bits")), + slr_z0Range_(trackDigi_.getParameter("SLR_z0Range")), + slr_tanlambdaBits_(trackDigi_.getParameter("SLR_tanlambdaBits")), + slr_tanlambdaRange_(trackDigi_.getParameter("SLR_tanlambdaRange")), + slr_chisquaredBits_(trackDigi_.getParameter("SLR_chisquaredBits")), + slr_chisquaredRange_(trackDigi_.getParameter("SLR_chisquaredRange")), + // + kf_skipTrackDigi_(trackDigi_.getParameter("KF_skipTrackDigi")), + kf_oneOver2rBits_(trackDigi_.getParameter("KF_oneOver2rBits")), + kf_oneOver2rRange_(trackDigi_.getParameter("KF_oneOver2rRange")), + kf_d0Bits_(trackDigi_.getParameter("KF_d0Bits")), + kf_d0Range_(trackDigi_.getParameter("KF_d0Range")), + kf_phi0Bits_(trackDigi_.getParameter("KF_phi0Bits")), + kf_phi0Range_(trackDigi_.getParameter("KF_phi0Range")), + kf_z0Bits_(trackDigi_.getParameter("KF_z0Bits")), + kf_z0Range_(trackDigi_.getParameter("KF_z0Range")), + kf_tanlambdaBits_(trackDigi_.getParameter("KF_tanlambdaBits")), + kf_tanlambdaRange_(trackDigi_.getParameter("KF_tanlambdaRange")), + kf_chisquaredBits_(trackDigi_.getParameter("KF_chisquaredBits")), + kf_chisquaredRange_(trackDigi_.getParameter("KF_chisquaredRange")), + kf_chisquaredBinEdges_(trackDigi_.getParameter>("KF_chisquaredBinEdges")), + // + other_skipTrackDigi_(trackDigi_.getParameter("Other_skipTrackDigi")), + + // Debug printout + debug_(iConfig.getParameter("Debug")), + resPlotOpt_(iConfig.getParameter("ResPlotOpt")), + iPhiPlot_(iConfig.getParameter("iPhiPlot")), + iEtaPlot_(iConfig.getParameter("iEtaPlot")), + + // Name of output EDM file if any. + // N.B. This parameter does not appear inside TMTrackProducer_Defaults_cfi.py . It is created inside + // tmtt_tf_analysis_cfg.py . + writeOutEdmFile_(iConfig.getUntrackedParameter("WriteOutEdmFile", true)), + + // Bfield in Tesla. (Unknown at job initiation. Set to true value for each event + bField_(0.), + + // Hybrid tracking + hybrid_(iConfig.getParameter("Hybrid")), + psStripPitch_(0.), + psNStrips_(0.), + psPixelLength_(0.), + ssStripPitch_(0.), + ssNStrips_(0.), + ssStripLength_(0.) { + // If user didn't specify any PDG codes, use e,mu,pi,K,p, to avoid picking up unstable particles like Xi-. + vector genPdgIdsUnsigned(genCuts_.getParameter>("GenPdgIds")); + if (genPdgIdsUnsigned.empty()) { + genPdgIdsUnsigned = {11, 13, 211, 321, 2212}; + } - if ( ! (useStubPhi_ || useStubPhiTrk_) ) throw cms::Exception("Settings.cc: Invalid cfg parameters - You cant set both UseStubPhi & useStubPhiTrk to false."); + // For simplicity, user need not distinguish particles from antiparticles in configuration file. + // But here we must store both explicitely in Settings, since TrackingParticleSelector expects them. + for (unsigned int i = 0; i < genPdgIdsUnsigned.size(); i++) { + genPdgIds_.push_back(genPdgIdsUnsigned[i]); + genPdgIds_.push_back(-genPdgIdsUnsigned[i]); + } - if (minNumMatchLayers_ > minStubLayers_) throw cms::Exception("Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type A."); - if (genMinStubLayers_ > minStubLayers_) throw cms::Exception("Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type B."); - if (minNumMatchLayers_ > genMinStubLayers_) throw cms::Exception("Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type C."); + // Clean up list of fitters that require the r-z track filter to be run before them, + // by removing those fitters that are not to be run. + vector useRZfilterTmp; + for (const string& name : useRZfilter_) { + if (std::count(trackFitters_.begin(), trackFitters_.end(), name) > 0) + useRZfilterTmp.push_back(name); + } + useRZfilter_ = useRZfilterTmp; + + //--- Sanity checks + + if (!(useStubPhi_ || useStubPhiTrk_)) + throw cms::Exception( + "Settings.cc: Invalid cfg parameters - You cant set both UseStubPhi & useStubPhiTrk to false."); + + if (minNumMatchLayers_ > minStubLayers_) + throw cms::Exception( + "Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type A."); + if (genMinStubLayers_ > minStubLayers_) + throw cms::Exception( + "Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type B."); + if (minNumMatchLayers_ > genMinStubLayers_) + throw cms::Exception( + "Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type C."); + + // If reducing number of required layers for high Pt tracks, then above checks must be redone. + bool doReduceLayers = (minPtToReduceLayers_ < 10000. || etaSecsReduceLayers_.size() > 0); + if (doReduceLayers && minStubLayers_ > 4) { + if (minNumMatchLayers_ > minStubLayers_ - 1) + throw cms::Exception( + "Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type D."); + if (genMinStubLayers_ > minStubLayers_ - 1) + throw cms::Exception( + "Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type E."); + } - // If reducing number of required layers for high Pt tracks, then above checks must be redone. - bool doReduceLayers = (minPtToReduceLayers_ < 10000. || etaSecsReduceLayers_.size() > 0) ; - if (doReduceLayers && minStubLayers_ > 4) { - if (minNumMatchLayers_ > minStubLayers_ - 1) throw cms::Exception("Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type D."); - if (genMinStubLayers_ > minStubLayers_ - 1) throw cms::Exception("Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type E."); - } + for (const unsigned int& iEtaReg : etaSecsReduceLayers_) { + if (iEtaReg >= etaRegions_.size()) + throw cms::Exception( + "Settings.cc: You specified an eta sector number in EtaSecsReduceLayers which exceeds the total number of " + "eta sectors!") + << iEtaReg << " " << etaRegions_.size() << endl; + } - for (const unsigned int& iEtaReg : etaSecsReduceLayers_) { - if (iEtaReg >= etaRegions_.size()) throw cms::Exception("Settings.cc: You specified an eta sector number in EtaSecsReduceLayers which exceeds the total number of eta sectors!")< mOrderCheck; + for (const unsigned int& m : busySectorMbinOrder_) { + mOrderCheck.insert(m); + } + if (mOrderCheck.size() != houghNbinsPt_) + throw cms::Exception( + "Settings.cc: Invalid cfg parameters - BusySectorMbinOrder used by HT MUX contains duplicate elements."); + unsigned int sum_nr = 0; + for (unsigned int nr : busySectorMbinRanges_) { + sum_nr += nr; + } + if (sum_nr != houghNbinsPt_) + throw cms::Exception( + "Settings.cc: Invalid cfg parameters - Sum of entries in BusySectorMbinRanges is incorrect."); + } - // Chains of m bin ranges for output of HT. - if ( ! busySectorMbinOrder_.empty() ) { - // User has specified an order in which the m bins should be chained together. Check if it makes sense. - if (busySectorMbinOrder_.size() != houghNbinsPt_) throw cms::Exception("Settings.cc: Invalid cfg parameters - BusySectorMbinOrder used by HT MUX contains wrong number of elements. Unless you are optimising the MUX, suggest you configure it to an empty vector."); - set mOrderCheck; - for (const unsigned int& m : busySectorMbinOrder_) { - mOrderCheck.insert(m); + if (miniHTstage_) { + if (enableMerge2x2_) + throw cms::Exception("Settings.cc: it is not allowed to enable both MiniHTstage & EnableMerge2x2 options."); + // Options for 2nd stage mini HT + if (shape_ != 0) + throw cms::Exception( + "Settings.cc: Invalid cfg parameters - 2nd stage mini HT only allowed for square-shaped cells."); + if (miniHoughNbinsPt_ != 2 || miniHoughNbinsPhi_ != 2) + throw cms::Exception("Settings.cc: 2nd mini HT has so dar only been implemented in C++ for 2x2."); } - if (mOrderCheck.size() != houghNbinsPt_) throw cms::Exception("Settings.cc: Invalid cfg parameters - BusySectorMbinOrder used by HT MUX contains duplicate elements."); - unsigned int sum_nr = 0; - for (unsigned int nr : busySectorMbinRanges_) { - sum_nr += nr; + + if (enableMerge2x2_) { + if (miniHTstage_) + throw cms::Exception("Settings.cc: it is not allowed to enable both MiniHTstage & EnableMerge2x2 options."); + // Merging of HT cells has not yet been implemented for diamond or hexagonal HT cell shape. + if (enableMerge2x2_ && shape_ != 0) + throw cms::Exception("Settings.cc: Invalid cfg parameters - merging only allowed for square-shaped cells."); } - if (sum_nr != houghNbinsPt_) throw cms::Exception("Settings.cc: Invalid cfg parameters - Sum of entries in BusySectorMbinRanges is incorrect."); - } - if (miniHTstage_) { - if (enableMerge2x2_) throw cms::Exception("Settings.cc: it is not allowed to enable both MiniHTstage & EnableMerge2x2 options."); - // Options for 2nd stage mini HT - if (shape_ != 0) throw cms::Exception("Settings.cc: Invalid cfg parameters - 2nd stage mini HT only allowed for square-shaped cells."); - if (miniHoughNbinsPt_ != 2 || miniHoughNbinsPhi_ != 2) throw cms::Exception("Settings.cc: 2nd mini HT has so dar only been implemented in C++ for 2x2."); - } + // Do not use our private dead module emulation together with the communal Tracklet/TMTT dead module emulation + // developed for the Stress Test. + if (deadSimulateFrac_ > 0. && killScenario_ > 0) + throw cms::Exception("Settings.cc: Invalid cfg parameters - don't enable both DeadSimulateFrac and KillScenario"); - if (enableMerge2x2_) { - if (miniHTstage_) throw cms::Exception("Settings.cc: it is not allowed to enable both MiniHTstage & EnableMerge2x2 options."); - // Merging of HT cells has not yet been implemented for diamond or hexagonal HT cell shape. - if (enableMerge2x2_ && shape_ != 0) throw cms::Exception("Settings.cc: Invalid cfg parameters - merging only allowed for square-shaped cells."); + // Check Kalman fit params. + if (kalmanMaxNumStubs_ < kalmanMinNumStubs_) + throw cms::Exception("Settings.cc: Invalid cfg parameters - KalmanMaxNumStubs is less than KalmanMaxNumStubs."); } - // Do not use our private dead module emulation together with the communal Tracklet/TMTT dead module emulation - // developed for the Stress Test. - if (deadSimulateFrac_ > 0. && killScenario_ > 0) throw cms::Exception("Settings.cc: Invalid cfg parameters - don't enable both DeadSimulateFrac and KillScenario"); - - // Check Kalman fit params. - if (kalmanMaxNumStubs_ < kalmanMinNumStubs_) throw cms::Exception("Settings.cc: Invalid cfg parameters - KalmanMaxNumStubs is less than KalmanMaxNumStubs."); -} - + bool Settings::isHTRPhiEtaRegWhitelisted(unsigned const iEtaReg) const { + bool whitelisted = true; -bool Settings::isHTRPhiEtaRegWhitelisted(unsigned const iEtaReg) const -{ - bool whitelisted = true; + bool const whitelist_enabled = (!etaRegWhitelist_.empty()); + if (whitelist_enabled) { + whitelisted = (std::count(etaRegWhitelist_.begin(), etaRegWhitelist_.end(), iEtaReg) > 0); + } - bool const whitelist_enabled = ( ! etaRegWhitelist_.empty() ); - if (whitelist_enabled) { - whitelisted = (std::count(etaRegWhitelist_.begin(), etaRegWhitelist_.end(), iEtaReg) > 0); + return whitelisted; } - return whitelisted; -} - -} +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/SimpleLR.cc b/L1Trigger/TrackFindingTMTT/src/SimpleLR.cc index dd55c34a890ff..b480f8f1e7eb7 100644 --- a/L1Trigger/TrackFindingTMTT/src/SimpleLR.cc +++ b/L1Trigger/TrackFindingTMTT/src/SimpleLR.cc @@ -15,59 +15,59 @@ using namespace TMTT; -static bool pair_compare( std::pair a, std::pair b) -{ - return ( a.second < b.second); +static bool pair_compare(std::pair a, std::pair b) { + return (a.second < b.second); } // Initialize some parameters -void SimpleLR::initRun(){ - phiMult_ = pow(2., settings_->phiSBits())/settings_->phiSRange(); - rTMult_ = pow(2., settings_->rtBits())/settings_->rtRange(); - zMult_ = pow(2., settings_->zBits())/settings_->zRange(); - z0Mult_ = pow(2., settings_->slr_z0Bits())/settings_->slr_z0Range(); - phiTMult_ = pow(2., settings_->slr_phi0Bits())/settings_->slr_phi0Range(); - - qOverPtMult_ = pow(2.,settings_->slr_oneOver2rBits())/settings_->slr_oneOver2rRange(); - tanLambdaMult_ = pow(2.,settings_->slr_tanlambdaBits())/settings_->slr_tanlambdaRange(); - chi2Mult_ = pow(2.,settings_->slr_chisquaredBits())/settings_->slr_chisquaredRange(); - - numeratorPtMult_ = rTMult_*phiMult_; - numeratorPhiMult_ = rTMult_*rTMult_*phiMult_; - numeratorZ0Mult_ = rTMult_*rTMult_*z0Mult_; - numeratorLambdaMult_ = rTMult_*z0Mult_; - denominatorMult_ = rTMult_*rTMult_; - resMult_ = rTMult_*qOverPtMult_; - - digitize_ = settings_->digitizeSLR() and settings_->enableDigitize(); - dividerBitsHelix_ = settings_->dividerBitsHelix(); - dividerBitsHelixZ_ = settings_->dividerBitsHelixZ(); - shiftingBitsDenRPhi_ = settings_->ShiftingBitsDenRPhi(); - shiftingBitsDenRZ_ = settings_->ShiftingBitsDenRZ(); - - shiftingBitsPhi_ = settings_->ShiftingBitsPhi(); - shiftingBitsz0_ = settings_->ShiftingBitsZ0(); - shiftingBitsPt_ = settings_->ShiftingBitsPt(); - shiftingBitsLambda_ = settings_->ShiftingBitsLambda(); - - phiSectorWidth_ = 2.*M_PI / float(settings_->numPhiSectors()); - phiNonantWidth_ = 2.*M_PI / float(settings_->numPhiNonants()); - - chi2cut_ = settings_->slr_chi2cut(); - invPtToDPhi_ = - settings_->invPtToDphi(); - chosenRofPhi_ = settings_->chosenRofPhi(); - if(digitize_) chosenRofPhi_ = floor(chosenRofPhi_*rTMult_)/rTMult_; - +void SimpleLR::initRun() { + phiMult_ = pow(2., settings_->phiSBits()) / settings_->phiSRange(); + rTMult_ = pow(2., settings_->rtBits()) / settings_->rtRange(); + zMult_ = pow(2., settings_->zBits()) / settings_->zRange(); + z0Mult_ = pow(2., settings_->slr_z0Bits()) / settings_->slr_z0Range(); + phiTMult_ = pow(2., settings_->slr_phi0Bits()) / settings_->slr_phi0Range(); + + qOverPtMult_ = pow(2., settings_->slr_oneOver2rBits()) / settings_->slr_oneOver2rRange(); + tanLambdaMult_ = pow(2., settings_->slr_tanlambdaBits()) / settings_->slr_tanlambdaRange(); + chi2Mult_ = pow(2., settings_->slr_chisquaredBits()) / settings_->slr_chisquaredRange(); + + numeratorPtMult_ = rTMult_ * phiMult_; + numeratorPhiMult_ = rTMult_ * rTMult_ * phiMult_; + numeratorZ0Mult_ = rTMult_ * rTMult_ * z0Mult_; + numeratorLambdaMult_ = rTMult_ * z0Mult_; + denominatorMult_ = rTMult_ * rTMult_; + resMult_ = rTMult_ * qOverPtMult_; + + digitize_ = settings_->digitizeSLR() and settings_->enableDigitize(); + dividerBitsHelix_ = settings_->dividerBitsHelix(); + dividerBitsHelixZ_ = settings_->dividerBitsHelixZ(); + shiftingBitsDenRPhi_ = settings_->ShiftingBitsDenRPhi(); + shiftingBitsDenRZ_ = settings_->ShiftingBitsDenRZ(); + + shiftingBitsPhi_ = settings_->ShiftingBitsPhi(); + shiftingBitsz0_ = settings_->ShiftingBitsZ0(); + shiftingBitsPt_ = settings_->ShiftingBitsPt(); + shiftingBitsLambda_ = settings_->ShiftingBitsLambda(); + + phiSectorWidth_ = 2. * M_PI / float(settings_->numPhiSectors()); + phiNonantWidth_ = 2. * M_PI / float(settings_->numPhiNonants()); + + chi2cut_ = settings_->slr_chi2cut(); + invPtToDPhi_ = -settings_->invPtToDphi(); + chosenRofPhi_ = settings_->chosenRofPhi(); + if (digitize_) + chosenRofPhi_ = floor(chosenRofPhi_ * rTMult_) / rTMult_; } +L1fittedTrack SimpleLR::fit(const L1track3D& l1track3D) { + if (settings_->debug() == 6) + cout << "=============== FITTING TRACK ====================" << endl; -L1fittedTrack SimpleLR::fit( const L1track3D& l1track3D) { - if(settings_->debug()==6) cout << "=============== FITTING TRACK ====================" << endl; - - double phiCentreSec0 = -0.5*phiNonantWidth_ + 0.5*phiSectorWidth_; - phiSectorCentre_ = phiSectorWidth_ * double(l1track3D.iPhiSec()) - phiCentreSec0; + double phiCentreSec0 = -0.5 * phiNonantWidth_ + 0.5 * phiSectorWidth_; + phiSectorCentre_ = phiSectorWidth_ * double(l1track3D.iPhiSec()) - phiCentreSec0; - if(digitize_) phiSectorCentre_ = floor(phiSectorCentre_*phiTMult_)/phiTMult_; + if (digitize_) + phiSectorCentre_ = floor(phiSectorCentre_ * phiTMult_) / phiTMult_; // Inizialise track fit parameters double qOverPt = 0.; @@ -88,156 +88,166 @@ L1fittedTrack SimpleLR::fit( const L1track3D& l1track3D) { unsigned int numStubs = 0; // Calc helix parameters on Rphi Plane (STEP 1) // This loop calculates the sums needed to calculate the numerators and the denominator to compute the helix parameters in the R-Phi plane (q/pT, phiT) - for(const Stub* stub : l1track3D.getStubs()){ + for (const Stub* stub : l1track3D.getStubs()) { // if((const_cast(stub))->psModule()){ - numStubs++; - - if(digitize_){ - (const_cast(stub))->digitizeForHTinput(l1track3D.iPhiSec()); - (const_cast(stub))->digitizeForSFinput(); - const DigitalStub digiStub = (const_cast(stub))->digitalStub(); - - SumRPhi = SumRPhi + digiStub.rt()*digiStub.phiS(); - SumR = SumR + digiStub.rt(); - SumPhi = SumPhi + digiStub.phiS(); - SumR2 = SumR2 + digiStub.rt()*digiStub.rt(); - if(settings_->debug() == 6) cout << "phiS " << digiStub.iDigi_PhiS() << " rT " << digiStub.iDigi_Rt() << " z "<< digiStub.iDigi_Z()<< endl; - } else{ - float phi = 0; - if(l1track3D.iPhiSec() == 0 and (const_cast(stub))->phi() > 0){ - phi = (const_cast(stub))->phi() - 2*M_PI; - } else if(l1track3D.iPhiSec() == settings_->numPhiSectors() and (const_cast(stub))->phi() < 0){ - phi = (const_cast(stub))->phi() + 2*M_PI; - } else{ - phi = (const_cast(stub))->phi(); - } - SumRPhi = SumRPhi + (const_cast(stub))->r()*phi; - SumR = SumR + (const_cast(stub))->r(); - SumPhi = SumPhi + phi; - SumR2 = SumR2 + (const_cast(stub))->r()*(const_cast(stub))->r(); - if(settings_->debug() == 6) cout << "phi " << phi << " r " << (const_cast(stub))->r() << " z "<< (const_cast(stub))->z()<< endl; + numStubs++; + + if (digitize_) { + (const_cast(stub))->digitizeForHTinput(l1track3D.iPhiSec()); + (const_cast(stub))->digitizeForSFinput(); + const DigitalStub digiStub = (const_cast(stub))->digitalStub(); + + SumRPhi = SumRPhi + digiStub.rt() * digiStub.phiS(); + SumR = SumR + digiStub.rt(); + SumPhi = SumPhi + digiStub.phiS(); + SumR2 = SumR2 + digiStub.rt() * digiStub.rt(); + if (settings_->debug() == 6) + cout << "phiS " << digiStub.iDigi_PhiS() << " rT " << digiStub.iDigi_Rt() << " z " << digiStub.iDigi_Z() + << endl; + } else { + float phi = 0; + if (l1track3D.iPhiSec() == 0 and (const_cast(stub))->phi() > 0) { + phi = (const_cast(stub))->phi() - 2 * M_PI; + } else if (l1track3D.iPhiSec() == settings_->numPhiSectors() and (const_cast(stub))->phi() < 0) { + phi = (const_cast(stub))->phi() + 2 * M_PI; + } else { + phi = (const_cast(stub))->phi(); } + SumRPhi = SumRPhi + (const_cast(stub))->r() * phi; + SumR = SumR + (const_cast(stub))->r(); + SumPhi = SumPhi + phi; + SumR2 = SumR2 + (const_cast(stub))->r() * (const_cast(stub))->r(); + if (settings_->debug() == 6) + cout << "phi " << phi << " r " << (const_cast(stub))->r() << " z " << (const_cast(stub))->z() + << endl; + } // } } - + double numeratorPt, digiNumeratorPt; double denominator, digiDenominator; double numeratorPhi, digiNumeratorPhi; double reciprocal, digiReciprocal; - double numeratorZ0, digiNumeratorZ0 ; - double numeratorLambda, digiNumeratorLambda ; + double numeratorZ0, digiNumeratorZ0; + double numeratorLambda, digiNumeratorLambda; - digiNumeratorPt = (numStubs*SumRPhi - SumR*SumPhi); - digiDenominator = (numStubs*SumR2 - SumR*SumR); - digiNumeratorPhi = ( SumR2 * SumPhi - SumR*SumRPhi); + digiNumeratorPt = (numStubs * SumRPhi - SumR * SumPhi); + digiDenominator = (numStubs * SumR2 - SumR * SumR); + digiNumeratorPhi = (SumR2 * SumPhi - SumR * SumRPhi); - if(!digitize_){ - qOverPt = (numStubs*SumRPhi - SumR*SumPhi)/(numStubs*SumR2 - SumR*SumR); - phi0 = ( SumR2 * SumPhi - SumR*SumRPhi )/(numStubs*SumR2 - SumR*SumR); - } else{ + if (!digitize_) { + qOverPt = (numStubs * SumRPhi - SumR * SumPhi) / (numStubs * SumR2 - SumR * SumR); + phi0 = (SumR2 * SumPhi - SumR * SumRPhi) / (numStubs * SumR2 - SumR * SumR); + } else { digiNumeratorPt /= pow(2., shiftingBitsPt_); - digiNumeratorPt = floor(digiNumeratorPt*numeratorPtMult_); - numeratorPt = digiNumeratorPt/numeratorPtMult_; + digiNumeratorPt = floor(digiNumeratorPt * numeratorPtMult_); + numeratorPt = digiNumeratorPt / numeratorPtMult_; digiNumeratorPhi /= pow(2., shiftingBitsPhi_); - digiNumeratorPhi = floor(digiNumeratorPhi*numeratorPhiMult_); - numeratorPhi = digiNumeratorPhi/numeratorPhiMult_; - - digiDenominator /= pow(2., shiftingBitsDenRPhi_) ; - digiDenominator = (floor(digiDenominator*denominatorMult_)+0.5); - denominator = digiDenominator/denominatorMult_; - digiReciprocal = (pow(2.,dividerBitsHelix_)-1)/(denominator); // To be moved - digiReciprocal = floor(digiReciprocal/denominatorMult_); - reciprocal = digiReciprocal*denominatorMult_; - - - qOverPt = numeratorPt*reciprocal/pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPt_); - phiT = numeratorPhi*reciprocal/pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPhi_); - - qOverPt = floor(qOverPt*qOverPtMult_)/(qOverPtMult_); - phiT = floor(phiT*phiTMult_)/phiTMult_; + digiNumeratorPhi = floor(digiNumeratorPhi * numeratorPhiMult_); + numeratorPhi = digiNumeratorPhi / numeratorPhiMult_; + + digiDenominator /= pow(2., shiftingBitsDenRPhi_); + digiDenominator = (floor(digiDenominator * denominatorMult_) + 0.5); + denominator = digiDenominator / denominatorMult_; + digiReciprocal = (pow(2., dividerBitsHelix_) - 1) / (denominator); // To be moved + digiReciprocal = floor(digiReciprocal / denominatorMult_); + reciprocal = digiReciprocal * denominatorMult_; + + qOverPt = numeratorPt * reciprocal / pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPt_); + phiT = numeratorPhi * reciprocal / pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPhi_); + + qOverPt = floor(qOverPt * qOverPtMult_) / (qOverPtMult_); + phiT = floor(phiT * phiTMult_) / phiTMult_; } - if(settings_->debug() == 6 and digitize_) cout << setw(10) << "First Helix parameters: qOverPt = "<< qOverPt << " ("<< floor(qOverPt*qOverPtMult_) << "), phiT = "<< phiT <<" ("<< floor(phiT*phiTMult_)<<") "<< endl; + if (settings_->debug() == 6 and digitize_) + cout << setw(10) << "First Helix parameters: qOverPt = " << qOverPt << " (" << floor(qOverPt * qOverPtMult_) + << "), phiT = " << phiT << " (" << floor(phiT * phiTMult_) << ") " << endl; - if(settings_->debug() == 6 and !digitize_) cout << "First Helix Parameters: qOverPt = "<< qOverPt << " phi0 "<< phi0 << endl; - + if (settings_->debug() == 6 and !digitize_) + cout << "First Helix Parameters: qOverPt = " << qOverPt << " phi0 " << phi0 << endl; // ================== RESIDUAL CALCULATION ON RPHI ======================== - std::vector > vRes; + std::vector > vRes; unsigned int psStubs = 0; - for(const Stub* stub : l1track3D.getStubs()){ - if((const_cast(stub))->psModule()) psStubs++; + for (const Stub* stub : l1track3D.getStubs()) { + if ((const_cast(stub))->psModule()) + psStubs++; double ResPhi; - - if(digitize_){ + if (digitize_) { (const_cast(stub))->digitizeForHTinput(l1track3D.iPhiSec()); (const_cast(stub))->digitizeForSFinput(); const DigitalStub digiStub = (const_cast(stub))->digitalStub(); - - ResPhi = digiStub.iDigi_PhiS()*pow(2., shiftingBitsDenRPhi_- shiftingBitsPt_) - floor(phiT*phiTMult_)*pow(2., shiftingBitsDenRPhi_- shiftingBitsPt_ - settings_->slr_phi0Bits() + settings_->phiSBits() ) - floor(qOverPt*qOverPtMult_)*digiStub.iDigi_Rt(); + ResPhi = digiStub.iDigi_PhiS() * pow(2., shiftingBitsDenRPhi_ - shiftingBitsPt_) - + floor(phiT * phiTMult_) * + pow(2., shiftingBitsDenRPhi_ - shiftingBitsPt_ - settings_->slr_phi0Bits() + settings_->phiSBits()) - + floor(qOverPt * qOverPtMult_) * digiStub.iDigi_Rt(); - if(settings_->debug() == 6) { + if (settings_->debug() == 6) { // cout << "floor(phiT*phiTMult_) " << floor(phiT*phiTMult_) << endl; // cout << "dsp_PhiSPhiT "<< digiStub.iDigi_PhiS() - floor(phiT*phiTMult_) << " shift_right(dsp_QoverPt_Rt,divider_shift- divider_pt) "<< floor(qOverPt*qOverPtMult_)*digiStub.iDigi_Rt()/(pow(2., ShiftingBits_- shiftingBitsPt_ ) )<< " settings_->rtRange() "<< settings_->rtRange() << endl; - cout << "DIGI RESIDUAL "<< ResPhi << endl;} - ResPhi = floor(ResPhi)/resMult_; - } + cout << "DIGI RESIDUAL " << ResPhi << endl; + } + ResPhi = floor(ResPhi) / resMult_; + } - else{ - ResPhi = reco::deltaPhi((const_cast(stub))->phi(), phi0 + qOverPt*(const_cast(stub))->r()); + else { + ResPhi = reco::deltaPhi((const_cast(stub))->phi(), phi0 + qOverPt * (const_cast(stub))->r()); } - double Res = fabs(ResPhi) ; + double Res = fabs(ResPhi); // if(digitize_) Res = floor(Res*phiMult_)/phiMult_; - std::pair< const Stub*, double > ResStubPair (stub, Res); + std::pair ResStubPair(stub, Res); vRes.push_back(ResStubPair); - if(settings_->debug()==6){ - if(const_cast(stub)->assocTP()!= nullptr) cout << " Stub Residual " << Res << " TP " << const_cast(stub)->assocTP()->index() << endl; - else cout << " Stub Residual " << Res << " TP nullptr" << endl; + if (settings_->debug() == 6) { + if (const_cast(stub)->assocTP() != nullptr) + cout << " Stub Residual " << Res << " TP " << const_cast(stub)->assocTP()->index() << endl; + else + cout << " Stub Residual " << Res << " TP nullptr" << endl; } } double LargResidual = 9999.; // Find largest residuals - while(vRes.size() > 4 and LargResidual > settings_->ResidualCut() ){ - std::vector >::iterator maxResIt = max_element(vRes.begin(), vRes.end(), pair_compare ); + while (vRes.size() > 4 and LargResidual > settings_->ResidualCut()) { + std::vector >::iterator maxResIt = + max_element(vRes.begin(), vRes.end(), pair_compare); LargResidual = (*maxResIt).second; - if(settings_->debug() == 6) cout << "Largest Residual "<< LargResidual << endl; - - if(LargResidual > settings_->ResidualCut()){ - if((*maxResIt).first->psModule()){ - if(psStubs > 2){ - if(settings_->debug() == 6) cout << "removing PS residual "<< (*maxResIt).second << endl; + if (settings_->debug() == 6) + cout << "Largest Residual " << LargResidual << endl; + + if (LargResidual > settings_->ResidualCut()) { + if ((*maxResIt).first->psModule()) { + if (psStubs > 2) { + if (settings_->debug() == 6) + cout << "removing PS residual " << (*maxResIt).second << endl; vRes.erase(maxResIt); psStubs--; - } else{ - if(settings_->debug() == 6) cout << "residual "<< (*maxResIt).second << " set to -1. "<< endl; + } else { + if (settings_->debug() == 6) + cout << "residual " << (*maxResIt).second << " set to -1. " << endl; (*maxResIt).second = -1.; - } - } else{ + } else { vRes.erase(maxResIt); - if(settings_->debug() == 6) cout << "removing residual "<< (*maxResIt).second << endl; + if (settings_->debug() == 6) + cout << "removing residual " << (*maxResIt).second << endl; } } - - } - - std::vector fitStubs; - for( std::pair< const Stub*, double > ResStubPair : vRes ){ + for (std::pair ResStubPair : vRes) { fitStubs.push_back(ResStubPair.first); } phiT = 0.; zT = 0.; - + SumRPhi = 0.; SumR = 0.; SumPhi = 0.; @@ -250,142 +260,152 @@ L1fittedTrack SimpleLR::fit( const L1track3D& l1track3D) { numStubs = 0; psStubs = 0; - for(const Stub* stub : fitStubs){ - if((const_cast(stub))->psModule()) + for (const Stub* stub : fitStubs) { + if ((const_cast(stub))->psModule()) psStubs++; - + numStubs++; - if(digitize_){ + if (digitize_) { (const_cast(stub))->digitizeForHTinput(l1track3D.iPhiSec()); // (const_cast(stub))->digitizeForSFinput(); const DigitalStub digiStub = (const_cast(stub))->digitalStub(); - SumRPhi += digiStub.rt()*digiStub.phiS(); - SumR += digiStub.rt(); - SumPhi += digiStub.phiS(); - SumR2 += digiStub.rt()*digiStub.rt(); - if((const_cast(stub))->psModule() ){ - SumRZ += digiStub.rt()*digiStub.z(); - SumZ += digiStub.z(); - SumR_ps += digiStub.rt(); - SumR2_ps += digiStub.rt()*digiStub.rt(); + SumRPhi += digiStub.rt() * digiStub.phiS(); + SumR += digiStub.rt(); + SumPhi += digiStub.phiS(); + SumR2 += digiStub.rt() * digiStub.rt(); + if ((const_cast(stub))->psModule()) { + SumRZ += digiStub.rt() * digiStub.z(); + SumZ += digiStub.z(); + SumR_ps += digiStub.rt(); + SumR2_ps += digiStub.rt() * digiStub.rt(); } - if(settings_->debug() == 6) { - cout << "phiS " << digiStub.iDigi_PhiS() << " rT " << digiStub.iDigi_Rt() << " z "<< digiStub.iDigi_Z()<< endl; + if (settings_->debug() == 6) { + cout << "phiS " << digiStub.iDigi_PhiS() << " rT " << digiStub.iDigi_Rt() << " z " << digiStub.iDigi_Z() + << endl; } - } else{ - + } else { float phi = 0; - if(l1track3D.iPhiSec() == 0 and (const_cast(stub))->phi() > 0){ - phi = (const_cast(stub))->phi() - 2*M_PI; - } else if(l1track3D.iPhiSec() == settings_->numPhiSectors() and (const_cast(stub))->phi() < 0){ - phi = (const_cast(stub))->phi() + 2*M_PI; - } else{ + if (l1track3D.iPhiSec() == 0 and (const_cast(stub))->phi() > 0) { + phi = (const_cast(stub))->phi() - 2 * M_PI; + } else if (l1track3D.iPhiSec() == settings_->numPhiSectors() and (const_cast(stub))->phi() < 0) { + phi = (const_cast(stub))->phi() + 2 * M_PI; + } else { phi = (const_cast(stub))->phi(); } - SumRPhi += (const_cast(stub))->r()*phi; - SumR += (const_cast(stub))->r(); - SumPhi += phi; - SumR2 += (const_cast(stub))->r()*(const_cast(stub))->r(); - if((const_cast(stub))->psModule() ){ - SumRZ += (const_cast(stub))->r()*(const_cast(stub))->z(); - SumZ += (const_cast(stub))->z(); - SumR_ps += (const_cast(stub))->r(); - SumR2_ps += (const_cast(stub))->r()*(const_cast(stub))->r(); - + SumRPhi += (const_cast(stub))->r() * phi; + SumR += (const_cast(stub))->r(); + SumPhi += phi; + SumR2 += (const_cast(stub))->r() * (const_cast(stub))->r(); + if ((const_cast(stub))->psModule()) { + SumRZ += (const_cast(stub))->r() * (const_cast(stub))->z(); + SumZ += (const_cast(stub))->z(); + SumR_ps += (const_cast(stub))->r(); + SumR2_ps += (const_cast(stub))->r() * (const_cast(stub))->r(); } - if(settings_->debug() == 6) cout << "phi " << phi << " r " << (const_cast(stub))->r() << " z "<< (const_cast(stub))->z()<< endl; } - + if (settings_->debug() == 6) + cout << "phi " << phi << " r " << (const_cast(stub))->r() << " z " << (const_cast(stub))->z() + << endl; + } + // } } - numeratorZ0 = (SumR2_ps * SumZ - SumR_ps*SumRZ); - numeratorLambda = (psStubs*SumRZ - SumR_ps*SumZ); - numeratorPt = (numStubs*SumRPhi - SumR*SumPhi); - denominator = (numStubs*SumR2 - SumR*SumR); - double denominatorZ = (psStubs*SumR2_ps - SumR_ps*SumR_ps); - numeratorPhi = ( SumR2 * SumPhi - SumR*SumRPhi ); - double reciprocalZ ; - if(!digitize_){ - z0 = numeratorZ0/denominatorZ; - tanLambda = numeratorLambda/denominatorZ; - qOverPt = (numStubs*SumRPhi - SumR*SumPhi)/(numStubs*SumR2 - SumR*SumR); - phi0 = ( SumR2 * SumPhi - SumR*SumRPhi )/(numStubs*SumR2 - SumR*SumR); - } else{ + numeratorZ0 = (SumR2_ps * SumZ - SumR_ps * SumRZ); + numeratorLambda = (psStubs * SumRZ - SumR_ps * SumZ); + numeratorPt = (numStubs * SumRPhi - SumR * SumPhi); + denominator = (numStubs * SumR2 - SumR * SumR); + double denominatorZ = (psStubs * SumR2_ps - SumR_ps * SumR_ps); + numeratorPhi = (SumR2 * SumPhi - SumR * SumRPhi); + double reciprocalZ; + if (!digitize_) { + z0 = numeratorZ0 / denominatorZ; + tanLambda = numeratorLambda / denominatorZ; + qOverPt = (numStubs * SumRPhi - SumR * SumPhi) / (numStubs * SumR2 - SumR * SumR); + phi0 = (SumR2 * SumPhi - SumR * SumRPhi) / (numStubs * SumR2 - SumR * SumR); + } else { numeratorPt /= pow(2., shiftingBitsPt_); - numeratorPt = floor(numeratorPt*numeratorPtMult_)/numeratorPtMult_; + numeratorPt = floor(numeratorPt * numeratorPtMult_) / numeratorPtMult_; numeratorPhi /= pow(2., shiftingBitsPhi_); - numeratorPhi = floor(numeratorPhi*numeratorPhiMult_)/numeratorPhiMult_; + numeratorPhi = floor(numeratorPhi * numeratorPhiMult_) / numeratorPhiMult_; numeratorLambda /= pow(2., shiftingBitsLambda_); - numeratorLambda = floor(numeratorLambda*numeratorLambdaMult_)/numeratorLambdaMult_; + numeratorLambda = floor(numeratorLambda * numeratorLambdaMult_) / numeratorLambdaMult_; numeratorZ0 /= pow(2., shiftingBitsz0_); - numeratorZ0 = floor(numeratorZ0*numeratorZ0Mult_)/numeratorZ0Mult_; + numeratorZ0 = floor(numeratorZ0 * numeratorZ0Mult_) / numeratorZ0Mult_; denominator /= pow(2., shiftingBitsDenRPhi_); - denominator = (floor(denominator*denominatorMult_)+0.5)/denominatorMult_; - reciprocal = (pow(2.,dividerBitsHelix_)-1)/(denominator); - reciprocal = floor(reciprocal/denominatorMult_)*denominatorMult_; + denominator = (floor(denominator * denominatorMult_) + 0.5) / denominatorMult_; + reciprocal = (pow(2., dividerBitsHelix_) - 1) / (denominator); + reciprocal = floor(reciprocal / denominatorMult_) * denominatorMult_; denominatorZ /= pow(2., shiftingBitsDenRZ_); - denominatorZ = (floor(denominatorZ*denominatorMult_)+0.5)/denominatorMult_; - reciprocalZ = (pow(2.,dividerBitsHelixZ_)-1)/(denominatorZ); - reciprocalZ = floor(reciprocalZ/denominatorMult_)*denominatorMult_; + denominatorZ = (floor(denominatorZ * denominatorMult_) + 0.5) / denominatorMult_; + reciprocalZ = (pow(2., dividerBitsHelixZ_) - 1) / (denominatorZ); + reciprocalZ = floor(reciprocalZ / denominatorMult_) * denominatorMult_; - qOverPt = numeratorPt*reciprocal/pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPt_); - phiT = numeratorPhi*reciprocal/pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPhi_); + qOverPt = numeratorPt * reciprocal / pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPt_); + phiT = numeratorPhi * reciprocal / pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPhi_); - tanLambda = numeratorLambda*reciprocalZ/pow(2., dividerBitsHelixZ_ + shiftingBitsDenRZ_ - shiftingBitsLambda_); - zT = numeratorZ0*reciprocalZ/pow(2., dividerBitsHelixZ_ + shiftingBitsDenRZ_ - shiftingBitsz0_); + tanLambda = numeratorLambda * reciprocalZ / pow(2., dividerBitsHelixZ_ + shiftingBitsDenRZ_ - shiftingBitsLambda_); + zT = numeratorZ0 * reciprocalZ / pow(2., dividerBitsHelixZ_ + shiftingBitsDenRZ_ - shiftingBitsz0_); - phi0 = phiSectorCentre_ + phiT - qOverPt*settings_->chosenRofPhi(); - z0 = zT - tanLambda*settings_->chosenRofPhi(); + phi0 = phiSectorCentre_ + phiT - qOverPt * settings_->chosenRofPhi(); + z0 = zT - tanLambda * settings_->chosenRofPhi(); - qOverPt = floor(qOverPt*qOverPtMult_)/qOverPtMult_; - phiT = floor(phiT*phiTMult_)/phiTMult_; + qOverPt = floor(qOverPt * qOverPtMult_) / qOverPtMult_; + phiT = floor(phiT * phiTMult_) / phiTMult_; } // cout << "z0" // qOverPt /= -invPtToDPhi_; - - if(settings_->debug() == 6 and digitize_) { - cout << "HT mbin "<< int(l1track3D.getCellLocationHT().first) - 16 << " cbin "<< int(l1track3D.getCellLocationHT().second) - 32 << " iPhi "<< l1track3D.iPhiSec() << " iEta "<< l1track3D.iEtaReg() << endl; - cout << "Second Helix variables: numeratorPt = "<< numeratorPt << ", numeratorPhi = "<< numeratorPhi <<", numeratorZ0 = " << numeratorZ0 <<" numeratorLambda = " << numeratorLambda << " denominator = "<< denominator <<" reciprocal = "<< reciprocal << " denominatorZ = "<< denominatorZ <<" reciprocalZ = "<< reciprocalZ << endl; - cout << setw(10) << "Final Helix parameters: qOverPt = "<< qOverPt << " ("<< floor(qOverPt*qOverPtMult_) << "), phiT = "<< phiT <<" ("<< floor(phiT*phiTMult_)<<"), zT = "<< zT << " ("<debug() == 6 ){ - cout << setw(10) << "Final Helix parameters: qOverPt = "<< qOverPt <<", phi0 = "<< phi0 <<", z0 = "<< z0 << ", tanLambda = "<debug() == 6 and digitize_) { + cout << "HT mbin " << int(l1track3D.getCellLocationHT().first) - 16 << " cbin " + << int(l1track3D.getCellLocationHT().second) - 32 << " iPhi " << l1track3D.iPhiSec() << " iEta " + << l1track3D.iEtaReg() << endl; + cout << "Second Helix variables: numeratorPt = " << numeratorPt << ", numeratorPhi = " << numeratorPhi + << ", numeratorZ0 = " << numeratorZ0 << " numeratorLambda = " << numeratorLambda + << " denominator = " << denominator << " reciprocal = " << reciprocal << " denominatorZ = " << denominatorZ + << " reciprocalZ = " << reciprocalZ << endl; + cout << setw(10) << "Final Helix parameters: qOverPt = " << qOverPt << " (" << floor(qOverPt * qOverPtMult_) + << "), phiT = " << phiT << " (" << floor(phiT * phiTMult_) << "), zT = " << zT << " (" << floor(zT * z0Mult_) + << "), tanLambda = " << tanLambda << " (" << floor(tanLambda * tanLambdaMult_) << ")" + << " z0 " << z0 << endl; + } else if (settings_->debug() == 6) { + cout << setw(10) << "Final Helix parameters: qOverPt = " << qOverPt << ", phi0 = " << phi0 << ", z0 = " << z0 + << ", tanLambda = " << tanLambda << endl; } double chi2_phi = 0.; double chi2_z = 0.; - for(const Stub* stub : fitStubs){ + for (const Stub* stub : fitStubs) { double ResPhi = 0.; - double ResZ= 0.; - if(digitize_){ + double ResZ = 0.; + if (digitize_) { (const_cast(stub))->digitizeForHTinput(l1track3D.iPhiSec()); (const_cast(stub))->digitizeForSFinput(); const DigitalStub digiStub = (const_cast(stub))->digitalStub(); - ResPhi = digiStub.phiS() - phiT - qOverPt*digiStub.rt(); - ResZ = digiStub.z() - zT - tanLambda*digiStub.rt(); + ResPhi = digiStub.phiS() - phiT - qOverPt * digiStub.rt(); + ResZ = digiStub.z() - zT - tanLambda * digiStub.rt(); // ResZ = digiStub.z() - z0 - tanLambda*digiStub.r(); - } else{ - ResPhi = reco::deltaPhi((const_cast(stub))->phi(), phi0 + qOverPt*(const_cast(stub))->r()); - ResZ = (const_cast(stub))->z() - z0 - tanLambda*(const_cast(stub))->r(); + } else { + ResPhi = reco::deltaPhi((const_cast(stub))->phi(), phi0 + qOverPt * (const_cast(stub))->r()); + ResZ = (const_cast(stub))->z() - z0 - tanLambda * (const_cast(stub))->r(); } double RPhiSigma = 0.0002; - float RZSigma = (const_cast(stub))->zErr() + fabs(tanLambda)*(const_cast(stub))->rErr(); + float RZSigma = (const_cast(stub))->zErr() + fabs(tanLambda) * (const_cast(stub))->rErr(); - if ( not (const_cast(stub))->barrel() ) + if (not(const_cast(stub))->barrel()) RPhiSigma = 0.0004; - if(digitize_){ - RPhiSigma = floor(RPhiSigma*phiMult_)/phiMult_; + if (digitize_) { + RPhiSigma = floor(RPhiSigma * phiMult_) / phiMult_; } // if(!(const_cast(stub))->psModule()) RZSigma = 5; @@ -394,13 +414,14 @@ L1fittedTrack SimpleLR::fit( const L1track3D& l1track3D) { // cout << "zT "<< zT << " tanLambda "<< t<< RZSigma << endl; ResZ /= RZSigma; - chi2_phi += fabs(ResPhi*ResPhi); - chi2_z += fabs(ResZ*ResZ); - if(settings_->debug()==6 ){ - cout << "Stub ResPhi "<< ResPhi*RPhiSigma << " ResSigma " << RPhiSigma << " Res "<< ResPhi << " chi2 "<< chi2_phi << endl; - cout << "Stub ResZ "<< ResZ*RZSigma << " ResSigma " << RZSigma << " Res "<< ResZ << " chi2 "<< chi2_z << endl; - } - + chi2_phi += fabs(ResPhi * ResPhi); + chi2_z += fabs(ResZ * ResZ); + if (settings_->debug() == 6) { + cout << "Stub ResPhi " << ResPhi * RPhiSigma << " ResSigma " << RPhiSigma << " Res " << ResPhi << " chi2 " + << chi2_phi << endl; + cout << "Stub ResZ " << ResZ * RZSigma << " ResSigma " << RZSigma << " Res " << ResZ << " chi2 " << chi2_z + << endl; + } } qOverPt /= invPtToDPhi_; @@ -408,57 +429,67 @@ L1fittedTrack SimpleLR::fit( const L1track3D& l1track3D) { // double chi2 = (chi2_phi + chi2_z)/2.; // double chi2 = sqrt(chi2_phi*chi2_phi + chi2_z*chi2_z)/2; - double chi2 = chi2_phi; // Ignore r-z residuals due to poor 2S resolution? - if(digitize_) chi2 = floor(chi2*chi2Mult_)/chi2Mult_; + double chi2 = chi2_phi; // Ignore r-z residuals due to poor 2S resolution? + if (digitize_) + chi2 = floor(chi2 * chi2Mult_) / chi2Mult_; + // cout << "chi2 "<< chi2 << " phi "<< chi2_phi << " z "<< chi2_z << endl; + float dof = 2 * fitStubs.size() - 4; + float chi2dof = chi2 / dof; + if (chi2 < chi2cut_) + accepted = true; + if (settings_->debug() == 6) + cout << "qOverPt " << qOverPt << " phiT " << phiT << endl; - // cout << "chi2 "<< chi2 << " phi "<< chi2_phi << " z "<< chi2_z << endl; - float dof = 2*fitStubs.size() - 4; - float chi2dof = chi2/dof; - if(chi2 < chi2cut_) accepted = true; - - if(settings_->debug()==6) cout << "qOverPt "<< qOverPt << " phiT "<< phiT << endl; - // This condition can only happen if cfg param TrackFitCheat = True. - if (fitStubs.size() < 4) accepted = false; + if (fitStubs.size() < 4) + accepted = false; // Kinematic cuts -- NOT YET IN FIRMWARE!!! const float tolerance = 0.1; - if (fabs(qOverPt) > 1./(settings_->houghMinPt() - 0.1)) accepted = false; - if (fabs(z0) > 20.) accepted = false; - + if (fabs(qOverPt) > 1. / (settings_->houghMinPt() - 0.1)) + accepted = false; + if (fabs(z0) > 20.) + accepted = false; // Create the L1fittedTrack object - const unsigned int hitPattern = 0; // FIX: Needs setting - L1fittedTrack fitTrk(settings_, l1track3D, fitStubs, hitPattern, - qOverPt, 0., phi0, z0, tanLambda, - chi2_phi, chi2_z, 4, accepted); - - if(settings_->enableDigitize()) fitTrk.digitizeTrack("SimpleLR"); - - if(settings_->debug() == 6 and digitize_) { - cout << "Digitized parameters "<< endl; - cout << "HT mbin "<< int(l1track3D.getCellLocationHT().first) - 16 << " cbin "<< int(l1track3D.getCellLocationHT().second) - 32 << " iPhi "<< l1track3D.iPhiSec() << " iEta "<< l1track3D.iEtaReg() << endl; - cout << setw(10) << "First Helix parameters: qOverPt = "<< fitTrk.qOverPt() << " oneOver2r "<< fitTrk.digitaltrack().oneOver2r() <<" ("<< floor(fitTrk.digitaltrack().oneOver2r()*qOverPtMult_) << "), phi0 = "<< fitTrk.digitaltrack().phi0() <<" ("<< fitTrk.digitaltrack().iDigi_phi0rel() <<"), zT = "<< zT << " ("<enableDigitize()) + fitTrk.digitizeTrack("SimpleLR"); + + if (settings_->debug() == 6 and digitize_) { + cout << "Digitized parameters " << endl; + cout << "HT mbin " << int(l1track3D.getCellLocationHT().first) - 16 << " cbin " + << int(l1track3D.getCellLocationHT().second) - 32 << " iPhi " << l1track3D.iPhiSec() << " iEta " + << l1track3D.iEtaReg() << endl; + cout << setw(10) << "First Helix parameters: qOverPt = " << fitTrk.qOverPt() << " oneOver2r " + << fitTrk.digitaltrack().oneOver2r() << " (" << floor(fitTrk.digitaltrack().oneOver2r() * qOverPtMult_) + << "), phi0 = " << fitTrk.digitaltrack().phi0() << " (" << fitTrk.digitaltrack().iDigi_phi0rel() + << "), zT = " << zT << " (" << floor(zT * z0Mult_) << "), tanLambda = " << tanLambda << " (" + << floor(tanLambda * tanLambdaMult_) << ")" << endl; } - - if(settings_->debug()==6){ - cout << "FitTrack helix parameters "<< int(fitTrk.getCellLocationFit().first)-16 << ", "<< int(fitTrk.getCellLocationFit().second)-32 << " HT parameters "<< int(fitTrk.getCellLocationHT().first)-16 << ", " <qOverPt() << " phi0 "<< fitTrk.getMatchedTP()->phi0() << endl; - if(!accepted) cout << "BAD CHI2 "<< chi2 << " chi2/ndof " << chi2dof << endl; - } - else{ - cout << "FAKE TRACK!!! " << chi2 << " chi2/ndof "<< chi2dof << endl; - if(l1track3D.getMatchedTP() != nullptr) cout << "was good"<< endl; + + if (settings_->debug() == 6) { + cout << "FitTrack helix parameters " << int(fitTrk.getCellLocationFit().first) - 16 << ", " + << int(fitTrk.getCellLocationFit().second) - 32 << " HT parameters " + << int(fitTrk.getCellLocationHT().first) - 16 << ", " << int(fitTrk.getCellLocationHT().second) - 32 << endl; + + if (fitTrk.getMatchedTP() != nullptr) { + cout << "VERY GOOD! " << chi2dof << endl; + cout << "TP qOverPt " << fitTrk.getMatchedTP()->qOverPt() << " phi0 " << fitTrk.getMatchedTP()->phi0() << endl; + if (!accepted) + cout << "BAD CHI2 " << chi2 << " chi2/ndof " << chi2dof << endl; + } else { + cout << "FAKE TRACK!!! " << chi2 << " chi2/ndof " << chi2dof << endl; + if (l1track3D.getMatchedTP() != nullptr) + cout << "was good" << endl; } - cout << "layers in track "<< fitTrk.getNumLayers() << endl; + cout << "layers in track " << fitTrk.getNumLayers() << endl; } return fitTrk; } - diff --git a/L1Trigger/TrackFindingTMTT/src/Stub.cc b/L1Trigger/TrackFindingTMTT/src/Stub.cc index ee0475163db80..fdc77e1fc4476 100644 --- a/L1Trigger/TrackFindingTMTT/src/Stub.cc +++ b/L1Trigger/TrackFindingTMTT/src/Stub.cc @@ -18,69 +18,97 @@ using namespace std; namespace TMTT { -// Static variables - -thread_local string Stub::trackerGeometryVersion_ = "UNKNOWN"; - -bool Stub::stubKillerInit_ = false; -StubKiller Stub::stubKiller_; - -//=== Store useful info about the stub (for use with HYBRID code), with hard-wired constants to allow use outside CMSSW. + // Static variables + + thread_local string Stub::trackerGeometryVersion_ = "UNKNOWN"; + + bool Stub::stubKillerInit_ = false; + StubKiller Stub::stubKiller_; + + //=== Store useful info about the stub (for use with HYBRID code), with hard-wired constants to allow use outside CMSSW. + + Stub::Stub(double phi, + double r, + double z, + double bend, + int layerid, + bool psModule, + bool barrel, + unsigned int iphi, + double alpha, + const Settings* settings, + const TrackerTopology* trackerTopology, + unsigned int ID, + unsigned int iPhiSec) + : phi_(phi), + r_(r), + z_(z), + bend_(bend), + iphi_(iphi), + alpha_(alpha), + psModule_(psModule), + layerId_(layerid), + endcapRing_(0), + barrel_(barrel), + digitalStub_(settings, r, phi, z, iPhiSec), + stubWindowSuggest_(settings) { //work in progress on better constructor for new hybrid + if (psModule && barrel) { + double zMax[4]; + settings->get_zMaxNonTilted(zMax); + tiltedBarrel_ = (fabs(z) > zMax[layerid]); + } else { + tiltedBarrel_ = false; + } + if (!psModule) { + stripPitch_ = settings->ssStripPitch(); + nStrips_ = settings->ssNStrips(); + sigmaPar_ = settings->ssStripLength() / std::sqrt(12.0); + } else { + stripPitch_ = settings->psStripPitch(); + nStrips_ = settings->psNStrips(); + sigmaPar_ = settings->psPixelLength() / std::sqrt(12.0); + } + sigmaPerp_ = stripPitch_ / std::sqrt(12.0); + index_in_vStubs_ = ID; // A unique ID to label the stub. + } + + //=== Store useful info about stub (for use with TMTT tracking). + + Stub::Stub(const TTStubRef& ttStubRef, + unsigned int index_in_vStubs, + const Settings* settings, + const TrackerGeometry* trackerGeometry, + const TrackerTopology* trackerTopology) + : TTStubRef(ttStubRef), + settings_(settings), + index_in_vStubs_(index_in_vStubs), + assocTP_(nullptr), // Initialize in case job is using no MC truth info. + digitalStub_(settings), + digitizedForGPinput_(false), // notes that stub has not yet been digitized for GP input. + digitizedForHTinput_(false), // notes that stub has not yet been digitized for HT input. + digitizedForSForTFinput_( + ""), // notes that stub has not yet been digitized for seed filter or track fitter input. + digitizeWarningsOn_(true), + stubWindowSuggest_(settings, trackerTopology), // TMTT recommendations for stub window sizes to CMS. + degradeBend_(trackerTopology) // Used to degrade stub bend information. + { + // Determine tracker geometry version (T3, T4, T5 ...) + this->setTrackerGeometryVersion(trackerGeometry, trackerTopology); + + // Initialize tool to optionally emulate dead modules. + + if (not stubKillerInit_) { + stubKillerInit_ = true; + stubKiller_.initialise(settings->killScenario(), trackerTopology, trackerGeometry); + } -Stub::Stub(double phi, double r, double z, double bend, int layerid, bool psModule, bool barrel, unsigned int iphi, double alpha, const Settings* settings, const TrackerTopology* trackerTopology, unsigned int ID, unsigned int iPhiSec) : - phi_(phi), r_(r), z_(z), bend_(bend), iphi_(iphi), alpha_(alpha), psModule_(psModule), layerId_(layerid), endcapRing_(0), barrel_(barrel), - digitalStub_(settings, r, phi, z, iPhiSec), stubWindowSuggest_(settings) -{ //work in progress on better constructor for new hybrid - if (psModule && barrel) { - double zMax[4]; - settings->get_zMaxNonTilted(zMax); - tiltedBarrel_ = (fabs(z) > zMax[layerid]); - } else { - tiltedBarrel_ = false; - } - if (!psModule) { - stripPitch_ = settings->ssStripPitch(); nStrips_=settings->ssNStrips(); sigmaPar_=settings->ssStripLength()/std::sqrt(12.0); - } else { - stripPitch_ = settings->psStripPitch(); nStrips_=settings->psNStrips(); sigmaPar_=settings->psPixelLength()/std::sqrt(12.0); - } - sigmaPerp_ = stripPitch_/std::sqrt(12.0); - index_in_vStubs_ = ID; // A unique ID to label the stub. -} - -//=== Store useful info about stub (for use with TMTT tracking). - -Stub::Stub(const TTStubRef& ttStubRef, unsigned int index_in_vStubs, const Settings* settings, - const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology) : - TTStubRef(ttStubRef), - settings_(settings), - index_in_vStubs_(index_in_vStubs), - assocTP_(nullptr), // Initialize in case job is using no MC truth info. - digitalStub_(settings), - digitizedForGPinput_(false), // notes that stub has not yet been digitized for GP input. - digitizedForHTinput_(false), // notes that stub has not yet been digitized for HT input. - digitizedForSForTFinput_(""), // notes that stub has not yet been digitized for seed filter or track fitter input. - digitizeWarningsOn_(true), - stubWindowSuggest_(settings, trackerTopology), // TMTT recommendations for stub window sizes to CMS. - degradeBend_(trackerTopology) // Used to degrade stub bend information. -{ - // Determine tracker geometry version (T3, T4, T5 ...) - this->setTrackerGeometryVersion(trackerGeometry, trackerTopology); - - // Initialize tool to optionally emulate dead modules. - - if (not stubKillerInit_) { - stubKillerInit_ = true; - stubKiller_.initialise(settings->killScenario(), trackerTopology, trackerGeometry); - } - - - // Get coordinates of stub. - const TTStub *ttStubP = ttStubRef.get(); + // Get coordinates of stub. + const TTStub* ttStubP = ttStubRef.get(); - // The stub gives access to the DetId of the stacked module, but we want the DetId of the lower of - // the two sensors in the module. + // The stub gives access to the DetId of the stacked module, but we want the DetId of the lower of + // the two sensors in the module. - /* + /* // This the way CMS usually does this conversion, but it uses huge amounts of CPU. DetId geoDetId; for (const GeomDet* gd : trackerGeometry->dets()) { @@ -97,453 +125,473 @@ Stub::Stub(const TTStubRef& ttStubRef, unsigned int index_in_vStubs, const Setti if (geoDetId.null()) throw cms::Exception("Stub: Det ID corresponding to Stub not found"); */ - // This is a faster way we found of doing the conversion. It seems to work ... - DetId stackDetid = ttStubRef->getDetId(); - DetId geoDetId(stackDetid.rawId() + 1); - if ( not (trackerTopology->isLower(geoDetId) && trackerTopology->stack(geoDetId) == stackDetid) ) throw cms::Exception("Stub: determination of detId went wrong"); - - const GeomDetUnit* det0 = trackerGeometry->idToDetUnit( geoDetId ); - // To get other module, can do this - // const GeomDetUnit* det1 = trackerGeometry->idToDetUnit( trackerTopology->partnerDetId( geoDetId ) ); - - const PixelGeomDetUnit* theGeomDet = dynamic_cast< const PixelGeomDetUnit* >( det0 ); - const PixelTopology* topol = dynamic_cast< const PixelTopology* >( &(theGeomDet->specificTopology()) ); - MeasurementPoint measurementPoint = ttStubRef->clusterRef(0)->findAverageLocalCoordinatesCentered(); - LocalPoint clustlp = topol->localPosition(measurementPoint); - GlobalPoint pos = theGeomDet->surface().toGlobal(clustlp); + // This is a faster way we found of doing the conversion. It seems to work ... + DetId stackDetid = ttStubRef->getDetId(); + DetId geoDetId(stackDetid.rawId() + 1); + if (not(trackerTopology->isLower(geoDetId) && trackerTopology->stack(geoDetId) == stackDetid)) + throw cms::Exception("Stub: determination of detId went wrong"); + + const GeomDetUnit* det0 = trackerGeometry->idToDetUnit(geoDetId); + // To get other module, can do this + // const GeomDetUnit* det1 = trackerGeometry->idToDetUnit( trackerTopology->partnerDetId( geoDetId ) ); + + const PixelGeomDetUnit* theGeomDet = dynamic_cast(det0); + const PixelTopology* topol = dynamic_cast(&(theGeomDet->specificTopology())); + MeasurementPoint measurementPoint = ttStubRef->clusterRef(0)->findAverageLocalCoordinatesCentered(); + LocalPoint clustlp = topol->localPosition(measurementPoint); + GlobalPoint pos = theGeomDet->surface().toGlobal(clustlp); + + phi_ = pos.phi(); + r_ = pos.perp(); + z_ = pos.z(); + + if (r_ < settings_->trackerInnerRadius() || r_ > settings_->trackerOuterRadius() || + fabs(z_) > settings_->trackerHalfLength()) { + throw cms::Exception( + "Stub: Stub found outside assumed tracker volume. Please update tracker dimensions specified in Settings.h!") + << " r=" << r_ << " z=" << z_ << " " << ttStubRef->getDetId().subdetId() << endl; + } - phi_ = pos.phi(); - r_ = pos.perp(); - z_ = pos.z(); + // Set info about the module this stub is in + this->setModuleInfo(trackerGeometry, trackerTopology, geoDetId); + // Uncertainty in stub coordinates due to strip or pixel length in r-z. + if (barrel_) { + rErr_ = 0.; + zErr_ = 0.5 * stripLength_; + } else { + rErr_ = 0.5 * stripLength_; + zErr_ = 0.; + } - if (r_ < settings_->trackerInnerRadius() || r_ > settings_->trackerOuterRadius() || fabs(z_) > settings_->trackerHalfLength()) { - throw cms::Exception("Stub: Stub found outside assumed tracker volume. Please update tracker dimensions specified in Settings.h!")<<" r="<getDetId().subdetId()<clusterRef(iClus)->findAverageLocalCoordinatesCentered().x(); + localV_cluster_[iClus] = ttStubP->clusterRef(iClus)->findAverageLocalCoordinatesCentered().y(); + } - // Set info about the module this stub is in - this->setModuleInfo(trackerGeometry, trackerTopology, geoDetId); - // Uncertainty in stub coordinates due to strip or pixel length in r-z. - if (barrel_) { - rErr_ = 0.; - zErr_ = 0.5*stripLength_; - } else { - rErr_ = 0.5*stripLength_; - zErr_ = 0.; - } + // Get location of stub in module in units of strip number (or pixel number along finest granularity axis). + // Range from 0 to (nStrips - 1) inclusive. + // N.B. Since iphi is integer, this degrades the granularity by a factor 2. This seems silly, but track fit wants it. + iphi_ = localU_cluster_[0]; // granularity 1*strip (unclear why we want to degrade it ...) + + // Determine alpha correction for non-radial strips in endcap 2S modules. + // (If true hit at larger r than stub r by deltaR, then stub phi needs correcting by +alpha*deltaR). + alpha_ = 0.; + if ((not barrel_) && (not psModule_)) { + float fracPosInModule = (float(iphi_) - 0.5 * float(nStrips_)) / float(nStrips_); + float phiRelToModule = sensorWidth_ * fracPosInModule / r_; + if (z_ < 0) + phiRelToModule *= -1; + if (outerModuleAtSmallerR_) + phiRelToModule *= -1; // Module flipped. + // If true hit at larger r than stub r by deltaR, then stub phi needs correcting by +alpha*deltaR. + alpha_ = -phiRelToModule / r_; + } - // Get the coordinates of the two clusters that make up this stub, measured in units of strip pitch, and measured - // in the local frame of the sensor. They have a granularity of 0.5*pitch. - for (unsigned int iClus = 0; iClus <= 1; iClus++) { // Loop over two clusters in stub. - localU_cluster_[iClus] = ttStubP->clusterRef(iClus)->findAverageLocalCoordinatesCentered().x(); - localV_cluster_[iClus] = ttStubP->clusterRef(iClus)->findAverageLocalCoordinatesCentered().y(); - } + // Calculate constants used to interpret bend information. + + // float sensorSpacing = barrel_ ? (moduleMaxR_ - moduleMinR_) : (moduleMaxZ_ - moduleMinZ_); + // EJC Above not true for tilted modules + float sensorSpacing = sqrt((moduleMaxR_ - moduleMinR_) * (moduleMaxR_ - moduleMinR_) + + (moduleMaxZ_ - moduleMinZ_) * (moduleMaxZ_ - moduleMinZ_)); + + pitchOverSep_ = stripPitch_ / sensorSpacing; + // IRT - use stub (r,z) instead of module (r,z). Logically correct but has negligable effect on results. + // This old equation was valid for flat geom, where all modules are parallel or perpendicular to beam. + //dphiOverBend_ = barrel_ ? pitchOverSep_ : pitchOverSep_*fabs(z_)/r_; + // EJC - This new equation is valid in general case, so works for both flat and tilted geom. + dphiOverBendCorrection_ = fabs(cos(this->theta() - moduleTilt_) / sin(this->theta())); + dphiOverBendCorrection_approx_ = getApproxB(); + if (settings->useApproxB()) { + dphiOverBend_ = pitchOverSep_ * dphiOverBendCorrection_approx_; + } else { + dphiOverBend_ = pitchOverSep_ * dphiOverBendCorrection_; + } - // Get location of stub in module in units of strip number (or pixel number along finest granularity axis). - // Range from 0 to (nStrips - 1) inclusive. - // N.B. Since iphi is integer, this degrades the granularity by a factor 2. This seems silly, but track fit wants it. - iphi_ = localU_cluster_[0]; // granularity 1*strip (unclear why we want to degrade it ...) - - // Determine alpha correction for non-radial strips in endcap 2S modules. - // (If true hit at larger r than stub r by deltaR, then stub phi needs correcting by +alpha*deltaR). - alpha_ = 0.; - if ((not barrel_) && (not psModule_)) { - float fracPosInModule = (float(iphi_) - 0.5*float(nStrips_)) / float(nStrips_); - float phiRelToModule = sensorWidth_ * fracPosInModule / r_; - if (z_ < 0) phiRelToModule *= -1; - if (outerModuleAtSmallerR_) phiRelToModule *= -1; // Module flipped. - // If true hit at larger r than stub r by deltaR, then stub phi needs correcting by +alpha*deltaR. - alpha_ = -phiRelToModule /r_ ; - } + // Get stub bend that is available in front-end electronics, where bend is displacement between + // two hits in stubs in units of strip pitch. + bendInFrontend_ = ttStubRef->bendFE(); + if ((not barrel_) && pos.z() > 0) + bendInFrontend_ *= -1; + // EJC Bend in barrel seems to be flipped in tilted geom. + if (barrel_) + bendInFrontend_ *= -1; + + // Get stub bend that is available in off-detector electronics, allowing for degredation of + // bend resolution due to bit encoding by FE chip if required. + bool rejectStub = false; // indicates if bend is outside window assumed in DegradeBend.h + numMergedBend_ = 1; // Number of bend values merged into single degraded one. + if (settings->degradeBendRes() == 2) { + float degradedBend; // degraded bend + this->degradeResolution( + bendInFrontend_, degradedBend, rejectStub, numMergedBend_); // sets value of last 3 arguments. + bend_ = degradedBend; + } else if (settings->degradeBendRes() == 1) { + bend_ = ttStubRef->bendBE(); // Degraded bend from official CMS recipe. + if ((not barrel_) && pos.z() > 0) + bend_ *= -1; + if (barrel_) + bend_ *= -1; + } else { + bend_ = bendInFrontend_; + } - // Calculate constants used to interpret bend information. - - // float sensorSpacing = barrel_ ? (moduleMaxR_ - moduleMinR_) : (moduleMaxZ_ - moduleMinZ_); - // EJC Above not true for tilted modules - float sensorSpacing = sqrt( (moduleMaxR_ - moduleMinR_) * (moduleMaxR_ - moduleMinR_) + (moduleMaxZ_ - moduleMinZ_) * (moduleMaxZ_ - moduleMinZ_) ); - - pitchOverSep_ = stripPitch_/sensorSpacing; - // IRT - use stub (r,z) instead of module (r,z). Logically correct but has negligable effect on results. - // This old equation was valid for flat geom, where all modules are parallel or perpendicular to beam. - //dphiOverBend_ = barrel_ ? pitchOverSep_ : pitchOverSep_*fabs(z_)/r_; - // EJC - This new equation is valid in general case, so works for both flat and tilted geom. - dphiOverBendCorrection_ = fabs( cos( this->theta() - moduleTilt_ ) / sin( this->theta() ) ); - dphiOverBendCorrection_approx_ = getApproxB(); - if ( settings->useApproxB() ) { - dphiOverBend_ = pitchOverSep_ * dphiOverBendCorrection_approx_; - } - else{ - dphiOverBend_ = pitchOverSep_ * dphiOverBendCorrection_; + // Fill frontendPass_ flag, indicating if frontend readout electronics will output this stub. + this->setFrontend(rejectStub); + + // Calculate bin range along q/Pt axis of r-phi Hough transform array consistent with bend of this stub. + this->calcQoverPtrange(); + + // Initialize class used to produce digital version of stub, with original stub parameters pre-digitization. + digitalStub_.init(phi_, + r_, + z_, + min_qOverPt_bin_, + max_qOverPt_bin_, + layerId_, + this->layerIdReduced(), + bend_, + stripPitch_, + sensorSpacing, + rErr_, + zErr_, + barrel_, + tiltedBarrel_, + psModule_); + + // Update recommended stub window sizes that TMTT recommends that CMS should use in FE electronics. + if (settings_->printStubWindows()) + stubWindowSuggest_.process(this); + + // Initialize truth info to false in case job is using no MC truth info. + for (unsigned int iClus = 0; iClus <= 1; iClus++) { + assocTPofCluster_[iClus] = nullptr; + } } - // Get stub bend that is available in front-end electronics, where bend is displacement between - // two hits in stubs in units of strip pitch. - bendInFrontend_ = ttStubRef->bendFE(); - if ((not barrel_) && pos.z() > 0) bendInFrontend_ *= -1; - // EJC Bend in barrel seems to be flipped in tilted geom. - if (barrel_) bendInFrontend_ *= -1; - - // Get stub bend that is available in off-detector electronics, allowing for degredation of - // bend resolution due to bit encoding by FE chip if required. - bool rejectStub = false; // indicates if bend is outside window assumed in DegradeBend.h - numMergedBend_ = 1; // Number of bend values merged into single degraded one. - if (settings->degradeBendRes() == 2) { - float degradedBend; // degraded bend - this->degradeResolution(bendInFrontend_, - degradedBend, rejectStub, numMergedBend_); // sets value of last 3 arguments. - bend_ = degradedBend; - } else if (settings->degradeBendRes() == 1) { - bend_ = ttStubRef->bendBE(); // Degraded bend from official CMS recipe. - if ((not barrel_) && pos.z() > 0) bend_ *= -1; - if (barrel_) bend_ *= -1; - } else { - bend_ = bendInFrontend_; + //=== Calculate bin range along q/Pt axis of r-phi Hough transform array consistent with bend of this stub. + + void Stub::calcQoverPtrange() { + // First determine bin range along q/Pt axis of HT array + const int nbinsPt = + (int)settings_->houghNbinsPt(); // Use "int" as nasty things happen if multiply "int" and "unsigned int". + const int min_array_bin = 0; + const int max_array_bin = nbinsPt - 1; + // Now calculate range of q/Pt bins allowed by bend filter. + float qOverPtMin = this->qOverPtOverBend() * (this->bend() - this->bendRes()); + float qOverPtMax = this->qOverPtOverBend() * (this->bend() + this->bendRes()); + int houghNbinsPt = settings_->houghNbinsPt(); + const float houghMaxInvPt = 1. / settings_->houghMinPt(); + float qOverPtBinSize = (2. * houghMaxInvPt) / houghNbinsPt; + if (settings_->shape() == 2 || settings_->shape() == 1 || settings_->shape() == 3) // Non-square HT cells. + qOverPtBinSize = 2. * houghMaxInvPt / (houghNbinsPt - 1); + // Convert to bin number along q/Pt axis of HT array. + // N.B. For square HT cells, setting "tmp = -0.5" causeas cell to be accepted if q/Pt at its centre is consistent + // with the stub bend. Instead using "tmp = 0.0" accepts cells if q/Pt at any point in cell is consistent with bend. + // So if you use change from -0.5 to 0.0, you have to tighten the bend cut (by ~0.05) to get similar performance. + // Decision to set tmp = 0.0 taken in softare & GP firmware on 9th August 2016. + //float tmp = ( settings_->shape() == 2 || settings_->shape() == 1 || settings_->shape() == 3 ) ? 1. : -0.5; + + float tmp = (settings_->shape() == 2 || settings_->shape() == 1 || settings_->shape() == 3) ? 1. : 0.; + int min_bin = std::floor(-tmp + (qOverPtMin + houghMaxInvPt) / qOverPtBinSize); + int max_bin = std::floor(tmp + (qOverPtMax + houghMaxInvPt) / qOverPtBinSize); + + // Limit it to range of HT array. + min_bin = max(min_bin, min_array_bin); + max_bin = min(max_bin, max_array_bin); + // If min_bin > max_bin at this stage, it means that the Pt estimated from the bend is below the cutoff for track-finding. + // Keep min_bin > max_bin, so such stubs can be rejected, but set both variables to values inside the HT bin range. + if (min_bin > max_bin) { + min_bin = max_array_bin; + max_bin = min_array_bin; + //if (frontendPass_) throw cms::Exception("Stub: m bin calculation found low Pt stub not killed by FE electronics cuts")<enableDigitize()) { + // Save CPU by not redoing digitization if stub was already digitized for this phi sector. + if (!(digitizedForGPinput_ && digitalStub_.iGetNonant(iPhiSec) == digitalStub_.iDigi_Nonant())) { + // Digitize + digitalStub_.makeGPinput(iPhiSec); + + // Replace stub coordinates with those degraded by digitization process. + phi_ = digitalStub_.phi(); + r_ = digitalStub_.r(); + z_ = digitalStub_.z(); + bend_ = digitalStub_.bend(); + + // If the Stub class contains any data members that are not input to the GP, but are derived from variables that + // are, then be sure to update these here too, unless Stub.h uses the check*() functions to declare them invalid. + dphiOverBendCorrection_ = fabs(cos(this->theta() - moduleTilt_) / sin(this->theta())); + dphiOverBend_ = pitchOverSep_ * dphiOverBendCorrection_; + + // Note that stub has been digitized for GP input + digitizedForGPinput_ = true; + } + digitizedForHTinput_ = false; + } } - // Fill frontendPass_ flag, indicating if frontend readout electronics will output this stub. - this->setFrontend(rejectStub); - - // Calculate bin range along q/Pt axis of r-phi Hough transform array consistent with bend of this stub. - this->calcQoverPtrange(); - - // Initialize class used to produce digital version of stub, with original stub parameters pre-digitization. - digitalStub_.init(phi_, r_, z_, min_qOverPt_bin_, max_qOverPt_bin_, layerId_, this->layerIdReduced(), bend_, stripPitch_, sensorSpacing, rErr_, zErr_, barrel_, tiltedBarrel_, psModule_); - - // Update recommended stub window sizes that TMTT recommends that CMS should use in FE electronics. - if (settings_->printStubWindows()) stubWindowSuggest_.process(this); - - // Initialize truth info to false in case job is using no MC truth info. - for (unsigned int iClus = 0; iClus <= 1; iClus++) { - assocTPofCluster_[iClus] = nullptr; - } -} - -//=== Calculate bin range along q/Pt axis of r-phi Hough transform array consistent with bend of this stub. - -void Stub::calcQoverPtrange() { - // First determine bin range along q/Pt axis of HT array - const int nbinsPt = (int) settings_->houghNbinsPt(); // Use "int" as nasty things happen if multiply "int" and "unsigned int". - const int min_array_bin = 0; - const int max_array_bin = nbinsPt - 1; - // Now calculate range of q/Pt bins allowed by bend filter. - float qOverPtMin = this->qOverPtOverBend() * (this->bend() - this->bendRes()); - float qOverPtMax = this->qOverPtOverBend() * (this->bend() + this->bendRes()); - int houghNbinsPt = settings_->houghNbinsPt(); - const float houghMaxInvPt = 1./settings_->houghMinPt(); - float qOverPtBinSize = (2. * houghMaxInvPt)/houghNbinsPt; - if ( settings_->shape() == 2 || settings_->shape() == 1 || settings_->shape() == 3 ) // Non-square HT cells. - qOverPtBinSize = 2. * houghMaxInvPt / ( houghNbinsPt - 1 ); - // Convert to bin number along q/Pt axis of HT array. - // N.B. For square HT cells, setting "tmp = -0.5" causeas cell to be accepted if q/Pt at its centre is consistent - // with the stub bend. Instead using "tmp = 0.0" accepts cells if q/Pt at any point in cell is consistent with bend. - // So if you use change from -0.5 to 0.0, you have to tighten the bend cut (by ~0.05) to get similar performance. - // Decision to set tmp = 0.0 taken in softare & GP firmware on 9th August 2016. - //float tmp = ( settings_->shape() == 2 || settings_->shape() == 1 || settings_->shape() == 3 ) ? 1. : -0.5; - - float tmp = ( settings_->shape() == 2 || settings_->shape() == 1 || settings_->shape() == 3 ) ? 1. : 0.; - int min_bin = std::floor(-tmp + (qOverPtMin + houghMaxInvPt)/qOverPtBinSize); - int max_bin = std::floor( tmp + (qOverPtMax + houghMaxInvPt)/qOverPtBinSize); - - // Limit it to range of HT array. - min_bin = max(min_bin, min_array_bin); - max_bin = min(max_bin, max_array_bin); - // If min_bin > max_bin at this stage, it means that the Pt estimated from the bend is below the cutoff for track-finding. - // Keep min_bin > max_bin, so such stubs can be rejected, but set both variables to values inside the HT bin range. - if (min_bin > max_bin) { - min_bin = max_array_bin; - max_bin = min_array_bin; - //if (frontendPass_) throw cms::Exception("Stub: m bin calculation found low Pt stub not killed by FE electronics cuts")<enableDigitize()) { + // Save CPU by not redoing digitization if stub was already digitized for this phi sector. + if (!(digitizedForHTinput_ && iPhiSec == digitalStub_.iDigi_PhiSec())) { + // Call digitization for GP in case not already done. (Needed for variables that are common to GP & HT). + this->digitizeForGPinput(iPhiSec); -void Stub::digitizeForGPinput(unsigned int iPhiSec) { - if (settings_->enableDigitize()) { + // Digitize + digitalStub_.makeHTinput(iPhiSec); - // Save CPU by not redoing digitization if stub was already digitized for this phi sector. - if ( ! (digitizedForGPinput_ && digitalStub_.iGetNonant(iPhiSec) == digitalStub_.iDigi_Nonant()) ) { + // Since GP and HT use same digitisation in r and z, don't bother updating their values. + // (Actually, the phi digitisation boundaries also match, except for systolic array, so could skip updating phi too). - // Digitize - digitalStub_.makeGPinput(iPhiSec); + // Replace stub coordinates and bend with those degraded by digitization process. (Don't bother with r & z, as already done by GP digitisation). + phi_ = digitalStub_.phi(); - // Replace stub coordinates with those degraded by digitization process. - phi_ = digitalStub_.phi(); - r_ = digitalStub_.r(); - z_ = digitalStub_.z(); - bend_ = digitalStub_.bend(); + // Recalculate bin range along q/Pt axis of r-phi Hough transform array + // consistent with bend of this stub, since it depends on r & z which have now been digitized. + // (This recalculation should really be done in DigitalStub::makeHTinput(), but too lazy to move it there ...). + this->calcQoverPtrange(); - // If the Stub class contains any data members that are not input to the GP, but are derived from variables that - // are, then be sure to update these here too, unless Stub.h uses the check*() functions to declare them invalid. - dphiOverBendCorrection_ = fabs( cos( this->theta() - moduleTilt_ ) / sin( this->theta() ) ); - dphiOverBend_ = pitchOverSep_ * dphiOverBendCorrection_; + // If the Stub class contains any data members that are not input to the HT, but are derived from variables that + // are, then be sure to update these here too, unless Stub.h uses the check*() functions to declare them invalid. + // - currently none. - // Note that stub has been digitized for GP input - digitizedForGPinput_ = true; + // Note that stub has been digitized. + digitizedForHTinput_ = true; + } } - digitizedForHTinput_ = false; } -} - -//=== Digitize stub for input to Hough transform, with digitized phi coord. measured relative to specified phi sector. - -void Stub::digitizeForHTinput(unsigned int iPhiSec) { - - if (settings_->enableDigitize()) { - - // Save CPU by not redoing digitization if stub was already digitized for this phi sector. - if ( ! (digitizedForHTinput_ && iPhiSec == digitalStub_.iDigi_PhiSec()) ) { - - // Call digitization for GP in case not already done. (Needed for variables that are common to GP & HT). - this->digitizeForGPinput(iPhiSec); - - // Digitize - digitalStub_.makeHTinput(iPhiSec); - // Since GP and HT use same digitisation in r and z, don't bother updating their values. - // (Actually, the phi digitisation boundaries also match, except for systolic array, so could skip updating phi too). + //=== Digitize stub for input to r-z Seed Filter or Track Fitter. + //=== Argument is "SeedFilter" or name of Track Fitter. - // Replace stub coordinates and bend with those degraded by digitization process. (Don't bother with r & z, as already done by GP digitisation). - phi_ = digitalStub_.phi(); + void Stub::digitizeForSForTFinput(string SForTF) { + if (settings_->enableDigitize()) { + if (digitizedForSForTFinput_ != SForTF) { + // Digitize variables specific to seed filter or track fittr if not already done. + digitalStub_.makeSForTFinput(SForTF); - // Recalculate bin range along q/Pt axis of r-phi Hough transform array - // consistent with bend of this stub, since it depends on r & z which have now been digitized. - // (This recalculation should really be done in DigitalStub::makeHTinput(), but too lazy to move it there ...). - this->calcQoverPtrange(); + // Replace stub (r,z) uncertainties, estimated from half-pixel/strip-length, by those degraded by the digitization process. + rErr_ = digitalStub_.rErr(); + zErr_ = digitalStub_.zErr(); + // Must also replace stub r coordinate, as seed filter & fitters work with digitized r instead of digitized rT. + r_ = digitalStub_.r(); + // And KF may also redigitize z. + z_ = digitalStub_.z(); - // If the Stub class contains any data members that are not input to the HT, but are derived from variables that - // are, then be sure to update these here too, unless Stub.h uses the check*() functions to declare them invalid. - // - currently none. - - // Note that stub has been digitized. - digitizedForHTinput_ = true; + digitizedForSForTFinput_ = SForTF; + } } } -} - -//=== Digitize stub for input to r-z Seed Filter or Track Fitter. -//=== Argument is "SeedFilter" or name of Track Fitter. -void Stub::digitizeForSForTFinput(string SForTF) { - if (settings_->enableDigitize()) { + //=== Digitize stub for input to r-z Seed Filter. - if ( digitizedForSForTFinput_ != SForTF) { - // Digitize variables specific to seed filter or track fittr if not already done. - digitalStub_.makeSForTFinput(SForTF); - - // Replace stub (r,z) uncertainties, estimated from half-pixel/strip-length, by those degraded by the digitization process. - rErr_ = digitalStub_.rErr(); - zErr_ = digitalStub_.zErr(); - // Must also replace stub r coordinate, as seed filter & fitters work with digitized r instead of digitized rT. - r_ = digitalStub_.r(); - // And KF may also redigitize z. - z_ = digitalStub_.z(); - - digitizedForSForTFinput_ = SForTF; + void Stub::digitizeForDRinput(unsigned int stubId) { + if (settings_->enableDigitize()) { + // Digitize variables specific to seed filter if not already done. + digitalStub_.makeDRinput(stubId); + // digitizedForDRinput_ = true; } } -} - -//=== Digitize stub for input to r-z Seed Filter. -void Stub::digitizeForDRinput(unsigned int stubId) { - if (settings_->enableDigitize()) { - - // Digitize variables specific to seed filter if not already done. - digitalStub_.makeDRinput(stubId); - // digitizedForDRinput_ = true; - - } -} + //=== Restore stub to pre-digitized state. i.e. Undo what function digitize() did. -//=== Restore stub to pre-digitized state. i.e. Undo what function digitize() did. + void Stub::reset_digitize() { + if (settings_->enableDigitize()) { + // Save CPU by not undoing digitization if stub was not already digitized. + if (digitizedForGPinput_ || digitizedForHTinput_) { + // Replace stub coordinates and bend with original coordinates stored prior to any digitization. + phi_ = digitalStub_.orig_phi(); + r_ = digitalStub_.orig_r(); + z_ = digitalStub_.orig_z(); + bend_ = digitalStub_.orig_bend(); -void Stub::reset_digitize() { - if (settings_->enableDigitize()) { - // Save CPU by not undoing digitization if stub was not already digitized. - if (digitizedForGPinput_ || digitizedForHTinput_) { + // Also restore original uncertainties in stub coordinates (estimated from strip or pixel half-length). + rErr_ = digitalStub_.orig_rErr(); + zErr_ = digitalStub_.orig_zErr(); - // Replace stub coordinates and bend with original coordinates stored prior to any digitization. - phi_ = digitalStub_.orig_phi(); - r_ = digitalStub_.orig_r(); - z_ = digitalStub_.orig_z(); - bend_ = digitalStub_.orig_bend(); + // Note that stub is (no longer) digitized. + digitizedForGPinput_ = false; + digitizedForHTinput_ = false; + digitizedForSForTFinput_ = ""; - // Also restore original uncertainties in stub coordinates (estimated from strip or pixel half-length). - rErr_ = digitalStub_.orig_rErr(); - zErr_ = digitalStub_.orig_zErr(); + // If the Stub class contains any data members that are not input to the GP or HT, but are derived from + // variables that are, then be sure to update these here too. + dphiOverBendCorrection_ = fabs(cos(this->theta() - moduleTilt_) / sin(this->theta())); + dphiOverBend_ = pitchOverSep_ * dphiOverBendCorrection_; + } + } + } - // Note that stub is (no longer) digitized. - digitizedForGPinput_ = false; - digitizedForHTinput_ = false; - digitizedForSForTFinput_ = ""; + //=== Degrade assumed stub bend resolution. + //=== Also return boolean indicating if stub bend was outside assumed window, so stub should be rejected + //=== and return an integer indicating how many values of bend are merged into this single one. - // If the Stub class contains any data members that are not input to the GP or HT, but are derived from - // variables that are, then be sure to update these here too. - dphiOverBendCorrection_ = fabs( cos( this->theta() - moduleTilt_ ) / sin( this->theta() ) ); - dphiOverBend_ = pitchOverSep_ * dphiOverBendCorrection_; + void Stub::degradeResolution(float bend, float& degradedBend, bool& reject, unsigned int& num) const { + // If TMTT code is tightening official CMS FE stub window cuts, then calculate TMTT stub windows. + float windowFE; + if (settings_->killLowPtStubs()) { + // Window size corresponding to Pt cut used for tracking. + float invPtMax = 1. / (settings_->houghMinPt()); + windowFE = invPtMax / fabs(this->qOverPtOverBend()); + // Increase half-indow size to allow for resolution in bend. + windowFE += this->bendResInFrontend(); + } else { + windowFE = 99999.; // TMTT is not tightening windows. } - } -} - -//=== Degrade assumed stub bend resolution. -//=== Also return boolean indicating if stub bend was outside assumed window, so stub should be rejected -//=== and return an integer indicating how many values of bend are merged into this single one. - -void Stub::degradeResolution(float bend, - float& degradedBend, bool& reject, unsigned int& num) const { - - // If TMTT code is tightening official CMS FE stub window cuts, then calculate TMTT stub windows. - float windowFE; - if (settings_->killLowPtStubs()) { - // Window size corresponding to Pt cut used for tracking. - float invPtMax = 1./(settings_->houghMinPt()); - windowFE = invPtMax/fabs(this->qOverPtOverBend()); - // Increase half-indow size to allow for resolution in bend. - windowFE += this->bendResInFrontend(); - } else { - windowFE = 99999.; // TMTT is not tightening windows. - } - static bool firstErr = true; - if (trackerGeometryVersion_ != "T5") { // Tilted geometry - if (firstErr) { - cout<<"Stub: WARNING - Stub windows in DegradeBend class have not been tuned for this tracker geometry, so may need retuning "<eta()) > settings_->maxStubEta() ) frontendPass_ = false; - // Don't use stubs whose Pt is significantly below the Pt cut used in the L1 tracking, allowing for uncertainty in q/Pt due to stub bend resolution. - if (settings_->killLowPtStubs()) { - const float qOverPtCut = 1./settings_->houghMinPt(); - // Apply this cut in the front-end electronics. - if (fabs(this->bendInFrontend()) - this->bendResInFrontend() > qOverPtCut/this->qOverPtOverBend()) frontendPass_ = false; - // Reapply the same cut using the degraded bend information available in the off-detector electronics. - // The reason is that the bend degredation can move the Pt below the Pt cut, making the stub useless to the off-detector electronics. - if (fabs(this->bend()) - this->bendRes() > qOverPtCut/this->qOverPtOverBend()) frontendPass_ = false; - } - // Don't use stubs whose bend is outside the window encoded into DegradeBend.h - if (rejectStub) { - if (frontendPass_) stubFailedDegradeWindow_ = true; - frontendPass_ = false; - } + degradeBend_.degrade(bend, psModule_, idDet_, windowFE, degradedBend, reject, num); + } + + //=== Set flag indicating if stub will be output by front-end readout electronics + //=== (where we can reconfigure the stub window size and rapidity cut). + //=== Argument indicates if stub bend was outside window size encoded in DegradeBend.h + //=== Note that this should run on quantities as available inside front-end chip, which are not + //=== degraded by loss of bits or digitisation. + + void Stub::setFrontend(bool rejectStub) { + frontendPass_ = true; // Did stub pass cuts applied in front-end chip + stubFailedDegradeWindow_ = false; // Did it only fail cuts corresponding to windows encoded in DegradeBend.h? + // Don't use stubs at large eta, since it is impossible to form L1 tracks from them, so they only contribute to combinatorics. + if (fabs(this->eta()) > settings_->maxStubEta()) + frontendPass_ = false; + // Don't use stubs whose Pt is significantly below the Pt cut used in the L1 tracking, allowing for uncertainty in q/Pt due to stub bend resolution. + if (settings_->killLowPtStubs()) { + const float qOverPtCut = 1. / settings_->houghMinPt(); + // Apply this cut in the front-end electronics. + if (fabs(this->bendInFrontend()) - this->bendResInFrontend() > qOverPtCut / this->qOverPtOverBend()) + frontendPass_ = false; + // Reapply the same cut using the degraded bend information available in the off-detector electronics. + // The reason is that the bend degredation can move the Pt below the Pt cut, making the stub useless to the off-detector electronics. + if (fabs(this->bend()) - this->bendRes() > qOverPtCut / this->qOverPtOverBend()) + frontendPass_ = false; + } + // Don't use stubs whose bend is outside the window encoded into DegradeBend.h + if (rejectStub) { + if (frontendPass_) + stubFailedDegradeWindow_ = true; + frontendPass_ = false; + } - // Emulate stubs in dead tracker regions using private TMTT emulation. - if (settings_->deadSimulateFrac() > 0.) { // Is option to emulate dead modules enabled? - const DeadModuleDB dead; - if (dead.killStub(this)) { - static TRandom randomGenerator; - if (randomGenerator.Rndm() < settings_->deadSimulateFrac()) frontendPass_ = false; + // Emulate stubs in dead tracker regions using private TMTT emulation. + if (settings_->deadSimulateFrac() > 0.) { // Is option to emulate dead modules enabled? + const DeadModuleDB dead; + if (dead.killStub(this)) { + static TRandom randomGenerator; + if (randomGenerator.Rndm() < settings_->deadSimulateFrac()) + frontendPass_ = false; + } } - } - // Or emulate stubs in dead tracker regions using communal emulation shared with Tracklet. - if (settings_->killScenario() > 0) { - TTStubRef ttStubRef(*this); // Cast to base class - bool kill = stubKiller_.killStub(ttStubRef.get()); - if (kill) frontendPass_ = false; + // Or emulate stubs in dead tracker regions using communal emulation shared with Tracklet. + if (settings_->killScenario() > 0) { + TTStubRef ttStubRef(*this); // Cast to base class + bool kill = stubKiller_.killStub(ttStubRef.get()); + if (kill) + frontendPass_ = false; + } } -} -//=== Function to calculate approximation for dphiOverBendCorrection aka B -double Stub::getApproxB() { - if ( tiltedBarrel_ ) { - return settings_->bApprox_gradient() * fabs(z_)/r_ + settings_->bApprox_intercept(); - } - else { - return barrel_ ? 1 : fabs(z_)/r_; + //=== Function to calculate approximation for dphiOverBendCorrection aka B + double Stub::getApproxB() { + if (tiltedBarrel_) { + return settings_->bApprox_gradient() * fabs(z_) / r_ + settings_->bApprox_intercept(); + } else { + return barrel_ ? 1 : fabs(z_) / r_; + } } -} - -//=== Note which tracking particle(s), if any, produced this stub. -//=== The 1st argument is a map relating TrackingParticles to TP. -void Stub::fillTruth(const map, const TP* >& translateTP, const edm::Handle& mcTruthTTStubHandle, const edm::Handle& mcTruthTTClusterHandle){ + //=== Note which tracking particle(s), if any, produced this stub. + //=== The 1st argument is a map relating TrackingParticles to TP. - TTStubRef ttStubRef(*this); // Cast to base class + void Stub::fillTruth(const map, const TP*>& translateTP, + const edm::Handle& mcTruthTTStubHandle, + const edm::Handle& mcTruthTTClusterHandle) { + TTStubRef ttStubRef(*this); // Cast to base class - //--- Fill assocTP_ info. If both clusters in this stub were produced by the same single tracking particle, find out which one it was. + //--- Fill assocTP_ info. If both clusters in this stub were produced by the same single tracking particle, find out which one it was. - bool genuine = mcTruthTTStubHandle->isGenuine(ttStubRef); // Same TP contributed to both clusters? - assocTP_ = nullptr; + bool genuine = mcTruthTTStubHandle->isGenuine(ttStubRef); // Same TP contributed to both clusters? + assocTP_ = nullptr; - // Require same TP contributed to both clusters. - if ( genuine ) { - edm::Ptr< TrackingParticle > tpPtr = mcTruthTTStubHandle->findTrackingParticlePtr(ttStubRef); - if (translateTP.find(tpPtr) != translateTP.end()) { - assocTP_ = translateTP.at(tpPtr); - // N.B. Since not all tracking particles are stored in InputData::vTPs_, sometimes no match will be found. + // Require same TP contributed to both clusters. + if (genuine) { + edm::Ptr tpPtr = mcTruthTTStubHandle->findTrackingParticlePtr(ttStubRef); + if (translateTP.find(tpPtr) != translateTP.end()) { + assocTP_ = translateTP.at(tpPtr); + // N.B. Since not all tracking particles are stored in InputData::vTPs_, sometimes no match will be found. + } } - } - - // Fill assocTPs_ info. - if (settings_->stubMatchStrict()) { + // Fill assocTPs_ info. - // We consider only stubs in which this TP contributed to both clusters. - if (assocTP_ != nullptr) assocTPs_.insert(assocTP_); + if (settings_->stubMatchStrict()) { + // We consider only stubs in which this TP contributed to both clusters. + if (assocTP_ != nullptr) + assocTPs_.insert(assocTP_); - } else { - - // We consider stubs in which this TP contributed to either cluster. + } else { + // We consider stubs in which this TP contributed to either cluster. - for (unsigned int iClus = 0; iClus <= 1; iClus++) { // Loop over both clusters that make up stub. - const TTClusterRef& ttClusterRef = ttStubRef->clusterRef(iClus); + for (unsigned int iClus = 0; iClus <= 1; iClus++) { // Loop over both clusters that make up stub. + const TTClusterRef& ttClusterRef = ttStubRef->clusterRef(iClus); - // Now identify all TP's contributing to either cluster in stub. - vector< edm::Ptr< TrackingParticle > > vecTpPtr = mcTruthTTClusterHandle->findTrackingParticlePtrs(ttClusterRef); + // Now identify all TP's contributing to either cluster in stub. + vector > vecTpPtr = mcTruthTTClusterHandle->findTrackingParticlePtrs(ttClusterRef); - for (edm::Ptr< TrackingParticle> tpPtr : vecTpPtr) { - if (translateTP.find(tpPtr) != translateTP.end()) { - assocTPs_.insert( translateTP.at(tpPtr) ); - // N.B. Since not all tracking particles are stored in InputData::vTPs_, sometimes no match will be found. - } + for (edm::Ptr tpPtr : vecTpPtr) { + if (translateTP.find(tpPtr) != translateTP.end()) { + assocTPs_.insert(translateTP.at(tpPtr)); + // N.B. Since not all tracking particles are stored in InputData::vTPs_, sometimes no match will be found. + } + } } } - } - //--- Also note which tracking particles produced the two clusters that make up the stub + //--- Also note which tracking particles produced the two clusters that make up the stub - for (unsigned int iClus = 0; iClus <= 1; iClus++) { // Loop over both clusters that make up stub. - const TTClusterRef& ttClusterRef = ttStubRef->clusterRef(iClus); + for (unsigned int iClus = 0; iClus <= 1; iClus++) { // Loop over both clusters that make up stub. + const TTClusterRef& ttClusterRef = ttStubRef->clusterRef(iClus); - bool genuineCluster = mcTruthTTClusterHandle->isGenuine(ttClusterRef); // Only 1 TP made cluster? - assocTPofCluster_[iClus] = nullptr; + bool genuineCluster = mcTruthTTClusterHandle->isGenuine(ttClusterRef); // Only 1 TP made cluster? + assocTPofCluster_[iClus] = nullptr; - // Only consider clusters produced by just one TP. - if ( genuineCluster ) { - edm::Ptr< TrackingParticle > tpPtr = mcTruthTTClusterHandle->findTrackingParticlePtr(ttClusterRef); + // Only consider clusters produced by just one TP. + if (genuineCluster) { + edm::Ptr tpPtr = mcTruthTTClusterHandle->findTrackingParticlePtr(ttClusterRef); - if (translateTP.find(tpPtr) != translateTP.end()) { - assocTPofCluster_[iClus] = translateTP.at(tpPtr); - // N.B. Since not all tracking particles are stored in InputData::vTPs_, sometimes no match will be found. + if (translateTP.find(tpPtr) != translateTP.end()) { + assocTPofCluster_[iClus] = translateTP.at(tpPtr); + // N.B. Since not all tracking particles are stored in InputData::vTPs_, sometimes no match will be found. + } } } - } - // Sanity check - is truth info of stub consistent with that of its clusters? - // Commented this out, as it throws errors for unknown reason with iErr=1. Apparently, "genuine" stubs can be composed of two clusters that are - // not "genuine", providing that one of the TP that contributed to each cluster was the same. - /* + // Sanity check - is truth info of stub consistent with that of its clusters? + // Commented this out, as it throws errors for unknown reason with iErr=1. Apparently, "genuine" stubs can be composed of two clusters that are + // not "genuine", providing that one of the TP that contributed to each cluster was the same. + /* unsigned int iErr = 0; if (this->genuine()) { // Stub matches truth particle if ( ! ( this->genuineCluster()[0] && (this->assocTPofCluster()[0] == this->assocTPofCluster()[1]) ) ) iErr = 1; @@ -559,170 +607,183 @@ void Stub::fillTruth(const map, const TP* >& transl // throw cms::Exception("Stub: Truth info of stub & its clusters inconsistent!")< Stub::trkPhiAtR(float rad) const { - float rStubMax = r_ + rErr_; // Uncertainty in radial stub coordinate due to strip length. - float rStubMin = r_ - rErr_; - float trkPhi1 = (phi_ + dphi()*(1. - rad/rStubMin)); - float trkPhi2 = (phi_ + dphi()*(1. - rad/rStubMax)); - float trkPhi = 0.5* (trkPhi1 + trkPhi2); - float errTrkPhi = 0.5*fabs(trkPhi1 - trkPhi2); - return pair(trkPhi, errTrkPhi); -} + } + //=== Estimated phi angle at which track intercepts a given radius rad, based on stub bend info. Also estimate uncertainty on this angle due to endcap 2S module strip length. + //=== N.B. This is identical to Stub::beta() if rad=0. -//=== Note if stub is a crazy distance from the tracking particle trajectory that produced it. -//=== If so, it was probably produced by a delta ray. + pair Stub::trkPhiAtR(float rad) const { + float rStubMax = r_ + rErr_; // Uncertainty in radial stub coordinate due to strip length. + float rStubMin = r_ - rErr_; + float trkPhi1 = (phi_ + dphi() * (1. - rad / rStubMin)); + float trkPhi2 = (phi_ + dphi() * (1. - rad / rStubMax)); + float trkPhi = 0.5 * (trkPhi1 + trkPhi2); + float errTrkPhi = 0.5 * fabs(trkPhi1 - trkPhi2); + return pair(trkPhi, errTrkPhi); + } -bool Stub::crazyStub() const { + //=== Note if stub is a crazy distance from the tracking particle trajectory that produced it. + //=== If so, it was probably produced by a delta ray. - bool crazy; - if (assocTP_ == nullptr) { - crazy = false; // Stub is fake, but this is not crazy. It happens ... - } else { - // Stub was produced by TP. Check it lies not too far from TP trajectory. - crazy = fabs( reco::deltaPhi(phi_, assocTP_->trkPhiAtStub( this )) ) > settings_->crazyStubCut(); - } - return crazy; -} - -//=== Get reduced layer ID (in range 1-7), which can be packed into 3 bits so simplifying the firmware). - -unsigned int Stub::layerIdReduced() const { - // Don't bother distinguishing two endcaps, as no track can have stubs in both. - unsigned int lay = (layerId_ < 20) ? layerId_ : layerId_ - 10; - - // No genuine track can have stubs in both barrel layer 6 and endcap disk 11 etc., so merge their layer IDs. - // WARNING: This is tracker geometry dependent, so may need changing in future ... - if (lay == 6) lay = 11; - if (lay == 5) lay = 12; - if (lay == 4) lay = 13; - if (lay == 3) lay = 15; - // At this point, the reduced layer ID can have values of 1, 2, 11, 12, 13, 14, 15. So correct to put in range 1-7. - if (lay > 10) lay -= 8; - - if (lay < 1 || lay > 7) throw cms::Exception("Stub: Reduced layer ID out of expected range"); - - return lay; -} - - -//=== Set info about the module that this stub is in. - -void Stub::setModuleInfo(const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology, const DetId& detId) { - - idDet_ = detId; - - // Note if module is PS or 2S, and whether in barrel or endcap. - psModule_ = trackerGeometry->getDetectorType( detId ) == TrackerGeometry::ModuleType::Ph2PSP; // From https://github.com/cms-sw/cmssw/blob/CMSSW_8_1_X/Geometry/TrackerGeometryBuilder/README.md - barrel_ = detId.subdetId()==StripSubdetector::TOB || detId.subdetId()==StripSubdetector::TIB; - - // Get min & max (r,phi,z) coordinates of the centre of the two sensors containing this stub. - const GeomDetUnit* det0 = trackerGeometry->idToDetUnit( detId ); - const GeomDetUnit* det1 = trackerGeometry->idToDetUnit( trackerTopology->partnerDetId( detId ) ); - - float R0 = det0->position().perp(); - float R1 = det1->position().perp(); - float PHI0 = det0->position().phi(); - float PHI1 = det1->position().phi(); - float Z0 = det0->position().z(); - float Z1 = det1->position().z(); - moduleMinR_ = std::min(R0,R1); - moduleMaxR_ = std::max(R0,R1); - moduleMinPhi_ = std::min(PHI0,PHI1); - moduleMaxPhi_ = std::max(PHI0,PHI1); - moduleMinZ_ = std::min(Z0,Z1); - moduleMaxZ_ = std::max(Z0,Z1); - - // Note if tilted barrel module & get title angle (in range 0 to PI). - tiltedBarrel_ = barrel_ && (trackerTopology->tobSide(detId) != 3); - float deltaR = fabs(R1 - R0); - float deltaZ = (R1 - R0 > 0) ? (Z1 - Z0) : - (Z1 - Z0); - moduleTilt_ = atan2( deltaR, deltaZ); - if (moduleTilt_ > M_PI/2.) moduleTilt_ -= M_PI; // Put in range -PI/2 to +PI/2. - if (moduleTilt_ < -M_PI/2.) moduleTilt_ += M_PI; // - - // cout<<"DEBUG STUB "<layer( detId ); // barrel layer 1-6 encoded as 1-6 - } else { - // layerId_ = 10*detId.iSide() + detId.iDisk(); // endcap layer 1-5 encoded as 11-15 (endcap A) or 21-25 (endcapB) - // EJC This seems to give the same encoding as what we had in CMSSW6 - layerId_ = 10*trackerTopology->side( detId ) + trackerTopology->tidWheel( detId ); - } + bool Stub::crazyStub() const { + bool crazy; + if (assocTP_ == nullptr) { + crazy = false; // Stub is fake, but this is not crazy. It happens ... + } else { + // Stub was produced by TP. Check it lies not too far from TP trajectory. + crazy = fabs(reco::deltaPhi(phi_, assocTP_->trkPhiAtStub(this))) > settings_->crazyStubCut(); + } + return crazy; + } + + //=== Get reduced layer ID (in range 1-7), which can be packed into 3 bits so simplifying the firmware). + + unsigned int Stub::layerIdReduced() const { + // Don't bother distinguishing two endcaps, as no track can have stubs in both. + unsigned int lay = (layerId_ < 20) ? layerId_ : layerId_ - 10; + + // No genuine track can have stubs in both barrel layer 6 and endcap disk 11 etc., so merge their layer IDs. + // WARNING: This is tracker geometry dependent, so may need changing in future ... + if (lay == 6) + lay = 11; + if (lay == 5) + lay = 12; + if (lay == 4) + lay = 13; + if (lay == 3) + lay = 15; + // At this point, the reduced layer ID can have values of 1, 2, 11, 12, 13, 14, 15. So correct to put in range 1-7. + if (lay > 10) + lay -= 8; + + if (lay < 1 || lay > 7) + throw cms::Exception("Stub: Reduced layer ID out of expected range"); + + return lay; + } + + //=== Set info about the module that this stub is in. + + void Stub::setModuleInfo(const TrackerGeometry* trackerGeometry, + const TrackerTopology* trackerTopology, + const DetId& detId) { + idDet_ = detId; + + // Note if module is PS or 2S, and whether in barrel or endcap. + psModule_ = + trackerGeometry->getDetectorType(detId) == + TrackerGeometry::ModuleType:: + Ph2PSP; // From https://github.com/cms-sw/cmssw/blob/CMSSW_8_1_X/Geometry/TrackerGeometryBuilder/README.md + barrel_ = detId.subdetId() == StripSubdetector::TOB || detId.subdetId() == StripSubdetector::TIB; + + // Get min & max (r,phi,z) coordinates of the centre of the two sensors containing this stub. + const GeomDetUnit* det0 = trackerGeometry->idToDetUnit(detId); + const GeomDetUnit* det1 = trackerGeometry->idToDetUnit(trackerTopology->partnerDetId(detId)); + + float R0 = det0->position().perp(); + float R1 = det1->position().perp(); + float PHI0 = det0->position().phi(); + float PHI1 = det1->position().phi(); + float Z0 = det0->position().z(); + float Z1 = det1->position().z(); + moduleMinR_ = std::min(R0, R1); + moduleMaxR_ = std::max(R0, R1); + moduleMinPhi_ = std::min(PHI0, PHI1); + moduleMaxPhi_ = std::max(PHI0, PHI1); + moduleMinZ_ = std::min(Z0, Z1); + moduleMaxZ_ = std::max(Z0, Z1); + + // Note if tilted barrel module & get title angle (in range 0 to PI). + tiltedBarrel_ = barrel_ && (trackerTopology->tobSide(detId) != 3); + float deltaR = fabs(R1 - R0); + float deltaZ = (R1 - R0 > 0) ? (Z1 - Z0) : -(Z1 - Z0); + moduleTilt_ = atan2(deltaR, deltaZ); + if (moduleTilt_ > M_PI / 2.) + moduleTilt_ -= M_PI; // Put in range -PI/2 to +PI/2. + if (moduleTilt_ < -M_PI / 2.) + moduleTilt_ += M_PI; // + + // cout<<"DEBUG STUB "<layer(detId); // barrel layer 1-6 encoded as 1-6 + } else { + // layerId_ = 10*detId.iSide() + detId.iDisk(); // endcap layer 1-5 encoded as 11-15 (endcap A) or 21-25 (endcapB) + // EJC This seems to give the same encoding as what we had in CMSSW6 + layerId_ = 10 * trackerTopology->side(detId) + trackerTopology->tidWheel(detId); + } - // Note module ring in endcap - endcapRing_ = barrel_ ? 0 : trackerTopology->tidRing( detId ); + // Note module ring in endcap + endcapRing_ = barrel_ ? 0 : trackerTopology->tidRing(detId); - if (trackerGeometryVersion_ == "T5") { - if ( ! barrel_) { - // Apply bodge, since Topology class annoyingly starts ring count at 1, even in endcap wheels where - // inner rings are absent. - unsigned int iWheel = trackerTopology->tidWheel( detId ); - if (iWheel >= 3 && iWheel <=5) endcapRing_ += 3; + if (trackerGeometryVersion_ == "T5") { + if (!barrel_) { + // Apply bodge, since Topology class annoyingly starts ring count at 1, even in endcap wheels where + // inner rings are absent. + unsigned int iWheel = trackerTopology->tidWheel(detId); + if (iWheel >= 3 && iWheel <= 5) + endcapRing_ += 3; + } } - } - // Get sensor strip or pixel pitch using innermost sensor of pair. + // Get sensor strip or pixel pitch using innermost sensor of pair. - const PixelGeomDetUnit* unit = reinterpret_cast( det0 ); - const PixelTopology& topo = unit->specificTopology(); - const Bounds& bounds = det0->surface().bounds(); + const PixelGeomDetUnit* unit = reinterpret_cast(det0); + const PixelTopology& topo = unit->specificTopology(); + const Bounds& bounds = det0->surface().bounds(); - std::pair pitch = topo.pitch(); - stripPitch_ = pitch.first; // Strip pitch (or pixel pitch along shortest axis) - stripLength_ = pitch.second; // Strip length (or pixel pitch along longest axis) - nStrips_ = topo.nrows(); // No. of strips in sensor - sensorWidth_ = bounds.width(); // Width of sensitive region of sensor (= stripPitch * nStrips). + std::pair pitch = topo.pitch(); + stripPitch_ = pitch.first; // Strip pitch (or pixel pitch along shortest axis) + stripLength_ = pitch.second; // Strip length (or pixel pitch along longest axis) + nStrips_ = topo.nrows(); // No. of strips in sensor + sensorWidth_ = bounds.width(); // Width of sensitive region of sensor (= stripPitch * nStrips). - // Note if modules are flipped back-to-front. - outerModuleAtSmallerR_ = ( det0->position().mag() > det1->position().mag() ); - /* + // Note if modules are flipped back-to-front. + outerModuleAtSmallerR_ = (det0->position().mag() > det1->position().mag()); + /* if ( barrel_ && det0->position().perp() > det1->position().perp() ) { outerModuleAtSmallerR_ = true; } */ - sigmaPerp_ = stripPitch_/sqrt(12.); // resolution perpendicular to strip (or to longest pixel axis) - sigmaPar_ = stripLength_/sqrt(12.); // resolution parallel to strip (or to longest pixel axis) -} - -//=== Determine tracker geometry version by counting modules. + sigmaPerp_ = stripPitch_ / sqrt(12.); // resolution perpendicular to strip (or to longest pixel axis) + sigmaPar_ = stripLength_ / sqrt(12.); // resolution parallel to strip (or to longest pixel axis) + } -void Stub::setTrackerGeometryVersion(const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology) { + //=== Determine tracker geometry version by counting modules. - // N.B. The relationship between Tracker geometry name (T3, T4, T5 ...) and CMS geometry name - // (D13, D17 ...) is documented in - // https://github.com/cms-sw/cmssw/blob/CMSSW_9_1_X/Configuration/Geometry/README.md . + void Stub::setTrackerGeometryVersion(const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology) { + // N.B. The relationship between Tracker geometry name (T3, T4, T5 ...) and CMS geometry name + // (D13, D17 ...) is documented in + // https://github.com/cms-sw/cmssw/blob/CMSSW_9_1_X/Configuration/Geometry/README.md . - if (trackerGeometryVersion_ == "UNKNOWN") { - unsigned int numDet = 0; - for (const GeomDet* gd : trackerGeometry->dets()) { - DetId detid = gd->geographicalId(); - if (detid.subdetId() != StripSubdetector::TOB || detid.subdetId() != StripSubdetector::TID) { // Phase 2 Outer Tracker uses TOB for entire barrel & TID for entire endcap. - if ( trackerTopology->isLower(detid) ) { // Select only lower of the two sensors in a module. - numDet++; + if (trackerGeometryVersion_ == "UNKNOWN") { + unsigned int numDet = 0; + for (const GeomDet* gd : trackerGeometry->dets()) { + DetId detid = gd->geographicalId(); + if (detid.subdetId() != StripSubdetector::TOB || + detid.subdetId() != + StripSubdetector::TID) { // Phase 2 Outer Tracker uses TOB for entire barrel & TID for entire endcap. + if (trackerTopology->isLower(detid)) { // Select only lower of the two sensors in a module. + numDet++; + } } } - } - if (numDet == 13296) { - trackerGeometryVersion_ = "T5"; // Tilted geometry - } else if (numDet == 13556) { - trackerGeometryVersion_ = "T3"; // Older tilted geometry - } else if (numDet == 14850) { - trackerGeometryVersion_ = "T4"; // Flat geometry - } else { - trackerGeometryVersion_ = "UNRECOGNISED"; - cout<<"Stub: WARNING -- The tracker geometry you are using is yet not known to the stub class. Please update Stub::degradeResolution() & Stub::setTrackerGeometryVersion(). Number of tracker modules = "<idDet()); - - // Modified by TMTT group, so we can update the numbers in the window size arrays. - //int window = 0; - - if (stDetId.subdetId()==StripSubdetector::TOB) - { - unsigned int layer = theTrackerTopo_->layer(stDetId); - unsigned int ladder = theTrackerTopo_->tobRod(stDetId); - int type = 2*theTrackerTopo_->tobSide(stDetId)-3; // -1 for tilted-, 1 for tilted+, 3 for flat - double corr=0; - - if (type<3) // Only for tilted modules - { - corr = (barrelNTilt_.at(layer)+1)/2.; - ladder = corr-(corr-ladder)*type; // Corrected ring number, bet 0 and barrelNTilt.at(layer), in ascending |z| - // Modified by TMTT group, to expland arrays if necessary, divide by 2, & update the stored window sizes. - if (tiltedCut_.size() < (layer+1)) tiltedCut_.resize(layer+1); - if (tiltedCut_.at(layer).size() < (ladder+1)) tiltedCut_.at(layer).resize(ladder+1, 0.); - double& storedHalfWindow = (tiltedCut_.at(layer)).at(ladder); - if (storedHalfWindow < bendHalfWind) storedHalfWindow = bendHalfWind; + //=== Update stored stub window size with this stub. + + void StubWindowSuggest::updateStoredWindow(const Stub* stub, double bendHalfWind) { + // Values set according to L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py + // parameter NTiltedRings for whichever tracker geometry (T3, T4, T5 ...) is used.. + const vector barrelNTilt_T5_init = {0., 12., 12., 12., 0., 0., 0.}; + if (stub->trackerGeometryVersion() == "T5") { + barrelNTilt_ = barrelNTilt_T5_init; + } else { + throw cms::Exception( + "StubWindowSuggest: the tracker geometry you are using is not yet known to StubWindowSuggest. Please update " + "constant barrelNTilt_T*_init inside it.") + << " Geometry=" << stub->trackerGeometryVersion() << endl; } - else // Classic barrel window otherwise - { - // Modified by TMTT group, to expland arrays if necessary, divide by 2, & update the stored window sizes. - if (barrelCut_.size() < (layer+1)) barrelCut_.resize(layer+1, 0.); - double& storedHalfWindow = barrelCut_.at( layer ); - if (storedHalfWindow < bendHalfWind) storedHalfWindow = bendHalfWind; + + // This code should be kept almost identical to that in + // L1Trigger/TrackTrigger/src/TTStubAlgorithm_official.cc + // The only exceptions are lines marked "Modified by TMTT group" + + DetId stDetId(stub->idDet()); + + // Modified by TMTT group, so we can update the numbers in the window size arrays. + //int window = 0; + + if (stDetId.subdetId() == StripSubdetector::TOB) { + unsigned int layer = theTrackerTopo_->layer(stDetId); + unsigned int ladder = theTrackerTopo_->tobRod(stDetId); + int type = 2 * theTrackerTopo_->tobSide(stDetId) - 3; // -1 for tilted-, 1 for tilted+, 3 for flat + double corr = 0; + + if (type < 3) // Only for tilted modules + { + corr = (barrelNTilt_.at(layer) + 1) / 2.; + ladder = + corr - (corr - ladder) * type; // Corrected ring number, bet 0 and barrelNTilt.at(layer), in ascending |z| + // Modified by TMTT group, to expland arrays if necessary, divide by 2, & update the stored window sizes. + if (tiltedCut_.size() < (layer + 1)) + tiltedCut_.resize(layer + 1); + if (tiltedCut_.at(layer).size() < (ladder + 1)) + tiltedCut_.at(layer).resize(ladder + 1, 0.); + double& storedHalfWindow = (tiltedCut_.at(layer)).at(ladder); + if (storedHalfWindow < bendHalfWind) + storedHalfWindow = bendHalfWind; + } else // Classic barrel window otherwise + { + // Modified by TMTT group, to expland arrays if necessary, divide by 2, & update the stored window sizes. + if (barrelCut_.size() < (layer + 1)) + barrelCut_.resize(layer + 1, 0.); + double& storedHalfWindow = barrelCut_.at(layer); + if (storedHalfWindow < bendHalfWind) + storedHalfWindow = bendHalfWind; + } + + } else if (stDetId.subdetId() == StripSubdetector::TID) { + // Modified by TMTT group, to expland arrays if necessary, divide by 2, & update the stored window sizes + unsigned int wheel = theTrackerTopo_->tidWheel(stDetId); + unsigned int ring = theTrackerTopo_->tidRing(stDetId); + if (ringCut_.size() < (wheel + 1)) + ringCut_.resize(wheel + 1); + if (ringCut_.at(wheel).size() < (ring + 1)) + ringCut_.at(wheel).resize(ring + 1, 0.); + double& storedHalfWindow = ringCut_.at(wheel).at(ring); + if (storedHalfWindow < bendHalfWind) + storedHalfWindow = bendHalfWind; } - - } - else if (stDetId.subdetId()==StripSubdetector::TID) - { - // Modified by TMTT group, to expland arrays if necessary, divide by 2, & update the stored window sizes - unsigned int wheel = theTrackerTopo_->tidWheel(stDetId); - unsigned int ring = theTrackerTopo_->tidRing(stDetId); - if (ringCut_.size() < (wheel+1)) ringCut_.resize(wheel+1); - if (ringCut_.at(wheel).size() < (ring+1)) ringCut_.at(wheel).resize(ring+1, 0.); - double& storedHalfWindow = ringCut_.at(wheel).at(ring); - if (storedHalfWindow < bendHalfWind) storedHalfWindow = bendHalfWind; } -} -//=== Print results (should be done in endJob(); + //=== Print results (should be done in endJob(); -void StubWindowSuggest::printResults() { + void StubWindowSuggest::printResults() { + cout << "==============================================================================" << endl; + cout << " Stub window sizes that TMTT suggests putting inside " << endl; + cout << " /L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py" << endl; + cout << " (These should give good efficiency, but tighter windows may be needed to" << endl; + cout << " limit the data rate from the FE tracker electronics)." << endl; + cout << "==============================================================================" << endl; - cout<<"=============================================================================="<pdgId()), - charge_(tpPtr->charge()), - mass_(tpPtr->mass()), - pt_(tpPtr->pt()), - eta_(tpPtr->eta()), - theta_(tpPtr->theta()), - tanLambda_(1./tan(theta_)), - phi0_(tpPtr->phi()), - vx_(tpPtr->vertex().x()), - vy_(tpPtr->vertex().y()), - vz_(tpPtr->vertex().z()), - d0_(vx_*sin(phi0_) - vy_*cos(phi0_)), // Copied from CMSSW class TrackBase::d0(). - z0_(vz_ - (vx_*cos(phi0_) + vy_*sin(phi0_))*tanLambda_) // Copied from CMSSW class TrackBase::dz(). -{ - const vector &vst = tpPtr->g4Tracks(); - EncodedEventId eid = vst.at(0).eventId(); - inTimeBx_ = (eid.bunchCrossing() == 0); // TP from in-time or out-of-time Bx. - physicsCollision_ = (eid.event() == 0); // TP from physics collision or from pileup. - - this->fillUse(); // Fill use_ flag, indicating if TP is worth keeping. - this->fillUseForEff(); // Fill useForEff_ flag, indicating if TP is good for tracking efficiency measurement. -} - -//=== Fill truth info with association from tracking particle to stubs. - -void TP::fillTruth(const vector& vStubs) { - - for (const Stub& s : vStubs) { - for (const TP* tp_i : s.assocTPs()) { - if (tp_i -> index() == this->index()) assocStubs_.push_back(&s); - } + //=== Store useful info about this tracking particle + + TP::TP(const TrackingParticlePtr& tpPtr, unsigned int index_in_vTPs, const Settings* settings) + : TrackingParticlePtr(tpPtr), + index_in_vTPs_(index_in_vTPs), + settings_(settings), + pdgId_(tpPtr->pdgId()), + charge_(tpPtr->charge()), + mass_(tpPtr->mass()), + pt_(tpPtr->pt()), + eta_(tpPtr->eta()), + theta_(tpPtr->theta()), + tanLambda_(1. / tan(theta_)), + phi0_(tpPtr->phi()), + vx_(tpPtr->vertex().x()), + vy_(tpPtr->vertex().y()), + vz_(tpPtr->vertex().z()), + d0_(vx_ * sin(phi0_) - vy_ * cos(phi0_)), // Copied from CMSSW class TrackBase::d0(). + z0_(vz_ - (vx_ * cos(phi0_) + vy_ * sin(phi0_)) * tanLambda_) // Copied from CMSSW class TrackBase::dz(). + { + const vector& vst = tpPtr->g4Tracks(); + EncodedEventId eid = vst.at(0).eventId(); + inTimeBx_ = (eid.bunchCrossing() == 0); // TP from in-time or out-of-time Bx. + physicsCollision_ = (eid.event() == 0); // TP from physics collision or from pileup. + + this->fillUse(); // Fill use_ flag, indicating if TP is worth keeping. + this->fillUseForEff(); // Fill useForEff_ flag, indicating if TP is good for tracking efficiency measurement. } - this->fillUseForAlgEff(); // Fill useForAlgEff_ flag. + //=== Fill truth info with association from tracking particle to stubs. - this->calcNumLayers(); // Calculate number of tracker layers this TP has stubs in. -} + void TP::fillTruth(const vector& vStubs) { + for (const Stub& s : vStubs) { + for (const TP* tp_i : s.assocTPs()) { + if (tp_i->index() == this->index()) + assocStubs_.push_back(&s); + } + } -//=== Check if this tracking particle is worth keeping. -//=== (i.e. If there is the slightest chance of reconstructing it, so as to measure fake rate). + this->fillUseForAlgEff(); // Fill useForAlgEff_ flag. -void TP::fillUse() { + this->calcNumLayers(); // Calculate number of tracker layers this TP has stubs in. + } - const bool useOnlyInTimeParticles = false; - const bool useOnlyTPfromPhysicsCollisionFalse = false; - // Use looser cuts here those those used for tracking efficiency measurement. - // Keep only those TP that have a chance (allowing for finite track resolution) of being reconstructed as L1 tracks. L1 tracks not matching these TP will be defined as fake. + //=== Check if this tracking particle is worth keeping. + //=== (i.e. If there is the slightest chance of reconstructing it, so as to measure fake rate). + + void TP::fillUse() { + const bool useOnlyInTimeParticles = false; + const bool useOnlyTPfromPhysicsCollisionFalse = false; + // Use looser cuts here those those used for tracking efficiency measurement. + // Keep only those TP that have a chance (allowing for finite track resolution) of being reconstructed as L1 tracks. L1 tracks not matching these TP will be defined as fake. + + const vector genPdgIdsAllUnsigned = { + 11, + 13, + 211, + 321, + 2212}; // Include all possible particle types here, as if some are left out, L1 tracks matching one of missing types will be declared fake. + vector genPdgIdsAll; + for (unsigned int i = 0; i < genPdgIdsAllUnsigned.size(); i++) { + genPdgIdsAll.push_back(genPdgIdsAllUnsigned[i]); + genPdgIdsAll.push_back(-genPdgIdsAllUnsigned[i]); + } - const vector genPdgIdsAllUnsigned = {11, 13, 211, 321, 2212}; // Include all possible particle types here, as if some are left out, L1 tracks matching one of missing types will be declared fake. - vector genPdgIdsAll; - for (unsigned int i = 0; i < genPdgIdsAllUnsigned.size(); i++) { - genPdgIdsAll.push_back( genPdgIdsAllUnsigned[i] ); - genPdgIdsAll.push_back( -genPdgIdsAllUnsigned[i] ); + // Range big enough to include all TP needed to measure tracking efficiency + // and big enough to include any TP that might be reconstructed for fake rate measurement. + const float ptMin = min(settings_->genMinPt(), 0.7 * settings_->houghMinPt()); + const float etaMax = max(settings_->genMaxAbsEta(), 0.2 + fabs(settings_->etaRegions()[0])); + + static TrackingParticleSelector trackingParticleSelector(ptMin, + 9999999999, + -etaMax, + etaMax, + max(10.0, settings_->genMaxVertR()), + max(35.0, settings_->genMaxVertZ()), + 0, + useOnlyTPfromPhysicsCollisionFalse, + useOnlyInTimeParticles, + true, + false, + genPdgIdsAll); + + const TrackingParticlePtr tp_ptr(*this); // cast to base class. + use_ = trackingParticleSelector(*tp_ptr); } - // Range big enough to include all TP needed to measure tracking efficiency - // and big enough to include any TP that might be reconstructed for fake rate measurement. - const float ptMin = min(settings_->genMinPt(), 0.7*settings_->houghMinPt()); - const float etaMax = max(settings_->genMaxAbsEta(), 0.2 + fabs(settings_->etaRegions()[0])); - - static TrackingParticleSelector trackingParticleSelector(ptMin, - 9999999999, - -etaMax, - etaMax, - max(10.0, settings_->genMaxVertR()), - max(35.0, settings_->genMaxVertZ()), - 0, - useOnlyTPfromPhysicsCollisionFalse, - useOnlyInTimeParticles, - true, - false, - genPdgIdsAll); - - const TrackingParticlePtr tp_ptr(*this); // cast to base class. - use_ = trackingParticleSelector(*tp_ptr); -} - -//=== Check if this tracking particle can be used to measure the L1 tracking efficiency. - -void TP::fillUseForEff() { - - useForEff_ = false; - if (use_) { - const bool useOnlyInTimeParticles = true; - const bool useOnlyTPfromPhysicsCollision = true; - static TrackingParticleSelector trackingParticleSelector( - settings_->genMinPt(), - 9999999999, - -settings_->genMaxAbsEta(), - settings_->genMaxAbsEta(), - settings_->genMaxVertR(), - settings_->genMaxVertZ(), - 0, - useOnlyTPfromPhysicsCollision, - useOnlyInTimeParticles, - true, - false, - settings_->genPdgIds()); - - const TrackingParticlePtr tp_ptr(*this); // cast to base class. - useForEff_ = trackingParticleSelector(*tp_ptr); - - // Add additional cut on particle transverse impact parameter. - if (fabs(d0_) > settings_->genMaxD0()) useForEff_ = false; - if (fabs(z0_) > settings_->genMaxZ0()) useForEff_ = false; + //=== Check if this tracking particle can be used to measure the L1 tracking efficiency. + + void TP::fillUseForEff() { + useForEff_ = false; + if (use_) { + const bool useOnlyInTimeParticles = true; + const bool useOnlyTPfromPhysicsCollision = true; + static TrackingParticleSelector trackingParticleSelector(settings_->genMinPt(), + 9999999999, + -settings_->genMaxAbsEta(), + settings_->genMaxAbsEta(), + settings_->genMaxVertR(), + settings_->genMaxVertZ(), + 0, + useOnlyTPfromPhysicsCollision, + useOnlyInTimeParticles, + true, + false, + settings_->genPdgIds()); + + const TrackingParticlePtr tp_ptr(*this); // cast to base class. + useForEff_ = trackingParticleSelector(*tp_ptr); + + // Add additional cut on particle transverse impact parameter. + if (fabs(d0_) > settings_->genMaxD0()) + useForEff_ = false; + if (fabs(z0_) > settings_->genMaxZ0()) + useForEff_ = false; + } } -} -//=== Check if this tracking particle can be used to measure the L1 tracking algorithmic efficiency (makes stubs in enough layers). + //=== Check if this tracking particle can be used to measure the L1 tracking algorithmic efficiency (makes stubs in enough layers). -void TP::fillUseForAlgEff() { - useForAlgEff_ = false; - if (useForEff_) { - useForAlgEff_ = (Utility::countLayers(settings_, assocStubs_, true) >= settings_->genMinStubLayers()); + void TP::fillUseForAlgEff() { + useForAlgEff_ = false; + if (useForEff_) { + useForAlgEff_ = (Utility::countLayers(settings_, assocStubs_, true) >= settings_->genMinStubLayers()); + } } -} -//== Estimated phi angle at which TP trajectory crosses the module containing the stub. + //== Estimated phi angle at which TP trajectory crosses the module containing the stub. -float TP::trkPhiAtStub(const Stub* stub) const { - float trkPhi = phi0_ - this->dphi(this->trkRAtStub(stub)); - return trkPhi; -} + float TP::trkPhiAtStub(const Stub* stub) const { + float trkPhi = phi0_ - this->dphi(this->trkRAtStub(stub)); + return trkPhi; + } -//== Estimated r coord. at which TP trajectory crosses the module containing the given stub. -//== Only works for modules orientated parallel or perpendicular to beam-axis, -//== and makes the approximation that tracks are straight-lines in r-z plane. + //== Estimated r coord. at which TP trajectory crosses the module containing the given stub. + //== Only works for modules orientated parallel or perpendicular to beam-axis, + //== and makes the approximation that tracks are straight-lines in r-z plane. -float TP::trkRAtStub(const Stub* stub) const { - float rTrk = (stub->barrel()) ? stub->r() : (stub->z() - z0_)/tanLambda_; - return rTrk; -} + float TP::trkRAtStub(const Stub* stub) const { + float rTrk = (stub->barrel()) ? stub->r() : (stub->z() - z0_) / tanLambda_; + return rTrk; + } -//== Estimated z coord. at which TP trajectory crosses the module containing the given stub. -//== Only works for modules orientated parallel or perpendicular to beam-axis, -//== and makes the approximation that tracks are straight-lines in r-z plane. + //== Estimated z coord. at which TP trajectory crosses the module containing the given stub. + //== Only works for modules orientated parallel or perpendicular to beam-axis, + //== and makes the approximation that tracks are straight-lines in r-z plane. -float TP::trkZAtStub(const Stub* stub) const { - float zTrk = (stub->barrel()) ? z0_ + tanLambda_ * stub->r() : stub->z(); - return zTrk; -} + float TP::trkZAtStub(const Stub* stub) const { + float zTrk = (stub->barrel()) ? z0_ + tanLambda_ * stub->r() : stub->z(); + return zTrk; + } -void TP::fillNearestJetInfo( const reco::GenJetCollection* genJets ) { + void TP::fillNearestJetInfo(const reco::GenJetCollection* genJets) { + double minDR = 999; + double ptOfNearestJet = -1; - double minDR = 999; - double ptOfNearestJet = -1; + reco::GenJetCollection::const_iterator iterGenJet; + for (iterGenJet = genJets->begin(); iterGenJet != genJets->end(); ++iterGenJet) { + reco::GenJet myJet = reco::GenJet(*iterGenJet); - reco::GenJetCollection::const_iterator iterGenJet; - for ( iterGenJet = genJets->begin(); iterGenJet != genJets->end(); ++iterGenJet ) { - - reco::GenJet myJet = reco::GenJet(*iterGenJet); - - if (myJet.pt() < 30.0) continue; - if (fabs(myJet.eta()) > 2.5) continue; + if (myJet.pt() < 30.0) + continue; + if (fabs(myJet.eta()) > 2.5) + continue; - double deltaR = reco::deltaR(this->eta(), this->phi0(), myJet.eta(), myJet.phi()); + double deltaR = reco::deltaR(this->eta(), this->phi0(), myJet.eta(), myJet.phi()); - if (deltaR < 0.4 && deltaR < minDR ) { - minDR = deltaR; - ptOfNearestJet = myJet.pt(); + if (deltaR < 0.4 && deltaR < minDR) { + minDR = deltaR; + ptOfNearestJet = myJet.pt(); + } } - } - - tpInJet_ = (minDR < 0.4) ? true : false; - nearestJetPt_ = ptOfNearestJet; -} + tpInJet_ = (minDR < 0.4) ? true : false; + nearestJetPt_ = ptOfNearestJet; + } -} +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/TrackFitGeneric.cc b/L1Trigger/TrackFindingTMTT/src/TrackFitGeneric.cc index 450b5f8763cfa..97a6d2b207420 100644 --- a/L1Trigger/TrackFindingTMTT/src/TrackFitGeneric.cc +++ b/L1Trigger/TrackFindingTMTT/src/TrackFitGeneric.cc @@ -12,42 +12,41 @@ #include "L1Trigger/TrackFindingTMTT/interface/HLS/KFParamsCombCallHLS.h" #endif #include "FWCore/Utilities/interface/Exception.h" -#include +#include #include - + namespace TMTT { -//=== Set configuration parameters. - -TrackFitGeneric::TrackFitGeneric( const Settings* settings, const string &fitterName ) : settings_(settings), fitterName_(fitterName), nDupStubs_(0) { -} - - -//=== Fit a track candidate obtained from the Hough Transform. -//=== Specify which phi sector and eta region it is in. - -L1fittedTrack TrackFitGeneric::fit(const L1track3D& l1track3D) { - return L1fittedTrack (settings_, l1track3D, l1track3D.getStubs(), 0, 0, 0, 0, 0, 0, 0, 999999., 0); -} - -TrackFitGeneric* TrackFitGeneric::create(std::string fitter, const Settings* settings) { - if (fitter.compare("ChiSquared4ParamsApprox")==0) { - return new ChiSquared4ParamsApprox(settings, 4); - } else if (fitter.compare("KF4ParamsComb")==0) { - return new KFParamsComb(settings, 4, fitter ); - } else if (fitter.compare("KF5ParamsComb")==0) { - return new KFParamsComb(settings, 5, fitter ); - } else if (fitter.compare("SimpleLR")==0) { + //=== Set configuration parameters. + + TrackFitGeneric::TrackFitGeneric(const Settings* settings, const string& fitterName) + : settings_(settings), fitterName_(fitterName), nDupStubs_(0) {} + + //=== Fit a track candidate obtained from the Hough Transform. + //=== Specify which phi sector and eta region it is in. + + L1fittedTrack TrackFitGeneric::fit(const L1track3D& l1track3D) { + return L1fittedTrack(settings_, l1track3D, l1track3D.getStubs(), 0, 0, 0, 0, 0, 0, 0, 999999., 0); + } + + TrackFitGeneric* TrackFitGeneric::create(std::string fitter, const Settings* settings) { + if (fitter.compare("ChiSquared4ParamsApprox") == 0) { + return new ChiSquared4ParamsApprox(settings, 4); + } else if (fitter.compare("KF4ParamsComb") == 0) { + return new KFParamsComb(settings, 4, fitter); + } else if (fitter.compare("KF5ParamsComb") == 0) { + return new KFParamsComb(settings, 5, fitter); + } else if (fitter.compare("SimpleLR") == 0) { return new SimpleLR(settings); #ifdef USE_HLS - } else if (fitter.compare("KF4ParamsCombHLS")==0){ - return new KFParamsCombCallHLS(settings, 4, fitter ); - } else if (fitter.compare("KF5ParamsCombHLS")==0){ - return new KFParamsCombCallHLS(settings, 5, fitter ); + } else if (fitter.compare("KF4ParamsCombHLS") == 0) { + return new KFParamsCombCallHLS(settings, 4, fitter); + } else if (fitter.compare("KF5ParamsCombHLS") == 0) { + return new KFParamsCombCallHLS(settings, 5, fitter); #endif } else { - throw cms::Exception("TrackFitGeneric: ERROR you requested unknown track fitter")<detUnits()) { - float R0 = gd->position().perp(); - float Z0 = fabs(gd->position().z()); - DetId detId = gd->geographicalId(); - - bool barrel = detId.subdetId()==StripSubdetector::TOB || detId.subdetId()==StripSubdetector::TIB; - bool tiltedBarrel = barrel && (theTrackerTopo->tobSide(detId) != 3); - bool isLower = theTrackerTopo->isLower(detId); - - // Calculate and store r, z, B at centre of titled modules - // Only do this for the "lower" sensor - if ( tiltedBarrel && isLower ) { - - // int type = 2*theTrackerTopo->tobSide(detId)-3; // -1 for tilted-, 1 for tilted+, 3 for flat - // double corr = (barrelNTiltedModules_+1)/2.; - - double minZOfThisModule = fabs(gd->surface().zSpan().first); - double maxZOfThisModule = fabs(gd->surface().zSpan().second); - double minROfThisModule = gd->surface().rSpan().first; - double maxROfThisModule = gd->surface().rSpan().second; - - // Calculate module tilt and B at centre of module - double moduleTilt = atan( fabs(maxZOfThisModule - minZOfThisModule) / ( maxROfThisModule - minROfThisModule ) ); - double moduleTheta = atan(R0 / Z0); - double BCorrection = fabs( cos( fabs(moduleTheta) - moduleTilt ) / sin( moduleTheta ) ); - - // Only store if this value of B has not been stored already - bool storeThisBCorrection = true; - for (unsigned int iCorr = 0; iCorr < moduleB_.size(); ++iCorr ) { - if ( fabs( BCorrection - moduleB_[iCorr] ) < 0.0001 ) { - storeThisBCorrection = false; - break; + TrackerGeometryInfo::TrackerGeometryInfo() + : barrelNTiltedModules_(12), barrelNLayersWithTiltedModules_(3), moduleZoR_(), moduleB_() {} + + void TrackerGeometryInfo::getTiltedModuleInfo(const Settings* settings, + const TrackerTopology* theTrackerTopo, + const TrackerGeometry* theTrackerGeom) { + for (const GeomDetUnit* gd : theTrackerGeom->detUnits()) { + float R0 = gd->position().perp(); + float Z0 = fabs(gd->position().z()); + DetId detId = gd->geographicalId(); + + bool barrel = detId.subdetId() == StripSubdetector::TOB || detId.subdetId() == StripSubdetector::TIB; + bool tiltedBarrel = barrel && (theTrackerTopo->tobSide(detId) != 3); + bool isLower = theTrackerTopo->isLower(detId); + + // Calculate and store r, z, B at centre of titled modules + // Only do this for the "lower" sensor + if (tiltedBarrel && isLower) { + // int type = 2*theTrackerTopo->tobSide(detId)-3; // -1 for tilted-, 1 for tilted+, 3 for flat + // double corr = (barrelNTiltedModules_+1)/2.; + + double minZOfThisModule = fabs(gd->surface().zSpan().first); + double maxZOfThisModule = fabs(gd->surface().zSpan().second); + double minROfThisModule = gd->surface().rSpan().first; + double maxROfThisModule = gd->surface().rSpan().second; + + // Calculate module tilt and B at centre of module + double moduleTilt = atan(fabs(maxZOfThisModule - minZOfThisModule) / (maxROfThisModule - minROfThisModule)); + double moduleTheta = atan(R0 / Z0); + double BCorrection = fabs(cos(fabs(moduleTheta) - moduleTilt) / sin(moduleTheta)); + + // Only store if this value of B has not been stored already + bool storeThisBCorrection = true; + for (unsigned int iCorr = 0; iCorr < moduleB_.size(); ++iCorr) { + if (fabs(BCorrection - moduleB_[iCorr]) < 0.0001) { + storeThisBCorrection = false; + break; + } } - } - if ( storeThisBCorrection ) { - moduleZoR_.push_back( Z0 / R0 ); - moduleB_.push_back( BCorrection ); + if (storeThisBCorrection) { + moduleZoR_.push_back(Z0 / R0); + moduleB_.push_back(BCorrection); + } } } } -} - -} +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc b/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc index 66694fa5f926c..551db8424ae76 100644 --- a/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc +++ b/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc @@ -6,273 +6,303 @@ namespace TMTT { -//=== Initialize configuration parameters, and note eta range covered by sector and phi coordinate of its centre. - -void TrkRZfilter::init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, - float etaMinSector, float etaMaxSector, float phiCentreSector) { - - // Configuration parameters. - settings_ = settings; - - // Sector number. - iPhiSec_ = iPhiSec; - iEtaReg_ = iEtaReg; - - // Eta range of sector & phi coord of its centre. - etaMinSector_ = etaMinSector; - etaMaxSector_ = etaMaxSector; - phiCentreSector_ = phiCentreSector; - - // Note that no estimate of the r-z helix params yet exists. - rzHelix_set_ = false; // No valid estimate yet. - - // Calculate z coordinate a track would have at given radius if on eta sector boundary. - chosenRofZ_ = settings->chosenRofZ(); - zTrkMinSector_ = chosenRofZ_/ tan( 2. * atan(exp(-etaMinSector_)) ); - zTrkMaxSector_ = chosenRofZ_/ tan( 2. * atan(exp(-etaMaxSector_)) ); - unsigned int zbits = settings->zBits(); - unsigned int rtbits = settings_->rtBits(); - float zrange = settings_->zRange(); - float rtRange = settings_->rtRange(); - float zMultiplier = pow(2.,zbits)/zrange; - float rMultiplier = pow(2.,rtbits)/rtRange; - - if(settings_->enableDigitize()){ - zTrkMinSector_ = floor(zTrkMinSector_*zMultiplier)/zMultiplier; - zTrkMaxSector_ = floor(zTrkMaxSector_*zMultiplier)/zMultiplier; - chosenRofZ_ = floor(chosenRofZ_*rMultiplier)/rMultiplier; - } + //=== Initialize configuration parameters, and note eta range covered by sector and phi coordinate of its centre. + + void TrkRZfilter::init(const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float etaMinSector, + float etaMaxSector, + float phiCentreSector) { + // Configuration parameters. + settings_ = settings; + + // Sector number. + iPhiSec_ = iPhiSec; + iEtaReg_ = iEtaReg; + + // Eta range of sector & phi coord of its centre. + etaMinSector_ = etaMinSector; + etaMaxSector_ = etaMaxSector; + phiCentreSector_ = phiCentreSector; + + // Note that no estimate of the r-z helix params yet exists. + rzHelix_set_ = false; // No valid estimate yet. - // Assumed length of beam-spot in z. - beamWindowZ_ = settings->beamWindowZ(); + // Calculate z coordinate a track would have at given radius if on eta sector boundary. + chosenRofZ_ = settings->chosenRofZ(); + zTrkMinSector_ = chosenRofZ_ / tan(2. * atan(exp(-etaMinSector_))); + zTrkMaxSector_ = chosenRofZ_ / tan(2. * atan(exp(-etaMaxSector_))); + unsigned int zbits = settings->zBits(); + unsigned int rtbits = settings_->rtBits(); + float zrange = settings_->zRange(); + float rtRange = settings_->rtRange(); + float zMultiplier = pow(2., zbits) / zrange; + float rMultiplier = pow(2., rtbits) / rtRange; - // Name of r-z track filter algorithm to run. - rzFilterName_ = settings->rzFilterName(); + if (settings_->enableDigitize()) { + zTrkMinSector_ = floor(zTrkMinSector_ * zMultiplier) / zMultiplier; + zTrkMaxSector_ = floor(zTrkMaxSector_ * zMultiplier) / zMultiplier; + chosenRofZ_ = floor(chosenRofZ_ * rMultiplier) / rMultiplier; + } - // --- Options for Seed filter. - //Added resolution for a tracklet-like filter algorithm, beyond that estimated from hit resolution. - seedResolution_ = settings->seedResolution(); - // Keep stubs compatible with all possible good seed. - keepAllSeed_ = settings->keepAllSeed(); - // Maximum number of seed combinations to bother checking per track candidate. - maxSeedCombinations_ = settings->maxSeedCombinations(); - // Maximum number of seed combinations consistent with sector (z0,eta) constraints to bother checking per track candidate. - maxGoodSeedCombinations_ = settings->maxGoodSeedCombinations(); - // Maximum number of seeds that a single stub can be included in. - maxSeedsPerStub_ = settings->maxSeedsPerStub(); - // Reject tracks whose estimated rapidity from seed filter is inconsistent range of with eta sector. (Kills some duplicate tracks). - zTrkSectorCheck_ = settings->zTrkSectorCheck(); + // Assumed length of beam-spot in z. + beamWindowZ_ = settings->beamWindowZ(); + + // Name of r-z track filter algorithm to run. + rzFilterName_ = settings->rzFilterName(); + + // --- Options for Seed filter. + //Added resolution for a tracklet-like filter algorithm, beyond that estimated from hit resolution. + seedResolution_ = settings->seedResolution(); + // Keep stubs compatible with all possible good seed. + keepAllSeed_ = settings->keepAllSeed(); + // Maximum number of seed combinations to bother checking per track candidate. + maxSeedCombinations_ = settings->maxSeedCombinations(); + // Maximum number of seed combinations consistent with sector (z0,eta) constraints to bother checking per track candidate. + maxGoodSeedCombinations_ = settings->maxGoodSeedCombinations(); + // Maximum number of seeds that a single stub can be included in. + maxSeedsPerStub_ = settings->maxSeedsPerStub(); + // Reject tracks whose estimated rapidity from seed filter is inconsistent range of with eta sector. (Kills some duplicate tracks). + zTrkSectorCheck_ = settings->zTrkSectorCheck(); + + // For debugging + minNumMatchLayers_ = settings->minNumMatchLayers(); + + //--- Option for duplicate track removal on collection of L1track3D produced after running all r-z filter. + unsigned int dupTrkAlg3D = settings->dupTrkAlg3D(); + killDupTrks_.init(settings, dupTrkAlg3D); + } - // For debugging - minNumMatchLayers_ = settings->minNumMatchLayers(); + //=== Filters track candidates (found by the r-phi Hough transform), removing inconsistent stubs from the tracks, + //=== also killing some of the tracks altogether if they are left with too few stubs. + //=== Also adds an estimate of r-z helix parameters to the selected track objects, if the filters used provide this. - //--- Option for duplicate track removal on collection of L1track3D produced after running all r-z filter. - unsigned int dupTrkAlg3D = settings->dupTrkAlg3D(); - killDupTrks_.init(settings, dupTrkAlg3D); -} + vector TrkRZfilter::filterTracks(const vector& tracks) { + vector filteredTracks; -//=== Filters track candidates (found by the r-phi Hough transform), removing inconsistent stubs from the tracks, -//=== also killing some of the tracks altogether if they are left with too few stubs. -//=== Also adds an estimate of r-z helix parameters to the selected track objects, if the filters used provide this. - -vector TrkRZfilter::filterTracks(const vector& tracks) { + for (const L1track2D& trkIN : tracks) { + const vector& stubs = trkIN.getStubs(); // stubs assigned to track - vector filteredTracks; + // Declare this to be worth keeping (for now). + bool trackAccepted = true; - for (const L1track2D& trkIN : tracks) { + // Note that no estimate of the r-z helix params of this track yet exists. + rzHelix_set_ = false; // No valid estimate yet. - const vector& stubs = trkIN.getStubs(); // stubs assigned to track + // Digitize stubs for r-z filter if required. + if (settings_->enableDigitize()) { + for (const Stub* s : stubs) { + (const_cast(s))->digitizeForSFinput(); + } + } - // Declare this to be worth keeping (for now). - bool trackAccepted = true; + //--- Filter stubs assigned to track, checking they are consistent with requested criteria. - // Note that no estimate of the r-z helix params of this track yet exists. - rzHelix_set_ = false; // No valid estimate yet. + // Get debug printout for specific regions. + bool print = false; + // unsigned int mbin = trkIN.getCellLocationHT().first; + // unsigned int cbin = trkIN.getCellLocationHT().second; + // if(mbin == 0 && cbin == 45 && trkIN.iEtaReg() == 14 && trkIN.iPhiSec() == 6) print = true; + // cout << "track in region "<enableDigitize()) { - for (const Stub* s: stubs) { - (const_cast(s))->digitizeForSFinput(); + vector filteredStubs = stubs; + if (rzFilterName_ == "SeedFilter") { + filteredStubs = this->seedFilter(filteredStubs, trkIN.qOverPt(), print); + } else { + throw cms::Exception("TrkRzFilter: ERROR unknown r-z track filter requested") << rzFilterName_ << endl; } - } - //--- Filter stubs assigned to track, checking they are consistent with requested criteria. - - // Get debug printout for specific regions. - bool print = false; - // unsigned int mbin = trkIN.getCellLocationHT().first; - // unsigned int cbin = trkIN.getCellLocationHT().second; - // if(mbin == 0 && cbin == 45 && trkIN.iEtaReg() == 14 && trkIN.iPhiSec() == 6) print = true; - // cout << "track in region "< filteredStubs = stubs; - if (rzFilterName_ == "SeedFilter") { - filteredStubs = this->seedFilter(filteredStubs, trkIN.qOverPt(), print ); - } else { - throw cms::Exception("TrkRzFilter: ERROR unknown r-z track filter requested")<minFilterLayers()) + trackAccepted = false; + //if (numLayersAfterFilters < Utility::numLayerCut("SEED", settings_, iPhiSec_, iEtaReg_, fabs(trkIN.qOverPt()))) trackAccepted = false; - unsigned int numLayersAfterFilters = Utility::countLayers(settings_, filteredStubs); - if (numLayersAfterFilters < settings_->minFilterLayers()) trackAccepted = false; - //if (numLayersAfterFilters < Utility::numLayerCut("SEED", settings_, iPhiSec_, iEtaReg_, fabs(trkIN.qOverPt()))) trackAccepted = false; - - if (trackAccepted) { - // Estimate r-z helix parameters from centre of eta-sector if no estimate provided by r-z filter. - if ( ! rzHelix_set_ ) this->estRZhelix(); + if (trackAccepted) { + // Estimate r-z helix parameters from centre of eta-sector if no estimate provided by r-z filter. + if (!rzHelix_set_) + this->estRZhelix(); - pair helixRZ(rzHelix_z0_, rzHelix_tanL_); + pair helixRZ(rzHelix_z0_, rzHelix_tanL_); - // Create copy of original track, except now using its filtered stubs, to be added to filteredTrack collection. - L1track3D trkOUT(settings_, filteredStubs, trkIN.getCellLocationHT(), trkIN.getHelix2D(), helixRZ, - trkIN.iPhiSec(), trkIN.iEtaReg(), trkIN.optoLinkID(), trkIN.mergedHTcell()); + // Create copy of original track, except now using its filtered stubs, to be added to filteredTrack collection. + L1track3D trkOUT(settings_, + filteredStubs, + trkIN.getCellLocationHT(), + trkIN.getHelix2D(), + helixRZ, + trkIN.iPhiSec(), + trkIN.iEtaReg(), + trkIN.optoLinkID(), + trkIN.mergedHTcell()); - filteredTracks.push_back(trkOUT); + filteredTracks.push_back(trkOUT); + } } - } - // Optionally run duplicate track removal on all the 3D tracks found in this sector & store final 3D track collection. - filteredTracks = killDupTrks_.filter( filteredTracks ); + // Optionally run duplicate track removal on all the 3D tracks found in this sector & store final 3D track collection. + filteredTracks = killDupTrks_.filter(filteredTracks); - return filteredTracks; -} + return filteredTracks; + } -//=== Use Seed Filter to produce a filtered collection of stubs on this track candidate that are consistent with a straight line -//=== in r-z using tracklet algo. + //=== Use Seed Filter to produce a filtered collection of stubs on this track candidate that are consistent with a straight line + //=== in r-z using tracklet algo. -vector TrkRZfilter::seedFilter(const std::vector& stubs, float trkQoverPt, bool print) { - unsigned int numLayers; //Num of Layers in the cell after that filter has been applied - std::vector filtStubs = stubs; // Copy stubs vector in filtStubs + vector TrkRZfilter::seedFilter(const std::vector& stubs, float trkQoverPt, bool print) { + unsigned int numLayers; //Num of Layers in the cell after that filter has been applied + std::vector filtStubs = stubs; // Copy stubs vector in filtStubs bool FirstSeed = true; - const int FirstSeedLayers[] = {1,2,11,21,3,12,22,4}; //Allowed layers for the first seeding stubs - const int SecondSeedLayers[] = {1,2,11,3,21,22,12,23,13,4};//Allowed layers for the second seeding stubs + const int FirstSeedLayers[] = {1, 2, 11, 21, 3, 12, 22, 4}; //Allowed layers for the first seeding stubs + const int SecondSeedLayers[] = {1, 2, 11, 3, 21, 22, 12, 23, 13, 4}; //Allowed layers for the second seeding stubs set uniqueFilteredStubs; - unsigned int numSeedCombinations = 0; // Counter for number of seed combinations considered. - unsigned int numGoodSeedCombinations = 0; // Counter for number of seed combinations considered with z0 within beam spot length. - vector filteredStubs; // Filter Stubs vector to be returned - - unsigned int oldNumLay = 0; //Number of Layers counter, used to keep the seed with more layers - + unsigned int numSeedCombinations = 0; // Counter for number of seed combinations considered. + unsigned int numGoodSeedCombinations = + 0; // Counter for number of seed combinations considered with z0 within beam spot length. + vector filteredStubs; // Filter Stubs vector to be returned + + unsigned int oldNumLay = 0; //Number of Layers counter, used to keep the seed with more layers + std::sort(filtStubs.begin(), filtStubs.end(), SortStubsInLayer()); // Loop over stubs in the HT Cell - for(const Stub* s0: filtStubs){ - // Select the first available seeding stub (r<70) - if(s0->psModule() && std::find(std::begin(FirstSeedLayers), std::end(FirstSeedLayers), s0->layerId()) != std::end(FirstSeedLayers)) { - unsigned int numSeedsPerStub = 0; - - for(const Stub* s1: filtStubs){ - if (numGoodSeedCombinations < maxGoodSeedCombinations_ && numSeedCombinations < maxSeedCombinations_ && numSeedsPerStub < maxSeedsPerStub_) { - // Select the second seeding stub (r<90) - if(s1->psModule() && s1->layerId() > s0->layerId() && std::find(std::begin(SecondSeedLayers), std::end(SecondSeedLayers), s1->layerId()) != std::end(SecondSeedLayers) ){ - numSeedsPerStub++; - numSeedCombinations++; //Increase filter cycles counter - if(print) cout << "s0: "<< "z: "<< s0->z() << ", r: "<< s0->r() << ", id:" << s0->layerId() << " ****** s1: "<< "z: "<< s1->z() << ", r: "<< s1->r() << ", id:" << s1->layerId() << endl; - double sumSeedDist = 0., oldSumSeedDist = 1000000.; //Define variable used to estimate the quality of seeds - vector tempStubs; //Create a temporary container for stubs - tempStubs.push_back(s0); //Store the first seeding stub in the temporary container - tempStubs.push_back(s1); //Store the second seeding stub in the temporary container - - double z0 = s1->z() + (-s1->z()+s0->z())*s1->r()/(s1->r()-s0->r()); // Estimate a value of z at the beam spot using the two seeding stubs - //double z0err = s1->zErr() + ( s1->zErr() + s0->zErr() )*s1->r()/fabs(s1->r()-s0->r()) + fabs(-s1->z()+s0->z())*(s1->rErr()*fabs(s1->r()-s0->r()) + s1->r()*(s1->rErr() + s0->rErr()) )/((s1->r()-s0->r())*(s1->r()-s0->r())); - float zTrk = s1->z() + (-s1->z()+s0->z())*(s1->r()-chosenRofZ_)/(s1->r()-s0->r()); // Estimate a value of z at a chosen Radius using the two seeding stubs - // float zTrkErr = s1->zErr() + ( s1->zErr() + s0->zErr() )*fabs(s1->r()-chosenRofZ_)/fabs(s1->r()-s0->r()) + fabs(-s1->z()+s0->z())*(s1->rErr()*fabs(s1->r()-s0->r()) + fabs(s1->r()-chosenRofZ_)*(s1->rErr() + s0->rErr()) )/((s1->r()-s0->r())*(s1->r()-s0->r())); - float leftZtrk = zTrk*fabs(s1->r()-s0->r()); - float rightZmin = zTrkMinSector_*fabs(s1->r()-s0->r()); - float rightZmax = zTrkMaxSector_*fabs(s1->r()-s0->r()); - - // If z0 is within the beamspot range loop over the other stubs in the cell - //if (fabs(z0)<=beamWindowZ_+z0err) { - if (fabs(z0)<=beamWindowZ_) { - // Check track r-z helix parameters are consistent with it being assigned to current rapidity sector (kills duplicates due to overlapping sectors). - // if ( (! zTrkSectorCheck_) || (zTrk > zTrkMinSector_ - zTrkErr && zTrk < zTrkMaxSector_ + zTrkErr) ) { - if ( (! zTrkSectorCheck_) || (leftZtrk > rightZmin && leftZtrk < rightZmax ) ) { - numGoodSeedCombinations++; - unsigned int LiD = 0; //Store the layerId of the stub (KEEP JUST ONE STUB PER LAYER) -// double oldseed = 1000.; //Store the seed value of the current stub (KEEP JUST ONE STUB PER LAYER) - - // Loop over stubs in vector different from the seeding stubs - for(const Stub* s: filtStubs){ - // if(s!= s0 && s!= s1){ - // Calculate the seed and its tolerance - double seedDist = (s->z() - s1->z())*(s1->r()-s0->r()) - (s->r() - s1->r())*(s1->z() - s0->z()); - double seedDistRes = (s->zErr()+ s1->zErr() )*fabs(s1->r()-s0->r()) + (s->rErr()+s1->rErr())*fabs(s1->z() - s0->z()) + (s0->zErr()+s1->zErr())*fabs(s->r() - s1->r()) + (s0->rErr()+s1->rErr())*fabs(s->z() - s1->z()); - seedDistRes += seedResolution_; // Add extra configurable contribution to assumed resolution. - //If seed is lower than the tolerance push back the stub (KEEP JUST ONE STUB PER LAYER, NOT ENABLED BY DEFAULT) - if(fabs(seedDist) <= seedDistRes){ - // if(s->layerId()==LiD){ - //if(fabs(seedDist)layerId(); - // sumSeedDist = sumSeedDist + fabs(seedDist) - fabs(oldseed); - // oldseed = seedDist; - //} - // } else { - if(s->layerId() != LiD and s->layerId() != s0->layerId() and s->layerId() != s1->layerId()){ - tempStubs.push_back(s); - LiD = s->layerId(); - // oldseed = seedDist; - //sumSeedDist = sumSeedDist + fabs(seedDist); - } - } - - //If stub lies on the seeding line, store it in the tempstubs vector - // if(fabs(seedDist) <= seedDistRes){ - // tempStubs.push_back(s); - // sumSeedDist = sumSeedDist + fabs(seedDist); //Increase the seed quality variable - // } - // } - } - } - } - - numLayers = Utility::countLayers(settings_, tempStubs); // Count the number of layers in the temporary stubs container - //sumSeedDist = sumSeedDist/(tempStubs.size()); //Measure the average seed quality per stub for the current seed - - // Check if the current seed has more layers then the previous one (Keep the best seed) - if(keepAllSeed_ == false){ - if(numLayers > oldNumLay ){ - // Check if the current seed has better quality than the previous one - //if(sumSeedDist < oldSumSeedDist){ - filteredStubs = tempStubs; //Copy the temporary stubs vector in the filteredStubs vector, which will be returned + for (const Stub* s0 : filtStubs) { + // Select the first available seeding stub (r<70) + if (s0->psModule() && std::find(std::begin(FirstSeedLayers), std::end(FirstSeedLayers), s0->layerId()) != + std::end(FirstSeedLayers)) { + unsigned int numSeedsPerStub = 0; + + for (const Stub* s1 : filtStubs) { + if (numGoodSeedCombinations < maxGoodSeedCombinations_ && numSeedCombinations < maxSeedCombinations_ && + numSeedsPerStub < maxSeedsPerStub_) { + // Select the second seeding stub (r<90) + if (s1->psModule() && s1->layerId() > s0->layerId() && + std::find(std::begin(SecondSeedLayers), std::end(SecondSeedLayers), s1->layerId()) != + std::end(SecondSeedLayers)) { + numSeedsPerStub++; + numSeedCombinations++; //Increase filter cycles counter + if (print) + cout << "s0: " + << "z: " << s0->z() << ", r: " << s0->r() << ", id:" << s0->layerId() << " ****** s1: " + << "z: " << s1->z() << ", r: " << s1->r() << ", id:" << s1->layerId() << endl; + double sumSeedDist = 0., + oldSumSeedDist = 1000000.; //Define variable used to estimate the quality of seeds + vector tempStubs; //Create a temporary container for stubs + tempStubs.push_back(s0); //Store the first seeding stub in the temporary container + tempStubs.push_back(s1); //Store the second seeding stub in the temporary container + + double z0 = + s1->z() + + (-s1->z() + s0->z()) * s1->r() / + (s1->r() - s0->r()); // Estimate a value of z at the beam spot using the two seeding stubs + //double z0err = s1->zErr() + ( s1->zErr() + s0->zErr() )*s1->r()/fabs(s1->r()-s0->r()) + fabs(-s1->z()+s0->z())*(s1->rErr()*fabs(s1->r()-s0->r()) + s1->r()*(s1->rErr() + s0->rErr()) )/((s1->r()-s0->r())*(s1->r()-s0->r())); + float zTrk = + s1->z() + + (-s1->z() + s0->z()) * (s1->r() - chosenRofZ_) / + (s1->r() - s0->r()); // Estimate a value of z at a chosen Radius using the two seeding stubs + // float zTrkErr = s1->zErr() + ( s1->zErr() + s0->zErr() )*fabs(s1->r()-chosenRofZ_)/fabs(s1->r()-s0->r()) + fabs(-s1->z()+s0->z())*(s1->rErr()*fabs(s1->r()-s0->r()) + fabs(s1->r()-chosenRofZ_)*(s1->rErr() + s0->rErr()) )/((s1->r()-s0->r())*(s1->r()-s0->r())); + float leftZtrk = zTrk * fabs(s1->r() - s0->r()); + float rightZmin = zTrkMinSector_ * fabs(s1->r() - s0->r()); + float rightZmax = zTrkMaxSector_ * fabs(s1->r() - s0->r()); + + // If z0 is within the beamspot range loop over the other stubs in the cell + //if (fabs(z0)<=beamWindowZ_+z0err) { + if (fabs(z0) <= beamWindowZ_) { + // Check track r-z helix parameters are consistent with it being assigned to current rapidity sector (kills duplicates due to overlapping sectors). + // if ( (! zTrkSectorCheck_) || (zTrk > zTrkMinSector_ - zTrkErr && zTrk < zTrkMaxSector_ + zTrkErr) ) { + if ((!zTrkSectorCheck_) || (leftZtrk > rightZmin && leftZtrk < rightZmax)) { + numGoodSeedCombinations++; + unsigned int LiD = 0; //Store the layerId of the stub (KEEP JUST ONE STUB PER LAYER) + // double oldseed = 1000.; //Store the seed value of the current stub (KEEP JUST ONE STUB PER LAYER) + + // Loop over stubs in vector different from the seeding stubs + for (const Stub* s : filtStubs) { + // if(s!= s0 && s!= s1){ + // Calculate the seed and its tolerance + double seedDist = + (s->z() - s1->z()) * (s1->r() - s0->r()) - (s->r() - s1->r()) * (s1->z() - s0->z()); + double seedDistRes = (s->zErr() + s1->zErr()) * fabs(s1->r() - s0->r()) + + (s->rErr() + s1->rErr()) * fabs(s1->z() - s0->z()) + + (s0->zErr() + s1->zErr()) * fabs(s->r() - s1->r()) + + (s0->rErr() + s1->rErr()) * fabs(s->z() - s1->z()); + seedDistRes += seedResolution_; // Add extra configurable contribution to assumed resolution. + //If seed is lower than the tolerance push back the stub (KEEP JUST ONE STUB PER LAYER, NOT ENABLED BY DEFAULT) + if (fabs(seedDist) <= seedDistRes) { + // if(s->layerId()==LiD){ + //if(fabs(seedDist)layerId(); + // sumSeedDist = sumSeedDist + fabs(seedDist) - fabs(oldseed); + // oldseed = seedDist; + //} + // } else { + if (s->layerId() != LiD and s->layerId() != s0->layerId() and s->layerId() != s1->layerId()) { + tempStubs.push_back(s); + LiD = s->layerId(); + // oldseed = seedDist; + //sumSeedDist = sumSeedDist + fabs(seedDist); + } + } + + //If stub lies on the seeding line, store it in the tempstubs vector + // if(fabs(seedDist) <= seedDistRes){ + // tempStubs.push_back(s); + // sumSeedDist = sumSeedDist + fabs(seedDist); //Increase the seed quality variable + // } + // } + } + } + } + + numLayers = Utility::countLayers( + settings_, tempStubs); // Count the number of layers in the temporary stubs container + //sumSeedDist = sumSeedDist/(tempStubs.size()); //Measure the average seed quality per stub for the current seed + + // Check if the current seed has more layers then the previous one (Keep the best seed) + if (keepAllSeed_ == false) { + if (numLayers > oldNumLay) { + // Check if the current seed has better quality than the previous one + //if(sumSeedDist < oldSumSeedDist){ + filteredStubs = + tempStubs; //Copy the temporary stubs vector in the filteredStubs vector, which will be returned // oldSumSeedDist = sumSeedDist; //Update value of oldSumSeedDist - oldNumLay = numLayers; //Update value of oldNumLay - rzHelix_z0_ = z0; //Store estimated z0 - rzHelix_tanL_ = (s1->z() -s0->z())/(s1->r()-s0->r()); // Store estimated tanLambda - rzHelix_set_ = true; - } - //} - } else { - // Check if the current seed satisfies the minimum layers requirement (Keep all seed algorithm) - if (numLayers >= Utility::numLayerCut("SEED", settings_, iPhiSec_, iEtaReg_, fabs(trkQoverPt))) { - uniqueFilteredStubs.insert(tempStubs.begin(), tempStubs.end()); //Insert the uniqueStub set - - // If these are the first seeding stubs store the values of z0 and tanLambda - if(FirstSeed){ - FirstSeed = false; - rzHelix_z0_ = z0; //Store estimated z0 - rzHelix_tanL_ = (s1->z() -s0->z())/(s1->r()-s0->r()); // Store estimated tanLambda - rzHelix_set_ = true; - } - } - } - } + oldNumLay = numLayers; //Update value of oldNumLay + rzHelix_z0_ = z0; //Store estimated z0 + rzHelix_tanL_ = (s1->z() - s0->z()) / (s1->r() - s0->r()); // Store estimated tanLambda + rzHelix_set_ = true; } + //} + } else { + // Check if the current seed satisfies the minimum layers requirement (Keep all seed algorithm) + if (numLayers >= Utility::numLayerCut("SEED", settings_, iPhiSec_, iEtaReg_, fabs(trkQoverPt))) { + uniqueFilteredStubs.insert(tempStubs.begin(), tempStubs.end()); //Insert the uniqueStub set + + // If these are the first seeding stubs store the values of z0 and tanLambda + if (FirstSeed) { + FirstSeed = false; + rzHelix_z0_ = z0; //Store estimated z0 + rzHelix_tanL_ = (s1->z() - s0->z()) / (s1->r() - s0->r()); // Store estimated tanLambda + rzHelix_set_ = true; + } + } + } } + } } + } } - + // Copy stubs from the uniqueFilteredStubs set to the filteredStubs vector (Keep all seed algorithm) - if(keepAllSeed_ == true){ - for (const Stub* stub : uniqueFilteredStubs) { - filteredStubs.push_back(stub); - } + if (keepAllSeed_ == true) { + for (const Stub* stub : uniqueFilteredStubs) { + filteredStubs.push_back(stub); + } } - // EJC Commented out, as nMatchedLayersBest is never set, so CLANG complains // EJC Leave code in case it is useful for whoever is reading this in the future // Print Missing Track information if debug variable is set to 4 @@ -282,7 +312,7 @@ vector TrkRZfilter::seedFilter(const std::vector& stub // std::vector matchedFiltStubs; // unsigned int nMatchedFiltLayersBest; - + // if(nMatchedLayersBest >= minNumMatchLayers_ && Utility::countLayers(settings_, filteredStubs) < Utility::numLayerCut("SEED", settings_, iPhiSec_, iEtaReg_, fabs(trkQoverPt))) { // cout << " ******* NOT ENOUGH LAYERS *******" << endl; // cout << " ====== TP stubs ====== " << endl; @@ -321,18 +351,18 @@ vector TrkRZfilter::seedFilter(const std::vector& stub numSeedCombsPerTrk_.push_back(numSeedCombinations); numGoodSeedCombsPerTrk_.push_back(numGoodSeedCombinations); - return filteredStubs; // Return the filteredStubs vector -} + return filteredStubs; // Return the filteredStubs vector + } -// Estimate r-z helix parameters from centre of eta-sector if no better estimate provided by r-z filter. + // Estimate r-z helix parameters from centre of eta-sector if no better estimate provided by r-z filter. -void TrkRZfilter::estRZhelix() { - rzHelix_z0_ = 0.; - // float etaCentreSector = 0.5*(etaMinSector_ + etaMaxSector_); - // float theta = 2. * atan(exp(-etaCentreSector)); - // rzHelix_tanL_ = 1./tan(theta); - rzHelix_tanL_ = 0.5*(1/tan(2*atan(exp(-etaMinSector_))) + 1/tan(2*atan(exp(-etaMaxSector_)))); - rzHelix_set_ = true; -} + void TrkRZfilter::estRZhelix() { + rzHelix_z0_ = 0.; + // float etaCentreSector = 0.5*(etaMinSector_ + etaMaxSector_); + // float theta = 2. * atan(exp(-etaCentreSector)); + // rzHelix_tanL_ = 1./tan(theta); + rzHelix_tanL_ = 0.5 * (1 / tan(2 * atan(exp(-etaMinSector_))) + 1 / tan(2 * atan(exp(-etaMaxSector_)))); + rzHelix_set_ = true; + } -} +} // namespace TMTT diff --git a/L1Trigger/TrackFindingTMTT/src/Utility.cc b/L1Trigger/TrackFindingTMTT/src/Utility.cc index 8aa3a1c04f283..87c4f6248670e 100644 --- a/L1Trigger/TrackFindingTMTT/src/Utility.cc +++ b/L1Trigger/TrackFindingTMTT/src/Utility.cc @@ -8,177 +8,192 @@ namespace TMTT { -//=== Count number of tracker layers a given list of stubs are in. -//=== By default, consider both PS+2S modules, but optionally consider only the PS ones. - -unsigned int Utility::countLayers(const Settings* settings, const vector& vstubs, bool disableReducedLayerID, bool onlyPS) { - - //=== Unpack configuration parameters - - // Note if using reduced layer ID, so tracker layer can be encoded in 3 bits. - static bool reduceLayerID = settings->reduceLayerID(); - // Define layers using layer ID (true) or by bins in radius of 5 cm width (false). - static bool useLayerID = settings->useLayerID(); - // When counting stubs in layers, actually histogram stubs in distance from beam-line with this bin size. - static float layerIDfromRadiusBin = settings->layerIDfromRadiusBin(); - // Inner radius of tracker. - static float trackerInnerRadius = settings->trackerInnerRadius(); - - // Disable use of reduced layer ID if requested, otherwise take from cfg. - bool reduce = (disableReducedLayerID) ? false : reduceLayerID; - - const int maxLayerID(30); - vector foundLayers(maxLayerID, false); - - if (useLayerID) { - // Count layers using CMSSW layer ID. - for (const Stub* stub: vstubs) { - if ( (! onlyPS) || stub->psModule()) { // Consider only stubs in PS modules if that option specified. - // Use either normal or reduced layer ID depending on request. - int layerID = reduce ? stub->layerIdReduced() : stub->layerId(); - if (layerID >= 0 && layerID < maxLayerID) { - foundLayers[layerID] = true; - } else { - throw cms::Exception("Utility::invalid layer ID"); - } + //=== Count number of tracker layers a given list of stubs are in. + //=== By default, consider both PS+2S modules, but optionally consider only the PS ones. + + unsigned int Utility::countLayers(const Settings* settings, + const vector& vstubs, + bool disableReducedLayerID, + bool onlyPS) { + //=== Unpack configuration parameters + + // Note if using reduced layer ID, so tracker layer can be encoded in 3 bits. + static bool reduceLayerID = settings->reduceLayerID(); + // Define layers using layer ID (true) or by bins in radius of 5 cm width (false). + static bool useLayerID = settings->useLayerID(); + // When counting stubs in layers, actually histogram stubs in distance from beam-line with this bin size. + static float layerIDfromRadiusBin = settings->layerIDfromRadiusBin(); + // Inner radius of tracker. + static float trackerInnerRadius = settings->trackerInnerRadius(); + + // Disable use of reduced layer ID if requested, otherwise take from cfg. + bool reduce = (disableReducedLayerID) ? false : reduceLayerID; + + const int maxLayerID(30); + vector foundLayers(maxLayerID, false); + + if (useLayerID) { + // Count layers using CMSSW layer ID. + for (const Stub* stub : vstubs) { + if ((!onlyPS) || stub->psModule()) { // Consider only stubs in PS modules if that option specified. + // Use either normal or reduced layer ID depending on request. + int layerID = reduce ? stub->layerIdReduced() : stub->layerId(); + if (layerID >= 0 && layerID < maxLayerID) { + foundLayers[layerID] = true; + } else { + throw cms::Exception("Utility::invalid layer ID"); + } + } } - } - } else { - // Count layers by binning stub distance from beam line. - for (const Stub* stub: vstubs) { - if ( (! onlyPS) || stub->psModule()) { // Consider only stubs in PS modules if that option specified. - // N.B. In this case, no concept of "reduced" layer ID has been defined yet, so don't depend on "reduce"; - int layerID = (int) ( (stub->r() - trackerInnerRadius) / layerIDfromRadiusBin ); - if (layerID >= 0 && layerID < maxLayerID) { - foundLayers[layerID] = true; - } else { - throw cms::Exception("Utility::invalid layer ID"); - } + } else { + // Count layers by binning stub distance from beam line. + for (const Stub* stub : vstubs) { + if ((!onlyPS) || stub->psModule()) { // Consider only stubs in PS modules if that option specified. + // N.B. In this case, no concept of "reduced" layer ID has been defined yet, so don't depend on "reduce"; + int layerID = (int)((stub->r() - trackerInnerRadius) / layerIDfromRadiusBin); + if (layerID >= 0 && layerID < maxLayerID) { + foundLayers[layerID] = true; + } else { + throw cms::Exception("Utility::invalid layer ID"); + } + } } } - } - unsigned int ncount = 0; - for (const bool& found: foundLayers) { - if (found) ncount++; - } - - return ncount; -} - -//=== Given a set of stubs (presumably on a reconstructed track candidate) -//=== return the best matching Tracking Particle (if any), -//=== the number of tracker layers in which one of the stubs matched one from this tracking particle, -//=== and the list of the subset of the stubs which match those on the tracking particle. - -const TP* Utility::matchingTP(const Settings* settings, const vector& vstubs, - unsigned int& nMatchedLayersBest, vector& matchedStubsBest) -{ - // Get matching criteria - const double minFracMatchStubsOnReco = settings->minFracMatchStubsOnReco(); - const double minFracMatchStubsOnTP = settings->minFracMatchStubsOnTP(); - const unsigned int minNumMatchLayers = settings->minNumMatchLayers(); - const unsigned int minNumMatchPSLayers = settings->minNumMatchPSLayers(); - - // Loop over the given stubs, looking at the TP that produced each one. - - map > tpsToStubs; - map > tpsToStubsStrict; - - for (const Stub* s : vstubs) { - // If this stub was produced by one or more TPs, store a link from the TPs to the stub. - // (The assocated TPs here are influenced by config param "StubMatchStrict"). - for (const TP* tp_i : s->assocTPs()) { - tpsToStubs[ tp_i ].push_back( s ); - } - // To resolve tie-break situations, do the same, but now only considering strictly associated TP, where the TP contributed - // to both clusters making up stub. - if (s->assocTP() != nullptr) { - tpsToStubsStrict[ s->assocTP() ].push_back( s ); + unsigned int ncount = 0; + for (const bool& found : foundLayers) { + if (found) + ncount++; } + + return ncount; } - // Loop over all the TP that matched the given stubs, looking for the best matching TP. - - nMatchedLayersBest = 0; // initialize - unsigned int nMatchedLayersStrictBest = 0; // initialize - matchedStubsBest.clear(); // initialize - const TP* tpBest = nullptr; // initialize - - for (const auto& iter: tpsToStubs) { - const TP* tp = iter.first; - const vector matchedStubsFromTP = iter.second; - - const vector matchedStubsStrictFromTP = tpsToStubsStrict[tp]; // Empty vector, if this TP didnt produce both clusters in stub. - - // Count number of the given stubs that came from this TP. - unsigned int nMatchedStubs = matchedStubsFromTP.size(); - // Count number of tracker layers in which the given stubs came from this TP. - unsigned int nMatchedLayers = Utility::countLayers( settings, matchedStubsFromTP, true ); - unsigned int nMatchedPSLayers = Utility::countLayers( settings, matchedStubsFromTP, true, true ); - - // For tie-breaks, count number of tracker layers in which both clusters of the given stubs came from this TP. - unsigned int nMatchedLayersStrict = Utility::countLayers( settings, matchedStubsStrictFromTP, true ); - - // If enough layers matched, then accept this tracking particle. - // Of the three criteria used here, usually only one is used, with the cuts on the other two set ultra loose. - - if (nMatchedStubs >= minFracMatchStubsOnReco * vstubs.size() && // Fraction of matched stubs relative to number of given stubs - nMatchedStubs >= minFracMatchStubsOnTP * tp->numAssocStubs() && // Fraction of matched stubs relative to number of stubs on TP. - nMatchedLayers >= minNumMatchLayers && nMatchedPSLayers >= minNumMatchPSLayers) { // Number of matched layers - // In case more than one matching TP found in this cell, note best match based on number of matching layers. - // In tie-break situation, count layers in which both clusters in stub came from same TP. - if (nMatchedLayersBest < nMatchedLayers || (nMatchedLayersBest == nMatchedLayers && nMatchedLayersStrictBest < nMatchedLayersStrict)) { - // Store data for this TP match. - nMatchedLayersBest = nMatchedLayers; - matchedStubsBest = matchedStubsFromTP; - tpBest = tp; + //=== Given a set of stubs (presumably on a reconstructed track candidate) + //=== return the best matching Tracking Particle (if any), + //=== the number of tracker layers in which one of the stubs matched one from this tracking particle, + //=== and the list of the subset of the stubs which match those on the tracking particle. + + const TP* Utility::matchingTP(const Settings* settings, + const vector& vstubs, + unsigned int& nMatchedLayersBest, + vector& matchedStubsBest) { + // Get matching criteria + const double minFracMatchStubsOnReco = settings->minFracMatchStubsOnReco(); + const double minFracMatchStubsOnTP = settings->minFracMatchStubsOnTP(); + const unsigned int minNumMatchLayers = settings->minNumMatchLayers(); + const unsigned int minNumMatchPSLayers = settings->minNumMatchPSLayers(); + + // Loop over the given stubs, looking at the TP that produced each one. + + map > tpsToStubs; + map > tpsToStubsStrict; + + for (const Stub* s : vstubs) { + // If this stub was produced by one or more TPs, store a link from the TPs to the stub. + // (The assocated TPs here are influenced by config param "StubMatchStrict"). + for (const TP* tp_i : s->assocTPs()) { + tpsToStubs[tp_i].push_back(s); + } + // To resolve tie-break situations, do the same, but now only considering strictly associated TP, where the TP contributed + // to both clusters making up stub. + if (s->assocTP() != nullptr) { + tpsToStubsStrict[s->assocTP()].push_back(s); } } - } - return tpBest; -} + // Loop over all the TP that matched the given stubs, looking for the best matching TP. + + nMatchedLayersBest = 0; // initialize + unsigned int nMatchedLayersStrictBest = 0; // initialize + matchedStubsBest.clear(); // initialize + const TP* tpBest = nullptr; // initialize + + for (const auto& iter : tpsToStubs) { + const TP* tp = iter.first; + const vector matchedStubsFromTP = iter.second; + + const vector matchedStubsStrictFromTP = + tpsToStubsStrict[tp]; // Empty vector, if this TP didnt produce both clusters in stub. + + // Count number of the given stubs that came from this TP. + unsigned int nMatchedStubs = matchedStubsFromTP.size(); + // Count number of tracker layers in which the given stubs came from this TP. + unsigned int nMatchedLayers = Utility::countLayers(settings, matchedStubsFromTP, true); + unsigned int nMatchedPSLayers = Utility::countLayers(settings, matchedStubsFromTP, true, true); + + // For tie-breaks, count number of tracker layers in which both clusters of the given stubs came from this TP. + unsigned int nMatchedLayersStrict = Utility::countLayers(settings, matchedStubsStrictFromTP, true); + + // If enough layers matched, then accept this tracking particle. + // Of the three criteria used here, usually only one is used, with the cuts on the other two set ultra loose. + + if (nMatchedStubs >= + minFracMatchStubsOnReco * vstubs.size() && // Fraction of matched stubs relative to number of given stubs + nMatchedStubs >= minFracMatchStubsOnTP * + tp->numAssocStubs() && // Fraction of matched stubs relative to number of stubs on TP. + nMatchedLayers >= minNumMatchLayers && + nMatchedPSLayers >= minNumMatchPSLayers) { // Number of matched layers + // In case more than one matching TP found in this cell, note best match based on number of matching layers. + // In tie-break situation, count layers in which both clusters in stub came from same TP. + if (nMatchedLayersBest < nMatchedLayers || + (nMatchedLayersBest == nMatchedLayers && nMatchedLayersStrictBest < nMatchedLayersStrict)) { + // Store data for this TP match. + nMatchedLayersBest = nMatchedLayers; + matchedStubsBest = matchedStubsFromTP; + tpBest = tp; + } + } + } -//=== Determine the minimum number of layers a track candidate must have stubs in to be defined as a track. -//=== The first argument indicates from what type of algorithm this function is called: "HT", "SEED", "DUP" or "FIT". + return tpBest; + } -unsigned int Utility::numLayerCut(string algo, const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, float invPt, float eta) { - if (algo == "HT" || algo == "SEED" || algo == "DUP" || algo == "FIT") { + //=== Determine the minimum number of layers a track candidate must have stubs in to be defined as a track. + //=== The first argument indicates from what type of algorithm this function is called: "HT", "SEED", "DUP" or "FIT". - unsigned int nLayCut = settings->minStubLayers(); + unsigned int Utility::numLayerCut( + string algo, const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, float invPt, float eta) { + if (algo == "HT" || algo == "SEED" || algo == "DUP" || algo == "FIT") { + unsigned int nLayCut = settings->minStubLayers(); - //--- Check if should reduce cut on number of layers by 1 for any reason. + //--- Check if should reduce cut on number of layers by 1 for any reason. - bool reduce = false; + bool reduce = false; - // e.g. To increase efficiency for high Pt tracks. - bool applyMinPt = (settings->minPtToReduceLayers() < 10000.); - if (applyMinPt && fabs(invPt) < 1/settings->minPtToReduceLayers()) reduce = true; + // e.g. To increase efficiency for high Pt tracks. + bool applyMinPt = (settings->minPtToReduceLayers() < 10000.); + if (applyMinPt && fabs(invPt) < 1 / settings->minPtToReduceLayers()) + reduce = true; - // e.g. Or to increase efficiency in the barrel-endcap transition or very forward regions. - const vector etaSecsRed = settings->etaSecsReduceLayers(); - if (std::count(etaSecsRed.begin(), etaSecsRed.end(), iEtaReg) != 0) reduce = true; + // e.g. Or to increase efficiency in the barrel-endcap transition or very forward regions. + const vector etaSecsRed = settings->etaSecsReduceLayers(); + if (std::count(etaSecsRed.begin(), etaSecsRed.end(), iEtaReg) != 0) + reduce = true; - // e.g. Or to increase efficiency in sectors containing dead modules. - if (settings->deadReduceLayers()) { - const DeadModuleDB dead; - if (dead.reduceLayerCut(iPhiSec, iEtaReg)) reduce = true; - } - - if (reduce) nLayCut--; + // e.g. Or to increase efficiency in sectors containing dead modules. + if (settings->deadReduceLayers()) { + const DeadModuleDB dead; + if (dead.reduceLayerCut(iPhiSec, iEtaReg)) + reduce = true; + } + + if (reduce) + nLayCut--; - // Avoid minimum number of layers going below 4. - if (nLayCut < 4) nLayCut = 4; + // Avoid minimum number of layers going below 4. + if (nLayCut < 4) + nLayCut = 4; - // Seed Filter & Track Fitters require only 4 layers. - if (algo == "SEED" || algo == "FIT") nLayCut = 4; + // Seed Filter & Track Fitters require only 4 layers. + if (algo == "SEED" || algo == "FIT") + nLayCut = 4; - return nLayCut; - } else { - throw cms::Exception("Utility::numLayerCut() called with invalid algo argument!")<SetOptTitle(0); @@ -21,16 +21,16 @@ gStyle->SetPadGridX(false); gStyle->SetPadGridY(false); - const float trkInRad = 20; + const float trkInRad = 20; const float trkOutRad = 110; const float trkLength = 270; - const float beamLen = 15; + const float beamLen = 15; const unsigned int nSec = 9; - const float chosenR = 50; + const float chosenR = 50; const unsigned int nSecEdges = nSec + 1; // Standard eta sectors - const float eta[nSecEdges] = {0,0.31,0.61,0.89,1.16,1.43,1.7,1.95,2.16,2.4}; + const float eta[nSecEdges] = {0, 0.31, 0.61, 0.89, 1.16, 1.43, 1.7, 1.95, 2.16, 2.4}; // Sectors optimised by Ben Gayther to balance GP output data rate (at expense of increased HT tracks). //const float eta[nSecEdges] = {0.0, 0.19, 0.38, 0.57, 0.77, 1.01, 1.31, 1.66, 2.03, 2.40}; const unsigned int nSubSec = 2; @@ -39,9 +39,9 @@ // Optionally draw a stub with the given digitized (r,z) coordinates. const bool drawStub = true; const int iDigi_RT = 492; - const int iDigi_Z = -1403; + const int iDigi_Z = -1403; - TCanvas d1("d1","d1",1000,800); + TCanvas d1("d1", "d1", 1000, 800); // Open picture of CMS tracker // http://ghugo.web.cern.ch/ghugo/layouts/cabling/OT614_200_IT404_layer2_10G/layout.html @@ -50,21 +50,21 @@ img->Draw("x"); d1.Update(); - //Create a transparent pad filling the full canvas - TPad p("p","p",0,0,1,1); - p.Range(-beamLen-leftMargin, -1-bottomMargin, trkLength+30+rightMargin, trkOutRad+15+topMargin); + //Create a transparent pad filling the full canvas + TPad p("p", "p", 0, 0, 1, 1); + p.Range(-beamLen - leftMargin, -1 - bottomMargin, trkLength + 30 + rightMargin, trkOutRad + 15 + topMargin); p.SetFillStyle(4000); p.SetFrameFillStyle(4000); p.Draw(); p.cd(); - + TPolyLine trackerBorder; - trackerBorder.SetNextPoint(0.,0.); - trackerBorder.SetNextPoint(295.,0.); - trackerBorder.SetNextPoint(295.,123.); - trackerBorder.SetNextPoint(0.,123.); - trackerBorder.SetNextPoint(0.,0.); + trackerBorder.SetNextPoint(0., 0.); + trackerBorder.SetNextPoint(295., 0.); + trackerBorder.SetNextPoint(295., 123.); + trackerBorder.SetNextPoint(0., 123.); + trackerBorder.SetNextPoint(0., 0.); //trackerBorder.Draw(); /* @@ -113,32 +113,32 @@ // Draw sector boundaries for (unsigned int k = 0; k < nSecEdges; k++) { // z at r = chosenR; - float z = chosenR/tan(2.0 * atan(exp(-eta[k]))); + float z = chosenR / tan(2.0 * atan(exp(-eta[k]))); // Calculate (r,z) at periphery of Tracker from two ends of beam spot. // Start by assuming exit through barrel. - float rPeriphNeg = trkOutRad; - float rPeriphPos = trkOutRad; - float zPeriphNeg = -beamLen + (z + beamLen)*(rPeriphNeg/chosenR); - float zPeriphPos = beamLen + (z - beamLen)*(rPeriphNeg/chosenR); + float rPeriphNeg = trkOutRad; + float rPeriphPos = trkOutRad; + float zPeriphNeg = -beamLen + (z + beamLen) * (rPeriphNeg / chosenR); + float zPeriphPos = beamLen + (z - beamLen) * (rPeriphNeg / chosenR); // Now check if actual exit through endcap. if (fabs(zPeriphNeg) > trkLength) { - int whichEndcap = (zPeriphNeg + beamLen > 0) ? 1 : -1; - zPeriphNeg = whichEndcap*trkLength; - rPeriphNeg = chosenR*(zPeriphNeg + beamLen)/(z + beamLen); - } + int whichEndcap = (zPeriphNeg + beamLen > 0) ? 1 : -1; + zPeriphNeg = whichEndcap * trkLength; + rPeriphNeg = chosenR * (zPeriphNeg + beamLen) / (z + beamLen); + } if (fabs(zPeriphPos) > trkLength) { - int whichEndcap = (zPeriphPos - beamLen > 0) ? 1 : -1; - zPeriphPos = whichEndcap*trkLength; - rPeriphPos = chosenR*(zPeriphPos - beamLen)/(z - beamLen); - } - secBoundary[k].SetNextPoint(-beamLen,0); + int whichEndcap = (zPeriphPos - beamLen > 0) ? 1 : -1; + zPeriphPos = whichEndcap * trkLength; + rPeriphPos = chosenR * (zPeriphPos - beamLen) / (z - beamLen); + } + secBoundary[k].SetNextPoint(-beamLen, 0); secBoundary[k].SetNextPoint(zPeriphNeg, rPeriphNeg); secBoundary[k].SetNextPoint(zPeriphPos, rPeriphPos); - secBoundary[k].SetNextPoint(beamLen,0); - secBoundary[k].SetNextPoint(-beamLen,0); - secBoundary[k].SetFillColor(kGreen-2); + secBoundary[k].SetNextPoint(beamLen, 0); + secBoundary[k].SetNextPoint(-beamLen, 0); + secBoundary[k].SetFillColor(kGreen - 2); //cout<9Rqhd9qP_%!!3Y)Z%c{d*IJhv_Sq#xAqMFXXKvfvwh_GHSvU@%6Qg6!SLE{Tgn%28>}Wx~$}VwSXI&Q=yYvPY6< z+ncKxJ-JBmN&X{x^{u7)Sw9v8t;Xj_^1F;pb$1o#g8J7s5mjuM>YlDASBPP*@^99# zLl?H9K5EeSsNMNA=(~CfSN;t6_HMfz8YQG$SR>=o5)|0iG_iPosk3)pJ<(cnb@}FK zygr=g{(Z@cdbv zRY9!LQl6E`D{lJ%vGyBhW;vm^qq5TLs!m0S>?b5Lj`!#A*{`qmDAJ345(f_1q?1L4 ztDAZbjw+oQ2JXdYDnz}|Bp+7#Zk52&Qoq$Dq`ZsDY5~vXCfm`R?c+Py4dL*r#feqETdj@xjsan2dBTMDmB_faLv^Mf2e=S60ab;T4W|-EK5% zRvfhc@%jknL*$R)W@>F{!XCQLGo-f3Tcv~}L5tdRVu&=7MIpv$df95!_YtYf^Tp-D z{$fO=^h5YNE!D=A!mRmG)ep-Hv%@&3!9gv?zU{sXaV|HS6)Fy7aeq*s8zBvS-fw?t z^+$%_ZgLnZBE)4u)=z9!BJ@xrr!IE*_RYI+xD|TaWHUd6xKn3m^3rFG-F8>Tm89he zTYte}A!TPnfs;@C&0379<6jsZeym+2Uo%`GvUTCbpVffxL=NjJI`<28EIHxds9qeR z7$!*)8{72fwn7(K(Wn>Fi8U%p&wG{+?YH$;YNehHD!x-+qjfj8g~mpYgHzts_rx)^ zM@Tt7bL>lgRdgexAD3hd?PGM&5&D9$W?#{lvhGLoytCT*UQQ}p7l>gwwHt-T^YB2GFMxfYv7o$)pFTZMzM-)v2pWgvdo7NqlyDs zDvy%>0i7T2%Vj1{T<-6D>2<~h%e`t<^4apl;YL;2$FCITHm?R667hSq?yA^K-`LQS zy6~QnvLbi6*KlS`aBSm*XGrVon}r#7n-5_3vn~6~IB+fa&fHJlF%f$}0U~9Hhu#TBMzX+>3EW znn^Rtz2B_FHePusG+-1eR~i!e@L1IAghipXz%o7)iOe)>Em$ln*(bJEZn@R1?4T3e!XeV(a0j#en98`{SEPA@?K+)Nxf**^m4w%HCrB{ z8nfFsOk(cx5EQXoncCEzgk|=eBUl|gAW6)8w9XX9pR{h-vej6+H$u)x5_;D5zGOjC zRBtOI!{}htLYTe1|G7;(`7`uE#(ES#y$Rn)MK1IlPm+#Ul{@jDZ#5Cx^G*XX7;2QK`HA;`n`?#Blr8bIFr~q5TXh zEjg~a5Ay z*IU`Ok|H(i_0o6p#j+UfRJvMjrEHec4|q=oZbbH1BM+NiUI4O7bjK7bNXH;L;N2Fw z@e*F=cGxlo)E`WNIrG(*UB-LK{m+F*1twk`s$RMg8Swlq=-z=tdeXLUB zFSL8|uc+qU02^o5mj0&6j8LNDZAnDFa6hF%@}FM-y??JqZnhw549tPHrD9uBu%KO ze#5M9rWtGIFRvnm1oVcjDI2kTLMBJB!OHU=DQ59OR7bs1IxldbXC*!-i$kv*{hxK0 z<*r=YULNH|BB?`OZiuV)eq#?7QtlP<%zgC*iL9!#zrNT;2NfB;t%7*#5AYI~m?G}` zOtUB!lnIL^s(_2keb~AfQU#0S-Qp;85g|=E-Tu;J_%8`0Iwf~uZeDF?6sq8jN@dOa zx4KkJ{Go@=IY^{ge1s*dYK>{L&;h^cI$4UO2aPpjm#UxcGG8-3)Jt23b;3q%1J0xR zaV7qeA!{AZeXbX=#8uMlhl?lKxeLo#DMa5a1Q*HadzK=M2J7!asBZL+3VrCb>+_hY zB`2j`A%+5HoVP3r&xcoq+6saK0{(1_IpYz}v1Jj9`Pqcqy@iUvH2PXBf^>5g8GhwS zIfZx6N#HPCWgQJD4}7bshiQ zY0umJ^^U6`!wxO<3TvV`<%deK znO8ypN6sxdwH4&#F2sE@Es2~pyNKyijNQ7P(D}f7x(3-uq;1yEvfPABDs7XwnvJ}} zd?VWyR;ZeiKn8bbJx9%$t3Y85>futJa2;ftNvF(e{GjQ3;)eU6ZgUU39FP{!0KL8% z_LjHpD!EDW025MIitd>%!q!k%L-&|T6lnOWsWG%@2kR3n$hN#u1#7jTnjzKnTXHYL z`nE@mkrmo$hY&Z#q>8erN@l$<%AvDt8>-Y+k$EHV!Q)UOFh0^U+SbV}kkb>&r>3uWZ$&a8(=5hFUq!;^ zrM&@o0lPo;B;?<+v=ro6p@o!jyyk;2^-wsh>wVLDC;74v>mp>m#YuaTf!QKSA3WAF zWK%E}Z*_9ACL2D7Y0YFtH>M4_$v~s^)x5G-R|hn3XEH|-^H-e;6y}gbZTOelovk`4awdL#xUn)UvHMQVt%XEcP_j1^b>0^&;p!*w zvTIVvElj8J=8g~}<;1d_$`j?{KjkZ41ZFmfN-7A+kj?DY^WA#+=7E82V*{T63|7z7 z=;3=y!vmv?N@ycR(+=gJQQW${chT_if5RIyK+t=Ewpbj(2d}^wdDyC2q#-vZ@xWO- z+}#$sd5>*Guf64ld|SbTDA{hz=(?Pbo5fKZMOF)Cof{r2m9(K%+5dPoyh1EL7m2K; zkW(XA9u4B>{u454_?iNC@$gtHils&Bq;j|!hhXJp*az0El~(bz!H}mcC9lD{DMWp< zDtD$JT0A~EuF9ilI7Vq`Tb|&3*|b1#Ak_q9!ORFv2-b{(mOSRc-u!}`mo!@;!XPNI zTV4(9x+47`r{hlR z!Ppft;glC8yLyM0D%GsfBz}#`@C7R+*yN+{|NCtH2Xyw=Kh=2NEA)986^r#!^Yf9& z;MDh}Ch-6vlFLPAnkCKLa1J}!_zR{6|5z7`mc!v!x4GH`6rwT#URUk~Zg3u2>a>Pv zu!BlO?N1_tw+*`>&1@AfKR5gP0Y<*PjX?RmPo@z@nkVRpfU=R* z5!o+QoSr)UV~8~AcUHLaads!2!$Z*C3VhltRE*|sD*!Gb9RB{{h;r^ox$_Kw#NeSf zonOXGo#npD?)Ff|(w_H!g|dr`?Xh0jl!Qj!HNfQ#o5RauZf(=6j#mdjoF?F_K2cj^%*+zL^X$zHlPlRAcVrY>i^ zum4%ui9@gKxc3UB7zm;4BWI0I=aS8JmgkS*e?isQbsIHBoGhIzUp%n8)<1^SM#fWkc4!=nZijv~XJiW*yMmV|Y|f_oLFe+PYNK$d2fc z$V*{6&e;oYe1_0GmgMB#dQ9o&=F@!ygk-$4Ciyi3K+L~fUPl)q!KXH6bzpf8024Jb zCOJYaY0mw8nOn=8RaZdS>X(})t!*-Sb&vOthOCRfJ{D4liatl)ShYPtDDv3&GMv2Dm zF^PH(FnN47fab9zen#A3h5jpX&Fm|G4g37njlJmK>tKNDj*71p4fakRbgZ% zX>Pc3Q3{l~V_qOG!&T{k82O|0Gvoq{YbDuh#(MJH>z$HDmAAdlMoHa^4L5q`nnftn z4K^c;V|-rM_8b!`V054?pPMOZ>5RSI{y*&}ZjI^UMSIlo;%<#m^uEO)@v`3FbVuIf=y+_%AEGIAe-+uHF8_}G`rn<$L`d$kGtBlo>VVs%E`gcE3wZKz z%!B7a1EbMcMe-lL&i~o+;Q-{gh91m}l+w8N5Aabxhk08(>=+LD;ZiBpb9bb$&xcHA9_#c@+?ARe~ zO7dMuxyp6-2%(E)gJv$Dv4;H-O9FJ681-or`uL;B!Qw1_ z8{*WFq2V=Dq;<_e)U1?yCtWMIWp-ah#vYke$^7!hJ~d}x-bp|*0p{WQi2x8Cy%fXJqVZ=?NZIASW{mx|$=!c|0v&o- zzK?D3tAGctw$~W=el*>5ichS(u@P#_`#iGKsLkUVWUbo@7MtSD;#n00`T|xX0CA(R z*?UmP_y~iG^v+nJSyda7G-IwS08gl1X1|!6Fe8mqUW5^=)-M2R)1WI(`WbapmkO>z zlh0%FN%}NscJsY!gf>c99o)R|du`-TIR;)Xkz^JHo&FU`;rdU1J%28)9Aq?$f@Vyw z+($*(om7k>fssFg!{Y%bV65p>HKNOtHtCe=uEyV*KH`Ng$B{YSb6%l8Y-NWq4^=WS z(LOb$KDIFo@{YFGR;X#@>+oS7DL2TzEbJR`00*lWZMAyOhI_o;Iqs;h;mi`)W##ASXmkjrdxb*=^J+a}$+7PZEI%g}(5 z3TP6xXs=4Ko5%VeGWfQh^OZri2Yk4U`Fa<7dh%6{05Lbx=cq#_mo%dvkURYt^GZPK z+1cwdLO^;1B@IK{F_2CnYBLoTaH-48H7VA}wR}igZ@-J|a{(vD+w-`A+Bhh&E)KAP zEFds=u|}FPMmqh(QbrP|rrKnzFVzym;n)gQoe2Nf)goA^`bzQif;&}tyEcME;@|HY zK2GJ{LsZ4i;(^GXWn*s}p z22Lwv+aiLURCmQu2i#!u9yeNFSRnuUbUL>NV;%hNKfcm>?$KO$ij>%~ex}ELsd9pE z2m4OtTU9^`Qv4%gpgo?LfVWO?C6r#K>f1(2yWnI3u^I3xh!2RDKVrnr+u}-SBhOEF za=Gq9GHcP_yqD=n?NBwXKu+SJ1s-KSpZ2wFL%iLG7omu#n3^3(n-)4QFc2C-|F{b^ z;Jt$@Z`l7XFvdu;-%;aFwdzyICQ+I}a*5U9Bu-zMEt#1hm z-%NqjySIfpKlS$ro9(CSmyCHnklCST0#L48;0Y}8z24?3WYc_0***j|9<^jA!e5aCOcULpN2+xZfEaV|hbRLklIR;sRp z-C_ahMHsC8|3bCeiemUbSakx>JInI9b?}?_Vk3Dq;-v%tW7tySaQ!D| zc)oDneOto+8lTF~&omQu!5snY9q41V0Pv?E9}C(?aJaHmIudy-vo0PRVO=+_1dSp; z^i<2EHlRom8t@)bFSzKxAUPKSwuoYZ*jp{K2H*f9+xoAcDq}ysZ(MCW7YToT1PYIf zlJJwM)I~zIPi5VN?-eop622)~*p-v0qkxO5)XQ{$(rMN&ARtrY9k5BZK6aou)vx@%944_buY)%9HDmL?TA}9x@~>c3s>kOx z{yGWyr*63TSFo#Eye>}c__25YARBKe*8Nmg(+r{&{#T!#<1gyTrZiHwgiECea~56t zlr8^>CNW!{BZ+CAIE2ZK9OKfX(k{2`QYP~AhZ4YGCf&OCk_1nO>gCV!?b;QI8#V0z z#>iB!DM;r5mKKt{sm;2F3bQu>T@3!aC1sQ%4vA#_jiZS?7KLT6lRdk?TV}>^i{;|! zdxDYdzQ={m7|$MKnac33ohwq}<9 zG5p=O_)LOpQWgZU;xk>7!oQO^QCdQi0LuldNX!Um?klT%3dO{|r)2{=gc4{u* zLT&uR4OcDh8o?Cdk%K%52N1>k9UmSUX)diDH55{@}Y1ptmb4hpdlm7Rr{3BMu*6i6kFj zZt&Np>a1jvKi_2ly~#Pa9qmtqu~tQ~$7@gbn{@4kF_ydfflv22Tqa|U=N!tth?le9 zBHW3dye8u5f^a>If{9YXJO90UtPRlrLdsbT0)jgpn*8z0R-HDO5v@R0F~(>oxwds3 z?e}`8!fI6vQdPDfkZ3p?>(m*iD77)2!uk_Z;W=Xy?{v8E3aM&lnL4y@b4(^3`M@o&jT(3gv$kNF0N`_<{Wv%PhD<%uRGu@3Xwx~yd-5` z+o_W>yFpZ=cOCdxi_Aclfp|^Z%v`#Ns#NkJbdei3Wb)%^D=>@4EDnCQpQXdIULkuY zLom7l|2u`Cw{qD{Du|1jLqveYm`nlMNlMv4(>!S=1-Y4W!OI^Sn#MzRBlkdUYy zv^Rn{IBZ?KYGehpkkw?L0hm)D1EmFzbHC~f{QwcJG8%dnza#(vhYXZ0vHKf_575caV3iTns{SX+A{MN| zYj_O5+82u|u)MuS;4CH-gy20@6UwD|LVkc<)kyy=6WuAGW#mfR zEO_{BBQf#y!>z)MCD&N2_eM@)+=Z&rH+`=-LSZg9WamJ0T4Vbt!9LG|kg_B__QviL z3eVSbtM#gUmqHa!c5f&|9gKL%5Bzqs%I#k?Ub3;r9X0etDXR`-P(Fw0@wz6VKArn8 zeDC^P45V+o2mAxMJNx=9>?@2#EWCVW(!CD9*Vuerxx6D`oj8P>I{!fT8{N5>o4YS| zF4?}!y|g|4+jrthsKE6jKugVN>3DW9pM2s)|FgNk&TX6BZMP7r7A^Gsvdgl+;wnwW zE&>||8J7d+?PW>)S(Jn}AB|4>_pRUBd4nClM~+F*0~P|7EN^YE&B>F%P4-ilC_w^D z#^FLe2p-|@RGlowGRXh>+eqHaz_0tgTgZ(fsqxK}Yo(5N9`BG2R0s?Hescz9D~syY zf9Lh#y&lM+kn#L*{(WGmV3~mz>MBDl! z*0KZGp5AF^HF)Scdlgsy)fr#B-%XDSW38-I5*XOLEgT#X2O;NUKObL0=WYF%nD0T| z8Y>9Y87{34x9um? zof2GLOCB_C@v=d`(8K*IfL;{2`n&8lbJw?zZzwUoJI) zar90%;f+%3d>A=qu9^B>RV#zvOA}jgba{r>=peP5GBa3}LF9F6_rUFousbaE9|;t7 z$os$j%&O--d6G$U*(uGY?BVi|K$(%2`{xelrWawkh^}LiEW1M8vC;>Q8B!_4!jqas{44BHrv5raK2e*o+sAa zLq#lvpwsx5t61MTYh9*;Ck#c4jhio>^FjlQ46Da~nyj@0G^p*q_SS~4@m)>!9L1aa z)1FOTVIiAicLrxS(ug9%B#Rko=)}ec?pQ^H$%~~R+N>YYioAAR=yu9MHD$r6hC^&q zu^dRnE}lGx@jB-vNV9j4khTkfg3FRs7dVNNtnD&-sqvEW63 zm|ZsIg<(M*y@8Xt?Jthu^VEsiZw@~WHk9voN%!yi4AEPdtm*0(&i|lWIJ1L{_%ISs z(aLmL$wN7N%)q@ua@T;_D6>HLzC`bUDbdfD;uW#xf_5#8AE2a>XTrfc z;sZLo9K(pBU8XndB)_TJX#TSx~SbUBhFzO-yTALkzE7GdE+(0AM zlZHRXhF*qY-(W$Nt@e#(xf2{jKU^3=5G`0ulC0&&3T0Ueao3=Q{NA>~`!{r_Z-Sekz#yin$$t^$x!~aYJE$oG>^7AIlI~H{VobEuiM>D02vNM z0xZ228{f35`IG^s5pMozEBoSESV;+p4`Yn|EkODIM{lIU<1z5-fj6RC5zC@rfMp`M zGT4Jz6biWT_okPefH78xdQhLH9~8S9fdxlG$7q@)?^81C4z5faHirbzER|FR-FKPz zmgqqylx9rJi-=YzxDP)0-T-iAJrHawcyV}~g4#-l!`~U1NgrK2jb&W$BXFpUh>?_1 zES(iT4P%@I&@Gn$1PVy6egt+;|0qKom64jD257kaPr$Hr{sCbmUKmMurdjQ?2aY=7 zOC-lj*3uwKfG+Yqb0g#tmal`1WO^#E4JCM>8MBjIz-57cGBkVfv}5m)$Q~gph?GA# zIu;mjFUYA<&A$3Uqd6(#G%bb7H7Vc$@GW9{$7HU5x-h#l4#C^%8epE@i4RFQ+5U|i zfPm*E|I}p?H{4Ty;!MgD2Lvazxg3LWM?ipyW|3(>C6;@Dkqh3sS*Zl#+saXsh^hda zwt^o+)@Jd2jvr=R;qaBr&mIr3p^=gK)b=8)87WS#a)ifm50Ca0fJZBR7%1PJx zd&U^LESDjEK6CgSn34P(;@0lR`Bo43+z8RK~=7y(FT4(GB zT^!bgi_I`Kbg>j@2qQbi150guiTcM(*mkc1mobr~Iob&D%^FA7b9Mzv-aC;X9I8g@ zj+J}gPnT1H&`Z(^Nm<6hu+!cb=YHL#u{PB$VrA~A%UlB$HOBq80#B^4mE(+O#Sw`- z3|Lq#Bs~PKDee9DMF$TV_624=G}KtrKl^lp9I&)LDESg(WfUrG^2R-6_yYF$c5kkY zJS5Ijw1|uVnHv-BT<2@@;0kTKY1Ill4BRfpbTfi1XS> zAv+9 zGOSVkk|5`THu1M09!ex?|5NfR?Y#bn`*!F(m9DY6BdGfz{E3Qe8!a3BV9Nm5&N{<# ztv8n-qCD(b(#&99?e^-H?DF8rqdL7a+ne@LOJV-+7|zF&mV1g9B5IZ;iVyp?<$jMW zE@zkj5pewFOT-%P-VjOJ6vl=t=3wm}NVG#pjYLRi60mW3B(EhN@F^=bhdYf&WBjBToWyOyla=dr|hXcSE{!Y zwKh1S)NzTy(j<&yCV_6&XhN%V{Hf4>50f3bvd+=PClv%*3?gP+HBu1!^g&1PxrH*K zmmLlLX~Us_j+7pU=xX}kAoS4Zcs(^`@tYMo-(;sLI970Nu%|8G4)IZxEz_g82S``) z)R%&8qwtdLy9`8Yb`uwgBBvVS&?>jI0}jZ-&caB1|3%|UMppa%GAbLA_SY6EMHCY0 z#^`MlNJ}`CteM`IW8nODu*3Obqv?_pKU+>Bm1$=v$4Ici%(uOo_WiHz25XiMVU5nB zU2ToU+JR=%jfC}aQ*_M5OJdpqZ0yt*FdhbA+skrwdDgBtx!hN&EB3u1@HOYB1ingI zdDY4Q1M|KZS7qp~iNUNqfu{=}+jtzqId1gt_M;K=eDt0xDu|&&q_3GdY{l;55b^Kt zQZ8Lf_AN6Lxkn2qk%6}r7tP;*sp}fJ{_>-43NJDX-4aTeHZ~L@SSy(K3Sz2T(&wDk zp1!9@27DDfukP4UM=Cnczok;W{5v4s!^Kgbk@4&(MCrLmjeG~8IEljJDM_29lP7bt zvi=jy4dDs!C(G)!r8Yy^sok+ePkmiWh*Td6U4m6_OMjVde=J0$Nja^*M%f2=CpE2O zIsdzcYW)L}0X%eY5w|X1Ywb_Bs{{kssg;>$hYLYZAGXKVmp@kea_{Ct%i-JClBg-x z`huL``HXq@*$Ry+FLO%Z2zKyrduCr;qQA1t|NBeBrnY?RIE1d=aK5IRE#J{!BJx`r zQtOdArq+7;;&@2BF3Ipj0cB%loM7XaXE9S6xf0-(b0kMSGIhrn=R>LIU9IDI8%N`j zq)ozYmZW6~Xl?3U6@dDFqO-Zzw{#c8>NP%b zT-XsuSebZqWR%T6bnFwW=dSFOKXw3F4SNp>1kXCH)Wy)v_TMIqc~kl8@jBAMAx~I0MhkIL zE>&Fk7}6^Hfffux55c||Gv_1jAH#e39N5ZLMwGq&?Dpf(TK#qoI?vDFmlsyFwDLQ? z+O@@QrH_28f{KDIwLtf{d$t_APCIntQLz2S%=bUUV*LfF#1DAzgh#Iiu_*Mgx$gu{ z;mMEbO}G0ekNouc!aXp(srI z9M8>uNyylJEUbULy5EHli`}AilT3Jzk21rRA9IO0sxE45s>=ACc*5iqx!r%j@?-E- zREwoU;c9W3>EL_HbyE3fsVzKKDMNU~;o56SKGP+*udv2D(}{CSj$L0b zSUI_>hkl{{=Bdgm&inMcp~*C~>xo{1^@f#$IB~s&udL0l?P95}N}MorYrDrE=4g4s z{~;4FF?D`7HG9d0N)6j3uVWF-ar=Rw#dRwV|zKV~h!$C+Jo?MW}K@%8$t8qF9VHU)!LIxPuK0 zF2{mwL~K+x$mJjDG-sH`e~hd^$l;fea-bNSdgp3dS#F(-v>$bWS|2Nxqk;SVu{RL* zL>Gbd71v=a*SL%VvQrY~BP6s3TA4O{)Cg>#mAn4i87O=n2oZpQfI2zen35m9DIEHG zhvcGaM4=Ow3Q1c@X)i4In$_5w(c2%)qc?(|vNY--EcwPGip5dKE5gx<*hB&w9jT5& z0;3|(R=}bF(v*@Y@?;(UGDT1c_`YphH(v@O6dklIhlQe_!2yMzVQ-Ec7VnXU8*nT` zK%7HKD5n)f`rYxAxZfFx7X9og{70A-8wmEeAsYu`8u|xqM$z<6xTQ#tdUV>eJMT}D z0Q0|Z8PBTRi%CG;29Xj=f?DPK{t~n4S#Hzl%N~aFs5H)}8`-EOr_@H6+VvKV>(2ArZYR38k9cnd+y#@N#MJdqNz{x{h@pD$7FxcxG=;YFi7r!X5)@!yXXNTIt83ex#5b~H^V2fDku1zm(h#_#|;*X zC_RABJ&wgXM&*6>>coJ!QowdKzyT(mo#G!qv`k}+NVn2K0$8hK#~$wOBhCE-a$$@4 zgVMblH_O}948%5N8B+IO(Es;Q=>l+^Rqb3%OBW(pcUy_La2luWzNW8U^k*9UAJc3G zBgOg3k3!PVoz^0h!&ct9L@$g3y9r zqP@ukM9O%Urj*5JOwt&N^W`5ImU9d6dnD{li*=fhtaTX{muYQ%-1s|7otxzz?TjFn z5(J>*l?|qG0=bX92LYa~1z^2m(nnr{!MMAUqC^L0W4XD8f7V-%q+k3y9Mc+BA}vT(_O9?NU0q>KNV)Yb*Fxm#P!bSml*8z*UD5$FHy8S+2FdDF z{p!2;p(%FK?f8cbu9>9RRRKlc`v(gCVfmJ4h5i~Kq)ciq*YRP*AC$MaZR;V5@{9z6 z+S(yMB48qYB#Oir{Yv_@q0@u}IG@ko-%OryWj`UfnXV88Q2G)$jyLfBP}{B23hmL{ zS5cJ&QXyA{aGdggvenseeleJ>d!K9L8>V{V@QFOe+}t2wH4SyqHUk=3eF|Hn$C3=& zwXxmhsjx`rm5j6heRG{`$wii4afk5#!C7R{+{Mz7umjqBS-ph%!s_)TMV=GBOX2iyZaon# zQN|Auy7}Z}*Jy1*5!&x~Xo|2mbRwMCNj}j@kkBzf1G%pAAb=8z%gm0_iOD<>XL7!(OW(1}l)?~=V|vJdzBG|$1G zib2)J4GA=~8N5lUwJvS~>{wBiqC9j|*%qsO0b26L^HD2_iQQQUMM9IIA3Gucyr2AZ zfl6vucB6pugCzmqT&`n3a98T&z^<4wnEcoA4~q<~MJxN6%8F&;lD3yP#MGz@e;4*2 zFu8r|?ei+(}qew{jsOpjxFHxIINe2>gEc^cC{wL#wfEn!Sb^?Hz} zNlk(;6m_qT1<8#dV4qU~J%?$(dNzK}6w>U+F$G+}3fQ##3zLD#b~z}@T@XiQg@67D zoh!g3X=_vA0H!U9MKi{q9i*)sSqi16>IZ<_LFwO8g*ukcVvPE0+a9g>W4Zukb!$_7 z#gCho2{H{-tSiOeO2@DlzrF5zozw&ntk*&YiS~nsFMn?6fW(XVyZ4pq9CnZUeZwz_ z&eao<1~~mQ%fBJk0F!n^D&{A;PAo#OB*g-SAoaL0rxkJ)KqM68F;BGB@Hwo09qJ^0 zE=dlJQw8uFd?3iBx$3B+x+wfN+_+oaFKoXPql3#?w{wxO4jLr%-i|n_wm*1#=P`s_Dl2qprmA5f_ z9Ll#%;96RD4ukP*9cU(Lj_khi`gYGTmqJ8qVfwZ@i*6`3v*2E_Q{`oAy#dbyWxoBy z;20ySq8(x;8l6^ZkDTy4{| zz>C?zV&c`;nP$-0Ww*$8ANDt9O<0rqboYUMfci1qHT3LT0{S=u(JESjRDY^!E_`%a zjPEIhwy|c>Pmk@rsbumr-3V+6V~{m{Y`$=kd9iGKtb5HYckW;PXm|ms!x?{gvNUuzCRMTc;zO6u#txrVC!4DyUmdwOO^yUU<+?;7 zBS)aOBG3I+b|c-9pd*~ob}Hj07RHWFNaId1DEEd|iv1BFxMSjMOMk?9x~QJum~?Sl z0c|G@A=75tdvdRU^dEoeW(sLal?z9Edvhl5xBIm@m-Ftl7GjG<0H{H(@-`2t$XUi5 zOE<&w6mt$?+d69xWVGt^Z;{GXAVvqJ(8Amb z_Zq!Uj&>F&4mVIzH{h~7EV_TN8BN05(l7RWMykAstH`_)d-H54paRuImZX}wlKl2g zyD|9xOR&eFo1s zKv9?mE2U8oa9W-|nR*E@WtGxXt~DZTxNZis=6w|m9#l?I!(Lqz1YPQZa~!KTp$@`!$!pllBgd}FMMpE&MX6iT zY8vlyad61JzHY=`XQH6MA;85ULnW!Cs2HiQK-IdcsjePOpw#;CH7Y7f{e{LAoR6P7 zGZxB7q{ll;32&GFdc@ArF@K%TE@q1Acw#s!olH?N<=^~ynI9!^=-BMnc`JmZcFQfS z7#Q2K+bit(fnxcSf2}>JO7&?t+2z{%VzE@vCdaZoxY5HXEAl?xA`pI5_;H)Y<>-pN1O6 z*42J0x#R}M4607cgrQegH4Qg+$JPADxVm?#-RHl#Ntz5bua9`0eDJ&z3*{Yo(>mxl zmuiDkofkj8; zgPAZeLv{y_(zr)+8*8*9?D82v32Y1it^w?IXG%l}eDW8ShqOnSGB8Vxb99B~;rbGB zvN5F+a{f_0|9)71$4kpW3C;qA-?}&RQ#B2xFC6dELD@3}s;ga`>>4yn?-i@;q6c-M zo2@Llqod{j(-L6TW?ZkvR2Rj!^FxH`TQZ!JQs=`>`O<}9^LK5CljEZxgMyohn@M=r zGajm6`d|Ju=co7oQ8N3$S_P7#ohyWI2!8hEgER`?!bznLbOEdGJD-+iTk)L18ca9L zdxIoY0A*ges3P*xrZ^zH(8+AIZ0fZ~Rq{=7-EVvkX;6dT2``!~brf@LCUw&cWYFAu z+V7}F24+#~H{gR(a~B4WfY71SkVs{7Kj)4&HfgM01L(De9-2z?(HjP;orr}aMBl1M zf5mnZ9qOKPZbi$Z!_bOVwMpYm<6`=v;%=Jf!XBPOXp_APU*~9%*jCY3E@MSSRx-Fc z{YQs~WX`!!WIH)X&Sff8Nk7YEp3Tr$W2V`D$i6>GZvTR`O%q*kY9K>1PpneP-d@qb zK(8d|eL`jsO@LT^aS-ZQakUB4v+e^@>APU4F4)G4YB3 z^_48=R~!cel?ltYCy}|Y%l1$kAx1dUKEtC zQsQ%CwnFzgRz%n}iu~x7=M`V47`acsy=@vWMuT!_2trTRQCS*0uv=^n?HssnYt$}k z!E&riD;Vf!dxl>uj0IY48dqWFZJ3Gjh=)S=cBBh)U2Poh4i9|g%Jz#~sduBp(kovB z?sZ5d7Lct7l>2Uw4Lm<#l{f$uiYEOO{>_B=G`9C`YWvN;b)s68!EcX=5a&^r}6yx1)5PE+yf=t}5%>|EsSrsZ2j{^16l3;JMq zGu<(RpPBCvy|!pKv#}$W4&0ddUF13c$gex$u%c^N-UjsVe(CM&3?Sdu3H(fjdoqgr zxQFufap8?}wjgtrk=sO8c7Fj1FVpvMJ(6_t8xyn0xW!iHDPe7aGQu4}Q!+(&sW#7A5v`3*E;heAjyj3dtZ}vs;aQGRXL`?Z^~<7o zKiguHIBajLV2?qooSs@uJpE0PTc_!Mwzo0x1~%$|!8Wk!IV^DW?!~4V!?I2@<^Nj+ z-o%%@fNA=f+)V!t@Ve-mQ0ulDMw*Q@jyfXBg;T0INJZgRiKbQ@tHQkh%Ad*w7M<40D)?$pj z36Ku(7HTUV{and-V5CW;nqd<^ZC47C9nW|F8OrdX@r5p&99kUQ-GI7o>IC^>OxQ>7v0|qpDKXuUA+1Pm0E*C@Gz~|uFc9x%g1^ZhrtHJMs z%e)E2u&8#_?4^$hx@d&w{Bvx2=BOx>-@+Ei!+bPTCG!M3^WxyQ9bDvgO?XSrYwm3= zLB1|*Ak2koAEX@Mrs+LaX|2RAjmxvpdjZn8ojE4=6e)<#f!9XuTMKd)+z$5AjWoeg zN5`Q?so0AAMoe_$?*dDHUMS->v9>;(7~sgloXS|e3$0edhk?o?)feH|PIx?IP_}k5 t%Utqe209Nqs{>PMqQ)%K|6MXVPhd5(+hK(s$0(?vf}DzMuC$)d{{aW!qH+KL diff --git a/L1Trigger/TrackFindingTMTT/test/chi2dof_cut.C b/L1Trigger/TrackFindingTMTT/test/chi2dof_cut.C index ca6ce9b0c421d..66373fe48efff 100644 --- a/L1Trigger/TrackFindingTMTT/test/chi2dof_cut.C +++ b/L1Trigger/TrackFindingTMTT/test/chi2dof_cut.C @@ -26,8 +26,8 @@ void chi2dof_cut(int nSkip) { gStyle->SetTitleYOffset(1.6); gStyle->SetTitleSize(0.05, "XYZ"); - gStyle->SetLabelSize(.04,"x"); - gStyle->SetLabelSize(.04,"y"); + gStyle->SetLabelSize(.04, "x"); + gStyle->SetLabelSize(.04, "y"); gStyle->SetCanvasDefH(600); gStyle->SetCanvasDefW(600); @@ -43,7 +43,7 @@ void chi2dof_cut(int nSkip) { //TFile file1("out_ttbar_ultimate_offall_20180831_183257/Hist.root"); TFile file1("Hist.root"); - TLegend leg(0.25,0.15,0.55,0.30); + TLegend leg(0.25, 0.15, 0.55, 0.30); file1.GetObject("TMTrackProducer/KF4ParamsComb/FitChi2DofMatched_KF4ParamsComb", hisMatchTot); file1.GetObject("TMTrackProducer/KF4ParamsComb/FitChi2DofUnmatched_KF4ParamsComb", hisUnmatchTot); if (nSkip == 0) { @@ -67,46 +67,46 @@ void chi2dof_cut(int nSkip) { unsigned int nBins = hisMatchCum->GetNbinsX(); // TH1::GetCumulative() ignores overflow bins, so add them by hand. - float overMatch = hisMatchCum->GetBinContent(nBins+1); - float overUnmatch = hisUnmatchCum->GetBinContent(nBins+1); + float overMatch = hisMatchCum->GetBinContent(nBins + 1); + float overUnmatch = hisUnmatchCum->GetBinContent(nBins + 1); float lastMatch = hisMatchCum->GetBinContent(nBins); float lastUnmatch = hisUnmatchCum->GetBinContent(nBins); hisMatchCum->SetBinContent(nBins, lastMatch + overMatch); hisUnmatchCum->SetBinContent(nBins, lastUnmatch + overUnmatch); - hisMatchCum->Scale(1./hisMatchTot->GetEntries()); - hisUnmatchCum->Scale(1./hisUnmatchTot->GetEntries()); + hisMatchCum->Scale(1. / hisMatchTot->GetEntries()); + hisUnmatchCum->Scale(1. / hisUnmatchTot->GetEntries()); hisMatchCum->SetMarkerStyle(20); hisUnmatchCum->SetMarkerStyle(24); - hisMatchCum->SetAxisRange(0.9, 35, "X"); // dangerous. don't make lower cut too big. + hisMatchCum->SetAxisRange(0.9, 35, "X"); // dangerous. don't make lower cut too big. hisMatchCum->SetTitle("; chi2/dof; efficiency loss"); d1.SetLogx(1); d1.SetLogy(1); float ymax = max(hisMatchCum->GetMaximum(), hisUnmatchCum->GetMaximum()); - hisMatchCum->SetMaximum(2*ymax); + hisMatchCum->SetMaximum(2 * ymax); hisMatchCum->SetMarkerStyle(20); hisMatchCum->Draw("P"); - leg.AddEntry(hisMatchCum,"match","P"); + leg.AddEntry(hisMatchCum, "match", "P"); hisUnmatchCum->SetMarkerStyle(24); hisUnmatchCum->Draw("P SAME"); - leg.AddEntry(hisUnmatchCum,"unmatch","P"); + leg.AddEntry(hisUnmatchCum, "unmatch", "P"); leg.Draw(); d1.Update(); - cin.get(); + cin.get(); TGraph graph_killed(nBins); graph_killed.SetTitle("; Good tracks killed; Fake tracks killed"); for (unsigned int i = 1; i <= nBins + 1; i++) { - float fracMatch = hisMatchCum->GetBinContent(i); + float fracMatch = hisMatchCum->GetBinContent(i); float fracUnmatch = hisUnmatchCum->GetBinContent(i); - graph_killed.SetPoint(i-1, fracMatch, fracUnmatch); - } + graph_killed.SetPoint(i - 1, fracMatch, fracUnmatch); + } graph_killed.Draw("AP"); - + d1.Update(); d1.Print("plot.pdf"); - cin.get(); + cin.get(); file1.Close(); } diff --git a/L1Trigger/TrackFindingTMTT/test/plot.C b/L1Trigger/TrackFindingTMTT/test/plot.C index 7151153dfa1d1..550310b15c370 100644 --- a/L1Trigger/TrackFindingTMTT/test/plot.C +++ b/L1Trigger/TrackFindingTMTT/test/plot.C @@ -21,8 +21,8 @@ gStyle->SetTitleYOffset(1.3); gStyle->SetTitleSize(0.05, "XYZ"); - gStyle->SetLabelSize(.04,"x"); - gStyle->SetLabelSize(.04,"y"); + gStyle->SetLabelSize(.04, "x"); + gStyle->SetLabelSize(.04, "y"); gStyle->SetCanvasDefH(500); gStyle->SetCanvasDefW(800); @@ -30,7 +30,7 @@ TCanvas d1("d1"); TFile *file[7]; - + /* file[1] = new TFile("out_ttbar_ultimate_off1_20180831_183411/Hist.root"); // Corr 1 off file[2] = new TFile("out_ttbar_ultimate_off2_20180831_183030/Hist.root"); // Corr 2 off @@ -62,20 +62,20 @@ TLegend leg(0.7,0.15,0.9,0.45); */ - file[1] = new TFile("out_muon_ultimate_off1_20180903_145832/Hist.root"); // Corr 1 off - file[2] = new TFile("out_muon_ultimate_off2_20180903_145511/Hist.root"); // Corr 2 off - file[3] = new TFile("out_muon_ultimate_off3_20180903_145549/Hist.root"); // Corr 3 off - file[4] = new TFile("out_muon_ultimate_off4_20180903_145621/Hist.root"); // Corr 4 off - file[5] = new TFile("out_muon_ultimate_20180903_145432/Hist.root"); // All on - file[6] = new TFile("out_muon_ultimate_offall_20180903_145655/Hist.root"); // All off - TLegend leg(0.2,0.6,0.4,0.9); + file[1] = new TFile("out_muon_ultimate_off1_20180903_145832/Hist.root"); // Corr 1 off + file[2] = new TFile("out_muon_ultimate_off2_20180903_145511/Hist.root"); // Corr 2 off + file[3] = new TFile("out_muon_ultimate_off3_20180903_145549/Hist.root"); // Corr 3 off + file[4] = new TFile("out_muon_ultimate_off4_20180903_145621/Hist.root"); // Corr 4 off + file[5] = new TFile("out_muon_ultimate_20180903_145432/Hist.root"); // All on + file[6] = new TFile("out_muon_ultimate_offall_20180903_145655/Hist.root"); // All off + TLegend leg(0.2, 0.6, 0.4, 0.9); TString name[7] = {"", "Corr. 1 off", "Corr. 2 off", "Corr. 3 off", "Corr. 4 off", "All on", "All off"}; //TString name[7] = {"", "e", "#mu, #pi, K, p", "e, #mu, #pi, K, p", "Corr. 4 off", "All on", "All off"}; unsigned int icol[7] = {0, 1, 2, 3, 6, 8, 9}; - TH1F* his; - TH2F* his2D; + TH1F *his; + TH2F *his2D; TProfile *prof[7]; TEfficiency *teffi1, *teffi2, *teffi3; @@ -83,7 +83,6 @@ bool first = true; for (unsigned int i = 1; i <= 6; i++) { - //if (i > 3) continue; file[i]->GetObject("TMTrackProducer/KF4ParamsComb/QoverPtResVsTrueEta_KF4ParamsComb", prof[i]); @@ -95,13 +94,14 @@ //file[i]->GetObject("TMTrackProducer/KF4ParamsComb/FitChi2DofVsEtaUnmatched_KF4ParamsComb", prof[i]); float ym = prof[i]->GetMaximum(); - if (ymax < ym) ymax = ym; - prof[i]->SetMaximum(1.8*ymax); + if (ymax < ym) + ymax = ym; + prof[i]->SetMaximum(1.8 * ymax); //prof[i]->SetMaximum(0.02); prof[i]->SetMinimum(0.0); if (prof[i] == nullptr) { - cout<<"ERROR: Input histogram missing "<SetTitle(";1/Pt (1/GeV); #phi_{0} resolution"); - + d1.Print("plot.pdf"); - cin.get(); + cin.get(); for (unsigned int i = 1; i <= 6; i++) { file[i]->Close(); From d315ff7a30e8de02587cc3029e0d212cdd6ec9e6 Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Thu, 2 Apr 2020 15:27:26 +0100 Subject: [PATCH 07/22] Delete KF4ParamsComb.h.bak --- .../interface/KF4ParamsComb.h.bak | 42 ------------------- 1 file changed, 42 deletions(-) delete mode 100644 L1Trigger/TrackFindingTMTT/interface/KF4ParamsComb.h.bak diff --git a/L1Trigger/TrackFindingTMTT/interface/KF4ParamsComb.h.bak b/L1Trigger/TrackFindingTMTT/interface/KF4ParamsComb.h.bak deleted file mode 100644 index a207234789d85..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/KF4ParamsComb.h.bak +++ /dev/null @@ -1,42 +0,0 @@ -///=== This is the Kalman Combinatorial Filter for 4 helix parameters track fit algorithm. - -#ifndef __KF4PARAMSCOMB__ -#define __KF4PARAMSCOMB__ - -#include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" -#include -#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" - -namespace TMTT { - -class KF4ParamsComb : public L1KalmanComb{ - - public: - enum PAR_IDS { INV2R, PHI0, T, Z0 }; - enum MEAS_IDS { PHI, Z }; - public: - KF4ParamsComb(const Settings* settings, const uint nPar, const string &fitterName ); - virtual ~KF4ParamsComb(){} - - protected: - virtual std::map getTrackParams(const KalmanState *state )const; - virtual std::vector seedx(const L1track3D& l1track3D)const; - virtual TMatrixD seedP(const L1track3D& l1track3D)const; - virtual std::vector d(const StubCluster* stubCluster )const; - virtual TMatrixD H(const StubCluster* stubCluster)const; - virtual TMatrixD dH(const StubCluster* stubCluster)const; - virtual TMatrixD F(const StubCluster* stubCluster=0, const KalmanState *state = 0)const; - virtual TMatrixD PxxModel( const KalmanState *state, const StubCluster *stubCluster )const; - virtual TMatrixD PddMeas(const StubCluster* stubCluster, const KalmanState *state )const; - virtual bool isGoodState( const KalmanState &state )const; - - private: - std::vector mapToVec(std::map x)const; - std::map vecToMap(std::vector x)const; -}; - -} - -#endif - - From c06e68e319b37a952a72a1a048ed6d9fdc6b1d2b Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Thu, 2 Apr 2020 15:27:42 +0100 Subject: [PATCH 08/22] Delete KF4ParamsCombIV.bak --- .../interface/KF4ParamsCombIV.bak | 50 ------------------- 1 file changed, 50 deletions(-) delete mode 100644 L1Trigger/TrackFindingTMTT/interface/KF4ParamsCombIV.bak diff --git a/L1Trigger/TrackFindingTMTT/interface/KF4ParamsCombIV.bak b/L1Trigger/TrackFindingTMTT/interface/KF4ParamsCombIV.bak deleted file mode 100644 index 08a2d71785bdc..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/KF4ParamsCombIV.bak +++ /dev/null @@ -1,50 +0,0 @@ -///=== This is the Kalman Combinatorial Filter for 4 helix parameters track fit algorithm. - -///=== Written by: Sioni Summers - -#ifndef __KF4PARAMSCOMBIV__ -#define __KF4PARAMSCOMBIV__ - -#include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" -//#include "L1Trigger/TrackFindingTMTT/interface/Matrix.h" -#include -#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" -#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" - -class KF4ParamsCombIV : public L1KalmanComb{ - - public: - enum BARREL_PAR_IDS { BP_RHOPHI, BP_Z, BP_INV2R, BP_T }; - enum ENDCAP_PAR_IDS { EP_RHOPHI, EP_RHO, EP_INV2RT, EP_INVT }; - enum BARREL_MEAS_IDS { BM_RHOPHI, BM_Z }; - enum ENDCAP_MEAS_IDS { EM_RHOPHI, EM_RHO }; - public: - KF4ParamsCombIV(const Settings* settings, const string &fitterName ); - virtual ~KF4ParamsCombIV(){} - std::string getParams(); - - protected: - virtual std::map getTrackParams(const KalmanState *state )const; - virtual std::vector seedx(const L1track3D& l1track3D)const; - virtual TMatrixD seedP(const L1track3D& l1track3D)const; - virtual std::vector d(const StubCluster* stubCluster )const; - virtual TMatrixD H(const StubCluster* stubCluster)const; - virtual TMatrixD F(const StubCluster* stubCluster, const KalmanState *state )const; - virtual TMatrixD PxxModel( const KalmanState *state, const StubCluster *stubCluster, unsigned stub_itr )const; - virtual TMatrixD PddMeas(const StubCluster* stubCluster, const KalmanState *state )const; - virtual void barrelToEndcap( double r, const StubCluster* stubCluster, std::vector &state, TMatrixD &cov_x )const; - virtual bool stubBelongs(const StubCluster* stubCluster, KalmanState& state, unsigned itr )const; - virtual double validationGateCutValue( const StubCluster *stubCluster, unsigned path )const; - virtual bool isGoodState( const KalmanState &state )const; - virtual std::vector residual(const StubCluster* stubCluster, const std::vector &x )const; - - private: - double getZ( const KalmanState *state )const; - double getZ0( const KalmanState *state )const; - double getZ0Variance( const KalmanState *state )const; - double getZVariance( const KalmanState *state )const; - void barrelToEndcap( double r, const StubCluster *stubCluster, std::vector &state )const; -}; -#endif - - From 543fc9f9cceba49d174a8006849fb95c49b1c10e Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Thu, 2 Apr 2020 15:27:54 +0100 Subject: [PATCH 09/22] Delete KF4ParamsCombV2.bak --- .../interface/KF4ParamsCombV2.bak | 33 ------------------- 1 file changed, 33 deletions(-) delete mode 100644 L1Trigger/TrackFindingTMTT/interface/KF4ParamsCombV2.bak diff --git a/L1Trigger/TrackFindingTMTT/interface/KF4ParamsCombV2.bak b/L1Trigger/TrackFindingTMTT/interface/KF4ParamsCombV2.bak deleted file mode 100644 index 569ff757dfc9b..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/KF4ParamsCombV2.bak +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef __KF4ParamsCombV2_H__ -#define __KF4ParamsCombV2_H__ - -#include "L1Trigger/TrackFindingTMTT/interface/KF4ParamsComb.h" -#include - -class KF4ParamsCombV2 : public KF4ParamsComb{ - - public: - enum PAR_IDS { V2_BETA, V2_Z0P, V2_R0P, V2_RHO0 }; - enum MEAS_IDS { Z, R }; - public: - KF4ParamsCombV2(const Settings* settings, const string &fitterName ); - ~KF4ParamsCombV2(){} - std::string getParams(); - - protected: - std::map getTrackParams( const KalmanState *state )const; - std::vector seedx(const L1track3D& l1track3D)const; - TMatrixD seedP(const L1track3D& l1track3D)const; - std::vector d(const StubCluster* stubCluster )const; - TMatrixD H(const StubCluster* stubCluster)const; - TMatrixD PxxModel( const KalmanState* state, const StubCluster* stubCluster, unsigned stub_itr )const; - TMatrixD PddMeas(const StubCluster* stubCluster, const KalmanState *state )const; - std::map convertParams(std::vector x)const; - bool isGoodState( const KalmanState &state )const; - - std::vector residual(const StubCluster* stubCluster, std::vector &x )const; - -}; - -#endif - From d3af54da7b03f69def7f38c3d99922e94e8f3935 Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Thu, 2 Apr 2020 15:28:04 +0100 Subject: [PATCH 10/22] Delete KF5ParamsComb.h.bak --- .../interface/KF5ParamsComb.h.bak | 43 ------------------- 1 file changed, 43 deletions(-) delete mode 100644 L1Trigger/TrackFindingTMTT/interface/KF5ParamsComb.h.bak diff --git a/L1Trigger/TrackFindingTMTT/interface/KF5ParamsComb.h.bak b/L1Trigger/TrackFindingTMTT/interface/KF5ParamsComb.h.bak deleted file mode 100644 index 8a3098b2df356..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/KF5ParamsComb.h.bak +++ /dev/null @@ -1,43 +0,0 @@ -///=== This is the Kalman Combinatorial Filter for 4 helix parameters track fit algorithm. - -#ifndef __KF5PARAMSCOMB__ -#define __KF5PARAMSCOMB__ - -#include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" -#include -#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" - -namespace TMTT { - -class KF5ParamsComb : public L1KalmanComb{ - - public: - enum PAR_IDS { INV2R, PHI0, T, Z0, D0 }; - enum MEAS_IDS { PHI, Z }; - public: - KF5ParamsComb(const Settings* settings, const uint nPar, const string &fitterName ); - virtual ~KF5ParamsComb(){} - - protected: - virtual std::map getTrackParams(const KalmanState *state )const; - virtual std::map getTrackParams_BeamConstr(const KalmanState *state, double& deltaChi2) const; - virtual std::vector seedx(const L1track3D& l1track3D)const; - virtual TMatrixD seedP(const L1track3D& l1track3D)const; - virtual std::vector d(const StubCluster* stubCluster )const; - virtual TMatrixD H(const StubCluster* stubCluster)const; - virtual TMatrixD dH(const StubCluster* stubCluster)const; - virtual TMatrixD F(const StubCluster* stubCluster=0, const KalmanState *state = 0)const; - virtual TMatrixD PxxModel( const KalmanState *state, const StubCluster *stubCluster )const; - virtual TMatrixD PddMeas(const StubCluster* stubCluster, const KalmanState *state )const; - virtual bool isGoodState( const KalmanState &state )const; - - private: - std::vector mapToVec(std::map x)const; - std::map vecToMap(std::vector x)const; -}; - -} - -#endif - - From 691e89b67c0561c2f443fa3ab25df836ca188bfd Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Thu, 2 Apr 2020 15:28:27 +0100 Subject: [PATCH 11/22] Delete KF4ParamsComb.cc.bak --- .../TrackFindingTMTT/src/KF4ParamsComb.cc.bak | 394 ------------------ 1 file changed, 394 deletions(-) delete mode 100644 L1Trigger/TrackFindingTMTT/src/KF4ParamsComb.cc.bak diff --git a/L1Trigger/TrackFindingTMTT/src/KF4ParamsComb.cc.bak b/L1Trigger/TrackFindingTMTT/src/KF4ParamsComb.cc.bak deleted file mode 100644 index 26ebf1652da9a..0000000000000 --- a/L1Trigger/TrackFindingTMTT/src/KF4ParamsComb.cc.bak +++ /dev/null @@ -1,394 +0,0 @@ -///=== This is the Kalman Combinatorial Filter for 4 helix parameters track fit algorithm. - - -#include "L1Trigger/TrackFindingTMTT/interface/KF4ParamsComb.h" -#include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" -#include "L1Trigger/TrackFindingTMTT/interface/StubCluster.h" -#define CKF_DEBUG - -namespace TMTT { - -/* -// Scattering constants - HISTORIC NOT USED. - -static unsigned nlayer_eta[25] = -{ 6, 6, 6, 6, -6, 6, 6, 6, 6, 6, 6, 7, 7, 7, -7, 7, 7, 7, 6, 6, 6, 6, 6, 6}; - -static double matx_outer[25] = { -0.16, 0.17, 0.18, 0.19, 0.20, -0.21, 0.26, 0.22, 0.26, 0.38, -0.41, 0.40, 0.44, 0.50, 0.54, -0.60, 0.44, 0.48, 0.60, 0.68, -0.50, 0.48, 0.64, 0.39, 0.20 -}; - -static double matx_inner[25] = { -0.14, 0.1, 0.1, 0.1, 0.1, -0.1, 0.1, 0.1, 0.1, 0.1, -0.12, 0.1, 0.1, 0.1, 0.15, -0.20, 0.25, 0.25, 0.3, 0.3, -0.35, 0.40, 0.40, 0.6, 0.6 -}; -*/ - -static double wrapRadian( double t ){ - - if( t > 0 ){ - while( t > M_PI ) t-= 2*M_PI; - } - else{ - while( t < - M_PI ) t+= 2*M_PI; - } - return t; -} - - - -KF4ParamsComb::KF4ParamsComb(const Settings* settings, const uint nPar, const string &fitterName ) : L1KalmanComb(settings, nPar, fitterName ){ - - hdxmin[INV2R] = -1.1e-4; - hdxmax[INV2R] = +1.1e-4; - hdxmin[PHI0] = -6.e-3; - hdxmax[PHI0] = +6.e-3; - hdxmin[Z0] = -4.1; - hdxmax[Z0] = +4.1; - hdxmin[T] = -6.; - hdxmax[T] = +6.; - - hxmin[INV2R] = -0.3 * 0.0057; - hxmax[INV2R] = +0.3 * 0.0057; - hxmin[PHI0] = -0.3; - hxmax[PHI0] = +0.3; - hxmin[Z0] = -120; - hxmax[Z0] = +120; - hxmin[T] = -6.; - hxmax[T] = +6.; - - hddMeasmin[PHI0] = -1.e1; - hddMeasmax[PHI0] = +1.e1; - - hresmin[PHI0] = -0.5; - hresmax[PHI0] = +0.5; - - hresmin[PHI0] = -10.; - hresmax[PHI0] = +10.; - - - hxaxtmin[INV2R] = -1.e-3; - hxaxtmax[INV2R] = +1.e-3; - hxaxtmin[PHI0] = -1.e-1; - hxaxtmax[PHI0] = +1.e-1; - hxaxtmin[Z0] = -10.; - hxaxtmax[Z0] = +10.; - hxaxtmin[T] = -1.e-0; - hxaxtmax[T] = +1.e-0; -} - - -std::map KF4ParamsComb::getTrackParams(const KalmanState *state )const{ - - std::vector x = state->xa(); - std::map y; - y["qOverPt"] = x.at(INV2R) / getSettings()->invPtToInvR() * 2.; - y["phi0"] = wrapRadian( x.at(PHI0) + sectorPhi() ); - y["z0"] = x.at(Z0); - y["t"] = x.at(T); - y["d0"] = 0; - return y; -} - -/* The Kalman measurement matrix = derivative of helix intercept w.r.t. helix params - * Here I always measure phi(r), and z(r) */ -TMatrixD KF4ParamsComb::H(const StubCluster* stubCluster)const{ - TMatrixD h(2, nPar_); - double r = stubCluster->r(); - h(PHI,INV2R) = -r; - h(PHI,PHI0) = 1; - h(Z,Z0) = 1; - h(Z,T) = r; - return h; -} - -// Not used? - -TMatrixD KF4ParamsComb::dH(const StubCluster* stubCluster)const{ - - double dr(0); - if(stubCluster->layerId() > 10){ - dr = stubCluster->sigmaZ(); - } - - TMatrixD h(2, nPar_); - h(PHI,INV2R) = -dr; - h(Z,T) = dr; - - return h; -} - -/* Seed the state vector */ -std::vector KF4ParamsComb::seedx(const L1track3D& l1track3D)const{ - - std::vector x(nPar_); - x[INV2R] = getSettings()->invPtToInvR() * l1track3D.qOverPt()/2; - x[PHI0] = wrapRadian( l1track3D.phi0() - sectorPhi() ); - x[Z0] = l1track3D.z0(); - x[T] = l1track3D.tanLambda(); - - return x; -} - -/* Seed the covariance matrix */ -TMatrixD KF4ParamsComb::seedP(const L1track3D& l1track3D)const{ - TMatrixD p(nPar_,nPar_); - - double c = getSettings()->invPtToInvR() / 2; - - if ( getSettings()->numEtaRegions() == 18 ) { - - // optimised for 18x2 sectors with additional error factor in pt/phi to avoid pulling towards wrong HT params - p(INV2R,INV2R) = 0.0157 * 0.0157 * c * c * 4; - p(PHI0,PHI0) = 0.0051 * 0.0051 * 4; - p(Z0,Z0) = 5.0 * 5.0; - p(T,T) = 0.25 * 0.25 * 4; // IRT: increased by factor 4, as was affecting fit chi2. - - } else { - - // choose large errors - p(INV2R,INV2R) = 0.0157 * 0.0157 * c * c * 10; - p(PHI0,PHI0) = 0.0051 * 0.0051 * 10; - p(Z0,Z0) = 5.0 * 5.0; - p(T,T) = 0.25 * 0.25 * 10; - - } - - return p; -} - -/* The forecast matrix - * (here equals identity matrix) */ -TMatrixD KF4ParamsComb::F(const StubCluster* stubCluster, const KalmanState *state )const{ - TMatrixD F(nPar_,nPar_); - for(unsigned int n = 0; n < nPar_; n++) - F(n, n) = 1; - return F; -} - -/* the vector of measurements */ -std::vector KF4ParamsComb::d(const StubCluster* stubCluster )const{ - std::vector meas; - meas.resize(2); - meas[PHI] = wrapRadian( stubCluster->phi() - sectorPhi() ); - meas[Z] = stubCluster->z(); - return meas; -} - -// Assumed hit resolution in (phi,z) -TMatrixD KF4ParamsComb::PddMeas(const StubCluster* stubCluster, const KalmanState *state )const{ - - double inv2R = (getSettings()->invPtToInvR()) * 0.5 * state->candidate().qOverPt(); // alternatively use state->xa().at(INV2R) - double inv2R2 = inv2R * inv2R; - - double tanl = state->xa().at(T); // factor of 0.9 improves rejection - double tanl2 = tanl * tanl; - - TMatrixD p(2,2); - - double vphi(0); - double vz(0); - double vcorr(0); - - // consider error due to integerisation only for z (r in encap) coord when enabled - double err_digi2(0); - if (getSettings()->enableDigitize()) err_digi2 = 0.15625 * 0.15625 / 12.0; - - double a = stubCluster->sigmaX() * stubCluster->sigmaX(); - double b = stubCluster->sigmaZ() * stubCluster->sigmaZ() + err_digi2; - double r2 = stubCluster->r() * stubCluster->r(); - double invr2 = 1./r2; - - // Scattering term scaling as 1/Pt. - double sigmaScat = getSettings()->kalmanMultiScattTerm()/(state->candidate().pt()); - double sigmaScat2 = sigmaScat * sigmaScat; - - if ( stubCluster->barrel() ) { - - vphi = (a * invr2) + sigmaScat2; - - if (stubCluster->tiltedBarrel()) { - // Convert uncertainty in (r,phi) to (z,phi). - float scaleTilted = 1.; - if (getSettings()->kalmanHOtilted()) { - if ( getSettings()->useApproxB() ) { // Simple firmware approximation - scaleTilted = getApproxB(stubCluster->z(), stubCluster->r()); - } else { // Exact C++ implementation. - float tilt = stubCluster->moduleTilt(); - scaleTilted = sin(tilt) + cos(tilt)*tanl; - } - } - float scaleTilted2 = scaleTilted*scaleTilted; - // This neglects the non-radial strip effect, assumed negligeable for PS. - vz = b * scaleTilted2; - } else { - vz = b; - } - - if (getSettings()->kalmanHOdodgy()) { - // Use original (Dec. 2016) dodgy implementation was this. - vz = b; - } - - } else { - - vphi = a * invr2 + sigmaScat2; - vz = (b * tanl2); - - if (not stubCluster->psModule()) { // Neglect these terms in PS - double beta = 0.; - // Add correlation term related to conversion of stub residuals from (r,phi) to (z,phi). - if (getSettings()->kalmanHOprojZcorr() == 2) beta += -inv2R; - // Add alpha correction for non-radial 2S endcap strips.. - if (getSettings()->kalmanHOalpha() == 2) beta += -stubCluster->alpha(); // alpha is 0 except in endcap 2S disks - - double beta2 = beta * beta; - vphi += b * beta2; - vcorr = b * (beta * tanl); - - // IRT - for checking efficiency of removing phi-z correlation from projection. - // "ultimate_off1" - //vphi = a * invr2 + b * pow(-stubCluster->alpha(), 2) + b * inv2R2 + sigmaScat2; - //vcorr = b * ((-stubCluster->alpha()) * tanl); - - // IRT - This higher order correction doesn't significantly improve the track fit performance, so commented out. - //if (getSettings()->kalmanHOhelixExp()) { - // float dsByDr = 1. + (1./2.)*r2*inv2R2; // Allows for z = z0 + s*tanL, where s is not exactly r due to circle. - // vcorr *= dsByDr; - // vz *= dsByDr * dsByDr; - //} - - if (getSettings()->kalmanHOdodgy()) { - // Use original (Dec. 2016) dodgy implementation was this. - vphi = (a * invr2) + (b * inv2R2) + sigmaScat2; - vcorr = 0.; - vz = (b * tanl2); - } - } - } - - p(PHI, PHI) = vphi; - p(Z, Z) = vz; - p(PHI, Z) = vcorr; - p(Z, PHI) = vcorr; - - return p; - -} - -// State uncertainty due to scattering -- HISTORIC NOT USED -TMatrixD KF4ParamsComb::PxxModel( const KalmanState *state, const StubCluster *stubCluster )const -{ - - TMatrixD p(nPar_,nPar_); - - /* - if( getSettings()->kalmanMultiScattFactor() ){ - - unsigned i_eta = abs( stubCluster->eta() / 0.1 ); - if( i_eta > 24 ) i_eta = 24; - double dl = matx_outer[i_eta] / nlayer_eta[i_eta]; - - unsigned stub_itr = state->nextLayer(); - - const KalmanState * last_update_state = state->last_update_state(); - unsigned last_itr(1); - if( last_update_state ) last_itr = last_update_state->nextLayer(); - dl = ( stub_itr - last_itr ) * dl; - - if( dl ){ - std::map y = getTrackParams( state ); - double dtheta0 = 1./sqrt(3) * 0.0136 * fabs(y["qOverPt"]) * sqrt(dl)*( 1+0.038*log(dl) ); - dtheta0 *= getSettings()->kalmanMultiScattFactor(); - p(PHI0, PHI0) = dtheta0 * dtheta0; // Despite the name, I think this is uncertainty in phi0. I guess uncertainty in theta0 neglected compared to detector resolution. - } - } - */ - - return p; -} - -bool KF4ParamsComb::isGoodState( const KalmanState &state )const -{ - - unsigned nStubLayers = state.nStubLayers(); - bool goodState( true ); - - // todo : make configurable - - // N.B. Code below changed by Alexander Morton to allow tracking down to Pt = 2 GeV. - - double pt=fabs( getSettings()->invPtToInvR() / (2*state.xa()[INV2R]) ); - double z0=fabs( state.xa()[Z0] ); - - // state parameter selections - if( nStubLayers >= 2 ){ - - if( z0 > 15. ) goodState = false; - - const double tolerance = (nStubLayers >= 4) ? 0.05 : 0.1; - if( pt < getSettings()->houghMinPt() - tolerance) goodState = false; - } - - // chi2 selections - if (getSettings()->kalmanMultiScattTerm() < 0.0001) { // scattering ignored - if( nStubLayers == 2 ) { - if (state.chi2() > 15.0) goodState=false; // No separate pT selection needed - } else if ( nStubLayers == 3 ) { - if (state.chi2() > 100.0 && pt > 2.7) goodState=false; - if (state.chi2() > 120.0 && pt <= 2.7) goodState=false; - } else if ( nStubLayers == 4 ) { - if (state.chi2() > 320.0 && pt > 2.7) goodState=false; - if (state.chi2() > 1420.0 && pt <= 2.7) goodState=false; - } else if ( nStubLayers == 5 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! - if (state.chi2() > 480.0 && pt > 2.7) goodState=false; - if (state.chi2() > 2130.0 && pt <= 2.7) goodState=false; - } else if ( nStubLayers >= 6 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! - if (state.chi2() > 640.0 && pt > 2.7) goodState=false; - if (state.chi2() > 2840.0 && pt <= 2.7) goodState=false; - } - - } else { // scattering taken into account. - - if( nStubLayers == 2 ) { - if (state.chi2() > 10.0) goodState=false; // No separate pT selection needed - } else if ( nStubLayers == 3 ) { - if (state.chi2() > 30.0) goodState=false; - } else if ( nStubLayers == 4 ) { - if (state.chi2() > 80.0) goodState=false; - } else if ( nStubLayers == 5 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! - if (state.chi2() > 120.0) goodState=false; - } else if ( nStubLayers >= 6 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! - if (state.chi2() > 160.0) goodState=false; - } - } - - // IRT - //if( nStubLayers >= 4 ) { - //std::map trackParams = getTrackParams(&state); - //L1fittedTrack fitTrkTmp(getSettings(), state.candidate(), state.stubs(), trackParams["qOverPt"], trackParams["d0"], trackParams["phi0"], trackParams["z0"], trackParams["t"], state.chi2(), nPar_, true); - //if (abs(int(fitTrkTmp.getCellLocationFit().first) - int(fitTrkTmp.getCellLocationHT().first)) > 1 || abs(int(fitTrkTmp.getCellLocationFit().second) - int(fitTrkTmp.getCellLocationHT().second)) > 1) goodState = false; - //cout<<"Consistent "< 0 ){ - while( t > M_PI ) t-= 2*M_PI; - } - else{ - while( t < - M_PI ) t+= 2*M_PI; - } - return t; -} - -KF4ParamsCombIV::KF4ParamsCombIV(const Settings* settings, const string &fitterName ) : L1KalmanComb(settings, 4, fitterName ){ - - hdxmin[0] = -0.0060; - hdxmax[0] = +0.0060; - hdxmin[1] = -4.1; - hdxmax[1] = +4.1; - hdxmin[2] = -1.1e-4; - hdxmax[2] = +1.1e-4; - hdxmin[3] = -1.; - hdxmax[3] = +1.; - - hxmin[0] = -50; - hxmax[0] = +50; - hxmin[1] = -120; - hxmax[1] = +120; - hxmin[2] = -0.3 * 0.0057; - hxmax[2] = +0.3 * 0.0057; - hxmin[3] = -6.; - hxmax[3] = +6.; - - hddMeasmin[1] = -1.e1; - hddMeasmax[1] = +1.e1; - - hresmin[0] = -0.5; - hresmax[0] = +0.5; - hresmin[1] = -10.; - hresmax[1] = +10.; - - - hxaxtmin[0] = -1.e-3; - hxaxtmax[0] = +1.e-3; - hxaxtmin[1] = -1.e-1; - hxaxtmax[1] = +1.e-1; - hxaxtmin[2] = -10.; - hxaxtmax[2] = +10.; - hxaxtmin[3] = -6.e-0; - hxaxtmax[3] = +6.e-0; -} - -std::map KF4ParamsCombIV::getTrackParams(const KalmanState *state )const{ - - std::map y; - if( state->barrel() ){ - y["phi0"] = wrapRadian( state->xa().at(BP_RHOPHI) / state->r() + state->r() * state->xa().at(BP_INV2R) + sectorPhi() ); - y["z0"] = state->xa().at(BP_Z) - state->r() * state->xa().at(BP_T); - y["qOverPt"] = state->xa().at(BP_INV2R) / getSettings()->invPtToInvR() * 2.; - y["t"] = state->xa().at(BP_T); - - } - else{ - double t = 1./state->xa().at(EP_INVT); - double inv2R = state->xa().at(EP_INV2RT) * t; - y["phi0"] = wrapRadian( state->xa().at(EP_RHOPHI) / state->xa().at(EP_RHO) + state->xa().at(EP_RHO) * inv2R + sectorPhi() ); - y["z0"] = state->z() - state->xa().at(EP_RHO) * t; - y["qOverPt"] = inv2R / getSettings()->invPtToInvR() * 2.; - y["t"] = t; - } - y["d0"] = 0; - return y; -} -/* The Kalman measurement matrix - * Here I always measure phi(r), and z(r) */ -TMatrixD KF4ParamsCombIV::H(const StubCluster* stubCluster)const{ - TMatrixD h(2, 4); - if( stubCluster->barrel() ){ - h(BM_RHOPHI,BP_RHOPHI) = 1; - h(BM_Z,BP_Z) = 1; - } - else{ - h(EM_RHOPHI,BP_RHOPHI) = 1; - h(EM_RHO,EP_RHO) = 1; - } - return h; -} - -/* Seed the state vector */ -std::vector KF4ParamsCombIV::seedx(const L1track3D& l1track3D)const{ - - std::vector x(nPar_); - x[BP_RHOPHI] = 0.1 * wrapRadian( l1track3D.phi0() - sectorPhi() ); - x[BP_Z] = l1track3D.z0(); - x[BP_INV2R] = getSettings()->invPtToInvR() * l1track3D.qOverPt()/2; - x[BP_T] = 0.; - if (settings_->useZTrkFilter() || settings_->useSeedFilter()) { - x[BP_T] = l1track3D.tanLambda(); - } - else{ - - if( getSettings()->numEtaRegions() == 9 ) { - switch ( iCurrentEtaReg_ ){ - case 0 : - x[BP_T] = -4.4; - break; - case 1 : - x[BP_T] = -2.8; - break; - case 2 : - x[BP_T] = -1.6; - break; - case 3 : - x[BP_T] = -0.7; - break; - case 4 : - x[BP_T] = 0.0; - break; - case 8 : - x[BP_T] = +4.4; - break; - case 7 : - x[BP_T] = +2.8; - break; - case 6 : - x[BP_T] = +1.6; - break; - case 5 : - x[BP_T] = +0.7; - break; - } - } - else{ - x[BP_T] = 0.0; - if( iCurrentEtaReg_ > getSettings()->numEtaRegions() / 2 ) x[BP_T] = 2.8; - else if( iCurrentEtaReg_ < getSettings()->numEtaRegions() / 2 - 1 ) x[BP_T] = -2.8; - } - } - return x; -} - -/* Seed the covariance matrix - * Note: 1024 is an arbitrary 'large' value */ -TMatrixD KF4ParamsCombIV::seedP(const L1track3D& l1track3D)const{ - TMatrixD p(4,4); - double c = getSettings()->invPtToInvR() / 2; - //0.0057 - // - p(BP_RHOPHI,BP_RHOPHI) = 0.1 * 0.006* 0.1 * 0.006; - p(BP_Z,BP_Z) = 4.0*4.0; - p(BP_INV2R,BP_INV2R) = 0.020*0.020 * c * c; - //0.020*c = 0.0001 - - if( getSettings()->numEtaRegions() == 9 ) { - switch ( iCurrentEtaReg_ ){ - case 0 : - case 8 : - p(BP_T,BP_T) = 0.5*0.5; - break; - case 1 : - case 7 : - p(BP_T,BP_T) = 0.4*0.4; - break; - case 2 : - case 6 : - p(BP_T,BP_T) = 0.37*0.37; - break; - case 3 : - case 5 : - p(BP_T,BP_T) = 0.27*0.27; - break; - case 4 : - p(BP_T,BP_T) = 0.27*0.27; - break; - } - } - else{ - p(BP_T,BP_T) = 0.5*0.5; - } - - return p; -} -double KF4ParamsCombIV::getZ( const KalmanState *state )const{ - - double z(0); - if( state->barrel() ){ - z = state->xa().at(BP_Z); - } - else{ - z = state->z(); - } - return z; -} - -double KF4ParamsCombIV::getZ0( const KalmanState *state )const{ - - double z0(0); - if( state->barrel() ){ - if( state->nStubLayers() == 0 ) z0 = state->xa().at(BP_Z); - else - z0 = state->xa().at(BP_Z) - state->r() * state->xa().at(BP_T); - } - else{ - z0 = state->z() - state->xa().at(EP_RHO) / state->xa().at(EP_INVT); - } - return z0; -} -double KF4ParamsCombIV::getZVariance( const KalmanState *state )const{ - - double vz(0); - if( state->barrel() ){ - vz = state->pxxa()(BP_Z, BP_Z); - } - - return vz; -} - -double KF4ParamsCombIV::getZ0Variance( const KalmanState *state )const{ - - - double vz0(0); - if( state->barrel() ){ - if( state->nStubLayers() == 0 ) state->pxxa()(BP_Z, BP_Z); - else - vz0 = state->pxxa()(BP_Z, BP_Z) + state->r() * state->r() * state->pxxa()(BP_T, BP_T); - } - else{ - double r = state->xa().at(EP_RHO); - double vr = state->pxxa()(EP_RHO,EP_RHO); - double invt = state->xa().at(EP_INVT); - double vinvt = state->pxxa()(EP_INVT, EP_INVT); - vz0 = r/invt * r/invt * ( vr/(r*r) + vinvt/(invt*invt) ); - } - return vz0; -} -void KF4ParamsCombIV::barrelToEndcap( double r, const StubCluster *stubCluster, std::vector &x )const{ - - double rhophi = x[BP_RHOPHI]; - double Inv2R = x[BP_INV2R]; - double t = x[BP_T]; - - x[EP_RHOPHI] = rhophi; - x[EP_RHO] = r; - if( t ){ - x[EP_INV2RT] = Inv2R / t; - x[EP_INVT] = 1./t; - } - else{ - // if( iCurrentEtaReg_ > 4 ) t = 1.; - if( iCurrentEtaReg_ > getSettings()->numEtaRegions() / 2 ) t = 1.; - else t = -1.; - x[EP_INV2RT] = Inv2R * t; - x[EP_INVT] = 1. * t; - } -} - - -/* The forecast matrix */ -TMatrixD KF4ParamsCombIV::F(const StubCluster* stubCluster, const KalmanState *state )const{ - - TMatrixD F(4,4); - for(int n = 0; n < 4; n++) - F(n, n) = 1; - - if( stubCluster->barrel() ){ - double deltar = stubCluster->r() - state->r(); - F(BP_RHOPHI,BP_RHOPHI) = stubCluster->r()/state->r(); - F(BP_RHOPHI,BP_INV2R) = - deltar * stubCluster->r(); - F(BP_Z,BP_T) = deltar; - } - else{ - double statez = getZ(state); - double deltaz = stubCluster->z() - statez; - double z0 = getZ0( state ); - - // F(EP_RHOPHI,EP_RHOPHI) = 1 + z0 * ( 1./statez - 1./stub->z() ); - if( state->barrel() ){ - double t = state->xa().at(BP_T); - if( state->nStubLayers() == 0 ){ - double deltar = stubCluster->r() - state->r(); - F(EP_RHOPHI,EP_RHOPHI) = stubCluster->r() / state->r(); - F(EP_RHOPHI,EP_INV2RT) = - stubCluster->r()*stubCluster->z(); - F(EP_RHO,EP_INVT) = stubCluster->z(); - } - else{ - // F(EP_RHOPHI,EP_RHOPHI) = 1 + z0 * ( 1./statez - 1./stub->z() ); - F(EP_RHOPHI,EP_RHOPHI) = stubCluster->r() / state->r(); - F(EP_RHOPHI,EP_INV2RT) = - deltaz * stubCluster->r(); - F(EP_RHO,EP_INVT) = deltaz; - } - } - else{ - //F(EP_RHOPHI,EP_RHOPHI) = 1 + z0 * ( 1./statez - 1./stub->z() ); - F(EP_RHOPHI,EP_RHOPHI) = stubCluster->r()/ state->r(); - F(EP_RHOPHI,EP_INV2RT) = - deltaz * stubCluster->r(); - F(EP_RHO,EP_INVT) = deltaz; - } - } - - return F; -} - -/* the vector of measurements */ -std::vector KF4ParamsCombIV::d(const StubCluster* stubCluster )const{ - std::vector meas; - meas.resize(2); - if( stubCluster->barrel() ){ - meas[0] = stubCluster->r() * wrapRadian( stubCluster->phi() - sectorPhi() ); - meas[1] = stubCluster->z(); - } - else{ - meas[0] = stubCluster->r() * wrapRadian( stubCluster->phi() - sectorPhi() ); - meas[1] = stubCluster->r(); - } - return meas; -} - -TMatrixD KF4ParamsCombIV::PddMeas(const StubCluster* stubCluster, const KalmanState *state )const{ - - - double rdphi = stubCluster->r() * stubCluster->dphi(); - TMatrixD p(2,2); - p(0,0) = rdphi * rdphi; - p(1,1) = stubCluster->sigmaZ() * stubCluster->sigmaZ(); - - return p; -} - -/* State uncertainty */ -TMatrixD KF4ParamsCombIV::PxxModel( const KalmanState *state, const StubCluster *stubCluster, unsigned stub_itr )const -{ - - TMatrixD p(4,4); - - if( getSettings()->kalmanMultiScattFactor() ){ - unsigned i_eta = abs( stubCluster->eta() / 0.1 ); - if( i_eta > 24 ) i_eta = 24; - double dl = matx_outer[i_eta] / nlayer_eta[i_eta]; - - const KalmanState * last_update_state = state->last_update_state(); - unsigned last_itr(1); - if( last_update_state ) last_itr = last_update_state->nIterations(); - dl = ( stub_itr - last_itr ) * dl; - - if( dl ){ - std::map y = getTrackParams( state ); - double dtheta0 = 1./sqrt(3) * 0.0136 * fabs(y["qOverPt"]) * sqrt(dl)*( 1+0.038*log(dl) ); - dtheta0 *= getSettings()->kalmanMultiScattFactor(); - double drphi = stubCluster->r() * dtheta0; - p(0,0) = drphi * drphi; - } - } - - if( stubCluster->barrel() || state->nStubLayers() == 0 ) return p; - // if( stubCluster->barrel() ) return p; - - //error from z_{k-1} - if( state->barrel() ){ - - double vz = state->pxxa()( BP_Z, BP_Z ); - - std::vector x = state->xa(); - barrelToEndcap(state->r(), stubCluster, x); - - double dfx = stubCluster->r() * x.at(EP_INV2RT); - p(EP_RHOPHI, EP_RHOPHI) += vz * dfx * dfx; - - dfx = -1. * x.at(EP_INVT); - p(EP_RHO, EP_RHO) += vz * dfx * dfx; - - } - return p; -} - -void KF4ParamsCombIV::barrelToEndcap( double r, const StubCluster *stubCluster, std::vector &x, TMatrixD &cov_x )const -{ - - double Inv2R = x[BP_INV2R]; - double t = x[BP_T]; - - barrelToEndcap( r, stubCluster, x ); - - // if( r != 0.1 ){ - TMatrixD G(4,4); - /* - * new_cov_x = y - * y(0,0) = cov_x(0,0)^2 + cov_x(0,2)^2 - * y(0,2) = G(2,2) * ( cov_x(0,0) + cov_x(2,2) ) * cov_x(0,2) - * y(2,0) = y(0,2) - * y(2,2) = G(2,2)^2 * ( cov_x(0,2)^2 + cov_x(2,2)^2 ) + G(2,3) * ( cov_x(1,3)^2 + cov_x(3,3)^2 ) - * y(2,3) = G(2,3) * G(3,3) * ( cov_x(1,3)^2 + cov_x(3,3)^2 ) - * y(3,2) = y(2,3) - * y(3,3) = G(3,3)^2 * ( cov_x(1,3)^2 + cov_x(3,3)^2 ) - */ - - G(EP_RHOPHI,BP_RHOPHI) = 1.; - G(EP_RHOPHI,BP_Z) = 0.; - G(EP_RHOPHI,BP_INV2R) = 0.; - G(EP_RHOPHI,BP_T) = 0.; - - G(EP_RHO,BP_RHOPHI) = 0; - G(EP_RHO,BP_Z) = 0; - G(EP_RHO,BP_INV2R) = 0; - G(EP_RHO,BP_T) = 0; - - G(EP_INV2RT,BP_RHOPHI) = 0.; - G(EP_INV2RT,BP_Z) = 0.; - if( t ){ - G(EP_INV2RT,BP_INV2R) = 1./t; - G(EP_INV2RT,BP_T) = Inv2R * -1./(t*t); - } - else{ - G(EP_INV2RT,BP_INV2R) = 1.; - G(EP_INV2RT,BP_T) = Inv2R * -1.; - } - - G(EP_INVT,BP_RHOPHI) = 0; - G(EP_INVT,BP_Z) = 0; - G(EP_INVT,BP_INV2R) = 0; - if( t ){ - G(EP_INVT,BP_T) = -1./(t*t); - } - else{ - G(EP_INVT,BP_T) = -1.; - } - - TMatrixD org(cov_x); - TMatrixD GT(TMatrixD::kTransposed, G ); - - cov_x = G * org * GT; - // } -} - - -std::string KF4ParamsCombIV::getParams(){ - return "KF4ParamsCombIV"; -} - -/* Determine with a stub belongs/does not belong to a candidate - * Decision based on hit and state uncertainty */ -bool KF4ParamsCombIV::stubBelongs(const StubCluster* stubCluster, KalmanState& state, unsigned itr )const{ - - return true; - -} -double KF4ParamsCombIV::validationGateCutValue( const StubCluster *stubCluster, unsigned path )const -{ - double max_rchi2(100); - if( path > 10 ) return max_rchi2; - - if( stubCluster->barrel() ){ - switch ( stubCluster->layerId() ){ - case 3: - max_rchi2 = 50; - case 4: - max_rchi2 = 30; - case 5: - max_rchi2 = 40; - case 6: - max_rchi2 = 40; - } - } - else{ - switch ( stubCluster->endcapRing() ){ - case 2: - max_rchi2 = 50; - case 3: - max_rchi2 = 80; - case 4: - max_rchi2 = 100; - case 5: - max_rchi2 = 80; - case 6: - max_rchi2 = 130; - case 7: - max_rchi2 = 80; - case 8: - max_rchi2 = 130; - case 9: - max_rchi2 = 130; - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - max_rchi2 = 50; - } - } - - return max_rchi2; -} - -bool KF4ParamsCombIV::isGoodState( const KalmanState &state )const -{ - unsigned nStubLayers = state.nStubLayers(); - bool goodState( true ); - - if( nStubLayers == 2 ){ - - double z0=fabs( getTrackParams( &state )["z0"] ); - if( z0 > 20. ) goodState = false; - } - - - if( nStubLayers >= 3 ){ - - double max_rchi2(100); - - if( state.path() < 11 ){ - - - if( state.barrel() ){ - - switch ( state.layerId() ){ - case 3: - max_rchi2 = 50; - case 4: - max_rchi2 = 80; - case 5: - max_rchi2 = 80; - case 6: - max_rchi2 = 50; - } - } - else{ - switch ( state.endcapRing() ){ - case 2: - max_rchi2 = 10; - case 3: - max_rchi2 = 30; - case 4: - max_rchi2 = 70; - case 5: - max_rchi2 = 40; - case 6: - max_rchi2 = 60; - case 7: - max_rchi2 = 50; - case 8: - max_rchi2 = 70; - case 9: - max_rchi2 = 50; - case 10: - max_rchi2 = 30; - case 11: - case 12: - case 13: - case 14: - case 15: - max_rchi2 = 20; - } - } - } - if( state.reducedChi2() > max_rchi2 ) goodState=false; - } - - return goodState; -} - -std::vector KF4ParamsCombIV::residual(const StubCluster* stubCluster, const std::vector &x )const{ - - std::vector vd = d(stubCluster); - std::vector hx = Hx( H(stubCluster), x ); - std::vector delta(2); - // cout << "hx " << hx.at(0) << " " << hx.at(1) << endl; - // cout << "vd " << vd.at(0) << " " << vd.at(1) << endl; - for( unsigned i=0; i<2; i++ ) delta.at(i) = vd.at(i) - hx.at(i); - return delta; -} - From 050e16bea03e450ca947ec1c4af28054f947e8b2 Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Thu, 2 Apr 2020 15:28:49 +0100 Subject: [PATCH 13/22] Delete KF4ParamsCombV2.bak --- .../TrackFindingTMTT/src/KF4ParamsCombV2.bak | 222 ------------------ 1 file changed, 222 deletions(-) delete mode 100644 L1Trigger/TrackFindingTMTT/src/KF4ParamsCombV2.bak diff --git a/L1Trigger/TrackFindingTMTT/src/KF4ParamsCombV2.bak b/L1Trigger/TrackFindingTMTT/src/KF4ParamsCombV2.bak deleted file mode 100644 index c4df336d9bcfd..0000000000000 --- a/L1Trigger/TrackFindingTMTT/src/KF4ParamsCombV2.bak +++ /dev/null @@ -1,222 +0,0 @@ -#include "L1Trigger/TrackFindingTMTT/interface/KF4ParamsCombV2.h" -#include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" -#include "L1Trigger/TrackFindingTMTT/interface/StubCluster.h" -//#include "L1Trigger/TrackFindingTMTT/interface/Matrix.h" -#include -#define CKF_DEBUG - -static unsigned nlayer_eta[25] = -{ 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, - 7, 7, 7, 7, 6, 6, 6, 6, 6, 6}; - -static double matx_outer[25] = { -0.16, 0.17, 0.18, 0.19, 0.20, -0.21, 0.26, 0.22, 0.26, 0.38, -0.41, 0.40, 0.44, 0.50, 0.54, -0.60, 0.44, 0.48, 0.60, 0.68, -0.50, 0.48, 0.64, 0.39, 0.20 -}; - -static double matx_inner[25] = { -0.14, 0.1, 0.1, 0.1, 0.1, -0.1, 0.1, 0.1, 0.1, 0.1, -0.12, 0.1, 0.1, 0.1, 0.15, -0.20, 0.25, 0.25, 0.3, 0.3, -0.35, 0.40, 0.40, 0.6, 0.6 -}; -static double wrapRadian( double t ){ - - if( t > 0 ){ - while( t > M_PI ) t-= 2*M_PI; - } - else{ - while( t < - M_PI ) t+= 2*M_PI; - } - return t; -} -KF4ParamsCombV2::KF4ParamsCombV2(const Settings* settings, const string &fitterName ) : - KF4ParamsComb(settings, 4, fitterName ){ - - - hdxmin[0] = -4.e-2; - hdxmax[0] = +4.e-2; - hdxmin[1] = -1.001e-1; - hdxmax[1] = +1.001e-1; - hdxmin[2] = -5.; - hdxmax[2] = +5.; - hdxmin[3] = -4.e-1; - hdxmax[3] = +4.e-1; - - hddMeasmin[1] = -1.e-1; - hddMeasmax[1] = +1.e-1; - - hresmin[0] = -100.; - hresmax[0] = +100.; - hresmin[1] = -100.; - hresmax[1] = +100.; - - hxaxtmin[0] = -1000; - hxaxtmax[0] = +1000; - hxaxtmin[1] = -1000; - hxaxtmax[1] = +1000; - hxaxtmin[2] = -1000; - hxaxtmax[2] = +1000; - hxaxtmin[3] = -1000; - hxaxtmax[3] = +1000; -} - -std::string KF4ParamsCombV2::getParams(){ - return "KF4ParamsCombV2"; -} - -std::map KF4ParamsCombV2::getTrackParams( const KalmanState *state )const{ - - std::vector x = state->xa(); - - std::map z; - double beta = x.at(V2_BETA); - double z0p = x.at(V2_Z0P); - double R0p = x.at(V2_R0P); - double rho0 = x.at(V2_RHO0); - - z["qOverPt"] = 1./( getSettings()->invPtToInvR() * 0.5 * R0p ); - z["phi0"] = wrapRadian( rho0 / R0p + sectorPhi() ); - z["z0"] = z0p - beta * wrapRadian( z["phi0"] - sectorPhi() ); - z["t"] = beta / R0p; - return z; -} - -std::vector KF4ParamsCombV2::residual(const StubCluster* stubCluster, std::vector &x )const -{ - std::vector hx = Hx( H(stubCluster), x ); - std::vector vd = d(stubCluster); - - std::vector delta(2); - for( unsigned i=0; i<2; i++ ){ - delta.at(i) = vd.at(i) - hx.at(i); - } - - return delta; -} - -/* Seed the state vector */ -std::vector KF4ParamsCombV2::seedx(const L1track3D& l1track3D)const{ - std::vector x; - x.resize(4); - double InvR0 = getSettings()->invPtToInvR() * l1track3D.qOverPt(); - double R0 = 1./InvR0; - double beta = 2 * R0 * l1track3D.tanLambda(); - - x[V2_BETA] = beta; - x[V2_Z0P] = l1track3D.z0() + beta * wrapRadian( l1track3D.phi0() - sectorPhi() ); - x[V2_R0P] = 2. * R0; - x[V2_RHO0] = 2. * R0 * wrapRadian( l1track3D.phi0() - sectorPhi() ); - return x; -} - -TMatrixD KF4ParamsCombV2::seedP(const L1track3D& l1track3D)const{ - TMatrixD p(4,4); - - p(V2_BETA,V2_BETA) = 1.e+10; - p(V2_Z0P,V2_Z0P) = 1.e+4; - p(V2_R0P,V2_R0P) = 1.e+10; - p(V2_RHO0,V2_RHO0) = 1.e+4; - - return p; -} - -/* the vector of measurements */ -std::vector KF4ParamsCombV2::d(const StubCluster* stubCluster )const{ - - std::vector meas; - meas.resize(2); - meas[0] = stubCluster->z(); - meas[1] = stubCluster->r(); - return meas; -} - -/* The Kalman measurement matrix - * Here I always measure phi(r), and z(r) */ -TMatrixD KF4ParamsCombV2::H(const StubCluster* stubCluster)const{ - TMatrixD h(2, 4); - h(0,0) = -( stubCluster->phi() - sectorPhi() ); - h(0,1) = 1; - h(1,2) = -( stubCluster->phi() - sectorPhi() ); - h(1,3) = 1; - return h; -} -TMatrixD KF4ParamsCombV2::PxxModel( const KalmanState *state, const StubCluster *stubCluster, unsigned stub_itr )const{ - //not easy to implement the multiple scattering. - TMatrixD p(4,4); - - if( getSettings()->kalmanMultiScattFactor() ){ - unsigned i_eta = abs( stubCluster->eta() / 0.1 ); - if( i_eta > 24 ) i_eta = 24; - double dl = matx_outer[i_eta] / nlayer_eta[i_eta]; - - const KalmanState * last_update_state = state->last_update_state(); - unsigned last_itr(1); - if( last_update_state ) last_itr = last_update_state->nIterations(); - dl = ( stub_itr - last_itr ) * dl; - - if( dl ){ - std::map y = getTrackParams( state ); - double dtheta0 = 1./sqrt(3) * 0.0136 * fabs(y["qOverPt"]) * sqrt(dl)*( 1+0.038*log(dl) ); - dtheta0 *= getSettings()->kalmanMultiScattFactor(); - double dbeta = state->xa().at(V2_BETA) * dtheta0; - p(V2_Z0P,V2_Z0P) = dbeta * dbeta; - double drho0 = state->xa().at(V2_R0P) * dtheta0; - p(V2_RHO0, V2_RHO0) = drho0 * drho0; - } - } - - return p; -} - -TMatrixD KF4ParamsCombV2::PddMeas(const StubCluster* stubCluster, const KalmanState *state )const{ - - const std::vector &x = state->xa(); - - TMatrixD p(2,2); - - double dztOverdphi = -1. * x.at(V2_BETA); - double drtOverdphi = -1. * x.at(V2_R0P); - - double dz(0), dr(0); - if(stubCluster->layerId() < 10){ - dz = stubCluster->sigmaZ(); - } - else{ - dr = stubCluster->sigmaZ(); - } - - double dphi = stubCluster->dphi(); - p(0,0) = dz * dz + dztOverdphi * dztOverdphi * dphi * dphi; - - double dphi_dr = stubCluster->dphi_dr(); - double dphi_dl = stubCluster->dphi_dl(); - double drho_dr = dr + drtOverdphi * dphi_dr; - double drho_dl = drtOverdphi * dphi_dl; - p(1,1) = drho_dr * drho_dr + drho_dl * drho_dl; - - return p; -} - - -bool KF4ParamsCombV2::isGoodState( const KalmanState &state )const -{ - unsigned nStubLayers = state.nStubLayers(); - bool goodState( true ); - /* - std::map x = getTrackParams( &state ); - double z0=fabs( x["z0"] ); - if( z0 > 20. ) goodState = false; - */ - - if( nStubLayers >= 3 && state.reducedChi2() > getSettings()->kalmanStateReducedChi2CutValue() ) goodState=false; - - return goodState; - -} - From 3915d5e9e8a7954f31fb3ad6e100b034af2df0ba Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Thu, 2 Apr 2020 15:29:01 +0100 Subject: [PATCH 14/22] Delete KF5ParamsComb.cc.bak --- .../TrackFindingTMTT/src/KF5ParamsComb.cc.bak | 427 ------------------ 1 file changed, 427 deletions(-) delete mode 100644 L1Trigger/TrackFindingTMTT/src/KF5ParamsComb.cc.bak diff --git a/L1Trigger/TrackFindingTMTT/src/KF5ParamsComb.cc.bak b/L1Trigger/TrackFindingTMTT/src/KF5ParamsComb.cc.bak deleted file mode 100644 index 704d0caab0883..0000000000000 --- a/L1Trigger/TrackFindingTMTT/src/KF5ParamsComb.cc.bak +++ /dev/null @@ -1,427 +0,0 @@ -///=== This is the Kalman Combinatorial Filter for 4 helix parameters track fit algorithm. - - -#include "L1Trigger/TrackFindingTMTT/interface/KF5ParamsComb.h" -#include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" -#include "L1Trigger/TrackFindingTMTT/interface/StubCluster.h" -#define CKF_DEBUG - -namespace TMTT { - - -/* -// Scattering constants - HISTORIC NOT USED. - -static unsigned nlayer_eta[25] = -{ 6, 6, 6, 6, -6, 6, 6, 6, 6, 6, 6, 7, 7, 7, -7, 7, 7, 7, 6, 6, 6, 6, 6, 6}; - -static double matx_outer[25] = { -0.16, 0.17, 0.18, 0.19, 0.20, -0.21, 0.26, 0.22, 0.26, 0.38, -0.41, 0.40, 0.44, 0.50, 0.54, -0.60, 0.44, 0.48, 0.60, 0.68, -0.50, 0.48, 0.64, 0.39, 0.20 -}; - -static double matx_inner[25] = { -0.14, 0.1, 0.1, 0.1, 0.1, -0.1, 0.1, 0.1, 0.1, 0.1, -0.12, 0.1, 0.1, 0.1, 0.15, -0.20, 0.25, 0.25, 0.3, 0.3, -0.35, 0.40, 0.40, 0.6, 0.6 -}; -*/ - -static double wrapRadian( double t ){ - - if( t > 0 ){ - while( t > M_PI ) t-= 2*M_PI; - } - else{ - while( t < - M_PI ) t+= 2*M_PI; - } - return t; -} - - - -KF5ParamsComb::KF5ParamsComb(const Settings* settings, const uint nPar, const string &fitterName ) : L1KalmanComb(settings, nPar, fitterName ){ - - hdxmin[INV2R] = -1.1e-4; - hdxmax[INV2R] = +1.1e-4; - hdxmin[PHI0] = -6.e-3; - hdxmax[PHI0] = +6.e-3; - hdxmin[Z0] = -4.1; - hdxmax[Z0] = +4.1; - hdxmin[T] = -6.; - hdxmax[T] = +6.; - hdxmin[D0] = -1.001; - hdxmax[D0] = +1.001; - - hxmin[INV2R] = -0.3 * 0.0057; - hxmax[INV2R] = +0.3 * 0.0057; - hxmin[PHI0] = -0.3; - hxmax[PHI0] = +0.3; - hxmin[Z0] = -120; - hxmax[Z0] = +120; - hxmin[T] = -6.; - hxmax[T] = +6.; - hxmin[D0] = -3.5; - hxmax[D0] = +3.5; - - hddMeasmin[PHI0] = -1.e1; - hddMeasmax[PHI0] = +1.e1; - - hresmin[PHI0] = -0.5; - hresmax[PHI0] = +0.5; - - hresmin[PHI0] = -10.; - hresmax[PHI0] = +10.; - - hxaxtmin[INV2R] = -1.e-3; - hxaxtmax[INV2R] = +1.e-3; - hxaxtmin[PHI0] = -1.e-1; - hxaxtmax[PHI0] = +1.e-1; - hxaxtmin[Z0] = -10.; - hxaxtmax[Z0] = +10.; - hxaxtmin[T] = -1.e-0; - hxaxtmax[T] = +1.e-0; - hxaxtmin[D0] = -1.001; - hxaxtmax[D0] = +1.001; -} - - -std::map KF5ParamsComb::getTrackParams(const KalmanState *state )const{ - - std::vector x = state->xa(); - std::map y; - y["qOverPt"] = x.at(INV2R) / getSettings()->invPtToInvR() * 2.; - y["phi0"] = wrapRadian( x.at(PHI0) + sectorPhi() ); - y["z0"] = x.at(Z0); - y["t"] = x.at(T); - y["d0"] = x.at(D0); - return y; -} - -/* Get track params with beam-spot constraint & track fit chi2 from applying it. */ - -std::map KF5ParamsComb::getTrackParams_BeamConstr( const KalmanState *state, double& chi2 ) const { - std::map y; - std::vector x = state->xa(); - TMatrixD cov_xa = state->pxxa(); - double deltaChi2 = (x.at(D0) * x.at(D0)) / cov_xa[D0][D0]; - chi2 = state->chi2() + deltaChi2; - // Apply beam-spot constraint to helix params in transverse plane only, as most sensitive to it. - x[INV2R] -= x.at(D0) * (cov_xa[INV2R][D0] / cov_xa[D0][D0]); - x[PHI0 ] -= x.at(D0) * (cov_xa[PHI0 ][D0] / cov_xa[D0][D0]); - x[D0 ] = 0.0; - y["qOverPt"] = x.at(INV2R) / getSettings()->invPtToInvR() * 2.; - y["phi0"] = wrapRadian( x.at(PHI0) + sectorPhi() ); - y["z0"] = x.at(Z0); - y["t"] = x.at(T); - y["d0"] = x.at(D0); - return y; -} - - -/* The Kalman measurement matrix = derivative of helix intercept w.r.t. helix params - * Here I always measure phi(r), and z(r) */ -TMatrixD KF5ParamsComb::H(const StubCluster* stubCluster)const{ - TMatrixD h(2, nPar_); - double r = stubCluster->r(); - h(PHI,INV2R) = -r; - h(PHI,PHI0) = 1; - h(PHI,D0) = -1./r; - h(Z,Z0) = 1; - h(Z,T) = r; - return h; -} - -// Not used? - -TMatrixD KF5ParamsComb::dH(const StubCluster* stubCluster)const{ - - double dr(0); - if(stubCluster->layerId() > 10){ - dr = stubCluster->sigmaZ(); - } - - double r = stubCluster->r(); - - TMatrixD h(2, nPar_); - h(PHI,INV2R) = -dr; - h(PHI,D0) = dr/(r*r); - h(Z,T) = dr; - - return h; -} - -/* Seed the state vector */ -std::vector KF5ParamsComb::seedx(const L1track3D& l1track3D)const{ - - std::vector x(nPar_); - x[INV2R] = getSettings()->invPtToInvR() * l1track3D.qOverPt()/2; - x[PHI0] = wrapRadian( l1track3D.phi0() - sectorPhi() ); - x[Z0] = l1track3D.z0(); - x[T] = l1track3D.tanLambda(); - x[D0] = 0; - - return x; -} - -/* Seed the covariance matrix */ -TMatrixD KF5ParamsComb::seedP(const L1track3D& l1track3D)const{ - TMatrixD p(nPar_,nPar_); - - double c = getSettings()->invPtToInvR() / 2; - - // Assumed track seed (from HT) uncertainty in transverse impact parameter. - const float d0Sigma = 1.0; - - if ( getSettings()->numEtaRegions() == 18 ) { - - // optimised for 18x2 with additional error factor in pt/phi to avoid pulling towards wrong HT params - p(INV2R,INV2R) = 0.0157 * 0.0157 * c * c * 4; - p(PHI0,PHI0) = 0.0051 * 0.0051 * 4; - p(Z0,Z0) = 5.0 * 5.0; - p(T,T) = 0.25 * 0.25 * 4; // IRT: increased by factor 4, as was affecting fit chi2. - p(D0,D0) = d0Sigma * d0Sigma; - - } else { - - // choose large errors - p(INV2R,INV2R) = 0.0157 * 0.0157 * c * c * 10; - p(PHI0,PHI0) = 0.0051 * 0.0051 * 10; - p(Z0,Z0) = 5.0 * 5.0; - p(T,T) = 0.25 * 0.25 * 10; - p(D0,D0) = d0Sigma * d0Sigma; - - } - - return p; -} - -/* The forecast matrix - * (here equals identity matrix) */ -TMatrixD KF5ParamsComb::F(const StubCluster* stubCluster, const KalmanState *state )const{ - TMatrixD F(nPar_,nPar_); - for(unsigned int n = 0; n < nPar_; n++) - F(n, n) = 1; - return F; -} - -/* the vector of measurements */ -std::vector KF5ParamsComb::d(const StubCluster* stubCluster )const{ - std::vector meas; - meas.resize(2); - meas[PHI] = wrapRadian( stubCluster->phi() - sectorPhi() ); - meas[Z] = stubCluster->z(); - return meas; -} - -// Assumed hit resolution in (phi,z) -TMatrixD KF5ParamsComb::PddMeas(const StubCluster* stubCluster, const KalmanState *state )const{ - - double inv2R = (getSettings()->invPtToInvR()) * 0.5 * state->candidate().qOverPt(); // alternatively use state->xa().at(INV2R) - double inv2R2 = inv2R * inv2R; - - double tanl = state->xa().at(T); // factor of 0.9 improves rejection - double tanl2 = tanl * tanl; - - TMatrixD p(2,2); - - double vphi(0); - double vz(0); - double vcorr(0); - - // consider error due to integerisation only for z (r in encap) coord when enabled - double err_digi2(0); - if (getSettings()->enableDigitize()) err_digi2 = 0.15625 * 0.15625 / 12.0; - - double a = stubCluster->sigmaX() * stubCluster->sigmaX(); - double b = stubCluster->sigmaZ() * stubCluster->sigmaZ() + err_digi2; - double r2 = stubCluster->r() * stubCluster->r(); - double invr2 = 1./r2; - - // Scattering term scaling as 1/Pt. - double sigmaScat = getSettings()->kalmanMultiScattTerm()/(state->candidate().pt()); - double sigmaScat2 = sigmaScat * sigmaScat; - - if ( stubCluster->barrel() ) { - - vphi = (a * invr2) + sigmaScat2; - - if (stubCluster->tiltedBarrel()) { - // Convert uncertainty in (r,phi) to (z,phi). - float scaleTilted = 1.; - if (getSettings()->kalmanHOtilted()) { - if ( getSettings()->useApproxB() ) { // Simple firmware approximation - scaleTilted = getApproxB(stubCluster->z(), stubCluster->r()); - } else { // Exact C++ implementation. - float tilt = stubCluster->moduleTilt(); - scaleTilted = sin(tilt) + cos(tilt)*tanl; - } - } - float scaleTilted2 = scaleTilted*scaleTilted; - // This neglects the non-radial strip effect, assumed negligeable for PS. - vz = b * scaleTilted2; - } else { - vz = b; - } - - if (getSettings()->kalmanHOdodgy()) { - // Use original (Dec. 2016) dodgy implementation was this. - vz = b; - } - - } else { - - vphi = a * invr2 + sigmaScat2; - vz = (b * tanl2); - - if (not stubCluster->psModule()) { // Neglect these terms in PS - double beta = 0.; - // Add correlation term related to conversion of stub residuals from (r,phi) to (z,phi). - if (getSettings()->kalmanHOprojZcorr() == 2) beta += -inv2R; - // Add alpha correction for non-radial 2S endcap strips.. - if (getSettings()->kalmanHOalpha() == 2) beta += -stubCluster->alpha(); // alpha is 0 except in endcap 2S disks - - double beta2 = beta * beta; - vphi += b * beta2; - vcorr = b * (beta * tanl); - - // IRT - for checking efficiency of removing phi-z correlation from projection. - // "ultimate_off1" - //vphi = a * invr2 + b * pow(-stubCluster->alpha(), 2) + b * inv2R2 + sigmaScat2; - //vcorr = b * ((-stubCluster->alpha()) * tanl); - - // IRT - This higher order correction doesn't significantly improve the track fit performance, so commented out. - //if (getSettings()->kalmanHOhelixExp()) { - // float dsByDr = 1. + (1./2.)*r2*inv2R2; // Allows for z = z0 + s*tanL, where s is not exactly r due to circle. - // vcorr *= dsByDr; - // vz *= dsByDr * dsByDr; - //} - - if (getSettings()->kalmanHOdodgy()) { - // Use original (Dec. 2016) dodgy implementation was this. - vphi = (a * invr2) + (b * inv2R2) + sigmaScat2; - vcorr = 0.; - vz = (b * tanl2); - } - } - } - - p(PHI, PHI) = vphi; - p(Z, Z) = vz; - p(PHI, Z) = vcorr; - p(Z, PHI) = vcorr; - - return p; - -} - -// State uncertainty due to scattering -- HISTORIC NOT USED -TMatrixD KF5ParamsComb::PxxModel( const KalmanState *state, const StubCluster *stubCluster )const -{ - - TMatrixD p(nPar_,nPar_); - - /* - if( getSettings()->kalmanMultiScattFactor() ){ - - unsigned i_eta = abs( stubCluster->eta() / 0.1 ); - if( i_eta > 24 ) i_eta = 24; - double dl = matx_outer[i_eta] / nlayer_eta[i_eta]; - - unsigned stub_itr = state->nextLayer(); - - const KalmanState * last_update_state = state->last_update_state(); - unsigned last_itr(1); - if( last_update_state ) last_itr = last_update_state->nextLayer(); - dl = ( stub_itr - last_itr ) * dl; - - if( dl ){ - std::map y = getTrackParams( state ); - double dtheta0 = 1./sqrt(3) * 0.0136 * fabs(y["qOverPt"]) * sqrt(dl)*( 1+0.038*log(dl) ); - dtheta0 *= getSettings()->kalmanMultiScattFactor(); - p(PHI0, PHI0) = dtheta0 * dtheta0; // Despite the name, I think this is uncertainty in phi0. I guess uncertainty in theta0 neglected compared to detector resolution. - } - } - */ - - return p; -} - -bool KF5ParamsComb::isGoodState( const KalmanState &state )const -{ - - unsigned nStubLayers = state.nStubLayers(); - bool goodState( true ); - - // todo : make configurable - - // N.B. Code below changed by Alexander Morton to allow tracking down to Pt = 2 GeV. - - double pt=fabs( getSettings()->invPtToInvR() / (2*state.xa()[INV2R]) ); - double z0=fabs( state.xa()[Z0] ); - - // state parameter selections - if( nStubLayers >= 2 ){ - - if( z0 > 15. ) goodState = false; - - const double tolerance = (nStubLayers >= 4) ? 0.05 : 0.1; // Loosen this for nStubLayers = 2 ??? - if( pt < getSettings()->houghMinPt() - tolerance) goodState = false; - - if( nStubLayers >= 3 ){ - double d0=fabs( state.xa()[D0] ); - if( d0 > 10. ) goodState = false; - } - } - - // chi2 selections - if (getSettings()->kalmanMultiScattTerm() < 0.0001) { // scattering ignored - if( nStubLayers == 2 ) { - if (state.chi2() > 15.0) goodState=false; // No separate pT selection needed - } else if ( nStubLayers == 3 ) { - if (state.chi2() > 100.0 && pt > 2.7) goodState=false; - if (state.chi2() > 120.0 && pt <= 2.7) goodState=false; - } else if ( nStubLayers == 4 ) { - if (state.chi2() > 320.0 && pt > 2.7) goodState=false; - if (state.chi2() > 1420.0 && pt <= 2.7) goodState=false; - } else if ( nStubLayers == 5 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! - if (state.chi2() > 480.0 && pt > 2.7) goodState=false; - if (state.chi2() > 2130.0 && pt <= 2.7) goodState=false; - } else if ( nStubLayers >= 6 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! - if (state.chi2() > 640.0 && pt > 2.7) goodState=false; - if (state.chi2() > 2840.0 && pt <= 2.7) goodState=false; - } - - } else { // scattering taken into account. - - if( nStubLayers == 2 ) { - if (state.chi2() > 10.0) goodState=false; // No separate pT selection needed - } else if ( nStubLayers == 3 ) { - if (state.chi2() > 30.0) goodState=false; - } else if ( nStubLayers == 4 ) { - if (state.chi2() > 80.0) goodState=false; - } else if ( nStubLayers == 5 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! - if (state.chi2() > 120.0) goodState=false; - } else if ( nStubLayers >= 6 ) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! - if (state.chi2() > 160.0) goodState=false; - } - } - - if ( getSettings()->kalmanDebugLevel() >= 1 && tpa_ != nullptr) { - if (not goodState) cout<<"State veto: nlay="< vecToMap(std::vector x); }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h b/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h index a0b61a498b9a5..d6e523f98b4c1 100644 --- a/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h +++ b/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h @@ -1,5 +1,5 @@ -#ifndef __ConverterToTTTrack_H__ -#define __ConverterToTTTrack_H__ +#ifndef L1Trigger_TrackFindingTMTT_ConverterToTTTrack_h +#define L1Trigger_TrackFindingTMTT_ConverterToTTTrack_h #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" @@ -9,7 +9,7 @@ using namespace std; -namespace TMTT { +namespace tmtt { typedef edmNew::DetSetVector > DetSetVec; typedef edm::Ref > TTStubRef; @@ -56,5 +56,5 @@ namespace TMTT { float invPtToInvR_; // converts 1/Pt to 1/radius_of_curvature }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h b/L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h index 38e05decb131c..d89730d9d2bf8 100644 --- a/L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h +++ b/L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h @@ -1,5 +1,5 @@ -#ifndef __DEADMODULEDB_H__ -#define __DEADMODULEDB_H__ +#ifndef L1Trigger_TrackFindingTMTT_DeadModuleDB_h +#define L1Trigger_TrackFindingTMTT_DeadModuleDB_h #include "DataFormats/Math/interface/deltaPhi.h" @@ -11,7 +11,7 @@ using namespace std; -namespace TMTT { +namespace tmtt { class Settings; class Stub; @@ -96,5 +96,5 @@ namespace TMTT { set > reduceLayerCut_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h b/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h index 4a50724ab12fa..45152a174ce51 100644 --- a/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h +++ b/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h @@ -1,5 +1,5 @@ -#ifndef __DEGRADEBEND_H__ -#define __DEGRADEBEND_H__ +#ifndef L1Trigger_TrackFindingTMTT_DegradeBend_h +#define L1Trigger_TrackFindingTMTT_DegradeBend_h #include "DataFormats/DetId/interface/DetId.h" @@ -9,7 +9,7 @@ class TrackerTopology; using namespace std; -namespace TMTT { +namespace tmtt { class DegradeBend { /* @@ -82,11 +82,11 @@ namespace TMTT { const unsigned int bits2S_ = 4; // Stub window sizes as encoded in L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h - static std::vector barrelCut_; - static std::vector > ringCut_; - static std::vector > tiltedCut_; - static std::vector barrelNTilt_; + static const std::vector barrelCut_; + static const std::vector > ringCut_; + static const std::vector > tiltedCut_; + static const std::vector barrelNTilt_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h b/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h index 2dbc68ec1e314..75c772006ba56 100644 --- a/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h +++ b/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h @@ -1,5 +1,5 @@ -#ifndef __DIGITALSTUB_H__ -#define __DIGITALSTUB_H__ +#ifndef L1Trigger_TrackFindingTMTT_DigitalStub_h +#define L1Trigger_TrackFindingTMTT_DigitalStub_h #include "FWCore/Utilities/interface/Exception.h" #include @@ -13,7 +13,7 @@ using namespace std; //=== WARNING: Not all variables available in the GP are available inside the HT or visa-versa, //=== so think about the hardware when calling the functions below. -namespace TMTT { +namespace tmtt { class Settings; @@ -343,5 +343,5 @@ namespace TMTT { float zErr_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h b/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h index 8af1db68041d2..639a131c28451 100644 --- a/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h +++ b/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h @@ -1,5 +1,5 @@ -#ifndef __DIGITALTRACK_H__ -#define __DIGITALTRACK_H__ +#ifndef L1Trigger_TrackFindingTMTT_DigitalTrack_h +#define L1Trigger_TrackFindingTMTT_DigitalTrack_h #include "FWCore/Utilities/interface/Exception.h" #include "L1Trigger/TrackFindingTMTT/interface/TP.h" @@ -8,7 +8,7 @@ using namespace std; -namespace TMTT { +namespace tmtt { class Settings; @@ -441,5 +441,5 @@ namespace TMTT { float chisquaredRphi_bcon_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/Get3Dtracks.h b/L1Trigger/TrackFindingTMTT/interface/Get3Dtracks.h index dbf5d6f26c045..f77d7a598f90f 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Get3Dtracks.h +++ b/L1Trigger/TrackFindingTMTT/interface/Get3Dtracks.h @@ -1,5 +1,5 @@ -#ifndef __Get3Dtracks_H__ -#define __Get3Dtracks_H__ +#ifndef L1Trigger_TrackFindingTMTT_Get3Dtracks_h +#define L1Trigger_TrackFindingTMTT_Get3Dtracks_h #include "L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h" #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" @@ -19,7 +19,7 @@ using namespace std; //=== //=== To create 3D tracks, call the sequence init(), run(), and then get tracks via trackCands3D(). -namespace TMTT { +namespace tmtt { class Settings; class Stub; @@ -107,5 +107,5 @@ namespace TMTT { vector vecTracks3D_unfiltered_; // Before r-z filter run. }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/HTbase.h b/L1Trigger/TrackFindingTMTT/interface/HTbase.h index b210849043f8f..51349fdd46968 100644 --- a/L1Trigger/TrackFindingTMTT/interface/HTbase.h +++ b/L1Trigger/TrackFindingTMTT/interface/HTbase.h @@ -1,5 +1,5 @@ -#ifndef __HTbase_H__ -#define __HTbase_H__ +#ifndef L1Trigger_TrackFindingTMTT_HTbase_h +#define L1Trigger_TrackFindingTMTT_HTbase_h #include "L1Trigger/TrackFindingTMTT/interface/HTcell.h" #include "L1Trigger/TrackFindingTMTT/interface/L1track2D.h" @@ -15,7 +15,7 @@ using namespace std; //=== Base class for Hough Transform array for a single (eta,phi) sector. -namespace TMTT { +namespace tmtt { class Settings; class Stub; @@ -160,6 +160,6 @@ namespace TMTT { vector trackCands2D_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/HTcell.h b/L1Trigger/TrackFindingTMTT/interface/HTcell.h index 30df39a362a93..97826f94dc0fd 100644 --- a/L1Trigger/TrackFindingTMTT/interface/HTcell.h +++ b/L1Trigger/TrackFindingTMTT/interface/HTcell.h @@ -1,5 +1,5 @@ -#ifndef __HTCELL_H__ -#define __HTCELL_H__ +#ifndef L1Trigger_TrackFindingTMTT_HTcell_h +#define L1Trigger_TrackFindingTMTT_HTcell_h #include "L1Trigger/TrackFindingTMTT/interface/Utility.h" #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" @@ -14,7 +14,7 @@ using namespace std; //=== A single cell in a Hough Transform array. -namespace TMTT { +namespace tmtt { class Settings; class Stub; @@ -159,5 +159,5 @@ namespace TMTT { subSectors_; // Indicate which subsectors within the sector this stub is consistent with. }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/HTrphi.h b/L1Trigger/TrackFindingTMTT/interface/HTrphi.h index 037120c3d2e47..503db55829661 100644 --- a/L1Trigger/TrackFindingTMTT/interface/HTrphi.h +++ b/L1Trigger/TrackFindingTMTT/interface/HTrphi.h @@ -1,10 +1,11 @@ -#ifndef __HTrphi_H__ -#define __HTrphi_H__ +#ifndef L1Trigger_TrackFindingTMTT_HTrphi_h +#define L1Trigger_TrackFindingTMTT_HTrphi_h #include "L1Trigger/TrackFindingTMTT/interface/HTbase.h" #include #include +#include using namespace std; @@ -13,7 +14,7 @@ using namespace std; //=== Its axes are (q/Pt, phiTrk), where phiTrk is the phi at which the track crosses a //=== user-configurable radius from the beam-line. -namespace TMTT { +namespace tmtt { class Settings; class Stub; @@ -144,13 +145,13 @@ namespace TMTT { //--- Checks that stub filling is compatible with limitations of firmware. // Maximum |gradient| of line corresponding to any stub. Should be less than the value of 1.0 assumed by the firmware. - static float maxLineGradient_; + static std::atomic maxLineGradient_; // Error count when stub added to cell which does not lie NE, E or SE of stub added to previous HT column. - static unsigned int numErrorsTypeA_; + static std::atomic numErrorsTypeA_; // Error count when stub added to more than 2 cells in one HT column (problem only for Thomas' firmware). - static unsigned int numErrorsTypeB_; + static std::atomic numErrorsTypeB_; // Error count normalisation - static unsigned int numErrorsNormalisation_; + static std::atomic numErrorsNormalisation_; // Number of stubs received from GP, irrespective of whether the stub was actually stored in // a cell in the HT array. @@ -161,6 +162,6 @@ namespace TMTT { // ... The list of found track candidates is in the base class ... }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/Histos.h b/L1Trigger/TrackFindingTMTT/interface/Histos.h index e4aa6fe70de25..a70ab1992d4af 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Histos.h +++ b/L1Trigger/TrackFindingTMTT/interface/Histos.h @@ -1,5 +1,5 @@ -#ifndef __HISTOS_H__ -#define __HISTOS_H__ +#ifndef L1Trigger_TrackFindingTMTT_Histos_h +#define L1Trigger_TrackFindingTMTT_Histos_h #include "FWCore/ServiceRegistry/interface/Service.h" #include "CommonTools/UtilAlgos/interface/TFileService.h" @@ -25,7 +25,7 @@ class TGraphAsymmErrors; class TGraph; class TEfficiency; -namespace TMTT { +namespace tmtt { class InputData; class TP; @@ -657,5 +657,5 @@ namespace TMTT { bool bApproxMistake_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/InputData.h b/L1Trigger/TrackFindingTMTT/interface/InputData.h index 3a41f17adb86d..3d7b0c5ed7648 100644 --- a/L1Trigger/TrackFindingTMTT/interface/InputData.h +++ b/L1Trigger/TrackFindingTMTT/interface/InputData.h @@ -1,5 +1,5 @@ -#ifndef __INPUTDATA_H__ -#define __INPUTDATA_H__ +#ifndef L1Trigger_TrackFindingTMTT_InputData_h +#define L1Trigger_TrackFindingTMTT_InputData_h #include "FWCore/Framework/interface/EDAnalyzer.h" #include "L1Trigger/TrackFindingTMTT/interface/TP.h" @@ -10,7 +10,7 @@ using namespace std; -namespace TMTT { +namespace tmtt { class Settings; @@ -60,5 +60,5 @@ namespace TMTT { vAllStubs_; // all stubs, even those that would fail any tightened front-end readout electronic cuts specified in section StubCuts of Analyze_Defaults_cfi.py. (Only used to measure the efficiency of these cuts). }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h b/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h index cffe3d281596a..425cdf42f24b2 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h +++ b/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h @@ -1,13 +1,13 @@ ///=== This is the Kalman Combinatorial Filter for 4 & 5 helix parameters track fit algorithm. -#ifndef __KFPARAMSCOMB__ -#define __KFPARAMSCOMB__ +#ifndef L1Trigger_TrackFindingTMTT_KFParamsComb_h +#define L1Trigger_TrackFindingTMTT_KFParamsComb_h #include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" #include #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" -namespace TMTT { +namespace tmtt { class KFParamsComb : public L1KalmanComb { public: @@ -36,6 +36,6 @@ namespace TMTT { std::map vecToMap(std::vector x) const; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h b/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h index d212b57699de1..782a1c3c6b875 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h +++ b/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h @@ -1,5 +1,5 @@ -#ifndef __KFTrackletTrack_H__ -#define __KFTrackletTrack_H__ +#ifndef L1Trigger_TrackFindingTMTT_KFTrackletTrack_h +#define L1Trigger_TrackFindingTMTT_KFTrackletTrack_h #include "FWCore/Utilities/interface/Exception.h" #include "DataFormats/Math/interface/deltaPhi.h" @@ -27,7 +27,7 @@ using namespace std; //=== It also calculates & gives access to associated truth particle (Tracking Particle) if any. //=== It also gives access to the 3D hough-transform track candidate (L1track3D) on which the fit was run. -namespace TMTT { +namespace tmtt { class KFTrackletTrack { public: @@ -281,6 +281,6 @@ namespace TMTT { DigitalTrack digitalTrack_; // Class used to digitize track if required. }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/KalmanState.h b/L1Trigger/TrackFindingTMTT/interface/KalmanState.h index 74962c2e597e1..1f030d25aa587 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KalmanState.h +++ b/L1Trigger/TrackFindingTMTT/interface/KalmanState.h @@ -1,12 +1,12 @@ -#ifndef __KALMAN_STATE__ -#define __KALMAN_STATE__ +#ifndef L1Trigger_TrackFindingTMTT_KalmanState_h +#define L1Trigger_TrackFindingTMTT_KalmanState_h #include #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" #include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" #include -namespace TMTT { +namespace tmtt { class L1KalmanComb; class KalmanState; @@ -113,6 +113,6 @@ namespace TMTT { bool consistentHLS_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/KillDupFitTrks.h b/L1Trigger/TrackFindingTMTT/interface/KillDupFitTrks.h index baed535f35fe2..a8a56c835562b 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KillDupFitTrks.h +++ b/L1Trigger/TrackFindingTMTT/interface/KillDupFitTrks.h @@ -1,5 +1,5 @@ -#ifndef __KILLDUPFITTRKS_H__ -#define __KILLDUPFITTRKS_H__ +#ifndef L1Trigger_TrackFindingTMTT_KillDupFitTrks_h +#define L1Trigger_TrackFindingTMTT_KillDupFitTrks_h #include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" #include "L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h" @@ -19,7 +19,7 @@ using namespace std; * implemented inside class KillDupTrks. */ -namespace TMTT { +namespace tmtt { class Settings; @@ -68,6 +68,6 @@ namespace TMTT { KillDupTrks killDupTrks_; // Contains duplicate removal algorithms common to all track types. }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h b/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h index 5adb86edf4eea..9edc915312fc4 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h +++ b/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h @@ -1,5 +1,5 @@ -#ifndef __KILLDUPTRKS_H__ -#define __KILLDUPTRKS_H__ +#ifndef L1Trigger_TrackFindingTMTT_KillDupTrks_h +#define L1Trigger_TrackFindingTMTT_KillDupTrks_h #include #include @@ -33,7 +33,7 @@ using namespace std; * ------------------------------------------------------------------------------------------- */ -namespace TMTT { +namespace tmtt { class L1trackBase; class L1track2D; @@ -96,7 +96,7 @@ namespace TMTT { unsigned int dupTrkMinCommonHitsLayers_; // Min no of matched stubs & layers to keep smaller cand }; -} // namespace TMTT +} // namespace tmtt //=== Include file which implements all the functions in the above class. #include "L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc" diff --git a/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc b/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc index 9c198fb6675e5..85bd0fa7b987c 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc +++ b/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc @@ -1,4 +1,4 @@ -namespace TMTT { +namespace tmtt { // Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. template @@ -316,4 +316,4 @@ namespace TMTT { //template class KillDupTrks; //template class KillDupTrks; -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h b/L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h index 8f1f277de378e..6f95040170205 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h @@ -2,8 +2,8 @@ ///=== Written by: Sioni Summers and Alexander D. Morton -#ifndef __L1_CHI_SQUARED__ -#define __L1_CHI_SQUARED__ +#ifndef L1Trigger_TrackFindingTMTT_L1ChiSquared_h +#define L1Trigger_TrackFindingTMTT_L1ChiSquared_h #include "L1Trigger/TrackFindingTMTT/interface/Matrix.h" #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" @@ -14,7 +14,7 @@ #include #include -namespace TMTT { +namespace tmtt { class L1ChiSquared : public TrackFitGeneric { public: @@ -53,6 +53,6 @@ namespace TMTT { unsigned int minStubLayersRed_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h b/L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h index 3e42f1aded361..07ab863cd0f9c 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h @@ -1,7 +1,7 @@ ///=== This is the base class for the Kalman Combinatorial Filter track fit algorithm. -#ifndef __L1_KALMAN_COMB__ -#define __L1_KALMAN_COMB__ +#ifndef L1Trigger_TrackFindingTMTT_L1KalmanComb_h +#define L1Trigger_TrackFindingTMTT_L1KalmanComb_h #include #include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h" @@ -18,7 +18,7 @@ class TH1F; class TH2F; -namespace TMTT { +namespace tmtt { class TP; class KalmanState; @@ -203,6 +203,6 @@ namespace TMTT { const TP *tpa_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h b/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h index 1322027476544..0333c0ad174e4 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h @@ -1,5 +1,5 @@ -#ifndef __L1fittedTrack_H__ -#define __L1fittedTrack_H__ +#ifndef L1Trigger_TrackFindingTMTT_L1fittedTrack_h +#define L1Trigger_TrackFindingTMTT_L1fittedTrack_h #include "FWCore/Utilities/interface/Exception.h" #include "DataFormats/Math/interface/deltaPhi.h" @@ -26,7 +26,7 @@ using namespace std; //=== It also calculates & gives access to associated truth particle (Tracking Particle) if any. //=== It also gives access to the 3D hough-transform track candidate (L1track3D) on which the fit was run. -namespace TMTT { +namespace tmtt { class L1fittedTrack : public L1trackBase { public: @@ -402,6 +402,6 @@ namespace TMTT { bool consistentCell_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/L1track2D.h b/L1Trigger/TrackFindingTMTT/interface/L1track2D.h index 829926be2a6af..6617c81f246ab 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1track2D.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1track2D.h @@ -1,5 +1,5 @@ -#ifndef __L1track2D_H__ -#define __L1track2D_H__ +#ifndef L1Trigger_TrackFindingTMTT_L1track2D_h +#define L1Trigger_TrackFindingTMTT_L1track2D_h #include "FWCore/Utilities/interface/Exception.h" #include "L1Trigger/TrackFindingTMTT/interface/L1trackBase.h" @@ -17,7 +17,7 @@ using namespace std; //=== Gives access to all stubs on track and to its 2D helix parameters. //=== Also calculates & gives access to associated truth particle (Tracking Particle) if any. -namespace TMTT { +namespace tmtt { class L1track2D : public L1trackBase { public: @@ -137,6 +137,6 @@ namespace TMTT { unsigned int nMatchedLayers_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/L1track3D.h b/L1Trigger/TrackFindingTMTT/interface/L1track3D.h index d5387998f4b6e..4ceef3c3366f4 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1track3D.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1track3D.h @@ -1,5 +1,5 @@ -#ifndef __L1track3D_H__ -#define __L1track3D_H__ +#ifndef L1Trigger_TrackFindingTMTT_L1track3D_h +#define L1Trigger_TrackFindingTMTT_L1track3D_h #include "DataFormats/Math/interface/deltaPhi.h" #include "L1Trigger/TrackFindingTMTT/interface/L1trackBase.h" @@ -21,7 +21,7 @@ using namespace std; //=== Gives access to all stubs on track and to its 3D helix parameters. //=== Also calculates & gives access to associated truth particle (Tracking Particle) if any. -namespace TMTT { +namespace tmtt { class L1track3D : public L1trackBase { public: @@ -114,7 +114,7 @@ namespace TMTT { vector getChiPhiDigi() { vector result; - static const float phiMult = pow(2, settings_->phiSBits()) / settings_->phiSRange(); + const float phiMult = pow(2, settings_->phiSBits()) / settings_->phiSRange(); for (const float& chi_phi : this->getChiPhi()) { int iDigi_chi_phi = floor(chi_phi * phiMult); result.push_back(iDigi_chi_phi); @@ -133,7 +133,7 @@ namespace TMTT { vector getChiZDigi() { vector result; - static const float zMult = pow(2, settings_->zBits()) / settings_->zRange(); + const float zMult = pow(2, settings_->zBits()) / settings_->zRange(); for (const float& chi_z : this->getChiZ()) { int iDigi_chi_z = floor(chi_z * zMult); result.push_back(iDigi_chi_z); @@ -271,6 +271,6 @@ namespace TMTT { unsigned int nMatchedLayers_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h b/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h index 3386a5f020475..49adaaaccec0d 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h @@ -1,5 +1,5 @@ -#ifndef __L1trackBase_H__ -#define __L1trackBase_H__ +#ifndef L1Trigger_TrackFindingTMTT_L1trackBase_h +#define L1Trigger_TrackFindingTMTT_L1trackBase_h #include #include @@ -11,7 +11,7 @@ using namespace std; //=== However, it declares functions that are common to the derived classes L1trackBase, L1track3D and L1fittedTrack, //=== allowing software to analyse objects of all three types in the same way. -namespace TMTT { +namespace tmtt { class Stub; class TP; @@ -60,6 +60,6 @@ namespace TMTT { virtual unsigned int getNumMatchedLayers() const = 0; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/Matrix.h b/L1Trigger/TrackFindingTMTT/interface/Matrix.h index b970b68626543..16e9e3cd5063f 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Matrix.h +++ b/L1Trigger/TrackFindingTMTT/interface/Matrix.h @@ -1,9 +1,9 @@ -#ifndef __L1TRK_MATRIX_H__ -#define __L1TRK_MATRIX_H__ +#ifndef L1Trigger_TrackFindingTMTT_Matrix_h +#define L1Trigger_TrackFindingTMTT_Matrix_h #include -namespace TMTT { +namespace tmtt { template class Matrix { @@ -55,6 +55,6 @@ namespace TMTT { void print(); }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h b/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h index ca6f91a07edb0..9701df8a6d1f9 100644 --- a/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h +++ b/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h @@ -1,12 +1,12 @@ -#ifndef __MINIHTSTAGE_H__ -#define __MINIHTSTAGE_H__ +#ifndef L1Trigger_TrackFindingTMTT_MiniHTstage_h +#define L1Trigger_TrackFindingTMTT_MiniHTstage_h #include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h" using namespace std; using boost::numeric::ublas::matrix; -namespace TMTT { +namespace tmtt { class Settings; @@ -55,6 +55,6 @@ namespace TMTT { unsigned int nHTlinksPerNonant_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h b/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h index 1b2073529a15e..c29587e8897bb 100644 --- a/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h +++ b/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h @@ -1,5 +1,5 @@ -#ifndef __MUXHTOUTPUTS_H__ -#define __MUXHTOUTPUTS_H__ +#ifndef L1Trigger_TrackFindingTMTT_MuxHToutputs_h +#define L1Trigger_TrackFindingTMTT_MuxHToutputs_h #include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h" @@ -22,7 +22,7 @@ using boost::numeric::ublas::matrix; */ //================================================================================================== -namespace TMTT { +namespace tmtt { class Settings; @@ -72,6 +72,6 @@ namespace TMTT { bool busySectorUseMbinRanges_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/Sector.h b/L1Trigger/TrackFindingTMTT/interface/Sector.h index 04b6ea11ba810..f97e3678a5f6e 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Sector.h +++ b/L1Trigger/TrackFindingTMTT/interface/Sector.h @@ -1,5 +1,5 @@ -#ifndef __SECTOR_H__ -#define __SECTOR_H__ +#ifndef L1Trigger_TrackFindingTMTT_Sector_h +#define L1Trigger_TrackFindingTMTT_Sector_h #include "L1Trigger/TrackFindingTMTT/interface/TP.h" @@ -8,7 +8,7 @@ using namespace std; -namespace TMTT { +namespace tmtt { class Settings; class Stub; @@ -137,6 +137,6 @@ namespace TMTT { vector zOuterMaxSub_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/Settings.h b/L1Trigger/TrackFindingTMTT/interface/Settings.h index f8d63bfced81b..8b8701a508894 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Settings.h +++ b/L1Trigger/TrackFindingTMTT/interface/Settings.h @@ -1,5 +1,5 @@ -#ifndef __SETTINGS_H__ -#define __SETTINGS_H__ +#ifndef L1Trigger_TrackFindingTMTT_Settings_h +#define L1Trigger_TrackFindingTMTT_Settings_h #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/Exception.h" @@ -10,7 +10,7 @@ using namespace std; // Stores all configuration parameters + some hard-wired constants. -namespace TMTT { +namespace tmtt { class Settings { public: @@ -744,6 +744,6 @@ namespace TMTT { double zMaxNonTilted_[4]; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/SimpleLR.h b/L1Trigger/TrackFindingTMTT/interface/SimpleLR.h index 69fe082b0b5e8..785a220180220 100644 --- a/L1Trigger/TrackFindingTMTT/interface/SimpleLR.h +++ b/L1Trigger/TrackFindingTMTT/interface/SimpleLR.h @@ -2,8 +2,8 @@ ///=== Written by: Davide Cieri (davide.cieri@stfc.ac.uk) -#ifndef __SIMPLELR__ -#define __SIMPLELR__ +#ifndef L1Trigger_TrackFindingTMTT_SimpleLR_h +#define L1Trigger_TrackFindingTMTT_SimpleLR_h #include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h" #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" @@ -15,7 +15,7 @@ #include #include -namespace TMTT { +namespace tmtt { class SimpleLR : public TrackFitGeneric { public: @@ -64,6 +64,6 @@ namespace TMTT { unsigned int shiftingBitsLambda_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/Stub.h b/L1Trigger/TrackFindingTMTT/interface/Stub.h index d61dfde8b0b5e..5d01f7145dd4f 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Stub.h +++ b/L1Trigger/TrackFindingTMTT/interface/Stub.h @@ -1,5 +1,5 @@ -#ifndef __STUB_H__ -#define __STUB_H__ +#ifndef L1Trigger_TrackFindingTMTT_Stub_h +#define L1Trigger_TrackFindingTMTT_Stub_h #include "DataFormats/L1TrackTrigger/interface/TTTypes.h" #include "DataFormats/L1TrackTrigger/interface/TTStub.h" @@ -25,6 +25,7 @@ #include #include #include +#include using namespace std; @@ -32,7 +33,7 @@ class TrackerGeometry; class TrackerTopology; // class DetId; -namespace TMTT { +namespace tmtt { class TP; @@ -279,7 +280,7 @@ namespace TMTT { // Return tracker geometry (T3, T4, T5 ...) // See https://github.com/cms-sw/cmssw/blob/CMSSW_9_1_X/Configuration/Geometry/README.md - string trackerGeometryVersion() const { return trackerGeometryVersion_; } + unsigned int trackerGeometryVersion() const { return trackerGeometryVersion_.load(); } private: // Degrade assumed stub bend resolution. @@ -384,7 +385,7 @@ namespace TMTT { bool digitizeWarningsOn_; // Enable warnings about accessing non-digitized quantities. // Which tracker geometry is this? - static thread_local string trackerGeometryVersion_; + static std::atomic trackerGeometryVersion_; // Used to provide TMTT recommendations for stub window sizes that CMS should use. StubWindowSuggest stubWindowSuggest_; @@ -393,9 +394,9 @@ namespace TMTT { DegradeBend degradeBend_; //--- Utility to emulate dead modules. - static bool stubKillerInit_; - static StubKiller stubKiller_; + static std::atomic stubKillerInit_; + static thread_local StubKiller stubKiller_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/StubCluster.h b/L1Trigger/TrackFindingTMTT/interface/StubCluster.h index dd90b1927dfee..1acfb27b10e8c 100644 --- a/L1Trigger/TrackFindingTMTT/interface/StubCluster.h +++ b/L1Trigger/TrackFindingTMTT/interface/StubCluster.h @@ -1,5 +1,5 @@ -#ifndef __STUB_CLUSTER_H__ -#define __STUB_CLUSTER_H__ +#ifndef L1Trigger_TrackFindingTMTT_StubCluster_h +#define L1Trigger_TrackFindingTMTT_StubCluster_h #include #include @@ -7,7 +7,7 @@ // Used to merge all clusters assigned to a track in a single layer into a single StubCluster // whose coordinate is the mean of all the individual clusters. -namespace TMTT { +namespace tmtt { class Stub; class TP; @@ -80,6 +80,6 @@ namespace TMTT { double moduleTilt_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/StubKiller.h b/L1Trigger/TrackFindingTMTT/interface/StubKiller.h index e4c3fdda10d12..5a7e47b2fbd9e 100644 --- a/L1Trigger/TrackFindingTMTT/interface/StubKiller.h +++ b/L1Trigger/TrackFindingTMTT/interface/StubKiller.h @@ -1,8 +1,8 @@ // Copied from https://raw.githubusercontent.com/EmyrClement/StubKiller/master/StubKiller.cc // on 9th May 2018. -#ifndef __STUBKILLER_H__ -#define __STUBKILLER_H__ +#ifndef L1Trigger_TrackFindingTMTT_StubKiller_h +#define L1Trigger_TrackFindingTMTT_StubKiller_h #include "DataFormats/L1TrackTrigger/interface/TTTypes.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" @@ -14,52 +14,56 @@ using namespace std; -class StubKiller { -public: - StubKiller(); - ~StubKiller() {} - - void initialise(unsigned int killScenario, - const TrackerTopology* trackerTopology, - const TrackerGeometry* trackerGeometry); - - bool killStub(const TTStub* stub, - const vector layersToKill, - const int minPhiToKill, - const int maxPhiToKill, - const int minZToKill, - const int maxZToKill, - const int minRToKill, - const int maxRToKill, - const double fractionOfStubsToKillInLayers, - const double fractionOfStubsToKillEverywhere); - - bool killStub(const TTStub* stub); - - bool killStubInDeadModule(const TTStub* stub); - - map getListOfDeadModules() { return deadModules_; } - -private: - void chooseModulesToKill(); - void addDeadLayerModulesToDeadModuleList(); - - unsigned int killScenario_; - const TrackerTopology* trackerTopology_; - const TrackerGeometry* trackerGeometry_; - - vector layersToKill_; - int minPhiToKill_; - int maxPhiToKill_; - int minZToKill_; - int maxZToKill_; - int minRToKill_; - int maxRToKill_; - double fractionOfStubsToKillInLayers_; - double fractionOfStubsToKillEverywhere_; - double fractionOfModulesToKillEverywhere_; - - map deadModules_; -}; +namespace tmtt { + + class StubKiller { + public: + StubKiller(); + ~StubKiller() {} + + void initialise(unsigned int killScenario, + const TrackerTopology* trackerTopology, + const TrackerGeometry* trackerGeometry); + + bool killStub(const TTStub* stub, + const vector layersToKill, + const double minPhiToKill, + const double maxPhiToKill, + const double minZToKill, + const double maxZToKill, + const double minRToKill, + const double maxRToKill, + const double fractionOfStubsToKillInLayers, + const double fractionOfStubsToKillEverywhere); + + bool killStub(const TTStub* stub); + + bool killStubInDeadModule(const TTStub* stub); + + map getListOfDeadModules() { return deadModules_; } + + private: + void chooseModulesToKill(); + void addDeadLayerModulesToDeadModuleList(); + + unsigned int killScenario_; + const TrackerTopology* trackerTopology_; + const TrackerGeometry* trackerGeometry_; + + vector layersToKill_; + double minPhiToKill_; + double maxPhiToKill_; + double minZToKill_; + double maxZToKill_; + double minRToKill_; + double maxRToKill_; + double fractionOfStubsToKillInLayers_; + double fractionOfStubsToKillEverywhere_; + double fractionOfModulesToKillEverywhere_; + + map deadModules_; + }; + +}; // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h b/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h index 50a60f48d4cf6..538c19a37f104 100644 --- a/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h +++ b/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h @@ -1,5 +1,5 @@ -#ifndef __STUBWINDOWSUGGEST_H__ -#define __STUBWINDOWSUGGEST_H__ +#ifndef L1Trigger_TrackFindingTMTT_StubWindowsSuggest_h +#define L1Trigger_TrackFindingTMTT_StubWindowsSuggest_h #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" @@ -9,7 +9,7 @@ using namespace std; class TrackerTopology; -namespace TMTT { +namespace tmtt { class Stub; @@ -54,12 +54,12 @@ namespace TMTT { const TrackerTopology* theTrackerTopo_; // Stub window sizes as encoded in L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h - static std::vector barrelCut_; - static std::vector > ringCut_; - static std::vector > tiltedCut_; - static std::vector barrelNTilt_; + static thread_local std::vector barrelCut_; + static thread_local std::vector > ringCut_; + static thread_local std::vector > tiltedCut_; + static thread_local std::vector barrelNTilt_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/TP.h b/L1Trigger/TrackFindingTMTT/interface/TP.h index d70a8408d95e5..48d2d95aa6636 100644 --- a/L1Trigger/TrackFindingTMTT/interface/TP.h +++ b/L1Trigger/TrackFindingTMTT/interface/TP.h @@ -1,5 +1,5 @@ -#ifndef __TP_H__ -#define __TP_H__ +#ifndef L1Trigger_TrackFindingTMTT_TP_h +#define L1Trigger_TrackFindingTMTT_TP_h #include "DataFormats/Math/interface/deltaPhi.h" #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h" @@ -15,7 +15,7 @@ using namespace std; -namespace TMTT { +namespace tmtt { class Stub; @@ -131,6 +131,6 @@ namespace TMTT { float nearestJetPt_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h b/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h index cd456f9309db4..8e6ecf082d975 100644 --- a/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h +++ b/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h @@ -2,8 +2,8 @@ ///=== Written by: Alexander D. Morton and Sioni Summers -#ifndef __TrackFitGeneric_H__ -#define __TrackFitGeneric_H__ +#ifndef L1Trigger_TrackFindingTMTT_TrackFitGeneric_h +#define L1Trigger_TrackFindingTMTT_TrackFitGeneric_h // Don't fit track candidates if they have more than this number of stubs. #define __MAX_STUBS_PER_TRK__ 30 @@ -16,7 +16,7 @@ using namespace std; -namespace TMTT { +namespace tmtt { class Settings; @@ -49,6 +49,6 @@ namespace TMTT { unsigned nDupStubs_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h b/L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h index dd595635cd82d..fd49de84f1ff9 100644 --- a/L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h +++ b/L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h @@ -1,5 +1,5 @@ -#ifndef __TRACKERGEOMETRYINFO_H__ -#define __TRACKERGEOMETRYINFO_H__ +#ifndef L1Trigger_TrackFindingTMTT_TrackerGeometryInfo_h +#define L1Trigger_TrackFindingTMTT_TrackerGeometryInfo_h #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" @@ -14,7 +14,7 @@ using namespace std; class TrackerTopology; class TrackerGeometry; -namespace TMTT { +namespace tmtt { /** * ======================================================================================================== @@ -47,6 +47,6 @@ namespace TMTT { vector moduleB_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h b/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h index 3c3091f5401b7..5e3e652347fbe 100644 --- a/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h +++ b/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h @@ -1,5 +1,5 @@ -#ifndef __TrkRZfilter_H__ -#define __TrkRZfilter_H__ +#ifndef L1Trigger_TrackFindingTMTT_TrkRZfilter_h +#define L1Trigger_TrackFindingTMTT_TrkRZfilter_h #include "L1Trigger/TrackFindingTMTT/interface/L1track2D.h" #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" @@ -25,7 +25,7 @@ using namespace std; //=== After creating the L1track3D tracks, TrkRZfilter can optionally run duplicate removal on them, //=== before they are output. -namespace TMTT { +namespace tmtt { class Settings; class Stub; @@ -133,6 +133,6 @@ namespace TMTT { KillDupTrks killDupTrks_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interface/Utility.h b/L1Trigger/TrackFindingTMTT/interface/Utility.h index 2e915b7030842..8ff4000c13045 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Utility.h +++ b/L1Trigger/TrackFindingTMTT/interface/Utility.h @@ -1,11 +1,11 @@ -#ifndef __UTILITY_H__ -#define __UTILITY_H__ +#ifndef L1Trigger_TrackFindingTMTT_Utility_h +#define L1Trigger_TrackFindingTMTT_Utility_h #include #include using namespace std; -namespace TMTT { +namespace tmtt { class TP; class Stub; @@ -47,6 +47,6 @@ namespace TMTT { string algo, const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, float invPt, float eta = 0.); } // namespace Utility -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h index 5fb2b95afa1ec..7e4fae322c9a8 100644 --- a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h +++ b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h @@ -1,5 +1,5 @@ -#ifndef __DEMONSTRATOR_DATAFORMATS_DIGICONVERTER_H__ -#define __DEMONSTRATOR_DATAFORMATS_DIGICONVERTER_H__ +#ifndef L1Trigger_TrackFindingTMTT_DigiConverter_h +#define L1Trigger_TrackFindingTMTT_DigiConverter_h #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" @@ -19,26 +19,26 @@ namespace demo { class DigiConverter { public: - DigiConverter(const TMTT::Settings* settings); + DigiConverter(const tmtt::Settings* settings); ~DigiConverter() = default; - DigiDTCStub makeDigiDTCStub(const TMTT::Stub& aDTCStub, uint32_t aDigiPhiSec) const; - DigiHTStub makeDigiHTStub(const TMTT::Stub& aHTStub, + DigiDTCStub makeDigiDTCStub(const tmtt::Stub& aDTCStub, uint32_t aDigiPhiSec) const; + DigiHTStub makeDigiHTStub(const tmtt::Stub& aHTStub, uint32_t aPhiSectorIdInNon, uint32_t aEtaSectorId, int cBin, int aChiZ, int aChiPhi, bool mSel) const; - DigiHTMiniStub makeDigiHTMiniStub(const TMTT::Stub& aHTMiniStub, + DigiHTMiniStub makeDigiHTMiniStub(const tmtt::Stub& aHTMiniStub, uint32_t aPhiSectorIdInNon, uint32_t aEtaSectorId, int8_t cBin, int8_t mBin) const; - DigiKF4Track makeDigiKF4Track(const TMTT::L1fittedTrack& aFitTrk) const; + DigiKF4Track makeDigiKF4Track(const tmtt::L1fittedTrack& aFitTrk) const; private: - const TMTT::Settings* mSettings; // Configuration parameters. + const tmtt::Settings* mSettings; // Configuration parameters. }; } // namespace demo diff --git a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.icc b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.icc index 76e7d6e47969c..2dfda2c8a267d 100644 --- a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.icc +++ b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.icc @@ -3,11 +3,11 @@ namespace demo { //----------------------------------------------------------------------------- - DigiConverter::DigiConverter(const TMTT::Settings* settings) : mSettings(settings) {} + DigiConverter::DigiConverter(const tmtt::Settings* settings) : mSettings(settings) {} //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- - DigiDTCStub DigiConverter::makeDigiDTCStub(const TMTT::Stub& aDTCStub, uint32_t aDigiPhiSec) const { + DigiDTCStub DigiConverter::makeDigiDTCStub(const tmtt::Stub& aDTCStub, uint32_t aDigiPhiSec) const { return DigiDTCStub(aDTCStub.digitalStub().iDigi_PhiO(), aDTCStub.digitalStub().moduleType(), aDigiPhiSec, @@ -19,7 +19,7 @@ namespace demo { //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- - DigiHTStub DigiConverter::makeDigiHTStub(const TMTT::Stub& aHTStub, + DigiHTStub DigiConverter::makeDigiHTStub(const tmtt::Stub& aHTStub, uint32_t aPhiSectorIdInNon, uint32_t aEtaSectorId, int cBin, @@ -40,7 +40,7 @@ namespace demo { //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- - DigiHTMiniStub DigiConverter::makeDigiHTMiniStub(const TMTT::Stub& aHTMiniStub, + DigiHTMiniStub DigiConverter::makeDigiHTMiniStub(const tmtt::Stub& aHTMiniStub, uint32_t aPhiSectorIdInNon, uint32_t aEtaSectorId, int8_t cBin, @@ -59,7 +59,7 @@ namespace demo { //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- - DigiKF4Track DigiConverter::makeDigiKF4Track(const TMTT::L1fittedTrack& aFitTrk) const { + DigiKF4Track DigiConverter::makeDigiKF4Track(const tmtt::L1fittedTrack& aFitTrk) const { const uint numPhiSecPerNon = mSettings->numPhiSectors() / mSettings->numPhiNonants(); return DigiKF4Track(aFitTrk.digitaltrack().iDigi_oneOver2r(), diff --git a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.h b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.h index a2107a743661c..b378eb4ad4682 100644 --- a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.h +++ b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.h @@ -1,5 +1,5 @@ -#ifndef __DEMONSTRATOR_PRODUCER_DIGIPRODUCER_HPP__ -#define __DEMONSTRATOR_PRODUCER_DIGIPRODUCER_HPP__ +#ifndef L1Trigger_TrackFindingTMTT_DigiProducer_h +#define L1Trigger_TrackFindingTMTT_DigiProducer_h #include "FWCore/Framework/interface/EDProducer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -47,21 +47,21 @@ class TrackFitGeneric;*/ private: const edm::EDGetTokenT tpInputTag; - const edm::EDGetTokenT stubInputTag; - const edm::EDGetTokenT stubTruthInputTag; - const edm::EDGetTokenT clusterTruthInputTag; + const edm::EDGetTokenT stubInputTag; + const edm::EDGetTokenT stubTruthInputTag; + const edm::EDGetTokenT clusterTruthInputTag; const edm::EDGetTokenT genJetInputTag_; // Configuration parameters - TMTT::Settings *settings_; + tmtt::Settings *settings_; vector trackFitters_; vector useRZfilter_; bool runRZfilter_; - TMTT::Histos *hists_; - map fitterWorkerMap_; + tmtt::Histos *hists_; + map fitterWorkerMap_; - TMTT::TrackerGeometryInfo trackerGeometryInfo_; + tmtt::TrackerGeometryInfo trackerGeometryInfo_; }; } // namespace demo diff --git a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.icc b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.icc index 2acc990665d8e..1905528f662ab 100644 --- a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.icc +++ b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.icc @@ -43,14 +43,14 @@ namespace demo { DigiProducer::DigiProducer(const edm::ParameterSet& iConfig) : tpInputTag(consumes(iConfig.getParameter("tpInputTag"))), - stubInputTag(consumes(iConfig.getParameter("stubInputTag"))), - stubTruthInputTag(consumes(iConfig.getParameter("stubTruthInputTag"))), + stubInputTag(consumes(iConfig.getParameter("stubInputTag"))), + stubTruthInputTag(consumes(iConfig.getParameter("stubTruthInputTag"))), clusterTruthInputTag( - consumes(iConfig.getParameter("clusterTruthInputTag"))), + consumes(iConfig.getParameter("clusterTruthInputTag"))), genJetInputTag_(consumes(iConfig.getParameter("genJetInputTag"))), trackerGeometryInfo_() { // Get configuration parameters - settings_ = new TMTT::Settings(iConfig); + settings_ = new tmtt::Settings(iConfig); trackFitters_ = settings_->trackFitters(); useRZfilter_ = settings_->useRZfilter(); runRZfilter_ = (useRZfilter_.size() > 0); // Do any fitters require an r-z track filter to be run? @@ -60,12 +60,12 @@ namespace demo { cout.precision(4); // Book histograms. - hists_ = new TMTT::Histos(settings_); + hists_ = new tmtt::Histos(settings_); hists_->book(); // Create track fitting algorithm (& internal histograms if it uses them) for (const string& fitterName : trackFitters_) { - fitterWorkerMap_[fitterName] = TMTT::TrackFitGeneric::create(fitterName, settings_); + fitterWorkerMap_[fitterName] = tmtt::TrackFitGeneric::create(fitterName, settings_); fitterWorkerMap_[fitterName]->bookHists(); } @@ -118,22 +118,22 @@ namespace demo { void DigiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { // Note useful info about MC truth particles and about reconstructed stubs . - TMTT::InputData inputData( + tmtt::InputData inputData( iEvent, iSetup, settings_, tpInputTag, stubInputTag, stubTruthInputTag, clusterTruthInputTag, genJetInputTag_); - const vector& vTPs = inputData.getTPs(); - const vector& vStubs = inputData.getStubs(); + const vector& vTPs = inputData.getTPs(); + const vector& vStubs = inputData.getStubs(); // Creates matrix of Sector objects, which decide which stubs are in which (eta,phi) sector - matrix mSectors(settings_->numPhiSectors(), settings_->numEtaRegions()); + matrix mSectors(settings_->numPhiSectors(), settings_->numEtaRegions()); // Create matrix of r-phi Hough-Transform arrays, with one-to-one correspondence to sectors. - matrix mHtRphis(settings_->numPhiSectors(), settings_->numEtaRegions()); + matrix mHtRphis(settings_->numPhiSectors(), settings_->numEtaRegions()); // Create matrix of Get3Dtracks objects, to run optional r-z track filter, with one-to-one correspondence to sectors. - matrix mGet3Dtrks(settings_->numPhiSectors(), settings_->numEtaRegions()); + matrix mGet3Dtrks(settings_->numPhiSectors(), settings_->numEtaRegions()); //=== Initialization // Create utility for converting L1 tracks from our private format to official CMSSW EDM format. - const TMTT::ConverterToTTTrack converter(settings_); + const tmtt::ConverterToTTTrack converter(settings_); const DigiConverter digiConverter(settings_); const unsigned int nFitAlgs = trackFitters_.size(); @@ -161,17 +161,17 @@ namespace demo { cout << "============================ DIGI EVENT " << jEventCount << " =========================" << endl; jEventCount++; - map, ostringstream> thomasString; + map, ostringstream> thomasString; #endif - map> stubsInNonant; + map> stubsInNonant; uint numPhiSecPerNon = settings_->numPhiSectors() / settings_->numPhiNonants(); // Fill Hough-Transform arrays with stubs. for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { - TMTT::Sector& sector = mSectors(iPhiSec, iEtaReg); - TMTT::HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); + tmtt::Sector& sector = mSectors(iPhiSec, iEtaReg); + tmtt::HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); // Initialize constants for this sector. sector.init(settings_, iPhiSec, iEtaReg); @@ -179,12 +179,12 @@ namespace demo { // Check sector is enabled (always true, except if user disabled some for special studies). if (settings_->isHTRPhiEtaRegWhitelisted(iEtaReg)) { - for (const TMTT::Stub* stub : vStubs) { + for (const tmtt::Stub* stub : vStubs) { // Digitize stub as would be at input to GP. This doesn't need the nonant number, since we assumed an integer number of // phi digitisation bins inside an nonant. N.B. This changes the coordinates & bend stored in the stub. // The cast allows us to ignore the "const". - const_cast(stub)->digitizeForGPinput(iPhiSec); + const_cast(stub)->digitizeForGPinput(iPhiSec); // Check if stub is inside this sector bool inside = sector.inside(stub); @@ -193,7 +193,7 @@ namespace demo { const vector inEtaSubSecs = sector.insideEtaSubSecs(stub); // Digitize stub if as would be at input to HT, which slightly degrades its coord. & bend resolution, affecting the HT performance. - const_cast(stub)->digitizeForHTinput(iPhiSec); + const_cast(stub)->digitizeForHTinput(iPhiSec); // Store stub in Hough transform array for this sector, indicating its compatibility with eta subsectors with sector. htRphi.store(stub, inEtaSubSecs); @@ -201,7 +201,7 @@ namespace demo { unsigned int iPhiNonant = std::floor(iPhiSec / numPhiSecPerNon); unsigned int digiPhiSec = iPhiSec % numPhiSecPerNon; - set& stubsInThisNonant = stubsInNonant[iPhiNonant]; + set& stubsInThisNonant = stubsInNonant[iPhiNonant]; if (std::count(stubsInThisNonant.begin(), stubsInThisNonant.end(), stub) == 0) { stubsInNonant[iPhiSec / 2].insert(stub); @@ -225,7 +225,7 @@ namespace demo { } int mBinMin = (int(stub->min_qOverPt_bin()) - int(settings_->houghNbinsPt()) / 2) / 2; int mBinMax = (int(stub->max_qOverPt_bin()) - int(settings_->houghNbinsPt()) / 2) / 2; - thomasString[pair(iPhiNonant, stub)] + thomasString[pair(iPhiNonant, stub)] << "DIGI STUB: iNonant=" << digiDTCStub.routeId().processor() << " link=" << link << " IphiO=" << digiDTCStub.phiO() << " Iz=" << digiDTCStub.z() << " IrT=" << digiDTCStub.rT() << " modType=" << (unsigned int)(digiDTCStub.modType()) << " bend=" << int(digiDTCStub.bend()) @@ -236,7 +236,7 @@ namespace demo { #endif } #ifdef THOMAS - thomasString[pair(iPhiNonant, stub)] << " (" << digiPhiSec << "," + thomasString[pair(iPhiNonant, stub)] << " (" << digiPhiSec << "," << iEtaReg << ")"; #endif } @@ -259,7 +259,7 @@ namespace demo { // Multiplex outputs of several HT onto one pair of output opto-links. // This only affects tracking performance if option busySectorKill is enabled, so that tracks that // can't be sent down the link within the time-multiplexed period are killed. - TMTT::MuxHToutputs muxHT(settings_); + tmtt::MuxHToutputs muxHT(settings_); muxHT.exec(mHtRphis); } @@ -269,9 +269,9 @@ namespace demo { unsigned int iPhiSecInNonant = iPhiSec % numPhiSecPerNon; for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { - const TMTT::Sector& sector = mSectors(iPhiSec, iEtaReg); + const tmtt::Sector& sector = mSectors(iPhiSec, iEtaReg); - TMTT::Get3Dtracks& get3DtrkCoarse = mGet3Dtrks(iPhiSec, iEtaReg); + tmtt::Get3Dtracks& get3DtrkCoarse = mGet3Dtrks(iPhiSec, iEtaReg); // Initialize utility for making 3D tracks from 2D ones. get3DtrkCoarse.init(settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), sector.phiCentre()); @@ -279,8 +279,8 @@ namespace demo { get3DtrkCoarse.run(mHtRphis(iPhiSec, iEtaReg).trackCands2D()); // Loop over candidates in this phi/eta sector - for (const TMTT::L1track3D& trk : get3DtrkCoarse.trackCands3D(false)) { - auto lMTrk = const_cast(trk); + for (const tmtt::L1track3D& trk : get3DtrkCoarse.trackCands3D(false)) { + auto lMTrk = const_cast(trk); auto lChiPhi = lMTrk.getChiPhiDigi(); auto lChiZ = lMTrk.getChiZDigi(); const auto& lStubs = lMTrk.getStubs(); @@ -309,7 +309,7 @@ namespace demo { // Optionally, run 2nd stage mini HT -- WITHOUT TRUNCATION ??? if (settings_->miniHTstage()) { - TMTT::MiniHTstage miniHTstage(settings_); + tmtt::MiniHTstage miniHTstage(settings_); miniHTstage.exec(mHtRphis); } @@ -319,29 +319,29 @@ namespace demo { for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { // Get tracks found by r-phi HT. - const TMTT::HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); + const tmtt::HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); // Then create the 3D tracks, because only they know about chiZ and chiPhi - const TMTT::Sector& sector = mSectors(iPhiSec, iEtaReg); + const tmtt::Sector& sector = mSectors(iPhiSec, iEtaReg); - TMTT::Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); + tmtt::Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); // Initialize utility for making 3D tracks from 2D ones. get3Dtrk.init(settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), sector.phiCentre()); // Convert 2D tracks found by HT to 3D tracks (optionally by running r-z filters & duplicate track removal) get3Dtrk.run(htRphi.trackCands2D()); - const vector& vecTrk3D = get3Dtrk.trackCands3D(false); + const vector& vecTrk3D = get3Dtrk.trackCands3D(false); // Loop over the tracks - for (const TMTT::L1track3D& trk : vecTrk3D) { + for (const tmtt::L1track3D& trk : vecTrk3D) { int8_t cBin = trk.getCellLocationHT().second - settings_->houghNbinsPhi() / 2; int8_t mBin = trk.getCellLocationHT().first - settings_->houghNbinsPt() / 2; unsigned int iLink = trk.optoLinkID(); unsigned int iNonant = iPhiSec / numPhiSecPerNon; - for (const TMTT::Stub* stub : trk.getStubs()) { + for (const tmtt::Stub* stub : trk.getStubs()) { DigiHTMiniStub digiHTMiniStub = digiConverter.makeDigiHTMiniStub(*stub, // SectorID iPhiSecInNonant, @@ -356,40 +356,40 @@ namespace demo { } // Initialize the duplicate track removal algorithm that can optionally be run after the track fit. - TMTT::KillDupFitTrks killDupFitTrks; + tmtt::KillDupFitTrks killDupFitTrks; killDupFitTrks.init(settings_, settings_->dupTrkAlgFit()); //=== Do a helix fit to all the track candidates. - map> fittedTracks; + map> fittedTracks; // Initialize with empty vector in case no fitted tracks found. for (const string& fitterName : trackFitters_) { // Loop over fit algos. - fittedTracks[fitterName] = vector(); + fittedTracks[fitterName] = vector(); } for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { - const TMTT::Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); + const tmtt::Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); // Loop over all the fitting algorithms we are trying. for (const string& fitterName : trackFitters_) { // Get 3D track candidates found by Hough transform (plus optional r-z filters/duplicate removal) in this sector. - const vector& vecTrk3D = get3Dtrk.trackCands3D(false); + const vector& vecTrk3D = get3Dtrk.trackCands3D(false); // Fit all tracks in this sector - vector fittedTracksInSec; - for (const TMTT::L1track3D& trk : vecTrk3D) { + vector fittedTracksInSec; + for (const tmtt::L1track3D& trk : vecTrk3D) { // Ensure stubs assigned to this track is digitized with respect to the phi sector the track is in. if (settings_->enableDigitize()) { - const vector& stubsOnTrk = trk.getStubs(); - for (const TMTT::Stub* s : stubsOnTrk) { - (const_cast(s))->digitizeForHTinput(iPhiSec); + const vector& stubsOnTrk = trk.getStubs(); + for (const tmtt::Stub* s : stubsOnTrk) { + (const_cast(s))->digitizeForHTinput(iPhiSec); // Also digitize stub in way this specific track fitter uses it. - (const_cast(s))->digitizeForSForTFinput(fitterName); + (const_cast(s))->digitizeForSForTFinput(fitterName); } } - TMTT::L1fittedTrack fitTrack = fitterWorkerMap_[fitterName]->fit(trk); + tmtt::L1fittedTrack fitTrack = fitterWorkerMap_[fitterName]->fit(trk); if (fitTrack.accepted()) { // If fitter accepted track, then store it. // Optionally digitize fitted track, degrading slightly resolution. @@ -402,7 +402,7 @@ namespace demo { } // Save digi tracks with duplicates - for (const TMTT::L1fittedTrack& fitTrk : fittedTracksInSec) { + for (const tmtt::L1fittedTrack& fitTrk : fittedTracksInSec) { if (!settings_->enableDigitize() && "Digitization must be enabled to run the digi producer") { assert(0); } @@ -430,10 +430,10 @@ namespace demo { } ///allDigiKFTracks Run duplicate track removal on the fitted tracks if requested. - const vector filtFittedTracksInSec = killDupFitTrks.filter(fittedTracksInSec); + const vector filtFittedTracksInSec = killDupFitTrks.filter(fittedTracksInSec); // Store fitted tracks from entire tracker. - for (const TMTT::L1fittedTrack& fitTrk : filtFittedTracksInSec) { + for (const tmtt::L1fittedTrack& fitTrk : filtFittedTracksInSec) { fittedTracks[fitterName].push_back(fitTrk); // Convert these fitted tracks to EDM format for output (used for collaborative work outside TMTT group). TTTrack fitTTTrack = converter.makeTTTrack(fitTrk, iPhiSec, iEtaReg); @@ -461,22 +461,22 @@ namespace demo { unsigned int numHTtracks = 0; for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { - const TMTT::Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); + const tmtt::Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); numHTtracks += get3Dtrk.trackCands3D(false).size(); } } cout << "Number of tracks after HT = " << numHTtracks << endl; for (const auto& p : fittedTracks) { const string& fitName = p.first; - const vector& fittedTracks = p.second; + const vector& fittedTracks = p.second; cout << "Number of tracks after " << fitName << " track helix fit = " << fittedTracks.size() << endl; } } // Allow histogramming to plot undigitized variables. - for (const TMTT::Stub* stub : vStubs) { + for (const tmtt::Stub* stub : vStubs) { if (settings_->enableDigitize()) - (const_cast(stub))->setDigitizeWarningsOn(false); + (const_cast(stub))->setDigitizeWarningsOn(false); } // Fill histograms to monitor input data & tracking performance. @@ -493,7 +493,7 @@ namespace demo { void DigiProducer::endJob() { // Print stub window sizes that TMTT recommends CMS uses in FE chips. if (settings_->printStubWindows()) - TMTT::StubWindowSuggest::printResults(); + tmtt::StubWindowSuggest::printResults(); // Optional debug printout from track fitters at end of job. for (const string& fitterName : trackFitters_) { diff --git a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc index c42cad5a72f27..d1f2dcdee8803 100644 --- a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc +++ b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc @@ -31,7 +31,7 @@ using namespace std; using boost::numeric::ublas::matrix; -namespace TMTT { +namespace tmtt { TMTrackProducer::TMTrackProducer(const edm::ParameterSet& iConfig) : stubInputTag(consumes(iConfig.getParameter("stubInputTag"))), trackerGeometryInfo_() { @@ -377,4 +377,4 @@ namespace TMTT { DEFINE_FWK_MODULE(TMTrackProducer); -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h index 8ec99c292d7d3..d9c9927b9e3cb 100644 --- a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h +++ b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h @@ -1,5 +1,5 @@ -#ifndef __TMTRACKPRODUCER_H__ -#define __TMTRACKPRODUCER_H__ +#ifndef L1Trigger_TrackFindingTMTT_TMTrackProducer_h +#define L1Trigger_TrackFindingTMTT_TMTrackProducer_h #include "FWCore/Framework/interface/EDProducer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -19,7 +19,7 @@ using namespace std; -namespace TMTT { +namespace tmtt { class Settings; class Histos; @@ -56,6 +56,6 @@ namespace TMTT { TrackerGeometryInfo trackerGeometryInfo_; }; -} // namespace TMTT +} // namespace tmtt #endif diff --git a/L1Trigger/TrackFindingTMTT/src/ChiSquared4ParamsApprox.cc b/L1Trigger/TrackFindingTMTT/src/ChiSquared4ParamsApprox.cc index afc6fd96ab094..7ea929d3db2f5 100644 --- a/L1Trigger/TrackFindingTMTT/src/ChiSquared4ParamsApprox.cc +++ b/L1Trigger/TrackFindingTMTT/src/ChiSquared4ParamsApprox.cc @@ -1,6 +1,6 @@ #include "L1Trigger/TrackFindingTMTT/interface/ChiSquared4ParamsApprox.h" -namespace TMTT { +namespace tmtt { ChiSquared4ParamsApprox::ChiSquared4ParamsApprox(const Settings* settings, const uint nPar) : L1ChiSquared(settings, nPar) { @@ -218,4 +218,4 @@ namespace TMTT { return result; } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc b/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc index 08b800fd13365..def71b561ff19 100644 --- a/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc +++ b/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc @@ -4,7 +4,7 @@ //=== Convert our non-persistent L1track3D object (track candidate found by Hough transform prior to fit) //=== to the official persistent CMSSW EDM TTrack format. -namespace TMTT { +namespace tmtt { TTTrack ConverterToTTTrack::makeTTTrack(const L1track3D& trk, unsigned int iPhiSec, @@ -140,4 +140,4 @@ namespace TMTT { return track; } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/DeadModuleDB.cc b/L1Trigger/TrackFindingTMTT/src/DeadModuleDB.cc index 5cc26849b8ce8..cac393629fd32 100644 --- a/L1Trigger/TrackFindingTMTT/src/DeadModuleDB.cc +++ b/L1Trigger/TrackFindingTMTT/src/DeadModuleDB.cc @@ -4,7 +4,7 @@ //=== Does this stub lie in a dead region of the tracker? //=== This function is only invoked if cfg param DeadSimulate = True & used to kill stubs to emulate dead regions. -namespace TMTT { +namespace tmtt { bool DeadModuleDB::killStub(const Stub* stub) const { bool dead = false; @@ -62,4 +62,4 @@ namespace TMTT { } } -} // namespace TMTT \ No newline at end of file +} // namespace tmtt \ No newline at end of file diff --git a/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc b/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc index 75879dc5fd056..d579c0ca4471e 100644 --- a/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc +++ b/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc @@ -12,24 +12,24 @@ using namespace std; -namespace TMTT { +namespace tmtt { //--- Stub window sizes copied from L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py - std::vector DegradeBend::barrelCut_ = {0, 2.0, 2.0, 3.5, 4.5, 5.5, 6.5}; - std::vector > DegradeBend::ringCut_ = { + const std::vector DegradeBend::barrelCut_ = {0, 2.0, 2.0, 3.5, 4.5, 5.5, 6.5}; + const std::vector > DegradeBend::ringCut_ = { // EndcapCutSet {0}, - {0, 1, 1.5, 1.5, 2, 2, 2.5, 3, 3, 3.5, 4, 2.5, 3, 3.5, 4.5, 5.5}, - {0, 1, 1.5, 1.5, 2, 2, 2, 2.5, 3, 3, 3, 2, 3, 4, 5, 5.5}, - {0, 1.5, 1.5, 2, 2, 2.5, 2.5, 2.5, 3.5, 2.5, 5, 5.5, 6}, - {0, 1.0, 1.5, 1.5, 2, 2, 2, 2, 3, 3, 6, 6, 6.5}, - {0, 1.0, 1.5, 1.5, 1.5, 2, 2, 2, 3, 3, 6, 6, 6.5}}; - std::vector > DegradeBend::tiltedCut_ = { + {0, 1, 2.5, 2.5, 3, 2.5, 3, 3.5, 4, 4, 4.5, 3.5, 4, 4.5, 5, 5.5}, + {0, 0.5, 2.5, 2.5, 3, 2.5, 3, 3, 3.5, 3.5, 4, 3.5, 3.5, 4, 4.5, 5}, + {0, 1, 3, 3, 2.5, 3.5, 3.5, 3.5, 4, 3.5, 3.5, 4, 4.5}, + {0, 1, 2.5, 3, 2.5, 3.5, 3, 3, 3.5, 3.5, 3.5, 4, 4}, + {0, 0.5, 1.5, 3, 2.5, 3.5, 3, 3, 3.5, 4, 3.5, 4, 3.5}}; + const std::vector > DegradeBend::tiltedCut_ = { // TiltedBarrelCutSet {0}, - {0, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2., 2., 1.5, 1.5, 1., 1.}, - {0, 3., 3., 3., 3., 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2, 2}, - {0, 4.5, 4.5, 4, 4, 4, 4, 3.5, 3.5, 3.5, 3, 3, 3}}; - std::vector DegradeBend::barrelNTilt_ = {0., 12., 12., 12., 0., 0., 0.}; + {0, 3, 3, 2.5, 3, 3, 2.5, 2.5, 2, 1.5, 1.5, 1, 1}, + {0, 3.5, 3, 3, 3, 3, 2.5, 2.5, 3, 3, 2.5, 2.5, 2.5}, + {0, 4, 4, 4, 3.5, 3.5, 3.5, 3.5, 3, 3, 3, 3, 3}}; + const std::vector DegradeBend::barrelNTilt_ = {0., 12., 12., 12., 0., 0., 0.}; //--- Given the original bend, flag indicating if this is a PS or 2S module, & detector identifier, //--- this return the degraded stub bend, a boolean indicatng if stub bend was outside the assumed window @@ -106,7 +106,7 @@ namespace TMTT { int b = std::round(2 * bend); - if (abs(b) <= window) { + if ((unsigned int)(abs(b)) <= window) { reject = false; float degradedB; unsigned int numBends = 2 * window + 1; @@ -178,7 +178,7 @@ namespace TMTT { pair p(windowHalfStrips, psModule); // Map notes if this (window size, psModule) combination has already been checked. - static map, bool> checked; + static thread_local map, bool> checked; if (checked.find(p) == checked.end()) { bool wasDegraded = false; // Was any stub bend encoding required for this window size? @@ -228,4 +228,4 @@ namespace TMTT { } } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/DigitalStub.cc b/L1Trigger/TrackFindingTMTT/src/DigitalStub.cc index 90986e3e3b771..9aea553c839f3 100644 --- a/L1Trigger/TrackFindingTMTT/src/DigitalStub.cc +++ b/L1Trigger/TrackFindingTMTT/src/DigitalStub.cc @@ -3,7 +3,9 @@ #include "DataFormats/Math/interface/deltaPhi.h" -namespace TMTT { +#include + +namespace tmtt { //=== Simplified version of DigitalStub for use with KF in Hybrid tracking. @@ -443,7 +445,7 @@ namespace TMTT { float TD = phiO_ - phiO_orig_; float TE = bend_ - bend_orig_; - static unsigned int nErr = 0; + static std::atomic nErr = 0; const unsigned int maxErr = 20; // Print error message only this number of times. if (nErr < maxErr) { if (fabs(TA) > 0.001 || fabs(TB) > 0.3 || fabs(TC) > 0.25 || fabs(TD) > 0.005 || fabs(TE) > 0.01) { @@ -454,4 +456,4 @@ namespace TMTT { } } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/DigitalTrack.cc b/L1Trigger/TrackFindingTMTT/src/DigitalTrack.cc index 54910475eda94..9fa8693bcb0a2 100644 --- a/L1Trigger/TrackFindingTMTT/src/DigitalTrack.cc +++ b/L1Trigger/TrackFindingTMTT/src/DigitalTrack.cc @@ -5,7 +5,7 @@ #include -namespace TMTT { +namespace tmtt { //=== Note configuration parameters. @@ -335,7 +335,7 @@ namespace TMTT { float TF = chisquaredRphi_ - chisquaredRphi_orig_; float TG = chisquaredRz_ - chisquaredRz_orig_; - static map nErr; // Count precision errors from each fitter. + static thread_local map nErr; // Count precision errors from each fitter. if (nErr.find(fitterName_) == nErr.end()) nErr[fitterName_] = 0; // Initialize error count. const unsigned int maxErr = 20; // Print error message only this number of times. @@ -350,4 +350,4 @@ namespace TMTT { } } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/Get3Dtracks.cc b/L1Trigger/TrackFindingTMTT/src/Get3Dtracks.cc index e7dc3e1511b83..07d3ce3cfc420 100644 --- a/L1Trigger/TrackFindingTMTT/src/Get3Dtracks.cc +++ b/L1Trigger/TrackFindingTMTT/src/Get3Dtracks.cc @@ -7,7 +7,7 @@ using namespace std; -namespace TMTT { +namespace tmtt { class Settings; @@ -133,4 +133,4 @@ namespace TMTT { return assocRecoTrk; } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/HTbase.cc b/L1Trigger/TrackFindingTMTT/src/HTbase.cc index 34a3aae6d720d..32502e38635a6 100644 --- a/L1Trigger/TrackFindingTMTT/src/HTbase.cc +++ b/L1Trigger/TrackFindingTMTT/src/HTbase.cc @@ -9,7 +9,7 @@ using namespace std; -namespace TMTT { +namespace tmtt { //=== Termination. Causes HT array to search for tracks etc. @@ -256,4 +256,4 @@ namespace TMTT { return trackCands2D; } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/HTcell.cc b/L1Trigger/TrackFindingTMTT/src/HTcell.cc index a12bd6ca27da6..b77667af46bf2 100644 --- a/L1Trigger/TrackFindingTMTT/src/HTcell.cc +++ b/L1Trigger/TrackFindingTMTT/src/HTcell.cc @@ -2,7 +2,7 @@ #include "L1Trigger/TrackFindingTMTT/interface/TP.h" #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" -namespace TMTT { +namespace tmtt { //=== Initialization with cfg params, //=== rapidity range of current sector, and estimated q/Pt of cell, @@ -144,4 +144,4 @@ namespace TMTT { return filteredStubs; } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/HTrphi.cc b/L1Trigger/TrackFindingTMTT/src/HTrphi.cc index 4c261de8023df..5e9748b44d8ad 100644 --- a/L1Trigger/TrackFindingTMTT/src/HTrphi.cc +++ b/L1Trigger/TrackFindingTMTT/src/HTrphi.cc @@ -9,8 +9,9 @@ #include #include +#include -namespace TMTT { +namespace tmtt { //=== The r-phi Hough Transform array for a single (eta,phi) sector. //=== @@ -20,13 +21,13 @@ namespace TMTT { using namespace std; // Maximum |gradient| of line corresponding to any stub. Should be less than the value of 1.0 assumed by the firmware. - float HTrphi::maxLineGradient_ = 0.; + std::atomic HTrphi::maxLineGradient_ = 0.; // Error count when stub added to cell which does not lie NE, E or SE of stub added to previous HT column. - unsigned int HTrphi::numErrorsTypeA_ = 0; + std::atomic HTrphi::numErrorsTypeA_ = 0; // Error count when stub added to more than 2 cells in one HT column (problem only for Thomas' firmware). - unsigned int HTrphi::numErrorsTypeB_ = 0; + std::atomic HTrphi::numErrorsTypeB_ = 0; // Error count normalisation - unsigned int HTrphi::numErrorsNormalisation_ = 0; + std::atomic HTrphi::numErrorsNormalisation_ = 0; //=== Initialise @@ -85,7 +86,7 @@ namespace TMTT { // Note max. |gradient| that the line corresponding to any stub in any of the r-phi HT arrays could have. // Firmware assumes this should not exceed 1.0; - HTrphi::maxLineGradient_ = max(HTrphi::maxLineGradient_, this->calcMaxLineGradArray()); + HTrphi::maxLineGradient_ = max(HTrphi::maxLineGradient_.load(), this->calcMaxLineGradArray()); // Optionally merge 2x2 neighbouring cells into a single cell at low Pt, to reduce efficiency loss due to // scattering. (Do this if either of options EnableMerge2x2 or MiniHTstage are enabled. @@ -179,7 +180,7 @@ namespace TMTT { } } - static bool first = true; + static std::atomic first = true; if (first) { first = false; cout << "=== R-PHI HOUGH TRANSFORM AXES RANGES: abs(q/Pt) < " << maxAbsQoverPtAxis_ << " & abs(track-phi) < " @@ -421,8 +422,8 @@ namespace TMTT { //=== Check that limitations of firmware would not prevent stub being stored correctly in this HT column. void HTrphi::countFirmwareErrors(unsigned int iQoverPtBin, unsigned int iPhiTrkBinMin, unsigned int iPhiTrkBinMax) { - static unsigned int iPhiTrkBinMinLast = 0; - static unsigned int iPhiTrkBinMaxLast = 99999; + static std::atomic iPhiTrkBinMinLast = 0; + static std::atomic iPhiTrkBinMaxLast = 99999; // Reinitialize if this is left-most column in HT array. if (iQoverPtBin == 0) { iPhiTrkBinMinLast = 0; @@ -738,4 +739,4 @@ namespace TMTT { return iOrder; } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/Histos.cc b/L1Trigger/TrackFindingTMTT/src/Histos.cc index cf7718bffb8bc..8faa5b209886b 100644 --- a/L1Trigger/TrackFindingTMTT/src/Histos.cc +++ b/L1Trigger/TrackFindingTMTT/src/Histos.cc @@ -24,10 +24,11 @@ #include #include #include +#include using namespace std; -namespace TMTT { +namespace tmtt { //=== Store cfg parameters. @@ -1538,7 +1539,7 @@ namespace TMTT { // Plot number of tracks & number of stubs per output HT opto-link. if (TMTT && not withRZfilter) { - static bool firstMess = true; + static std::atomic firstMess = true; const unsigned int numPhiSecPerNon = numPhiSectors_ / numPhiNonants; // Hard-wired bodge const unsigned int nLinks = houghNbinsPt_ / 2; // Hard-wired to number of course HT bins. Check. @@ -3967,4 +3968,4 @@ namespace TMTT { } } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/InputData.cc b/L1Trigger/TrackFindingTMTT/src/InputData.cc index 39283e8a10a1f..89f7dfb67bcc4 100644 --- a/L1Trigger/TrackFindingTMTT/src/InputData.cc +++ b/L1Trigger/TrackFindingTMTT/src/InputData.cc @@ -27,7 +27,7 @@ using namespace std; -namespace TMTT { +namespace tmtt { InputData::InputData(const edm::Event& iEvent, const edm::EventSetup& iSetup, @@ -147,4 +147,4 @@ namespace TMTT { } } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc b/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc index 8bc760b5c6693..4a7a34f124add 100644 --- a/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc +++ b/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc @@ -6,17 +6,17 @@ #include "DataFormats/Math/interface/deltaPhi.h" //#define CKF_DEBUG -namespace TMTT { +namespace tmtt { /* // Scattering constants - HISTORIC NOT USED. -static unsigned nlayer_eta[25] = +constexpr unsigned nlayer_eta[25] = { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6}; -static double matx_outer[25] = { +constexpr double matx_outer[25] = { 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.26, 0.22, 0.26, 0.38, 0.41, 0.40, 0.44, 0.50, 0.54, @@ -24,7 +24,7 @@ static double matx_outer[25] = { 0.50, 0.48, 0.64, 0.39, 0.20 }; -static double matx_inner[25] = { +constexpr double matx_inner[25] = { 0.14, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.12, 0.1, 0.1, 0.1, 0.15, @@ -462,4 +462,4 @@ static double matx_inner[25] = { return goodState; } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/KFTrackletTrack.cc b/L1Trigger/TrackFindingTMTT/src/KFTrackletTrack.cc index b71e3b8bfae3b..83f4cf0448d1d 100644 --- a/L1Trigger/TrackFindingTMTT/src/KFTrackletTrack.cc +++ b/L1Trigger/TrackFindingTMTT/src/KFTrackletTrack.cc @@ -1,6 +1,6 @@ #include "L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h" -namespace TMTT { +namespace tmtt { // Digitize track and degrade helix parameter resolution according to effect of digitisation. diff --git a/L1Trigger/TrackFindingTMTT/src/KalmanState.cc b/L1Trigger/TrackFindingTMTT/src/KalmanState.cc index 2111ace1f9599..dfa43948fa084 100644 --- a/L1Trigger/TrackFindingTMTT/src/KalmanState.cc +++ b/L1Trigger/TrackFindingTMTT/src/KalmanState.cc @@ -2,7 +2,7 @@ #include "L1Trigger/TrackFindingTMTT/interface/StubCluster.h" #include -namespace TMTT { +namespace tmtt { KalmanState::KalmanState() : kLayerNext_(0), @@ -272,4 +272,4 @@ namespace TMTT { } } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/KillDupFitTrks.cc b/L1Trigger/TrackFindingTMTT/src/KillDupFitTrks.cc index 761422d88b086..4d815ac50d0bd 100644 --- a/L1Trigger/TrackFindingTMTT/src/KillDupFitTrks.cc +++ b/L1Trigger/TrackFindingTMTT/src/KillDupFitTrks.cc @@ -3,7 +3,7 @@ #include "FWCore/Utilities/interface/Exception.h" #include -namespace TMTT { +namespace tmtt { //=== Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. @@ -122,8 +122,8 @@ namespace TMTT { } else { if (limitDiff) { const unsigned int maxDiff = 1; - if (abs(int(trk.getCellLocationHT().first) - int(trk.getCellLocationFit().first)) <= maxDiff && - abs(int(trk.getCellLocationHT().second) - int(trk.getCellLocationFit().second)) <= maxDiff) + if (abs(int(trk.getCellLocationHT().first) - int(trk.getCellLocationFit().first)) <= int(maxDiff) && + abs(int(trk.getCellLocationHT().second) - int(trk.getCellLocationFit().second)) <= int(maxDiff)) tracksRejected.push_back(&trk); } else { tracksRejected.push_back(&trk); @@ -272,4 +272,4 @@ namespace TMTT { cout << "FOUND " << tracks.size() << endl; } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/L1ChiSquared.cc b/L1Trigger/TrackFindingTMTT/src/L1ChiSquared.cc index b2bb613752478..19599064191cf 100644 --- a/L1Trigger/TrackFindingTMTT/src/L1ChiSquared.cc +++ b/L1Trigger/TrackFindingTMTT/src/L1ChiSquared.cc @@ -13,7 +13,7 @@ #include #include -namespace TMTT { +namespace tmtt { template std::vector operator-(const std::vector& a, const std::vector& b) { @@ -180,4 +180,4 @@ namespace TMTT { } } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc b/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc index f5010e3d59ccd..fd4b641325f2d 100644 --- a/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc +++ b/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc @@ -6,6 +6,7 @@ #include "L1Trigger/TrackFindingTMTT/interface/Utility.h" #include +#include #include "L1Trigger/TrackFindingTMTT/interface/TP.h" #include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" #include "L1Trigger/TrackFindingTMTT/interface/StubCluster.h" @@ -17,7 +18,7 @@ #include #include #include -#include +#include //#define CKF_DEBUG // Enable debug printout to pair with that in Histos.cc enabled by recalc_debug. //#define RECALC_DEBUG @@ -25,7 +26,7 @@ // Enable merging of nearby stubs. //#define MERGE_STUBS -namespace TMTT { +namespace tmtt { unsigned LayerId[16] = {1, 2, 3, 4, 5, 6, 11, 12, 13, 14, 15, 21, 22, 23, 24, 25}; @@ -177,7 +178,7 @@ namespace TMTT { // In cases where identical GP encoded layer ID present in this sector from both barrel & endcap, this array filled considering barrel. The endcap is fixed by subsequent code. - static const unsigned layerMap[nEta / 2][nGPlayID + 1] = { + constexpr unsigned layerMap[nEta / 2][nGPlayID + 1] = { {7, 0, 1, 5, 4, 3, 7, 2}, // B1 B2 B3 B4 B5 B6 {7, 0, 1, 5, 4, 3, 7, 2}, // B1 B2 B3 B4 B5 B6 {7, 0, 1, 5, 4, 3, 7, 2}, // B1 B2 B3 B4 B5 B6 @@ -270,7 +271,7 @@ namespace TMTT { /* const unsigned int nEta = 16; const unsigned int nKFlayer = 7; - static const bool ambiguityMap[nEta/2][nKFlayer] = + constexpr bool ambiguityMap[nEta/2][nKFlayer] = { {false, false, false, false, false, false, false}, {false, false, false, false, false, false, false}, @@ -363,7 +364,7 @@ namespace TMTT { tpa_ = tpa; //dump flag - static unsigned nthFit(0); + static std::atomic nthFit(0); nthFit++; if (getSettings()->kalmanDebugLevel() >= 3 && nthFit <= maxNfitForDump_) { if (tpa) @@ -484,7 +485,7 @@ namespace TMTT { if (getSettings()->kalmanFillInternalHists()) { if (tpa && tpa->useForAlgEff()) { hTrackEta_->Fill(tpa->eta()); - static set set_tp; + static thread_local set set_tp; if (iCurrentPhiSec_ < iLastPhiSec_ && iCurrentEtaReg_ < iLastEtaReg_) set_tp.clear(); if (set_tp.find(tpa) == set_tp.end()) { @@ -1134,7 +1135,7 @@ namespace TMTT { if (getSettings()->kalmanDebugLevel() >= 4) { cout << "calcChi2 " << endl; } - double deltaChi2rphi(0), deltaChi2rz; + double deltaChi2rphi(0), deltaChi2rz(0); if (state.last_state()) { const StubCluster *stubCluster = state.stubCluster(); @@ -1695,17 +1696,17 @@ namespace TMTT { } double L1KalmanComb::DeltaRphiForClustering(unsigned layerId, unsigned endcapRing) { - static double barrel_drphi[6] = {0.05, 0.04, 0.05, 0.12, 0.13, 0.19}; + constexpr double barrel_drphi[6] = {0.05, 0.04, 0.05, 0.12, 0.13, 0.19}; if (layerId < 10) return barrel_drphi[layerId - 1]; - static double ec_drphi[16] = { + constexpr double ec_drphi[16] = { 0.04, 0.05, 0.04, 0.06, 0.06, 0.04, 0.06, 0.07, 0.15, 0.08, 0.27, 0.08, 0.27, 0.12, 0.09}; return ec_drphi[endcapRing - 1]; }; double L1KalmanComb::DeltaRForClustering(unsigned endcapRing) { - static double ec_dr[16] = { + constexpr double ec_dr[16] = { 0.52, 0.56, 0.59, 0.86, 0.66, 0.47, 0.55, 0.72, 1.53, 1.10, 2.72, 0.91, 2.69, 0.67, 0.09}; return ec_dr[endcapRing - 1]; } @@ -1825,4 +1826,4 @@ namespace TMTT { return getSettings()->bApprox_gradient() * fabs(z) / r + getSettings()->bApprox_intercept(); } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc.beamConstraint b/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc.beamConstraint deleted file mode 100644 index bce05f6468b71..0000000000000 --- a/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc.beamConstraint +++ /dev/null @@ -1,1452 +0,0 @@ -///=== This is the base class for the Kalman Combinatorial Filter track fit algorithm. - -///=== Written by: S. Summers, K. Uchida, M. Pesaresi - -#include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" -#include "L1Trigger/TrackFindingTMTT/interface/Utility.h" - -#include -#include "L1Trigger/TrackFindingTMTT/interface/TP.h" -#include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" -#include "L1Trigger/TrackFindingTMTT/interface/StubCluster.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "CommonTools/UtilAlgos/interface/TFileService.h" - -#include -#include -#include -#include -#include -//#define CKF_DEBUG - -namespace TMTT { - -unsigned LayerId[16] = { 1, 2, 3, 4, 5, 6, 11, 12, 13, 14, 15, 21, 22, 23, 24, 25 }; - - -static double wrapRadian( double t ){ - - if( t > 0 ){ - while( t > M_PI ) t-= 2*M_PI; - } - else{ - while( t < - M_PI ) t+= 2*M_PI; - } - return t; -} - -static bool orderStubsByLayer(const Stub* a, const Stub* b){ - return (a->layerId() < b->layerId()); -} - -static bool orderStubsByZ(const Stub* a, const Stub* b){ - return (a->z() < b->z()); -} - -static bool orderStubsByR(const Stub* a, const Stub* b){ - return (a->r() < b->r()); -} - -void printTPSummary( std::ostream &os, const TP *tp, bool addReturn=true ){ - - if( tp ){ - - os << "TP "; - // os << "addr=" << tp << " "; - os << "index=" << tp->index() << " "; - os << "qOverPt=" << tp->qOverPt() << " "; - os << "phi0=" << tp->phi0() << " "; - os << "z0=" << tp->z0() << " "; - os << "t=" << tp->tanLambda() << " "; - os << "d0=" << tp->d0(); - if( addReturn ) os << endl; - else os << " | "; - } -} - -void L1KalmanComb::printTP( std::ostream &os, const TP *tp )const{ - - std::map tp_x; - bool useForAlgEff(false); - if( tp ){ - useForAlgEff = tp->useForAlgEff(); - tp_x["qOverPt"] = tp->qOverPt(); - tp_x["phi0"] = tp->phi0(); - tp_x["z0"] = tp->z0(); - tp_x["t"] = tp->tanLambda(); - tp_x["d0"] = tp->d0(); - } - if( tp ){ - os << "\tTP index = " << tp->index() << " useForAlgEff = " << useForAlgEff << " "; - os << "\tpT, eta = " << tp->pt() << ", " << tp->eta() << " "; - os << "\tqOver2R0 = " << tp->qOverPt() * getSettings()->invPtToInvR() * 0.5 << " "; - for( auto pair : tp_x ){ - os << pair.first << ":" << pair.second << ", "; - } - } - else{ - os << "\tTP index = "; - } - os << endl; -} - -static void printStubLayers( std::ostream &os, std::vector &stubs ){ - - if( stubs.size() == 0 ) os << "stub layers = []" << endl; - else{ - os << "stub layers = [ "; - for( unsigned i=0; ilayerId() << ", "; - os << stubs.back()->layerId() << " ]" << endl; - } -} - -static void printStubCluster( std::ostream &os, const StubCluster * stubCluster, bool addReturn=true ){ - os << "stub cluster "; - // os << "addr=" << stub << " "; - os << "layerId=" << stubCluster->layerId() << " "; - os << "endcapRing=" << stubCluster->endcapRing() << " "; - os << "# of stubs= " << stubCluster->nStubs() << " "; - os << "r=" << stubCluster->r() << " "; - os << "phi=" << stubCluster->phi() << " "; - os << "z=" << stubCluster->z() << " "; - os << "sigmaX=" << stubCluster->sigmaX() << " "; - os << "sigmaZ=" << stubCluster->sigmaZ() << " "; - os << "dphi_dr=" << stubCluster->dphi_dr() << " "; - os << "TPids="; - std::set tps = stubCluster->assocTPs(); - for( auto tp : tps ) os << tp->index() << ","; - if( addReturn ) os << endl; - else os << " | "; - -} - -static void printStubClusters( std::ostream &os, std::vector &stubClusters ){ - - for( auto &stubcl : stubClusters ){ - printStubCluster( os, stubcl ); - } -} -static void printStub( std::ostream &os, const Stub * stub, bool addReturn=true ){ - os << "stub "; - // os << "addr=" << stub << " "; - os << "index=" << stub->index() << " "; - os << "layerId=" << stub->layerId() << " "; - os << "endcapRing=" << stub->endcapRing() << " "; - os << "r=" << stub->r() << " "; - os << "phi=" << stub->phi() << " "; - os << "z=" << stub->z() << " "; - os << "sigmaX=" << stub->sigmaX() << " "; - os << "sigmaZ=" << stub->sigmaZ() << " "; - os << "TPids="; - std::set tps = stub->assocTPs(); - for( auto tp : tps ) os << tp->index() << ","; - if( addReturn ) os << endl; - else os << " | "; - -} - -static void printStubs( std::ostream &os, std::vector &stubs ){ - - for( auto &stub : stubs ){ - printStub( os, stub ); - } -} - - - - -L1KalmanComb::L1KalmanComb(const Settings* settings, const uint nPar, const string &fitterName, const uint nMeas ) : TrackFitGeneric(settings, fitterName ){ - nPar_ = nPar; - nMeas_ = nMeas; - hymin = vector( nPar_, -1 ); - hymax = vector( nPar_, 1 ); - hymin[0] = -0.05; - hymax[0] = +0.05; - hymin[1] = -3.2; - hymax[1] = +3.2; - hymin[2] = -20; - hymax[2] = +20; - hymin[3] = -6; - hymax[3] = +6; - if (nPar_ == 5) { - hymin[4] = -5; - hymax[4] = +5; - } - - hxmin = vector( nPar_, -1 ); - hxmax = vector( nPar_, 1 ); - - hddMeasmin = vector( 2, -1e-3 ); - hddMeasmax = vector( 2, 1e-3 ); - - hresmin = vector( 2, -1e-2 ); - hresmax = vector( 2, 1e-2 ); - - hxaxtmin = vector( nPar_, -1 ); - hxaxtmax = vector( nPar_, 1 ); - - hdxmin = vector( nPar_, -1 ); - hdxmax = vector( nPar_, 1 ); - - hchi2min = 0; - hchi2max = 50; - - maxNfitForDump_ = 10; - dump_ = false; - - iLastPhiSec_ = 999; - iLastEtaReg_ = 999; -} - - -L1fittedTrack L1KalmanComb::fit(const L1track3D& l1track3D, unsigned int iPhiSec, unsigned int iEtaReg){ - - iLastPhiSec_ = iCurrentPhiSec_; - iLastEtaReg_ = iCurrentEtaReg_; - iCurrentPhiSec_ = iPhiSec; - iCurrentEtaReg_ = iEtaReg; - resetStates(); - deleteStubClusters(); - - // Get cut on number of layers including variation due to dead sectors, pt dependence etc. - minStubLayersRed_ = Utility::numLayerCut("FIT", getSettings(), iPhiSec, iEtaReg, fabs(l1track3D.qOverPt()), l1track3D.eta()); - - //TP - const TP* tpa(0); - if( l1track3D.getMatchedTP() ){ - tpa = l1track3D.getMatchedTP(); - } - - //dump flag - static unsigned nthFit(0); - nthFit++; - if( getSettings()->kalmanDebugLevel() > 2 && nthFit <= maxNfitForDump_ ){ - if( tpa ) dump_ = true; - else dump_ = false; - } - else dump_ = false; - - //stub list from L1track3D, sorted in layer order - necessary for clustering only - std::vector stubs = l1track3D.getStubs(); - - sort(stubs.begin(), stubs.end(), orderStubsByLayer); // Unnecessary? - - // Eliminate identical duplicate stubs. - for(unsigned i=0; i < stubs.size(); i++ ){ - const Stub *stub_a = stubs.at(i); - for(unsigned j=i+1; j < stubs.size(); j++ ){ - const Stub *stub_b = stubs.at(j); - if( stub_a->r() == stub_b->r() && stub_a->phi() == stub_b->phi() && stub_a->z() == stub_b->z() ){ - stubs.erase( stubs.begin() + j ); - if( getSettings()->kalmanFillInternalHists() ) - hndupStub_->Fill(1); - j--; - } - } - } - - std::vector stubcls; - - for( unsigned j_layer=0; j_layer < 16; j_layer++ ){ - - std::vector layer_stubs; - for(unsigned i=0; i < stubs.size(); i++ ){ - const Stub *stub = stubs.at(i); - if( stub->layerId() == LayerId[j_layer] ){ - layer_stubs.push_back( stub ); - } - } - - if( LayerId[j_layer] < 10 ) - sort( layer_stubs.begin(), layer_stubs.end(), orderStubsByZ ); // barrel - else - sort( layer_stubs.begin(), layer_stubs.end(), orderStubsByR ); // endcap - - for(unsigned i=0; i < layer_stubs.size(); i++ ){ // Stubs in single layer, ordered by z or r. - - std::vector stubs_for_cls; - stubs_for_cls.push_back(layer_stubs.at(i)); - - // disable clustering - each stub is its own cluster - /* - while( layer_stubs.at(i) != layer_stubs.back() ){ - if( isOverlap( layer_stubs.at(i), layer_stubs.at(i+1), TYPE_NORMAL ) ){ - stubs_for_cls.push_back( layer_stubs.at(i+1) ); - if( getSettings()->kalmanFillInternalHists() ) - hnmergeStub_->Fill(0); - i++; - } - else break; - } - */ - if( getSettings()->kalmanFillInternalHists() ) { - - if( tpa && tpa->useForAlgEff() ){ - - if( stubs_for_cls.size() > 1 ){ - - std::set s_tps = stubs_for_cls.at(0)->assocTPs(); - if( s_tps.find( tpa ) != s_tps.end() ){ - - const Stub *sa = stubs_for_cls.front(); - const Stub *sb = stubs_for_cls.back(); - - double drphi = fabs( sa->r() * wrapRadian( sa->phi() - sectorPhi() ) - sb->r() * wrapRadian( sb->phi() - sectorPhi() ) ); - double dz = fabs( sa->z() - sb->z() ); - double dr = fabs( sa->r() - sb->r() ); - TString hname; - if( LayerId[j_layer] < 10 ){ - - hname = Form( "hBarrelStubMaxDistanceLayer%02d", LayerId[j_layer] ); - - if( hBarrelStubMaxDistanceMap.find( hname ) == hBarrelStubMaxDistanceMap.end() ){ - cout << hname << " does not exist." << endl; - } - else{ - hBarrelStubMaxDistanceMap[hname]->Fill( drphi, dz ); - } - } - else{ - hname = Form( "hEndcapStubMaxDistanceRing%02d", sa->endcapRing() ); - - if( hEndcapStubMaxDistanceMap.find( hname ) == hEndcapStubMaxDistanceMap.end() ){ - cout << hname << " does not exist." << endl; - } - else{ - hEndcapStubMaxDistanceMap[hname]->Fill( drphi, dr ); - } - } - } - } - } - } - - // dl error now disabled - StubCluster *stbcl = new StubCluster( stubs_for_cls, sectorPhi(), 0 ); - stbcl_list_.push_back( stbcl ); - stubcls.push_back( stbcl ); - - if( getSettings()->kalmanFillInternalHists() ) { - if( !stbcl->barrel() ){ - TString hname = Form( "hphiErrorRatioRing%d", stbcl->endcapRing() ); - if( hphiErrorRatioMap.find(hname) == hphiErrorRatioMap.end() ){ - cout << hname << " does not exist." << endl; - } - else{ - hphiErrorRatioMap[hname]->Fill( fabs( stbcl->deltai() + 0.5 ), fabs( stbcl->dphi_dr() ) / stbcl->dphi_dl() ); - } - } - } - } - } - if( getSettings()->kalmanFillInternalHists() ){ - if( tpa && tpa->useForAlgEff() ){ - hTrackEta_->Fill( tpa->eta() ); - static set set_tp; - if( iCurrentPhiSec_ < iLastPhiSec_ && iCurrentEtaReg_ < iLastEtaReg_ ) set_tp.clear(); - if( set_tp.find( tpa ) == set_tp.end() ){ - hUniqueTrackEta_->Fill( tpa->eta() ); - } - set_tp.insert( tpa ); - } - } - - - //track information dump - if( getSettings()->kalmanDebugLevel() >= 1 ){ - - std::cout << "===============================================================================" << endl; - std::cout << "Track Finding candidate in [phi_sec, eta_reg] = [" << iPhiSec << ", " << iEtaReg << "]" << std::endl; - printTP( cout, tpa ); - printStubLayers( cout, stubs ); - printStubClusters( cout, stubcls ); - - } - - - - // debug for Mark - bool goodTrack = false; - if( tpa && tpa->useForAlgEff() ) { - if (l1track3D.getNumMatchedLayers()>=4) goodTrack=true; - } - - - //Kalman Filter - std::vector cands = doKF( l1track3D, stubcls, tpa ); - - - - //return L1fittedTrk for the selected state. - if( cands.size() ) { - - const KalmanState *cand = cands[0]; - - std::map tp = getTrackParams(cand); - - // IRT - beam spot constraint - float deltaChi2 = 0. ; - if (nPar_ == 5) { - TMatrixD cov_xa = cand->pxxa(); - deltaChi2 = tp["d0"]*tp["d0"] / cov_xa[4][4]; - tp["qOverPt"] -= tp["d0"] * (cov_xa[0][4] / cov_xa[4][4]); - tp["phi0"] -= tp["d0"] * (cov_xa[1][4] / cov_xa[4][4]); - tp["d0"] = 0.0; - } else { - deltaChi2 = 0.0; - } - - L1fittedTrack returnTrk(getSettings(), l1track3D, cand->stubs(), tp["qOverPt"], tp["d0"], tp["phi0"], tp["z0"], tp["t"], cand->chi2() + deltaChi2, nPar_, iPhiSec, iEtaReg, true); - - //L1fittedTrack returnTrk(getSettings(), l1track3D, cand->stubs(), tp["qOverPt"], tp["d0"], tp["phi0"], tp["z0"], tp["t"], cand->chi2(), nPar_, iPhiSec, iEtaReg, true); - - // for Tom - fitted track params must lie in same sector as HT originally found track in. - if (!returnTrk.consistentSector()) { - - L1fittedTrack failedTrk(getSettings(), l1track3D, cand->stubs(), tp["qOverPt"], tp["d0"], tp["phi0"], tp["z0"], tp["t"], cand->chi2(), nPar_, iPhiSec, iEtaReg, false); - return failedTrk; - } - - //candidate dump - if( getSettings()->kalmanDebugLevel() >= 1 ){ - - cout << "------------------------------------" << endl; - if( tpa && tpa->useForAlgEff() ){ - cout << "TP for eff. addr. index : " << tpa << " " << tpa->index() << endl; - } - cout << "Candidate : " << endl; - if( tpa && tpa->useForAlgEff() && returnTrk.getPurity() != 1 ){ - cout << "The candidate is not pure" << endl; - } - cand->dump( cout, tpa, true ); - cout << "------------------------------------" << endl; - } - - //fill histograms for the selected state with TP for algEff - if( getSettings()->kalmanFillInternalHists() ) fillCandHists( *cand, tpa ); - - return returnTrk; - - } else { - - if(goodTrack) { - - /* - int tpin=0; - if(l1track3D.getMatchedTP()) tpin=l1track3D.getMatchedTP()->index(); - - cout<r()<<" "<z()< stubs = stubCluster->stubs(); - for( auto stub : stubs ){ - for (const TP* tp_i : stub->assocTPs()) { - cout<index()<assocTPs().size()==0) cout<<"no associated TP"< tp = getTrackParams(state); - //L1fittedTrack returnTrk(getSettings(), l1track3D, state->stubs(), tp["qOverPt"], tp["d0"], tp["phi0"], tp["z0"], tp["t"], state->chi2(), nPar_, iPhiSec, iEtaReg, true); - - - std::vector sstubs = state->stubs(); - for( auto stub : sstubs ){ - - for (const TP* tp_i : stub->assocTPs()) { - cout<index()<r()<<" "<z()<<" "<nStubLayers()<kalmanDebugLevel() >= 1 ){ - if( tpa && tpa->useForAlgEff() ){ - cout << "TP for eff. missed addr. index : " << tpa << " " << tpa->index() << endl; - printStubClusters( cout, stubcls ); - printStubs( cout, stubs ); - } - } - - - L1fittedTrack returnTrk(getSettings(), l1track3D, l1track3D.getStubs(), l1track3D.qOverPt(), 0, l1track3D.phi0(), l1track3D.z0(), l1track3D.tanLambda(), 9999, nPar_, iPhiSec, iEtaReg, false); - return returnTrk; - } - -} - - -std::vector L1KalmanComb::doKF( const L1track3D& l1track3D, const std::vector &stubClusters, const TP *tpa ){ - - // output container - std::vector finished_states; - - // seed helix params & their covariance. - std::vector x0 = seedx(l1track3D); - TMatrixD pxx0 = seedP(l1track3D); - TMatrixD K( nPar_, 2 ); - TMatrixD dcov( 2, 2 ); - - const KalmanState *state0 = mkState( l1track3D, 0, 0, 0, 0, x0, pxx0, K, dcov, 0, 0 ); - - if( getSettings()->kalmanFillInternalHists() ) fillSeedHists( state0, tpa ); - - - // internal containers - i.e. the state FIFO. Contains estimate of helix params in last/next layer, with multiple entries if there were multiple stubs, yielding multiple states. - std::vector new_states; - std::vector prev_states; - prev_states.push_back( state0 ); - - - // === Layer Mapping (i.e. layer order in which stubs should be processed) === - - // index across is ian encoded layer id (where barrel layers=1,2,6,5,4,3 & endcap wheels=3,4,5,6,7 & 0 never occurs) - // index down is eta reg - // element is kalman layer where 7 is invalid - // assumes we are in barrel, endcap adjustments later - // should really be defined once in constructor - - unsigned layerMap[18][8] = - { - { 7, 0, 7, 1, 2, 3, 4, 5 }, - { 7, 0, 7, 1, 2, 3, 4, 5 }, - { 7, 0, 1, 2, 3, 4, 5, 5 }, - { 7, 0, 1, 2, 3, 4, 5, 2 }, - { 7, 0, 1, 3, 4, 3, 6, 2 }, - { 7, 0, 1, 5, 4, 3, 7, 2 }, - { 7, 0, 1, 5, 4, 3, 7, 2 }, - { 7, 0, 1, 5, 4, 3, 7, 2 }, - { 7, 0, 1, 5, 4, 3, 7, 2 }, - { 7, 0, 1, 5, 4, 3, 7, 2 }, - { 7, 0, 1, 5, 4, 3, 7, 2 }, - { 7, 0, 1, 5, 4, 3, 7, 2 }, - { 7, 0, 1, 5, 4, 3, 7, 2 }, - { 7, 0, 1, 3, 4, 3, 6, 2 }, - { 7, 0, 1, 2, 3, 4, 5, 2 }, - { 7, 0, 1, 2, 3, 4, 5, 5 }, - { 7, 0, 7, 1, 2, 3, 4, 5 }, - { 7, 0, 7, 1, 2, 3, 4, 5 }, - }; - - - - // arrange stubs into Kalman layers according to eta region - int etaReg = l1track3D.iEtaReg(); - std::map > layerStubs; - - - for( auto stubCluster : stubClusters ){ - - int kalmanLayer = layerMap[etaReg][stubCluster->layerIdReduced()]; - - if ( !stubCluster->barrel() ) { - - switch ( etaReg ) { - case 3: - case 14: - if (stubCluster->layerIdReduced()==7) kalmanLayer = 6; - break; - case 4: - case 13: - if (stubCluster->layerIdReduced()==5) kalmanLayer = 5; - break; - case 5: - case 12: - if (stubCluster->layerIdReduced()==4) kalmanLayer = 5; - break; - default: - break; - } - - } - - layerStubs[kalmanLayer].push_back( stubCluster ); - - } - - - - // iterate using state->nextLayer() to determine next Kalman layer(s) to add stubs from - for( unsigned iteration = 0; iteration < 6; iteration++ ){ - - int combinations_per_iteration = 0; - - // should be a defined in constructor/settings - unsigned int maxSkippedLayers = 2; - - - // update each state from previous iteration (or seed) using stubs in next Kalman layer - std::vector::const_iterator i_state = prev_states.begin(); - for(; i_state != prev_states.end(); i_state++ ){ - - - const KalmanState *the_state = *i_state; - - - unsigned layer = the_state->nextLayer(); - unsigned skipped = the_state->nSkippedLayers(); - - - // containers for updated state+stub combinations - std::vector next_states; - std::vector next_states_skipped; - - - // find stubs for this layer - std::vector stubs = layerStubs[layer]; - - - // find stubs for next layer if we skip a layer, except when we are on the penultimate layer, - // or we have exceeded the max skipped layers - std::vector next_stubs ; - if ( (layer<5) && (skipped temp_stubs; - std::vector temp_nextstubs; - for (auto stub : stubs) { - if (stub->r()<60.0) temp_stubs.push_back(stub); - } - for (auto stub : next_stubs) { - if (stub->r()<60.0) temp_nextstubs.push_back(stub); - } - stubs = temp_stubs; - next_stubs = temp_nextstubs; - } - - - combinations_per_iteration += stubs.size() + next_stubs.size(); - - - // loop over each stub in this layer and check for compatibility with this state - for( unsigned i=0; i < stubs.size() ; i++ ){ - - const StubCluster * next_stubCluster = stubs[i]; - - // Update helix params by adding this stub. - const KalmanState * new_state = kalmanUpdate( skipped, layer+1, next_stubCluster, *the_state, tpa ); - - if( getSettings()->kalmanFillInternalHists() ) fillStepHists( tpa, iteration, new_state ); - - // Cut on track chi2, pt etc. - if(isGoodState( *new_state ) ) next_states.push_back( new_state ); - - } - - // loop over each stub in next layer if we skip, and check for compatibility with this state - for( unsigned i=0; i < next_stubs.size() ; i++ ){ - - const StubCluster * next_stubCluster = next_stubs[i]; - - const KalmanState * new_state = kalmanUpdate( skipped+1, layer+2, next_stubCluster, *the_state, tpa ); - - if( getSettings()->kalmanFillInternalHists() ) fillStepHists( tpa, iteration, new_state ); - - if(isGoodState( *new_state ) ) next_states_skipped.push_back( new_state ); - - } - - - // post Kalman filter local sorting per state - sort( next_states.begin(), next_states.end(), KalmanState::orderChi2); - sort( next_states_skipped.begin(), next_states_skipped.end(), KalmanState::orderChi2); - - - int i, max_states, max_states_skip; - - // If layer contained several stubs, so several states now exist, select only the best ones. - - switch ( iteration ) { - case 0: - max_states = 4; - max_states_skip = 4; - break; - case 1: - max_states = 1; - max_states_skip = 1; - break; - case 2: - max_states = 1; - max_states_skip = 1; - break; - case 3: - max_states = 1; - max_states_skip = 1; - break; - case 4: - max_states = 1; - max_states_skip = 1; - break; - default: - max_states = 999; - max_states_skip = 999; - break; - } - - - i = 0; - for( auto state : next_states ){ - - if( i < max_states ){ - new_states.push_back( state ); - } else { - break; - } - i++; - - } - - i = 0; - for( auto state : next_states_skipped ){ - - if( i < max_states_skip ){ - new_states.push_back( state ); - } else { - break; - } - i++; - - } - - } //end of state loop - - - if( getSettings()->kalmanFillInternalHists() ) { - TString hname = Form( "hstubComb_itr%d", iteration ); - if( hstubCombMap.find(hname) == hstubCombMap.end() ){ - cout << hname << " does not exist." << endl; - } - else{ - hstubCombMap[hname]->Fill( combinations_per_iteration ); - } - } - - - // copy new_states into prev_states for next iteration or end if we are on - // iteration 4 by clearing all states and making final state selection - - sort( new_states.begin(), new_states.end(), KalmanState::orderMinSkipChi2); // Sort by chi2*(skippedLayers+1) - - if( iteration+1 == 4 ){ - - if(new_states.size()) finished_states.push_back(new_states[0]); - - prev_states.clear(); - new_states.clear(); - - } else { - - prev_states = new_states; - new_states.clear(); - - } - - - /* - int i = 0; - bool found = false; - for( auto best_state : best_states4 ){ - - if( tpa && tpa->useForAlgEff() ) { - std::map tp = getTrackParams(best_state); - L1fittedTrack returnTrk(getSettings(), l1track3D, best_state->stubs(), tp["qOverPt"], tp["d0"], tp["phi0"], tp["z0"], tp["t"], best_state->chi2(), nPar_, l1track3D.iPhiSec(), l1track3D.iEtaReg(), true); - if (returnTrk.getNumMatchedLayers()>=4) { - //temp_states.push_back(best_state); - if(i==0) found = true; - if (!found) cout<<"Lost this cand "<chi2()<<" "<reducedChi2()<<" "<path()<<" chose instead "<chi2()<<" "<reducedChi2()<<" "<path()<kalmanDebugLevel() >= 3 ){ - cout << "---------------" << endl; - cout << "kalmanUpdate" << endl; - cout << "---------------" << endl; - printStubCluster( cout, stubCluster ); - } - - - // Helix params & their covariance. - std::vector xa = state.xa(); - TMatrixD cov_xa = state.pxxa(); - if( state.barrel() && !stubCluster->barrel() ){ - if( getSettings()->kalmanDebugLevel() >= 3 ) { - cout << "STATE BARREL TO ENDCAP BEFORE " << endl; - cout << "state : " << xa.at(0) << " " << xa.at(1) << " " << xa.at(2) << " " << xa.at(3) << endl; - cout << "cov(x): " << endl; - cov_xa.Print(); - } - barrelToEndcap( state.r(), stubCluster, xa, cov_xa ); - if( getSettings()->kalmanDebugLevel() >= 3 ){ - cout << "STATE BARREL TO ENDCAP AFTER " << endl; - cout << "state : " << xa.at(0) << " " << xa.at(1) << " " << xa.at(2) << " " << xa.at(3) << endl; - cout << "cov(x): " << endl; - cov_xa.Print(); - } - } - // Matrix to propagate helix params from one layer to next (=identity matrix). - TMatrixD f = F(stubCluster, &state ); - TMatrixD ft(TMatrixD::kTransposed, f ); - if( getSettings()->kalmanDebugLevel() >= 3 ){ - cout << "f" << endl; - f.Print(); - cout << "ft" << endl; - ft.Print(); - } - - std::vector fx = Fx( f, xa ); // Multiply matrices to get helix params at next layer. - if( getSettings()->kalmanDebugLevel() >= 3 ){ - cout << "fx = ["; - for( unsigned i = 0; i < nPar_; i++ ) cout << fx.at(i) << ", "; - cout << "]" << endl; - } - - std::vector delta = residual(stubCluster, fx ); - if( getSettings()->kalmanDebugLevel() >= 3 ){ - cout << "delta = " << delta[0] << ", " << delta[1] << endl; - } - - // Derivative of predicted (phi,z) intercept with layer w.r.t. helix params. - TMatrixD h = H(stubCluster); - if( getSettings()->kalmanDebugLevel() >= 3 ){ - cout << "h" << endl; - h.Print(); - } - - - if( getSettings()->kalmanDebugLevel() >= 3 ){ - cout << "previous state covariance" << endl; - cov_xa.Print(); - } - // Get contribution to helix parameter covariance from scattering. - TMatrixD pxxm = PxxModel( &state, stubCluster ); - if( getSettings()->kalmanDebugLevel() >= 3 ){ - cout << "model xcov" << endl; - pxxm.Print(); - } - // Get covariance on helix parameters. - TMatrixD pxcov = f * cov_xa * ft + pxxm; - if( getSettings()->kalmanDebugLevel() >= 3 ){ - cout << "forcast xcov + model xcov" << endl; - pxcov.Print(); - } - // Get hit position covariance matrix. - TMatrixD dcov = PddMeas( stubCluster, &state ); - if( getSettings()->kalmanDebugLevel() >= 3 ){ - cout << "dcov" << endl; - dcov.Print(); - } - // Calculate Kalman Gain matrix. - TMatrixD k = GetKalmanMatrix( h, pxcov, dcov ); - if( getSettings()->kalmanDebugLevel() >= 3 ){ - cout << "k" << endl; - k.Print(); - } - - std::vector new_xa(nPar_); - TMatrixD new_pxxa; - GetAdjustedState( k, pxcov, fx, stubCluster, new_xa, new_pxxa ); - if( getSettings()->kalmanDebugLevel() >= 3 ){ - if( nPar_ == 4 ) - cout << "adjusted x = " << new_xa[0] << ", " << new_xa[1] << ", " << new_xa[2] << ", " << new_xa[3] << endl; - else if( nPar_ == 5 ) - cout << "adjusted x = " << new_xa[0] << ", " << new_xa[1] << ", " << new_xa[2] << ", " << new_xa[3] << ", " << new_xa[4] << endl; - cout << "adjusted covx " << endl; - new_pxxa.Print(); - } - - const KalmanState *new_state = mkState( state.candidate(), skipped, layer, stubCluster->layerId(), &state, new_xa, new_pxxa, k, dcov, stubCluster, 0 ); - if( getSettings()->kalmanDebugLevel() >= 3 ){ - cout << "new state" << endl; - new_state->dump( cout, tpa ); - } - - - return new_state; -} - - -double L1KalmanComb::calcChi2( const KalmanState &state )const{ - - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "calcChi2 " << endl; - } - double chi2(0), chi2_p(0); - - if( state.last_state() ) { - chi2 = state.last_state()->chi2(); - - const StubCluster *stubCluster = state.stubCluster(); - - if( stubCluster ){ - - std::vector delta = residual( stubCluster, state.last_state()->xa() ); - TMatrixD dcov = PddMeas( stubCluster, &state ); - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "dcov" << endl; - dcov.Print(); - cout << "xcov" << endl; - state.last_state()->pxxa().Print(); - } - TMatrixD h = H(stubCluster); - TMatrixD hxxh = HxxH( h, state.last_state()->pxxa() ); - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "h" << endl; - h.Print(); - cout << "hxcovh" << endl; - hxxh.Print(); - } - TMatrixD covR = dcov + hxxh; - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "covR" << endl; - covR.Print(); - cout << "---" << endl; - cout << scientific << "delta = " << delta[0] << ", " << delta[1] << endl; - } - chi2_p = Chi2( covR, delta ); - - } - chi2 += chi2_p; - } - - return chi2; -} - - -double L1KalmanComb::Chi2( const TMatrixD &dcov, const std::vector &delta, bool debug )const -{ - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "dcov" << endl; - dcov.Print(); - } - - if( dcov.Determinant() == 0 ) return 999; - - - TMatrixD dcovi( dcov ); - dcovi.Invert(); - - vector tmp(2,0); - for( int i=0; i < dcovi.GetNrows(); i++ ){ - for( int j=0; j < dcovi.GetNcols(); j++ ){ - tmp.at(j) += delta.at(i) * dcovi(i,j); - } - } - double chi2(0); - for( int j=0; j < 2; j++ ){ - chi2 += tmp.at(j) * delta.at(j); - } - - if( debug ){ - cout << "CHI SQUARE OUTPUT" << endl; - cout << "cov" << endl; - dcov.Print(); - cout << "cov inv" << endl; - dcovi.Print(); - for( unsigned i=0; i < delta.size(); i++ ) cout << delta.at(i) << " "; - cout << endl; - } - return chi2; -} - - -std::map L1KalmanComb::getTrackParams( const L1KalmanComb *p, const KalmanState *state ) -{ - return p->getTrackParams( state ); -} - - -std::vector L1KalmanComb::Hx( const TMatrixD &pH, const std::vector &x )const -{ - std::vector m( (unsigned) pH.GetNrows(), 0 ); - if( pH.GetNcols() != (int) x.size() ) { cerr << "Hx() : H and x have different dimensions" << endl; } - else{ - - for( int i=0; i < pH.GetNcols(); i++ ){ - for( int j=0; j < pH.GetNrows(); j++ ){ - m.at(j) += pH(j,i) * x.at(i); - } - } - } - return m; -} - - -std::vector L1KalmanComb::Fx( const TMatrixD &pF, const std::vector &x )const -{ - return Hx( pF, x ); -} - - -TMatrixD L1KalmanComb::HxxH( const TMatrixD &pH, const TMatrixD &xx )const -{ - int nd = (unsigned) pH.GetNrows(); - TMatrixD tmp(nd,nPar_); - TMatrixD mHxxH(nd,nd); - if( pH.GetNcols() != xx.GetNcols() || pH.GetNcols() != xx.GetNrows() ) { cerr << "HxxH() : H and xx have different dimensions" << endl; } - else{ - - for( int i=0; i < pH.GetNrows(); i++ ){ - for( int j=0; j < xx.GetNrows(); j++ ){ - for( int k=0; k < xx.GetNcols(); k++ ){ - tmp(i,k) += pH(i,j) * xx(j,k); - } - } - } - for( int i=0; i < tmp.GetNrows(); i++ ){ - for( int j=0; j < pH.GetNcols(); j++ ){ - for( int k=0; k < pH.GetNrows(); k++ ){ - mHxxH(i,k) += tmp(i,j) * pH(k,j); - } - } - } - } - return mHxxH; - -} - - -TMatrixD L1KalmanComb::GetKalmanMatrix( const TMatrixD &h, const TMatrixD &pxcov, const TMatrixD &dcov )const -{ - - TMatrixD pxcovht(pxcov.GetNrows(),2); - for( int i=0; ikalmanDebugLevel() >= 4 ){ - cout << "pxcovht" << endl; - pxcovht.Print(); - } - - TMatrixD tmp(dcov.GetNrows(), dcov.GetNcols() ); - TMatrixD hxxh = HxxH( h, pxcov ); - tmp = dcov + hxxh; - - if( getSettings()->kalmanDebugLevel() >= 4 ){ - cout << "hxxh" << endl; - hxxh.Print(); - cout << "dcov + hxxh " << endl; - tmp.Print(); - } - - TMatrixD K( pxcovht.GetNrows(), tmp.GetNcols() ); - - if(tmp.Determinant() == 0 ) return K; - tmp.Invert(); - - for( int i=0; i &x, const StubCluster *stubCluster, - std::vector &new_x, TMatrixD &new_xcov )const -{ - TMatrixD h = H(stubCluster); - std::vector m = d(stubCluster); - - for( unsigned i=0; i < new_x.size(); i++ ){ - new_x.at(i) = 0; - } - - std::vector tmpv(m.size(), 0 ); - for( int i=0; i < h.GetNrows(); i++ ){ - tmpv.at(i) += m.at(i); - for( int j=0; j < h.GetNcols(); j++ ){ - tmpv.at(i) += -1. * h(i,j) * x.at(j); - } - } - for( int i=0; i < K.GetNrows(); i++ ){ - new_x.at(i) += x.at(i); - for( int j=0; j < K.GetNcols(); j++ ){ - new_x.at(i) += K(i,j) * tmpv.at(j); - } - } - - TMatrixD tmp(K.GetNrows(), h.GetNcols() ); - for( int i=0; i< K.GetNrows(); i++ ){ - tmp(i,i) = 1; - } - for( int i=0; i< K.GetNrows(); i++ ){ - for( int j=0; j< K.GetNcols(); j++ ){ - for( int k=0; k< h.GetNcols(); k++ ){ - tmp(i,k) += -1 * K(i,j) * h(j,k); - } - } - } - new_xcov.Clear(); - new_xcov.ResizeTo(pxcov.GetNrows(), pxcov.GetNcols()); - for( int i=0; i< tmp.GetNrows(); i++ ){ - for( int j=0; j< tmp.GetNcols(); j++ ){ - for( int k=0; k< pxcov.GetNcols(); k++ ){ - new_xcov(i,k) += tmp(i,j) * pxcov(j,k); - } - } - } -} - - -void L1KalmanComb::resetStates() -{ - for( unsigned int i=0; i < state_list_.size(); i++ ){ - - delete state_list_.at(i); - } - state_list_.clear(); -} - - -const KalmanState *L1KalmanComb::mkState( const L1track3D &candidate, unsigned skipped, unsigned layer, unsigned layerId, const KalmanState *last_state, - const std::vector &x, const TMatrixD &pxx, const TMatrixD &K, const TMatrixD &dcov, const StubCluster* stubCluster, double chi2 ) -{ - - KalmanState *new_state = new KalmanState( candidate, skipped, layer, layerId, last_state, x, pxx, K, dcov, stubCluster, chi2, this, &getTrackParams ); - - if( chi2 == 0 ){ - double new_state_chi2 = calcChi2( *new_state ); - new_state->setChi2( new_state_chi2 ); - } - - state_list_.push_back( new_state ); - return new_state; -} - - -std::vector L1KalmanComb::residual(const StubCluster* stubCluster, const std::vector &x )const{ - - std::vector vd = d(stubCluster); // Get (phi relative to sector, z) of hit. - std::vector hx = Hx( H(stubCluster), x ); // Ditto for intercept of helix with layer, in linear approximation. - std::vector delta(2); - for( unsigned i=0; i<2; i++ ) delta.at(i) = vd.at(i) - hx.at(i); - delta.at(0) = wrapRadian(delta.at(0)); - return delta; -} - - - - - -void L1KalmanComb::bookHists(){ - - if ( getSettings()->kalmanFillInternalHists() ) { - - edm::Service fs_; - string dirName; - if( fitterName_.compare("") == 0 ) dirName = "L1KalmanCombInternal"; - else dirName = fitterName_ + "Internal"; - - TFileDirectory inputDir = fs_->mkdir(dirName.c_str()); - - - TString hname; - hTrackEta_ = inputDir.make( "hTrackEta", "Track #eta; #eta", 50, -2.5, 2.5 ); - hUniqueTrackEta_ = inputDir.make( "hUniqueTrackEta", "Unique Track #eta; #eta", 50, -2.5, 2.5 ); - hndupStub_ = inputDir.make( "hndupStub", "# of duplicated stubs", 1, 0, 1 ); - hnmergeStub_ = inputDir.make( "hnmergeStub", "# of merged stubs", 1, 0, 1 ); - - - for( unsigned j_layer=0; j_layer < 6; j_layer++ ){ - hname = Form( "hBarrelStubMaxDistanceLayer%02d", LayerId[j_layer] ); - hBarrelStubMaxDistanceMap[hname] = inputDir.make( hname, Form( "max distance of stubs in barrel Layer %02d; dr#phi; dz", LayerId[j_layer] ), - 100, 0, 1., 100, 0, 10 ); - } - - for( unsigned j_ecring=1; j_ecring < 16; j_ecring++ ){ - hname = Form( "hEndcapStubMaxDistanceRing%02d", j_ecring ); - hEndcapStubMaxDistanceMap[hname] = inputDir.make( hname, Form( "max distance of stubs in endcap Ring %02d; dr#phi; dr", j_ecring ), - 100, 0, 1., 100, 0, 10 ); - hname = Form( "hphiErrorRatioRing%d", j_ecring ); - hphiErrorRatioMap[hname] = inputDir.make( hname, Form( "; fabs( strip id - 0.5 x nStrips + 0.5 ); #delta #phi_{r} / #delta #phi_{l}" ), 508, 0.0, 508.0 , 50, -0.5, 49.5 ); - } - - - - float nbins(2002); - for( unsigned i=0; i < nPar_; i++ ){ - hname = Form( "hyt_%d", i ); - hytMap[hname] = inputDir.make( hname, Form( "; true track parameter values %d", i ), nbins, hymin[i], hymax[i] ); - hname = Form( "hy0_%d", i ); - hy0Map[hname] = inputDir.make( hname, Form( "; after HT track parameter values %d", i ), nbins, hymin[i], hymax[i] ); - hname = Form( "hyf_%d", i ); - hyfMap[hname] = inputDir.make( hname, Form( "; after KF track parameter values %d", i ), nbins, hymin[i], hymax[i] ); - hname = Form( "hx_%d", i ); - hxMap[hname] = inputDir.make( hname, Form( "; x values %d", i ), nbins, hxmin[i], hxmax[i] ); - } - - - for( unsigned itr=0; itr<=5; itr++ ){ - - hname = Form( "hstubComb_itr%d", itr ); - hstubCombMap[hname] = inputDir.make( hname, Form( "; #state+stub combinations, iteration %d ", itr ), 100, 0., 100.); - - for( unsigned i=0; i < nPar_; i++ ){ - for( unsigned j=0; j <= i; j++ ){ - - hname = Form( "hxcov_itr%d_%d_%d", itr, i, j ); - hxcovMap[hname] = inputDir.make( hname, Form( "; state covariance adjusted values, iteration %d (%d,%d)", itr, i, j ), - nbins, -1 * hdxmin[i]*hdxmin[j], hdxmax[i]*hdxmax[j] ); - } - } - for( unsigned i=0; i < nPar_; i++ ){ - for( unsigned j=0; j < nMeas_; j++ ){ - hname = Form( "hk_itr%d_%d_%d", itr, i, j ); - hkMap[hname] = inputDir.make( hname, Form( "; K(%d,%d), Iteration %d", i, j, itr ), 200, -1., 1. ); - } - } - for( unsigned i=0; i < nMeas_; i++ ){ - hname = Form( "hres_itr%d_%d", itr, i ); - hresMap[hname] = inputDir.make( hname, Form( "; residual values, iteration %d (%d)", itr, i ), - nbins, hresmin[i], hresmax[i] ); - for( unsigned j=0; j <= i; j++ ){ - hname = Form( "hmcov_itr%d_%d_%d", itr, i, j ); - hmcovMap[hname] = inputDir.make( hname, Form( "; measurement covariance values, iteration %d (%d,%d)", itr, i, j ), - nbins, -1 * hddMeasmin[i]*hddMeasmin[i], hddMeasmax[i]*hddMeasmax[j] ); - } - } - } - } -} - - -void L1KalmanComb::fillCandHists( const KalmanState &state, const TP *tpa ) -{ - if( tpa && tpa->useForAlgEff() ){ - - const KalmanState *the_state = &state; - while( the_state ){ - if( the_state->stubCluster() ){ - std::vector x = the_state->xa(); - for( unsigned i=0; i < nPar_; i++ ){ - TString hname = Form( "hx_%d", i ); - if( hxMap.find(hname) == hxMap.end() ){ - cout << hname << " does not exist." << endl; - } - else hxMap[hname]->Fill(x.at(i)); - } - } - the_state = the_state->last_state(); - } - - - std::map mx = getTrackParams( &state ); - std::vector vx(nPar_); - vx[0] = mx["qOverPt"]; - vx[1] = mx["phi0"]; - vx[2] = mx["z0"]; - vx[3] = mx["t"]; - if( nPar_ == 5 ) vx[4] = mx["d0"]; - for( unsigned i=0; i < nPar_; i++ ){ - TString hname = Form( "hyf_%d", i ); - if( hyfMap.find(hname) == hyfMap.end() ){ - cout << hname << " does not exist." << endl; - } - else hyfMap[hname]->Fill(vx[i]); - } - } -} - - -void L1KalmanComb::fillSeedHists( const KalmanState *state, const TP *tpa ){ - - std::vector x0 = state->xa(); - TMatrixD pxx0 = state->pxxa(); - //Histogram Fill : seed pxxa - for( unsigned i=0; i < nPar_; i++ ){ - for( unsigned j=0; j <= i; j++ ){ - TString hname = Form( "hxcov_itr%d_%d_%d", 0, i, j ); - if( hxcovMap.find( hname ) == hxcovMap.end() ){ - cout << hname << " does not exist." << endl; - } - else hxcovMap[hname]->Fill( pxx0(i,j) ); - } - } - - if( tpa && tpa->useForAlgEff() ){ - std::vector xt(nPar_); - xt[0] = tpa->qOverPt(); - xt[1] = tpa->phi0(); - xt[2] = tpa->z0(); - xt[3] = tpa->tanLambda(); - if( nPar_ == 5 ) xt[4] = tpa->d0(); - for( unsigned i=0; i < nPar_; i++ ){ - TString hname = Form( "hyt_%d", i ); - if( hytMap.find(hname) == hytMap.end() ){ - cout << hname << " does not exist." << endl; - } - else hytMap[hname]->Fill(xt[i]); - } - //Histogram Fill : Seed state - std::map mx0 = getTrackParams( state ); - std::vector vx0(nPar_); - vx0[0] = mx0["qOverPt"]; - vx0[1] = mx0["phi0"]; - vx0[2] = mx0["z0"]; - vx0[3] = mx0["t"]; - if( nPar_ == 5 ) vx0[4] = mx0["d0"]; - for( unsigned i=0; i < nPar_; i++ ){ - TString hname = Form( "hy0_%d", i ); - if( hy0Map.find(hname) == hy0Map.end() ){ - cout << hname << " does not exist." << endl; - } - else hy0Map[hname]->Fill(vx0[i]); - } - } -} - - -void L1KalmanComb::fillStepHists( const TP *tpa, unsigned nItr, const KalmanState *new_state ) -{ - unsigned path = 0; - - const std::vector &xa = new_state->xa(); - const StubCluster *stubCluster = new_state->stubCluster(); - const TMatrixD &pxxa = new_state->pxxa(); - - TString hname; - - for( unsigned i=0; i < nPar_; i++ ){ - - for( unsigned j=0; j <= i; j++ ){ - hname = Form( "hxcov_itr%d_%d_%d", nItr, i, j ); - if( hxcovMap.find( hname ) == hxcovMap.end() ){ - cout << hname << " does not exist." << endl; - } - else hxcovMap[hname]->Fill( pxxa(i,j) ); - } - } - for( unsigned i=0; i < nPar_; i++ ){ - for( int j=0; j < 2; j++ ){ - TString hname = Form( "hk_itr%d_%d_%d", nItr, i, j ); - if( hkMap.find( hname ) == hkMap.end() ){ - cout << hname << " does not exist." << endl; - } - else hkMap[hname]->Fill( new_state->K()(i,j) ); - } - } - std::vector delta_new = residual(stubCluster, xa ); - for( unsigned int i=0; i < delta_new.size(); i++ ){ - TString hname = Form( "hres_itr%d_%d", nItr, i ); - if( hresMap.find(hname) == hresMap.end() ){ - cout << hname << " does not exist." << endl; - } - else hresMap[hname]->Fill( delta_new[i] ); - } - for( int i=0; i < 2; i++ ){ - for( int j=0; j < i; j++ ){ - TString hname = Form( "hmcov_itr%d_%d_%d", nItr, i, j ); - if( hmcovMap.find( hname ) == hmcovMap.end() ){ - cout << hname << " does not exist." << endl; - } - else hmcovMap[hname]->Fill( new_state->dcov()(i,j) ); - } - } -} - - -void L1KalmanComb::deleteStubClusters() -{ - for( unsigned int i=0; i < stbcl_list_.size(); i++ ){ - delete stbcl_list_.at(i); - } - stbcl_list_.clear(); -} - - -double L1KalmanComb::DeltaRphiForClustering( unsigned layerId, unsigned endcapRing ) -{ - static double barrel_drphi[6] = { 0.05, 0.04, 0.05, 0.12, 0.13, 0.19 }; - if( layerId < 10 ) return barrel_drphi[layerId - 1]; - - static double ec_drphi[16] = - { 0.04, 0.05, 0.04, 0.06, 0.06, 0.04, 0.06, 0.07, 0.15, 0.08, 0.27, 0.08, 0.27, 0.12, 0.09 }; - return ec_drphi[endcapRing - 1]; -}; - - -double L1KalmanComb::DeltaRForClustering( unsigned endcapRing ) -{ - static double ec_dr[16] = - { 0.52, 0.56, 0.59, 0.86, 0.66, 0.47, 0.55, 0.72, 1.53, 1.10, 2.72, 0.91, 2.69, 0.67, 0.09 }; - return ec_dr[endcapRing - 1]; - -} - - -bool L1KalmanComb::isOverlap( const Stub* a, const Stub*b, OVERLAP_TYPE type ){ - - std::set a_tps = a->assocTPs(); - std::set b_tps = b->assocTPs(); - double drphi = DeltaRphiForClustering( a->layerId(), a->endcapRing() ); - double dr(0); - switch ( type ){ - - case TYPE_NORMAL: - if( a->layerId() != b->layerId() ) return false; - - if( a->layerId() < 7 ){ - if( fabs( b->z() - a->z() ) > 0.5 * b->stripLength() || fabs( wrapRadian( b->phi() - sectorPhi() ) * b->r() - wrapRadian( a->phi() - sectorPhi() ) * a->r() ) > 0.5 * b->stripPitch() ) return false; - } - else{ - dr = DeltaRForClustering( a->endcapRing() ); - if( fabs( b->r() - a->r() ) > 0.5 * b->stripLength() || fabs( wrapRadian( b->phi() - sectorPhi() ) * b->r() - wrapRadian( a->phi() - sectorPhi() ) * a->r() ) > 0.5 * b->stripPitch() ) return false; - } - return true; - case TYPE_V2: - if( a->layerId() != b->layerId() ) return false; - - if( a->layerId() < 7 ){ - if( fabs( b->z() - a->z() ) > 0.5 * b->stripLength() || fabs( wrapRadian( b->phi() - sectorPhi() ) * b->r() - wrapRadian( a->phi() - sectorPhi() ) * a->r() ) > drphi ) return false; - } - else{ - dr = DeltaRForClustering( a->endcapRing() ); - if( fabs( b->r() - a->r() ) > dr || fabs( wrapRadian( b->phi() - sectorPhi() ) * b->r() - wrapRadian( a->phi() - sectorPhi() ) * a->r() ) > drphi ) return false; - } - return true; - - case TYPE_NOCLUSTERING: - return false; - - case TYPE_TP: - for( auto a_tp : a_tps ) - if( b_tps.find( a_tp ) != b_tps.end() ) return true; - return false; - default: - return false; - } -} - -} diff --git a/L1Trigger/TrackFindingTMTT/src/L1fittedTrack.cc b/L1Trigger/TrackFindingTMTT/src/L1fittedTrack.cc index 207ae9c5d76aa..0da0c64d45625 100644 --- a/L1Trigger/TrackFindingTMTT/src/L1fittedTrack.cc +++ b/L1Trigger/TrackFindingTMTT/src/L1fittedTrack.cc @@ -1,6 +1,6 @@ #include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" -namespace TMTT { +namespace tmtt { // Digitize track and degrade helix parameter resolution according to effect of digitisation. @@ -112,4 +112,4 @@ namespace TMTT { } } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/Matrix.cc b/L1Trigger/TrackFindingTMTT/src/Matrix.cc index 75f127dc27c0a..8ae632cdea527 100644 --- a/L1Trigger/TrackFindingTMTT/src/Matrix.cc +++ b/L1Trigger/TrackFindingTMTT/src/Matrix.cc @@ -9,7 +9,7 @@ #include #include -namespace TMTT { +namespace tmtt { // Parameter Constructor template @@ -369,4 +369,4 @@ namespace TMTT { template class Matrix; template class Matrix; -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc b/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc index 41af5b5bd046e..5215bff2cfaea 100644 --- a/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc +++ b/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc @@ -3,7 +3,7 @@ #include -namespace TMTT { +namespace tmtt { MiniHTstage::MiniHTstage(const Settings* settings) : settings_(settings), @@ -269,4 +269,4 @@ namespace TMTT { return trueLinkID; } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc b/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc index 03ca046f2e65e..20937fc1c034e 100644 --- a/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc +++ b/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc @@ -7,7 +7,9 @@ #include "FWCore/Utilities/interface/Exception.h" -namespace TMTT { +#include + +namespace tmtt { //=== Initialize constants from configuration parameters. @@ -35,7 +37,7 @@ namespace TMTT { // Check that the MUX algorithm implemented in linkID() is not obviously wrong. this->sanityCheck(); - bool static first = true; + static std::atomic first = true; if (first) { first = false; cout << "=== The R-PHI HT output is multiplexed onto " << this->numLinksPerNonant() @@ -189,4 +191,4 @@ namespace TMTT { } } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/Sector.cc b/L1Trigger/TrackFindingTMTT/src/Sector.cc index 8f8078456c1f3..ed2b4753db82c 100644 --- a/L1Trigger/TrackFindingTMTT/src/Sector.cc +++ b/L1Trigger/TrackFindingTMTT/src/Sector.cc @@ -6,7 +6,7 @@ using namespace std; -namespace TMTT { +namespace tmtt { //=== Initialise @@ -347,4 +347,4 @@ namespace TMTT { return insideVec; } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/Settings.cc b/L1Trigger/TrackFindingTMTT/src/Settings.cc index 36e0f8a3ba089..f25126ca20345 100644 --- a/L1Trigger/TrackFindingTMTT/src/Settings.cc +++ b/L1Trigger/TrackFindingTMTT/src/Settings.cc @@ -3,7 +3,7 @@ #include #include -namespace TMTT { +namespace tmtt { // Set config params for HYBRID TRACKING via hard-wired consts to allow use outside CMSSW. @@ -505,4 +505,4 @@ namespace TMTT { return whitelisted; } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/SimpleLR.cc b/L1Trigger/TrackFindingTMTT/src/SimpleLR.cc index b480f8f1e7eb7..6002b0e5d85ff 100644 --- a/L1Trigger/TrackFindingTMTT/src/SimpleLR.cc +++ b/L1Trigger/TrackFindingTMTT/src/SimpleLR.cc @@ -13,7 +13,7 @@ #include #include -using namespace TMTT; +using namespace tmtt; static bool pair_compare(std::pair a, std::pair b) { return (a.second < b.second); diff --git a/L1Trigger/TrackFindingTMTT/src/Stub.cc b/L1Trigger/TrackFindingTMTT/src/Stub.cc index fdc77e1fc4476..9dca1b701d27c 100644 --- a/L1Trigger/TrackFindingTMTT/src/Stub.cc +++ b/L1Trigger/TrackFindingTMTT/src/Stub.cc @@ -16,14 +16,13 @@ using namespace std; -namespace TMTT { +namespace tmtt { // Static variables - thread_local string Stub::trackerGeometryVersion_ = "UNKNOWN"; - - bool Stub::stubKillerInit_ = false; - StubKiller Stub::stubKiller_; + std::atomic Stub::trackerGeometryVersion_ = 0; + std::atomic Stub::stubKillerInit_ = false; + thread_local StubKiller Stub::stubKiller_; //=== Store useful info about the stub (for use with HYBRID code), with hard-wired constants to allow use outside CMSSW. @@ -451,10 +450,10 @@ namespace TMTT { windowFE = 99999.; // TMTT is not tightening windows. } - static bool firstErr = true; - if (trackerGeometryVersion_ != "T5") { // Tilted geometry + static std::atomic firstErr = true; + if (trackerGeometryVersion_ < 5) { if (firstErr) { - cout << "Stub: WARNING - Stub windows in DegradeBend class have not been tuned for this tracker geometry, so " + cout << "Stub: WARNING - Stub windows in DegradeBend class have not been tuned for flat tracker geometry, so " "may need retuning " << trackerGeometryVersion_ << endl; firstErr = false; @@ -498,7 +497,7 @@ namespace TMTT { if (settings_->deadSimulateFrac() > 0.) { // Is option to emulate dead modules enabled? const DeadModuleDB dead; if (dead.killStub(this)) { - static TRandom randomGenerator; + static thread_local TRandom randomGenerator; if (randomGenerator.Rndm() < settings_->deadSimulateFrac()) frontendPass_ = false; } @@ -717,7 +716,7 @@ namespace TMTT { // Note module ring in endcap endcapRing_ = barrel_ ? 0 : trackerTopology->tidRing(detId); - if (trackerGeometryVersion_ == "T5") { + if (trackerGeometryVersion_ >= 5) { // Tilted geometry if (!barrel_) { // Apply bodge, since Topology class annoyingly starts ring count at 1, even in endcap wheels where // inner rings are absent. @@ -758,7 +757,7 @@ namespace TMTT { // (D13, D17 ...) is documented in // https://github.com/cms-sw/cmssw/blob/CMSSW_9_1_X/Configuration/Geometry/README.md . - if (trackerGeometryVersion_ == "UNKNOWN") { + if (trackerGeometryVersion_ == 0) { unsigned int numDet = 0; for (const GeomDet* gd : trackerGeometry->dets()) { DetId detid = gd->geographicalId(); @@ -771,14 +770,14 @@ namespace TMTT { } } - if (numDet == 13296) { - trackerGeometryVersion_ = "T5"; // Tilted geometry - } else if (numDet == 13556) { - trackerGeometryVersion_ = "T3"; // Older tilted geometry + if (numDet == 13200) { + trackerGeometryVersion_ = 14; // Tilted geometry T14/T15 + } else if (numDet == 13296) { + trackerGeometryVersion_ = 5; // Tilted geometry T5/T6 } else if (numDet == 14850) { - trackerGeometryVersion_ = "T4"; // Flat geometry + trackerGeometryVersion_ = 4; // Flat geometry T4 } else { - trackerGeometryVersion_ = "UNRECOGNISED"; + trackerGeometryVersion_ = -1; cout << "Stub: WARNING -- The tracker geometry you are using is yet not known to the stub class. Please update " "Stub::degradeResolution() & Stub::setTrackerGeometryVersion(). Number of tracker modules = " << numDet << endl; @@ -786,4 +785,4 @@ namespace TMTT { } } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/StubCluster.cc b/L1Trigger/TrackFindingTMTT/src/StubCluster.cc index a01f92956e174..93d428bb21a20 100644 --- a/L1Trigger/TrackFindingTMTT/src/StubCluster.cc +++ b/L1Trigger/TrackFindingTMTT/src/StubCluster.cc @@ -3,7 +3,7 @@ #include "L1Trigger/TrackFindingTMTT/interface/TP.h" #include "DataFormats/Math/interface/deltaPhi.h" -namespace TMTT { +namespace tmtt { StubCluster::StubCluster(std::vector stubs, double SectorPhi, int lres_dr) : layerKF_(999) { r_ = 0; @@ -122,4 +122,4 @@ namespace TMTT { alpha_ /= nstubs_; } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/StubKiller.cc b/L1Trigger/TrackFindingTMTT/src/StubKiller.cc index 83a59910e42a4..886918e5b77c9 100644 --- a/L1Trigger/TrackFindingTMTT/src/StubKiller.cc +++ b/L1Trigger/TrackFindingTMTT/src/StubKiller.cc @@ -7,241 +7,245 @@ using namespace std; -StubKiller::StubKiller() - : killScenario_(0), - trackerTopology_(0), - trackerGeometry_(0), - layersToKill_(vector()), - minPhiToKill_(0), - maxPhiToKill_(0), - minZToKill_(0), - maxZToKill_(0), - minRToKill_(0), - maxRToKill_(0), - fractionOfStubsToKillInLayers_(0), - fractionOfStubsToKillEverywhere_(0), - fractionOfModulesToKillEverywhere_(0) {} - -void StubKiller::initialise(unsigned int killScenario, - const TrackerTopology* trackerTopology, - const TrackerGeometry* trackerGeometry) { - killScenario_ = killScenario; - trackerTopology_ = trackerTopology; - trackerGeometry_ = trackerGeometry; - - // These sceanrios correspond to slide 12 of https://indico.cern.ch/event/719985/contributions/2970687/attachments/1634587/2607365/StressTestTF-Acosta-Apr18.pdf - // Sceanrio 1 - // kill layer 5 in one quadrant +5 % random module loss to connect to what was done before - if (killScenario_ == 1) { - layersToKill_ = {5}; - minPhiToKill_ = 0; - maxPhiToKill_ = TMath::PiOver2(); - minZToKill_ = -1000; - maxZToKill_ = 0; - minRToKill_ = 0; - maxRToKill_ = 1000; - fractionOfStubsToKillInLayers_ = 1; - fractionOfStubsToKillEverywhere_ = 0; - fractionOfModulesToKillEverywhere_ = 0.05; - } - // Sceanrio 2 - // kill layer 1 in one quadrant +5 % random module loss - else if (killScenario_ == 2) { - layersToKill_ = {1}; - minPhiToKill_ = 0; - maxPhiToKill_ = TMath::PiOver2(); - minZToKill_ = -1000; - maxZToKill_ = 0; - minRToKill_ = 0; - maxRToKill_ = 1000; - fractionOfStubsToKillInLayers_ = 1; - fractionOfStubsToKillEverywhere_ = 0; - fractionOfModulesToKillEverywhere_ = 0.05; - } - // Scenario 3 - // kill layer 1 + layer 2, both in same quadrant - else if (killScenario_ == 3) { - layersToKill_ = {1, 2}; - minPhiToKill_ = 0; - maxPhiToKill_ = TMath::PiOver2(); - minZToKill_ = -1000; - maxZToKill_ = 0; - minRToKill_ = 0; - maxRToKill_ = 1000; - fractionOfStubsToKillInLayers_ = 1; - fractionOfStubsToKillEverywhere_ = 0; - fractionOfModulesToKillEverywhere_ = 0; - } - // Scenario 4 - // kill layer 1 and disk 1, both in same quadrant - else if (killScenario_ == 4) { - layersToKill_ = {1, 11}; - minPhiToKill_ = 0; - maxPhiToKill_ = TMath::PiOver2(); - minZToKill_ = -1000; - maxZToKill_ = 0; - minRToKill_ = 0; - maxRToKill_ = 66.5; - fractionOfStubsToKillInLayers_ = 1; - fractionOfStubsToKillEverywhere_ = 0; - fractionOfModulesToKillEverywhere_ = 0; - } - // An extra scenario not listed in the slides - // 5% random module loss throughout tracker - else if (killScenario_ == 5) { - layersToKill_ = {}; - fractionOfStubsToKillInLayers_ = 0; - fractionOfStubsToKillEverywhere_ = 0.; - fractionOfModulesToKillEverywhere_ = 0.05; - } +namespace tmtt { + + StubKiller::StubKiller() + : killScenario_(0), + trackerTopology_(0), + trackerGeometry_(0), + layersToKill_(vector()), + minPhiToKill_(0), + maxPhiToKill_(0), + minZToKill_(0), + maxZToKill_(0), + minRToKill_(0), + maxRToKill_(0), + fractionOfStubsToKillInLayers_(0), + fractionOfStubsToKillEverywhere_(0), + fractionOfModulesToKillEverywhere_(0) {} + + void StubKiller::initialise(unsigned int killScenario, + const TrackerTopology* trackerTopology, + const TrackerGeometry* trackerGeometry) { + killScenario_ = killScenario; + trackerTopology_ = trackerTopology; + trackerGeometry_ = trackerGeometry; + + // These sceanrios correspond to slide 12 of https://indico.cern.ch/event/719985/contributions/2970687/attachments/1634587/2607365/StressTestTF-Acosta-Apr18.pdf + // Sceanrio 1 + // kill layer 5 in one quadrant +5 % random module loss to connect to what was done before + if (killScenario_ == 1) { + layersToKill_ = {5}; + minPhiToKill_ = 0; + maxPhiToKill_ = TMath::PiOver2(); + minZToKill_ = -1000; + maxZToKill_ = 0; + minRToKill_ = 0; + maxRToKill_ = 1000; + fractionOfStubsToKillInLayers_ = 1; + fractionOfStubsToKillEverywhere_ = 0; + fractionOfModulesToKillEverywhere_ = 0.05; + } + // Sceanrio 2 + // kill layer 1 in one quadrant +5 % random module loss + else if (killScenario_ == 2) { + layersToKill_ = {1}; + minPhiToKill_ = 0; + maxPhiToKill_ = TMath::PiOver2(); + minZToKill_ = -1000; + maxZToKill_ = 0; + minRToKill_ = 0; + maxRToKill_ = 1000; + fractionOfStubsToKillInLayers_ = 1; + fractionOfStubsToKillEverywhere_ = 0; + fractionOfModulesToKillEverywhere_ = 0.05; + } + // Scenario 3 + // kill layer 1 + layer 2, both in same quadrant + else if (killScenario_ == 3) { + layersToKill_ = {1, 2}; + minPhiToKill_ = 0; + maxPhiToKill_ = TMath::PiOver2(); + minZToKill_ = -1000; + maxZToKill_ = 0; + minRToKill_ = 0; + maxRToKill_ = 1000; + fractionOfStubsToKillInLayers_ = 1; + fractionOfStubsToKillEverywhere_ = 0; + fractionOfModulesToKillEverywhere_ = 0; + } + // Scenario 4 + // kill layer 1 and disk 1, both in same quadrant + else if (killScenario_ == 4) { + layersToKill_ = {1, 11}; + minPhiToKill_ = 0; + maxPhiToKill_ = TMath::PiOver2(); + minZToKill_ = -1000; + maxZToKill_ = 0; + minRToKill_ = 0; + maxRToKill_ = 66.5; + fractionOfStubsToKillInLayers_ = 1; + fractionOfStubsToKillEverywhere_ = 0; + fractionOfModulesToKillEverywhere_ = 0; + } + // An extra scenario not listed in the slides + // 5% random module loss throughout tracker + else if (killScenario_ == 5) { + layersToKill_ = {}; + fractionOfStubsToKillInLayers_ = 0; + fractionOfStubsToKillEverywhere_ = 0.; + fractionOfModulesToKillEverywhere_ = 0.05; + } - deadModules_.clear(); - if (fractionOfModulesToKillEverywhere_ > 0) { - this->chooseModulesToKill(); - } - this->addDeadLayerModulesToDeadModuleList(); -} - -void StubKiller::chooseModulesToKill() { - TRandom randomGenerator; - for (const GeomDetUnit* gd : trackerGeometry_->detUnits()) { - if (!trackerTopology_->isLower(gd->geographicalId())) - continue; - if (randomGenerator.Rndm() < fractionOfModulesToKillEverywhere_) { - deadModules_[gd->geographicalId()] = 1; + deadModules_.clear(); + if (fractionOfModulesToKillEverywhere_ > 0) { + this->chooseModulesToKill(); } + this->addDeadLayerModulesToDeadModuleList(); } -} - -void StubKiller::addDeadLayerModulesToDeadModuleList() { - for (const GeomDetUnit* gd : trackerGeometry_->detUnits()) { - float moduleR = gd->position().perp(); - float moduleZ = gd->position().z(); - float modulePhi = gd->position().phi(); - DetId geoDetId = gd->geographicalId(); - bool isInBarrel = geoDetId.subdetId() == StripSubdetector::TOB || geoDetId.subdetId() == StripSubdetector::TIB; - - int layerID = 0; - if (isInBarrel) { - layerID = trackerTopology_->layer(geoDetId); - } else { - layerID = 10 * trackerTopology_->side(geoDetId) + trackerTopology_->tidWheel(geoDetId); + + void StubKiller::chooseModulesToKill() { + TRandom randomGenerator; + for (const GeomDetUnit* gd : trackerGeometry_->detUnits()) { + if (!trackerTopology_->isLower(gd->geographicalId())) + continue; + if (randomGenerator.Rndm() < fractionOfModulesToKillEverywhere_) { + deadModules_[gd->geographicalId()] = 1; + } } - if (find(layersToKill_.begin(), layersToKill_.end(), layerID) != layersToKill_.end()) { - if (modulePhi < -1.0 * TMath::Pi()) - modulePhi += 2.0 * TMath::Pi(); - else if (modulePhi > TMath::Pi()) - modulePhi -= 2.0 * TMath::Pi(); - - if (modulePhi > minPhiToKill_ && modulePhi < maxPhiToKill_ && moduleZ > minZToKill_ && moduleZ < maxZToKill_ && - moduleR > minRToKill_ && moduleR < maxRToKill_) { - if (deadModules_.find(gd->geographicalId()) == deadModules_.end()) { - deadModules_[gd->geographicalId()] = fractionOfStubsToKillInLayers_; + } + + void StubKiller::addDeadLayerModulesToDeadModuleList() { + for (const GeomDetUnit* gd : trackerGeometry_->detUnits()) { + float moduleR = gd->position().perp(); + float moduleZ = gd->position().z(); + float modulePhi = gd->position().phi(); + DetId geoDetId = gd->geographicalId(); + bool isInBarrel = geoDetId.subdetId() == StripSubdetector::TOB || geoDetId.subdetId() == StripSubdetector::TIB; + + int layerID = 0; + if (isInBarrel) { + layerID = trackerTopology_->layer(geoDetId); + } else { + layerID = 10 * trackerTopology_->side(geoDetId) + trackerTopology_->tidWheel(geoDetId); + } + if (find(layersToKill_.begin(), layersToKill_.end(), layerID) != layersToKill_.end()) { + if (modulePhi < -1.0 * TMath::Pi()) + modulePhi += 2.0 * TMath::Pi(); + else if (modulePhi > TMath::Pi()) + modulePhi -= 2.0 * TMath::Pi(); + + if (modulePhi > minPhiToKill_ && modulePhi < maxPhiToKill_ && moduleZ > minZToKill_ && moduleZ < maxZToKill_ && + moduleR > minRToKill_ && moduleR < maxRToKill_) { + if (deadModules_.find(gd->geographicalId()) == deadModules_.end()) { + deadModules_[gd->geographicalId()] = fractionOfStubsToKillInLayers_; + } } } } } -} -bool StubKiller::killStub(const TTStub* stub) { - if (killScenario_ == 0) - return false; - else { - bool killStubRandomly = killStub(stub, - layersToKill_, - minPhiToKill_, - maxPhiToKill_, - minZToKill_, - maxZToKill_, - minRToKill_, - maxRToKill_, - fractionOfStubsToKillInLayers_, - fractionOfStubsToKillEverywhere_); - bool killStubInDeadModules = killStubInDeadModule(stub); - return killStubRandomly || killStubInDeadModules; - } -} - -// layersToKill - a vector stating the layers we are killing stubs in. Can be an empty vector. -// Barrel layers are encoded as 1-6. The endcap layers are encoded as 11-15 (-z) and 21-25 (+z) -// min/max Phi/Z/R - stubs within the region specified by these boundaries and layersToKill are flagged for killing -// fractionOfStubsToKillInLayers - The fraction of stubs to kill in the specified layers/region. -// fractionOfStubsToKillEverywhere - The fraction of stubs to kill throughout the tracker - -bool StubKiller::killStub(const TTStub* stub, - const vector layersToKill, - const int minPhiToKill, - const int maxPhiToKill, - const int minZToKill, - const int maxZToKill, - const int minRToKill, - const int maxRToKill, - const double fractionOfStubsToKillInLayers, - const double fractionOfStubsToKillEverywhere) { - // Only kill stubs in specified layers - if (layersToKill.size() > 0) { - // Get the layer the stub is in, and check if it's in the layer you want to kill - DetId stackDetid = stub->getDetId(); - DetId geoDetId(stackDetid.rawId() + 1); - - bool isInBarrel = geoDetId.subdetId() == StripSubdetector::TOB || geoDetId.subdetId() == StripSubdetector::TIB; - - int layerID = 0; - if (isInBarrel) { - layerID = trackerTopology_->layer(geoDetId); - } else { - layerID = 10 * trackerTopology_->side(geoDetId) + trackerTopology_->tidWheel(geoDetId); + bool StubKiller::killStub(const TTStub* stub) { + if (killScenario_ == 0) + return false; + else { + bool killStubRandomly = killStub(stub, + layersToKill_, + minPhiToKill_, + maxPhiToKill_, + minZToKill_, + maxZToKill_, + minRToKill_, + maxRToKill_, + fractionOfStubsToKillInLayers_, + fractionOfStubsToKillEverywhere_); + bool killStubInDeadModules = killStubInDeadModule(stub); + return killStubRandomly || killStubInDeadModules; } + } + + // layersToKill - a vector stating the layers we are killing stubs in. Can be an empty vector. + // Barrel layers are encoded as 1-6. The endcap layers are encoded as 11-15 (-z) and 21-25 (+z) + // min/max Phi/Z/R - stubs within the region specified by these boundaries and layersToKill are flagged for killing + // fractionOfStubsToKillInLayers - The fraction of stubs to kill in the specified layers/region. + // fractionOfStubsToKillEverywhere - The fraction of stubs to kill throughout the tracker + + bool StubKiller::killStub(const TTStub* stub, + const vector layersToKill, + const double minPhiToKill, + const double maxPhiToKill, + const double minZToKill, + const double maxZToKill, + const double minRToKill, + const double maxRToKill, + const double fractionOfStubsToKillInLayers, + const double fractionOfStubsToKillEverywhere) { + // Only kill stubs in specified layers + if (layersToKill.size() > 0) { + // Get the layer the stub is in, and check if it's in the layer you want to kill + DetId stackDetid = stub->getDetId(); + DetId geoDetId(stackDetid.rawId() + 1); + + bool isInBarrel = geoDetId.subdetId() == StripSubdetector::TOB || geoDetId.subdetId() == StripSubdetector::TIB; + + int layerID = 0; + if (isInBarrel) { + layerID = trackerTopology_->layer(geoDetId); + } else { + layerID = 10 * trackerTopology_->side(geoDetId) + trackerTopology_->tidWheel(geoDetId); + } - if (find(layersToKill.begin(), layersToKill.end(), layerID) != layersToKill.end()) { - // Get the phi and z of stub, and check if it's in the region you want to kill - const GeomDetUnit* det0 = trackerGeometry_->idToDetUnit(geoDetId); - const PixelGeomDetUnit* theGeomDet = dynamic_cast(det0); - const PixelTopology* topol = dynamic_cast(&(theGeomDet->specificTopology())); - MeasurementPoint measurementPoint = stub->clusterRef(0)->findAverageLocalCoordinatesCentered(); - LocalPoint clustlp = topol->localPosition(measurementPoint); - GlobalPoint pos = theGeomDet->surface().toGlobal(clustlp); - - // Just in case phi is outside of -pi -> pi - double stubPhi = pos.phi(); - if (stubPhi < -1.0 * TMath::Pi()) - stubPhi += 2.0 * TMath::Pi(); - else if (stubPhi > TMath::Pi()) - stubPhi -= 2.0 * TMath::Pi(); - - if (stubPhi > minPhiToKill && stubPhi < maxPhiToKill && pos.z() > minZToKill && pos.z() < maxZToKill && - pos.perp() > minRToKill && pos.perp() < maxRToKill) { - // Kill fraction of stubs - if (fractionOfStubsToKillInLayers == 1) { - return true; - } else { - static TRandom randomGenerator; - if (randomGenerator.Rndm() < fractionOfStubsToKillInLayers) { + if (find(layersToKill.begin(), layersToKill.end(), layerID) != layersToKill.end()) { + // Get the phi and z of stub, and check if it's in the region you want to kill + const GeomDetUnit* det0 = trackerGeometry_->idToDetUnit(geoDetId); + const PixelGeomDetUnit* theGeomDet = dynamic_cast(det0); + const PixelTopology* topol = dynamic_cast(&(theGeomDet->specificTopology())); + MeasurementPoint measurementPoint = stub->clusterRef(0)->findAverageLocalCoordinatesCentered(); + LocalPoint clustlp = topol->localPosition(measurementPoint); + GlobalPoint pos = theGeomDet->surface().toGlobal(clustlp); + + // Just in case phi is outside of -pi -> pi + double stubPhi = pos.phi(); + if (stubPhi < -1.0 * TMath::Pi()) + stubPhi += 2.0 * TMath::Pi(); + else if (stubPhi > TMath::Pi()) + stubPhi -= 2.0 * TMath::Pi(); + + if (stubPhi > minPhiToKill && stubPhi < maxPhiToKill && pos.z() > minZToKill && pos.z() < maxZToKill && + pos.perp() > minRToKill && pos.perp() < maxRToKill) { + // Kill fraction of stubs + if (fractionOfStubsToKillInLayers == 1) { return true; + } else { + static thread_local TRandom randomGenerator; + if (randomGenerator.Rndm() < fractionOfStubsToKillInLayers) { + return true; + } } } } } - } - // Kill fraction of stubs throughout tracker - if (fractionOfStubsToKillEverywhere > 0) { - static TRandom randomGenerator; - if (randomGenerator.Rndm() < fractionOfStubsToKillEverywhere) { - return true; + // Kill fraction of stubs throughout tracker + if (fractionOfStubsToKillEverywhere > 0) { + static thread_local TRandom randomGenerator; + if (randomGenerator.Rndm() < fractionOfStubsToKillEverywhere) { + return true; + } } + + return false; } - return false; -} + bool StubKiller::killStubInDeadModule(const TTStub* stub) { + if (deadModules_.size() > 0) { + DetId stackDetid = stub->getDetId(); + DetId geoDetId(stackDetid.rawId() + 1); + if (deadModules_.find(geoDetId) != deadModules_.end()) + return true; + } -bool StubKiller::killStubInDeadModule(const TTStub* stub) { - if (deadModules_.size() > 0) { - DetId stackDetid = stub->getDetId(); - DetId geoDetId(stackDetid.rawId() + 1); - if (deadModules_.find(geoDetId) != deadModules_.end()) - return true; + return false; } - return false; -} +}; // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc b/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc index 15ca30e285242..77ef662884dc9 100644 --- a/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc +++ b/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc @@ -4,12 +4,12 @@ #include "DataFormats/DetId/interface/DetId.h" #include "FWCore/Utilities/interface/Exception.h" -namespace TMTT { +namespace tmtt { - std::vector StubWindowSuggest::barrelCut_; - std::vector > StubWindowSuggest::ringCut_; - std::vector > StubWindowSuggest::tiltedCut_; - std::vector StubWindowSuggest::barrelNTilt_; + thread_local std::vector StubWindowSuggest::barrelCut_; + thread_local std::vector > StubWindowSuggest::ringCut_; + thread_local std::vector > StubWindowSuggest::tiltedCut_; + thread_local std::vector StubWindowSuggest::barrelNTilt_; //=== Analyse stub window required for this stub. @@ -31,9 +31,9 @@ namespace TMTT { void StubWindowSuggest::updateStoredWindow(const Stub* stub, double bendHalfWind) { // Values set according to L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py // parameter NTiltedRings for whichever tracker geometry (T3, T4, T5 ...) is used.. - const vector barrelNTilt_T5_init = {0., 12., 12., 12., 0., 0., 0.}; - if (stub->trackerGeometryVersion() == "T5") { - barrelNTilt_ = barrelNTilt_T5_init; + const vector barrelNTilt_init = {0., 12., 12., 12., 0., 0., 0.}; + if (stub->trackerGeometryVersion() >= 5) { // Tilted barrel + barrelNTilt_ = barrelNTilt_init; } else { throw cms::Exception( "StubWindowSuggest: the tracker geometry you are using is not yet known to StubWindowSuggest. Please update " @@ -144,4 +144,4 @@ namespace TMTT { cout << "==============================================================================" << endl; } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/TP.cc b/L1Trigger/TrackFindingTMTT/src/TP.cc index cf61e80e0f9e1..e9dab538ac8b0 100644 --- a/L1Trigger/TrackFindingTMTT/src/TP.cc +++ b/L1Trigger/TrackFindingTMTT/src/TP.cc @@ -7,7 +7,7 @@ using namespace std; -namespace TMTT { +namespace tmtt { //=== Store useful info about this tracking particle @@ -79,18 +79,18 @@ namespace TMTT { const float ptMin = min(settings_->genMinPt(), 0.7 * settings_->houghMinPt()); const float etaMax = max(settings_->genMaxAbsEta(), 0.2 + fabs(settings_->etaRegions()[0])); - static TrackingParticleSelector trackingParticleSelector(ptMin, - 9999999999, - -etaMax, - etaMax, - max(10.0, settings_->genMaxVertR()), - max(35.0, settings_->genMaxVertZ()), - 0, - useOnlyTPfromPhysicsCollisionFalse, - useOnlyInTimeParticles, - true, - false, - genPdgIdsAll); + static thread_local TrackingParticleSelector trackingParticleSelector(ptMin, + 9999999999, + -etaMax, + etaMax, + max(10.0, settings_->genMaxVertR()), + max(35.0, settings_->genMaxVertZ()), + 0, + useOnlyTPfromPhysicsCollisionFalse, + useOnlyInTimeParticles, + true, + false, + genPdgIdsAll); const TrackingParticlePtr tp_ptr(*this); // cast to base class. use_ = trackingParticleSelector(*tp_ptr); @@ -103,18 +103,18 @@ namespace TMTT { if (use_) { const bool useOnlyInTimeParticles = true; const bool useOnlyTPfromPhysicsCollision = true; - static TrackingParticleSelector trackingParticleSelector(settings_->genMinPt(), - 9999999999, - -settings_->genMaxAbsEta(), - settings_->genMaxAbsEta(), - settings_->genMaxVertR(), - settings_->genMaxVertZ(), - 0, - useOnlyTPfromPhysicsCollision, - useOnlyInTimeParticles, - true, - false, - settings_->genPdgIds()); + static thread_local TrackingParticleSelector trackingParticleSelector(settings_->genMinPt(), + 9999999999, + -settings_->genMaxAbsEta(), + settings_->genMaxAbsEta(), + settings_->genMaxVertR(), + settings_->genMaxVertZ(), + 0, + useOnlyTPfromPhysicsCollision, + useOnlyInTimeParticles, + true, + false, + settings_->genPdgIds()); const TrackingParticlePtr tp_ptr(*this); // cast to base class. useForEff_ = trackingParticleSelector(*tp_ptr); @@ -186,4 +186,4 @@ namespace TMTT { nearestJetPt_ = ptOfNearestJet; } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/TrackFitGeneric.cc b/L1Trigger/TrackFindingTMTT/src/TrackFitGeneric.cc index 97a6d2b207420..dab75d2f36c97 100644 --- a/L1Trigger/TrackFindingTMTT/src/TrackFitGeneric.cc +++ b/L1Trigger/TrackFindingTMTT/src/TrackFitGeneric.cc @@ -15,7 +15,7 @@ #include #include -namespace TMTT { +namespace tmtt { //=== Set configuration parameters. @@ -49,4 +49,4 @@ namespace TMTT { } } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/TrackerGeometryInfo.cc b/L1Trigger/TrackFindingTMTT/src/TrackerGeometryInfo.cc index ede5f9999c5da..8f2ec4f2d6756 100644 --- a/L1Trigger/TrackFindingTMTT/src/TrackerGeometryInfo.cc +++ b/L1Trigger/TrackFindingTMTT/src/TrackerGeometryInfo.cc @@ -3,7 +3,7 @@ #include #include -namespace TMTT { +namespace tmtt { TrackerGeometryInfo::TrackerGeometryInfo() : barrelNTiltedModules_(12), barrelNLayersWithTiltedModules_(3), moduleZoR_(), moduleB_() {} @@ -53,4 +53,4 @@ namespace TMTT { } } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc b/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc index 551db8424ae76..d300924eb7c1d 100644 --- a/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc +++ b/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc @@ -4,7 +4,7 @@ #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" -namespace TMTT { +namespace tmtt { //=== Initialize configuration parameters, and note eta range covered by sector and phi coordinate of its centre. @@ -365,4 +365,4 @@ namespace TMTT { rzHelix_set_ = true; } -} // namespace TMTT +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/Utility.cc b/L1Trigger/TrackFindingTMTT/src/Utility.cc index 87c4f6248670e..85a6bd2175c27 100644 --- a/L1Trigger/TrackFindingTMTT/src/Utility.cc +++ b/L1Trigger/TrackFindingTMTT/src/Utility.cc @@ -6,7 +6,7 @@ #include "FWCore/Utilities/interface/Exception.h" -namespace TMTT { +namespace tmtt { //=== Count number of tracker layers a given list of stubs are in. //=== By default, consider both PS+2S modules, but optionally consider only the PS ones. @@ -18,13 +18,13 @@ namespace TMTT { //=== Unpack configuration parameters // Note if using reduced layer ID, so tracker layer can be encoded in 3 bits. - static bool reduceLayerID = settings->reduceLayerID(); + const bool reduceLayerID = settings->reduceLayerID(); // Define layers using layer ID (true) or by bins in radius of 5 cm width (false). - static bool useLayerID = settings->useLayerID(); + const bool useLayerID = settings->useLayerID(); // When counting stubs in layers, actually histogram stubs in distance from beam-line with this bin size. - static float layerIDfromRadiusBin = settings->layerIDfromRadiusBin(); + const float layerIDfromRadiusBin = settings->layerIDfromRadiusBin(); // Inner radius of tracker. - static float trackerInnerRadius = settings->trackerInnerRadius(); + const float trackerInnerRadius = settings->trackerInnerRadius(); // Disable use of reduced layer ID if requested, otherwise take from cfg. bool reduce = (disableReducedLayerID) ? false : reduceLayerID; @@ -196,4 +196,4 @@ namespace TMTT { } } -} // namespace TMTT +} // namespace tmtt From 1abdff8f099f60fedb9e62cc9c17bb70c81a5c78 Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Wed, 13 May 2020 03:27:49 +0100 Subject: [PATCH 16/22] All code review changes (#13) --- L1Trigger/TrackFindingTMTT/BuildFile.xml | 3 - L1Trigger/TrackFindingTMTT/README.md | 272 +- .../TrackFindingTMTT/README_SimpleCode.txt | 216 -- .../interface/ChiSquared4ParamsApprox.h | 28 - .../interface/ChiSquaredFit4.h | 21 + .../interface/ChiSquaredFitBase.h | 61 + .../interface/ConverterToTTTrack.h | 38 +- .../TrackFindingTMTT/interface/DeadModuleDB.h | 100 - .../TrackFindingTMTT/interface/DegradeBend.h | 21 +- .../TrackFindingTMTT/interface/DigitalStub.h | 395 +-- .../TrackFindingTMTT/interface/DigitalTrack.h | 430 +-- .../interface/DupFitTrkKiller.h | 58 + .../interface/GlobalCacheTMTT.h | 56 + L1Trigger/TrackFindingTMTT/interface/HTbase.h | 75 +- L1Trigger/TrackFindingTMTT/interface/HTcell.h | 64 +- L1Trigger/TrackFindingTMTT/interface/HTrphi.h | 101 +- L1Trigger/TrackFindingTMTT/interface/Histos.h | 691 ++-- .../TrackFindingTMTT/interface/InputData.h | 57 +- .../TrackFindingTMTT/interface/KFParamsComb.h | 54 +- .../interface/KFTrackletTrack.h | 90 +- L1Trigger/TrackFindingTMTT/interface/KFbase.h | 170 + .../TrackFindingTMTT/interface/KalmanState.h | 96 +- .../interface/KillDupFitTrks.h | 73 - .../TrackFindingTMTT/interface/KillDupTrks.h | 103 - .../interface/KillDupTrks.icc | 319 -- .../TrackFindingTMTT/interface/L1ChiSquared.h | 58 - .../TrackFindingTMTT/interface/L1KalmanComb.h | 208 -- .../interface/L1fittedTrack.h | 191 +- .../TrackFindingTMTT/interface/L1track2D.h | 47 +- .../TrackFindingTMTT/interface/L1track3D.h | 129 +- .../TrackFindingTMTT/interface/L1trackBase.h | 21 +- .../{Get3Dtracks.h => Make3Dtracks.h} | 61 +- L1Trigger/TrackFindingTMTT/interface/Matrix.h | 60 - .../TrackFindingTMTT/interface/MiniHTstage.h | 21 +- .../TrackFindingTMTT/interface/MuxHToutputs.h | 6 +- .../TrackFindingTMTT/interface/PrintL1trk.h | 29 + L1Trigger/TrackFindingTMTT/interface/Sector.h | 65 +- .../TrackFindingTMTT/interface/Settings.h | 324 +- .../interface/{SimpleLR.h => SimpleLR4.h} | 19 +- L1Trigger/TrackFindingTMTT/interface/Stub.h | 387 +-- .../TrackFindingTMTT/interface/StubCluster.h | 85 - .../TrackFindingTMTT/interface/StubKiller.h | 53 +- .../interface/StubWindowSuggest.h | 22 +- L1Trigger/TrackFindingTMTT/interface/TP.h | 32 +- .../interface/TrackFitFactory.h | 27 + .../interface/TrackFitGeneric.h | 31 +- .../interface/TrackerGeometryInfo.h | 52 - .../interface/TrackerModule.h | 140 + .../TrackFindingTMTT/interface/TrkRZfilter.h | 61 +- .../TrackFindingTMTT/interface/Utility.h | 37 +- .../interfaceDemo/DigiConverter.h | 46 - .../interfaceDemo/DigiConverter.icc | 86 - .../interfaceDemo/DigiProducer.h | 69 - .../interfaceDemo/DigiProducer.icc | 519 --- .../TrackFindingTMTT/interfaceDemo/README | 3 - .../plugins/TMTrackProducer.cc | 459 +-- .../plugins/TMTrackProducer.h | 72 +- .../python/TMTrackProducer_Defaults_cfi.py | 141 +- .../python/TMTrackProducer_Ultimate_cff.py | 51 +- .../python/TMTrackProducer_cff.py | 25 +- .../src/ChiSquared4ParamsApprox.cc | 221 -- .../TrackFindingTMTT/src/ChiSquaredFit4.cc | 174 + .../TrackFindingTMTT/src/ChiSquaredFitBase.cc | 136 + .../src/ConverterToTTTrack.cc | 173 +- .../TrackFindingTMTT/src/DeadModuleDB.cc | 65 - L1Trigger/TrackFindingTMTT/src/DegradeBend.cc | 95 +- L1Trigger/TrackFindingTMTT/src/DigitalStub.cc | 545 +--- .../TrackFindingTMTT/src/DigitalTrack.cc | 259 +- .../{KillDupFitTrks.cc => DupFitTrkKiller.cc} | 182 +- L1Trigger/TrackFindingTMTT/src/HTbase.cc | 119 +- L1Trigger/TrackFindingTMTT/src/HTcell.cc | 81 +- L1Trigger/TrackFindingTMTT/src/HTrphi.cc | 337 +- L1Trigger/TrackFindingTMTT/src/Histos.cc | 2845 ++--------------- L1Trigger/TrackFindingTMTT/src/InputData.cc | 138 +- .../TrackFindingTMTT/src/KFParamsComb.cc | 473 +-- .../TrackFindingTMTT/src/KFTrackletTrack.cc | 7 - L1Trigger/TrackFindingTMTT/src/KFbase.cc | 983 ++++++ L1Trigger/TrackFindingTMTT/src/KalmanState.cc | 282 +- .../TrackFindingTMTT/src/L1ChiSquared.cc | 183 -- .../TrackFindingTMTT/src/L1KalmanComb.cc | 1829 ----------- .../TrackFindingTMTT/src/L1fittedTrack.cc | 110 +- .../src/{Get3Dtracks.cc => Make3Dtracks.cc} | 69 +- L1Trigger/TrackFindingTMTT/src/Matrix.cc | 372 --- L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc | 94 +- .../TrackFindingTMTT/src/MuxHToutputs.cc | 111 +- L1Trigger/TrackFindingTMTT/src/Sector.cc | 248 +- L1Trigger/TrackFindingTMTT/src/Settings.cc | 180 +- L1Trigger/TrackFindingTMTT/src/SimpleLR.cc | 495 --- L1Trigger/TrackFindingTMTT/src/SimpleLR4.cc | 490 +++ L1Trigger/TrackFindingTMTT/src/Stub.cc | 672 +--- L1Trigger/TrackFindingTMTT/src/StubCluster.cc | 125 - L1Trigger/TrackFindingTMTT/src/StubKiller.cc | 165 +- .../TrackFindingTMTT/src/StubWindowSuggest.cc | 128 +- L1Trigger/TrackFindingTMTT/src/TP.cc | 119 +- .../TrackFindingTMTT/src/TrackFitFactory.cc | 42 + .../TrackFindingTMTT/src/TrackFitGeneric.cc | 52 - .../src/TrackerGeometryInfo.cc | 56 - .../TrackFindingTMTT/src/TrackerModule.cc | 156 + L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc | 231 +- L1Trigger/TrackFindingTMTT/src/Utility.cc | 73 +- .../test/L1TrackNtupleMaker_cfg.py | 208 ++ .../test/tmtt_tf_analysis_cfg.py | 36 +- 102 files changed, 6670 insertions(+), 13918 deletions(-) delete mode 100644 L1Trigger/TrackFindingTMTT/README_SimpleCode.txt delete mode 100644 L1Trigger/TrackFindingTMTT/interface/ChiSquared4ParamsApprox.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/ChiSquaredFit4.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/ChiSquaredFitBase.h delete mode 100644 L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/DupFitTrkKiller.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/KFbase.h delete mode 100644 L1Trigger/TrackFindingTMTT/interface/KillDupFitTrks.h delete mode 100644 L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h delete mode 100644 L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc delete mode 100644 L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h delete mode 100644 L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h rename L1Trigger/TrackFindingTMTT/interface/{Get3Dtracks.h => Make3Dtracks.h} (63%) delete mode 100644 L1Trigger/TrackFindingTMTT/interface/Matrix.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h rename L1Trigger/TrackFindingTMTT/interface/{SimpleLR.h => SimpleLR4.h} (82%) delete mode 100644 L1Trigger/TrackFindingTMTT/interface/StubCluster.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/TrackFitFactory.h delete mode 100644 L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h create mode 100644 L1Trigger/TrackFindingTMTT/interface/TrackerModule.h delete mode 100644 L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h delete mode 100644 L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.icc delete mode 100644 L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.h delete mode 100644 L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.icc delete mode 100644 L1Trigger/TrackFindingTMTT/interfaceDemo/README delete mode 100644 L1Trigger/TrackFindingTMTT/src/ChiSquared4ParamsApprox.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/ChiSquaredFit4.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/ChiSquaredFitBase.cc delete mode 100644 L1Trigger/TrackFindingTMTT/src/DeadModuleDB.cc rename L1Trigger/TrackFindingTMTT/src/{KillDupFitTrks.cc => DupFitTrkKiller.cc} (54%) delete mode 100644 L1Trigger/TrackFindingTMTT/src/KFTrackletTrack.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/KFbase.cc delete mode 100644 L1Trigger/TrackFindingTMTT/src/L1ChiSquared.cc delete mode 100644 L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc rename L1Trigger/TrackFindingTMTT/src/{Get3Dtracks.cc => Make3Dtracks.cc} (61%) delete mode 100644 L1Trigger/TrackFindingTMTT/src/Matrix.cc delete mode 100644 L1Trigger/TrackFindingTMTT/src/SimpleLR.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/SimpleLR4.cc delete mode 100644 L1Trigger/TrackFindingTMTT/src/StubCluster.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/TrackFitFactory.cc delete mode 100644 L1Trigger/TrackFindingTMTT/src/TrackFitGeneric.cc delete mode 100644 L1Trigger/TrackFindingTMTT/src/TrackerGeometryInfo.cc create mode 100644 L1Trigger/TrackFindingTMTT/src/TrackerModule.cc create mode 100644 L1Trigger/TrackFindingTMTT/test/L1TrackNtupleMaker_cfg.py diff --git a/L1Trigger/TrackFindingTMTT/BuildFile.xml b/L1Trigger/TrackFindingTMTT/BuildFile.xml index e28d194af9e91..7566f8b6f35aa 100644 --- a/L1Trigger/TrackFindingTMTT/BuildFile.xml +++ b/L1Trigger/TrackFindingTMTT/BuildFile.xml @@ -19,9 +19,6 @@ - - - diff --git a/L1Trigger/TrackFindingTMTT/README.md b/L1Trigger/TrackFindingTMTT/README.md index 07bdfc65c96a4..bc2738a4b3bc5 100644 --- a/L1Trigger/TrackFindingTMTT/README.md +++ b/L1Trigger/TrackFindingTMTT/README.md @@ -1,135 +1,137 @@ -# N.B. THE GIT INSTRUCTIONS HERE APPLY TO THE ORIGINAL TMTT GIT REPO, SO SHOULD BE IGNORED IF USING THE HYBRID REPO. - -# Setup instructions to just run - -To checkout and run, or if your modifications won't need to be put into the central repository, do (on an SL7 machine): - -``` -cmsrel CMSSW_10_6_0 -cd CMSSW_10_6_0/src -cmsenv - -git cms-init -git remote add -t TMTT_1060 TMTT git@github.com:CMS-TMTT/cmssw.git -git fetch TMTT TMTT_1060 -git cms-checkout-topic CMS-TMTT:TMTT_1060 - -scramv1 b -j 8 - -cd L1Trigger/TrackFindingTMTT/test/ -cmsRun tmtt_tf_analysis_cfg.py inputMC=MCsamples/937/RelVal/TTbar/PU200.txt Events=10 -``` - -Note : In this example, the name of the remote repository is given the label TMTT. However the ```git cms-checkout-topic``` commands (and related git cms-*-*) use the username of the remote repository (CMS-TMTT). -Note : that if you want to checkout other packages e.g. the tracklet software, which contains the ntuple maker, you should replace ```git cms-checkout-topic``` with ```git cms-merge-topic``` - -# Setup instructions for making modifications - -Follow the above instructions. At this point, you should be on a local branch called TMTT_1060. - -Below is a simple example of making modifications, pushing them to your remote repository, and making a pull request back to the repository you want your changes to end up in. In this example, we will use the following as the "central" repository (something equivalent of trunkSimpleCode9 in svn) : https://github.com/CMS-TMTT/cmssw.git . Follow the link, and fork the repository to your own account. You then need to add your newly forked repository as a remote repository in your local working area, which we will call ```origin```: -``` -git remote add origin -``` -You can get the url by clicking on "Clone or download" on the webpage for YOUR repository, and will be something like ```git@github.com:/cmssw.git``` - -Lets change branch to one called "myChanges": -``` -git checkout -b myChanges -``` -Modify some files: -``` -echo "#Hello World" >> L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py -``` -Check the status of your modifications: -``` -git status -``` -Which should show something like: -``` -# On branch myChanges -# Changes not staged for commit: -# (use "git add ..." to update what will be committed) -# (use "git checkout -- ..." to discard changes in working directory) -# -# modified: L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py -# -no changes added to commit (use "git add" and/or "git commit -a") -``` -You can undo (revert) your changes (as explained in the message for ```git status```) with ```git checkout -- ...``` -To see your modifications, you can do: -``` -git diff L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py -#or just -#git diff -``` -Which should show something like: -```diff --git a/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py b/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py -index 7b693b9..fc59e07 100644 ---- a/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py -+++ b/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py -@@ -189,3 +189,4 @@ if options.outputDataset == 1: - process.writeDataset.outputCommands.append('keep *_TTAssociator*_TML1Tracks*_*') - - process.schedule = cms.Schedule(process.p, process.pa, process.pd) -+#Hello World -``` -Add the files, and commit: -``` -git add L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py -git commit -m "Modification to tmtt_tf_analysis_cfg comfig file" -``` -Doing ```git status``` will now show: -``` -# On branch myChanges -nothing to commit, working directory clean -``` -Now push these changes to your remote repository. -``` -git push origin myChanges -``` -You are now ready to make a pull request back to the central repository. Go the webpage for your remote repository, and you should see a box stating you have just pushed some changes to the myChanges branch, and gives the option to "Compare & pull request". Make the pull request to merge your changes in the myChanges branch to CMS-TMTT/cmssw:TMTT_1060. - -# Pull changes from the central TMTT repository -If changes (new commits) have been made to the central CMS-TMTT repository since you first checked it out, you can rebase your branch. If you have any local changes, you need to ```git add``` and ```git commit``` them first. Then do: -``` -git pull --rebase TMTT TMTT_1060 -``` -You may have to resolve conflicts, in the usual git way. Then "git push --force" if you want to submit your changes - -Alternatively, if you don't want to commit your local changes, you can do ```git stash```, perform the rebase, and then ```git stash pop```. - -# To run in a newer CMSSW release -The above repository was setup in CMSSW_10_6_0. If you want to run our TMTT software in a newer release, e.g. CMSSW_10_3_0, the command above will attempt things like merging all the differences in all packages between CMSSW_10_6_0 and CMSSW_10_3_0. This can be avoided by performing a ```git cms-rebase-topic```, or by manually performing a spare checkout. For the former, you can then make a new branch of our software for the new CMSSW release - -## Rebase -This example is moving from CMSSW_10_6_0 (the release the TMTT_1060 branch was created in) to CMSSW_10_7_0 -``` -cmsrel CMSSW_10_7_0 -cd CMSSW_10_7_0/src -cmsenv - -git cms-init -git remote add -t TMTT_1060 TMTT git@github.com:CMS-TMTT/cmssw.git -git cms-rebase-topic -o CMSSW_10_6_0 CMS-TMTT:TMTT_1060 -``` -You will end up on a branch called TMTT_1060, which will have our TMTT software on top of CMSSW_10_3_0. You can change to a new branch e.g. TMTT_1060_10_3_0, and push the new branch to the remote repository (if you have permissions). If this new CMSSW release and branch should become the "master" branch everyone should work from, then you should also update the recipes/documentation. - -## Manual sparse-checkout -Here you tell git to only consider the TMTT directory when performing a checkout (which is similar in part is what the above checkout/merge topic commands do, as you don't need to checkout all of CMSSW). - -The difference here is that if you make changes and a pull request, the pull request will be back to the CMS-TMTT:TMTT_1060 branch. -``` -cmsrel CMSSW_10_7_0 -cd CMSSW_10_7_0/src -cmsenv - -git cms-init -git remote add -t TMTT_1060 TMTT git@github.com:CMS-TMTT/cmssw.git -git fetch TMTT TMTT_1060 - -echo "/L1Trigger/TrackFindingTMTT" >> .git/info/sparse-checkout -echo "/TMTrackTrigger/MCsamples" >> .git/info/sparse-checkout - -git checkout -b myChanges TMTT/TMTT_1060 -``` +Two options: + +1) Run the TMTT L1 tracking algorithm (with detailed internal histos) + + cd L1Trigger/TrackFindingTMTT/test/ + cmsRun -n 4 tmtt_tf_analysis_cfg.py + +editing if necessary variables: GEOMETRY (CMS geometry version), inputMCtxt (MC file), makeStubs (regenerate stubs instead of using those from input MC), outputDataSet (write TTTrack collection to file). + +- Look at the printout from the job. At the end, it prints the number of track candidates reconstructed + and the algorithmic tracking efficiency. + +- Look at the performance histograms Hist.root (explained in class "Histos" below) + +2) cmsRun -n 4 L1TrackNtupleMaker_cfg.py +after editing it to change L1TRACKALGO = 'TMTT'. This writes a TTree with the fitfitted L1 tracks to file in a TTTrack collection, from which tracking performance can be studied with ROOT macro. L1TrackNtuplePlot.C. + +N.B. .txt files listing available MC samples can be found in https://github.com/cms-data/L1Trigger-TrackFindingTMTT . + +------------- + +=== Reproducing stubs ===: + +The makeStubs option to remake the stubs is very slow. If you need to do this, it may be better to "cmsRun make_stubs.py" to write the new stubs to disk. + +=== Changing configuration options ===: + +a) The full set of config parameters, which comments explaining what each is, can be found in +specifiied in L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py. + +b) The file mentioned on (a) is imported by +L1Trigger/TrackFindingTMTT/python/TMTrackProducer_cff.py , +which can optionally override the values of some parameters. This file lists the subset of the cfg +parameters that are most useful. + +e.g. Enable tracking down to 2 GeV, enabled displaced tracking etc. + +c) Alternatively, you can use L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Ultimate_cff.py , +which is like (b) but includes improvements not yet available in the firmware, such as reducing the +Pt threshold to 2 GeV. It is suitable for L1 trigger studies. + +d) You can also override cfg parameters in tmtt_tf_analysis_cfg.py . A line there illustrates how. +This file imports TMTrackProducer_cff.py. + +e) The python files in python/ all disable production of histograms & tracking performance summaries to save CPU. However, tmtt_tf_analysis_cfg overrides this default and switches them on via parameters EnableMCtruth & EnableHistos. If you do not care about this analysis information, and only care about producing TTTracks, then keep them switched off. + +------------- + +=== Software structure ===: + +1) Class "TMTrackProducer" -- This is the main routine, which uses classes: "InputData" to unpack the useful +data from the MC dataset, and "Sector" & "HTphi" to do the L1 Hough transform track-finding, +and "Get3Dtracks" to estimate the helix params in 3D, optionally by running an r-z track filter. +It creates matrices of "Sector", "HTphi" & "Get3Dtracks", where the matrix elements each correspond to +a different (phi,eta) sector. It then uses "TrackFitGeneric" to do the track fitting and optionally +"KillDupFitTrks" to remove duplicate tracks after the fit. It employs "Histos" to create the analysis + histograms. + To allow comparison of our tracks with those of the AM & Tracklet groups, it also converts our tracks +to the agree common TTTrack format, with this conversion done by the "ConverterToTTTrack" class. + +2) Class "InputData" -- This unpacks the most useful information from the Stubs and Tracking Particle +(truth particles) collections in the MC dataset, and it for convenient access in the "Stub" and "TP" +classes. Info about tracker silicon modules is stored in "ModuleInfo". The "Stub" class uses a class called "DigitalStub" to digitize and then undigitize again the stub data. This process degrades slightly the resolution, as would happen in the real firmware. The digitisation is optional. It is called from TMTrackProducer after the stubs have been assigned to +sectors. + +3) Class "Sector" -- This knows about the division of the Tracker into (phi,eta) sectors that we use +for the L1 tracking, and decides which of these sectors each stub belongs to. + +4) Class "HTrphi" implements the Hough transforms in the r-phi plane. It inherits from +a base class "HTbase". The Hough transform array is implemented as a matrix of "HTcell" +objects. The HTrphi class stores tracks it finds using the "L1track2D" class. It optionally +uses class "KillDupTrks" to attempt to eliminate duplicate tracks. And optionally, class "MuxHToutputs" +can be used to multiplex the tracks found in different HT arrays (sectors) onto a single output +optical link pair. + +5) Class "HTcell" -- This represents a single cell in an HT array. It provides functions allowing stubs +to be added to this cell, to check if the stubs in a cell give a good track candidate, and to check +if this matches a tracking particle (truth). + +6) Class "Get3Dtracks" makes an estimate of the track parameters in 3D, stored in the "L1track3D" +class, by taking the r-phi track found by the HT, assuming z0 = 0 and that eta is given by the centre +of the eta sector that track is in. Optionally it can also create a second collection of L1track3D, +by running an r-z track filter (from class "TrkRZfilter") on the tracks found by the HT, which gives +cleaner tracks with more precise r-z helix param info. + +7) Class "L1track2D" represents a 2D track, reconstructed in the r-phi or r-z plane by a Hough transform. +Class "L1track3D" represents a 3D tracks, obtained by combining the information in the 2D tracks +from r-phi and r-z Hough transforms. These classes give access to the stubs associated to each track, +to the reconstructed helix parameters, and to the associated truth particle (if any). They represent +the result of the track finding. Both inherit from a pure virtual class L1trackBase, which contains +no functionality but imposes common function names. + +8) Class "KillDupTrks" contains algorithms for killing duplicate tracks found within a single +HT array. Class "KillDupFitTrks" contains algorithms for killing duplicate fitted tracks. + +9) Class "TrkRZfilter" contains r-z track filters, such as the Seed Filter, that check if the stubs +on a track are consistent with a straight line in the r-z plane. + +10) Class "TrackFitGeneric" does one (or more) helix fit(s) to the track candidates, using various +other classes that implement linearized chi2, linear regression or Kalman filter fits. These are: + + - ChiSquared4ParamsApprox (chi2 linear fit, with maths simplified for easier use in FPGA) + - SimpleLR (linear regression fit, which is similar to chi2 fit, but assumes all hits have same uncertainty). + - KFParamsComb: Kalman Filter fit to a 4 or 5 parameter helix. + +The fit also uses a classe to represent the helix state + stubs: KalmanState. + +11) Class "L1fittedTrack" contains the result of running a track fitter (the algorithm for which is +implemented in class "TrackFitAlgo") on the L1track3D track candidate found by the Hough transform. +It gives access to the fitted track parameters and chi2, and via a link to the L1track3D candidate +that produced it, also to the stubs on the track and the associated truth particle (if any). +It inherits from the pure virutal L1trackBase, ensuring it has some common classes with L1track3D and +L1track2D. + +13) Class "DegradeBend" -- This is used by class "Stub" to degrade the resolution on the stub +bend information to that expected in the electronics, as opposed to that currently in CMSSW. + +14) "Utility" -- contains a few useful functions, that are not part of a class. + +15) Class "Settings" -- Reads in the configuration parameters. + +16) Class "Histos" -- Books and fills all the histograms. There are several categories of histograms, +with each category being booked/filled by its own function inside "Histos", and being placed inside its +own ROOT directory in the output histogram file. The categories are "InputData" = plots made with the +Stubs & Tracking Particles; "CheckEtaPhiSectors" = plots checking assignment of stubs to (eta,phi) +sectors; "HT" = plots checking how stubs are stored in the Hough Transform arrays; "TrackCands" = plots +showing number of track candidates found & investigating why tracking sometimes failed, +"EffiAndFakeRate" = plots of tracking efficiency. + +Each user of the code will probably want to book their own set of histograms inside "Histos". So +just consider the version of this class in GIT as a set of examples of how to do things. Don't feel +obliged to understand what every histogram does. + +17) Class "StubKiller" emulates dead modules. It was written to +model the scenarios requested by the Stress Test committee. + +18) Class "GlobalCacheTMTT" contains data shared by all threads. It includes configuration data and histograms. diff --git a/L1Trigger/TrackFindingTMTT/README_SimpleCode.txt b/L1Trigger/TrackFindingTMTT/README_SimpleCode.txt deleted file mode 100644 index b06551be476fc..0000000000000 --- a/L1Trigger/TrackFindingTMTT/README_SimpleCode.txt +++ /dev/null @@ -1,216 +0,0 @@ -# N.B. THE GIT INSTRUCTIONS HERE APPLY TO THE ORIGINAL TMTT GIT REPO, SO SHOULD BE IGNORED IF USING THE HYBRID REPO. THE CODE DOCUMENTATION HERE IS VALID. - -------------------------------------------------------------------------------------- -* How to setup the framework and how to run our analysis code: - -The code is in GITHUB. It can be browsed in in -https://github.com/CMS-TMTT/cmssw/blob/TMTT_1060/L1Trigger/TrackFindingTMTT/ . -(An older version of the code can be found in SVN in https://svnweb.cern.ch/cern/wsvn/UK-TrackTrig/software/cmssw/trunkSimpleCode9). - -- Setup a CMSSW environment. -cmsrel CMSSW_10_6_0 -cd CMSSW_10_6_0/src -cmsenv - -- Software checkout - -Check out from GIT following instructions in https://github.com/CMS-TMTT/cmssw/blob/TMTT_1060/L1Trigger/TrackFindingTMTT/README.md . - -- MC samples - You can use the RelVal samples in L1Trigger/TrackFindingTMTT//test/MCsamples/1040/RelVal/ or - L1Trigger/TrackFindingTMTT/test/MCsamples/937/RelVal/ . - These are based on CMS geometry D21 or D17 respectively. - - It is strongly recommended to copy a sample of events to your local scratch disk, since this will run much - faster than reading them from dcache or XROOTD. - -- Optionally, change the configuration parameters. (See section "Changing configuration options" below). - -- Compile: - scram b -j8 - -- Run the code - cd L1Trigger/TrackFindingTMTT/test/ - cmsRun tmtt_tf_analysis_cfg.py - - or with options: - - cmsRun tmtt_tf_analysis_cfg.py Events=50 inputMC=../../../Samples91X/930pre3/TTbar/PU200.txt histFile=outputHistFile.root makeStubs=1 - -- Look at the printout from the job. At the end, it prints the number of track candidates reconstructed - and the algorithmic tracking efficiency. - -- Look at the analysis histograms (which are explained in '(11) Class "Histos"' below). - root Hist.root - TBrowser b - -------------- - -=== Producing stubs ===: - -If you want to remake stubs on the fly (e.g. with different window sizes), you can do: - -cmsRun tmtt_tf_analysis_cfg.py makeStubs=1 - -This will run the CMSSW modules that produce the stubs (and truth association) before running our tracking algorithms. -Note this will take a long time to run (~100 events per hour for ttbar+200PU), so is only suitable for -debugging on a small number of events. - -To produce the stubs, add them to the event content, and output the new collections to file -(along with the existing event content), you can run make_stubs.py: - -cmsRun make_stubs.py inputMC=../../../Samples91X/930pre3/TTbar/PU200.txt Events=50 - -This will produce an output file output.root, which can then be read by tmtt_tf_analysis_cfg without having to remake the stubs. -i.e. you can then run with (or omit the makeStubs argument as it's False by default): - -cmsRun tmtt_tf_analysis_cfg.py makeStubs=0 - -=== Changing configuration options ===: - -a) The full set of config parameters, which comments explaining what each is, can be found in -specifiied in L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py. - -b) The file mentioned on (a) is imported by -L1Trigger/TrackFindingTMTT/python/TMTrackProducer_cff.py , -which can optionally override the values of some parameters. This file lists the subset of the cfg -parameters that are most useful. - -e.g. Enable tracking down to 2 GeV, enabled displaced tracking etc. - -c) Alternatively, you can use L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Ultimate_cff.py , -which is like (b) but includes improvements not yet available in the firmware, such as reducing the -Pt threshold to 2 GeV. It is suitable for L1 trigger studies. - -d) You can also override cfg parameters in tmtt_tf_analysis_cfg.py . A line there illustrates how. -This file imports TMTrackProducer_cff.py. - -------------- - -=== Software structure ===: - -1) Class "TMTrackProducer" -- This is the main routine, which uses classes: "InputData" to unpack the useful -data from the MC dataset, and "Sector" & "HTphi" to do the L1 Hough transform track-finding, -and "Get3Dtracks" to estimate the helix params in 3D, optionally by running an r-z track filter. -It creates matrices of "Sector", "HTphi" & "Get3Dtracks", where the matrix elements each correspond to -a different (phi,eta) sector. It then uses "TrackFitGeneric" to do the track fitting and optionally -"KillDupFitTrks" to remove duplicate tracks after the fit. It employs "Histos" to create the analysis - histograms. - To allow comparison of our tracks with those of the AM & Tracklet groups, it also converts our tracks -to the agree common TTTrack format, with this conversion done by the "ConverterToTTTrack" class. - -2) Class "InputData" -- This unpacks the most useful information from the Stubs and Tracking Particle -(truth particles) collections in the MC dataset, and it for convenient access in the "Stub" and "TP" -classes. The "Stub" class uses a class called "DigitalStub" to digitize and then undigitize again -the stub data. This process degrades slightly the resolution, as would happen in the real firmware. -The digitisation is optional. It is called from TMTrackProducer after the stubs have been assigned to -sectors. - -3) Class "Sector" -- This knows about the division of the Tracker into (phi,eta) sectors that we use -for the L1 tracking, and decides which of these sectors each stub belongs to. - -4) Class "HTrphi" implements the Hough transforms in the r-phi plane. It inherits from -a base class "HTbase". The Hough transform array is implemented as a matrix of "HTcell" -objects. The HTrphi class stores tracks it finds using the "L1track2D" class. It optionally -uses class "KillDupTrks" to attempt to eliminate duplicate tracks. And optionally, class "MuxHToutputs" -can be used to multiplex the tracks found in different HT arrays (sectors) onto a single output -optical link pair. - -5) Class "HTcell" -- This represents a single cell in an HT array. It provides functions allowing stubs -to be added to this cell, to check if the stubs in a cell give a good track candidate, and to check -if this matches a tracking particle (truth). - -6) Class "Get3Dtracks" makes an estimate of the track parameters in 3D, stored in the "L1track3D" -class, by taking the r-phi track found by the HT, assuming z0 = 0 and that eta is given by the centre -of the eta sector that track is in. Optionally it can also create a second collection of L1track3D, -by running an r-z track filter (from class "TrkRZfilter") on the tracks found by the HT, which gives -cleaner tracks with more precise r-z helix param info. - -7) Class "L1track2D" represents a 2D track, reconstructed in the r-phi or r-z plane by a Hough transform. -Class "L1track3D" represents a 3D tracks, obtained by combining the information in the 2D tracks -from r-phi and r-z Hough transforms. These classes give access to the stubs associated to each track, -to the reconstructed helix parameters, and to the associated truth particle (if any). They represent -the result of the track finding. Both inherit from a pure virtual class L1trackBase, which contains -no functionality but imposes common function names. - -8) Class "KillDupTrks" contains algorithms for killing duplicate tracks found within a single -HT array. Class "KillDupFitTrks" contains algorithms for killing duplicate fitted tracks. - -9) Class "TrkRZfilter" contains r-z track filters, such as the Seed Filter, that check if the stubs -on a track are consistent with a straight line in the r-z plane. - -10) Class "TrackFitGeneric" does one (or more) helix fit(s) to the track candidates, using various -other classes that implement linearized chi2, linear regression or Kalman filter fits. These are: - - - ChiSquared4ParamsApprox (chi2 linear fit, with maths simplified for easier use in FPGA) - - SimpleLR (linear regression fit, which is similar to chi2 fit, but assumes all hits have same uncertainty). - - KF4ParamsComb & KF5ParamsComb: Kalman Filter fits to a 4 or 5 parameter helix. - -The fit also uses a couple of dedicated utility classes (Matrix & kalmanState & StubCluster). - -11) Class "L1fittedTrack" contains the result of running a track fitter (the algorithm for which is -implemented in class "TrackFitAlgo") on the L1track3D track candidate found by the Hough transform. -It gives access to the fitted track parameters and chi2, and via a link to the L1track3D candidate -that produced it, also to the stubs on the track and the associated truth particle (if any). -It inherits from the pure virutal L1trackBase, ensuring it has some common classes with L1track3D and -L1track2D. - -13) Class "DegradeBend" -- This is used by class "Stub" to degrade the resolution on the stub -bend information to that expected in the electronics, as opposed to that currently in CMSSW. - -14) "Utility" -- contains a few useful functions, that are not part of a class. - -15) Class "Settings" -- Reads in the configuration parameters. - -16) Class "Histos" -- Books and fills all the histograms. There are several categories of histograms, -with each category being booked/filled by its own function inside "Histos", and being placed inside its -own ROOT directory in the output histogram file. The categories are "InputData" = plots made with the -Stubs & Tracking Particles; "CheckEtaPhiSectors" = plots checking assignment of stubs to (eta,phi) -sectors; "HT" = plots checking how stubs are stored in the Hough Transform arrays; "TrackCands" = plots -showing number of track candidates found & investigating why tracking sometimes failed, -"EffiAndFakeRate" = plots of tracking efficiency. - -Each user of the code will probably want to book their own set of histograms inside "Histos". So -just consider the version of this class in GIT as a set of examples of how to do things. Don't feel -obliged to understand what every histogram does. - -17) Class "DeadModuleDB" is used both to emulate dead modules by killing stubs in certain tracker -regions, and to recover efficiency caused by dead modules indicating in which sectors looser -track-finding cuts are required. - -Class "StubKiller" also emulates dead modules. It was written in collaboration with Tracklet to -model the scenarios requested by the Stress Test committee. If it is used, then the emulation in -DeadModuleDB should not be. - -18) SimTracker/TrackTriggerAssociation/ contains a modification to the official L1 track to TrackingParticle -matching software used by Louise Skinnari's official L1 track analysis code. This modification (made by -Seb Viret) to TTTrackAssociator.h allows one incorrect hit on L1 tracks, whereas the original matching code -allowed none. - ------- - -To update the dOxygen documentation, just type "doxygen". This creates the web page inside html/ -A recent version of this documentation is in http://tomalini.web.cern.ch/tomalini/IanSimpleCode/hierarchy.html . - -=== To output TTTrack dataset to EDM output_dataset.root file (e.g. for L1 trigger studies) === - -Before doing "cmsRun tmtt_tf_analysis_cfg.py", edit this script to set "outputDataset = 1". -You may also need to edit the python associating the TMTT L1 tracks to the MC truth particles, -to specify which track fitter you are using. - -If you only want to make TTTracks, and don't care about the TMTT histograms or job summary, you -can save CPU by setting cfg params: - -TMTrackProducer.EnableMCtruth = cms.bool(False) -TMTrackProducer.EnableHistos = cms.bool(False) - -=== To run Louise Skinnari's official CMS L1 track performance analysis code === - -(This is an alternative way of running the code, useful for comparing with the Tracklet & Hybrid - L1 track algos, since it guarantees identical tracking performance definitions, but providing - no histograms of performance inside the TMTT chain). - -a) cd L1Trigger/TrackFindingTracklet/test/ -b) Edit L1TrackNtupleMaker_cfg.py, changing: L1TRKALGO = 'TMTT' -b) cmsRun L1TrackNtupleMaker_cfg.py -c) ./makeHists.csh (prints tracking performance & adds plots to TrkPlots/ diff --git a/L1Trigger/TrackFindingTMTT/interface/ChiSquared4ParamsApprox.h b/L1Trigger/TrackFindingTMTT/interface/ChiSquared4ParamsApprox.h deleted file mode 100644 index e25f415613a91..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/ChiSquared4ParamsApprox.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef L1Trigger_TrackFindingTMTT_ChiSquared4ParamsApprox_h -#define L1Trigger_TrackFindingTMTT_ChiSquared4ParamsApprox_h - -#include "L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h" - -namespace tmtt { - - class ChiSquared4ParamsApprox : public L1ChiSquared { - public: - ChiSquared4ParamsApprox(const Settings* settings, const uint nPar); - - ~ChiSquared4ParamsApprox() {} - - protected: - std::vector seed(const L1track3D& l1track3D); - std::vector residuals(std::vector x); - Matrix D(std::vector x); - Matrix Vinv(); - std::map convertParams(std::vector x); - - private: - std::vector mapToVec(std::map x); - std::map vecToMap(std::vector x); - }; - -} // namespace tmtt - -#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/ChiSquaredFit4.h b/L1Trigger/TrackFindingTMTT/interface/ChiSquaredFit4.h new file mode 100644 index 0000000000000..00af64301b6be --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/ChiSquaredFit4.h @@ -0,0 +1,21 @@ +#ifndef L1Trigger_TrackFindingTMTT_ChiSquaredFit4_h +#define L1Trigger_TrackFindingTMTT_ChiSquaredFit4_h + +#include "L1Trigger/TrackFindingTMTT/interface/ChiSquaredFitBase.h" + +namespace tmtt { + + class ChiSquaredFit4 : public ChiSquaredFitBase { + public: + ChiSquaredFit4(const Settings* settings, const uint nPar); + + protected: + TVectorD seed(const L1track3D& l1track3D); + TVectorD residuals(const TVectorD& x); + TMatrixD D(const TVectorD& x); + TMatrixD Vinv(); + }; + +} // namespace tmtt + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/ChiSquaredFitBase.h b/L1Trigger/TrackFindingTMTT/interface/ChiSquaredFitBase.h new file mode 100644 index 0000000000000..90c9b825f141e --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/ChiSquaredFitBase.h @@ -0,0 +1,61 @@ +#ifndef L1Trigger_TrackFindingTMTT_ChiSquaredFitBase_h +#define L1Trigger_TrackFindingTMTT_ChiSquaredFitBase_h + +///=== This is the base class for the linearised chi-squared track fit algorithms. + +///=== Written by: Sioni Summers and Alexander D. Morton. + +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" +#include "TMatrixD.h" +#include "TVectorD.h" + +#include +#include +#include + +namespace tmtt { + + class ChiSquaredFitBase : public TrackFitGeneric { + public: + enum PAR_IDS { INVR, PHI0, T, Z0, D0 }; + + public: + ChiSquaredFitBase(const Settings* settings, const uint nPar); + + L1fittedTrack fit(const L1track3D& l1track3D); + + protected: + /* Methods */ + virtual TVectorD seed(const L1track3D& l1track3D) = 0; + virtual TVectorD residuals(const TVectorD& x) = 0; // Stub residuals/uncertainty + virtual TMatrixD D(const TVectorD& x) = 0; // derivatives + virtual TMatrixD Vinv() = 0; // Covariances + + /* Variables */ + double qOverPt_seed_; + std::vector stubs_; + TVectorD trackParams_; + uint nPar_; + float largestresid_; + int ilargestresid_; + double chiSq_; + + private: + void calculateChiSq(const TVectorD& resids); + void calculateDeltaChiSq(const TVectorD& deltaX, const TVectorD& covX); + + int numFittingIterations_; + int killTrackFitWorstHit_; + double generalResidualCut_; + double killingResidualCut_; + + unsigned int minStubLayers_; + unsigned int minStubLayersRed_; + }; + +} // namespace tmtt + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h b/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h index d6e523f98b4c1..c7ff08509f61d 100644 --- a/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h +++ b/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h @@ -7,49 +7,27 @@ #include "DataFormats/L1TrackTrigger/interface/TTTypes.h" -using namespace std; +//=== Convert non-persistent L1 track collection to the official persistent CMSSW EDM TTTrack format. +//=== Works for both L1track3D and for L1fittedTrk objects. namespace tmtt { - typedef edmNew::DetSetVector > DetSetVec; - typedef edm::Ref > TTStubRef; - - //=== Convert our non-persistent L1 track collection to the official persistent CMSSW EDM TTTrack format. - //=== Works for both L1track3D and for L1fittedTrk4and5 objects. + typedef edmNew::DetSetVector > TTStubDetSetVec; + typedef edm::Ref > TTStubRef; class ConverterToTTTrack { public: // Initialize constants. ConverterToTTTrack(const Settings* settings) : settings_(settings) { invPtToInvR_ = settings->invPtToInvR(); } - ~ConverterToTTTrack() {} - - // N.B. The function with argument L1fittedTrk4and5 below should be used if both 4 and 5 parameter helix fit results - // are to be stored in the same TTTrack object. Whilst the function with argument L1fittedTrack should be used if - // they are two be stored in two different TTTrack objects. - // One of these is a better idea, but we don't yet know which, so keep both functions! - // N.B. Do not call these two functions for invalid fitted tracks. - - // Convert L1track3D (track candidate before fit) to TTTrack format. - TTTrack makeTTTrack(const L1track3D& trk, unsigned int iPhiSec, unsigned int iEtaReg) const; - // Convert L1fittedTrack (track candidate after fit) to TTTrack format. - TTTrack makeTTTrack(const L1fittedTrack& trk, + // Convert L1fittedTrack or L1track3D (track candidates after/before fit) to TTTrack format. + TTTrack makeTTTrack(const L1trackBase* trk, unsigned int iPhiSec, unsigned int iEtaReg) const; private: - // Get references to stubs on track. (Templated, so works for either L1track3D or L1fittedTrack). - template - std::vector getStubRefs(const T& trk) const { - std::vector ttstubrefs; - const std::vector stubs = trk.getStubs(); - for (size_t ii = 0; ii < stubs.size(); ii++) { - TTStubRef ref = *stubs.at(ii); - ttstubrefs.push_back(ref); - } - - return ttstubrefs; - } + // Get references to stubs on track. (Works for either L1track3D or L1fittedTrack). + std::vector stubRefs(const L1trackBase* trk) const; private: const Settings* settings_; // Configuration parameters. diff --git a/L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h b/L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h deleted file mode 100644 index d89730d9d2bf8..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef L1Trigger_TrackFindingTMTT_DeadModuleDB_h -#define L1Trigger_TrackFindingTMTT_DeadModuleDB_h - -#include "DataFormats/Math/interface/deltaPhi.h" - -#include -#include -#include -#include -#include - -using namespace std; - -namespace tmtt { - - class Settings; - class Stub; - - //=============================================================================================================== - /** -* This class allows you to declare parts of the Tracker to be dead. -* You should edit the C++ implementation of this class to specify which moduels are dead. -* -* Modify function defineDeadTrackRegions() to kill stubs in certain layers & angular regions of the tracker. -* -* Modify function defineDeadSectors() to reduce the number of layers cut on tracks in certain (eta,phi) sectors. -*/ - //=============================================================================================================== - - class DeadModuleDB { - public: - DeadModuleDB() { - this->defineDeadTrackerRegions(); - this->defineDeadSectors(); - } - - ~DeadModuleDB() {} - - // Does this stub lie in a dead region of the tracker? - // This function is only invoked if cfg param DeadSimulate = True & used to kill stubs to emulate dead regions. - bool killStub(const Stub* stub) const; - - // Should the required number of layers that tracks must have be reduced by 1 in the given sector, because of dead modules - // within it? This function is only invoked if cfg param DeadReduceLayers = True. - bool reduceLayerCut(unsigned int iPhiSec, unsigned int iEtaReg) const { - return reduceLayerCut_.find(pair(iPhiSec, iEtaReg)) != reduceLayerCut_.end(); - } - - public: - // Define a class to describe regions of the tracker barrel that are dead. - class DeadBarrelRegion { - public: - DeadBarrelRegion(float phiMin, float phiMax, float zMin, float zMax) - : phiMin_(phiMin), phiMax_(phiMax), zMin_(zMin), zMax_(zMax) {} - - public: - const float phiMin_; - const float phiMax_; - const float zMin_; - const float zMax_; - }; - - // Define a class to describe regions of the tracker endcap that are dead. - class DeadEndcapRegion { - public: - DeadEndcapRegion(float phiMin, float phiMax, float rMin, float rMax) - : phiMin_(phiMin), phiMax_(phiMax), rMin_(rMin), rMax_(rMax) {} - - public: - const float phiMin_; - const float phiMax_; - const float rMin_; - const float rMax_; - }; - - private: - // Return the difference in azimuth of two angles (phi1 - phi2) in the range 0 to 2*PI. - float deltaPhiPos(float phi1, float phi2) const { return (M_PI + reco::deltaPhi(phi1 - phi2 - M_PI, 0.)); } - - // Define regions of the tracker in which the modules are dead. - // This function is only relevant if cfg param DeadSimulate = True, when any stubs in modules within these regions are killed, - // so emulating MC with dead regions. - void defineDeadTrackerRegions(); - - // Define sectors in which the cut on number of layer numbers on tracks should be reduced by 1, because - // they contain dead modules. This function is only relevant if cfg param DeadReduceLayers = True. - // Ideally these sectors would be derived from the regions declared in definedDeadTrackerRegions(). - void defineDeadSectors(); - - private: - // Regions of the tracker barrel & endcap which are dead. - map > deadBarrelRegions_; - map > deadEndcapRegions_; - - // Sectors in which layer cut should be reduced. - set > reduceLayerCut_; - }; - -} // namespace tmtt -#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h b/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h index 45152a174ce51..c43788e878372 100644 --- a/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h +++ b/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h @@ -7,8 +7,6 @@ class TrackerTopology; -using namespace std; - namespace tmtt { class DegradeBend { @@ -25,12 +23,7 @@ namespace tmtt { * This gives slightly more granular encoding with Pt > 3 GeV. * * TMTT histograms "hisBendFEVsLayerOrRingPS" & "hisBendFEVsLayerOrRing2S" produced by the "Histos" class - * are useful for debugging. - * - * IMPORTANT: If the code below detects a stub with bend outside the assumed window, meaning that looser windows - * were used when generating the MC, then it sets boolean reject = true to tell you this. You should reject this stub, - * and ideally update the hard-wired constants in this C++. - *------------------------------------------------------------------------------------------------------------------- + * are useful for debugging. *------------------------------------------------------------------------------------------------------------------- */ public: @@ -46,13 +39,12 @@ namespace tmtt { // (Input argument windowFEnew specifies the stub window size that should be used for this stub instead // of the window sizes specified in TTStubAlgorithmRegister_cfi.py , but it will ONLY replace the latter // sizes if it windowFEnew is smaller. If you always want to use TTStubAlgorithmRegister_cfi.py, then - // set windowFEnew to a large number, such as 99999.). + // std::set windowFEnew to a large number, such as 99999.). void degrade(float bend, bool psModule, const DetId& stDetId, float windowFEnew, float& degradedBend, - bool& reject, unsigned int& numInGroup) const; private: @@ -62,18 +54,9 @@ namespace tmtt { const DetId& stDetId, float windowFEnew, float& degradedBend, - bool& reject, unsigned int& numInGroup, unsigned int& windowHalfStrips) const; - // Check for mistakes - void sanityChecks(bool psModule, - const DetId& stDetId, - float windowFEnew, - float degradedBend, - unsigned int numInGroup, - unsigned int windowHalfStrips) const; - private: const TrackerTopology* theTrackerTopo_; diff --git a/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h b/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h index 75c772006ba56..751f7e4373306 100644 --- a/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h +++ b/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h @@ -2,16 +2,10 @@ #define L1Trigger_TrackFindingTMTT_DigitalStub_h #include "FWCore/Utilities/interface/Exception.h" -#include +#include +#include -using namespace std; - -//=== Used to digitize stubs both for input to GP and for input to HT. -//=== N.B. After constructing an object of type DigitalStub, you must call functions -//=== init() and make() before you try using any of the other functions to access digitized stub info. - -//=== WARNING: Not all variables available in the GP are available inside the HT or visa-versa, -//=== so think about the hardware when calling the functions below. +//=== Digtizes stubs for input to GP, HT & KF namespace tmtt { @@ -19,210 +13,76 @@ namespace tmtt { class DigitalStub { public: - // Digitization for KF in Hybrid tracking + //--- Hybrid tracking: simplified digitization for KF. DigitalStub(const Settings* settings, double r, double phi, double z, unsigned int iPhiSec); - // Note configuration parameters (for TMTT tracking) - DigitalStub(const Settings* settings); + //--- TMTT tracking: + // Initialize stub with floating point stub coords, range of HT m-bin values consistent with bend, + // bend and phi sector. + DigitalStub(const Settings* settings, + double phi_orig, + double r_orig, + double z_orig, + unsigned int mbin_min_orig, + unsigned int mbin_max_orig, + double bend_orig, + unsigned int iPhiSec); ~DigitalStub() {} - // Initialize stub with original, floating point stub coords, - // range of m bin (= q/Pt bin) values allowed by bend filter, - // normal & "reduced" tracker layer of stub, stub bend, and pitch & seperation of module, - // and half-length of strip or pixel in r and in z, and if it's in barrel, tilted barrel and/or PS modules. - void init(float phi_orig, - float r_orig, - float z_orig, - unsigned int min_qOverPt_bin_orig, - unsigned int max_qOverPt_bin_orig, - unsigned int layerID, - unsigned int layerIDreduced, - float bend_orig, - float pitch, - float sep, - float rErr, - float zErr, - bool barrel, - bool tiltedBarrel, - bool psModule); - - // Digitize stub for input to Geographic Processor, with stub phi coord. measured relative to phi nonant that contains specified phi sector. - void makeGPinput(unsigned int iPhiSec); - - // Digitize stub for input to Hough transform, with stub phi coord. measured relative to specified phi sector. - // (Also still allows digital data for input to GP to be accessed). - void makeHTinput(unsigned int iPhiSec); - - // Digitize stub for input to r-z Seed Filter or Track Fitter. - // Argument is "SeedFilter" or name of Track Fitter. - void makeSForTFinput(string SForTF); - - void makeDRinput(unsigned int stubId); - - // N.B. The m_min and m_max variables should logically be calculated by DigitalStub::makeHTinput(), - // but are actually calculated by Stub::digitizeForHTinput() because too lazy to move code. - - //--- The functions below return variables post-digitization. - //--- Do not call any of the functions below, unless you have already called init() and make()! - - // Digits corresponding to stub coords. - // %%% Those common to GP & HT input. - int iDigi_Rt() const { - this->okGP(); - return iDigi_Rt_; - } // r coord. relative to chosen radius - unsigned int iDigi_R() const { - this->okSForTF(); - return iDigi_R_; - } // r coord. - int iDigi_Z() const { - this->okGP(); - return iDigi_Z_; - } // z coord. - int iDigi_Z_KF() const { - this->okSForTF(); - return iDigi_Z_KF_; - } // z coord for internal KF use - // %%% Those exclusively input to HT. - unsigned int iDigi_PhiSec() const { - this->okHT(); - return iDigi_PhiSec_; - } // phi sector number - int iDigi_PhiS() const { - this->okHT(); - return iDigi_PhiS_; - } // phi coord. relative to sector - // %%% Those exclusively input to GP. - unsigned int moduleType() const { - this->okin(); - return moduleType_; - } // module type ID (gives pitch/spacing) - unsigned int iDigi_Nonant() const { - this->okGP(); - return iDigi_Nonant_; - } // phi nonant number - int iDigi_PhiO() const { - this->okGP(); - return iDigi_PhiO_; - } // phi coord. relative to nonant - int iDigi_Bend() const { - this->okGP(); - return iDigi_Bend_; - } // stub bend - // %%% Those exclusively input to seed filter. - unsigned int iDigi_rErr() const { - this->okSForTF(); - return iDigi_rErr_; - } // Stub uncertainty in r, assumed equal to half strip length. - unsigned int iDigi_zErr() const { - this->okSForTF(); - return iDigi_zErr_; - } // Stub uncertainty in z, assumed equal to half strip length. - - // Floating point stub coords derived from digitized info (so with degraded resolution). - // %%% Those common to GP & HT input. - float phi() const { - this->okGP(); - return phi_; - } - float r() const { - this->okGP(); - return r_; - } - float z() const { - this->okGP(); - return z_; - } - float rt() const { - this->okGP(); - return rt_; - } - // %%% Those exclusively input to HT. - float phiS() const { - this->okHT(); - return phiS_; - } - // Integer data after digitization (which doesn't degrade its resolution, but can recast it in a different form). - // m bin range (= q/Pt bin range) allowed by bend filter - // Note this range is centred on zero, so differs from Stub::min_qOverPt_bin() etc. which return a +ve number. - int m_min() const { - this->okHT(); - return m_min_; - } - int m_max() const { - this->okHT(); - return m_max_; - } - // Tracker layer identifier encoded as it will be sent along optical link. - // Note that this differs from the encoding returned by Stub::layerIdReduced()! - unsigned int iDigi_LayerID() const { - this->okHT(); - return iDigi_LayerID_; - } - // %%% Those exclusively input to GP. - float phiO() const { - this->okGP(); - return phiO_; - } - float bend() const { - this->okGP(); - return bend_; - } - // %%% Those exclusively input to seed filter. - float rErr() const { - this->okSForTF(); - return rErr_; - } - float zErr() const { - this->okSForTF(); - return zErr_; - } - - //--- The functions below give access to the original variables prior to digitization. - //%%% Those common to GP & HT input. - float orig_phi() const { - this->okin(); - return phi_orig_; - } - float orig_r() const { - this->okin(); - return r_orig_; - } - float orig_z() const { - this->okin(); - return z_orig_; - } - //%%% Those exclusively input to GP. - float orig_bend() const { - this->okin(); - return bend_orig_; - } - // %%% Those exclusively input to seed filter. - float orig_rErr() const { - this->okin(); - return rErr_orig_; - } - float orig_zErr() const { - this->okin(); - return zErr_orig_; - } + // Redo phi digitisation assigning stub to a different phi sector; + // (Return arg indicates if any work done). + bool changePhiSec(unsigned int iPhiSec); + + //--- Original floating point stub data before digitization. + double r_orig() const { return r_orig_; } + double rt_orig() const { return rt_orig_; } // r with respect to reference radius + double phi_orig() const { return phi_orig_; } + double phiS_orig() const { return phiS_orig_; } // with respect to centre of sector + double phiN_orig() const { return phiN_orig_; } // with respect to centre of nonant + double z_orig() const { return z_orig_; } + unsigned int mbin_min_orig() const { return mbin_min_orig_; } + unsigned int mbin_max_orig() const { return mbin_max_orig_; } + double bend_orig() const { return bend_orig_; } + + //--- Digitised stub data + + int iDigi_PhiN() const { return iDigi_PhiN_; } + int iDigi_Bend() const { return iDigi_Bend_; } + int iDigi_PhiS() const { return iDigi_PhiS_; } + int mbin_min() const { return mbin_min_; } + int mbin_max() const { return mbin_max_; } + int iDigi_Rt() const { return iDigi_Rt_; } + unsigned int iDigi_R() const { return iDigi_R_; } + int iDigi_Z() const { return iDigi_Z_; } + + //--- floating point stub data following digitisation & undigitisation again + // "GP" indicates valid variable for input to GP etc. If no such name, always valid. + double phiN() const { return phiN_; } + double phi_GP() const { return phi_GP_; } + double bend() const { return bend_; } + double phiS() const { return phiS_; } + double phi_HT_TF() const { return phi_HT_TF_; } + double rt_GP_HT() const { return rt_GP_HT_; } + double r_GP_HT() const { return r_GP_HT_; } + double r_SF_TF() const { return r_SF_TF_; } + double rt_SF_TF() const { return rt_SF_TF_; } + double z() const { return z_; } //--- Utility: return phi nonant number corresponding to given phi sector number. - unsigned int iGetNonant(unsigned int iPhiSec) const { return floor(iPhiSec * numPhiNonants_ / numPhiSectors_); } - unsigned int StubId() const { - this->okDR(); - return stubId_; - } + unsigned int iNonant(unsigned int iPhiSec) const { return floor(iPhiSec * numPhiNonants_ / numPhiSectors_); } private: - // Redigitize stub for input to Geographic Processor, if it was previously digitized for a different phi sector. - void quickMakeGPinput(int iPhiSec); + // Set cfg params. + void setCfgParams(const Settings* settings); - // Redigitize stub for input to Hough transform, if it was previously digitized for a different phi sector. - void quickMakeHTinput(int iPhiSec); + // Digitize stub + void digitize(unsigned int iPhiSec); + + // Undigitize stub again + void undigitize(unsigned int iPhiSec); // Check that stub coords. & bend angle are within assumed digitization range. void checkInRange() const; @@ -230,62 +90,29 @@ namespace tmtt { // Check that digitisation followed by undigitisation doesn't change significantly the stub coordinates. void checkAccuracy() const; - // Check that makeGPinput() or makeHTinput() are called before accessing digitized stub info. - void okGP() const { - if (!ranMakeGPinput_) - throw cms::Exception("DigitalStub: You forgot to call makeGPinput() or makeHTinput()!"); - } - void okHT() const { - if (!ranMakeHTinput_) - throw cms::Exception("DigitalStub: You forgot to call makeGPinput() or makeHTinput()!"); - } - void okSForTF() const { - if (ranMakeSForTFinput_ == "") - throw cms::Exception("DigitalStub: You forgot to call makeSForTFinput()!"); - } - void okDR() const { - if (!ranMakeDRinput_) - throw cms::Exception("DigitalStub: You forgot to call makeDRinput()!"); - } - - // Check that init() is called before accessing original pre-digitization variables. - void okin() const { - if (!ranInit_) - throw cms::Exception("DigitalStub: You forgot to call init()!"); - } - private: - //--- To check DigitialStub correctly initialized. - bool ranInit_; - bool ranMakeGPinput_; - bool ranMakeHTinput_; - string ranMakeSForTFinput_; - bool ranMakeDRinput_; - //--- configuration + //--- Configuration // Digitization configuration int iFirmwareType_; unsigned int phiSectorBits_; unsigned int phiSBits_; - float phiSRange_; + double phiSRange_; unsigned int rtBits_; - float rtRange_; + double rtRange_; unsigned int zBits_; - float zRange_; - unsigned int phiOBits_; - double phiORange_; + double zRange_; + unsigned int phiNBits_; + double phiNRange_; unsigned int bendBits_; - float bendRange_; + double bendRange_; // Digitization multipliers - float phiSMult_; - float rtMult_; - float zMult_; - double phiOMult_; - float bendMult_; - - // Are we using reduced layer ID, so layer can be packed into 3 bits? - bool reduceLayerID_; + double phiSMult_; + double rtMult_; + double zMult_; + double phiNMult_; + double bendMult_; // Number of phi sectors and phi nonants. unsigned int numPhiSectors_; @@ -293,54 +120,54 @@ namespace tmtt { // Phi sector and phi nonant width (radians) double phiSectorWidth_; double phiNonantWidth_; + // Centre of phi sector 0. + double phiCentreSec0_; + // Centre of this phi sector & nonant. + double phiSectorCentre_; + double phiNonantCentre_; // Radius from beamline with respect to which stub r coord. is measured. - float chosenRofPhi_; - + double chosenRofPhi_; // Number of q/Pt bins in Hough transform array. unsigned int nbinsPt_; + // Min. of HT m-bin array in firmware. + int min_array_mbin_; - //--- Original floating point stub coords before digitization. - float phi_orig_; - float r_orig_; - float z_orig_; - float rt_orig_; + // Used to check if new digitisation requests were already done. + unsigned int iPhiSec_done_; + + //--- Original floating point stub data before digitization. + double r_orig_; + double rt_orig_; + double phi_orig_; double phiS_orig_; - double phiO_orig_; - unsigned int layerID_; // Tracker layer ID - unsigned int layerIDreduced_; // Tracker "reduced" layer ID - unsigned int min_qOverPt_bin_orig_; // Range in q/Pt bins in HT array compatible with stub bend. (+ve definate) - unsigned int max_qOverPt_bin_orig_; - float bend_orig_; - float rErr_orig_; - float zErr_orig_; + double phiN_orig_; + double z_orig_; + unsigned int mbin_min_orig_; + unsigned int mbin_max_orig_; + double bend_orig_; + + //--- Digitised stub data - //--- Digits corresponding to stub coords. - unsigned int iDigi_PhiSec_; + int iDigi_PhiN_; + int iDigi_Bend_; int iDigi_PhiS_; + int mbin_min_; + int mbin_max_; int iDigi_Rt_; unsigned int iDigi_R_; int iDigi_Z_; - int iDigi_Z_KF_; - unsigned int iDigi_LayerID_; // Encoded tracker layer - int m_min_; // Range in q/Pt bins in HT array compatible with stub bend. (range centred on zero) - int m_max_; - unsigned int moduleType_; - unsigned int iDigi_Nonant_; - int iDigi_PhiO_; - int iDigi_Bend_; - unsigned int iDigi_rErr_; - unsigned int iDigi_zErr_; - unsigned int stubId_; - //--- Floating point stub coords derived from digitized info (so with degraded resolution). - float phi_; - float r_; - float z_; - float phiS_; - float rt_; - float phiO_; - float bend_; - float rErr_; - float zErr_; + + //--- floating point stub data following digitisation & undigitisation again + double phiN_; + double phi_GP_; + double bend_; + double phiS_; + double phi_HT_TF_; + double rt_GP_HT_; + double r_GP_HT_; + double r_SF_TF_; + double rt_SF_TF_; + double z_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h b/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h index 639a131c28451..bfe4200278d69 100644 --- a/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h +++ b/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h @@ -2,318 +2,108 @@ #define L1Trigger_TrackFindingTMTT_DigitalTrack_h #include "FWCore/Utilities/interface/Exception.h" -#include "L1Trigger/TrackFindingTMTT/interface/TP.h" +#include #include #include -using namespace std; - namespace tmtt { class Settings; + class L1fittedTrack; //==================================================================================================== /** -* Used to digitize the fitted track helix params. -* WARNING: Digitizes according to common format agreed for KF and SimpleLR fitters, -* and uses KF digitisation cfg for all fitters except SimpleLR. -*/ + * Used to digitize the fitted track helix params. + * WARNING: Digitizes according to common format agreed for KF and SimpleLR4 fitters, + * and uses KF digitisation cfg for all fitters except SimpleLR4. + */ //==================================================================================================== class DigitalTrack { public: - // Note configuration parameters. - DigitalTrack(const Settings* settings); - // Dummy constructor - DigitalTrack() {} - // DigitalTrack(); + // Digitize track + DigitalTrack(const Settings* settings, const std::string& fitterName, const L1fittedTrack* fitTrk); ~DigitalTrack() {} - /// Initialize track with original, floating point coords - void init(const string& fitterName, - unsigned int nHelixParams, - unsigned int iPhiSec, - unsigned int iEtaReg, - int mbin, - int cbin, - int mBinhelix, - int cBinhelix, - unsigned int hitPattern, - float qOverPt_orig, - float d0_orig, - float phi0_orig, - float tanLambda_orig, - float z0_orig, - float chisquaredRphi_orig, - float chisquaredRz_orig, - float qOverPt_bcon_orig, - float phi0_bcon_orig, - float chisquaredRphi_bcon_orig, // beam-spot constrained values. - unsigned int nLayers, - bool consistent, - bool consistentSect, - bool accepted, - float tp_qOverPt, - float tp_d0, - float tp_phi0, - float tp_tanLambda, - float tp_z0, - float tp_eta, - int tp_index, - bool tp_useForAlgEff, - bool tp_useForEff, - int tp_pdgId); - - // Digitize track - void makeDigitalTrack(); - //--- The functions below return variables post-digitization. - //--- Do not call any of the functions below, unless you have already called init() and make()! - - // Digits corresponding to track params. - int iDigi_oneOver2r() const { - this->ok(); - return iDigi_oneOver2r_; - } // half inverse curvature of track. - int iDigi_d0() const { - this->ok(); - return iDigi_d0_; - } - int iDigi_phi0rel() const { - this->ok(); - return iDigi_phi0rel_; - } // measured relative to centre of sector - int iDigi_z0() const { - this->ok(); - return iDigi_z0_; - } - int iDigi_tanLambda() const { - this->ok(); - return iDigi_tanLambda_; - } - unsigned int iDigi_chisquaredRphi() const { - this->ok(); - return iDigi_chisquaredRphi_; - } - unsigned int iDigi_chisquaredRz() const { - this->ok(); - return iDigi_chisquaredRz_; - } + + // half inverse curvature of track. + int iDigi_oneOver2r() const { return iDigi_oneOver2r_; } + int iDigi_d0() const { return iDigi_d0_; } + // measured relative to centre of sector + int iDigi_phi0rel() const { return iDigi_phi0rel_; } + int iDigi_z0() const { return iDigi_z0_; } + int iDigi_tanLambda() const { return iDigi_tanLambda_; } + unsigned int iDigi_chisquaredRphi() const { return iDigi_chisquaredRphi_; } + unsigned int iDigi_chisquaredRz() const { return iDigi_chisquaredRz_; } // Digits corresponding to track params with post-fit beam-spot constraint. - int iDigi_oneOver2r_bcon() const { - this->ok(); - return iDigi_oneOver2r_bcon_; - } // half inverse curvature of track. - int iDigi_phi0rel_bcon() const { - this->ok(); - return iDigi_phi0rel_bcon_; - } // measured relative to centre of sector - unsigned int iDigi_chisquaredRphi_bcon() const { - this->ok(); - return iDigi_chisquaredRphi_bcon_; - } + int iDigi_oneOver2r_bcon() const { return iDigi_oneOver2r_bcon_; } // half inverse curvature of track. + int iDigi_phi0rel_bcon() const { return iDigi_phi0rel_bcon_; } // measured relative to centre of sector + unsigned int iDigi_chisquaredRphi_bcon() const { return iDigi_chisquaredRphi_bcon_; } // Floating point track params derived from digitized info (so with degraded resolution). - float qOverPt() const { - this->ok(); - return qOverPt_; - } - float oneOver2r() const { - this->ok(); - return oneOver2r_; - } // half inverse curvature of track. - float d0() const { - this->ok(); - return d0_; - } - float phi0() const { - this->ok(); - return phi0_; - } - float phi0rel() const { - this->ok(); - return phi0rel_; - } // measured relative to centre of sector - float z0() const { - this->ok(); - return z0_; - } - float tanLambda() const { - this->ok(); - return tanLambda_; - } - float chisquaredRphi() const { - this->ok(); - return chisquaredRphi_; - } - float chisquaredRz() const { - this->ok(); - return chisquaredRz_; - } + float qOverPt() const { return qOverPt_; } + float oneOver2r() const { return oneOver2r_; } // half inverse curvature of track. + float d0() const { return d0_; } + float phi0() const { return phi0_; } + float phi0rel() const { return phi0rel_; } // measured relative to centre of sector + float z0() const { return z0_; } + float tanLambda() const { return tanLambda_; } + float chisquaredRphi() const { return chisquaredRphi_; } + float chisquaredRz() const { return chisquaredRz_; } // Floating point track params derived from digitized track params with post-fit beam-spot constraint. - float qOverPt_bcon() const { - this->ok(); - return qOverPt_bcon_; - } - float oneOver2r_bcon() const { - this->ok(); - return oneOver2r_bcon_; - } // half inverse curvature of track. - float phi0_bcon() const { - this->ok(); - return phi0_bcon_; - } - float phi0rel_bcon() const { - this->ok(); - return phi0rel_bcon_; - } // measured relative to centre of sector - float chisquaredRphi_bcon() const { - this->ok(); - return chisquaredRphi_bcon_; - } - - unsigned int iPhiSec() const { - this->okin(); - return iPhiSec_; - } - unsigned int iEtaReg() const { - this->okin(); - return iEtaReg_; - } - int mBinhelix() const { - this->okin(); - return mBinhelix_; - } - int cBinhelix() const { - this->okin(); - return cBinhelix_; - } - unsigned int nlayers() const { - this->okin(); - return nlayers_; - } - int mBinHT() const { - this->okin(); - return mBin_; - } - int cBinHT() const { - this->okin(); - return cBin_; - } - bool accepted() const { - this->okin(); - return accepted_; - } - unsigned int hitPattern() const { - this->okin(); - return hitPattern_; - } + float qOverPt_bcon() const { return qOverPt_bcon_; } + float oneOver2r_bcon() const { return oneOver2r_bcon_; } // half inverse curvature of track. + float phi0_bcon() const { return phi0_bcon_; } + float phi0rel_bcon() const { return phi0rel_bcon_; } // measured relative to centre of sector + float chisquaredRphi_bcon() const { return chisquaredRphi_bcon_; } + + unsigned int iPhiSec() const { return iPhiSec_; } + unsigned int iEtaReg() const { return iEtaReg_; } + int mBinhelix() const { return mBinhelix_; } + int cBinhelix() const { return cBinhelix_; } + unsigned int nlayers() const { return nlayers_; } + int mBinHT() const { return mBin_; } + int cBinHT() const { return cBin_; } + bool accepted() const { return accepted_; } + unsigned int hitPattern() const { return hitPattern_; } //--- The functions below give access to the original variables prior to digitization. //%%% Those common to GP & HT input. - float orig_qOverPt() const { - this->okin(); - return qOverPt_orig_; - } - float orig_oneOver2r() const { - this->okin(); - return oneOver2r_orig_; - } // half inverse curvature of track. - float orig_d0() const { - this->okin(); - return d0_orig_; - } - float orig_phi0() const { - this->okin(); - return phi0_orig_; - } - float orig_phi0rel() const { - this->okin(); - return phi0rel_orig_; - } // measured relative to centre of sector - float orig_z0() const { - this->okin(); - return z0_orig_; - } - float orig_tanLambda() const { - this->okin(); - return tanLambda_orig_; - } - float orig_chisquaredRphi() const { - this->okin(); - return chisquaredRphi_orig_; - } - float orig_chisquaredRz() const { - this->okin(); - return chisquaredRz_orig_; - } - - float tp_pt() const { - this->okin(); - return tp_pt_; - } - float tp_eta() const { - this->okin(); - return tp_eta_; - } - float tp_d0() const { - this->okin(); - return tp_d0_; - } - float tp_phi0() const { - this->okin(); - return tp_phi0_; - } - float tp_tanLambda() const { - this->okin(); - return tp_tanLambda_; - } - float tp_z0() const { - this->okin(); - return tp_z0_; - } - float tp_qoverpt() const { - this->okin(); - return tp_qoverpt_; - } - int tp_index() const { - this->okin(); - return tp_index_; - } - float tp_useForAlgEff() const { - this->okin(); - return tp_useForAlgEff_; - } - float tp_useForEff() const { - this->okin(); - return tp_useForEff_; - } - float tp_pdgId() const { - this->okin(); - return tp_pdgId_; - } + float orig_qOverPt() const { return qOverPt_orig_; } + float orig_oneOver2r() const { return oneOver2r_orig_; } // half inverse curvature of track. + float orig_d0() const { return d0_orig_; } + float orig_phi0() const { return phi0_orig_; } + float orig_phi0rel() const { return phi0rel_orig_; } // measured relative to centre of sector + float orig_z0() const { return z0_orig_; } + float orig_tanLambda() const { return tanLambda_orig_; } + float orig_chisquaredRphi() const { return chisquaredRphi_orig_; } + float orig_chisquaredRz() const { return chisquaredRz_orig_; } + + float tp_pt() const { return tp_pt_; } + float tp_eta() const { return tp_eta_; } + float tp_d0() const { return tp_d0_; } + float tp_phi0() const { return tp_phi0_; } + float tp_tanLambda() const { return tp_tanLambda_; } + float tp_z0() const { return tp_z0_; } + float tp_qoverpt() const { return tp_qoverpt_; } + int tp_index() const { return tp_index_; } + float tp_useForAlgEff() const { return tp_useForAlgEff_; } + float tp_useForEff() const { return tp_useForEff_; } + float tp_pdgId() const { return tp_pdgId_; } //--- Utility: return phi nonant number corresponding to given phi sector number. unsigned int iGetNonant(unsigned int iPhiSec) const { return floor(iPhiSec * numPhiNonants_ / numPhiSectors_); } - bool available() const { return ranMake_; } - private: - // Check DigitalTrack correctly initialized; - void okin() const { - if (!ranInit_) - throw cms::Exception("DigitalTrack: You forgot to call init()!"); - } - void ok() const { - if (!ranMake_) - throw cms::Exception("DigitalTrack: You forgot to call makeDigitalTrack()!"); - } - - // Get digitisation configuration parameters for the specific track fitter being used here. - void getDigiCfg(const string& fitterName); + // Load digitisation configuration parameters for the specific track fitter being used here. + void loadDigiCfg(const std::string& fitterName); + + // Digitize track + void makeDigitalTrack(); // Check that stub coords. are within assumed digitization range. void checkInRange() const; @@ -322,39 +112,18 @@ namespace tmtt { void checkAccuracy() const; private: - // Check DigitalTrack correctly initialized. - bool ranInit_; - bool ranMake_; - // Configuration params const Settings* settings_; - string fitterName_; - unsigned int nHelixParams_; - - // Integer data after digitization (which doesn't degrade its resolution, but can recast it in a different form). - unsigned int nlayers_; - unsigned int iPhiSec_; - unsigned int iEtaReg_; - int mBinhelix_; - int cBinhelix_; - bool consistent_; - bool consistentSect_; - int mBin_; - int cBin_; - bool accepted_; - - float tp_qoverpt_; - float tp_pt_; - float tp_eta_; - float tp_d0_; - float tp_phi0_; - float tp_tanLambda_; - float tp_z0_; - int tp_index_; - bool tp_useForAlgEff_; - bool tp_useForEff_; - int tp_pdgId_; + // Number of phi sectors and phi nonants. + unsigned int numPhiSectors_; + unsigned int numPhiNonants_; + double phiSectorWidth_; + double phiNonantWidth_; + double phiSectorCentre_; + float chosenRofPhi_; + unsigned int nbinsPt_; + float invPtToDPhi_; // Digitization configuration bool skipTrackDigi_; @@ -378,19 +147,25 @@ namespace tmtt { double tanLambdaMult_; double chisquaredMult_; - // Number of phi sectors and phi nonants. - unsigned int numPhiSectors_; - unsigned int numPhiNonants_; - double phiSectorWidth_; - double phiNonantWidth_; - double phiSectorCentre_; - float chosenRofPhi_; - unsigned int nbinsPt_; - float invPtToDPhi_; + // Fitted track - //--- Original floating point stub coords before digitization. + std::string fitterName_; + unsigned int nHelixParams_; + // Integer data after digitization (which doesn't degrade its resolution, but can recast it in a different form). + unsigned int nlayers_; + unsigned int iPhiSec_; + unsigned int iEtaReg_; + int mBin_; + int cBin_; + int mBinhelix_; + int cBinhelix_; unsigned int hitPattern_; + bool consistent_; + bool consistentSect_; + bool accepted_; + + //--- Original floating point stub coords before digitization. float qOverPt_orig_; float oneOver2r_orig_; @@ -439,6 +214,19 @@ namespace tmtt { float phi0_bcon_; float phi0rel_bcon_; float chisquaredRphi_bcon_; + + // Truth + float tp_qoverpt_; + float tp_pt_; + float tp_eta_; + float tp_d0_; + float tp_phi0_; + float tp_tanLambda_; + float tp_z0_; + int tp_index_; + bool tp_useForAlgEff_; + bool tp_useForEff_; + int tp_pdgId_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/DupFitTrkKiller.h b/L1Trigger/TrackFindingTMTT/interface/DupFitTrkKiller.h new file mode 100644 index 0000000000000..5d003b712271c --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/DupFitTrkKiller.h @@ -0,0 +1,58 @@ +#ifndef L1Trigger_TrackFindingTMTT_DupFitTrkKiller_h +#define L1Trigger_TrackFindingTMTT_DupFitTrkKiller_h + +#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" + +#include +#include + +/** +* Kill duplicate fitted tracks. +* +* Currently this is intended to run only on tracks found within a single (eta,phi) sector. +*/ + +namespace tmtt { + + class Settings; + + class DupFitTrkKiller { + public: + /** + * Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. + */ + DupFitTrkKiller(const Settings* settings); + + ~DupFitTrkKiller() {} + + /** + * Eliminate duplicate tracks from the input collection, and so return a reduced list of tracks. + */ + std::list filter(const std::list& vecTracks) const; + + private: + /** + * Duplicate removal algorithm that eliminates duplicates + * by requiring that the fitted (q/Pt, phi0) of the track correspond to the same HT cell in which the track + * was originally found by the HT. + */ + std::list filterAlg1(const std::list& tracks) const; + + /** + * Duplicate removal algorithm that eliminates duplicates + * by requiring that no two tracks should have fitted (q/Pt, phi0) that correspond to the same HT + * cell. If they do, then only the first to arrive is kept. + */ + std::list filterAlg2(const std::list& tracks) const; + + // Debug printout of which tracks are duplicates. + void printDuplicateTracks(const std::list& tracks) const; + + private: + const Settings* settings_; // Configuration parameters. + unsigned int dupTrkAlg_; // Specifies choice of algorithm for duplicate track removal. + }; + +} // namespace tmtt + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h b/L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h new file mode 100644 index 0000000000000..e6dab023018aa --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h @@ -0,0 +1,56 @@ +#ifndef L1Trigger_TrackFindingTMTT_GlobalCacheTMTT_h +#define L1Trigger_TrackFindingTMTT_GlobalCacheTMTT_h + +// Data shared across all streams by TMTT L1 tracking. +// +// Provides the python configuration parameters +// & optional histogramming/debugging. + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h" +#include "L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h" +#include "L1Trigger/TrackFindingTMTT/interface/TrackerModule.h" +#include "L1Trigger/TrackFindingTMTT/interface/Histos.h" + +#include +#include + +namespace tmtt { + + class GlobalCacheTMTT { + public: + GlobalCacheTMTT(const edm::ParameterSet& iConfig) + : settings_(iConfig), // Python configuration params + htRphiErrMon_({0., 0, 0, 0}), // rphi HT error monitoring + stubWindowSuggest_(&settings_), // Recommend FE stub window sizes. + hists_(&settings_) // Histograms + { + hists_.book(); + } + + // Get functions + Settings& settings() const { return settings_; } + HTrphi::ErrorMonitor& htRphiErrMon() const { return htRphiErrMon_; } + StubWindowSuggest& stubWindowSuggest() const { return stubWindowSuggest_; } + const std::list& listTrackerModule() const { return listTrackerModule_; } + Histos& hists() const { return hists_; } + + // Set functions + void setListTrackerModule(const std::list& list) const { + // Only need one copy of tracker geoemtry for histogramming. + if (listTrackerModule_.size() == 0) + listTrackerModule_ = list; + } + + private: + mutable Settings settings_; + mutable HTrphi::ErrorMonitor htRphiErrMon_; + mutable StubWindowSuggest stubWindowSuggest_; + mutable std::list listTrackerModule_; + mutable Histos hists_; + }; + +} // namespace tmtt + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/HTbase.h b/L1Trigger/TrackFindingTMTT/interface/HTbase.h index 51349fdd46968..97975a1961a5a 100644 --- a/L1Trigger/TrackFindingTMTT/interface/HTbase.h +++ b/L1Trigger/TrackFindingTMTT/interface/HTbase.h @@ -3,16 +3,15 @@ #include "L1Trigger/TrackFindingTMTT/interface/HTcell.h" #include "L1Trigger/TrackFindingTMTT/interface/L1track2D.h" -#include "L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h" #include "boost/numeric/ublas/matrix.hpp" #include +#include #include +#include using boost::numeric::ublas::matrix; -using namespace std; - //=== Base class for Hough Transform array for a single (eta,phi) sector. namespace tmtt { @@ -24,27 +23,11 @@ namespace tmtt { class HTbase { public: - HTbase() {} - virtual ~HTbase() {} - // Initialization. - virtual void init(const Settings* settings, - unsigned int iPhiSec, - unsigned int iEtaReg, - float etaMinSector, - float etaMaxSector, - float) = 0; - - void init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg) { - settings_ = settings; - iPhiSec_ = iPhiSec; - iEtaReg_ = iEtaReg; - optoLinkID_ = this->calcOptoLinkID(); - } + HTbase( + const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, unsigned int nBinsX, unsigned int nBinsY); - // Add stub to HT array. - // N.B. The argument lists for this are different for r-phi & r-z HT, so unfortunately it can't be declared in base class. - //virtual void store(const Stub*) = 0; + virtual ~HTbase() {} // Termination. Causes HT array to search for tracks etc. virtual void end(); @@ -60,8 +43,8 @@ namespace tmtt { virtual unsigned int numStubsExc() const; // Get all the cells that make up the array, which in turn give access to the stubs inside them. - // N.B. You can use getAllCells().size1() and getAllCells().size2() to get the dimensions ofthe array. - virtual const matrix& getAllCells() const { return htArray_; } + // N.B. You can use allCells().size1() and allCells().size2() to get the dimensions ofthe array. + virtual const matrix>& allCells() const { return htArray_; } //=== Info about track candidates found. @@ -70,7 +53,7 @@ namespace tmtt { // Get list of all track candidates found in this HT array, giving access to stubs on each track // and helix parameters. - virtual const vector& trackCands2D() const { return trackCands2D_; } + virtual const std::list& trackCands2D() const { return trackCands2D_; } // Number of track candidates found in this HT array. // If a duplicate track filter was run, this will contain the reduced list of tracks passing this filter. @@ -80,58 +63,56 @@ namespace tmtt { virtual unsigned int numStubsOnTrackCands2D() const; // Get all reconstructed tracks that were associated to the given tracking particle. - // (If the vector is empty, then the tracking particle was not reconstructed in this sector). - virtual vector assocTrackCands2D(const TP& tp) const; + // (If the std::vector is empty, then the tracking particle was not reconstructed in this sector). + virtual std::vector assocTrackCands2D(const TP& tp) const; //=== Function to replace the collection of 2D tracks found by this HT. // (This is used by classes MuxHToutputs & MiniHTstage). - virtual void replaceTrackCands2D(const vector& newTracks); - virtual void replaceTrackCands2D(const vector& newTracks) { trackCands2D_ = newTracks; } + virtual void replaceTrackCands2D(const std::list& newTracks) { trackCands2D_ = newTracks; } //=== Utilities // Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). // The helix parameters returned will be those corresponding to the two axes of the HT array. // So they might be (q/pt, phi65), (eta, z0) or (z110, z0) etc. depending on the configuration. - virtual pair helix2Dhough(unsigned int i, unsigned int j) const = 0; + virtual std::pair helix2Dhough(unsigned int i, unsigned int j) const = 0; // Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). // The helix parameters returned will be always be (q/Pt, phi0) or (tan_lambda, z0), irrespective of // how the axes of the HT array are defined. - virtual pair helix2Dconventional(unsigned int i, unsigned int j) const = 0; + virtual std::pair helix2Dconventional(unsigned int i, unsigned int j) const = 0; // Which cell in HT array should this TP be in, based on its true trajectory? // Returns 999999 in at least one index if TP not expected to be in any cell in this array. - virtual pair trueCell(const TP* tp) const = 0; + virtual std::pair trueCell(const TP* tp) const = 0; // Which cell in HT array should this fitted track be in, based on its fitted trajectory? // Returns 999999 in at least one index if fitted track not expected to be in any cell in this array. - virtual pair getCell(const L1fittedTrack* fitTrk) const = 0; + virtual std::pair cell(const L1fittedTrack* fitTrk) const = 0; // Disable filters (used for debugging). virtual void disableBendFilter(); protected: // Given a range in one of the coordinates specified by coordRange, calculate the corresponding range of bins. The other arguments specify the axis. And also if some cells nominally associated to stub are to be killed. - virtual pair convertCoordRangeToBinRange(pair coordRange, - unsigned int nBinsAxis, - float coordAxisMin, - float coordAxisBinSize, - unsigned int killSomeHTcells, - bool debug = false) const; + virtual std::pair convertCoordRangeToBinRange(std::pair coordRange, + unsigned int nBinsAxis, + float coordAxisMin, + float coordAxisBinSize, + unsigned int killSomeHTcells) const; private: // Return a list of all track candidates found in this array, giving access to all the stubs on each one // and the track helix parameters, plus the associated truth particle (if any). - virtual vector calcTrackCands2D() const; + virtual std::list calcTrackCands2D() const; // If requested, kill those tracks in this sector that can't be read out during the time-multiplexed period, because // the HT has associated too many stubs to tracks. - virtual vector killTracksBusySec(const vector& tracks) const = 0; + virtual std::list killTracksBusySec(const std::list& tracks) const = 0; // Define the order in which the hardware processes rows of the HT array when it outputs track candidates. - virtual vector rowOrder(unsigned int numRows) const = 0; + virtual std::vector rowOrder(unsigned int numRows) const = 0; // Calculate output opto-link ID from HT, assuming there is no MUX stage. virtual unsigned int calcOptoLinkID() const { @@ -145,19 +126,19 @@ namespace tmtt { unsigned int iPhiSec_; // Sector number. unsigned int iEtaReg_; - unsigned int optoLinkID_; // ID of opto-link from HT to Track Fitter. + unsigned int nBinsX_; // Bins in HT array. + unsigned int nBinsY_; // Hough transform array. // This has two dimensions, representing the two track helix parameters being varied. - matrix htArray_; + matrix> htArray_; - // Contains algorithm used for duplicate track removal. - KillDupTrks killDupTrks_; + unsigned int optoLinkID_; // ID of opto-link from HT to Track Fitter. // List of all track candidates found by HT & their associated properties. // If a duplicate track filter was run inside the HT, this will contain the reduced list of tracks passing this filter. // If some tracks could not be read out during the TM period, then such tracks are deleted from this list. - vector trackCands2D_; + std::list trackCands2D_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/HTcell.h b/L1Trigger/TrackFindingTMTT/interface/HTcell.h index 97826f94dc0fd..2e20b503be496 100644 --- a/L1Trigger/TrackFindingTMTT/interface/HTcell.h +++ b/L1Trigger/TrackFindingTMTT/interface/HTcell.h @@ -10,8 +10,6 @@ #include #include -using namespace std; - //=== A single cell in a Hough Transform array. namespace tmtt { @@ -21,32 +19,29 @@ namespace tmtt { class HTcell { public: - HTcell() {} - ~HTcell() {} - // Initialization with cfg params, // sector number, rapidity range of current sector, estimated q/Pt of cell, // and the bin number of the cell along the q/Pt axis of the r-phi HT array, // and a flag indicating if this cell is the merge of smaller HT cells. - void init(const Settings* settings, - unsigned int iPhiSec, - unsigned int iEtaReg, - float etaMinSector, - float etaMaxSector, - float qOverPt, - unsigned int ibin_qOverPt, - bool mergedCell, - bool miniHTcell = false); + HTcell(const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float etaMinSector, + float etaMaxSector, + float qOverPt, + unsigned int ibin_qOverPt, + bool mergedCell, + bool miniHTcell = false); // Add stub to this cell in HT array. - void store(const Stub* stub) { vStubs_.push_back(stub); } + void store(Stub* stub) { vStubs_.push_back(stub); } // Add stub to this cell in HT array, indicating also which subsectors within the sector is consistent with. - void store(const Stub* stub, const vector& inSubSecs) { + void store(Stub* stub, const std::vector& inSubSecs) { this->store(stub); subSectors_[stub] = inSubSecs; if (inSubSecs.size() != numSubSecs_) - throw cms::Exception("HTcell: Wrong number of subsectors!"); + throw cms::Exception("LogicError") << "HTcell: Wrong number of subsectors!"; } // Termination. Search for track in this HT cell etc. @@ -62,7 +57,7 @@ namespace tmtt { //=== If no filters were requested, they are identical to the unfiltered stubs.) // Get filtered stubs in this cell in HT array. - const vector& stubs() const { return vFilteredStubs_; } + const std::vector& stubs() const { return vFilteredStubs_; } // Check if a specific stub is in this cell and survived filtering. bool stubInCell(const Stub* stub) const { @@ -72,12 +67,13 @@ namespace tmtt { // Check if a specific stub was stored to this cell (without checking if it survived filtering). bool stubStoredInCell(const Stub* stub) const { return (std::count(vStubs_.begin(), vStubs_.end(), stub) > 0); } - // Return info useful for deciding if there is a track candidate in this cell. - unsigned int numStubs() const { return vFilteredStubs_.size(); } // Number of filtered stubs - unsigned int numLayers() const { return numFilteredLayersInCell_; } // Number of tracker layers with filtered stubs - unsigned int numLayersSubSec() const { - return numFilteredLayersInCellBestSubSec_; - } // Number of tracker layers with filtered stubs, requiring all stubs to be in same subsector to be counted. The number returned is the highest layer count found in any of the subsectors in this sector. If subsectors are not used, it is equal to numLayers(). + //-- Return info useful for deciding if there is a track candidate in this cell. + // Number of filtered stubs + unsigned int numStubs() const { return vFilteredStubs_.size(); } + // Number of tracker layers with filtered stubs + unsigned int numLayers() const { return numFilteredLayersInCell_; } + // Number of tracker layers with filtered stubs, requiring all stubs to be in same subsector to be counted. The number returned is the highest layer count found in any of the subsectors in this sector. If subsectors are not used, it is equal to numLayers(). + unsigned int numLayersSubSec() const { return numFilteredLayersInCellBestSubSec_; } // Useful for debugging. unsigned int numUnfilteredStubs() const { return vStubs_.size(); } // Number of unfiltered stubs @@ -89,7 +85,7 @@ namespace tmtt { // killed tracks are still found by this function. It is in HTbase::calcTrackCands2D() that they are killed. bool trackCandFound() const { return (numFilteredLayersInCellBestSubSec_ >= - Utility::numLayerCut("HT", settings_, iPhiSec_, iEtaReg_, fabs(qOverPtCell_))); + Utility::numLayerCut(Utility::AlgoStep::HT, settings_, iPhiSec_, iEtaReg_, std::abs(qOverPtCell_))); } //=== Disable filters (used for debugging). @@ -108,11 +104,11 @@ namespace tmtt { float dphi(float rad) const { return (invPtToDphi_ * rad * qOverPtCell_); } // Produce a filtered collection of stubs in this cell that all have consistent bend - vector bendFilter(const vector& stubs) const; + std::vector bendFilter(const std::vector& stubs) const; // Filter stubs so as to prevent more than specified number of stubs being stored in one cell. // This reflects finite memory of hardware. - vector maxStubCountFilter(const vector& stubs) const; + std::vector maxStubCountFilter(const std::vector& stubs) const; private: //=== Configuration parameters @@ -147,16 +143,12 @@ namespace tmtt { //=== data - vector vStubs_; // Stubs in this cell - vector - vFilteredStubs_; // Stubs in cell selected by applying all requested stub filters (e.g. bend and/or eta filter ...) - - unsigned int numFilteredLayersInCell_; // How many tracker layers these filtered stubs are in - unsigned int - numFilteredLayersInCellBestSubSec_; // Ditto, but requiring all stubs to be in same subsector to be counted. This number is the highest layer count found in any of the subsectors in this sector. + std::vector vStubs_; // Stubs in this cell + std::vector vFilteredStubs_; // Ditto after all requested stub filters (e.g. bend filter) - map> - subSectors_; // Indicate which subsectors within the sector this stub is consistent with. + unsigned int numFilteredLayersInCell_; + unsigned int numFilteredLayersInCellBestSubSec_; + std::map> subSectors_; // Subsectors in sector stub consistent with. }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/HTrphi.h b/L1Trigger/TrackFindingTMTT/interface/HTrphi.h index 503db55829661..ee7bd894017ad 100644 --- a/L1Trigger/TrackFindingTMTT/interface/HTrphi.h +++ b/L1Trigger/TrackFindingTMTT/interface/HTrphi.h @@ -4,11 +4,10 @@ #include "L1Trigger/TrackFindingTMTT/interface/HTbase.h" #include +#include #include #include -using namespace std; - //=== The r-phi Hough Transform array for a single (eta,phi) sector. //=== //=== Its axes are (q/Pt, phiTrk), where phiTrk is the phi at which the track crosses a @@ -23,20 +22,35 @@ namespace tmtt { class HTrphi : public HTbase { public: - HTrphi() : HTbase() {} - ~HTrphi() {} + enum class HTshape { square, diamond, hexagon, brick }; + + //--- Error monitoring + + struct ErrorMonitor { + // Maximum |gradient| of line corresponding to any stub. FW assumes it's < 1.0. + std::atomic maxLineGradient; + // Error count when stub added to cell not NE, E or SE of cell stub added to in previous HT column. + std::atomic numErrorsTypeA; + // Error count when stub added to more than 2 cells in one HT column + std::atomic numErrorsTypeB; + // Error count normalisation + std::atomic numErrorsNorm; + }; // Initialization with sector number, eta range covered by sector and phi coordinate of its centre. - void init(const Settings* settings, - unsigned int iPhiSec, - unsigned int iEtaReg, - float etaMinSector, - float etaMaxSector, - float phiCentreSector); + HTrphi(const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float etaMinSector, + float etaMaxSector, + float phiCentreSector, + ErrorMonitor* errMon = nullptr); + + ~HTrphi() {} // Add stub to HT array. // If eta subsectors are being used within each sector, specify which ones the stub is compatible with. - void store(const Stub* stub, const vector& inEtaSubSecs); + void store(Stub* stub, const std::vector& inEtaSubSecs); // Termination. Causes HT array to search for tracks etc. // ... function end() is in base class ... @@ -50,35 +64,26 @@ namespace tmtt { // Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). // The helix parameters returned will be those corresponding to the two axes of the HT array. // So they might be (q/pt, phi0) or (q/pt, phi65) etc. depending on the configuration. - pair helix2Dhough(unsigned int i, unsigned int j) const; + std::pair helix2Dhough(unsigned int i, unsigned int j) const; // Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). // The helix parameters returned will be always be (q/pt, phi0), irrespective of how the axes // of the HT array are defined. - pair helix2Dconventional(unsigned int i, unsigned int j) const; + std::pair helix2Dconventional(unsigned int i, unsigned int j) const; // Which cell in HT array should this TP be in, based on its true trajectory? // (If TP is outside HT array, it it put in the closest bin inside it). - pair trueCell(const TP* tp) const; + std::pair trueCell(const TP* tp) const; // Which cell in HT array should this fitted track be in, based on its fitted trajectory? // Always uses beam-spot constrained trajectory if available. // (If fitted track is outside HT array, it it put in the closest bin inside it). - pair getCell(const L1fittedTrack* fitTrk) const; + std::pair cell(const L1fittedTrack* fitTrk) const; // Check if specified cell has been merged with its 2x2 neighbours into a single cell, // as it is in low Pt region. bool mergedCell(unsigned int iQoverPtBin, unsigned int jPhiTrkBin) const; - //--- Functions to check that stub filling is compatible with limitations of firmware. - - // Calculate maximum |gradient| that any stub's line across any of the r-phi HT arrays could have, to check it is < 1. - static float maxLineGrad() { return maxLineGradient_; } - // Summed over all r-phi HT arrays, returns fraction of stubs added to an HT column which do not lie NE, E or SE of stub added to previous HT column. - static float fracErrorsTypeA() { return numErrorsTypeA_ / float(numErrorsNormalisation_); } - // Summed over all r-phi HT arrays, returns fraction of stubs added to more than 2 cells in one HT column. (Only a problem for Thomas' firmware). - static float fracErrorsTypeB() { return numErrorsTypeB_ / float(numErrorsNormalisation_); } - // Number of stubs received from GP, irrespective of whether the stub was actually stored in // a cell in the HT array. unsigned int nReceivedStubs() const { return nReceivedStubs_; } @@ -88,26 +93,33 @@ namespace tmtt { private: // For a given Q/Pt bin, find the range of phi bins that a given stub is consistent with. - pair iPhiRange(const Stub* stub, unsigned int iQoverPtBin, bool debug = false) const; + std::pair iPhiRange(const Stub* stub, + unsigned int iQoverPtBin, + bool debug = false) const; // Check that limitations of firmware would not prevent stub being stored correctly in this HT column. - void countFirmwareErrors(unsigned int iQoverPtBin, unsigned int iPhiTrkBinMin, unsigned int iPhiTrkBinMax); + void countFirmwareErrors(unsigned int iQoverPtBin, + unsigned int iPhiTrkBinMin, + unsigned int iPhiTrkBinMax, + unsigned int jPhiTrkBinMinLast, + unsigned int jPhiTrkBinMaxLast); // Calculate maximum |gradient| that any stub's line across this HT array could have, so can check it doesn't exceed 1. float calcMaxLineGradArray() const; // If requested, kill those tracks in this sector that can't be read out during the time-multiplexed period, because // the HT has associated too many stubs to tracks. - vector killTracksBusySec(const vector& tracks) const; + std::list killTracksBusySec(const std::list& tracks) const; // Define the order in which the hardware processes rows of the HT array when it outputs track candidates. // Currently corresponds to highest Pt tracks first. // If two tracks have the same Pt, the -ve charge one is output before the +ve charge one. - vector rowOrder(unsigned int numRows) const; + std::vector rowOrder(unsigned int numRows) const; private: float invPtToDphi_; // conversion constant. - unsigned int shape_; + + HTshape shape_; std::vector > > cellCenters_; //--- Specifications of HT array. @@ -121,42 +133,33 @@ namespace tmtt { float maxAbsPhiTrkAxis_; // Half-width of phiTrk axis in HT array. unsigned int nBinsPhiTrkAxis_; // Number of bins in HT array in phiTrk axis. float binSizePhiTrkAxis_; // HT array bin size in phiTrk - - bool enableMerge2x2_; // Optionally merge 2x2 neighbouring cells into a single cell at low Pt, to reduce efficiency loss due to scattering. (Used also by mini-HT). + // Optionally merge 2x2 neighbouring cells into a single cell at low Pt, to reduce efficiency loss due to scattering. (Used also by mini-HT). + bool enableMerge2x2_; float minInvPtToMerge2x2_; //--- Options when filling HT array. - unsigned int - killSomeHTCellsRphi_; // Take all cells in HT array crossed by line corresponding to each stub (= 0) or take only some to reduce rate at cost of efficiency ( > 0) - bool handleStripsRphiHT_; // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when fill stubs in r-phi HT? + // Take all cells in HT array crossed by line corresponding to each stub (= 0) or take only some to reduce rate at cost of efficiency ( > 0) + unsigned int killSomeHTCellsRphi_; // Options for killing stubs/tracks that cant be sent within time-multiplexed period. bool busyInputSectorKill_; unsigned int busyInputSectorNumStubs_; bool busySectorKill_; unsigned int busySectorNumStubs_; - vector busySectorMbinRanges_; + std::vector busySectorMbinRanges_; bool busySectorUseMbinRanges_; - vector busySectorMbinOrder_; + std::vector busySectorMbinOrder_; bool busySectorUseMbinOrder_; - vector busySectorMbinLow_; - vector busySectorMbinHigh_; - - //--- Checks that stub filling is compatible with limitations of firmware. - - // Maximum |gradient| of line corresponding to any stub. Should be less than the value of 1.0 assumed by the firmware. - static std::atomic maxLineGradient_; - // Error count when stub added to cell which does not lie NE, E or SE of stub added to previous HT column. - static std::atomic numErrorsTypeA_; - // Error count when stub added to more than 2 cells in one HT column (problem only for Thomas' firmware). - static std::atomic numErrorsTypeB_; - // Error count normalisation - static std::atomic numErrorsNormalisation_; + std::vector busySectorMbinLow_; + std::vector busySectorMbinHigh_; // Number of stubs received from GP, irrespective of whether the stub was actually stored in // a cell in the HT array. unsigned int nReceivedStubs_; + // Error monitoring. + ErrorMonitor* errMon_; + // ... The Hough transform array data is in the base class ... // ... The list of found track candidates is in the base class ... diff --git a/L1Trigger/TrackFindingTMTT/interface/Histos.h b/L1Trigger/TrackFindingTMTT/interface/Histos.h index a70ab1992d4af..54253a5390bcb 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Histos.h +++ b/L1Trigger/TrackFindingTMTT/interface/Histos.h @@ -5,17 +5,16 @@ #include "CommonTools/UtilAlgos/interface/TFileService.h" #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" -#include "L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h" +#include "L1Trigger/TrackFindingTMTT/interface/TrackerModule.h" #include "boost/numeric/ublas/matrix.hpp" using boost::numeric::ublas::matrix; #include #include +#include #include -using namespace std; - class TH1F; class TH2F; class TH2Poly; @@ -31,7 +30,7 @@ namespace tmtt { class TP; class Sector; class HTrphi; - class Get3Dtracks; + class Make3Dtracks; class L1fittedTrack; class L1fittedTrk4and5; @@ -45,16 +44,16 @@ namespace tmtt { // Book & fill all histograms. virtual void book(); virtual void fill(const InputData& inputData, - const matrix& mSectors, - const matrix& mHtPhis, - const matrix mGet3Dtrks, - const std::map>& fittedTracks); + const matrix>& mSectors, + const matrix>& mHtPhis, + const matrix>& mGet3Dtrks, + const std::map>& mapFinalTracks); // Print tracking performance summary & make tracking efficiency histograms. - virtual void endJobAnalysis(); + virtual void endJobAnalysis(const HTrphi::ErrorMonitor* htRphiErrMon = nullptr); // Determine "B" parameter, used in GP firmware to allow for tilted modules. - virtual void trackerGeometryAnalysis(const TrackerGeometryInfo trackerGeometryInfo); + virtual void trackerGeometryAnalysis(const std::list& listTrackerModule); // Did user request output histograms via the TFileService in their cfg? virtual bool available() const { return fs_.isAvailable(); } @@ -68,27 +67,27 @@ namespace tmtt { virtual TFileDirectory bookEtaPhiSectors(); virtual TFileDirectory bookRphiHT(); virtual TFileDirectory bookRZfilters(); - virtual TFileDirectory bookStudyBusyEvents(); - virtual TFileDirectory bookTrackCands(string tName); - virtual map bookTrackFitting(); + virtual TFileDirectory bookTrackCands(const std::string& tName); + virtual std::map bookTrackFitting(); // Fill histograms for specific topics. virtual void fillInputData(const InputData& inputData); - virtual void fillEtaPhiSectors(const InputData& inputData, const matrix& mSectors); - virtual void fillRphiHT(const matrix& mHtRphis); - virtual void fillRZfilters(const matrix& mGet3Dtrks); - virtual void fillStudyBusyEvents(const InputData& inputData, - const matrix& mSectors, - const matrix& mHtRphis, - const matrix& mGet3Dtrks); - virtual void fillTrackCands(const InputData& inputData, const vector& tracks, string tName); + virtual void fillEtaPhiSectors(const InputData& inputData, const matrix>& mSectors); + virtual void fillRphiHT(const matrix>& mHtRphis); + virtual void fillRZfilters(const matrix>& mMake3Dtrks); + virtual void fillTrackCands(const InputData& inputData, + const matrix>& mMake3Dtrks, + const std::string& tName); + virtual void fillTrackCands(const InputData& inputData, + const std::vector& tracks, + const std::string& tName); virtual void fillTrackFitting(const InputData& inputData, - const std::map>& fittedTracks); + const std::map>& mapFinalTracks); // Produce plots of tracking efficiency after HZ or after r-z track filter (run at end of job) - virtual TFileDirectory plotTrackEfficiency(string tName); + virtual TFileDirectory plotTrackEfficiency(const std::string& tName); // Produce plots of tracking efficiency after track fit (run at end of job). - virtual TFileDirectory plotTrackEffAfterFit(string fitName); + virtual TFileDirectory plotTrackEffAfterFit(const std::string& fitName); // For Hybrid tracking // Produce plots of tracklet seed finding efficiency before track reco @@ -100,10 +99,10 @@ namespace tmtt { TFileDirectory& inputDir, TEfficiency* outputEfficiency, TH1F* pass, TH1F* all, TString name, TString title); // Print summary of track-finding performance after track pattern reco. - virtual void printTrackPerformance(string tName); + virtual void printTrackPerformance(const std::string& tName); // Print summary of track-finding performance after helix fit for given track fitter. - virtual void printFitTrackPerformance(string fitName); + virtual void printFitTrackPerformance(const std::string& fitName); // For Hybrid tracking // Print summary of seed finding and extrapolation performance during track pattern reco. @@ -112,13 +111,6 @@ namespace tmtt { // Print summary of duplicate removal performance after track pattern reco. virtual void printHybridDupRemovalPerformance(){}; - // Understand why not all tracking particles were reconstructed. - // Returns list of tracking particles that were not reconstructed and an integer indicating why. - // Only considers TP used for algorithmic efficiency measurement. - virtual map diagnoseTracking(const vector& allTPs, - const vector& tracks, - bool withRZfilter) const; - protected: // Configuration parameters. const Settings* settings_; @@ -129,532 +121,247 @@ namespace tmtt { unsigned int houghNbinsPt_; unsigned int houghNbinsPhi_; float chosenRofZ_; - vector trackFitters_; - vector useRZfilter_; + std::vector trackFitters_; + std::vector useRZfilter_; bool ranRZfilter_; bool resPlotOpt_; edm::Service fs_; + bool oldSumW2opt_; + // Histograms of input data. - TH1F* hisNumEvents_; - TProfile* profNumStubs_; TH1F* hisStubsVsEta_; TH1F* hisStubsVsR_; - TH2F* hisStubsVsRVsZ_; - TH2F* hisStubsModuleVsRVsZ_; - TH2F* hisStubsModuleTiltVsZ_; - TH2F* hisStubsdPhiCorrectionVsZ_; - TH2F* hisStubsVsRVsPhi_; - TH2F* hisStubsModuleVsRVsPhi_; - - TH2F* hisStubsVsRVsZ_outerModuleAtSmallerR_; - TH2F* hisStubsVsRVsPhi_outerModuleAtSmallerR_; - - TProfile* profNumTPs_; - TH1F* hisNumStubsPerTP_; - TH1F* hisNumPSStubsPerTP_; - TH1F* hisNum2SStubsPerTP_; + TH1F* hisNumLayersPerTP_; TH1F* hisNumPSLayersPerTP_; - TH1F* hisNum2SLayersPerTP_; - - TH1F* hisNumLayersPerTP_lowPt_; - TH1F* hisNumPSLayersPerTP_lowPt_; - TH1F* hisNum2SLayersPerTP_lowPt_; - - TH1F* hisNumLayersPerTP_mediumPt_; - TH1F* hisNumPSLayersPerTP_mediumPt_; - TH1F* hisNum2SLayersPerTP_mediumPt_; - - TH1F* hisNumLayersPerTP_highPt_; - TH1F* hisNumPSLayersPerTP_highPt_; - TH1F* hisNum2SLayersPerTP_highPt_; - - TH1F* hisNumLayersPerTP_muons_; - TH1F* hisNumPSLayersPerTP_muons_; - TH1F* hisNum2SLayersPerTP_muons_; - - TH1F* hisNumLayersPerTP_electrons_; - TH1F* hisNumPSLayersPerTP_electrons_; - TH1F* hisNum2SLayersPerTP_electrons_; - - TH1F* hisNumLayersPerTP_pions_; - TH1F* hisNumPSLayersPerTP_pions_; - TH1F* hisNum2SLayersPerTP_pions_; TProfile* hisStubKillFE_; TProfile* hisStubIneffiVsInvPt_; TProfile* hisStubIneffiVsEta_; - TProfile* hisStubKillDegradeBend_; - TH1F* hisPtStub_; - TH1F* hisPtResStub_; - TH1F* hisBendFilterPower_; - TH1F* hisDelPhiStub_; - TH1F* hisDelPhiResStub_; - TH1F* hisDelPhiResStub_tilted_; - TH1F* hisDelPhiResStub_notTilted_; TH1F* hisBendStub_; TH1F* hisBendResStub_; - TH1F* hisNumMergedBend_; - TH2F* hisBendVsLayerOrRingPS_; - TH2F* hisBendVsLayerOrRing2S_; - TH2F* hisBendFEVsLayerOrRingPS_; - TH2F* hisBendFEVsLayerOrRing2S_; - TH1F* hisPhiStubVsPhiTP_; - TH1F* hisPhiStubVsPhi0TP_; - TH1F* hisPhi0StubVsPhi0TP_; - TH1F* hisPhi0StubVsPhi0TPres_; - TH1F* hisPhiStubVsPhi65TP_; - TH1F* hisPhi65StubVsPhi65TP_; - TH1F* hisPhi65StubVsPhi65TPres_; - TH1F* hisPitchOverSep_; - TH1F* hisRhoParameter_; - TH2F* hisAlphaCheck_; - TH1F* hisFracStubsSharingClus0_; - TH1F* hisFracStubsSharingClus1_; - - // Histograms of B - TH1F* hisStubB_; - TH1F* hisStubBApproxDiff_tilted_; + + // Histograms of B parameter for tilted modules. TGraph* graphBVsZoverR_; // Histograms checking that (eta,phi) sector definition is good. - TH1F* hisFracStubsInSec_; - TH1F* hisFracStubsInEtaSec_; - TH1F* hisFracStubsInPhiSec_; - TH1F* hisNumSecsPerStub_; TH1F* hisNumEtaSecsPerStub_; TH1F* hisNumPhiSecsPerStub_; TH1F* hisNumStubsPerSec_; - TProfile* profNumStubsPerEtaSec_; - TH2F* hisLayerIDvsEtaSec_; - TH2F* hisLayerIDreducedvsEtaSec_; - - // Histograms checking filling of r-phi HT array. - TH2Poly* hisArrayHT_; - TF1* hisStubHT_; - TH1F* hisIncStubsPerHT_; - TH1F* hisExcStubsPerHT_; - TH2F* hisNumStubsInCellVsEta_; - TH1F* hisStubsOnRphiTracksPerHT_; - TH1F* hisHTstubsPerTrack_; - TH1F* hisHTmBin_; - TH1F* hisHTcBin_; - - // Histograms about r-z track filters (or other filters applied after r-phi HT array). - TH1F* hisNumZtrkSeedCombinations_; - TH1F* hisNumSeedCombinations_; - TH1F* hisNumGoodSeedCombinations_; - TH1F* hisCorrelationZTrk_; - - // Histograms for studying freak, large events with too many stubs. - TH1F* hisNumBusySecsInPerEvent_; - TH1F* hisNumBusySecsOutPerEvent_; - TProfile* profFracBusyInVsEtaReg_; - TProfile* profFracBusyOutVsEtaReg_; - TProfile* profFracStubsKilledVsEtaReg_; - TProfile* profFracTracksKilledVsEtaReg_; - TProfile* profFracTracksKilledVsInvPt_; - TProfile* profFracTPKilledVsEta_; - TProfile* profFracTPKilledVsInvPt_; - TH1F* hisNumTPkilledBusySec_; - map hisNumInputStubs_; - map hisQoverPtInputStubs_; - map hisNumOutputStubs_; - map hisNumTracks_; - map hisNumStubsPerTrack_; - map hisTrackQoverPt_; - map hisTrackPurity_; - map hisNumTPphysics_; - map hisNumTPpileup_; - map hisSumPtTPphysics_; - map hisSumPtTPpileup_; - - // Histograms studying 3D track candidates found by Hough Transform or r-z Track Filter. - map profNumTrackCands_; - map profNumTracksVsEta_; - map hisNumTracksVsQoverPt_; - map hisNumTrksPerSect_; - map hisNumTrksPerNon_; - map profStubsOnTracks_; - map profStubsOnTracksVsEta_; - map hisStubsOnTracksPerSect_; - map hisStubsOnTracksPerNon_; - map hisUniqueStubsOnTrksPerSect_; - map hisUniqueStubsOnTrksPerNon_; - map hisStubsPerTrack_; - map hisLayersPerTrack_; - map hisPSLayersPerTrack_; - map hisLayersPerTrueTrack_; - map hisPSLayersPerTrueTrack_; - - map hisNumStubsPerLink_; - map hisNumStubsVsLink_; - map profMeanStubsPerLink_; - map hisNumTrksPerLink_; - map hisNumTrksVsLink_; - map profMeanTrksPerLink_; - - map profExcessStubsPerTrackVsPt_; - map hisFracMatchStubsOnTracks_; - map hisDeltaBendTrue_; - map hisDeltaBendFake_; - map profFracTrueStubsVsLayer_; - map profDupTracksVsEta_; - map profDupTracksVsInvPt_; - //map hisWrongSignStubRZ_pBend_; - //map hisWrongSignStubRZ_nBend_; + + // Histograms studying 3D track candidates. + std::map profNumTrackCands_; + std::map profNumTracksVsEta_; + std::map hisNumTracksVsQoverPt_; + std::map hisNumTrksPerNon_; + std::map profStubsOnTracks_; + std::map hisStubsOnTracksPerNon_; + std::map hisStubsPerTrack_; + std::map hisLayersPerTrack_; + + std::map hisNumStubsPerLink_; + std::map profMeanStubsPerLink_; + std::map hisFracMatchStubsOnTracks_; + std::map profDupTracksVsEta_; + std::map profDupTracksVsInvPt_; // Histos of track params after HT. - map hisQoverPt_; - map hisPhi0_; - map hisEta_; - map hisZ0_; + std::map hisQoverPt_; + std::map hisPhi0_; + std::map hisEta_; + std::map hisZ0_; // Histograms of track parameter resolution after HT transform. - map hisQoverPtRes_; - map hisPhi0Res_; - map hisEtaRes_; - map hisZ0Res_; - - map hisRecoVsTrueQinvPt_; - map hisRecoVsTruePhi0_; - map hisRecoVsTrueD0_; - map hisRecoVsTrueZ0_; - map hisRecoVsTrueEta_; - - // Diagnosis of failed tracking. - map hisRecoFailureReason_; - map hisRecoFailureLayer_; - - map hisNumStubsOnLayer_; + std::map hisQoverPtRes_; + std::map hisPhi0Res_; + std::map hisEtaRes_; + std::map hisZ0Res_; // Histos used for denominator of tracking efficiency plots. TH1F* hisTPinvptForEff_; - TH1F* hisTPptForEff_; TH1F* hisTPetaForEff_; TH1F* hisTPphiForEff_; TH1F* hisTPd0ForEff_; TH1F* hisTPz0ForEff_; // TH1F* hisTPinvptForAlgEff_; - TH1F* hisTPptForAlgEff_; TH1F* hisTPetaForAlgEff_; TH1F* hisTPphiForAlgEff_; TH1F* hisTPd0ForAlgEff_; TH1F* hisTPz0ForAlgEff_; - // - TH1F* hisTPphisecForAlgEff_; - TH1F* hisTPetasecForAlgEff_; - TH1F* hisTPinvptForAlgEff_inJetPtG30_; - TH1F* hisTPinvptForAlgEff_inJetPtG100_; - TH1F* hisTPinvptForAlgEff_inJetPtG200_; // Histograms used to make efficiency plots with 3D track candidates prior to fit. - map hisRecoTPinvptForEff_; - map hisRecoTPptForEff_; - map hisRecoTPetaForEff_; - map hisRecoTPphiForEff_; - // - map hisPerfRecoTPinvptForEff_; - map hisPerfRecoTPptForEff_; - map hisPerfRecoTPetaForEff_; - // - map hisRecoTPd0ForEff_; - map hisRecoTPz0ForEff_; + std::map hisRecoTPinvptForEff_; + std::map hisRecoTPetaForEff_; + std::map hisRecoTPphiForEff_; + std::map hisRecoTPd0ForEff_; + std::map hisRecoTPz0ForEff_; // - map hisRecoTPinvptForAlgEff_; - map hisRecoTPptForAlgEff_; - map hisRecoTPetaForAlgEff_; - map hisRecoTPphiForAlgEff_; + std::map hisPerfRecoTPinvptForEff_; + std::map hisPerfRecoTPetaForEff_; // - map hisPerfRecoTPinvptForAlgEff_; - map hisPerfRecoTPptForAlgEff_; - map hisPerfRecoTPetaForAlgEff_; + std::map hisRecoTPinvptForAlgEff_; + std::map hisRecoTPetaForAlgEff_; + std::map hisRecoTPphiForAlgEff_; + std::map hisRecoTPd0ForAlgEff_; + std::map hisRecoTPz0ForAlgEff_; // - map hisRecoTPd0ForAlgEff_; - map hisRecoTPz0ForAlgEff_; - // - map hisRecoTPphisecForAlgEff_; - map hisPerfRecoTPphisecForAlgEff_; - map hisRecoTPetasecForAlgEff_; - map hisPerfRecoTPetasecForAlgEff_; - - map hisRecoTPinvptForAlgEff_inJetPtG30_; - map hisRecoTPinvptForAlgEff_inJetPtG100_; - map hisRecoTPinvptForAlgEff_inJetPtG200_; - - // Histograms for track fitting evaluation, where map index specifies name of track fitting algorithm used. - - map profNumFitTracks_; - map hisNumFitTrks_; - map hisNumFitTrksPerNon_; - map hisNumFitTrksPerSect_; - - map hisStubsPerFitTrack_; - map profStubsOnFitTracks_; - - map hisFitQinvPtMatched_; - map hisFitPhi0Matched_; - map hisFitD0Matched_; - map hisFitZ0Matched_; - map hisFitEtaMatched_; - - map hisFitQinvPtUnmatched_; - map hisFitPhi0Unmatched_; - map hisFitD0Unmatched_; - map hisFitZ0Unmatched_; - map hisFitEtaUnmatched_; - - map hisKalmanNumUpdateCalls_; - map hisKalmanChi2DofSkipLay0Matched_; - map hisKalmanChi2DofSkipLay1Matched_; - map hisKalmanChi2DofSkipLay2Matched_; - map hisKalmanChi2DofSkipLay0Unmatched_; - map hisKalmanChi2DofSkipLay1Unmatched_; - map hisKalmanChi2DofSkipLay2Unmatched_; - - map hisFitChi2Matched_; - map hisFitChi2DofMatched_; - map hisFitChi2DofRphiMatched_; - map hisFitChi2DofRzMatched_; - map hisFitBeamChi2Matched_; - map hisFitBeamChi2DofMatched_; - map profFitChi2VsEtaMatched_; - map profFitChi2DofVsEtaMatched_; - map profFitChi2VsInvPtMatched_; - map profFitChi2DofVsInvPtMatched_; - map profFitChi2VsTrueD0Matched_; - map profFitChi2DofVsTrueD0Matched_; - map hisFitChi2PerfMatched_; - map hisFitChi2DofPerfMatched_; - - map hisFitChi2Unmatched_; - map hisFitChi2DofUnmatched_; - map hisFitChi2DofRphiUnmatched_; - map hisFitChi2DofRzUnmatched_; - map hisFitBeamChi2Unmatched_; - map hisFitBeamChi2DofUnmatched_; - map profFitChi2VsEtaUnmatched_; - map profFitChi2DofVsEtaUnmatched_; - map profFitChi2VsInvPtUnmatched_; - map profFitChi2DofVsInvPtUnmatched_; - - map profFitChi2VsPurity_; - map profFitChi2DofVsPurity_; - - map hisDeltaPhitruePSbarrel_; - map hisDeltaRorZtruePSbarrel_; - map hisDeltaPhitrue2Sbarrel_; - map hisDeltaRorZtrue2Sbarrel_; - map hisDeltaPhitruePSendcap_; - map hisDeltaRorZtruePSendcap_; - map hisDeltaPhitrue2Sendcap_; - map hisDeltaRorZtrue2Sendcap_; - map hisDeltaPhifakePSbarrel_; - map hisDeltaRorZfakePSbarrel_; - map hisDeltaPhifake2Sbarrel_; - map hisDeltaRorZfake2Sbarrel_; - map hisDeltaPhifakePSendcap_; - map hisDeltaRorZfakePSendcap_; - map hisDeltaPhifake2Sendcap_; - map hisDeltaRorZfake2Sendcap_; - map profRecalcRphiChi2VsEtaTrue1_; - map profRecalcRzChi2VsEtaTrue1_; - map profRecalcChi2VsEtaTrue1_; - map profRecalcChi2VsEtaTrue2_; - map profNsigmaPhivsInvPt_; - map profNsigmaPhivsR_; - map profNsigmaPhivsTanl_; - - map hisFitVsSeedQinvPtMatched_; - map hisFitVsSeedPhi0Matched_; - map hisFitVsSeedD0Matched_; - map hisFitVsSeedZ0Matched_; - map hisFitVsSeedEtaMatched_; - - map hisFitVsSeedQinvPtUnmatched_; - map hisFitVsSeedPhi0Unmatched_; - map hisFitVsSeedD0Unmatched_; - map hisFitVsSeedZ0Unmatched_; - map hisFitVsSeedEtaUnmatched_; - - map hisNumStubsVsPurityMatched_; - map profFitFracTrueStubsVsLayerMatched_; - map profFitFracTrueStubsVsEtaMatched_; - - map hisFitVsTrueQinvPt_; - map hisFitVsTruePhi0_; - map hisFitVsTrueD0_; - map hisFitVsTrueZ0_; - map hisFitVsTrueEta_; - - map hisFitQinvPtRes_; - map hisFitPhi0Res_; - map hisFitD0Res_; - map hisFitZ0Res_; - map hisFitEtaRes_; - - map hisQoverPtResVsTrueEta_; - map hisPhi0ResVsTrueEta_; - map hisEtaResVsTrueEta_; - map hisZ0ResVsTrueEta_; - map hisD0ResVsTrueEta_; - - map hisQoverPtResVsTrueInvPt_; - map hisPhi0ResVsTrueInvPt_; - map hisEtaResVsTrueInvPt_; - map hisZ0ResVsTrueInvPt_; - map hisD0ResVsTrueInvPt_; - - map hisQoverPtResBeamVsTrueEta_; - map hisPhi0ResBeamVsTrueEta_; - map hisQoverPtResBeamVsTrueInvPt_; - map hisPhi0ResBeamVsTrueInvPt_; - - map hisFitEfficiencyVsChi2Dof_; - map hisNumStubsVsChi2Dof_; - map hisNumLayersVsChi2Dof_; - map hisAvgNumStubsPerLayerVsChi2Dof_; - - map profDupFitTrksVsEta_; - map profDupFitTrksVsInvPt_; + std::map hisPerfRecoTPinvptForAlgEff_; + std::map hisPerfRecoTPetaForAlgEff_; + + // Histograms for track fitting evaluation, where std::map index specifies name of track fitting algorithm used. + + std::map profNumFitTracks_; + std::map hisNumFitTrks_; + std::map hisNumFitTrksPerNon_; + std::map hisNumFitTrksPerSect_; + + std::map hisStubsPerFitTrack_; + std::map profStubsOnFitTracks_; + + std::map hisFitQinvPtMatched_; + std::map hisFitPhi0Matched_; + std::map hisFitD0Matched_; + std::map hisFitZ0Matched_; + std::map hisFitEtaMatched_; + + std::map hisFitQinvPtUnmatched_; + std::map hisFitPhi0Unmatched_; + std::map hisFitD0Unmatched_; + std::map hisFitZ0Unmatched_; + std::map hisFitEtaUnmatched_; + + std::map hisKalmanNumUpdateCalls_; + std::map hisKalmanChi2DofSkipLay0Matched_; + std::map hisKalmanChi2DofSkipLay1Matched_; + std::map hisKalmanChi2DofSkipLay2Matched_; + std::map hisKalmanChi2DofSkipLay0Unmatched_; + std::map hisKalmanChi2DofSkipLay1Unmatched_; + std::map hisKalmanChi2DofSkipLay2Unmatched_; + + std::map hisFitChi2DofMatched_; + std::map hisFitChi2DofRphiMatched_; + std::map hisFitChi2DofRzMatched_; + std::map profFitChi2DofVsInvPtMatched_; + + std::map hisFitChi2DofUnmatched_; + std::map hisFitChi2DofRphiUnmatched_; + std::map hisFitChi2DofRzUnmatched_; + std::map profFitChi2DofVsInvPtUnmatched_; + + std::map hisQoverPtResVsTrueEta_; + std::map hisPhi0ResVsTrueEta_; + std::map hisEtaResVsTrueEta_; + std::map hisZ0ResVsTrueEta_; + std::map hisD0ResVsTrueEta_; + + std::map hisQoverPtResVsTrueInvPt_; + std::map hisPhi0ResVsTrueInvPt_; + std::map hisEtaResVsTrueInvPt_; + std::map hisZ0ResVsTrueInvPt_; + std::map hisD0ResVsTrueInvPt_; + + std::map profDupFitTrksVsEta_; + std::map profDupFitTrksVsInvPt_; // Histograms used for efficiency plots made with fitted tracks. - map hisFitTPinvptForEff_; - map hisFitTPptForEff_; - map hisFitTPetaForEff_; - map hisFitTPphiForEff_; - map hisPerfFitTPinvptForEff_; - map hisPerfFitTPptForEff_; - map hisPerfFitTPetaForEff_; - map hisFitTPd0ForEff_; - map hisFitTPz0ForEff_; - map hisFitTPinvptForAlgEff_; - map hisFitTPptForAlgEff_; - map hisFitTPetaForAlgEff_; - map hisFitTPphiForAlgEff_; - map hisPerfFitTPinvptForAlgEff_; - map hisPerfFitTPptForAlgEff_; - map hisPerfFitTPetaForAlgEff_; - map hisFitTPd0ForAlgEff_; - map hisFitTPz0ForAlgEff_; - map hisFitTPphisecForAlgEff_; - map hisFitTPetasecForAlgEff_; - map hisPerfFitTPphisecForAlgEff_; - map hisPerfFitTPetasecForAlgEff_; - map hisPerfFitTPinvptForAlgEff_inJetPtG30_; - map hisPerfFitTPinvptForAlgEff_inJetPtG100_; - map hisPerfFitTPinvptForAlgEff_inJetPtG200_; + std::map hisFitTPinvptForEff_; + std::map hisFitTPetaForEff_; + std::map hisFitTPphiForEff_; + std::map hisFitTPd0ForEff_; + std::map hisFitTPz0ForEff_; + std::map hisPerfFitTPinvptForEff_; + std::map hisPerfFitTPetaForEff_; + std::map hisFitTPinvptForAlgEff_; + std::map hisFitTPetaForAlgEff_; + std::map hisFitTPphiForAlgEff_; + std::map hisFitTPd0ForAlgEff_; + std::map hisFitTPz0ForAlgEff_; + std::map hisPerfFitTPinvptForAlgEff_; + std::map hisPerfFitTPetaForAlgEff_; // Histograms of tracking efficiency & fake rate after Hough transform or after r-z track filter. - map teffEffVsInvPt_; - map teffEffVsPt_; - map teffEffVsEta_; - map teffEffVsPhi_; - // - map teffPerfEffVsInvPt_; - map teffPerfEffVsPt_; - map teffPerfEffVsEta_; - // - map teffEffVsD0_; - map teffEffVsZ0_; + std::map teffEffVsInvPt_; + std::map teffEffVsEta_; + std::map teffEffVsPhi_; + std::map teffEffVsD0_; + std::map teffEffVsZ0_; // - map teffAlgEffVsInvPt_; - map teffAlgEffVsPt_; - map teffAlgEffVsEta_; - map teffAlgEffVsPhi_; - map teffAlgEffVsInvPt_inJetPtG30_; - map teffAlgEffVsInvPt_inJetPtG100_; - map teffAlgEffVsInvPt_inJetPtG200_; + std::map teffPerfEffVsInvPt_; + std::map teffPerfEffVsEta_; + std::map teffAlgEffVsD0_; + std::map teffAlgEffVsZ0_; // - map teffPerfAlgEffVsInvPt_; - map teffPerfAlgEffVsPt_; - map teffPerfAlgEffVsEta_; + std::map teffAlgEffVsInvPt_; + std::map teffAlgEffVsEta_; + std::map teffAlgEffVsPhi_; // - map teffAlgEffVsD0_; - map teffAlgEffVsZ0_; - // - map teffAlgEffVsPhiSec_; - map teffAlgEffVsEtaSec_; - map teffPerfAlgEffVsPhiSec_; - map teffPerfAlgEffVsEtaSec_; + std::map teffPerfAlgEffVsInvPt_; + std::map teffPerfAlgEffVsPt_; + std::map teffPerfAlgEffVsEta_; // Histograms of tracking efficiency & fake rate after Hough transform based on tracks after the track fit. - map teffEffFitVsInvPt_; - map teffEffFitVsPt_; - map teffEffFitVsEta_; - map teffEffFitVsPhi_; - // - map teffPerfEffFitVsInvPt_; - map teffPerfEffFitVsPt_; - map teffPerfEffFitVsEta_; - // - map teffEffFitVsD0_; - map teffEffFitVsZ0_; + std::map teffEffFitVsInvPt_; + std::map teffEffFitVsEta_; + std::map teffEffFitVsPhi_; + std::map teffEffFitVsD0_; + std::map teffEffFitVsZ0_; // - map teffAlgEffFitVsInvPt_; - map teffAlgEffFitVsPt_; - map teffAlgEffFitVsEta_; - map teffAlgEffFitVsPhi_; + std::map teffPerfEffFitVsInvPt_; + std::map teffPerfEffFitVsEta_; // - map teffPerfAlgEffFitVsInvPt_; - map teffPerfAlgEffFitVsPt_; - map teffPerfAlgEffFitVsEta_; - map teffPerfAlgEffFitVsInvPt_inJetPtG30_; - map teffPerfAlgEffFitVsInvPt_inJetPtG100_; - map teffPerfAlgEffFitVsInvPt_inJetPtG200_; + std::map teffAlgEffFitVsInvPt_; + std::map teffAlgEffFitVsEta_; + std::map teffAlgEffFitVsPhi_; + std::map teffAlgEffFitVsD0_; + std::map teffAlgEffFitVsZ0_; // - map teffAlgEffFitVsD0_; - map teffAlgEffFitVsZ0_; - // - map teffAlgEffFitVsPhiSec_; - map teffAlgEffFitVsEtaSec_; - map teffPerfAlgEffFitVsPhiSec_; - map teffPerfAlgEffFitVsEtaSec_; - - bool plotFirst_; + std::map teffPerfAlgEffFitVsInvPt_; + std::map teffPerfAlgEffFitVsEta_; // Number of genuine reconstructed and perfectly reconstructed tracks which were fitted. - map numFitAlgEff_; - map numFitPerfAlgEff_; + std::map numFitAlgEff_; + std::map numFitPerfAlgEff_; // Number of genuine reconstructed and perfectly reconstructed tracks which were fitted post-cut. - map numFitAlgEffPass_; - map numFitPerfAlgEffPass_; + std::map numFitAlgEffPass_; + std::map numFitPerfAlgEffPass_; // Range in r of each barrel layer. - map mapBarrelLayerMinR_; - map mapBarrelLayerMaxR_; + std::map mapBarrelLayerMinR_; + std::map mapBarrelLayerMaxR_; // Range in z of each endcap wheel. - map mapEndcapWheelMinZ_; - map mapEndcapWheelMaxZ_; + std::map mapEndcapWheelMinZ_; + std::map mapEndcapWheelMaxZ_; // Range in (r,z) of each module type. - map mapModuleTypeMinR_; - map mapModuleTypeMaxR_; - map mapModuleTypeMinZ_; - map mapModuleTypeMaxZ_; - // Extra maps for wierd barrel layers 1-2 & endcap wheels 3-5. - map mapExtraAModuleTypeMinR_; - map mapExtraAModuleTypeMaxR_; - map mapExtraAModuleTypeMinZ_; - map mapExtraAModuleTypeMaxZ_; - map mapExtraBModuleTypeMinR_; - map mapExtraBModuleTypeMaxR_; - map mapExtraBModuleTypeMinZ_; - map mapExtraBModuleTypeMaxZ_; - map mapExtraCModuleTypeMinR_; - map mapExtraCModuleTypeMaxR_; - map mapExtraCModuleTypeMinZ_; - map mapExtraCModuleTypeMaxZ_; - map mapExtraDModuleTypeMinR_; - map mapExtraDModuleTypeMaxR_; - map mapExtraDModuleTypeMinZ_; - map mapExtraDModuleTypeMaxZ_; + std::map mapModuleTypeMinR_; + std::map mapModuleTypeMaxR_; + std::map mapModuleTypeMinZ_; + std::map mapModuleTypeMaxZ_; + // Extra std::maps for wierd barrel layers 1-2 & endcap wheels 3-5. + std::map mapExtraAModuleTypeMinR_; + std::map mapExtraAModuleTypeMaxR_; + std::map mapExtraAModuleTypeMinZ_; + std::map mapExtraAModuleTypeMaxZ_; + std::map mapExtraBModuleTypeMinR_; + std::map mapExtraBModuleTypeMaxR_; + std::map mapExtraBModuleTypeMinZ_; + std::map mapExtraBModuleTypeMaxZ_; + std::map mapExtraCModuleTypeMinR_; + std::map mapExtraCModuleTypeMaxR_; + std::map mapExtraCModuleTypeMinZ_; + std::map mapExtraCModuleTypeMaxZ_; + std::map mapExtraDModuleTypeMinR_; + std::map mapExtraDModuleTypeMaxR_; + std::map mapExtraDModuleTypeMinZ_; + std::map mapExtraDModuleTypeMaxZ_; bool bApproxMistake_; + + bool printedGeomAnalysis_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/InputData.h b/L1Trigger/TrackFindingTMTT/interface/InputData.h index 3d7b0c5ed7648..fbe7355fa0bea 100644 --- a/L1Trigger/TrackFindingTMTT/interface/InputData.h +++ b/L1Trigger/TrackFindingTMTT/interface/InputData.h @@ -3,16 +3,16 @@ #include "FWCore/Framework/interface/EDAnalyzer.h" #include "L1Trigger/TrackFindingTMTT/interface/TP.h" +#include "L1Trigger/TrackFindingTMTT/interface/TrackerModule.h" #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Utilities/interface/InputTag.h" -#include - -using namespace std; +#include namespace tmtt { class Settings; + class StubWindowSuggest; //=== Unpacks stub & tracking particle (truth) data into user-friendlier format in Stub & TP classes. //=== Also makes B-field available to Settings class. @@ -21,43 +21,48 @@ namespace tmtt { public: InputData(const edm::Event& iEvent, const edm::EventSetup& iSetup, - Settings* settings, - const edm::EDGetTokenT tpInputTag, - const edm::EDGetTokenT stubInputTag, - const edm::EDGetTokenT stubTruthInputTag, - const edm::EDGetTokenT clusterTruthInputTag, - const edm::EDGetTokenT genJetInputTag); + const Settings* settings, + StubWindowSuggest* stubWindowSuggest, + const TrackerGeometry* trackerGeometry, + const TrackerTopology* trackerTopology, + const std::list& listTrackerModule, + const edm::EDGetTokenT tpToken, + const edm::EDGetTokenT stubToken, + const edm::EDGetTokenT stubTruthToken, + const edm::EDGetTokenT clusterTruthToken, + const edm::EDGetTokenT genJetToken); + + // Info about each tracker module + const std::list& trackerModules() const { return trackerModules_; }; // Get tracking particles - const vector& getTPs() const { return vTPs_; } + const std::list& getTPs() const { return vTPs_; } // Get stubs that would be output by the front-end readout electronics - const vector& getStubs() const { return vStubs_; } + const std::list& stubs() const { return vStubs_; } + // Ditto but const + const std::list& stubsConst() const { return vStubsConst_; } //--- of minor importance ... // Get number of stubs prior to applying tighted front-end readout electronics cuts specified in section StubCuts of Analyze_Defaults_cfi.py. (Only used to measure the efficiency of these cuts). - const vector& getAllStubs() const { return vAllStubs_; } + const std::list& allStubs() const { return vAllStubs_; } private: - // const edm::EDGetTokenT inputTag; + bool enableMCtruth_; // Notes if job will use MC truth info. - // Can optionally be used to sort stubs by bend. - struct SortStubsInBend { - inline bool operator()(const Stub* stub1, const Stub* stub2) { - return (fabs(stub1->bend()) < fabs(stub2->bend())); - } - }; + std::list trackerModules_; // Info about each tracker module. - private: - bool enableMCtruth_; // Notes if job will use MC truth info. + std::list vTPs_; // tracking particles + std::list vStubs_; // stubs that would be output by the front-end readout electronics. + std::list vStubsConst_; // ditto but const - vector vTPs_; // tracking particles - vector vStubs_; // stubs that would be output by the front-end readout electronics. + //--- Used for a few minor studies ... - //--- of minor importance ... + // all stubs, even those that would fail any tightened front-end readout electronic cuts specified in section StubCuts of Analyze_Defaults_cfi.py. (Only used to measure the efficiency of these cuts). + std::list vAllStubs_; - vector - vAllStubs_; // all stubs, even those that would fail any tightened front-end readout electronic cuts specified in section StubCuts of Analyze_Defaults_cfi.py. (Only used to measure the efficiency of these cuts). + // Recommends optimal FE stub window sizes. + StubWindowSuggest* stubWindowSuggest_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h b/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h index 425cdf42f24b2..e7544f205f770 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h +++ b/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h @@ -1,39 +1,47 @@ -///=== This is the Kalman Combinatorial Filter for 4 & 5 helix parameters track fit algorithm. - #ifndef L1Trigger_TrackFindingTMTT_KFParamsComb_h #define L1Trigger_TrackFindingTMTT_KFParamsComb_h -#include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" -#include +#include "L1Trigger/TrackFindingTMTT/interface/KFbase.h" #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" +#include "TMatrixD.h" + +///=== This is the Kalman Combinatorial Filter for 4 & 5 helix parameters track fit algorithm. +///=== All variable names & equations come from Fruhwirth KF paper +///=== http://dx.doi.org/10.1016/0168-9002%2887%2990887-4 namespace tmtt { - class KFParamsComb : public L1KalmanComb { + class KFParamsComb : public KFbase { public: - enum PAR_IDS { INV2R, PHI0, T, Z0, D0 }; - enum MEAS_IDS { PHI, Z }; + KFParamsComb(const Settings* settings, const uint nPar, const std::string& fitterName) + : KFbase(settings, nPar, fitterName) {} - public: - KFParamsComb(const Settings* settings, const uint nPar, const string& fitterName); virtual ~KFParamsComb() {} protected: - virtual std::map getTrackParams(const KalmanState* state) const; - virtual std::map getTrackParams_BeamConstr(const KalmanState* state, double& chi2rphi) const; - virtual std::vector seedx(const L1track3D& l1track3D) const; - virtual TMatrixD seedP(const L1track3D& l1track3D) const; - virtual std::vector d(const StubCluster* stubCluster) const; - virtual TMatrixD H(const StubCluster* stubCluster) const; - virtual TMatrixD dH(const StubCluster* stubCluster) const; - virtual TMatrixD F(const StubCluster* stubCluster = 0, const KalmanState* state = 0) const; - virtual TMatrixD PxxModel(const KalmanState* state, const StubCluster* stubCluster) const; - virtual TMatrixD PddMeas(const StubCluster* stubCluster, const KalmanState* state) const; - virtual bool isGoodState(const KalmanState& state) const; + //--- Input data - private: - std::vector mapToVec(std::map x) const; - std::map vecToMap(std::vector x) const; + // Seed track helix params & covariance matrix + virtual TVectorD seedX(const L1track3D& l1track3D) const; + virtual TMatrixD seedC(const L1track3D& l1track3D) const; + + // Stub coordinate measurements & resolution + virtual TVectorD vectorM(const Stub* stub) const; + virtual TMatrixD matrixV(const Stub* stub, const KalmanState* state) const; + + //--- KF maths matrix multiplications + + // Derivate of helix intercept point w.r.t. helix params. + virtual TMatrixD matrixH(const Stub* stub) const; + // Kalman helix ref point extrapolation matrix + virtual TMatrixD matrixF(const Stub* stub, const KalmanState* state) const; + + // Convert to physical helix params instead of local ones used by KF + virtual TVectorD trackParams(const KalmanState* state) const; + virtual TVectorD trackParams_BeamConstr(const KalmanState* state, double& chi2rphi) const; + + // Does helix state pass cuts? + virtual bool isGoodState(const KalmanState& state) const; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h b/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h index 782a1c3c6b875..3524d96c60f23 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h +++ b/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h @@ -6,19 +6,14 @@ #include "L1Trigger/TrackFindingTMTT/interface/L1trackBase.h" #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" -#include "L1Trigger/TrackFindingTMTT/interface/Utility.h" #include "L1Trigger/TrackFindingTMTT/interface/TP.h" #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" -#include "L1Trigger/TrackFindingTMTT/interface/Sector.h" -#include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h" #include "L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h" #include #include #include -using namespace std; - //=== This is used uniquely for HYBRID TRACKING. //=== It is the equivalent of class L1fittedTrack. //=== @@ -37,8 +32,8 @@ namespace tmtt { // and the number of helix parameters being fitted (=5 if d0 is fitted, or =4 if d0 is not fitted). // Also specify phi sector and eta region used by track-finding code that this track was in. // And if track fit declared this to be a valid track (enough stubs left on track after fit etc.). - KFTrackletTrack(const L1track3D& l1track3D, - const vector& stubs, + KFTrackletTrack(const L1track3D* l1track3D, + const std::vector& stubs, unsigned int hitPattern, float qOverPt, float d0, @@ -69,25 +64,17 @@ namespace tmtt { nHelixParam_(nHelixParam), iPhiSec_(iPhiSec), iEtaReg_(iEtaReg), - optoLinkID_(l1track3D.optoLinkID()), + optoLinkID_(l1track3D->optoLinkID()), accepted_(accepted), nSkippedLayers_(0), numUpdateCalls_(0), - numIterations_(0) { - // Doesn't make sense to assign stubs to track if fitter rejected it. - if (!accepted) - stubs_.clear(); - //nLayers_ = Utility::countLayers(settings, stubs); // Count tracker layers these stubs are in - // matchedTP_ = Utility::matchingTP(settings, stubs, nMatchedLayers_, matchedStubs_); // Find associated truth particle & calculate info about match. - // secTmp_.init(settings, iPhiSec, iEtaReg); //Sector class used to check if fitted track trajectory is in expected sector. - // htRphiTmp_.init(settings, iPhiSec, iEtaReg, secTmp_.etaMin(), secTmp_.etaMax(), secTmp_.phiCentre()); // HT class used to identify HT cell that corresponds to fitted helix parameters. - } + numIterations_(0) {} - KFTrackletTrack(){}; // Creates track object, but doesn't set any variables. + KFTrackletTrack(){}; // Creates track object, but doesn't std::set any variables. ~KFTrackletTrack() {} - //--- Optionally set track helix params & chi2 if beam-spot constraint is used (for 5-parameter fit). + //--- Optionally std::set track helix params & chi2 if beam-spot constraint is used (for 5-parameter fit). void setBeamConstr(float qOverPt_bcon, float phi0_bcon, float chi2rphi_bcon) { done_bcon_ = true; qOverPt_bcon_ = qOverPt_bcon; @@ -103,31 +90,35 @@ namespace tmtt { numUpdateCalls_ = numUpdateCalls; } - void getInfoKF(unsigned int& nSkippedLayers, unsigned int& numUpdateCalls) const { + void infoKF(unsigned int& nSkippedLayers, unsigned int& numUpdateCalls) const { nSkippedLayers = nSkippedLayers_; numUpdateCalls = numUpdateCalls_; } - const L1track3D& getL1track3D() const { return l1track3D_; } + const L1track3D* l1track3D() const { return l1track3D_; } // Get stubs on fitted track (can differ from those on HT track if track fit kicked out stubs with bad residuals) - const vector& getStubs() const { return stubs_; } + const std::vector& stubs() const { return stubs_; } // Get number of stubs on fitted track. - unsigned int getNumStubs() const { return stubs_.size(); } + unsigned int numStubs() const { return stubs_.size(); } // Get number of tracker layers these stubs are in. - unsigned int getNumLayers() const { return nLayers_; } + unsigned int numLayers() const { return nLayers_; } // Get number of stubs deleted from track candidate by fitter (because they had large residuals) - unsigned int getNumKilledStubs() const { return l1track3D_.getNumStubs() - this->getNumStubs(); } + unsigned int numKilledStubs() const { return l1track3D_->numStubs() - this->numStubs(); } // Get bit-encoded hit pattern (where layer number assigned by increasing distance from origin, according to layers track expected to cross). - unsigned int getHitPattern() const { return hitPattern_; } + unsigned int hitPattern() const { return hitPattern_; } //--- Get the fitted track helix parameters. float qOverPt() const { return qOverPt_; } float charge() const { return (qOverPt_ > 0 ? 1 : -1); } - float invPt() const { return fabs(qOverPt_); } - float pt() const { return 1. / (1.0e-6 + this->invPt()); } // includes protection against 1/pt = 0. + float invPt() const { return std::abs(qOverPt_); } + // Protect pt against 1/pt = 0. + float pt() const { + constexpr float small = 1.0e-6; + return 1. / (small + this->invPt()); + } float d0() const { return d0_; } float phi0() const { return phi0_; } float z0() const { return z0_; } @@ -141,7 +132,7 @@ namespace tmtt { bool done_bcon() const { return done_bcon_; } // Was beam-spot constraint aplied? float qOverPt_bcon() const { return qOverPt_bcon_; } float charge_bcon() const { return (qOverPt_bcon_ > 0 ? 1 : -1); } - float invPt_bcon() const { return fabs(qOverPt_bcon_); } + float invPt_bcon() const { return std::abs(qOverPt_bcon_); } float pt_bcon() const { return 1. / (1.0e-6 + this->invPt_bcon()); } float phi0_bcon() const { return phi0_bcon_; } @@ -167,9 +158,9 @@ namespace tmtt { float nHelixParam() const { return nHelixParam_; } // Get the fit degrees of freedom, chi2 & chi2/DOF - unsigned int numDOF() const { return 2 * this->getNumStubs() - nHelixParam_; } - unsigned int numDOFrphi() const { return this->getNumStubs() - (nHelixParam_ - 2); } - unsigned int numDOFrz() const { return this->getNumStubs() - 2; } + unsigned int numDOF() const { return 2 * this->numStubs() - nHelixParam_; } + unsigned int numDOFrphi() const { return this->numStubs() - (nHelixParam_ - 2); } + unsigned int numDOFrz() const { return this->numStubs() - 2; } float chi2rphi() const { return chi2rphi_; } float chi2rz() const { return chi2rz_; } float chi2() const { return chi2rphi_ + chi2rz_; } @@ -194,38 +185,21 @@ namespace tmtt { bool accepted() const { return accepted_; } - // Comparitor useful for sorting tracks by q/Pt using std::sort(). - static bool qOverPtSortPredicate(const KFTrackletTrack& t1, const KFTrackletTrack t2) { - return t1.qOverPt() < t2.qOverPt(); - } - - //--- Functions to help eliminate duplicate tracks. - - // Is the fitted track trajectory should lie within the same HT cell in which the track was originally found? - - // Is the fitted track trajectory within the same (eta,phi) sector of the HT used to find it? - bool consistentSector() const { - bool insidePhi = - (fabs(reco::deltaPhi(this->phiAtChosenR(done_bcon_), secTmp_.phiCentre())) < secTmp_.sectorHalfWidth()); - bool insideEta = (this->zAtChosenR() > secTmp_.zAtChosenR_Min() && this->zAtChosenR() < secTmp_.zAtChosenR_Max()); - return (insidePhi && insideEta); - } - // Digitize track and degrade helix parameter resolution according to effect of digitisation. - void digitizeTrack(const string& fitterName); + void digitizeTrack(const std::string& fitterName); // Access to detailed info about digitized track - const DigitalTrack& digitaltrack() const { return digitalTrack_; } + const DigitalTrack* digitaltrack() const { return digitalTrack_.get(); } private: //--- Configuration parameters const Settings* settings_; //--- The 3D hough-transform track candidate which was fitted. - L1track3D l1track3D_; + const L1track3D* l1track3D_; //--- The stubs on the fitted track (can differ from those on HT track if fit kicked off stubs with bad residuals) - vector stubs_; + std::vector stubs_; unsigned int nLayers_; //--- Bit-encoded hit pattern (where layer number assigned by increasing distance from origin, according to layers track expected to cross). @@ -258,17 +232,12 @@ namespace tmtt { //--- Information about its association (if any) to a truth Tracking Particle. const TP* matchedTP_; - vector matchedStubs_; + std::vector matchedStubs_; unsigned int nMatchedLayers_; //--- Has the track fit declared this to be a valid track? bool accepted_; - //--- Sector class used to check if fitted track trajectory is in same sector as HT used to find it. - Sector secTmp_; - //--- r-phi HT class used to determine HT cell location that corresponds to fitted track helix parameters. - HTrphi htRphiTmp_; - //--- Info specific to KF fitter. unsigned int nSkippedLayers_; unsigned int numUpdateCalls_; @@ -277,8 +246,7 @@ namespace tmtt { std::string lostMatchingState_; std::unordered_map stateCalls_; - bool digitizedTrack_; - DigitalTrack digitalTrack_; // Class used to digitize track if required. + std::shared_ptr digitalTrack_; // Class used to digitize track if required. }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/KFbase.h b/L1Trigger/TrackFindingTMTT/interface/KFbase.h new file mode 100644 index 0000000000000..57302237c8eec --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/KFbase.h @@ -0,0 +1,170 @@ +#ifndef L1Trigger_TrackFindingTMTT_KFbase_h +#define L1Trigger_TrackFindingTMTT_KFbase_h + +#include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" +#include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" +#include +#include + +#include +#include +#include +#include +#include + +class TH1F; +class TH2F; + +///=== This is the base class for the Kalman Combinatorial Filter track fit algorithm. +///=== All variable names & equations come from Fruhwirth KF paper +///=== http://dx.doi.org/10.1016/0168-9002%2887%2990887-4 + +namespace tmtt { + + class TP; + class KalmanState; + + class KFbase : public TrackFitGeneric { + public: + enum PAR_IDS { INV2R, PHI0, T, Z0, D0 }; + enum PAR_IDS_VAR { QOVERPT }; + enum MEAS_IDS { PHI, Z }; + + public: + // Initialize configuration + KFbase(const Settings *settings, const uint nPar, const std::string &fitterName = "", const uint nMeas = 2); + + virtual ~KFbase() { this->resetStates(); } + + KFbase(const KFbase &kf) = delete; // Disable copy & move of this class. + KFbase(KFbase &&kf) = delete; + KFbase &operator=(const KFbase &kf) = delete; + KFbase &operator=(KFbase &&kf) = delete; + + // Do KF fit + L1fittedTrack fit(const L1track3D &l1track3D); + + protected: + // Do KF fit (internal) + const KalmanState *doKF(const L1track3D &l1track3D, const std::vector &stubs, const TP *tpa); + + // Add one stub to a helix state + virtual const KalmanState *kalmanUpdate( + unsigned nSkipped, unsigned layer, Stub *stub, const KalmanState *state, const TP *tp); + + // Create a KalmanState, containing a helix state & next stub it is to be updated with. + const KalmanState *mkState(const L1track3D &candidate, + unsigned nSkipped, + unsigned layer, + const KalmanState *last_state, + const TVectorD &x, + const TMatrixD &pxx, + const TMatrixD &K, + const TMatrixD &dcov, + Stub *stub, + double chi2rphi, + double chi2rz); + + //--- Input data + + // Seed track helix params & covariance matrix + virtual TVectorD seedX(const L1track3D &l1track3D) const = 0; + virtual TMatrixD seedC(const L1track3D &l1track3D) const = 0; + + // Stub coordinate measurements & resolution + virtual TVectorD vectorM(const Stub *stub) const = 0; + virtual TMatrixD matrixV(const Stub *stub, const KalmanState *state) const = 0; + + //--- KF maths matrix multiplications + + // Derivate of helix intercept point w.r.t. helix params. + virtual TMatrixD matrixH(const Stub *stub) const = 0; + // Kalman helix ref point extrapolation matrix + virtual TMatrixD matrixF(const Stub *stub = 0, const KalmanState *state = 0) const = 0; + // Product of H*C*H(transpose) (where C = helix covariance matrix) + TMatrixD matrixHCHt(const TMatrixD &h, const TMatrixD &c) const; + // Get inverted Kalman R matrix: inverse(V + HCHt) + TMatrixD matrixRinv(const TMatrixD &matH, const TMatrixD &matCref, const TMatrixD &matV) const; + // Kalman gain matrix + TMatrixD getKalmanGainMatrix(const TMatrixD &h, const TMatrixD &pxcov, const TMatrixD &covRinv) const; + + // Residuals of stub with respect to helix. + virtual TVectorD residual(const Stub *stub, const TVectorD &x, double candQoverPt) const; + + // Update helix state & its covariance matrix with new stub + void adjustState(const TMatrixD &K, + const TMatrixD &pxcov, + const TVectorD &x, + const TMatrixD &h, + const TVectorD &delta, + TVectorD &new_x, + TMatrixD &new_xcov) const; + // Update track fit chi2 with new stub + virtual void adjustChi2(const KalmanState *state, + const TMatrixD &covRinv, + const TVectorD &delta, + double &chi2rphi, + double &chi2rz) const; + + //--- Utilities + + // Reset internal data ready for next track. + void resetStates(); + + // Convert to physical helix params instead of local ones used by KF + virtual TVectorD trackParams(const KalmanState *state) const = 0; + // Ditto after applying beam-spot constraint. + virtual TVectorD trackParams_BeamConstr(const KalmanState *state, double &chi2rphi_bcon) const = 0; + + // Get phi of centre of sector containing track. + double sectorPhi() const { + float phiCentreSec0 = -M_PI / float(settings_->numPhiNonants()) + M_PI / float(settings_->numPhiSectors()); + return 2. * M_PI * float(iPhiSec_) / float(settings_->numPhiSectors()) + phiCentreSec0; + } + + // Get KF layer (which is integer representing order layers cross) + virtual unsigned int kalmanLayer( + unsigned int iEtaReg, unsigned int layerIDreduced, bool barrel, float r, float z) const; + // Check if it is unclear whether a particle is expect to cross this layer. + virtual bool kalmanAmbiguousLayer(unsigned int iEtaReg, unsigned int kfLayer); + // KF algo mods to cope with dead tracker layers. + std::set kalmanDeadLayers(bool &remove2PSCut) const; + + // Function to calculate approximation for tilted barrel modules (aka B) copied from Stub class. + float approxB(float z, float r) const; + + // Is this HLS code? + virtual bool isHLS() { return false; }; + + // Helix state pases cuts. + virtual bool isGoodState(const KalmanState &state) const = 0; + + //--- Debug printout + void printTP(const TP *tp) const; + void printStubLayers(const std::vector &stubs, unsigned int iEtaReg) const; + void printStub(const Stub *stub) const; + void printStubs(const std::vector &stubs) const; + + protected: + unsigned nPar_; + unsigned nMeas_; + unsigned numEtaRegions_; + + unsigned int iPhiSec_; + unsigned int iEtaReg_; + + unsigned int numUpdateCalls_; + + const TP *tpa_; + + // All helix states KF produces for current track. + std::vector> listAllStates_; + }; + +} // namespace tmtt + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/KalmanState.h b/L1Trigger/TrackFindingTMTT/interface/KalmanState.h index 1f030d25aa587..ced792b5a0702 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KalmanState.h +++ b/L1Trigger/TrackFindingTMTT/interface/KalmanState.h @@ -1,80 +1,81 @@ #ifndef L1Trigger_TrackFindingTMTT_KalmanState_h #define L1Trigger_TrackFindingTMTT_KalmanState_h -#include #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" -#include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" +#include "L1Trigger/TrackFindingTMTT/interface/KFbase.h" +#include "TMatrixD.h" +#include "TVectorD.h" + #include +///=== Represents helix state & last associated stub. +///=== All variable names & equations come from Fruhwirth KF paper +///=== http://dx.doi.org/10.1016/0168-9002%2887%2990887-4 + namespace tmtt { - class L1KalmanComb; + class KFbase; class KalmanState; - class StubCluster; - - typedef std::map (*GET_TRACK_PARAMS)(const L1KalmanComb *p, const KalmanState *state); + class Stub; + class Settings; class KalmanState { public: KalmanState(); - KalmanState(const L1track3D &candidate, - unsigned n_skipped, - unsigned kLayer_next, - unsigned layerId, + KalmanState(const Settings *settings, + const L1track3D &candidate, + unsigned nSkipped, + int kLayer, const KalmanState *last_state, - const std::vector &x, - const TMatrixD &pxx, - const TMatrixD &K, - const TMatrixD &dcov, - const StubCluster *stubcl, + const TVectorD &vecX, + const TMatrixD &matC, + const TMatrixD &matK, + const TMatrixD &matV, + Stub *stub, double chi2rphi, - double chi2rz, - L1KalmanComb *fitter, - GET_TRACK_PARAMS f); + double chi2rz); + KalmanState(const KalmanState &p); ~KalmanState() {} KalmanState &operator=(const KalmanState &other); - unsigned nextLayer() const { return kLayerNext_; } - unsigned layerId() const { return layerId_; } - unsigned endcapRing() const { return endcapRing_; } + const Settings *settings() const { return settings_; } + // KF layer where next stub to extend this state should be sought. + unsigned nextLayer() const { return (1 + kLayer_); } + // KF layer of last added stub. (-1 if no stubs yet). + int layer() const { return kLayer_; } bool barrel() const { return barrel_; } - unsigned nSkippedLayers() const { return n_skipped_; } + unsigned nSkippedLayers() const { return nSkipped_; } // Hit coordinates. double r() const { return r_; } double z() const { return z_; } const KalmanState *last_state() const { return last_state_; } // Helix parameters (1/2R, phi relative to sector, z0, tanLambda) - std::vector xa() const { return xa_; } + const TVectorD &vectorX() const { return vecX_; } // Covariance matrix on helix params. - TMatrixD pxxa() const { return pxxa_; } + const TMatrixD &matrixC() const { return matC_; } // Kalman Gain matrix - TMatrixD K() const { return K_; } + const TMatrixD &matrixK() const { return matK_; } // Hit position covariance matrix. - TMatrixD dcov() const { return dcov_; } - // Hit - const StubCluster *stubCluster() const { return stubCluster_; } + const TMatrixD &matrixV() const { return matV_; } + // Last added stub + Stub *stub() const { return stub_; } + // Track used to seed KF. + const L1track3D &candidate() const { return l1track3D_; } + double chi2() const { return chi2rphi_ + chi2rz_; } double chi2scaled() const { return chi2rphi_ / kalmanChi2RphiScale_ + chi2rz_; } // Improves electron performance. double chi2rphi() const { return chi2rphi_; } double chi2rz() const { return chi2rz_; } unsigned nStubLayers() const { return n_stubs_; } - L1track3D candidate() const { return l1track3D_; } unsigned int hitPattern() const { return hitPattern_; } // Bit-encoded KF layers the fitted track has stubs in. bool good(const TP *tp) const; double reducedChi2() const; const KalmanState *last_update_state() const; - std::vector stubs() const; - L1KalmanComb *fitter() const { return fitter_; } - GET_TRACK_PARAMS fXtoTrackParams() const { return fXtoTrackParams_; }; - - static bool orderChi2(const KalmanState *left, const KalmanState *right); - static bool orderMinSkipChi2(const KalmanState *left, const KalmanState *right); + std::vector stubs() const; - static bool order(const KalmanState *left, const KalmanState *right); - void dump(ostream &os, const TP *tp = 0, bool all = 0) const; void setChi2(double chi2rphi, double chi2rz) { chi2rphi_ = chi2rphi; chi2rz_ = chi2rz; @@ -85,25 +86,22 @@ namespace tmtt { //void getHLSselect(unsigned int& mBinHelix, unsigned int& cBinHelix, bool& consistent) const { mBinHelix = mBinHelixHLS_; cBinHelix = cBinHelixHLS_; consistent = consistentHLS_;} private: - unsigned kLayerNext_; - unsigned layerId_; - unsigned endcapRing_; + const Settings *settings_; + int kLayer_; double r_; + double z_; const KalmanState *last_state_; - std::vector xa_; - TMatrixD pxxa_; - TMatrixD K_; - TMatrixD dcov_; - const StubCluster *stubCluster_; + TVectorD vecX_; + TMatrixD matC_; + TMatrixD matK_; + TMatrixD matV_; + Stub *stub_; double chi2rphi_; double chi2rz_; unsigned int kalmanChi2RphiScale_; unsigned n_stubs_; - L1KalmanComb *fitter_; - GET_TRACK_PARAMS fXtoTrackParams_; bool barrel_; - unsigned n_skipped_; - double z_; + unsigned nSkipped_; L1track3D l1track3D_; unsigned int hitPattern_; diff --git a/L1Trigger/TrackFindingTMTT/interface/KillDupFitTrks.h b/L1Trigger/TrackFindingTMTT/interface/KillDupFitTrks.h deleted file mode 100644 index a8a56c835562b..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/KillDupFitTrks.h +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef L1Trigger_TrackFindingTMTT_KillDupFitTrks_h -#define L1Trigger_TrackFindingTMTT_KillDupFitTrks_h - -#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" -#include "L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h" - -#include -#include - -using namespace std; - -/** -* Kill duplicate fitted tracks. -* -* Currently this is intended to run only on tracks found within a single (eta,phi) sector. -* -* N.B. Duplicate track removal algorithms that can only be run on fitted tracks are implemented -* here, whilst those that can also be run on the L1track2D or L1track3D collections are instead -* implemented inside class KillDupTrks. -*/ - -namespace tmtt { - - class Settings; - - class KillDupFitTrks { - public: - KillDupFitTrks() {} - - ~KillDupFitTrks() {} - - /** - * Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. - */ - void init(const Settings* settings, unsigned int dupTrkAlg); - - /** - * Eliminate duplicate tracks from the input collection, and so return a reduced list of tracks. - */ - vector filter(const vector& vecTracks) const; - - private: - /** - * Duplicate removal algorithm designed to run after the track helix fit, which eliminates duplicates simply - * by requiring that the fitted (q/Pt, phi0) of the track correspond to the same HT cell in which the track - * was originally found by the HT. - */ - vector filterAlg50(const vector& tracks) const; - - /** - * Duplicate removal algorithm designed to run after the track helix fit, which eliminates duplicates - * simply by requiring that no two tracks should have fitted (q/Pt, phi0) that correspond to the same HT - * cell. If they do, then only the first to arrive is kept. - */ - vector filterAlg51(const vector& tracks) const; - - /** - * Other duplicate track removal algorithms are available in class KillDupTrks, which this class - * can call. - */ - - // Debug printout of which tracks are duplicates. - void printDuplicateTracks(const vector& tracks) const; - - private: - const Settings* settings_; // Configuration parameters. - unsigned int dupTrkAlg_; // Specifies choice of algorithm for duplicate track removal. - KillDupTrks killDupTrks_; // Contains duplicate removal algorithms common to all track types. - }; - -} // namespace tmtt - -#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h b/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h deleted file mode 100644 index 9edc915312fc4..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef L1Trigger_TrackFindingTMTT_KillDupTrks_h -#define L1Trigger_TrackFindingTMTT_KillDupTrks_h - -#include -#include -#include -#include -#include -#include - -#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" -#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" -#include "L1Trigger/TrackFindingTMTT/interface/TP.h" -#include "FWCore/Utilities/interface/Exception.h" -#include - -using namespace std; - -/** -* Kill duplicate reconstructed tracks. -* e.g. Those sharing many hits in common. -* -* Currently this is intended to run only on tracks found within a single (eta,phi) sector. -* It includes a naive algorithms from Ian (dupTrkAlg = 1) & more sophisticated ones from Ivan (dupTrkAlg > 1). -* The class is implemented inside L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc -* -* The template class "T" can be any class inheriting from L1trackBase. -* -* ------------------------------------------------------------------------------------------- -* GENERAL INFO ABOUT THE FILTER ALGORITHMS DEFINED IN THE CLASS. -* Some of these algorithms are designed to work on r-phi L1track2D tracks, and some on r-z -* L1track2D tracks. Others work on L1tracks3D. -* ------------------------------------------------------------------------------------------- -*/ - -namespace tmtt { - - class L1trackBase; - class L1track2D; - class L1track3D; - class L1fittedTrack; - - template - class KillDupTrks { - public: - KillDupTrks() { - // Check that classed used as template "T" inherits from class L1trackBase. - static_assert(std::is_base_of::value, - "KillDupTrks ERROR: You instantiated this with a template class not inheriting from L1trackBase!"); - } - - ~KillDupTrks() {} - - /** - * Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. - */ - void init(const Settings* settings, unsigned int dupTrkAlg); - - /** - * Eliminate duplicate tracks from the input collection, and so return a reduced list of tracks. - */ - vector filter(const vector& vecTracks) const; - - private: - /** - * Implementing "inverse" OSU algorithm, check for stubs in common, - * keep largest candidates if common stubs in N or more layers (default 5 at present), both if equal - * Implementing "inverse" OSU algorithm, check for stubs in common, - * keep largest candidates if common stubs in N or more layers (default 5 at present), both if equal - */ - vector filterAlg8(const vector& vecTracks) const; - - /** Implementing "inverse" OSU algorithm, check for layers in common, reverse order as per Luis's suggestion - * Comparison window of up to 6 - * Modified version of Algo23, looking for layers in common as in Algo8 - * Check if N or more common layers (default 5 at present) - * Then keep candidate with most stubs, use |q/pT| as tie-break, finally drop "latest" if still equal - */ - vector filterAlg25(const vector& vecTracks) const; - - /** - * Prints out a consistently formatted formatted report of killed duplicate track - */ - void printKill(unsigned alg, unsigned dup, unsigned cand, T dupTrack, T candTrack) const; - - /** - * Counts candidate layers with stubs in common - */ - unsigned int layerMatches(std::vector >* iStubs, - std::vector >* jStubs) const; - - private: - const Settings* settings_; // Configuration parameters. - - unsigned int dupTrkAlg_; // Specifies choice of algorithm for duplicate track removal. - unsigned int dupTrkMinCommonHitsLayers_; // Min no of matched stubs & layers to keep smaller cand - }; - -} // namespace tmtt -//=== Include file which implements all the functions in the above class. -#include "L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc" - -#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc b/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc deleted file mode 100644 index 85bd0fa7b987c..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/KillDupTrks.icc +++ /dev/null @@ -1,319 +0,0 @@ -namespace tmtt { - - // Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. - template - void KillDupTrks::init(const Settings* settings, unsigned int dupTrkAlg) { - settings_ = settings; - - dupTrkAlg_ = dupTrkAlg; - dupTrkMinCommonHitsLayers_ = settings->dupTrkMinCommonHitsLayers(); - } - - // Count layers with stubs in common - template - unsigned int KillDupTrks::layerMatches(std::vector >* iStubs, - std::vector >* jStubs) const { - unsigned int match = 0; - unsigned int indxI = 0; - unsigned int indxJ = 0; - unsigned int lenI = iStubs->size(); - unsigned int lenJ = jStubs->size(); - - std::set layers; - - while ((indxI < lenI) && (indxJ < lenJ)) { - // Stub indices match? - if (iStubs->at(indxI).first == jStubs->at(indxJ).first) { - // Get layer for stub - unsigned int layer = iStubs->at(indxI).second; - - // Any match in this layer yet? - if (layers.insert(layer).second) { - ++match; - } - - // Next stubs - ++indxI; - ++indxJ; - } else { - if (iStubs->at(indxI).first < jStubs->at(indxJ).first) { - // In i, not j - ++indxI; - } else { - // In j, not i - ++indxJ; - } - } - } - return match; - } - - // Eliminate duplicate tracks from the input collection, and so return a reduced list of tracks. - template - vector KillDupTrks::filter(const vector& vecTracks) const { - // Short-circuit the calculation for trivial cases - if (vecTracks.size() == 0 || vecTracks.size() == 1) { - return vecTracks; - } - - // Choose which algorithm to run, based on parameter dupTrkAlg_. - switch (dupTrkAlg_) { - // Do no filtering at all in the 0 case - case 0: - return vecTracks; - break; - case 8: - return filterAlg8(vecTracks); - break; - case 25: - return filterAlg25(vecTracks); - break; - default: - throw cms::Exception("KillDupTrks: Option DupTrkAlg in cfg has invalid value."); - } - - // We should never end up here - return vecTracks; - } - - // Implementing "inverse" OSU algorithm, check for stubs in common, - // keep largest candidates if common stubs in N or more layers (default 5 at present), both if equal - // Implementing "inverse" OSU algorithm, check for stubs in common, - // keep largest candidates if common stubs in N or more layers (default 5 at present), both if equal - - template - vector KillDupTrks::filterAlg8(const vector& vecTracks) const { - vector vecTracksFiltered; - - // vector (corresponding to candidate tracks) of vectors (indices for stubs) - std::vector > > candList; - - for (const T& trk : vecTracks) { - const vector& stubs = trk.getStubs(); - std::vector > stubList; - - for (const auto& myStub : stubs) { - stubList.push_back(std::pair(myStub->index(), myStub->layerId())); - } - - // now necessary due to seed-filter disordering stubs - std::sort(stubList.begin(), stubList.end()); - - // make up vector of vectors - candList.push_back(stubList); - } - - std::vector indices; // to avoid expense of manipulating candidate vector - - for (std::size_t i = 0; i < candList.size(); ++i) { - indices.push_back(i); - } - - unsigned int i = 0; - - // Loop through vector - while (i < (candList.size() - 1)) { - unsigned int j = i + 1; - - // Check rest of candidates - while (j < candList.size()) { - if (layerMatches(&(candList[i]), &(candList[j])) >= - dupTrkMinCommonHitsLayers_) // Enough in common to keep one and kill the other - { - unsigned int qualI = vecTracks[indices[i]].getNumLayers(); - unsigned int qualJ = vecTracks[indices[j]].getNumLayers(); - - // Keep best "quality" - if (qualI < qualJ) { - printKill(dupTrkAlg_, i, j, vecTracks[indices[i]], vecTracks[indices[j]]); - - candList.erase(candList.begin() + i); - indices.erase(indices.begin() + i); - - // To counter increment we don't want here - --i; - - // Out of j-while - break; - } else { - // Delete j if lower quality (or equal to remove duplicates!) - - printKill(dupTrkAlg_, j, i, vecTracks[indices[j]], vecTracks[indices[i]]); - - candList.erase(candList.begin() + j); - indices.erase(indices.begin() + j); - } - } else { - // Keep both, next candidate - ++j; - } - } - ++i; - } - - for (std::size_t i = 0; i < indices.size(); ++i) { - vecTracksFiltered.push_back(vecTracks.at(indices[i])); // copy non-dupes to output - } - - return vecTracksFiltered; - } - - // Implementing "inverse" OSU algorithm, check for layers in common, reverse order as per Luis's suggestion - // Comparison window of up to 6 - // Modified version of Algo23, looking for layers in common as in Algo8 - // Check if N or more common layers (default 5 at present) - // Then keep candidate with most stubs, use |q/pT| as tie-break, finally drop "latest" if still equal - template - vector KillDupTrks::filterAlg25( - const vector& vecTracks) const { // vector (corresponding to candidate tracks) of vectors (indices for stubs) - std::vector > > candList; - - //std::cout<<"** Alg25 comparing "<& stubs = trk.getStubs(); - std::vector > stubList; - - for (const auto& myStub : stubs) { - stubList.push_back(std::pair(myStub->index(), myStub->layerId())); - } - - // now necessary due to seed-filter disordering stubs - std::sort(stubList.begin(), stubList.end()); - - // make up vector of vectors - candList.push_back(stubList); - } - - std::vector indices(candList.size(), true); // since we can't manipulate const candidate vector - - unsigned int i = 0; - - // Loop through vector - while (i < candList.size()) { - unsigned int range = vecTracks[i].getNumStubs(); - - // Check rest of candidates - for (unsigned int j = 0; j < candList.size(); - ++j) // Start at 0 as tracks out of scope can still eliminate future tracks - { - if (j == i) - continue; // We would always get a match... - if (j > i) { - range += vecTracks[j].getNumStubs(); - if (range >= 51) - break; - } - - if (layerMatches(&(candList[i]), &(candList[j])) >= dupTrkMinCommonHitsLayers_) // Enough in common - { - unsigned int qualI = vecTracks[i].getNumLayers(); - unsigned int qualJ = vecTracks[j].getNumLayers(); - - if (j < i) { - if (qualI == qualJ) // Drop i if same stubs, larger abs(q/pT), keep both if equal - // (later - j - will go out further down) - { - if (fabs(vecTracks[i].qOverPt()) > fabs(vecTracks[j].qOverPt())) { - printKill(dupTrkAlg_, i, j, vecTracks[i], vecTracks[j]); - //std::cout<<"a) "<i - { - if (qualI < qualJ) // Drop one with fewer layers - { - printKill(dupTrkAlg_, i, j, vecTracks[i], vecTracks[j]); - //std::cout<<"c) "<"<"<qualJ "<"<="<"< vecTracksFiltered; // Copy surviving candidates to output - for (unsigned int i = 0; i < vecTracks.size(); ++i) { - if (indices[i]) { - vecTracksFiltered.push_back(vecTracks[i]); - } - } - //std::cout<<"** Alg 25 returning "< - void KillDupTrks::printKill(unsigned int alg, unsigned int dup, unsigned int cand, T dupTrack, T candTrack) const { - // condition to print debug info from duplicate track removal code. - if (settings_->debug() == 5) { - std::pair duploc = dupTrack.getCellLocationHT(); - std::pair canloc = candTrack.getCellLocationHT(); - - const TP *dupTP = dupTrack.getMatchedTP(), *candTP = candTrack.getMatchedTP(); - - int dupTPIndex = dupTP == nullptr ? -1 : dupTP->index(); - int candTPIndex = candTP == nullptr ? -1 : candTP->index(); - - bool dupUsed = false, candUsed = false; - - if (dupTP != nullptr) { - dupUsed = dupTP->useForAlgEff(); - } - if (candTP != nullptr) { - candUsed = candTP->useForAlgEff(); - } - - std::cout << "** Alg" << alg << " erasing dupe " << dup << " (TP " << dupTPIndex << " " << dupUsed << ")" - << " at (" << duploc.first << "," << duploc.second << ")" - << " of cand " << cand << " (TP " << candTPIndex << " " << candUsed << ")" - << " at (" << canloc.first << "," << canloc.second << ")" - << " deltas " << int(duploc.first) - int(canloc.first) << " " << int(duploc.second) - int(canloc.second) - << std::endl; - } - } - - // I thought these three lines would allow the class implementation to be inside KillDupTrks.cc instead of in KillDupTrks.icc, but seems not to work ... - //template class KillDupTrks; - //template class KillDupTrks; - //template class KillDupTrks; - -} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h b/L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h deleted file mode 100644 index 6f95040170205..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h +++ /dev/null @@ -1,58 +0,0 @@ -///=== This is the base class for the linearised chi-squared track fit algorithms. - -///=== Written by: Sioni Summers and Alexander D. Morton - -#ifndef L1Trigger_TrackFindingTMTT_L1ChiSquared_h -#define L1Trigger_TrackFindingTMTT_L1ChiSquared_h - -#include "L1Trigger/TrackFindingTMTT/interface/Matrix.h" -#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" -#include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h" -#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" -#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" -#include -#include -#include - -namespace tmtt { - - class L1ChiSquared : public TrackFitGeneric { - public: - L1ChiSquared(const Settings* settings, const uint nPar); - - virtual ~L1ChiSquared() {} - - L1fittedTrack fit(const L1track3D& l1track3D); - - protected: - /* Methods */ - virtual std::vector seed(const L1track3D& l1track3D) = 0; - virtual std::vector residuals(std::vector x) = 0; - virtual Matrix D(std::vector x) = 0; // derivatives - virtual Matrix Vinv() = 0; // Covariances - virtual std::map convertParams(std::vector x) = 0; - - /* Variables */ - std::vector stubs_; - std::map trackParams_; - uint nPar_; - float largestresid_; - int ilargestresid_; - double chiSq_; - - private: - void calculateChiSq(std::vector resids); - void calculateDeltaChiSq(std::vector deltaX, std::vector covX); - - int numFittingIterations_; - int killTrackFitWorstHit_; - double generalResidualCut_; - double killingResidualCut_; - - unsigned int minStubLayers_; - unsigned int minStubLayersRed_; - }; - -} // namespace tmtt - -#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h b/L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h deleted file mode 100644 index 07ab863cd0f9c..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h +++ /dev/null @@ -1,208 +0,0 @@ -///=== This is the base class for the Kalman Combinatorial Filter track fit algorithm. - -#ifndef L1Trigger_TrackFindingTMTT_L1KalmanComb_h -#define L1Trigger_TrackFindingTMTT_L1KalmanComb_h - -#include -#include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h" -#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" -#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" -#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" -#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" -#include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" -#include -#include -#include -#include - -class TH1F; -class TH2F; - -namespace tmtt { - - class TP; - class KalmanState; - class StubCluster; - - class L1KalmanComb : public TrackFitGeneric { - public: - enum OVERLAP_TYPE { TYPE_NORMAL, TYPE_V2, TYPE_NOCLUSTERING, TYPE_TP }; - - public: - L1KalmanComb(const Settings *settings, const uint nPar, const string &fitterName = "", const uint nMeas = 2); - - virtual ~L1KalmanComb() { - this->resetStates(); - this->deleteStubClusters(); - } - - L1fittedTrack fit(const L1track3D &l1track3D); - void bookHists(); - - protected: - static std::map getTrackParams(const L1KalmanComb *p, const KalmanState *state); - virtual std::map getTrackParams(const KalmanState *state) const = 0; - - // Get track params with beam-spot constraint & chi2 (r-phi) after applying it.. - virtual std::map getTrackParams_BeamConstr(const KalmanState *state, - double &chi2rphi_bcon) const { - chi2rphi_bcon = 0.0; - return (this->getTrackParams(state)); // Returns unconstrained result, unless derived class overrides it. - } - - double sectorPhi() const { - float phiCentreSec0 = - -M_PI / float(getSettings()->numPhiNonants()) + M_PI / float(getSettings()->numPhiSectors()); - return 2. * M_PI * float(iCurrentPhiSec_) / float(getSettings()->numPhiSectors()) + phiCentreSec0; - } - //bool kalmanUpdate( const StubCluster *stubCluster, KalmanState &state, KalmanState &new_state, const TP *tpa ); - virtual const KalmanState *kalmanUpdate( - unsigned skipped, unsigned layer, const StubCluster *stubCluster, const KalmanState &state, const TP *); - void resetStates(); - void deleteStubClusters(); - const KalmanState *mkState(const L1track3D &candidate, - unsigned skipped, - unsigned layer, - unsigned layerId, - const KalmanState *last_state, - const std::vector &x, - const TMatrixD &pxx, - const TMatrixD &K, - const TMatrixD &dcov, - const StubCluster *stubCluster, - double chi2rphi, - double chi2rz); - - protected: - /* Methods */ - std::vector Hx(const TMatrixD &pH, const std::vector &x) const; - std::vector Fx(const TMatrixD &pF, const std::vector &x) const; - TMatrixD HxxH(const TMatrixD &pH, const TMatrixD &xx) const; - void getDeltaChi2(const TMatrixD &dcov, - const std::vector &delta, - bool debug, - double &deltaChi2rphi, - double &deltaChi2rz) const; - TMatrixD GetKalmanMatrix(const TMatrixD &h, const TMatrixD &pxcov, const TMatrixD &dcov) const; - void GetAdjustedState(const TMatrixD &K, - const TMatrixD &pxcov, - const std::vector &x, - const StubCluster *stubCluster, - const std::vector &delta, - std::vector &new_x, - TMatrixD &new_xcov) const; - - virtual std::vector seedx(const L1track3D &l1track3D) const = 0; - virtual TMatrixD seedP(const L1track3D &l1track3D) const = 0; - virtual void barrelToEndcap(double r, - const StubCluster *stubCluster, - std::vector &x, - TMatrixD &cov_x) const {} - virtual std::vector d(const StubCluster *stubCluster) const = 0; - virtual TMatrixD H(const StubCluster *stubCluster) const = 0; - virtual TMatrixD F(const StubCluster *stubCluster = 0, const KalmanState *state = 0) const = 0; - virtual TMatrixD PxxModel(const KalmanState *state, const StubCluster *stubCluster) const = 0; - virtual TMatrixD PddMeas(const StubCluster *stubCluster, const KalmanState *state) const = 0; - - virtual std::vector residual(const StubCluster *stubCluster, - const std::vector &x, - double candQoverPt) const; - virtual const KalmanState *updateSeedWithStub(const KalmanState &state, const StubCluster *stubCluster) { - return 0; - } - virtual bool isGoodState(const KalmanState &state) const { return true; } - - virtual void calcChi2(const KalmanState &state, double &chi2rphi, double &chi2rz) const; - - virtual double getRofState(unsigned layerId, const vector &xa) const { return 0; } - virtual unsigned int getKalmanLayer( - unsigned int iEtaReg, unsigned int layerIDreduced, bool barrel, float r, float z) const; - virtual bool getKalmanAmbiguousLayer(unsigned int iEtaReg, unsigned int kfLayer); - - std::vector doKF(const L1track3D &l1track3D, - const std::vector &stubClusters, - const TP *tpa); - - void printTPSummary(std::ostream &os, const TP *tp, bool addReturn = true) const; - void printTP(std::ostream &os, const TP *tp) const; - void printStubLayers(std::ostream &os, std::vector &stubs, unsigned int iEtaReg) const; - void printStubCluster(std::ostream &os, const StubCluster *stubCluster, bool addReturn = true) const; - void printStubClusters(std::ostream &os, std::vector &stubClusters) const; - void printStub(std::ostream &os, const Stub *stub, bool addReturn = true) const; - void printStubs(std::ostream &os, std::vector &stubs) const; - - void fillSeedHists(const KalmanState *state, const TP *tpa); - void fillCandHists(const KalmanState &state, const TP *tpa = 0); - void fillStepHists(const TP *tpa, unsigned nItr, const KalmanState *new_state); - - double DeltaRphiForClustering(unsigned layerId, unsigned endcapRing); - double DeltaRForClustering(unsigned endcapRing); - bool isOverlap(const Stub *a, const Stub *b, OVERLAP_TYPE type); - - set getKalmanDeadLayers(bool &remove2PSCut) const; - - // Function to calculate approximation for tilted barrel modules (aka B) copied from Stub class. - float getApproxB(float z, float r) const; - - // Is this HLS code? - virtual bool isHLS() { return false; }; - - protected: - unsigned nPar_; - unsigned nMeas_; - unsigned numEtaRegions_; - - std::vector state_list_; - std::vector stbcl_list_; - - std::vector hxaxtmin; - std::vector hxaxtmax; - std::vector hxmin; - std::vector hxmax; - std::vector hymin; - std::vector hymax; - std::vector hdxmin; - std::vector hdxmax; - std::vector hresmin; - std::vector hresmax; - std::vector hddMeasmin; - std::vector hddMeasmax; - - TH1F *hTrackEta_; - TH1F *hUniqueTrackEta_; - std::map hBarrelStubMaxDistanceMap; - std::map hEndcapStubMaxDistanceMap; - std::map hphiErrorRatioMap; - std::map hstubCombMap; - - TH1F *hndupStub_; - TH1F *hnmergeStub_; - std::map hytMap; - std::map hy0Map; - std::map hyfMap; - std::map hxMap; - std::map hxcovMap; - std::map hkMap; - std::map hresMap; - std::map hmcovMap; - - double hchi2min; - double hchi2max; - - unsigned maxNfitForDump_; - bool dump_; - unsigned int iCurrentPhiSec_; - unsigned int iCurrentEtaReg_; - unsigned int iLastPhiSec_; - unsigned int iLastEtaReg_; - - unsigned int minStubLayersRed_; - - unsigned int numUpdateCalls_; - - const TP *tpa_; - }; - -} // namespace tmtt - -#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h b/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h index 0333c0ad174e4..c10253f993d92 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h @@ -18,8 +18,7 @@ #include #include #include - -using namespace std; +#include //=== This represents a fitted L1 track candidate found in 3 dimensions. //=== It gives access to the fitted helix parameters & chi2 etc. @@ -36,8 +35,8 @@ namespace tmtt { // and the number of helix parameters being fitted (=5 if d0 is fitted, or =4 if d0 is not fitted). // And if track fit declared this to be a valid track (enough stubs left on track after fit etc.). L1fittedTrack(const Settings* settings, - const L1track3D& l1track3D, - const vector& stubs, + const L1track3D* l1track3D, + const std::vector& stubs, unsigned int hitPattern, float qOverPt, float d0, @@ -52,6 +51,7 @@ namespace tmtt { settings_(settings), l1track3D_(l1track3D), stubs_(stubs), + stubsConst_(stubs_.begin(), stubs_.end()), hitPattern_(hitPattern), qOverPt_(qOverPt), d0_(d0), @@ -66,48 +66,51 @@ namespace tmtt { phi0_bcon_(phi0), chi2rphi_bcon_(chi2rphi), nHelixParam_(nHelixParam), - iPhiSec_(l1track3D.iPhiSec()), - iEtaReg_(l1track3D.iEtaReg()), - optoLinkID_(l1track3D.optoLinkID()), accepted_(accepted), nSkippedLayers_(0), numUpdateCalls_(0), - numIterations_(0), - digitizedTrack_(false), - digitalTrack_(settings) { - // Doesn't make sense to assign stubs to track if fitter rejected it. - if (!accepted) - stubs_.clear(); - nLayers_ = Utility::countLayers(settings, stubs); // Count tracker layers these stubs are in - matchedTP_ = Utility::matchingTP(settings, - stubs, - nMatchedLayers_, - matchedStubs_); // Find associated truth particle & calculate info about match. + numIterations_(0) { + if (l1track3D != nullptr) { + iPhiSec_ = l1track3D->iPhiSec(); + iEtaReg_ = l1track3D->iEtaReg(); + optoLinkID_ = l1track3D->optoLinkID(); + } else { // Rejected track + iPhiSec_ = 0; + iEtaReg_ = 0; + optoLinkID_ = 0; + } + if (settings != nullptr) { + // Count tracker layers these stubs are in + nLayers_ = Utility::countLayers(settings, stubs_); + // Find associated truth particle & calculate info about match. + matchedTP_ = Utility::matchingTP(settings, stubs_, nMatchedLayers_, matchedStubs_); + } else { // Rejected track + nLayers_ = 0; + matchedTP_ = nullptr; + } // Set d0 = 0 for 4 param fit, in case fitter didn't do it. if (nHelixParam == 4) { d0_ = 0.; d0_bcon_ = 0.; } - if (!settings->hybrid()) { - secTmp_.init(settings, - iPhiSec_, - iEtaReg_); //Sector class used to check if fitted track trajectory is in expected sector. - htRphiTmp_.init( - settings, - iPhiSec_, - iEtaReg_, - secTmp_.etaMin(), - secTmp_.etaMax(), - secTmp_.phiCentre()); // HT class used to identify HT cell that corresponds to fitted helix parameters. + if (settings != nullptr && not settings->hybrid()) { + //Sector class used to check if fitted track trajectory is in expected sector. + secTmp_ = std::make_shared(settings, iPhiSec_, iEtaReg_); + // HT class used to identify HT cell that corresponds to fitted helix parameters. + htRphiTmp_ = std::make_shared( + settings, iPhiSec_, iEtaReg_, secTmp_->etaMin(), secTmp_->etaMax(), secTmp_->phiCentre()); + this->setConsistentHTcell(); + } else { + consistentCell_ = false; } - this->setConsistentHTcell(); } - L1fittedTrack() : L1trackBase(){}; // Creates track object, but doesn't set any variables. + // Creates track rejected by fitter. + L1fittedTrack() : L1fittedTrack(nullptr, nullptr, noStubs_, 0, 0., 0., 0., 0., 0., 0., 0., 0, false) {} ~L1fittedTrack() {} - //--- Optionally set track helix params & chi2 if beam-spot constraint is used (for 5-parameter fit). + //--- Optionally std::set track helix params & chi2 if beam-spot constraint is used (for 5-parameter fit). void setBeamConstr(float qOverPt_bcon, float phi0_bcon, float chi2rphi_bcon) { done_bcon_ = true; qOverPt_bcon_ = qOverPt_bcon; @@ -133,25 +136,25 @@ namespace tmtt { } void setInfoCHI2() {} - void getInfoKF(unsigned int& nSkippedLayers, unsigned int& numUpdateCalls) const { + void infoKF(unsigned int& nSkippedLayers, unsigned int& numUpdateCalls) const { nSkippedLayers = nSkippedLayers_; numUpdateCalls = numUpdateCalls_; } - void getInfoLR(int& numIterations, - std::string& lostMatchingState, - std::unordered_map& stateCalls) const { + void infoLR(int& numIterations, + std::string& lostMatchingState, + std::unordered_map& stateCalls) const { numIterations = numIterations_; lostMatchingState = lostMatchingState_; stateCalls = stateCalls_; } - void getInfoCHI2() const {} + void infoCHI2() const {} //--- Convert fitted track to KFTrackletTrack format, for use with HYBRID. KFTrackletTrack returnKFTrackletTrack() { - KFTrackletTrack trk_(getL1track3D(), - getStubs(), - getHitPattern(), + KFTrackletTrack trk_(l1track3D(), + stubsConst(), + hitPattern(), qOverPt(), d0(), phi0(), @@ -170,46 +173,47 @@ namespace tmtt { //--- Provide direct access to some of the info it contains. // Get track candidate from HT (before fit). - const L1track3D& getL1track3D() const { return l1track3D_; } + const L1track3D* l1track3D() const { return l1track3D_; } // Get stubs on fitted track (can differ from those on HT track if track fit kicked out stubs with bad residuals) - const vector& getStubs() const { return stubs_; } + const std::vector& stubsConst() const { return stubsConst_; } + const std::vector& stubs() const { return stubs_; } // Get number of stubs on fitted track. - unsigned int getNumStubs() const { return stubs_.size(); } + unsigned int numStubs() const { return stubs_.size(); } // Get number of tracker layers these stubs are in. - unsigned int getNumLayers() const { return nLayers_; } + unsigned int numLayers() const { return nLayers_; } // Get number of stubs deleted from track candidate by fitter (because they had large residuals) - unsigned int getNumKilledStubs() const { return l1track3D_.getNumStubs() - this->getNumStubs(); } + unsigned int numKilledStubs() const { return l1track3D_->numStubs() - this->numStubs(); } // Get bit-encoded hit pattern (where layer number assigned by increasing distance from origin, according to layers track expected to cross). - unsigned int getHitPattern() const { return hitPattern_; } + unsigned int hitPattern() const { return hitPattern_; } // Get Hough transform cell locations in units of bin number, corresponding to the fitted helix parameters of the track. // Always uses the beam-spot constrained helix params if they are available. // (If fitted track is outside HT array, it it put in the closest bin inside it). - pair getCellLocationFit() const { return htRphiTmp_.getCell(this); } + std::pair cellLocationFit() const { return htRphiTmp_->cell(this); } // Also get HT cell determined by Hough transform. - pair getCellLocationHT() const { return l1track3D_.getCellLocationHT(); } + std::pair cellLocationHT() const { return l1track3D_->cellLocationHT(); } //--- Get information about its association (if any) to a truth Tracking Particle. //--- Can differ from that of corresponding HT track, if track fit kicked out stubs with bad residuals. // Get best matching tracking particle (=nullptr if none). - const TP* getMatchedTP() const { return matchedTP_; } + const TP* matchedTP() const { return matchedTP_; } // Get the matched stubs with this Tracking Particle - const vector& getMatchedStubs() const { return matchedStubs_; } + const std::vector& matchedStubs() const { return matchedStubs_; } // Get number of matched stubs with this Tracking Particle - unsigned int getNumMatchedStubs() const { return matchedStubs_.size(); } + unsigned int numMatchedStubs() const { return matchedStubs_.size(); } // Get number of tracker layers with matched stubs with this Tracking Particle - unsigned int getNumMatchedLayers() const { return nMatchedLayers_; } + unsigned int numMatchedLayers() const { return nMatchedLayers_; } // Get purity of stubs on track (i.e. fraction matching best Tracking Particle) - float getPurity() const { return getNumMatchedStubs() / float(getNumStubs()); } + float purity() const { return numMatchedStubs() / float(numStubs()); } // Get number of stubs matched to correct TP that were deleted from track candidate by fitter. - unsigned int getNumKilledMatchedStubs() const { - unsigned int nStubCount = l1track3D_.getNumMatchedStubs(); + unsigned int numKilledMatchedStubs() const { + unsigned int nStubCount = l1track3D_->numMatchedStubs(); if (nStubCount > 0) { // Original HT track candidate did match a truth particle - const TP* tp = l1track3D_.getMatchedTP(); + const TP* tp = l1track3D_->matchedTP(); for (const Stub* s : stubs_) { - set assTPs = s->assocTPs(); + std::set assTPs = s->assocTPs(); if (assTPs.find(tp) != assTPs.end()) nStubCount--; // We found a stub matched to original truth particle that survived fit. } @@ -221,8 +225,12 @@ namespace tmtt { float qOverPt() const { return qOverPt_; } float charge() const { return (qOverPt_ > 0 ? 1 : -1); } - float invPt() const { return fabs(qOverPt_); } - float pt() const { return 1. / (1.0e-6 + this->invPt()); } // includes protection against 1/pt = 0. + float invPt() const { return std::abs(qOverPt_); } + // Protect pt against 1/pt = 0. + float pt() const { + constexpr float small = 1.0e-6; + return 1. / (small + this->invPt()); + } float d0() const { return d0_; } float phi0() const { return phi0_; } float z0() const { return z0_; } @@ -236,8 +244,12 @@ namespace tmtt { bool done_bcon() const { return done_bcon_; } // Was beam-spot constraint aplied? float qOverPt_bcon() const { return qOverPt_bcon_; } float charge_bcon() const { return (qOverPt_bcon_ > 0 ? 1 : -1); } - float invPt_bcon() const { return fabs(qOverPt_bcon_); } - float pt_bcon() const { return 1. / (1.0e-6 + this->invPt_bcon()); } + float invPt_bcon() const { return std::abs(qOverPt_bcon_); } + // Protect pt against 1/pt = 0. + float pt_bcon() const { + constexpr float small = 1.0e-6; + return 1. / (small + this->invPt_bcon()); + } float phi0_bcon() const { return phi0_bcon_; } // Phi and z coordinates at which track crosses "chosenR" values used by r-phi HT and rapidity sectors respectively. @@ -261,9 +273,9 @@ namespace tmtt { float nHelixParam() const { return nHelixParam_; } // Get the fit degrees of freedom, chi2 & chi2/DOF (also in r-phi & r-z planes). - unsigned int numDOF() const { return 2 * this->getNumStubs() - nHelixParam_; } - unsigned int numDOFrphi() const { return this->getNumStubs() - (nHelixParam_ - 2); } - unsigned int numDOFrz() const { return this->getNumStubs() - 2; } + unsigned int numDOF() const { return 2 * this->numStubs() - nHelixParam_; } + unsigned int numDOFrphi() const { return this->numStubs() - (nHelixParam_ - 2); } + unsigned int numDOFrz() const { return this->numStubs() - 2; } float chi2rphi() const { return chi2rphi_; } float chi2rz() const { return chi2rz_; } float chi2() const { return chi2rphi_ + chi2rz_; } @@ -288,11 +300,6 @@ namespace tmtt { bool accepted() const { return accepted_; } - // Comparitor useful for sorting tracks by q/Pt using std::sort(). - static bool qOverPtSortPredicate(const L1fittedTrack& t1, const L1fittedTrack t2) { - return t1.qOverPt() < t2.qOverPt(); - } - //--- Functions to help eliminate duplicate tracks. // Is the fitted track trajectory should lie within the same HT cell in which the track was originally found? @@ -300,22 +307,21 @@ namespace tmtt { // Determine if the fitted track trajectory should lie within the same HT cell in which the track was originally found? void setConsistentHTcell() { - //return (max(fabs(this->deltaM()), fabs(this->deltaC())) < 0.5); // Use helix params with beam-spot constaint if done in case of 5 param fit. - pair htCell = this->getCellLocationHT(); - bool consistent = (htCell == this->getCellLocationFit()); + std::pair htCell = this->cellLocationHT(); + bool consistent = (htCell == this->cellLocationFit()); - if (l1track3D_.mergedHTcell()) { + if (l1track3D_->mergedHTcell()) { // If this is a merged cell, check other elements of merged cell. - pair htCell10(htCell.first + 1, htCell.second); - pair htCell01(htCell.first, htCell.second + 1); - pair htCell11(htCell.first + 1, htCell.second + 1); - if (htCell10 == this->getCellLocationFit()) + std::pair htCell10(htCell.first + 1, htCell.second); + std::pair htCell01(htCell.first, htCell.second + 1); + std::pair htCell11(htCell.first + 1, htCell.second + 1); + if (htCell10 == this->cellLocationFit()) consistent = true; - if (htCell01 == this->getCellLocationFit()) + if (htCell01 == this->cellLocationFit()) consistent = true; - if (htCell11 == this->getCellLocationFit()) + if (htCell11 == this->cellLocationFit()) consistent = true; } @@ -325,26 +331,28 @@ namespace tmtt { // Is the fitted track trajectory within the same (eta,phi) sector of the HT used to find it? bool consistentSector() const { bool insidePhi = - (fabs(reco::deltaPhi(this->phiAtChosenR(done_bcon_), secTmp_.phiCentre())) < secTmp_.sectorHalfWidth()); - bool insideEta = (this->zAtChosenR() > secTmp_.zAtChosenR_Min() && this->zAtChosenR() < secTmp_.zAtChosenR_Max()); + (std::abs(reco::deltaPhi(this->phiAtChosenR(done_bcon_), secTmp_->phiCentre())) < secTmp_->sectorHalfWidth()); + bool insideEta = + (this->zAtChosenR() > secTmp_->zAtChosenR_Min() && this->zAtChosenR() < secTmp_->zAtChosenR_Max()); return (insidePhi && insideEta); } // Digitize track and degrade helix parameter resolution according to effect of digitisation. - void digitizeTrack(const string& fitterName); + void digitizeTrack(const std::string& fitterName); - // Access to detailed info about digitized track - const DigitalTrack& digitaltrack() const { return digitalTrack_; } + // Access to detailed info about digitized track. (Gets nullptr if trk not digitized) + const DigitalTrack* digitaltrack() const { return digitalTrack_.get(); } private: //--- Configuration parameters const Settings* settings_; //--- The 3D hough-transform track candidate which was fitted. - L1track3D l1track3D_; + const L1track3D* l1track3D_; //--- The stubs on the fitted track (can differ from those on HT track if fit kicked off stubs with bad residuals) - vector stubs_; + std::vector stubs_; + std::vector stubsConst_; unsigned int nLayers_; //--- Bit-encoded hit pattern (where layer number assigned by increasing distance from origin, according to layers track expected to cross). @@ -377,16 +385,16 @@ namespace tmtt { //--- Information about its association (if any) to a truth Tracking Particle. const TP* matchedTP_; - vector matchedStubs_; + std::vector matchedStubs_; unsigned int nMatchedLayers_; //--- Has the track fit declared this to be a valid track? bool accepted_; //--- Sector class used to check if fitted track trajectory is in same sector as HT used to find it. - Sector secTmp_; + std::shared_ptr secTmp_; // shared so as to allow copy of L1fittedTrack. //--- r-phi HT class used to determine HT cell location that corresponds to fitted track helix parameters. - HTrphi htRphiTmp_; + std::shared_ptr htRphiTmp_; //--- Info specific to KF fitter. unsigned int nSkippedLayers_; @@ -396,10 +404,11 @@ namespace tmtt { std::string lostMatchingState_; std::unordered_map stateCalls_; - bool digitizedTrack_; - DigitalTrack digitalTrack_; // Class used to digitize track if required. + std::shared_ptr digitalTrack_; // Class used to digitize track if required. bool consistentCell_; + + static const std::vector noStubs_; // Empty vector used to initialize rejected tracks. }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/L1track2D.h b/L1Trigger/TrackFindingTMTT/interface/L1track2D.h index 6617c81f246ab..273e6ee671c6d 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1track2D.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1track2D.h @@ -11,8 +11,6 @@ #include #include -using namespace std; - //=== L1 track cand found in 2 dimensions. //=== Gives access to all stubs on track and to its 2D helix parameters. //=== Also calculates & gives access to associated truth particle (Tracking Particle) if any. @@ -23,9 +21,9 @@ namespace tmtt { public: // Give stubs on track, its cell location inside HT array, its 2D helix parameters. L1track2D(const Settings* settings, - const vector& stubs, - pair cellLocationHT, - pair helix2D, + const std::vector& stubs, + std::pair cellLocationHT, + std::pair helix2D, unsigned int iPhiSec, unsigned int iEtaReg, unsigned int optoLinkID, @@ -33,6 +31,7 @@ namespace tmtt { : L1trackBase(), settings_(settings), stubs_(stubs), + stubsConst_(stubs_.begin(), stubs_.end()), cellLocationHT_(cellLocationHT), helix2D_(helix2D), estValid_(false), @@ -42,30 +41,31 @@ namespace tmtt { iEtaReg_(iEtaReg), optoLinkID_(optoLinkID), mergedHTcell_(mergedHTcell) { - nLayers_ = Utility::countLayers(settings, stubs); // Count tracker layers these stubs are in + nLayers_ = Utility::countLayers(settings, stubs_); // Count tracker layers these stubs are in matchedTP_ = Utility::matchingTP(settings, - stubs, + stubs_, nMatchedLayers_, matchedStubs_); // Find associated truth particle & calculate info about match. } - L1track2D() : L1trackBase(){}; // Creates track object, but doesn't set any variables. + L1track2D() : L1trackBase(){}; // Creates track object, but doesn't std::set any variables. ~L1track2D() {} //--- Get information about the reconstructed track. // Get stubs on track candidate. - const vector& getStubs() const { return stubs_; } + const std::vector& stubsConst() const { return stubsConst_; } + const std::vector& stubs() const { return stubs_; } // Get number of stubs on track candidate. - unsigned int getNumStubs() const { return stubs_.size(); } + unsigned int numStubs() const { return stubs_.size(); } // Get number of tracker layers these stubs are in. - unsigned int getNumLayers() const { return nLayers_; } + unsigned int numLayers() const { return nLayers_; } // Get cell location of track candidate in Hough Transform array in units of bin number. - pair getCellLocationHT() const { return cellLocationHT_; } + std::pair cellLocationHT() const { return cellLocationHT_; } // The two conventionally agreed track helix parameters relevant in this 2D plane. // i.e. (q/Pt, phi0). - pair getHelix2D() const { return helix2D_; } + std::pair helix2D() const { return helix2D_; } //--- User-friendlier access to the helix parameters obtained from track location inside HT array. @@ -73,7 +73,7 @@ namespace tmtt { float phi0() const { return helix2D_.second; } //--- In the case of tracks found by the r-phi HT, a rough estimate of the (z0, tan_lambda) may be provided by any r-z - //--- track filter run after the r-phi HT. These two functions give set/get access to these. + //--- track filter run after the r-phi HT. These two functions give std::set/get access to these. //--- The "get" function returns a boolean indicating if an estimate exists (i.e. "set" has been called). void setTrkEstZ0andTanLam(float estZ0, float estTanLambda) { @@ -82,7 +82,7 @@ namespace tmtt { estValid_ = true; } - bool getTrkEstZ0andTanLam(float& estZ0, float& estTanLambda) const { + bool trkEstZ0andTanLam(float& estZ0, float& estTanLambda) const { estZ0 = estZ0_; estTanLambda = estTanLambda_; return estValid_; @@ -102,23 +102,24 @@ namespace tmtt { //--- Get information about its association (if any) to a truth Tracking Particle. // Get matching tracking particle (=nullptr if none). - const TP* getMatchedTP() const { return matchedTP_; } + const TP* matchedTP() const { return matchedTP_; } // Get the matched stubs. - const vector& getMatchedStubs() const { return matchedStubs_; } + const std::vector& matchedStubs() const { return matchedStubs_; } // Get number of matched stubs. - unsigned int getNumMatchedStubs() const { return matchedStubs_.size(); } + unsigned int numMatchedStubs() const { return matchedStubs_.size(); } // Get number of tracker layers with matched stubs. - unsigned int getNumMatchedLayers() const { return nMatchedLayers_; } + unsigned int numMatchedLayers() const { return nMatchedLayers_; } private: //--- Configuration parameters const Settings* settings_; //--- Information about the reconstructed track from Hough transform. - vector stubs_; + std::vector stubs_; + std::vector stubsConst_; unsigned int nLayers_; - pair cellLocationHT_; - pair helix2D_; + std::pair cellLocationHT_; + std::pair helix2D_; //--- Rough estimate of r-z track parameters from r-z filter, which may be present in case of r-phi Hough transform bool estValid_; @@ -133,7 +134,7 @@ namespace tmtt { //--- Information about its association (if any) to a truth Tracking Particle. const TP* matchedTP_; - vector matchedStubs_; + std::vector matchedStubs_; unsigned int nMatchedLayers_; }; diff --git a/L1Trigger/TrackFindingTMTT/interface/L1track3D.h b/L1Trigger/TrackFindingTMTT/interface/L1track3D.h index 4ceef3c3366f4..25cfa52a64aea 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1track3D.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1track3D.h @@ -15,8 +15,6 @@ #include #include -using namespace std; - //=== L1 track candidate found in 3 dimensions. //=== Gives access to all stubs on track and to its 3D helix parameters. //=== Also calculates & gives access to associated truth particle (Tracking Particle) if any. @@ -24,12 +22,16 @@ using namespace std; namespace tmtt { class L1track3D : public L1trackBase { + public: + // Seeding layers of tracklet pattern reco. + enum TrackletSeedType { L1L2, L2L3, L3L4, L5L6, D1D2, D3D4, L1D1, L2D1, L3L4L2, L5L6L4, L2L3D1, D1D2L2, NONE }; + public: L1track3D(const Settings* settings, - const vector& stubs, - pair cellLocationHT, - pair helixRphi, - pair helixRz, + const std::vector& stubs, + std::pair cellLocationHT, + std::pair helixRphi, + std::pair helixRz, float helixD0, unsigned int iPhiSec, unsigned int iEtaReg, @@ -38,6 +40,7 @@ namespace tmtt { : L1trackBase(), settings_(settings), stubs_(stubs), + stubsConst_(stubs_.begin(), stubs_.end()), cellLocationHT_(cellLocationHT), helixRphi_(helixRphi), helixRz_(helixRz), @@ -46,20 +49,22 @@ namespace tmtt { iEtaReg_(iEtaReg), optoLinkID_(optoLinkID), mergedHTcell_(mergedHTcell), - seedLayerType_(999), + seedLayerType_(TrackletSeedType::NONE), seedPS_(999) { - nLayers_ = Utility::countLayers(settings, stubs); // Count tracker layers these stubs are in + nLayers_ = Utility::countLayers(settings, stubs_); // Count tracker layers these stubs are in matchedTP_ = Utility::matchingTP(settings, - stubs, + stubs_, nMatchedLayers_, matchedStubs_); // Find associated truth particle & calculate info about match. } + // TMTT tracking: constructor + L1track3D(const Settings* settings, - const vector& stubs, - pair cellLocationHT, - pair helixRphi, - pair helixRz, + const std::vector& stubs, + std::pair cellLocationHT, + std::pair helixRphi, + std::pair helixRz, unsigned int iPhiSec, unsigned int iEtaReg, unsigned int optoLinkID, @@ -67,16 +72,15 @@ namespace tmtt { : L1track3D( settings, stubs, cellLocationHT, helixRphi, helixRz, 0.0, iPhiSec, iEtaReg, optoLinkID, mergedHTcell) {} - L1track3D() : L1trackBase(){}; // Creates track object, but doesn't set any variables. + L1track3D() : L1trackBase(){}; // Creates track object, but doesn't std::set any variables. ~L1track3D() {} //--- Set/get optional info for tracklet tracks. - // Tracklet seeding layer pair (from FPGATracklet::seedIndex()) - // 0-7 = "L1L2","L2L3","L3L4","L5L6","D1D2","D3D4","L1D1","L2D1" - void setSeedLayerType(unsigned int seedLayerType) { seedLayerType_ = seedLayerType; } - unsigned int seedLayerType() const { return seedLayerType_; } + // Tracklet seeding layer pair (from Tracklet::calcSeedIndex()) + void setSeedLayerType(unsigned int seedLayerType) { seedLayerType_ = static_cast(seedLayerType); } + TrackletSeedType seedLayerType() const { return seedLayerType_; } // Tracklet seed stub pair uses PS modules (from FPGATracket::PSseed()) void setSeedPS(unsigned int seedPS) { seedPS_ = seedPS; } @@ -89,22 +93,23 @@ namespace tmtt { //--- Get information about the reconstructed track. // Get stubs on track candidate. - const vector& getStubs() const { return stubs_; } + const std::vector& stubsConst() const { return stubsConst_; } + const std::vector& stubs() const { return stubs_; } // Get number of stubs on track candidate. - unsigned int getNumStubs() const { return stubs_.size(); } + unsigned int numStubs() const { return stubs_.size(); } // Get number of tracker layers these stubs are in. - unsigned int getNumLayers() const { return nLayers_; } + unsigned int numLayers() const { return nLayers_; } // Get cell location of track candidate in r-phi Hough Transform array in units of bin number. - pair getCellLocationHT() const { return cellLocationHT_; } + std::pair cellLocationHT() const { return cellLocationHT_; } // The two conventionally agreed track helix parameters relevant in r-phi plane. i.e. (q/Pt, phi0) - pair getHelixRphi() const { return helixRphi_; } + std::pair helixRphi() const { return helixRphi_; } // The two conventionally agreed track helix parameters relevant in r-z plane. i.e. (z0, tan_lambda) - pair getHelixRz() const { return helixRz_; } + std::pair helixRz() const { return helixRz_; } //--- Return chi variables, (both digitized & undigitized), which are the stub coords. relative to track. - vector getChiPhi() { - vector result; + std::vector chiPhi() { + std::vector result; for (const Stub* s : stubs_) { float chi_phi = reco::deltaPhi(s->phi(), this->phi0() - s->r() * this->qOverPt() * settings_->invPtToDphi()); result.push_back(chi_phi); @@ -112,18 +117,18 @@ namespace tmtt { return result; } - vector getChiPhiDigi() { - vector result; + std::vector chiPhiDigi() { + std::vector result; const float phiMult = pow(2, settings_->phiSBits()) / settings_->phiSRange(); - for (const float& chi_phi : this->getChiPhi()) { + for (const float& chi_phi : this->chiPhi()) { int iDigi_chi_phi = floor(chi_phi * phiMult); result.push_back(iDigi_chi_phi); } return result; } - vector getChiZ() { - vector result; + std::vector chiZ() { + std::vector result; for (const Stub* s : stubs_) { float chi_z = s->z() - (this->z0() + s->r() * this->tanLambda()); result.push_back(chi_z); @@ -131,10 +136,10 @@ namespace tmtt { return result; } - vector getChiZDigi() { - vector result; + std::vector chiZDigi() { + std::vector result; const float zMult = pow(2, settings_->zBits()) / settings_->zRange(); - for (const float& chi_z : this->getChiZ()) { + for (const float& chi_z : this->chiZ()) { int iDigi_chi_z = floor(chi_z * zMult); result.push_back(iDigi_chi_z); } @@ -145,9 +150,13 @@ namespace tmtt { float qOverPt() const { return helixRphi_.first; } float charge() const { return (this->qOverPt() > 0 ? 1 : -1); } - float invPt() const { return fabs(this->qOverPt()); } - float pt() const { return 1. / (1.0e-6 + this->invPt()); } // includes protection against 1/pt = 0. - float d0() const { return helixD0_; } // Hough transform assumes d0 = 0. + float invPt() const { return std::abs(this->qOverPt()); } + // Protect pt against 1/pt = 0. + float pt() const { + constexpr float small = 1.0e-6; + return 1. / (small + this->invPt()); + } + float d0() const { return helixD0_; } // Hough transform assumes d0 = 0. float phi0() const { return helixRphi_.second; } float z0() const { return helixRz_.first; } float tanLambda() const { return helixRz_.second; } @@ -176,15 +185,15 @@ namespace tmtt { //--- Get information about its association (if any) to a truth Tracking Particle. // Get best matching tracking particle (=nullptr if none). - const TP* getMatchedTP() const { return matchedTP_; } + const TP* matchedTP() const { return matchedTP_; } // Get the matched stubs with this Tracking Particle - const vector& getMatchedStubs() const { return matchedStubs_; } + const std::vector& matchedStubs() const { return matchedStubs_; } // Get number of matched stubs with this Tracking Particle - unsigned int getNumMatchedStubs() const { return matchedStubs_.size(); } + unsigned int numMatchedStubs() const { return matchedStubs_.size(); } // Get number of tracker layers with matched stubs with this Tracking Particle - unsigned int getNumMatchedLayers() const { return nMatchedLayers_; } + unsigned int numMatchedLayers() const { return nMatchedLayers_; } // Get purity of stubs on track candidate (i.e. fraction matching best Tracking Particle) - float getPurity() const { return getNumMatchedStubs() / float(getNumStubs()); } + float purity() const { return numMatchedStubs() / float(numStubs()); } //--- For debugging purposes. @@ -195,9 +204,9 @@ namespace tmtt { bool cheat() { bool keep = false; - vector stubsSel; + std::vector stubsSel; if (matchedTP_ != nullptr) { // Genuine track - for (const Stub* s : stubs_) { + for (Stub* s : stubs_) { const TP* tp = s->assocTP(); if (tp != nullptr) { if (matchedTP_->index() == tp->index()) { @@ -207,6 +216,7 @@ namespace tmtt { } } stubs_ = stubsSel; + stubsConst_ = std::vector(stubs_.begin(), stubs_.end()); nLayers_ = Utility::countLayers(settings_, stubs_); // Count tracker layers these stubs are in matchedTP_ = Utility::matchingTP(settings_, @@ -217,19 +227,17 @@ namespace tmtt { bool genuine = (matchedTP_ != nullptr); if (genuine && matchedTP_->useForAlgEff()) { - Sector secTmp; - HTrphi htRphiTmp; - secTmp.init(settings_, iPhiSec_, iEtaReg_); - htRphiTmp.init(settings_, iPhiSec_, iEtaReg_, secTmp.etaMin(), secTmp.etaMax(), secTmp.phiCentre()); - pair trueCell = htRphiTmp.trueCell(matchedTP_); + Sector secTmp(settings_, iPhiSec_, iEtaReg_); + HTrphi htRphiTmp(settings_, iPhiSec_, iEtaReg_, secTmp.etaMin(), secTmp.etaMax(), secTmp.phiCentre()); + std::pair trueCell = htRphiTmp.trueCell(matchedTP_); - pair htCell = this->getCellLocationHT(); + std::pair htCell = this->cellLocationHT(); bool consistent = (htCell == trueCell); // If true, track is probably not a duplicate. if (mergedHTcell_) { // If this is a merged cell, check other elements of merged cell. - pair htCell10(htCell.first + 1, htCell.second); - pair htCell01(htCell.first, htCell.second + 1); - pair htCell11(htCell.first + 1, htCell.second + 1); + std::pair htCell10(htCell.first + 1, htCell.second); + std::pair htCell01(htCell.first, htCell.second + 1); + std::pair htCell11(htCell.first + 1, htCell.second + 1); if (htCell10 == trueCell) consistent = true; if (htCell01 == trueCell) @@ -249,12 +257,13 @@ namespace tmtt { const Settings* settings_; //--- Information about the reconstructed track. - vector stubs_; - unordered_set bestStubs_; + std::vector stubs_; + std::vector stubsConst_; + std::unordered_set bestStubs_; unsigned int nLayers_; - pair cellLocationHT_; - pair helixRphi_; - pair helixRz_; + std::pair cellLocationHT_; + std::pair helixRphi_; + std::pair helixRz_; float helixD0_; unsigned int iPhiSec_; unsigned int iEtaReg_; @@ -262,12 +271,12 @@ namespace tmtt { bool mergedHTcell_; //--- Optional info used for tracklet tracks. - unsigned int seedLayerType_; + TrackletSeedType seedLayerType_; unsigned int seedPS_; //--- Information about its association (if any) to a truth Tracking Particle. const TP* matchedTP_; - vector matchedStubs_; + std::vector matchedStubs_; unsigned int nMatchedLayers_; }; diff --git a/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h b/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h index 49adaaaccec0d..7d1717502850e 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h @@ -4,8 +4,6 @@ #include #include -using namespace std; - //=== L1 track base class //=== This is a pure virtual class containing no implemented functions or data members. //=== However, it declares functions that are common to the derived classes L1trackBase, L1track3D and L1fittedTrack, @@ -17,7 +15,7 @@ namespace tmtt { class TP; class L1trackBase { - protected: + public: L1trackBase() {} virtual ~L1trackBase() {} @@ -25,11 +23,12 @@ namespace tmtt { //--- Get information about the reconstructed track. // Get stubs on track candidate. - virtual const vector& getStubs() const = 0; + virtual const std::vector& stubsConst() const = 0; + virtual const std::vector& stubs() const = 0; // Get number of stubs on track candidate. - virtual unsigned int getNumStubs() const = 0; + virtual unsigned int numStubs() const = 0; // Get number of tracker layers these stubs are in. - virtual unsigned int getNumLayers() const = 0; + virtual unsigned int numLayers() const = 0; //--- User-friendly access to the helix parameters. @@ -39,7 +38,7 @@ namespace tmtt { //virtual float tanLambda() const = 0; //--- Cell locations of the track candidate in the r-phi Hough transform array in units of bin number. - virtual pair getCellLocationHT() const = 0; + virtual std::pair cellLocationHT() const = 0; //--- Get phi sector and eta region used by track finding code that this track is in. virtual unsigned int iPhiSec() const = 0; @@ -51,13 +50,13 @@ namespace tmtt { //--- Get information about its association (if any) to a truth Tracking Particle. // Get matching tracking particle (=nullptr if none). - virtual const TP* getMatchedTP() const = 0; + virtual const TP* matchedTP() const = 0; // Get the matched stubs. - virtual const vector& getMatchedStubs() const = 0; + virtual const std::vector& matchedStubs() const = 0; // Get number of matched stubs. - virtual unsigned int getNumMatchedStubs() const = 0; + virtual unsigned int numMatchedStubs() const = 0; // Get number of tracker layers with matched stubs. - virtual unsigned int getNumMatchedLayers() const = 0; + virtual unsigned int numMatchedLayers() const = 0; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/Get3Dtracks.h b/L1Trigger/TrackFindingTMTT/interface/Make3Dtracks.h similarity index 63% rename from L1Trigger/TrackFindingTMTT/interface/Get3Dtracks.h rename to L1Trigger/TrackFindingTMTT/interface/Make3Dtracks.h index f77d7a598f90f..4268d16da0831 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Get3Dtracks.h +++ b/L1Trigger/TrackFindingTMTT/interface/Make3Dtracks.h @@ -1,23 +1,20 @@ -#ifndef L1Trigger_TrackFindingTMTT_Get3Dtracks_h -#define L1Trigger_TrackFindingTMTT_Get3Dtracks_h +#ifndef L1Trigger_TrackFindingTMTT_Make3Dtracks_h +#define L1Trigger_TrackFindingTMTT_Make3Dtracks_h #include "L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h" #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" -#include "boost/numeric/ublas/matrix.hpp" #include +#include #include - -using boost::numeric::ublas::matrix; - -using namespace std; +#include //=== This reconstructs 3D tracks from the 2D tracks found by the Hough transform. //=== It can do this by simply estimating the r-z helix parameters from the centre of the eta sector //=== and/or by running an r-z filter (e.g. Seed Filter), which also cleans up the tracks by //=== checking their stubs consistency with a straight line in the r-z plane. //=== -//=== To create 3D tracks, call the sequence init(), run(), and then get tracks via trackCands3D(). +//=== To create 3D tracks, call run() and then get tracks via trackCands3D(). namespace tmtt { @@ -25,30 +22,22 @@ namespace tmtt { class Stub; class TP; - class Get3Dtracks { + class Make3Dtracks { public: - Get3Dtracks() - : settings_(nullptr), - iPhiSec_(0), - iEtaReg_(0), - etaMinSector_(0), - etaMaxSector_(0), - phiCentreSector_(0), - runRZfilter_(false) {} - ~Get3Dtracks() {} + // Initialize + Make3Dtracks(const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float etaMinSector, + float etaMaxSector, + float phiCentreSector); - //=== Main routines to make 3D tracks. + ~Make3Dtracks() {} - // Initialization - void init(const Settings* settings, - unsigned int iPhiSec, - unsigned int iEtaReg, - float etaMinSector, - float etaMaxSector, - float phiCentreSector); + //=== Main routines to make 3D tracks. // Make 3D track collections. - void run(const vector& vecTracksRphi) { + void run(const std::list& vecTracksRphi) { this->makeUnfilteredTrks(vecTracksRphi); if (runRZfilter_) this->makeRZfilteredTrks(vecTracksRphi); @@ -59,7 +48,7 @@ namespace tmtt { // Get 3D tracks (either r-z filtered or unfiltered, depending on the boolean). // (Each L1track3D object gives access to stubs on each track and helix parameters // & also to the associated truth tracking particle). - const vector& trackCands3D(bool rzFiltered) const { + const std::list& trackCands3D(bool rzFiltered) const { if (rzFiltered) { return vecTracks3D_rzFiltered_; } else { @@ -69,24 +58,24 @@ namespace tmtt { // Get all 3D track candidates (either r-z filtered on unfiltered, depending on the boolean), // that are associated to the given tracking particle. - // (If the vector is empty, then the tracking particle was not reconstructed in this sector). - vector assocTrackCands3D(const TP& tp, bool rzFiltered) const; + // (If the std::vector is empty, then the tracking particle was not reconstructed in this sector). + std::vector assocTrackCands3D(const TP& tp, bool rzFiltered) const; //=== Access to track r-z filter in case internal info from it required. bool ranRZfilter() const { return runRZfilter_; } // Was r-z filter required/run? - const TrkRZfilter& getRZfilter() const { return rzFilter_; } + const TrkRZfilter* rzFilter() const { return rzFilter_.get(); } private: // Convert 2D HT tracks within the current sector to 3D tracks, // by adding a rough estimate of their r-z helix parameters, without running any r-z track filter. - void makeUnfilteredTrks(const vector& vecTracksRphi); + void makeUnfilteredTrks(const std::list& vecTracksRphi); // Make 3D tracks from the 2D HT tracks within the current sector, by running the r-z track filter. // The r-z filter also adds an estimate of the r-z helix parameters to each track. // (Not filled if no track fitter needs the r-z filter). - void makeRZfilteredTrks(const vector& vecTracksRphi); + void makeRZfilteredTrks(const std::list& vecTracksRphi); private: // Configuration parameters @@ -100,11 +89,11 @@ namespace tmtt { bool runRZfilter_; // Does r-z track filter need to be run. // Track filter(s), such as r-z filters, run after the r-phi Hough transform. - TrkRZfilter rzFilter_; + std::unique_ptr rzFilter_; // List of all found 3D track candidates and their associated properties. - vector vecTracks3D_rzFiltered_; // After r-z filter run - vector vecTracks3D_unfiltered_; // Before r-z filter run. + std::list vecTracks3D_rzFiltered_; // After r-z filter run + std::list vecTracks3D_unfiltered_; // Before r-z filter run. }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/Matrix.h b/L1Trigger/TrackFindingTMTT/interface/Matrix.h deleted file mode 100644 index 16e9e3cd5063f..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/Matrix.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef L1Trigger_TrackFindingTMTT_Matrix_h -#define L1Trigger_TrackFindingTMTT_Matrix_h - -#include - -namespace tmtt { - - template - class Matrix { - private: - std::vector > mat; - unsigned rows; - unsigned cols; - - public: - Matrix(); - Matrix(unsigned _rows, unsigned _cols, const T& _initial); - Matrix(const Matrix& rhs); - virtual ~Matrix(); - - // Operator overloading, for "standard" mathematical matrix operations - Matrix& operator=(const Matrix& rhs); - - // Matrix mathematical operations - Matrix operator+(const Matrix& rhs); - Matrix& operator+=(const Matrix& rhs); - Matrix operator-(const Matrix& rhs); - Matrix& operator-=(const Matrix& rhs); - Matrix operator*(const Matrix& rhs); - Matrix& operator*=(const Matrix& rhs); - Matrix transpose(); - T determinant(); - Matrix cofactor(); - Matrix inverse(); - - // Matrix/scalar operations - Matrix operator+(const T& rhs); - Matrix operator-(const T& rhs); - Matrix operator*(const T& rhs); - Matrix operator/(const T& rhs); - - // Matrix/vector operations - std::vector operator*(const std::vector& rhs); - std::vector diag_vec(); - - // Access the individual elements - T& operator()(const unsigned& row, const unsigned& col); - const T& operator()(const unsigned& row, const unsigned& col) const; - - // Access the row and column sizes - unsigned get_rows() const; - unsigned get_cols() const; - - // Print to stdout - void print(); - }; - -} // namespace tmtt - -#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h b/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h index 9701df8a6d1f9..f6396fe7da8f6 100644 --- a/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h +++ b/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h @@ -3,8 +3,8 @@ #include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h" -using namespace std; using boost::numeric::ublas::matrix; +#include namespace tmtt { @@ -16,17 +16,18 @@ namespace tmtt { ~MiniHTstage(){}; - void exec(matrix& mHtRphis); + void exec(matrix>& mHtRphis); private: // Do load balancing - unsigned int linkIDLoadBalanced(unsigned int link, - unsigned int mBin, - unsigned int cBin, - unsigned int numStubs, - map, unsigned int>& numStubsPerLinkStage1, - map, unsigned int>& numStubsPerLinkStage2, - bool test = false) const; + unsigned int linkIDLoadBalanced( + unsigned int link, + unsigned int mBin, + unsigned int cBin, + unsigned int numStubs, + std::map, unsigned int>& numStubsPerLinkStage1, + std::map, unsigned int>& numStubsPerLinkStage2, + bool test = false) const; private: const Settings* settings_; // Configuration parameters @@ -46,7 +47,7 @@ namespace tmtt { unsigned int numEtaRegions_; bool busySectorKill_; unsigned int busySectorNumStubs_; - vector busySectorMbinRanges_; + std::vector busySectorMbinRanges_; float chosenRofPhi_; float binSizeQoverPtAxis_; float binSizePhiTrkAxis_; diff --git a/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h b/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h index c29587e8897bb..707d0b124521d 100644 --- a/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h +++ b/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h @@ -5,8 +5,8 @@ #include "boost/numeric/ublas/matrix.hpp" #include +#include -using namespace std; using boost::numeric::ublas::matrix; //================================================================================================== @@ -37,7 +37,7 @@ namespace tmtt { // of multiple (eta,phi) sectors onto single links and the truncation of the tracks caused by the requirement // to output all the tracks within the time-multiplexed period. // This function replaces the 2D track collection in the r-phi HT with the subset surviving the TM cut. - void exec(matrix& mHtRphis) const; + void exec(matrix>& mHtRphis) const; // Determine number of optical links used to output tracks from each phi nonant // (where "link" refers to a pair of links in the hardware). @@ -68,7 +68,7 @@ namespace tmtt { unsigned int numEtaRegions_; bool busySectorKill_; unsigned int busySectorNumStubs_; - vector busySectorMbinRanges_; + std::vector busySectorMbinRanges_; bool busySectorUseMbinRanges_; }; diff --git a/L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h b/L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h new file mode 100644 index 0000000000000..3a3423e747e6a --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h @@ -0,0 +1,29 @@ +#ifndef L1Trigger_TrackFindingTMTT_PrintL1trk +#define L1Trigger_TrackFindingTMTT_PrintL1trk + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include + +// Use LogVerbatim with "L1track" category & floating point precision specified here. +// Example use: PrintL1trk() << "My message "< + edm::LogVerbatim& operator<<(const T& t) { + lv_ << std::fixed << std::setprecision(nDigits_) << t; + return lv_; + } + + private: + edm::LogVerbatim lv_; + const unsigned int nDigits_; + }; + +} // namespace tmtt + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/Sector.h b/L1Trigger/TrackFindingTMTT/interface/Sector.h index f97e3678a5f6e..38832b3054997 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Sector.h +++ b/L1Trigger/TrackFindingTMTT/interface/Sector.h @@ -6,8 +6,6 @@ #include #include -using namespace std; - namespace tmtt { class Settings; @@ -15,47 +13,18 @@ namespace tmtt { class Sector { public: - Sector() - : settings_(nullptr), - beamWindowZ_(0), - trackerOuterRadius_(0), - trackerInnerRadius_(0), - trackerHalfLength_(0), - handleStripsPhiSec_(0), - handleStripsEtaSec_(0), - iPhiSec_(0), - iEtaReg_(0), - etaMin_(0), - etaMax_(0), - chosenRofZ_(0), - rOuterMax_(0), - zOuterMax_(0), - rOuterMin_(0), - zOuterMin_(0), - phiCentre_(0), - sectorHalfWidth_(0), - chosenRofPhi_(0), - useStubPhi_(0), - minPt_(0), - useStubPhiTrk_(0), - assumedPhiTrkRes_(0), - calcPhiTrkRes_(0), - numSubSecsEta_(0), - zOuterMinSub_(), - zOuterMaxSub_() {} + // Initialization. + Sector(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaSec); ~Sector() {} - // Initialization. - void init(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaSec); - // Check if stub within the eta and/or phi boundaries of this sector. bool inside(const Stub* stub) const { return (this->insideEta(stub) && this->insidePhi(stub)); } bool insideEta(const Stub* stub) const; bool insidePhi(const Stub* stub) const; // Check if stub is within subsectors in eta that sector may be divided into. - vector insideEtaSubSecs(const Stub* stub) const; + std::vector insideEtaSubSecs(const Stub* stub) const; unsigned int iPhiSec() const { return iPhiSec_; } // Sector number. unsigned int iEtaReg() const { return iEtaReg_; } @@ -72,7 +41,7 @@ namespace tmtt { // For performance studies, note which stubs on given tracking particle are inside the sector. // Returns two booleans for each stub, indicating if they are in phi & eta sectors respectively. // You can AND them together to check if stub is in (eta,phi) sector. - unordered_map> stubsInside(const TP& tp) const; + std::unordered_map> stubsInside(const TP& tp) const; // Count number of stubs in given tracking particle which are inside this (phi,eta) sector; // or inside it if only the eta cuts are applied; or inside it if only the phi cuts are applied. @@ -84,7 +53,7 @@ namespace tmtt { // Check if the helix parameters of a tracking particle (truth) are consistent with this sector. bool insidePhiSec(const TP& tp) const { - return (fabs(tp.trkPhiAtR(chosenRofPhi_) - phiCentre_) < sectorHalfWidth_); + return (std::abs(tp.trkPhiAtR(chosenRofPhi_) - phiCentre_) < sectorHalfWidth_); } bool insideEtaReg(const TP& tp) const { return (tp.trkZAtR(chosenRofZ_) > zOuterMin_ && tp.trkZAtR(chosenRofZ_) < zOuterMax_); @@ -95,31 +64,23 @@ namespace tmtt { bool insideEtaRange(const Stub* stub, float zRangeMin, float zRangeMax) const; // Digitize a floating point number to 2s complement integer, dropping anything after the decimal point. (Kristian Harder) - Long64_t forceBitWidth(const float value, const UInt_t nBits) const; + int64_t forceBitWidth(const float value, const UInt_t nBits) const; // Check if stub is within subsectors in eta that sector may be divided into. Uses digitized calculation corresponding to GP firmware. (Kristian Harder) - vector subEtaFwCalc(const int rT, const int z) const; + std::vector subEtaFwCalc(const int rT, const int z) const; private: const Settings* settings_; - float beamWindowZ_; - float trackerOuterRadius_; - float trackerInnerRadius_; - float trackerHalfLength_; - bool handleStripsPhiSec_; - bool handleStripsEtaSec_; - - // Define eta region. - unsigned int iPhiSec_; // Sector number + // Sector number + unsigned int iPhiSec_; unsigned int iEtaReg_; + float beamWindowZ_; float etaMin_; // Range in eta covered by this sector. float etaMax_; float chosenRofZ_; // Use z of track at radius="chosenRofZ" to define eta sectors. - float rOuterMax_; // Larger eta boundary point (r,z) + float zOuterMin_; // z range of sector at reference radius float zOuterMax_; - float rOuterMin_; // Smaller eta boundary point (r,z) - float zOuterMin_; // Define phi sector. float phiCentre_; // phi of centre of sector. @@ -133,8 +94,8 @@ namespace tmtt { // Possible subsectors in eta within each sector. unsigned int numSubSecsEta_; - vector zOuterMinSub_; - vector zOuterMaxSub_; + std::vector zOuterMinSub_; + std::vector zOuterMaxSub_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/Settings.h b/L1Trigger/TrackFindingTMTT/interface/Settings.h index 8b8701a508894..82b0bfad56ec4 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Settings.h +++ b/L1Trigger/TrackFindingTMTT/interface/Settings.h @@ -2,11 +2,12 @@ #define L1Trigger_TrackFindingTMTT_Settings_h #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Utilities/interface/InputTag.h" +#include "FWCore/Utilities/interface/ESInputTag.h" #include "FWCore/Utilities/interface/Exception.h" #include #include - -using namespace std; +#include // Stores all configuration parameters + some hard-wired constants. @@ -22,12 +23,24 @@ namespace tmtt { ~Settings() {} + // Input tags for ES & ED data. + edm::ESInputTag magneticFieldInputTag() const { return magneticFieldInputTag_; } + edm::ESInputTag trackerGeometryInputTag() const { return trackerGeometryInputTag_; } + edm::ESInputTag trackerTopologyInputTag() const { return trackerTopologyInputTag_; } + edm::InputTag stubInputTag() const { return stubInputTag_; } + edm::InputTag tpInputTag() const { return tpInputTag_; } + edm::InputTag stubTruthInputTag() const { return stubTruthInputTag_; } + edm::InputTag clusterTruthInputTag() const { return clusterTruthInputTag_; } + edm::InputTag genJetInputTag() const { return genJetInputTag_; } + //=== General settings. // Enable all use of MC truth info (disable to save CPU). bool enableMCtruth() const { return enableMCtruth_; } // Enable output histograms & job tracking performance summary (disable to save CPU). bool enableHistos() const { return enableHistos_; } + // Enable output of TTTracks from part-way through tracking chain (after HT & RZ). + bool enableOutputIntermediateTTTracks() const { return enableOutputIntermediateTTTracks_; } //=== Cuts on MC truth tracks for tracking efficiency measurements. @@ -37,7 +50,7 @@ namespace tmtt { double genMaxVertZ() const { return genMaxVertZ_; } double genMaxD0() const { return genMaxD0_; } double genMaxZ0() const { return genMaxZ0_; } - vector genPdgIds() const { return genPdgIds_; } + const std::vector& genPdgIds() const { return genPdgIds_; } // Additional cut on MC truth tracks for algorithmic tracking efficiency measurements. unsigned int genMinStubLayers() const { return genMinStubLayers_; } // Min. number of layers TP made stub in. @@ -53,11 +66,11 @@ namespace tmtt { // Print stub windows corresponding to KillLowPtStubs, in python cfg format used by CMSSW. bool printStubWindows() const { return printStubWindows_; } // Bend resolution assumed by bend filter in units of strip pitch. Also used when assigning stubs to sectors if calcPhiTrkRes() is true. - double bendResolution() const { return bendResolution_; } + double bendCut() const { return bendCut_; } // Additional contribution to bend resolution from its encoding into a reduced number of bits. // This number is the assumed resolution relative to the naive guess of its value. // It is ignored in DegradeBendRes = 0. - double bendResolutionExtra() const { return bendResolutionExtra_; } + double bendCutExtra() const { return bendCutExtra_; } // Order stubs by bend in DTC, such that highest Pt stubs are transmitted first. bool orderStubsByBend() const { return orderStubsByBend_; } @@ -73,10 +86,17 @@ namespace tmtt { unsigned int zBits() const { return zBits_; } double zRange() const { return zRange_; } //--- Parameters available in GP board (excluding any in common with MP specified above). - unsigned int phiOBits() const { return phiOBits_; } - double phiORange() const { return phiORange_; } + unsigned int phiNBits() const { return phiNBits_; } + double phiNRange() const { return phiNRange_; } unsigned int bendBits() const { return bendBits_; } + //=== Tracker module type for FW. + const std::vector& pitchVsType() const { return pitchVsType_; } + const std::vector& spaceVsType() const { return spaceVsType_; } + const std::vector& barrelVsType() const { return barrelVsType_; } + const std::vector& psVsType() const { return psVsType_; } + const std::vector& tiltedVsType() const { return tiltedVsType_; } + //=== Configuration of Geometric Processor. // Use an FPGA-friendly approximation to determine track angle dphi from bend in GP? bool useApproxB() const { return useApproxB_; } @@ -87,63 +107,44 @@ namespace tmtt { unsigned int numPhiNonants() const { return numPhiNonants_; } unsigned int numPhiSectors() const { return numPhiSectors_; } - double chosenRofPhi() const { - return chosenRofPhi_; - } // 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. - bool useStubPhi() const { - return useStubPhi_; - } // Require stub phi to be consistent with track of Pt > HTArraySpec.HoughMinPt that crosses HT phi axis? - bool useStubPhiTrk() const { - return useStubPhiTrk_; - } // Require stub phi0 (or phi65 etc.) as estimated from stub bend, to lie within HT phi axis, allowing tolerance specified below? - double assumedPhiTrkRes() const { - return assumedPhiTrkRes_; - } // Tolerance in stub phi0 (or phi65) assumed to be this fraction of phi sector width. (N.B. If > 0.5, then stubs can be shared by more than 2 phi sectors). - bool calcPhiTrkRes() const { - return calcPhiTrkRes_; - } // If true, tolerance in stub phi0 (or phi65 etc.) will be reduced below AssumedPhiTrkRes if stub bend resolution specified in StubCuts.BendResolution suggests it is safe to do so. - bool handleStripsPhiSec() const { - return handleStripsPhiSec_; - } // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when assigning stubs to phi sectors? + // Use phi of track at this radius as sector hourglass reference radius. + double chosenRofPhi() const { return chosenRofPhi_; } + // Require stub phi to be consistent with track of Pt > HTArraySpec.HoughMinPt that crosses HT phi axis? + bool useStubPhi() const { return useStubPhi_; } + // Require stub phi0 (or phi65 etc.) as estimated from stub bend, to lie within HT phi axis, allowing tolerance specified below? + bool useStubPhiTrk() const { return useStubPhiTrk_; } + // Tolerance in stub phi0 (or phi65) assumed to be this fraction of phi sector width. (N.B. If > 0.5, then stubs can be shared by more than 2 phi sectors). + double assumedPhiTrkRes() const { return assumedPhiTrkRes_; } + // If true, tolerance in stub phi0 (or phi65 etc.) will be reduced below AssumedPhiTrkRes if stub bend resolution specified in StubCuts.BendResolution suggests it is safe to do so. + bool calcPhiTrkRes() const { return calcPhiTrkRes_; } //=== Definition of eta sectors. - vector etaRegions() const { return etaRegions_; } // Boundaries of eta regions de + const std::vector& etaRegions() const { return etaRegions_; } // Boundaries of eta regions de unsigned int numEtaRegions() const { return (etaRegions_.size() - 1); } - double chosenRofZ() const { - return chosenRofZ_; - } // Use z of track at this radius for assignment of stubs to phi sectors & also for one of the axes of the r-z HT. - double beamWindowZ() const { return beamWindowZ_; } // Half-width of window supposed to contain beam-spot in z. - bool handleStripsEtaSec() const { - return handleStripsEtaSec_; - } // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when assigning stubs to eta sectors? - bool allowOver2EtaSecs() const { - return allowOver2EtaSecs_; - } // If True, the code will not throw an error if a stub is assigned to 3 or more eta sectors. + // Use z of track at this radius for assignment of stubs to phi sectors & also for one of the axes of the r-z HT. + double chosenRofZ() const { return chosenRofZ_; } + // Half-width of window supposed to contain beam-spot in z. + double beamWindowZ() const { return beamWindowZ_; } + // If True, the code will not throw an error if a stub is assigned to 3 or more eta sectors. + bool allowOver2EtaSecs() const { return allowOver2EtaSecs_; } //=== r-phi Hough transform array specifications. double houghMinPt() const { return houghMinPt_; } - unsigned int houghNbinsPt() const { - return houghNbinsPt_; - } // Dimension in any q/Pt related variable. Not valid if houghNcellsRphi() > 0. (If MiniHTstage = True, this refers to mini cells in whole HT array). - unsigned int houghNbinsPhi() const { - return houghNbinsPhi_; - } // Dimension in any track-phi related variable. Not valid if houghNcellsRphi() > 0. (If MiniHTstage = True, this refers to mini cells in whole HT array). - int houghNcellsRphi() const { - return houghNcellsRphi_; - } // Required no. of cells in r-phi HT array. If > 0, then parameters HoughNbinsPt and HoughNbinsPhi will be calculated from the constraints that their product should equal HoughNcellsRz and their ratio should make the maximum |gradient|" of stub lines in the HT array equal to 1. If <= 0, then HoughNbinsPt and HoughNbinsPhi will be taken from the values configured above. - bool enableMerge2x2() const { - return enableMerge2x2_; - } // Groups of neighbouring 2x2 cells in HT will be treated as if they are a single large cell. (Also enabled in MiniHTstage = True). - double maxPtToMerge2x2() const { - return maxPtToMerge2x2_; - } // but only cells with pt < maxPtToMerge2x2() will be merged in this way (irrelevant if enableMerge2x2() = false). - unsigned int numSubSecsEta() const { - return numSubSecsEta_; - } // Subdivide each sector into this number of subsectors in eta within r-phi HT. - unsigned int shape() const { return shape_; } // define cell shape (0 square, 1 diamond, 2 hexagon) - // Run 2nd stage HT with mini cells inside each 1st stage normal HT cell. N.B. This automatically sets EnableMerge2x2 = True & MaxPtToMerge = 999999. + // Dimension in any q/Pt related variable. (If MiniHTstage = True, this refers to mini cells in whole HT array). + unsigned int houghNbinsPt() const { return houghNbinsPt_; } + // Dimension in any track-phi related variable. (If MiniHTstage = True, this refers to mini cells in whole HT array). + unsigned int houghNbinsPhi() const { return houghNbinsPhi_; } + // Groups of neighbouring 2x2 cells in HT will be treated as if they are a single large cell. (Also enabled in MiniHTstage = True). + bool enableMerge2x2() const { return enableMerge2x2_; } + // but only cells with pt < maxPtToMerge2x2() will be merged in this way (irrelevant if enableMerge2x2() = false). + double maxPtToMerge2x2() const { return maxPtToMerge2x2_; } + // Subdivide each sector into this number of subsectors in eta within r-phi HT. + unsigned int numSubSecsEta() const { return numSubSecsEta_; } + // define cell shape (0 square, 1 diamond, 2 hexagon, 3 brick) + unsigned int shape() const { return shape_; } + // Run 2nd stage HT with mini cells inside each 1st stage normal HT cell. N.B. This automatically std::sets EnableMerge2x2 = True & MaxPtToMerge = 999999. bool miniHTstage() const { return miniHTstage_; } // Number of mini cells along q/Pt & phi axes inside each normal HT cell. unsigned int miniHoughNbinsPt() const { return miniHoughNbinsPt_; } @@ -159,8 +160,6 @@ namespace tmtt { //=== Rules governing how stubs are filled into the r-phi Hough Transform array. - // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when filling stubs in r-phi HT? - bool handleStripsRphiHT() const { return handleStripsRphiHT_; } // Take all cells in HT array crossed by line corresponding to each stub (= 0) or take only some to reduce rate at cost // of efficiency ( > 0). If this option is > 0, it can be 1 or 2, corresponding to different algorithms for rejecting some of the cells. unsigned int killSomeHTCellsRphi() const { return killSomeHTCellsRphi_; } @@ -174,11 +173,11 @@ namespace tmtt { // the excess tracks are killed, with lowest Pt ones killed first. This is because hardware has finite readout time. bool busySectorKill() const { return busySectorKill_; } unsigned int busySectorNumStubs() const { return busySectorNumStubs_; } - // If this returns a non-empty vector, then the BusySectorNumStubs cut is instead applied to the subset of tracks appearing in the following m bin ranges (q/Pt) of the HT array. The sum of the entries in the vector should equal the number of m bins in the HT, although the entries will be rescaled if this is not the case. If the vector is empty, this option is disabled. (P.S. If the HT includes "merged" cells, then the m bin ranges specified here should correspond to the bins before merging). - vector busySectorMbinRanges() const { return busySectorMbinRanges_; } + // If this returns a non-empty std::vector, then the BusySectorNumStubs cut is instead applied to the subset of tracks appearing in the following m bin ranges (q/Pt) of the HT array. The sum of the entries in the std::vector should equal the number of m bins in the HT, although the entries will be rescaled if this is not the case. If the std::vector is empty, this option is disabled. (P.S. If the HT includes "merged" cells, then the m bin ranges specified here should correspond to the bins before merging). + const std::vector& busySectorMbinRanges() const { return busySectorMbinRanges_; } // If BusySecMbinOrder is empty, then the groupings specified in BusySectorMbinRanges are applied to the m bins in the order // 0,1,2,3,4,5 ... . If it is not empty, then they are grouped in the order specified here. - vector busySectorMbinOrder() const { return busySectorMbinOrder_; } + const std::vector& busySectorMbinOrder() const { return busySectorMbinOrder_; } // If this is True, and more than BusyInputSectorNumStubs() are input to the HT array from the GP, then // the excess stubs are killed. This is because HT hardware has finite readin time. bool busyInputSectorKill() const { return busyInputSectorKill_; } @@ -193,10 +192,10 @@ namespace tmtt { //=== Options controlling r-z track filters (or any other track filters run after the Hough transform, as opposed to inside it). // Specify preferred r-z filter (from those available inside TrkRZfilter.cc) - currently only "SeedFilter". - string rzFilterName() const { return rzFilterName_; } + const std::string& rzFilterName() const { return rzFilterName_; } // --- Options relevant for Seed filter, (so only relevant if rzFilterName()="SeedFilter"). - // Added resolution beyond that estimated from hit resolution. - double seedResolution() const { return seedResolution_; } + // Cut at this many standard deviations on seed resolution. + double seedResCut() const { return seedResCut_; } // Store stubs compatible with all possible good seed (relevant for Seed filter)? bool keepAllSeed() const { return keepAllSeed_; } // Maximum number of seed combinations to check (relevant for Seed filter). @@ -215,10 +214,10 @@ namespace tmtt { // Min. number of layers in HT cell that must have stubs for track to be declared found. unsigned int minStubLayers() const { return minStubLayers_; } // Change min. number of layers cut to (MinStubLayers - 1) for tracks with Pt exceeding this cut. - // If this is set to > 10000, this option is disabled. + // If this is std::set to > 10000, this option is disabled. double minPtToReduceLayers() const { return minPtToReduceLayers_; } // Change min. number of layers cut to (MinStubLayers - 1) for tracks in these rapidity sectors. - vector etaSecsReduceLayers() const { return etaSecsReduceLayers_; } + const std::vector& etaSecsReduceLayers() const { return etaSecsReduceLayers_; } // Define layers using layer ID (true) or by bins in radius of 5 cm width (false)? bool useLayerID() const { return useLayerID_; } //Reduce this layer ID, so that it takes no more than 8 different values in any eta region (simplifies firmware)? @@ -226,19 +225,12 @@ namespace tmtt { //=== Specification of algorithm to eliminate duplicate tracks - // --- Which algorithms are enabled. - // Algorithm used for duplicate removal of 2D tracks produced by r-phi HT. - unsigned int dupTrkAlgRphi() const { return dupTrkAlgRphi_; } - // Algorithm run on all 3D tracks within each sector after r-z track filter. (Ignored if r-z track filter not run). - unsigned int dupTrkAlg3D() const { return dupTrkAlg3D_; } // Algorithm run on tracks after the track helix fit has been done. unsigned int dupTrkAlgFit() const { return dupTrkAlgFit_; } - //--- Options used by individual algorithms. - unsigned int dupTrkMinCommonHitsLayers() const { return dupTrkMinCommonHitsLayers_; } //=== Rules for deciding when a reconstructed L1 track matches a MC truth particle (i.e. tracking particle). - //--- Three different ways to define if a tracking particle matches a reco track candidate. (Usually, set two of them to ultra loose). + //--- Three different ways to define if a tracking particle matches a reco track candidate. (Usually, std::set two of them to ultra loose). // Min. fraction of matched stubs relative to number of stubs on reco track. double minFracMatchStubsOnReco() const { return minFracMatchStubsOnReco_; } // Min. fraction of matched stubs relative to number of stubs on tracking particle. @@ -254,10 +246,10 @@ namespace tmtt { //--- Options applicable to all track fitters --- // Track fitting algorithms to use. You can run several in parallel. - vector trackFitters() const { return trackFitters_; } + const std::vector& trackFitters() const { return trackFitters_; } // Indicate subset of fitters wanting r-z track filter to be run before them. // (Excludes fitters that are not run). - vector useRZfilter() const { return useRZfilter_; } + const std::vector& useRZfilter() const { return useRZfilter_; } // Print detailed summary of track fit performance at end of job (as opposed to a brief one)? bool detailedFitOutput() const { return detailedFitOutput_; } // Use MC truth to eliminate all fake tracks & all incorrect stubs assigned to tracks before doing fit. @@ -275,25 +267,6 @@ namespace tmtt { double generalResidualCut() const { return generalResidualCut_; } double killingResidualCut() const { return killingResidualCut_; } - //--- Additional options for Thomas Schuh's Linear Regression track fitter --- - - // Max allowed iterations. - unsigned int maxIterationsLR() const { return maxIterationsLR_; } - // Internal histograms are filled if it is True - bool LRFillInternalHists() const { return LRFillInternalHists_; } - bool combineResiduals() const { return combineResiduals_; } - bool lineariseStubPosition() const { return lineariseStubPosition_; } - bool checkSectorConsistency() const { return checkSectorConsistency_; } - bool checkHTCellConsistency() const { return checkHTCellConsistency_; } - unsigned int minPSLayers() const { return minPSLayers_; } - // Digitization - bool digitizeLR() const { return digitizeLR_; } - float PhiPrecision() const { return PhiPrecision_; } - float RPrecision() const { return RPrecision_; } - float ZPrecision() const { return ZPrecision_; } - unsigned int ZSlopeWidth() const { return ZSlopeWidth_; } - unsigned int ZInterceptWidth() const { return ZInterceptWidth_; } - //--- Additional options for Davide Cieri's Simple Linear Regression track fitter --- // Digitize Simple Linear Regression variables & calculation. (Disabled if EnableDigitize=False). @@ -323,13 +296,11 @@ namespace tmtt { // Larger number has more debugging printout. unsigned kalmanDebugLevel() const { return kalmanDebugLevel_; } - // Internal histograms are filled if it is True - bool kalmanFillInternalHists() const { return kalmanFillInternalHists_; } // Fit will reject fitted tracks unless it can assign at least this number of stubs to them. unsigned int kalmanMinNumStubs() const { return kalmanMinNumStubs_; } // Fit will attempt to add up to this nummber of stubs to each fitted tracks, but won't bother adding more. unsigned int kalmanMaxNumStubs() const { return kalmanMaxNumStubs_; } - // For 5-param helix fits, calculate also beam-constrained helix params after fit is complete, & use them for duplicate removal if DupTrkAlgFit=50. + // For 5-param helix fits, calculate also beam-constrained helix params after fit is complete, & use them for duplicate removal if DupTrkAlgFit=1. bool kalmanAddBeamConstr() const { return kalmanAddBeamConstr_; } // Remove requirement of at least 2 PS layers per track. bool kalmanRemove2PScut() const { return kalmanRemove2PScut_; } @@ -353,30 +324,20 @@ namespace tmtt { unsigned int kalmanHOalpha() const { return kalmanHOalpha_; } // 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). unsigned int kalmanHOprojZcorr() const { return kalmanHOprojZcorr_; } - // Use dodgy calculation to account for non-radial endcap 2S modules that was used in Dec. 2016 demonstrator & use no special treatment for tilted barrel modules. - bool kalmanHOdodgy() const { return kalmanHOdodgy_; } + // Use approx calc to account for non-radial endcap 2S modules corresponding to current FW, with no special treatment for tilted modules. + bool kalmanHOfw() const { return kalmanHOfw_; } //=== Treatment of dead modules. - - //--- Either use this private TMTT way of studying dead modules - // In (eta,phi) sectors containing dead modules, reduce the min. number of layers cut on tracks to (MinStubLayers() - 1)? - // The sectors affected are hard-wired in DeadModuleDB::defineDeadTrackerRegions(). - bool deadReduceLayers() const { return deadReduceLayers_; } - // Emulate dead modules by killing fraction of stubs given by DeadSimulateFrac in certain layers & angular regions of - // the tracker that are hard-wired in DeadModuleDB::defineDeadSectors(). Disable by setting <= 0. Fully enable by setting to 1. - // Do not use if KillScenario > 0. - double deadSimulateFrac() const { return deadSimulateFrac_; } // - //--- Or this use communal way developed with Tracklet of studying dead modules // Emulate dead/inefficient modules using the StubKiller code, with stubs killed according to the scenarios of the Stress Test group. - // (0=Don't kill any stubs; 1-5 = Scenarios from https://github.com/EmyrClement/StubKiller/blob/master/README.md). + // (0=Don't kill any stubs; 1-5 = Scenarios described in StubKiller.cc). unsigned int killScenario() const { return killScenario_; } // Modify TMTT tracking to try to recover tracking efficiency in presence of dead modules. (Does nothing if KillScenario = 0). bool killRecover() const { return killRecover_; } //=== Track fit digitisation configuration for various track fitters - // These are used only for SimpleLR track fitter. + // These are used only for SimpleLR4 track fitter. bool slr_skipTrackDigi() const { return slr_skipTrackDigi_; } unsigned int slr_oneOver2rBits() const { return slr_oneOver2rBits_; } double slr_oneOver2rRange() const { return slr_oneOver2rRange_; } @@ -404,20 +365,15 @@ namespace tmtt { double kf_tanlambdaRange() const { return kf_tanlambdaRange_; } unsigned int kf_chisquaredBits() const { return kf_chisquaredBits_; } double kf_chisquaredRange() const { return kf_chisquaredRange_; } - vector kf_chisquaredBinEdges() const { return kf_chisquaredBinEdges_; } - // Skip track digitisation when fitted is not SimpleLR or KF? + const std::vector& kf_chisquaredBinEdges() const { return kf_chisquaredBinEdges_; } + // Skip track digitisation when fitted is not SimpleLR4 or KF? bool other_skipTrackDigi() const { return other_skipTrackDigi_; } //=== Debug printout & plots - // Printout level. - unsigned int debug() const { return debug_; } // When making helix parameter resolution plots, only use particles from the physics event (True) // or also use particles from pileup (False) ? bool resPlotOpt() const { return resPlotOpt_; } - // Specify sector for which debug histos for hexagonal HT will be made. - unsigned int iPhiPlot() const { return iPhiPlot_; } - unsigned int iEtaPlot() const { return iEtaPlot_; } // Booleain indicating if an output EDM file will be written. // N.B. This parameter does not appear inside TMTrackProducer_Defaults_cfi.py . It is created inside tmtt_tf_analysis_cfg.py . @@ -425,31 +381,16 @@ namespace tmtt { //=== Hard-wired constants - double pitchPS() const { - cout << "ERROR: Use Stub::stripPitch instead of Settings::pitchPS!"; - exit(1); - return 0.; - } // pitch of PS modules - OBSOLETE - double pitch2S() const { - cout << "ERROR: Use Stub::stripPitch instead of Settings::pitch2S!"; - exit(1); - return 0.; - } // pitch of 2S modules - OBSOLETE double cSpeed() const { return 2.99792458e10; } // Speed of light (cm/s) double invPtToInvR() const { - return (this->getBfield()) * (this->cSpeed()) / 1.0E13; + return (this->magneticField()) * (this->cSpeed()) / 1.0E13; } // B*c/1E11 - converts q/Pt to 1/radius_of_curvature double invPtToDphi() const { - return (this->getBfield()) * (this->cSpeed()) / 2.0E13; + return (this->magneticField()) * (this->cSpeed()) / 2.0E13; } // B*c/2E11 - converts q/Pt to track angle at some radius from beamline. double trackerOuterRadius() const { return 112.7; } // max. occuring stub radius. double trackerInnerRadius() const { return 21.8; } // min. occuring stub radius. double trackerHalfLength() const { return 270.; } // half-length of tracker. - double stripLength2S() const { - cout << "ERROR: Use Stub::stripLength instead of Settings::stripLength2S!" << endl; - exit(1); - return 0.; - } // Strip length of 2S modules. - OBSOLETE double layerIDfromRadiusBin() const { return 6.; } // When counting stubs in layers, actually histogram stubs in distance from beam-line with this bin size. @@ -458,37 +399,43 @@ namespace tmtt { } // Stubs differing from TP trajectory by more than this in phi are assumed to come from delta rays etc. //=== Set and get B-field value in Tesla. - // N.B. This must bet set for each event, and can't be initialized at the beginning of the job. - void setBfield(float bField) { bField_ = bField; } - float getBfield() const { - if (bField_ == 0.) - throw cms::Exception("Settings.h:You attempted to access the B field before it was initialized"); - return bField_; + // N.B. This must bet std::set for each event, and can't be initialized at the beginning of the job. + void setMagneticField(float magneticField) { magneticField_ = magneticField; } + float magneticField() const { + if (magneticField_ == 0.) + throw cms::Exception("LogicError") << "Settings: You attempted to access the B field before it was initialized"; + return magneticField_; } //=== Settings used for HYBRID TRACKING code only. - // Is hybrid tracking in use? bool hybrid() const { return hybrid_; } // Info about geometry, needed for use of hybrid outside CMSSW. double ssStripPitch() const { return ssStripPitch_; } double ssNStrips() const { return ssNStrips_; } double ssStripLength() const { return ssStripLength_; } - double psStripPitch() const { return psStripPitch_; } + double psPixelPitch() const { return psPixelPitch_; } double psNStrips() const { return psNStrips_; } double psPixelLength() const { return psPixelLength_; } - // max z at which non-tilted modules are found in inner 3 barrel layers. (Element 0 not used). - void get_zMaxNonTilted(double (&zMax)[4]) const { - zMax[1] = zMaxNonTilted_[1]; - zMax[2] = zMaxNonTilted_[2]; - zMax[3] = zMaxNonTilted_[3]; - } + // max z at which non-tilted modules are found in 3 barrel PS layers. (Element 0 not used). + const std::vector& zMaxNonTilted() const { return zMaxNonTilted_; } private: - // Parameter sets for differents types of configuration parameter. + // Input tags for ES & ED data. + const edm::ESInputTag magneticFieldInputTag_; + const edm::ESInputTag trackerGeometryInputTag_; + const edm::ESInputTag trackerTopologyInputTag_; + const edm::InputTag stubInputTag_; + const edm::InputTag tpInputTag_; + const edm::InputTag stubTruthInputTag_; + const edm::InputTag clusterTruthInputTag_; + const edm::InputTag genJetInputTag_; + + // Parameter std::sets for differents types of configuration parameter. edm::ParameterSet genCuts_; edm::ParameterSet stubCuts_; edm::ParameterSet stubDigitize_; + edm::ParameterSet trackerModuleType_; edm::ParameterSet geometricProc_; edm::ParameterSet phiSectors_; edm::ParameterSet etaSectors_; @@ -505,6 +452,7 @@ namespace tmtt { // General settings bool enableMCtruth_; bool enableHistos_; + bool enableOutputIntermediateTTTracks_; // Cuts on truth tracking particles. double genMinPt_; @@ -513,7 +461,7 @@ namespace tmtt { double genMaxVertZ_; double genMaxD0_; double genMaxZ0_; - vector genPdgIds_; + std::vector genPdgIds_; unsigned int genMinStubLayers_; // Cuts applied to stubs before arriving in L1 track finding board. @@ -521,8 +469,8 @@ namespace tmtt { double maxStubEta_; bool killLowPtStubs_; bool printStubWindows_; - double bendResolution_; - double bendResolutionExtra_; + double bendCut_; + double bendCutExtra_; bool orderStubsByBend_; // Optional stub digitization. @@ -534,10 +482,20 @@ namespace tmtt { double rtRange_; unsigned int zBits_; double zRange_; - unsigned int phiOBits_; - double phiORange_; + unsigned int phiNBits_; + double phiNRange_; unsigned int bendBits_; + // Tracker module type for FW. + std::vector pitchVsType_; + std::vector spaceVsType_; + std::vector barrelVsType_; + std::vector psVsType_; + std::vector tiltedVsType_; + std::vector barrelVsTypeTmp_; + std::vector psVsTypeTmp_; + std::vector tiltedVsTypeTmp_; + // Configuration of Geometric Processor. bool useApproxB_; double bApprox_gradient_; @@ -551,20 +509,17 @@ namespace tmtt { bool useStubPhiTrk_; double assumedPhiTrkRes_; bool calcPhiTrkRes_; - bool handleStripsPhiSec_; // Definition of eta sectors. - vector etaRegions_; + std::vector etaRegions_; double chosenRofZ_; double beamWindowZ_; - bool handleStripsEtaSec_; bool allowOver2EtaSecs_; // r-phi Hough transform array specifications. double houghMinPt_; unsigned int houghNbinsPt_; unsigned int houghNbinsPhi_; - int houghNcellsRphi_; bool enableMerge2x2_; double maxPtToMerge2x2_; unsigned int numSubSecsEta_; @@ -578,23 +533,22 @@ namespace tmtt { unsigned int miniHoughLoadBalance_; // Rules governing how stubs are filled into the r-phi Hough Transform array. - bool handleStripsRphiHT_; unsigned int killSomeHTCellsRphi_; bool useBendFilter_; unsigned int maxStubsInCell_; unsigned int maxStubsInCellMiniHough_; bool busySectorKill_; unsigned int busySectorNumStubs_; - vector busySectorMbinRanges_; - vector busySectorMbinOrder_; + std::vector busySectorMbinRanges_; + std::vector busySectorMbinOrder_; bool busyInputSectorKill_; unsigned int busyInputSectorNumStubs_; unsigned int muxOutputsHT_; - vector etaRegWhitelist_; + std::vector etaRegWhitelist_; // Options controlling r-z track filters (or any other track filters run after the Hough transform, as opposed to inside it). - string rzFilterName_; - double seedResolution_; + std::string rzFilterName_; + double seedResCut_; bool keepAllSeed_; unsigned int maxSeedCombinations_; unsigned int maxGoodSeedCombinations_; @@ -605,15 +559,12 @@ namespace tmtt { // Rules for deciding when the track-finding has found an L1 track candidate unsigned int minStubLayers_; double minPtToReduceLayers_; - vector etaSecsReduceLayers_; + std::vector etaSecsReduceLayers_; bool useLayerID_; bool reduceLayerID_; // Specification of algorithm to eliminate duplicate tracks - unsigned int dupTrkAlgRphi_; - unsigned int dupTrkAlg3D_; unsigned int dupTrkAlgFit_; - unsigned int dupTrkMinCommonHitsLayers_; // Rules for deciding when a reconstructed L1 track matches a MC truth particle (i.e. tracking particle). double minFracMatchStubsOnReco_; @@ -623,8 +574,8 @@ namespace tmtt { bool stubMatchStrict_; // Track Fitting Settings - vector trackFitters_; - vector useRZfilter_; + std::vector trackFitters_; + std::vector useRZfilter_; double chi2OverNdfCut_; bool detailedFitOutput_; bool trackFitCheat_; @@ -634,20 +585,6 @@ namespace tmtt { double generalResidualCut_; double killingResidualCut_; // - unsigned int maxIterationsLR_; - bool LRFillInternalHists_; - bool combineResiduals_; - bool lineariseStubPosition_; - bool checkSectorConsistency_; - bool checkHTCellConsistency_; - unsigned int minPSLayers_; - bool digitizeLR_; - float PhiPrecision_; - float RPrecision_; - float ZPrecision_; - unsigned int ZSlopeWidth_; - unsigned int ZInterceptWidth_; - // bool digitizeSLR_; unsigned int dividerBitsHelix_; unsigned int dividerBitsHelixZ_; @@ -677,11 +614,9 @@ namespace tmtt { bool kalmanHOhelixExp_; unsigned int kalmanHOalpha_; unsigned int kalmanHOprojZcorr_; - bool kalmanHOdodgy_; + bool kalmanHOfw_; // Treatment of dead modules. - bool deadReduceLayers_; - double deadSimulateFrac_; unsigned int killScenario_; bool killRecover_; @@ -715,33 +650,30 @@ namespace tmtt { double kf_tanlambdaRange_; unsigned int kf_chisquaredBits_; double kf_chisquaredRange_; - vector kf_chisquaredBinEdges_; + std::vector kf_chisquaredBinEdges_; // bool other_skipTrackDigi_; // Debug printout - unsigned int debug_; bool resPlotOpt_; - unsigned int iPhiPlot_; - unsigned int iEtaPlot_; // Boolean indicating an an EDM output file will be written. bool writeOutEdmFile_; // B-field in Tesla - float bField_; + std::atomic magneticField_; // Hybrid tracking bool hybrid_; - double psStripPitch_; + double psPixelPitch_; double psNStrips_; double psPixelLength_; double ssStripPitch_; double ssNStrips_; double ssStripLength_; - double zMaxNonTilted_[4]; + std::vector zMaxNonTilted_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/SimpleLR.h b/L1Trigger/TrackFindingTMTT/interface/SimpleLR4.h similarity index 82% rename from L1Trigger/TrackFindingTMTT/interface/SimpleLR.h rename to L1Trigger/TrackFindingTMTT/interface/SimpleLR4.h index 785a220180220..90bf7ef9f766e 100644 --- a/L1Trigger/TrackFindingTMTT/interface/SimpleLR.h +++ b/L1Trigger/TrackFindingTMTT/interface/SimpleLR4.h @@ -1,34 +1,32 @@ +#ifndef L1Trigger_TrackFindingTMTT_SimpleLR4_h +#define L1Trigger_TrackFindingTMTT_SimpleLR4_h + ///=== This is the simple linear regression with 4 helix parameters (qOverPt, phiT, z0, tanLambda) track fit algorithm. ///=== Written by: Davide Cieri (davide.cieri@stfc.ac.uk) -#ifndef L1Trigger_TrackFindingTMTT_SimpleLR_h -#define L1Trigger_TrackFindingTMTT_SimpleLR_h - #include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h" #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" #include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" - #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" + #include #include #include namespace tmtt { - class SimpleLR : public TrackFitGeneric { + class SimpleLR4 : public TrackFitGeneric { public: - SimpleLR(const Settings* settings) : TrackFitGeneric(settings), settings_(settings){}; - - virtual ~SimpleLR(){}; + SimpleLR4(const Settings* settings); - virtual void initRun(); + virtual ~SimpleLR4(){}; L1fittedTrack fit(const L1track3D& l1track3D); protected: - const Settings* settings_; + bool debug_; float phiSectorWidth_; float phiSectorCentre_; @@ -51,6 +49,7 @@ namespace tmtt { float chi2cut_; float invPtToDPhi_; float chosenRofPhi_; + unsigned int minStubLayersRed_; bool digitize_; unsigned int dividerBitsHelix_; diff --git a/L1Trigger/TrackFindingTMTT/interface/Stub.h b/L1Trigger/TrackFindingTMTT/interface/Stub.h index 5d01f7145dd4f..2d8372adfe06a 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Stub.h +++ b/L1Trigger/TrackFindingTMTT/interface/Stub.h @@ -4,43 +4,34 @@ #include "DataFormats/L1TrackTrigger/interface/TTTypes.h" #include "DataFormats/L1TrackTrigger/interface/TTStub.h" #include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h" - -// TTStubAssociationMap.h forgets to two needed files, so must include them here ... -#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h" -#include "SimTracker/TrackTriggerAssociation/interface/TTClusterAssociationMap.h" #include "SimTracker/TrackTriggerAssociation/interface/TTStubAssociationMap.h" #include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/Common/interface/Ref.h" +#include "DataFormats/Common/interface/DetSetVector.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" #include "L1Trigger/TrackFindingTMTT/interface/DigitalStub.h" -#include "L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h" #include "L1Trigger/TrackFindingTMTT/interface/DegradeBend.h" +#include "L1Trigger/TrackFindingTMTT/interface/TrackerModule.h" #include "L1Trigger/TrackFindingTMTT/interface/StubKiller.h" -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/Common/interface/DetSetVector.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" - #include #include #include #include -#include - -using namespace std; +#include class TrackerGeometry; class TrackerTopology; -// class DetId; namespace tmtt { class TP; - // typedef edm::Ref< edm::DetSetVector< Phase2TrackerDigi >, Phase2TrackerDigi > Ref_Phase2TrackerDigi_; - typedef edmNew::DetSetVector > DetSetVec; - typedef edmNew::DetSet > DetSet; - typedef edm::Ref > TTStubRef; + typedef edmNew::DetSetVector > TTStubDetSetVec; + typedef edmNew::DetSet > TTStubDetSet; + typedef edm::Ref > TTStubRef; typedef edm::Ref >, TTCluster > TTClusterRef; typedef TTStubAssociationMap TTStubAssMap; @@ -48,68 +39,57 @@ namespace tmtt { //=== Represents a Tracker stub (=pair of hits) - class Stub : public TTStubRef { + class Stub { public: - // Store useful info about the stub (for use with HYBRID code), with hard-wired constants to allow use outside CMSSW. + // Hybrid L1 tracking: stub constructor. Stub(double phi, double r, double z, double bend, - int layerid, + unsigned int layerId, bool psModule, bool barrel, unsigned int iphi, double alpha, const Settings* settings, - const TrackerTopology* trackerTopology, unsigned int ID, unsigned int iPhiSec); - // Store useful info about stub (for use with TMTT code). + // TMTT L1 tracking: stub constructor. Stub(const TTStubRef& ttStubRef, unsigned int index_in_vStubs, const Settings* settings, - const TrackerGeometry* trackerGeometry, - const TrackerTopology* trackerTopology); + const TrackerTopology* trackerTopology, + const TrackerModule* trackerModule, + const StubKiller* stubKiller); ~Stub() {} bool operator==(const Stub& stubOther) { return (this->index() == stubOther.index()); } + // Return reference to original TTStub. + const TTStubRef& ttStubRef() const { return ttStubRef_; } + + // Info about tracker module containing stub. + const TrackerModule* trackerModule() const { return trackerModule_; } + // Fill truth info with association from stub to tracking particles. - // The 1st argument is a map relating TrackingParticles to TP. - void fillTruth(const map, const TP*>& translateTP, + void fillTruth(const std::map, const TP*>& translateTP, const edm::Handle& mcTruthTTStubHandle, const edm::Handle& mcTruthTTClusterHandle); - // Calculate bin range along q/Pt axis of r-phi Hough transform array consistent with bend of this stub. + // Calculate HT m-bin range consistent with bend. void calcQoverPtrange(); - // Digitize stub for input to Geographic Processor, with digitized phi coord. measured relative to closest phi sector. - // (This approximation is valid if their are an integer number of digitisation bins inside each phi nonant). - // However, you should also call digitizeForHTinput() before accessing digitized stub data, even if you only care about that going into GP! Otherwise, you will not identify stubs assigned to more than one nonant. - void digitizeForGPinput(unsigned int iPhiSec); - - // Digitize stub for input to Hough transform, with digitized phi coord. measured relative to specified phi sector. - void digitizeForHTinput(unsigned int iPhiSec); - - // Digitize stub for input to r-z Seed Filter. - // (Kept for backwards compatibility.) - void digitizeForSFinput() { this->digitizeForSForTFinput("SeedFilter"); } - - // Digitize stub for input to r-z Seed Filter or Track Fitter. - // Argument is "SeedFilter" or name of Track Fitter. - void digitizeForSForTFinput(string SForTF); - - // Digitize stub for input to Duplicate Removal . - void digitizeForDRinput(unsigned int stubId); + // Digitize stub for input to GP, HT, SF, TF + enum class DigiStage { NONE, GP, HT, SF, TF }; + void digitize(unsigned int iPhiSec, DigiStage digiStep); // Control warning messages about accessing non-digitized quantities. void setDigitizeWarningsOn(bool newVal) { digitizeWarningsOn_ = newVal; } - // Restore stub to pre-digitized state. i.e. Undo what function digitize() did. - - void reset_digitize(); + // Access to digitized version of stub coords. + const DigitalStub* digitalStub() const { return digitalStub_.get(); } // === Functions for returning info about reconstructed stubs === @@ -119,142 +99,65 @@ namespace tmtt { //--- Stub data and quantities derived from it --- // Stub coordinates (optionally after digitisation, if digitisation requested via cfg). - // N.B. Digitisation is not run when the stubs are created, but later, after stubs are assigned to sectors. - // Until then, these functions return the original coordinates. + // N.B. Digitisation is only run if Stub::digitize() is called. float phi() const { return phi_; } float r() const { return r_; } float z() const { return z_; } float theta() const { return atan2(r_, z_); } float eta() const { return asinh(z_ / r_); } - // Access to digitized version of stub coords. - const DigitalStub& digitalStub() const { return digitalStub_; } - // Access to booleans indicating if the stub has been digitized. - bool digitizedForGPinput() const { return digitizedForGPinput_; } - bool digitizedForHTinput() const { return digitizedForHTinput_; } - string digitizedForSForTFinput() const { - return digitizedForSForTFinput_; - } // Returns which SF or TF digitisation was done for, if any. - bool digitizedForDRinput() const { return digitizedForDRinput_; } - - // Get stub bend (i.e. displacement between two hits in stub in units of strip pitch) and its estimated resolution. - float bend() const { - this->check1(); - return bend_; - } - // The bend resolution has a contribution from the sensor and a contribution from encoding the bend into - // a reduced number of bits. - float bendRes() const { - return (settings_->bendResolution() + (numMergedBend_ - 1) * settings_->bendResolutionExtra()); - } - // Number of bend values which loss of bit to store bend resulted in being merged into this bend value. + + // Location of stub in module in units of strip/pixel number in phi direction. + // Range from 0 to (nStrips - 1) inclusive. + unsigned int iphi() const { return iphi_; } + // alpha correction for non-radial strips in endcap 2S modules. + // (If true hit at larger r than stub r by deltaR, then stub phi needs correcting by +alpha*deltaR). + // *** TO DO *** : Digitize this. + float alpha() const { return alpha_; } + + // Get stub bend and its resolution, as available within the front end chip (i.e. prior to loss of bits + // or digitisation). + float bendInFrontend() const { return bendInFrontend_; } + float bendCutInFrontend() const { return settings_->bendCut(); } + // Get stub bend (i.e. displacement between two hits in stub in units of strip pitch). + float bend() const { return bend_; } + // Bend resolution. + float bendCut() const { return (settings_->bendCut() + (numMergedBend_ - 1) * settings_->bendCutExtra()); } + // No. of bend values merged into FE bend encoding of this stub. float numMergedBend() const { return numMergedBend_; } - // Bend angle of track measured by stub and its estimated resolution. - float dphi() const { - this->check2(); - return (bend_ * dphiOverBend()); - } - float dphiRes() const { return (dphiOverBend() * this->bendRes()); } // Estimated track q/Pt based on stub bend info. float qOverPt() const { return (this->qOverPtOverBend() * this->bend()); } - float qOverPtres() const { return (this->qOverPtOverBend() * this->bendRes()); } + float qOverPtcut() const { return (this->qOverPtOverBend() * this->bendCut()); } // Range in q/Pt bins in HT array compatible with stub bend. unsigned int min_qOverPt_bin() const { return min_qOverPt_bin_; } unsigned int max_qOverPt_bin() const { return max_qOverPt_bin_; } - // Estimated phi0 of track at beam-line based on stub bend info. - float beta() const { return (phi_ + dphi()); } - // Estimated phi angle at which track intercepts a given radius rad, based on stub bend info. Also estimate uncertainty on this angle due to endcap 2S module strip length. - // This is identical to beta() if rad=0. - pair trkPhiAtR(float rad) const; - // Estimated resolution in trkPhiAtR(rad) based on nominal stub bend resolution. - float trkPhiAtRres(float rad) const { return this->dphiRes() * fabs(1 - rad / r_); } // Difference in phi between stub and angle at which track crosses given radius, assuming track has given Pt. - float phiDiff(float rad, float Pt) const { return fabs(r_ - rad) * (settings_->invPtToDphi()) / Pt; } + float phiDiff(float rad, float Pt) const { return std::abs(r_ - rad) * (settings_->invPtToDphi()) / Pt; } + // Phi angle at which particle consistent with this stub & its bend cross specified radius. + float trkPhiAtR(float rad) const { return phi_ + (bend_ * dphiOverBend_) * (1. - rad / r_); } + // Its resolution + float trkPhiAtRcut(float rad) const { return (bendCut() * dphiOverBend_) * std::abs(1. - rad / r_); } + // -- conversion factors - // Ratio of bend angle to bend, where bend is the displacement in strips between the two hits making up stub. - float dphiOverBend() const { - this->check2(); - return dphiOverBend_; - } - // Correction factor that was used when calculating dPhiOverBend, due to tilt of module. - float dphiOverBendCorrection() const { return dphiOverBendCorrection_; } - // Approximation of dphiOverBendCorrection, used in firmware. - float dphiOverBendCorrectionApprox() const { return dphiOverBendCorrection_approx_; } - // Ratio of q/Pt to bend, where bend is the displacement in strips between the two hits making up stub. - float qOverPtOverBend() const { return this->dphiOverBend() / (r_ * settings_->invPtToDphi()); } + // Ratio of track crossing angle to bend. + float dphiOverBend() const { return dphiOverBend_; } + // Ratio of q/Pt to bend. + float qOverPtOverBend() const { return dphiOverBend_ / (r_ * settings_->invPtToDphi()); } //--- Info about the two clusters that make up the stub. + // Coordinates in frame of sensor, measured in units of strip pitch along two orthogonal axes running perpendicular and parallel to longer axis of pixels/strips (U & V). - array localU_cluster() const { return localU_cluster_; } - array localV_cluster() const { return localV_cluster_; } + std::array localU_cluster() const { return localU_cluster_; } + std::array localV_cluster() const { return localV_cluster_; } - //--- Check if this stub will be output by front-end readout electronics, - //--- (where we can reconfigure the stub window size and rapidity cut). - //--- Don't use stubs failing this cut. + //--- Check if this stub will be output by FE. Stub failing this not used for L1 tracks. bool frontendPass() const { return frontendPass_; } - // Indicates if stub would have passed front-end cuts, were it not for window size encoded in DegradeBend.h + // Indicates if stub would have passed DE cuts, were it not for window size encoded in DegradeBend.h bool stubFailedDegradeWindow() const { return stubFailedDegradeWindow_; } - //--- Quantities common to all stubs in a given module --- - - // Unique identifier for each stacked module, allowing one to check which stubs are on the same module. - unsigned int idDet() const { return idDet_.rawId(); } - // Uncertainty in stub coordinates due to strip length, assumed equal to 0.5*strip-or-pixel-length - float rErr() const { return rErr_; } - float zErr() const { return zErr_; } - // Coordinates of centre of two sensors in (r,phi,z) - float minR() const { return moduleMinR_; } - float maxR() const { return moduleMaxR_; } - float minPhi() const { return moduleMinPhi_; } - float maxPhi() const { return moduleMaxPhi_; } - float minZ() const { return moduleMinZ_; } - float maxZ() const { return moduleMaxZ_; } - // Angle between normal to module and beam-line along +ve z axis. (In range -PI/2 to +PI/2). - float moduleTilt() const { return moduleTilt_; } - // Which of two sensors in module is furthest from beam-line? - bool outerModuleAtSmallerR() const { return outerModuleAtSmallerR_; } - // Sensor pitch over separation. - float pitchOverSep() const { return pitchOverSep_; } - // Location of stub in module in units of strip number (or pixel number along finest granularity axis). - // Range from 0 to (nStrips - 1) inclusive. - unsigned int iphi() const { return iphi_; } - // alpha correction for non-radial strips in endcap 2S modules. - // (If true hit at larger r than stub r by deltaR, then stub phi needs correcting by +alpha*deltaR). - // *** TO DO *** : Digitize this. - float alpha() const { return alpha_; } - // Module type: PS or 2S? - bool psModule() const { return psModule_; } - // Tracker layer ID number (1-6 = barrel layer; 11-15 = endcap A disk; 21-25 = endcap B disk) - unsigned int layerId() const { return layerId_; } - // Reduced layer ID (in range 1-7). This encodes the layer ID in only 3 bits (to simplify firmware) by merging some barrel layer and endcap disk layer IDs into a single ID. - unsigned int layerIdReduced() const; - // Endcap ring of module (returns zero in case of barrel) - unsigned int endcapRing() const { return endcapRing_; } - bool barrel() const { return barrel_; } - // True if stub is in tilted barrel module. - bool tiltedBarrel() const { return tiltedBarrel_; } - // Strip pitch (or pixel pitch along shortest axis). - float stripPitch() const { return stripPitch_; } - // Strip length (or pixel pitch along longest axis). - float stripLength() const { return stripLength_; } - // No. of strips in sensor. - unsigned int nStrips() const { return nStrips_; } - // Width of sensitive region of sensor. - float sensorWidth() const { return sensorWidth_; } - // Hit resolution perpendicular to strip (or to longest pixel axis) = pitch/sqrt(12). Measures phi. - float sigmaPerp() const { return sigmaPerp_; } - // Hit resolution parallel to strip (or to longest pixel axis) = length/sqrt(12). Measures r or z. - float sigmaPar() const { return sigmaPar_; } - - // Clone a few of the above functions with the less helpful names expected by the track fitting code. (Try to phase these out with time ...) - unsigned int nstrip() const { return this->nStrips(); } - float width() const { return this->sensorWidth(); } - float sigmaX() const { return this->sigmaPerp(); } - float sigmaZ() const { return this->sigmaPar(); } - //--- Truth info // Association of stub to tracking particles - const set& assocTPs() const { + const std::set& assocTPs() const { return assocTPs_; } // Return TPs associated to this stub. (Whether only TPs contributing to both clusters are returned is determined by "StubMatchStrict" config param.) bool genuine() const { return (assocTPs_.size() > 0); } // Did stub match at least one TP? @@ -263,58 +166,72 @@ namespace tmtt { } // If only one TP contributed to both clusters, this tells you which TP it is. Returns nullptr if none. // Association of both clusters making up stub to tracking particles - array genuineCluster() const { - return array{{(assocTPofCluster_[0] != nullptr), (assocTPofCluster_[1] != nullptr)}}; + std::array genuineCluster() const { + return std::array{{(assocTPofCluster_[0] != nullptr), (assocTPofCluster_[1] != nullptr)}}; } // Was cluster produced by a single TP? - array assocTPofCluster() const { + std::array assocTPofCluster() const { return assocTPofCluster_; } // Which TP made each cluster. Warning: If cluster was not produced by a single TP, then returns nullptr! (P.S. If both clusters match same TP, then this will equal assocTP()). - // Note if stub is a crazy distance from the tracking particle trajectory that produced it. (e.g. perhaps produced by delta ray) - bool crazyStub() const; + //--- Quantities common to all stubs in a given module --- + // N.B. Not taken from trackerModule_ to cope with Hybrid tracking. - // Get stub bend and its resolution, as available within the front end chip (i.e. prior to loss of bits - // or digitisation). - float bendInFrontend() const { return bendInFrontend_; } - float bendResInFrontend() const { return settings_->bendResolution(); } + // Angle between normal to module and beam-line along +ve z axis. (In range -PI/2 to +PI/2). + float tiltAngle() const { return tiltAngle_; } + // Uncertainty in stub (r,z) + float sigmaR() const { return (barrel() ? 0. : sigmaPar()); } + float sigmaZ() const { return (barrel() ? sigmaPar() : 0.); } + // Hit resolution perpendicular to strip. Measures phi. + float sigmaPerp() const { + constexpr float f = sqrt(1. / 12); + return f * stripPitch_; + } + // Hit resolution parallel to strip. Measures r or z. + float sigmaPar() const { + constexpr float f = sqrt(1. / 12.); + return f * stripLength_; + } - // Return tracker geometry (T3, T4, T5 ...) - // See https://github.com/cms-sw/cmssw/blob/CMSSW_9_1_X/Configuration/Geometry/README.md - unsigned int trackerGeometryVersion() const { return trackerGeometryVersion_.load(); } + //--- These module variables could be taken directly from trackerModule_, were it not for need + //--- to support Hybrid. + // Module type: PS or 2S? + bool psModule() const { return psModule_; } + // Tracker layer ID number (1-6 = barrel layer; 11-15 = endcap A disk; 21-25 = endcap B disk) + unsigned int layerId() const { return layerId_; } + // Reduced layer ID (in range 1-7). This encodes the layer ID in only 3 bits (to simplify firmware) by merging some barrel layer and endcap disk layer IDs into a single ID. + unsigned int layerIdReduced() const { return layerIdReduced_; } + bool barrel() const { return barrel_; } + // True if stub is in tilted barrel module. + bool tiltedBarrel() const { return tiltedBarrel_; } + // Strip pitch (or pixel pitch along shortest axis). + float stripPitch() const { return stripPitch_; } + // Strip length (or pixel pitch along longest axis). + float stripLength() const { return stripLength_; } + // No. of strips in sensor. + unsigned int nStrips() const { return nStrips_; } private: // Degrade assumed stub bend resolution. - // Also return boolean indicating if stub bend was outside assumed window, so stub should be rejected - // and return an integer indicating how many values of bend are merged into this single one. - void degradeResolution(float bend, float& degradedBend, bool& reject, unsigned int& num) const; + // And return an integer indicating how many values of bend are merged into this single one. + void degradeResolution(float bend, float& degradedBend, unsigned int& num) const; // Set the frontendPass_ flag, indicating if frontend readout electronics will output this stub. - // Argument indicates if stub bend was outside window size encoded in DegradeBend.h - void setFrontend(bool rejectStub); + void setFrontend(const StubKiller* stubKiller); // Set info about the module that this stub is in. - void setModuleInfo(const TrackerGeometry* trackerGeometry, - const TrackerTopology* trackerTopology, - const DetId& detId); - - // Determine tracker geometry version by counting modules. - void setTrackerGeometryVersion(const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology); + void setTrackerModule(const TrackerGeometry* trackerGeometry, + const TrackerTopology* trackerTopology, + const DetId& detId); // Function to calculate approximation for dphiOverBendCorrection aka B - double getApproxB(); + double approxB(); - // No HT firmware can access directly the stub bend info. - void check1() const { - if (digitizeWarningsOn_ && digitizedForHTinput_) - throw cms::Exception("Stub: You can't access digitized bend variable within HT firmware!"); - } - // If using daisy-chain firmware, then it makes no sense to access the digiitzed values of dphi within HT. - void check2() const { - if (digitizeWarningsOn_ && digitizedForHTinput_) - throw cms::Exception("Stub: You can't access digitized dphi within the HT or KF!"); - } + // Calculate variables giving ratio of track intercept angle to stub bend. + void calcDphiOverBend(); private: + TTStubRef ttStubRef_; // Reference to original TTStub + const Settings* settings_; // configuration parameters. unsigned int index_in_vStubs_; // location of this stub in InputData::vStubs @@ -324,48 +241,17 @@ namespace tmtt { float phi_; // stub coords, optionally after digitisation. float r_; float z_; - float bend_; // bend of stub. - float dphiOverBend_; // related to rho parameter. - float dphiOverBendCorrection_; // Correction from tilt of module - float dphiOverBendCorrection_approx_; // Correction from tilt of module - unsigned int min_qOverPt_bin_; // Range in q/Pt bins in HT array compatible with stub bend. + float bend_; // bend of stub. + float dphiOverBend_; // related to rho parameter. + unsigned int min_qOverPt_bin_; // Range in q/Pt bins in HT array compatible with stub bend. unsigned int max_qOverPt_bin_; //--- Info about the two clusters that make up the stub. - array localU_cluster_; - array localV_cluster_; - - //--- Parameters common to all stubs in a given module. - DetId idDet_; - float rErr_; - float zErr_; - float moduleMinR_; - float moduleMaxR_; - float moduleMinPhi_; - float moduleMaxPhi_; - float moduleMinZ_; - float moduleMaxZ_; - float moduleTilt_; - float pitchOverSep_; + std::array localU_cluster_; + std::array localV_cluster_; + unsigned int iphi_; float alpha_; - bool psModule_; - unsigned int layerId_; - unsigned int endcapRing_; - bool barrel_; - bool tiltedBarrel_; - float sigmaPerp_; - float sigmaPar_; - float stripPitch_; - float stripLength_; - unsigned int nStrips_; - float sensorWidth_; - bool outerModuleAtSmallerR_; - //--- Truth info about stub. - const TP* assocTP_; - set assocTPs_; - //--- Truth info about the two clusters that make up the stub - array assocTPofCluster_; // Would front-end electronics output this stub? bool frontendPass_; @@ -376,26 +262,35 @@ namespace tmtt { // Used for stub bend resolution degrading. unsigned int numMergedBend_; - DigitalStub digitalStub_; // Class used to digitize stub if required. - bool digitizedForGPinput_; // Has this stub been digitized for GP input? - bool digitizedForHTinput_; // Has this stub been digitized for HT input? - string - digitizedForSForTFinput_; // Has this stub been digitized for seed filter or track fitter input? If so, this was its name. - bool digitizedForDRinput_; // Has this stub been digitized for seed filter input? - bool digitizeWarningsOn_; // Enable warnings about accessing non-digitized quantities. + //--- Truth info about stub. + const TP* assocTP_; + std::set assocTPs_; + //--- Truth info about the two clusters that make up the stub + std::array assocTPofCluster_; - // Which tracker geometry is this? - static std::atomic trackerGeometryVersion_; + std::unique_ptr digitalStub_; // Class used to digitize stub if required. + bool digitizeWarningsOn_; // Enable warnings about accessing non-digitized quantities. + DigiStage lastDigiStep_; - // Used to provide TMTT recommendations for stub window sizes that CMS should use. - StubWindowSuggest stubWindowSuggest_; + // Info about tracker module containing stub. + const TrackerModule* trackerModule_; // Used to degrade stub bend information. DegradeBend degradeBend_; - //--- Utility to emulate dead modules. - static std::atomic stubKillerInit_; - static thread_local StubKiller stubKiller_; + // These module variables are needed only to support the Hybrid stub constructor. + // (Otherwise, they could be taken from trackerModule_). + bool psModule_; + unsigned int layerId_; + unsigned int layerIdReduced_; + bool barrel_; + bool tiltedBarrel_; + float tiltAngle_; + float stripPitch_; + float stripLength_; + unsigned int nStrips_; + + const float rejectedStubBend_ = 99999.; // Bend set to this if stub rejected. }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/StubCluster.h b/L1Trigger/TrackFindingTMTT/interface/StubCluster.h deleted file mode 100644 index 1acfb27b10e8c..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/StubCluster.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef L1Trigger_TrackFindingTMTT_StubCluster_h -#define L1Trigger_TrackFindingTMTT_StubCluster_h - -#include -#include - -// Used to merge all clusters assigned to a track in a single layer into a single StubCluster -// whose coordinate is the mean of all the individual clusters. - -namespace tmtt { - - class Stub; - class TP; - - class StubCluster { - public: - StubCluster(std::vector stubs, double SectorPhi, int lres_dr = 1); - ~StubCluster() {} - - void setLayerKF(unsigned int lay) { layerKF_ = lay; } // KF encoded tracker layer - unsigned int layerKF() const { return layerKF_; } - - unsigned nStubs() const { return nstubs_; } - std::vector stubs() const { - return stubs_; - } // Returns original stubs that were usefd to make StubCluster. - double r() const { return r_; } - double phi() const { return phi_; } - double z() const { return z_; } - double eta() const { return eta_; } - std::set assocTPs() const { return assocTPs_; } - unsigned layerId() const { return layerId_; } - unsigned layerIdReduced() const { return layerIdReduced_; } - unsigned endcapRing() const { return endcapRing_; } - bool barrel() const { return barrel_; } - bool tiltedBarrel() const { return tiltedBarrel_; } - bool psModule() const { return psModule_; } - //quadratic sum of the short side error of sensors and RMS of the sensor positions along the short side. - double sigmaX() const { return sigmaX_; } - //quadratic sum of the long side error of sensors and RMS of the sensor positions along the long side. - double sigmaZ() const { return sigmaZ_; } - //phi error from strip pitch - double dphi_dl() const { return dphi_dl_; } - //phi error from strip length in the endcap - double dphi_dr() const { return dphi_dr_; } - //total phi error - double dphi() const { return dphi_; } - //strip distance in cm from the center of the sensor. - double deltal() const { return deltal_; } - //strip distance from the center of the sensor. - double deltai() const { return deltai_; } - //alpha correction for non-radial strips in endcap 2S modules. - double alpha() const { return alpha_; } - // Angle between normal to module and beam-line along +ve z axis. (In range -PI/2 to PI/2). - double moduleTilt() const { return moduleTilt_; } - - private: - std::vector stubs_; - unsigned nstubs_; - double r_; - double phi_; - double z_; - double eta_; - std::set assocTPs_; - unsigned layerId_; - unsigned layerIdReduced_; - unsigned endcapRing_; - unsigned layerKF_; - bool barrel_; - bool tiltedBarrel_; - bool psModule_; - double sigmaX_; - double sigmaZ_; - double dphi_dl_; - double dphi_dr_; - double dphi_; - double deltal_; - double deltai_; - double alpha_; - double moduleTilt_; - }; - -} // namespace tmtt - -#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/StubKiller.h b/L1Trigger/TrackFindingTMTT/interface/StubKiller.h index 5a7e47b2fbd9e..88f476df2f172 100644 --- a/L1Trigger/TrackFindingTMTT/interface/StubKiller.h +++ b/L1Trigger/TrackFindingTMTT/interface/StubKiller.h @@ -1,32 +1,40 @@ -// Copied from https://raw.githubusercontent.com/EmyrClement/StubKiller/master/StubKiller.cc -// on 9th May 2018. - #ifndef L1Trigger_TrackFindingTMTT_StubKiller_h #define L1Trigger_TrackFindingTMTT_StubKiller_h +// Kill some stubs to emulate dead tracker modules. +// Author: Emyr Clement (2018) +// Tidy up: Ian Tomalin (2020) + +#include "FWCore/Framework/interface/Event.h" #include "DataFormats/L1TrackTrigger/interface/TTTypes.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "Geometry/CommonTopologies/interface/PixelGeomDetUnit.h" #include "Geometry/CommonTopologies/interface/PixelTopology.h" -#include "TRandom.h" -#include "TMath.h" - -using namespace std; +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/Utilities/interface/RandomNumberGenerator.h" +#include "CLHEP/Random/RandomEngine.h" namespace tmtt { class StubKiller { public: - StubKiller(); + enum class KillOptions { none = 0, layer5 = 1, layer1 = 2, layer1layer2 = 3, layer1disk1 = 4, random = 5 }; + + StubKiller(KillOptions killScenario, + const TrackerTopology* trackerTopology, + const TrackerGeometry* trackerGeometry, + const edm::Event& iEvent); + ~StubKiller() {} - void initialise(unsigned int killScenario, - const TrackerTopology* trackerTopology, - const TrackerGeometry* trackerGeometry); + // Indicate if given stub was killed by dead tracker module, based on dead module scenario. + bool killStub(const TTStub* stub) const; + // Indicate if given stub was killed by dead tracker module, based on dead regions specified here, + // and ignoring dead module scenario. bool killStub(const TTStub* stub, - const vector layersToKill, + const std::vector& layersToKill, const double minPhiToKill, const double maxPhiToKill, const double minZToKill, @@ -34,23 +42,25 @@ namespace tmtt { const double minRToKill, const double maxRToKill, const double fractionOfStubsToKillInLayers, - const double fractionOfStubsToKillEverywhere); - - bool killStub(const TTStub* stub); + const double fractionOfStubsToKillEverywhere) const; - bool killStubInDeadModule(const TTStub* stub); + // Indicate if given stub was in (partially) dead tracker module, based on dead module scenario. + bool killStubInDeadModule(const TTStub* stub) const; - map getListOfDeadModules() { return deadModules_; } + // List of all modules declared as (partially) dead, with fractional deadness of each. + const std::map& listOfDeadModules() const { return deadModules_; } private: + // Identify modules to be killed, chosen randomly from those in the whole tracker. void chooseModulesToKill(); + // Identify modules to be killed, chosen based on location in tracker. void addDeadLayerModulesToDeadModuleList(); - unsigned int killScenario_; + KillOptions killScenario_; const TrackerTopology* trackerTopology_; const TrackerGeometry* trackerGeometry_; - vector layersToKill_; + std::vector layersToKill_; double minPhiToKill_; double maxPhiToKill_; double minZToKill_; @@ -61,7 +71,10 @@ namespace tmtt { double fractionOfStubsToKillEverywhere_; double fractionOfModulesToKillEverywhere_; - map deadModules_; + std::map deadModules_; + + edm::Service rndmService_; + CLHEP::HepRandomEngine* rndmEngine_; }; }; // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h b/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h index 538c19a37f104..1558c8bba1052 100644 --- a/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h +++ b/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h @@ -5,8 +5,6 @@ #include -using namespace std; - class TrackerTopology; namespace tmtt { @@ -28,36 +26,30 @@ namespace tmtt { class StubWindowSuggest { public: // Initialize (for use with TMTT). - StubWindowSuggest(const Settings* settings, const TrackerTopology* trackerTopo) - : settings_(settings), ptMin_(settings->houghMinPt()), theTrackerTopo_(trackerTopo) {} - - // Initialize (for use with HYBRID) StubWindowSuggest(const Settings* settings) : settings_(settings), ptMin_(settings->houghMinPt()) {} ~StubWindowSuggest() {} // Analyse stub window required for this stub. - void process(const Stub* stub); + void process(const TrackerTopology* trackerTopo, const Stub* stub); // Print results (should be done in endJob(); - static void printResults(); + void printResults() const; private: // Update stored stub window size with this stub. - void updateStoredWindow(const Stub* stub, double bendWind); + void updateStoredWindow(const TrackerTopology* trackerTopo, const Stub* stub, double bendWind); private: // Configuration parameters. const Settings* settings_; const float ptMin_; - const TrackerTopology* theTrackerTopo_; - // Stub window sizes as encoded in L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h - static thread_local std::vector barrelCut_; - static thread_local std::vector > ringCut_; - static thread_local std::vector > tiltedCut_; - static thread_local std::vector barrelNTilt_; + std::vector barrelCut_; + std::vector > ringCut_; + std::vector > tiltedCut_; + std::vector barrelNTilt_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/TP.h b/L1Trigger/TrackFindingTMTT/interface/TP.h index 48d2d95aa6636..6820fb10f2f9f 100644 --- a/L1Trigger/TrackFindingTMTT/interface/TP.h +++ b/L1Trigger/TrackFindingTMTT/interface/TP.h @@ -12,8 +12,7 @@ #include "DataFormats/JetReco/interface/GenJet.h" #include - -using namespace std; +#include namespace tmtt { @@ -21,16 +20,19 @@ namespace tmtt { typedef edm::Ptr TrackingParticlePtr; - class TP : public TrackingParticlePtr { + class TP { public: // Fill useful info about tracking particle. TP(const TrackingParticlePtr& tpPtr, unsigned int index_in_vTPs, const Settings* settings); ~TP() {} - bool operator==(const TP& tpOther) { return (this->index() == tpOther.index()); } + // Return pointer to original tracking particle. + const TrackingParticlePtr& trackingParticlePtr() const { return trackingParticlePtr_; } + + bool operator==(const TP& tpOther) const { return (this->index() == tpOther.index()); } // Fill truth info with association from tracking particle to stubs. - void fillTruth(const vector& vStubs); + void fillTruth(const std::list& vStubs); // == Functions for returning info about tracking particles === @@ -45,7 +47,11 @@ namespace tmtt { int charge() const { return charge_; } float mass() const { return mass_; } float pt() const { return pt_; } - float qOverPt() const { return (pt_ > 0) ? charge_ / pt_ : 9.9e9; } + // Protect against pt=0; + float qOverPt() const { + constexpr float big = 9.9e9; + return (pt_ > 0) ? charge_ / pt_ : big; + } float eta() const { return eta_; } float theta() const { return theta_; } float tanLambda() const { return tanLambda_; } @@ -71,7 +77,7 @@ namespace tmtt { float trkZAtStub(const Stub* stub) const; // == Functions returning stubs produced by tracking particle. - const vector& assocStubs() const { + const std::vector& assocStubs() const { return assocStubs_; } // associated stubs. (Includes those failing tightened front-end electronics cuts supplied by user). (Which stubs are returned is affected by "StubMatchStrict" config param.) unsigned int numAssocStubs() const { return assocStubs_.size(); } @@ -85,11 +91,9 @@ namespace tmtt { void fillNearestJetInfo(const reco::GenJetCollection* genJets); // Store info (deltaR, pt) with nearest jet - float tpInJet() const { return tpInJet_ && nearestJetPt_ > 30; } - float tpInHighPtJet() const { return tpInJet_ && nearestJetPt_ > 100; } - float tpInVeryHighPtJet() const { return tpInJet_ && nearestJetPt_ > 200; } - - float nearestJetPt() const { return nearestJetPt_; } + // Check if TP is in a jet (for performance studies in jets) + float tpInJet(float genJetPtCut = 30.) const { return (tpInJet_ && nearestJetPt_ > genJetPtCut); } + float nearestJetPt() const { return nearestJetPt_; } // -ve if no nearest jet. private: void fillUse(); // Fill the use_ flag. @@ -100,6 +104,8 @@ namespace tmtt { void calcNumLayers() { nLayersWithStubs_ = Utility::countLayers(settings_, assocStubs_, false); } private: + TrackingParticlePtr trackingParticlePtr_; // Pointer to original TrackingParticle. + unsigned int index_in_vTPs_; // location of this TP in InputData::vTPs const Settings* settings_; // Configuration parameters @@ -124,7 +130,7 @@ namespace tmtt { bool useForEff_; // TP can be used for tracking efficiency measurement. bool useForAlgEff_; // TP can be used for tracking algorithmic efficiency measurement. - vector assocStubs_; + std::vector assocStubs_; unsigned int nLayersWithStubs_; // Number of tracker layers with stubs from this TP. bool tpInJet_; diff --git a/L1Trigger/TrackFindingTMTT/interface/TrackFitFactory.h b/L1Trigger/TrackFindingTMTT/interface/TrackFitFactory.h new file mode 100644 index 0000000000000..a16353f3842fe --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/TrackFitFactory.h @@ -0,0 +1,27 @@ +#ifndef L1Trigger_TrackFindingTMTT_TrackFitFactory_h +#define L1Trigger_TrackFindingTMTT_TrackFitFactory_h + +///=== Create requested track fitter + +#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" +#include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h" + +#include +#include +#include + +namespace tmtt { + + class Settings; + + namespace trackFitFactory { + + // Function to produce a fitter based on a std::string + std::unique_ptr create(const std::string& fitterName, const Settings* settings); + + } // namespace trackFitFactory + +} // namespace tmtt + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h b/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h index 8e6ecf082d975..158b1291e10ff 100644 --- a/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h +++ b/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h @@ -1,12 +1,9 @@ -///=== This is the base class for all the track fit algorithms - -///=== Written by: Alexander D. Morton and Sioni Summers - #ifndef L1Trigger_TrackFindingTMTT_TrackFitGeneric_h #define L1Trigger_TrackFindingTMTT_TrackFitGeneric_h -// Don't fit track candidates if they have more than this number of stubs. -#define __MAX_STUBS_PER_TRK__ 30 +///=== This is the base class for all the track fit algorithms + +///=== Written by: Alexander D. Morton and Sioni Summers #include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" @@ -14,8 +11,6 @@ #include #include -using namespace std; - namespace tmtt { class Settings; @@ -23,30 +18,18 @@ namespace tmtt { class TrackFitGeneric { public: // Set configuration parameters. - TrackFitGeneric(const Settings* settings, const string& fitterName = ""); + TrackFitGeneric(const Settings* settings, const std::string& fitterName = "") + : settings_(settings), fitterName_(fitterName) {} virtual ~TrackFitGeneric() {} - // Static method to produce a fitter based on a string - // static std::auto_ptr create(std::string, const Settings* settings); - static TrackFitGeneric* create(std::string, const Settings* settings); - virtual void bookHists() {} - - virtual void initRun() {} // Fit a track candidate obtained from the Hough Transform. - virtual L1fittedTrack fit(const L1track3D& l1track3D); - - // Optional debug printout at end of job. - virtual void endJob() {} - - const Settings* getSettings() const { return settings_; } - unsigned nDupStubs() const { return nDupStubs_; } + virtual L1fittedTrack fit(const L1track3D& l1track3D) { return L1fittedTrack(); } protected: // Configuration parameters const Settings* settings_; - const string fitterName_; - unsigned nDupStubs_; + const std::string fitterName_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h b/L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h deleted file mode 100644 index fd49de84f1ff9..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef L1Trigger_TrackFindingTMTT_TrackerGeometryInfo_h -#define L1Trigger_TrackFindingTMTT_TrackerGeometryInfo_h - -#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" -#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" -#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" - -#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" - -#include - -using namespace std; - -class TrackerTopology; -class TrackerGeometry; - -namespace tmtt { - - /** - * ======================================================================================================== - * Class for storing info on tracker geometry - * Currently stores the z/r and B of tilted modules, and only needs to do this once per job - * ======================================================================================================== - */ - - class TrackerGeometryInfo { - public: - // Initialize. - TrackerGeometryInfo(); - - ~TrackerGeometryInfo() {} - - void getTiltedModuleInfo(const Settings* settings, - const TrackerTopology* trackerTopo, - const TrackerGeometry* trackerGeom); - double barrelNTiltedModules() const { return barrelNTiltedModules_; } - double barrelNLayersWithTiltedModules() const { return barrelNLayersWithTiltedModules_; } - - vector moduleZoR() const { return moduleZoR_; } - vector moduleB() const { return moduleB_; } - - private: - unsigned int barrelNTiltedModules_; - unsigned int barrelNLayersWithTiltedModules_; - - std::vector moduleZoR_; - vector moduleB_; - }; - -} // namespace tmtt - -#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/TrackerModule.h b/L1Trigger/TrackFindingTMTT/interface/TrackerModule.h new file mode 100644 index 0000000000000..c3149ce1ce03e --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/TrackerModule.h @@ -0,0 +1,140 @@ +#ifndef L1Trigger_TrackFindingTMTT_TrackerModule_h +#define L1Trigger_TrackFindingTMTT_TrackerModule_h + +#include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/Common/interface/Ref.h" +#include "DataFormats/Common/interface/DetSetVector.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" + +#include +#include +#include +#include + +class TrackerGeometry; +class TrackerTopology; +class PixelGeomDetUnit; +class PixelTopology; + +namespace tmtt { + + //=== Get info about tracker module + + class TrackerModule { + public: + enum BarrelModuleType { tiltedMinusZ = 1, tiltedPlusZ = 2, flat = 3 }; + + // Info used to define firmware module type. + struct ModuleTypeCfg { + std::vector pitchVsType; + std::vector spaceVsType; + std::vector barrelVsType; + std::vector psVsType; + std::vector tiltedVsType; + }; + + // Here detId is ID of lower sensor in stacked module. + TrackerModule(const TrackerGeometry* trackerGeometry, + const TrackerTopology* trackerTopology, + const ModuleTypeCfg& moduleTypeCfg, + const DetId& detId); + + // Det ID of lower sensor in stacked module. + const DetId& detId() const { return detId_; } + unsigned int rawDetId() const { return detId_.rawId(); } + // Det ID of stacked module. + const DetId& stackedDetId() const { return stackedDetId_; } + unsigned int rawStackedDetId() const { return stackedDetId_.rawId(); } + // Tracker specific DetUnit & topology. + const PixelGeomDetUnit* specDet() const { return specDet_; } + const PixelTopology* specTopol() const { return specTopol_; } + // Coordinates of centre of two sensors in (r,phi,z) + float minR() const { return moduleMinR_; } + float maxR() const { return moduleMaxR_; } + float minPhi() const { return moduleMinPhi_; } + float maxPhi() const { return moduleMaxPhi_; } + float minZ() const { return moduleMinZ_; } + float maxZ() const { return moduleMaxZ_; } + // Polar angle of module. + float theta() const { return atan2(moduleMinR_, moduleMinZ_); } + // Which of two sensors in module is furthest from beam-line? + bool outerModuleAtSmallerR() const { return outerModuleAtSmallerR_; } + // Module type: PS or 2S? + bool psModule() const { return psModule_; } + bool barrel() const { return barrel_; } + // Tracker layer ID number (1-6 = barrel layer; 11-15 = endcap A disk; 21-25 = endcap B disk) + unsigned int layerId() const { return layerId_; } + // Reduced layer ID (in range 1-7), for packing into 3 bits to simplify the firmware. + unsigned int layerIdReduced() const { return layerIdReduced_; } + // Endcap ring of module (returns zero in case of barrel) + unsigned int endcapRing() const { return endcapRing_; } + // True if stub is in tilted barrel module. + bool tiltedBarrel() const { return tiltedBarrel_; } + // Angle between normal to module and beam-line along +ve z axis. (In range -PI/2 to +PI/2). + float tiltAngle() const { return tiltAngle_; } + // Width of sensitive region of sensor. + float sensorWidth() const { return sensorWidth_; } + // Sensor spacing in module + float sensorSpacing() const { return sensorSpacing_; } + // No. of strips in sensor. + unsigned int nStrips() const { return nStrips_; } + // Strip pitch (or pixel pitch along shortest axis). + float stripPitch() const { return stripPitch_; } + // Strip length (or pixel pitch along longest axis). + float stripLength() const { return stripLength_; } + // Hit resolution perpendicular to strip (or to longest pixel axis). Measures phi. + float sigmaPerp() const { + constexpr float f = sqrt(1. / 12.); + return f * stripPitch_; + } + // Hit resolution parallel to strip (or to longest pixel axis). Measures r or z. + float sigmaPar() const { + constexpr float f = sqrt(1. / 12.); + return f * stripLength_; + } + // Sensor pitch over separation. + float pitchOverSep() const { return stripPitch_ / sensorSpacing_; } + // "B" parameter correction for module tilt. + float paramB() const { return std::abs(cos(theta() - tiltAngle()) / sin(theta())); } + // Module type ID defined by firmware. + unsigned int moduleTypeID() const { return moduleTypeID_; } + + //--- Utilties + + // Calculate reduced layer ID (in range 1-7), for packing into 3 bits to simplify the firmware. + static unsigned int calcLayerIdReduced(unsigned int layerId); + + // Get module type ID defined by firmware. + unsigned int calcModuleType(float pitch, float space, bool barrel, bool tiltedBarrel, bool psModule) const; + + private: + DetId detId_; + DetId stackedDetId_; + const PixelGeomDetUnit* specDet_; + const PixelTopology* specTopol_; + float moduleMinR_; + float moduleMaxR_; + float moduleMinPhi_; + float moduleMaxPhi_; + float moduleMinZ_; + float moduleMaxZ_; + bool outerModuleAtSmallerR_; + bool psModule_; + bool barrel_; + unsigned int layerId_; + unsigned int layerIdReduced_; + unsigned int endcapRing_; + bool tiltedBarrel_; + float tiltAngle_; + float sensorWidth_; + float sensorSpacing_; + unsigned int nStrips_; + float stripPitch_; + float stripLength_; + unsigned int moduleTypeID_; + + ModuleTypeCfg moduleTypeCfg_; + }; + +} // namespace tmtt +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h b/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h index 5e3e652347fbe..4d96f7602f3e3 100644 --- a/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h +++ b/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h @@ -4,11 +4,9 @@ #include "L1Trigger/TrackFindingTMTT/interface/L1track2D.h" #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" #include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h" -#include "L1Trigger/TrackFindingTMTT/interface/KillDupTrks.h" #include - -using namespace std; +#include //=== This class runs filters in track candidates previously found by the r-phi Hough transform, //=== which check that each track's stubs are consistent with a straight line in the r-z plane. @@ -32,47 +30,29 @@ namespace tmtt { class TrkRZfilter { public: - TrkRZfilter() - : settings_(nullptr), - iPhiSec_(0), - iEtaReg_(0), - etaMinSector_(0), - etaMaxSector_(0), - phiCentreSector_(0), - rzHelix_z0_(0), - rzHelix_tanL_(0), - rzHelix_set_(false), - chosenRofZ_(0), - zTrkMinSector_(0), - zTrkMaxSector_(0), - beamWindowZ_(0) {} - ~TrkRZfilter() {} - - struct SortStubsInLayer { - inline bool operator()(const Stub* stub1, const Stub* stub2) { - return (fabs(stub1->layerId()) < fabs(stub2->layerId())); - } - }; - // Initialize configuration parameters, and note sector number, eta range covered by sector and phi coordinate of its centre. - void init(const Settings* settings, - unsigned int iPhiSec, - unsigned int iEtaReg, - float etaMinSector, - float etaMaxSector, - float phiCentreSector); + TrkRZfilter(const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float etaMinSector, + float etaMaxSector, + float phiCentreSector); + + struct SortStubsByLayer { + inline bool operator()(const Stub* stub1, const Stub* stub2) { return (stub1->layerId() < stub2->layerId()); } + }; // Filters track candidates (found by the r-phi Hough transform), removing inconsistent stubs from the tracks, // also killing some of the tracks altogether if they are left with too few stubs. // Also adds an estimate of r-z helix parameters to the selected track objects, returning the tracks as L1track3D type. // - vector filterTracks(const vector& tracks); + std::list filterTracks(const std::list& tracks); //=== Extra information about each track input to filter. (Only use after you have first called filterTracks). // Number of seed combinations considered by the Seed Filter for each input track. - vector numSeedCombsPerTrk() const { return numSeedCombsPerTrk_; } - vector numGoodSeedCombsPerTrk() const { + const std::vector& numSeedCombsPerTrk() const { return numSeedCombsPerTrk_; } + const std::vector& numGoodSeedCombsPerTrk() const { return numGoodSeedCombsPerTrk_; } // Only counts seeds compatible with beam-spot. @@ -81,7 +61,7 @@ namespace tmtt { // Use Seed Filter to produce a filtered collection of stubs on this track candidate that are consistent with a straight line // in r-z using tracklet algo. - vector seedFilter(const vector& stubs, float trkQoverPt, bool print); + std::vector seedFilter(const std::vector& stubs, float trkQoverPt, bool print); //--- Estimate r-z helix parameters from centre of eta-sector if no better estimate provided by r-z filter. void estRZhelix(); @@ -109,18 +89,18 @@ namespace tmtt { float beamWindowZ_; // Assumed length of beam spot in z. // Name of r-z track filter algorithm to run. - string rzFilterName_; + std::string rzFilterName_; // Filter stubs in cell using Seed Filter? (a tracklet-like algorithm in r-z plane). bool useSeedFilter_; // Options for Seed filter. - float seedResolution_; + float seedResCut_; bool keepAllSeed_; // Number of seed combinations considered by the Seed Filter, for each input track. - vector numSeedCombsPerTrk_; - vector numGoodSeedCombsPerTrk_; + std::vector numSeedCombsPerTrk_; + std::vector numGoodSeedCombsPerTrk_; unsigned int maxSeedCombinations_; unsigned int maxGoodSeedCombinations_; unsigned int maxSeedsPerStub_; @@ -128,9 +108,6 @@ namespace tmtt { // For debugging unsigned int minNumMatchLayers_; - - //=== Contains algorithm used for optional duplicate track removal. - KillDupTrks killDupTrks_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/Utility.h b/L1Trigger/TrackFindingTMTT/interface/Utility.h index 8ff4000c13045..38e91bd80f261 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Utility.h +++ b/L1Trigger/TrackFindingTMTT/interface/Utility.h @@ -3,7 +3,6 @@ #include #include -using namespace std; namespace tmtt { @@ -16,35 +15,51 @@ namespace tmtt { // // By default uses the "reduced" layer ID if the configuration file requested it. However, // you can insist on "normal" layer ID being used instead, ignoring the configuration file, by - // setting disableReducedLayerID = true. + // std::setting disableReducedLayerID = true. // // N.B. The "reduced" layer ID merges some layer IDs, so that no more than 8 ID are needed in any // eta region, so as to simplify the firmware. // - // N.B. You should set disableReducedLayerID = false when counting the number of layers on a tracking + // N.B. You should std::set disableReducedLayerID = false when counting the number of layers on a tracking // particle or how many layers it shares with an L1 track. Such counts by CMS convention use "normal" layer ID. // // By default, considers both PS+2S modules, but optionally considers only the PS ones if onlyPS = true. + enum AlgoStep { HT, SEED, DUP, FIT }; + + unsigned int countLayers(const Settings* settings, + const std::vector& stubs, + bool disableReducedLayerID = false, + bool onlyPS = false); + unsigned int countLayers(const Settings* settings, - const vector& stubs, + const std::vector& stubs, bool disableReducedLayerID = false, bool onlyPS = false); - // Given a set of stubs (presumably on a reconstructed track candidate) + // Given a std::set of stubs (presumably on a reconstructed track candidate) // return the best matching Tracking Particle (if any), // the number of tracker layers in which one of the stubs matched one from this tracking particle, // and the list of the subset of the stubs which match those on the tracking particle. const TP* matchingTP(const Settings* settings, - const vector& vstubs, + const std::vector& vstubs, + unsigned int& nMatchedLayersBest, + std::vector& matchedStubsBest); + + const TP* matchingTP(const Settings* settings, + const std::vector& vstubs, unsigned int& nMatchedLayersBest, - vector& matchedStubsBest); + std::vector& matchedStubsBest); - // Determine the minimum number of layers a track candidate must have stubs in to be defined as a track. - // The first argument indicates from what type of algorithm this function is called: "HT", "SEED", "DUP" or "FIT". - unsigned int numLayerCut( - string algo, const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, float invPt, float eta = 0.); + // Determine min number of layers a track candidate must have stubs in to be defined as a track. + // 1st argument indicates from which step in chain this function is called: HT, SEED, DUP or FIT. + unsigned int numLayerCut(Utility::AlgoStep algo, + const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float invPt, + float eta = 0.); } // namespace Utility } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h deleted file mode 100644 index 7e4fae322c9a8..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef L1Trigger_TrackFindingTMTT_DigiConverter_h -#define L1Trigger_TrackFindingTMTT_DigiConverter_h - -#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" - -#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" -#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" - -#include "Demonstrator/DataFormats/interface/DigiDTCStub.hpp" -#include "Demonstrator/DataFormats/interface/DigiHTStub.hpp" -#include "Demonstrator/DataFormats/interface/DigiHTMiniStub.hpp" -#include "Demonstrator/DataFormats/interface/DigiKF4Track.hpp" - -namespace demo { - - /** - * @brief Utility class to convert simulation objects into edm did objects - */ - - class DigiConverter { - public: - DigiConverter(const tmtt::Settings* settings); - ~DigiConverter() = default; - - DigiDTCStub makeDigiDTCStub(const tmtt::Stub& aDTCStub, uint32_t aDigiPhiSec) const; - DigiHTStub makeDigiHTStub(const tmtt::Stub& aHTStub, - uint32_t aPhiSectorIdInNon, - uint32_t aEtaSectorId, - int cBin, - int aChiZ, - int aChiPhi, - bool mSel) const; - DigiHTMiniStub makeDigiHTMiniStub(const tmtt::Stub& aHTMiniStub, - uint32_t aPhiSectorIdInNon, - uint32_t aEtaSectorId, - int8_t cBin, - int8_t mBin) const; - DigiKF4Track makeDigiKF4Track(const tmtt::L1fittedTrack& aFitTrk) const; - - private: - const tmtt::Settings* mSettings; // Configuration parameters. - }; - -} // namespace demo - -#endif /* __DEMONSTRATOR_DATAFORMATS_DIGICONVERTER_H__ */ diff --git a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.icc b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.icc deleted file mode 100644 index 2dfda2c8a267d..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.icc +++ /dev/null @@ -1,86 +0,0 @@ -#include "L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h" - -namespace demo { - - //----------------------------------------------------------------------------- - DigiConverter::DigiConverter(const tmtt::Settings* settings) : mSettings(settings) {} - //----------------------------------------------------------------------------- - - //----------------------------------------------------------------------------- - DigiDTCStub DigiConverter::makeDigiDTCStub(const tmtt::Stub& aDTCStub, uint32_t aDigiPhiSec) const { - return DigiDTCStub(aDTCStub.digitalStub().iDigi_PhiO(), - aDTCStub.digitalStub().moduleType(), - aDigiPhiSec, - aDTCStub.digitalStub().iDigi_Z(), - aDTCStub.digitalStub().iDigi_Bend(), - aDTCStub.digitalStub().iDigi_Rt(), - true); - } - //----------------------------------------------------------------------------- - - //----------------------------------------------------------------------------- - DigiHTStub DigiConverter::makeDigiHTStub(const tmtt::Stub& aHTStub, - uint32_t aPhiSectorIdInNon, - uint32_t aEtaSectorId, - int cBin, - int aChiZ, - int aChiPhi, - bool mSel) const { - return DigiHTStub(aHTStub.layerIdReduced(), - aPhiSectorIdInNon, - aEtaSectorId, - cBin, - aChiZ, - aChiPhi, - aHTStub.digitalStub().iDigi_Rt(), - mSel, - true // valid - ); - } - //----------------------------------------------------------------------------- - - //----------------------------------------------------------------------------- - DigiHTMiniStub DigiConverter::makeDigiHTMiniStub(const tmtt::Stub& aHTMiniStub, - uint32_t aPhiSectorIdInNon, - uint32_t aEtaSectorId, - int8_t cBin, - int8_t mBin) const { - return DigiHTMiniStub(aHTMiniStub.layerIdReduced(), - aPhiSectorIdInNon, - aEtaSectorId, - cBin, - mBin, - aHTMiniStub.digitalStub().iDigi_PhiS(), - aHTMiniStub.digitalStub().iDigi_Z(), - aHTMiniStub.digitalStub().iDigi_Rt(), - true // valid - ); - } - //----------------------------------------------------------------------------- - - //----------------------------------------------------------------------------- - DigiKF4Track DigiConverter::makeDigiKF4Track(const tmtt::L1fittedTrack& aFitTrk) const { - const uint numPhiSecPerNon = mSettings->numPhiSectors() / mSettings->numPhiNonants(); - - return DigiKF4Track(aFitTrk.digitaltrack().iDigi_oneOver2r(), - aFitTrk.digitaltrack().iDigi_phi0rel(), - aFitTrk.digitaltrack().iDigi_tanLambda(), - aFitTrk.digitaltrack().iDigi_z0(), - 0, // d0 - aFitTrk.digitaltrack().iDigi_chisquaredRphi(), - aFitTrk.digitaltrack().iDigi_chisquaredRz(), - aFitTrk.getHitPattern(), - aFitTrk.getNumLayers(), - 0, - aFitTrk.getCellLocationHT().first - mSettings->houghNbinsPt() / 2, - aFitTrk.getCellLocationHT().second - mSettings->houghNbinsPhi() / 2, - aFitTrk.iPhiSec() % numPhiSecPerNon, - aFitTrk.iEtaReg(), - aFitTrk.getCellLocationFit().first - mSettings->houghNbinsPt() / 2, - aFitTrk.getCellLocationFit().second - mSettings->houghNbinsPhi() / 2, - aFitTrk.consistentHTcell(), - true); - } - //----------------------------------------------------------------------------- - -} // namespace demo diff --git a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.h b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.h deleted file mode 100644 index b378eb4ad4682..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef L1Trigger_TrackFindingTMTT_DigiProducer_h -#define L1Trigger_TrackFindingTMTT_DigiProducer_h - -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "DataFormats/L1TrackTrigger/interface/TTTypes.h" -#include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h" -#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h" -#include "SimTracker/TrackTriggerAssociation/interface/TTClusterAssociationMap.h" -#include "SimTracker/TrackTriggerAssociation/interface/TTStubAssociationMap.h" -#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" -#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" -#include "L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h" -#include "DataFormats/Common/interface/DetSetVector.h" -#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" -#include "L1Trigger/TrackFindingTMTT/interface/Histos.h" -#include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h" -#include "Demonstrator/DataFormats/interface/DigiKF4Track.hpp" -#include "Demonstrator/DataFormats/interface/DigiHTStub.hpp" -#include "Demonstrator/DataFormats/interface/DigiHTMiniStub.hpp" -#include "Demonstrator/DataFormats/interface/DigiDTCStub.hpp" - -#include -#include -#include - -using namespace std; - -namespace demo { - - /*class Settings; -class Histos; -class TrackFitGeneric;*/ - - class DigiProducer : public edm::EDProducer { - public: - explicit DigiProducer(const edm::ParameterSet &); - ~DigiProducer() {} - - private: - typedef std::vector > TTTrackCollection; - - virtual void beginRun(const edm::Run &, const edm::EventSetup &); - virtual void produce(edm::Event &, const edm::EventSetup &); - virtual void endJob(); - - private: - const edm::EDGetTokenT tpInputTag; - const edm::EDGetTokenT stubInputTag; - const edm::EDGetTokenT stubTruthInputTag; - const edm::EDGetTokenT clusterTruthInputTag; - const edm::EDGetTokenT genJetInputTag_; - - // Configuration parameters - tmtt::Settings *settings_; - vector trackFitters_; - vector useRZfilter_; - bool runRZfilter_; - - tmtt::Histos *hists_; - map fitterWorkerMap_; - - tmtt::TrackerGeometryInfo trackerGeometryInfo_; - }; - -} // namespace demo - -#endif /* __DEMONSTRATOR_PRODUCER_DIGIPRODUCER_HPP__ */ diff --git a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.icc b/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.icc deleted file mode 100644 index 1905528f662ab..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interfaceDemo/DigiProducer.icc +++ /dev/null @@ -1,519 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "L1Trigger/TrackFindingTMTT/interface/HTcell.h" -#include "L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h" -#include "L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h" -#include "L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h" - -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "MagneticField/Engine/interface/MagneticField.h" -#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" - -#include "L1Trigger/TrackFindingTMTT/interfaceDemo/DigiConverter.h" - -#include "boost/numeric/ublas/matrix.hpp" -#include -#include -#include -#include -#include - -// If this defined, then the debug printout requested by Thomas to help with HT debugging is produced. -//#define THOMAS - -// If this is defined, then TTTrack collections will be output using tracks after HT (and optionally r-z filter) too. -//#define OutputHT_TTracks - -using namespace std; -using boost::numeric::ublas::matrix; - -namespace demo { - - DigiProducer::DigiProducer(const edm::ParameterSet& iConfig) - : tpInputTag(consumes(iConfig.getParameter("tpInputTag"))), - stubInputTag(consumes(iConfig.getParameter("stubInputTag"))), - stubTruthInputTag(consumes(iConfig.getParameter("stubTruthInputTag"))), - clusterTruthInputTag( - consumes(iConfig.getParameter("clusterTruthInputTag"))), - genJetInputTag_(consumes(iConfig.getParameter("genJetInputTag"))), - trackerGeometryInfo_() { - // Get configuration parameters - settings_ = new tmtt::Settings(iConfig); - trackFitters_ = settings_->trackFitters(); - useRZfilter_ = settings_->useRZfilter(); - runRZfilter_ = (useRZfilter_.size() > 0); // Do any fitters require an r-z track filter to be run? - - // Tame debug printout. - cout.setf(ios::fixed, ios::floatfield); - cout.precision(4); - - // Book histograms. - hists_ = new tmtt::Histos(settings_); - hists_->book(); - - // Create track fitting algorithm (& internal histograms if it uses them) - for (const string& fitterName : trackFitters_) { - fitterWorkerMap_[fitterName] = tmtt::TrackFitGeneric::create(fitterName, settings_); - fitterWorkerMap_[fitterName]->bookHists(); - } - - //--- Define EDM output to be written to file (if required) - - // L1 tracks found by Hough Transform - // produces< TTTrackCollection >( "TML1TracksHT" ).setBranchAlias("TML1TracksHT"); - // L1 tracks found by r-z track filter. - - produces("SimDigiKF4Tracks").setBranchAlias("SimDigiKF4Tracks"); - produces("SimDigiKF4TracksWithDups").setBranchAlias("SimDigiKF4TracksWithDups"); - produces("SimDigiHTStubs").setBranchAlias("SimDigiHTStubs"); - produces("SimDigiHTMiniStubs").setBranchAlias("SimDigiHTMiniStubs"); - produces("SimDigiHTStubs").setBranchAlias("SimDigiHTStubs"); - produces("SimDigiDTCStubs").setBranchAlias("SimDigiDTCStubs"); - // L1 tracks after track fit by each of the fitting algorithms under study - for (const string& fitterName : trackFitters_) { - string edmName = string("TML1Tracks") + fitterName; - produces(edmName).setBranchAlias(edmName); - } - } - - void DigiProducer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) { - // Get the B-field and store its value in the Settings class. - - edm::ESHandle magneticFieldHandle; - iSetup.get().get(magneticFieldHandle); - const MagneticField* theMagneticField = magneticFieldHandle.product(); - float bField = theMagneticField->inTesla(GlobalPoint(0, 0, 0)).z(); // B field in Tesla. - cout << endl << "--- B field = " << bField << " Tesla ---" << endl << endl; - - settings_->setBfield(bField); - - // Initialize track fitting algorithm at start of run (especially with B-field dependent variables). - for (const string& fitterName : trackFitters_) { - fitterWorkerMap_[fitterName]->initRun(); - } - - // Print info on tilted modules - edm::ESHandle trackerGeometryHandle; - iSetup.get().get(trackerGeometryHandle); - const TrackerGeometry* trackerGeometry = trackerGeometryHandle.product(); - - edm::ESHandle trackerTopologyHandle; - iSetup.get().get(trackerTopologyHandle); - const TrackerTopology* trackerTopology = trackerTopologyHandle.product(); - - trackerGeometryInfo_.getTiltedModuleInfo(settings_, trackerTopology, trackerGeometry); - } - - void DigiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { - // Note useful info about MC truth particles and about reconstructed stubs . - tmtt::InputData inputData( - iEvent, iSetup, settings_, tpInputTag, stubInputTag, stubTruthInputTag, clusterTruthInputTag, genJetInputTag_); - - const vector& vTPs = inputData.getTPs(); - const vector& vStubs = inputData.getStubs(); - - // Creates matrix of Sector objects, which decide which stubs are in which (eta,phi) sector - matrix mSectors(settings_->numPhiSectors(), settings_->numEtaRegions()); - // Create matrix of r-phi Hough-Transform arrays, with one-to-one correspondence to sectors. - matrix mHtRphis(settings_->numPhiSectors(), settings_->numEtaRegions()); - // Create matrix of Get3Dtracks objects, to run optional r-z track filter, with one-to-one correspondence to sectors. - matrix mGet3Dtrks(settings_->numPhiSectors(), settings_->numEtaRegions()); - - //=== Initialization - // Create utility for converting L1 tracks from our private format to official CMSSW EDM format. - const tmtt::ConverterToTTTrack converter(settings_); - const DigiConverter digiConverter(settings_); - - const unsigned int nFitAlgs = trackFitters_.size(); - - std::unique_ptr allFitTTTracksForOutput[nFitAlgs]; - std::unique_ptr allDigiKF4Tracks(new std::vector); - std::unique_ptr allDigiKF4TracksWithDups(new std::vector); - std::unique_ptr allDigiHTMiniStubs(new std::vector); - std::unique_ptr allDigiHTStubs(new std::vector); - std::unique_ptr allDigiDTCStubs(new std::vector); - - map locationInsideArray; - unsigned int ialg = 0; - for (const string& fitterName : trackFitters_) { - std::unique_ptr fitTTTracksForOutput(new TTTrackCollection); - allFitTTTracksForOutput[ialg] = std::move(fitTTTracksForOutput); - locationInsideArray[fitterName] = ialg++; - } - - //=== Do tracking in the r-phi Hough transform within each sector. - -#ifdef THOMAS - // Debug printout for Thomas - static unsigned int jEventCount = 0; - cout << "============================ DIGI EVENT " << jEventCount << " =========================" << endl; - jEventCount++; - - map, ostringstream> thomasString; -#endif - - map> stubsInNonant; - uint numPhiSecPerNon = settings_->numPhiSectors() / settings_->numPhiNonants(); - - // Fill Hough-Transform arrays with stubs. - for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { - for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { - tmtt::Sector& sector = mSectors(iPhiSec, iEtaReg); - tmtt::HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); - - // Initialize constants for this sector. - sector.init(settings_, iPhiSec, iEtaReg); - htRphi.init(settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), sector.phiCentre()); - - // Check sector is enabled (always true, except if user disabled some for special studies). - if (settings_->isHTRPhiEtaRegWhitelisted(iEtaReg)) { - for (const tmtt::Stub* stub : vStubs) { - // Digitize stub as would be at input to GP. This doesn't need the nonant number, since we assumed an integer number of - // phi digitisation bins inside an nonant. N.B. This changes the coordinates & bend stored in the stub. - // The cast allows us to ignore the "const". - - const_cast(stub)->digitizeForGPinput(iPhiSec); - // Check if stub is inside this sector - bool inside = sector.inside(stub); - - if (inside) { - // Check which eta subsectors within the sector the stub is compatible with (if subsectors being used). - const vector inEtaSubSecs = sector.insideEtaSubSecs(stub); - - // Digitize stub if as would be at input to HT, which slightly degrades its coord. & bend resolution, affecting the HT performance. - const_cast(stub)->digitizeForHTinput(iPhiSec); - - // Store stub in Hough transform array for this sector, indicating its compatibility with eta subsectors with sector. - htRphi.store(stub, inEtaSubSecs); - - unsigned int iPhiNonant = std::floor(iPhiSec / numPhiSecPerNon); - unsigned int digiPhiSec = iPhiSec % numPhiSecPerNon; - - set& stubsInThisNonant = stubsInNonant[iPhiNonant]; - if (std::count(stubsInThisNonant.begin(), stubsInThisNonant.end(), stub) == 0) { - stubsInNonant[iPhiSec / 2].insert(stub); - - DigiDTCStub digiDTCStub = digiConverter.makeDigiDTCStub(*stub, digiPhiSec); - - std::srand(stub->digitalStub().iDigi_PhiO()); - short unsigned int link_init = rand() % 48; - - digiDTCStub.setRouteId({(uint16_t)(iPhiNonant), (uint16_t)link_init, DigiRouteId::kNullTimeIndex}); - allDigiDTCStubs->push_back(digiDTCStub); - -#ifdef THOMAS - // IRT - debug printout for Thomas - unsigned int link = link_init; // GP input links in use in firmware. - if (link >= 36) { - link += 20; - } else if (link >= 12) { - link += 12; - } else { - link += 4; - } - int mBinMin = (int(stub->min_qOverPt_bin()) - int(settings_->houghNbinsPt()) / 2) / 2; - int mBinMax = (int(stub->max_qOverPt_bin()) - int(settings_->houghNbinsPt()) / 2) / 2; - thomasString[pair(iPhiNonant, stub)] - << "DIGI STUB: iNonant=" << digiDTCStub.routeId().processor() << " link=" << link - << " IphiO=" << digiDTCStub.phiO() << " Iz=" << digiDTCStub.z() << " IrT=" << digiDTCStub.rT() - << " modType=" << (unsigned int)(digiDTCStub.modType()) << " bend=" << int(digiDTCStub.bend()) - << "; FLOAT STUB: lay=" << stub->layerIdReduced() << " phiSec=" << sector.phiCentre() - << " etaMin=" << sector.etaMin() << " etaMax=" << sector.etaMax() << " mMin=" << mBinMin - << " mMax=" << mBinMax << " rT=" << stub->r() - settings_->chosenRofPhi() << " phi=" << stub->phi() - << " z=" << stub->z() << " : Sectors(phi,eta)="; -#endif - } -#ifdef THOMAS - thomasString[pair(iPhiNonant, stub)] << " (" << digiPhiSec << "," - << iEtaReg << ")"; -#endif - } - } - } - - // Find tracks in r-phi HT array. - htRphi.end(); // Calls htArrayRphi_.end() -> HTBase::end() - } - } - -#ifdef THOMAS - // Thomas debug printout. - for (const auto& p : thomasString) { - cout << (p.second).str() << endl; - } -#endif - - if (settings_->muxOutputsHT() > 0) { - // Multiplex outputs of several HT onto one pair of output opto-links. - // This only affects tracking performance if option busySectorKill is enabled, so that tracks that - // can't be sent down the link within the time-multiplexed period are killed. - tmtt::MuxHToutputs muxHT(settings_); - muxHT.exec(mHtRphis); - } - - // - for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { - unsigned int iNonant = iPhiSec / numPhiSecPerNon; - unsigned int iPhiSecInNonant = iPhiSec % numPhiSecPerNon; - - for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { - const tmtt::Sector& sector = mSectors(iPhiSec, iEtaReg); - - tmtt::Get3Dtracks& get3DtrkCoarse = mGet3Dtrks(iPhiSec, iEtaReg); - // Initialize utility for making 3D tracks from 2D ones. - get3DtrkCoarse.init(settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), sector.phiCentre()); - - // Convert 2D tracks found by HT to 3D tracks (optionally by running r-z filters & duplicate track removal) - get3DtrkCoarse.run(mHtRphis(iPhiSec, iEtaReg).trackCands2D()); - - // Loop over candidates in this phi/eta sector - for (const tmtt::L1track3D& trk : get3DtrkCoarse.trackCands3D(false)) { - auto lMTrk = const_cast(trk); - auto lChiPhi = lMTrk.getChiPhiDigi(); - auto lChiZ = lMTrk.getChiZDigi(); - const auto& lStubs = lMTrk.getStubs(); - - int8_t cBin = (trk.getCellLocationHT().second - settings_->houghNbinsPhi() / 2) / 2; - int8_t mBin = (trk.getCellLocationHT().first - settings_->houghNbinsPt() / 2) / 2; - //bool mSel = (mBin % 2 == 0); - // IRT - fix to match firmware - no longer needed. - //mBin = -int(mBin) - 1; - bool mSel = (mBin >= 0); - - //cout<<"Thomas check: mBin="<push_back(digiTrack); - } - } - - ///allDigiKFTracks Run duplicate track removal on the fitted tracks if requested. - const vector filtFittedTracksInSec = killDupFitTrks.filter(fittedTracksInSec); - - // Store fitted tracks from entire tracker. - for (const tmtt::L1fittedTrack& fitTrk : filtFittedTracksInSec) { - fittedTracks[fitterName].push_back(fitTrk); - // Convert these fitted tracks to EDM format for output (used for collaborative work outside TMTT group). - TTTrack fitTTTrack = converter.makeTTTrack(fitTrk, iPhiSec, iEtaReg); - allFitTTTracksForOutput[locationInsideArray[fitterName]]->push_back(fitTTTrack); - if (!settings_->enableDigitize() && "Digitization must be enabled to run the digi producer") { - assert(0); - } - - // Save digi tracks without duplicates - DigiKF4Track digiTrack = digiConverter.makeDigiKF4Track(fitTrk); - - digiTrack.setRouteId( - {(uint16_t)(iPhiSec / numPhiSecPerNon), DigiRouteId::kNullChannel, DigiRouteId::kNullTimeIndex}); - allDigiKF4Tracks->push_back(digiTrack); - } - } - } - } - - // Debug printout - unsigned int static nEvents = 0; - nEvents++; - if (settings_->debug() >= 1 && nEvents <= 1000) { - cout << "INPUT #TPs = " << vTPs.size() << " #STUBs = " << vStubs.size() << endl; - unsigned int numHTtracks = 0; - for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { - for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { - const tmtt::Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); - numHTtracks += get3Dtrk.trackCands3D(false).size(); - } - } - cout << "Number of tracks after HT = " << numHTtracks << endl; - for (const auto& p : fittedTracks) { - const string& fitName = p.first; - const vector& fittedTracks = p.second; - cout << "Number of tracks after " << fitName << " track helix fit = " << fittedTracks.size() << endl; - } - } - - // Allow histogramming to plot undigitized variables. - for (const tmtt::Stub* stub : vStubs) { - if (settings_->enableDigitize()) - (const_cast(stub))->setDigitizeWarningsOn(false); - } - - // Fill histograms to monitor input data & tracking performance. - hists_->fill(inputData, mSectors, mHtRphis, mGet3Dtrks, fittedTracks); - - //=== Store output EDM track and hardware stub collections. - iEvent.put(std::move(allDigiKF4Tracks), "SimDigiKF4Tracks"); - iEvent.put(std::move(allDigiKF4TracksWithDups), "SimDigiKF4TracksWithDups"); - iEvent.put(std::move(allDigiHTStubs), "SimDigiHTStubs"); - iEvent.put(std::move(allDigiHTMiniStubs), "SimDigiHTMiniStubs"); - iEvent.put(std::move(allDigiDTCStubs), "SimDigiDTCStubs"); - } - - void DigiProducer::endJob() { - // Print stub window sizes that TMTT recommends CMS uses in FE chips. - if (settings_->printStubWindows()) - tmtt::StubWindowSuggest::printResults(); - - // Optional debug printout from track fitters at end of job. - for (const string& fitterName : trackFitters_) { - fitterWorkerMap_[fitterName]->endJob(); - } - - // Print job summary - hists_->trackerGeometryAnalysis(trackerGeometryInfo_); - hists_->endJobAnalysis(); - - for (const string& fitterName : trackFitters_) { - //cout << "# of duplicated stubs = " << fitterWorkerMap_[fitterName]->nDupStubs() << endl; - delete fitterWorkerMap_[string(fitterName)]; - } - - cout << endl - << "Number of (eta,phi) sectors used = (" << settings_->numEtaRegions() << "," << settings_->numPhiSectors() - << ")" << endl; - } - - DEFINE_FWK_MODULE(DigiProducer); - -} // namespace demo diff --git a/L1Trigger/TrackFindingTMTT/interfaceDemo/README b/L1Trigger/TrackFindingTMTT/interfaceDemo/README deleted file mode 100644 index 6052378907dbb..0000000000000 --- a/L1Trigger/TrackFindingTMTT/interfaceDemo/README +++ /dev/null @@ -1,3 +0,0 @@ -The files in this subdirectory are compiled only when using the TMTT software with -the demonstrator code https://gitlab.cern.ch/cms-uk-tracktrigger/software/demo/Demonstrator/blob/master/README.md , -for comparing it with firmware. diff --git a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc index d1f2dcdee8803..0a3ea22eaa171 100644 --- a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc +++ b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc @@ -1,78 +1,90 @@ #include #include -#include -#include #include #include -#include -#include -#include +#include +#include +#include #include #include #include "L1Trigger/TrackFindingTMTT/interface/HTcell.h" #include "L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h" #include "L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h" -#include "L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h" +#include "L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h" +#include "FWCore/MessageService/interface/MessageLogger.h" #include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "MagneticField/Engine/interface/MagneticField.h" -#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" #include "boost/numeric/ublas/matrix.hpp" #include #include +#include #include - -// If this is defined, then TTTrack collections will be output using tracks after HT (and optionally r-z filter) too. -//#define OutputHT_TTracks +#include +#include using namespace std; using boost::numeric::ublas::matrix; namespace tmtt { - TMTrackProducer::TMTrackProducer(const edm::ParameterSet& iConfig) - : stubInputTag(consumes(iConfig.getParameter("stubInputTag"))), trackerGeometryInfo_() { - // Get configuration parameters - settings_ = new Settings(iConfig); + namespace { + std::once_flag printOnce; + std::once_flag callOnce; + } // namespace + + std::unique_ptr TMTrackProducer::initializeGlobalCache(edm::ParameterSet const& iConfig) { + return std::make_unique(iConfig); + } - if (settings_->enableMCtruth()) { + TMTrackProducer::TMTrackProducer(const edm::ParameterSet& iConfig, GlobalCacheTMTT const* globalCacheTMTT) + : debug_(true), // Debug printout + settings_(iConfig), // Set configuration parameters + hists_(globalCacheTMTT->hists()), // Initialize histograms + htRphiErrMon_(globalCacheTMTT->htRphiErrMon()), // rphi HT error monitoring + stubWindowSuggest_(globalCacheTMTT->stubWindowSuggest()) // For tuning FE stub window sizes + { + using namespace edm; + + // Get tokens for ES data access. + magneticFieldToken_ = + esConsumes(settings_.magneticFieldInputTag()); + trackerGeometryToken_ = esConsumes( + settings_.trackerGeometryInputTag()); + trackerTopologyToken_ = + esConsumes(settings_.trackerTopologyInputTag()); + + // Get tokens for ED data access. + stubToken_ = consumes(settings_.stubInputTag()); + if (settings_.enableMCtruth()) { // These lines use lots of CPU, even if no use of truth info is made later. - tpInputTag = consumes(iConfig.getParameter("tpInputTag")); - stubTruthInputTag = consumes(iConfig.getParameter("stubTruthInputTag")); - clusterTruthInputTag = consumes(iConfig.getParameter("clusterTruthInputTag")); - genJetInputTag_ = consumes(iConfig.getParameter("genJetInputTag")); + tpToken_ = consumes(settings_.tpInputTag()); + stubTruthToken_ = consumes(settings_.stubTruthInputTag()); + clusterTruthToken_ = consumes(settings_.clusterTruthInputTag()); + genJetToken_ = consumes(settings_.genJetInputTag()); } - trackFitters_ = settings_->trackFitters(); - useRZfilter_ = settings_->useRZfilter(); - runRZfilter_ = (useRZfilter_.size() > 0); // Do any fitters require an r-z track filter to be run? - - // Tame debug printout. - cout.setf(ios::fixed, ios::floatfield); - cout.precision(4); + trackFitters_ = settings_.trackFitters(); + useRZfilter_ = settings_.useRZfilter(); + runRZfilter_ = (not useRZfilter_.empty()); // Do any fitters require an r-z track filter to be run? // Book histograms. - hists_ = new Histos(settings_); - hists_->book(); + //hists_.book(); - // Create track fitting algorithm (& internal histograms if it uses them) + // Create track fitting algorithm for (const string& fitterName : trackFitters_) { - fitterWorkerMap_[fitterName] = TrackFitGeneric::create(fitterName, settings_); - fitterWorkerMap_[fitterName]->bookHists(); + fitterWorkerMap_[fitterName] = trackFitFactory::create(fitterName, &settings_); } //--- Define EDM output to be written to file (if required) -#ifdef OutputHT_TTracks - // L1 tracks found by Hough Transform - produces("TML1TracksHT").setBranchAlias("TML1TracksHT"); - // L1 tracks found by r-z track filter. - if (runRZfilter_) - produces("TML1TracksRZ").setBranchAlias("TML1TracksRZ"); -#endif + if (settings_.enableOutputIntermediateTTTracks()) { + // L1 tracks found by Hough Transform + produces("TML1TracksHT").setBranchAlias("TML1TracksHT"); + // L1 tracks found by r-z track filter. + if (runRZfilter_) + produces("TML1TracksRZ").setBranchAlias("TML1TracksRZ"); + } // L1 tracks after track fit by each of the fitting algorithms under study for (const string& fitterName : trackFitters_) { string edmName = string("TML1Tracks") + fitterName; @@ -82,299 +94,314 @@ namespace tmtt { void TMTrackProducer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) { // Get the B-field and store its value in the Settings class. - - edm::ESHandle magneticFieldHandle; - iSetup.get().get(magneticFieldHandle); - const MagneticField* theMagneticField = magneticFieldHandle.product(); + const MagneticField* theMagneticField = &(iSetup.getData(magneticFieldToken_)); float bField = theMagneticField->inTesla(GlobalPoint(0, 0, 0)).z(); // B field in Tesla. - cout << endl << "--- B field = " << bField << " Tesla ---" << endl << endl; - - settings_->setBfield(bField); - - // Initialize track fitting algorithm at start of run (especially with B-field dependent variables). - for (const string& fitterName : trackFitters_) { - fitterWorkerMap_[fitterName]->initRun(); + settings_.setMagneticField(bField); + + // Set also B field in GlobalCacheTMTT (used only for Histogramming) + globalCache()->settings().setMagneticField(bField); + + std::stringstream text; + text << "\n--- B field = " << bField << " Tesla ---\n"; + std::call_once( + printOnce, [](string t) { PrintL1trk() << t; }, text.str()); + + // Get tracker geometry + trackerGeometry_ = &(iSetup.getData(trackerGeometryToken_)); + trackerTopology_ = &(iSetup.getData(trackerTopologyToken_)); + + // Loop over tracker modules to get module info & stubs. + + // Identifies tracker module type for firmware. + TrackerModule::ModuleTypeCfg moduleTypeCfg; + moduleTypeCfg.pitchVsType = settings_.pitchVsType(); + moduleTypeCfg.spaceVsType = settings_.spaceVsType(); + moduleTypeCfg.barrelVsType = settings_.barrelVsType(); + moduleTypeCfg.psVsType = settings_.psVsType(); + moduleTypeCfg.tiltedVsType = settings_.tiltedVsType(); + + listTrackerModule_.clear(); + for (const GeomDet* gd : trackerGeometry_->dets()) { + DetId detId = gd->geographicalId(); + // Phase 2 Outer Tracker uses TOB for entire barrel & TID for entire endcap. + if (detId.subdetId() != StripSubdetector::TOB && detId.subdetId() != StripSubdetector::TID) + continue; + if (trackerTopology_->isLower(detId)) { // Select only lower of the two sensors in a module. + // Store info about this tracker module. + listTrackerModule_.emplace_back(trackerGeometry_, trackerTopology_, moduleTypeCfg, detId); + } } - // Print info on tilted modules - edm::ESHandle trackerGeometryHandle; - iSetup.get().get(trackerGeometryHandle); - const TrackerGeometry* trackerGeometry = trackerGeometryHandle.product(); - - edm::ESHandle trackerTopologyHandle; - iSetup.get().get(trackerTopologyHandle); - const TrackerTopology* trackerTopology = trackerTopologyHandle.product(); - - trackerGeometryInfo_.getTiltedModuleInfo(settings_, trackerTopology, trackerGeometry); + // Takes one copy of this to GlobalCacheTMTT for later histogramming. + globalCache()->setListTrackerModule(listTrackerModule_); } void TMTrackProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { - // edm::Handle tpHandle; - // edm::EDGetToken token( consumes>( edm::InputTag( "mix", "MergedTrackTruth" ) ) ); - // iEvent.getByToken(inputTag, tpHandle ); - // Note useful info about MC truth particles and about reconstructed stubs . - InputData inputData( - iEvent, iSetup, settings_, tpInputTag, stubInputTag, stubTruthInputTag, clusterTruthInputTag, genJetInputTag_); - - const vector& vTPs = inputData.getTPs(); - const vector& vStubs = inputData.getStubs(); + InputData inputData(iEvent, + iSetup, + &settings_, + &stubWindowSuggest_, + trackerGeometry_, + trackerTopology_, + listTrackerModule_, + tpToken_, + stubToken_, + stubTruthToken_, + clusterTruthToken_, + genJetToken_); + + const list& vTPs = inputData.getTPs(); + const list& vStubs = inputData.stubs(); // Creates matrix of Sector objects, which decide which stubs are in which (eta,phi) sector - matrix mSectors(settings_->numPhiSectors(), settings_->numEtaRegions()); + matrix> mSectors(settings_.numPhiSectors(), settings_.numEtaRegions()); // Create matrix of r-phi Hough-Transform arrays, with one-to-one correspondence to sectors. - matrix mHtRphis(settings_->numPhiSectors(), settings_->numEtaRegions()); - // Create matrix of Get3Dtracks objects, to run optional r-z track filter, with one-to-one correspondence to sectors. - matrix mGet3Dtrks(settings_->numPhiSectors(), settings_->numEtaRegions()); + matrix> mHtRphis(settings_.numPhiSectors(), settings_.numEtaRegions()); + // Create matrix of Make3Dtracks objects, to run optional r-z track filter, with one-to-one correspondence to sectors. + matrix> mMake3Dtrks(settings_.numPhiSectors(), settings_.numEtaRegions()); + // Create matrix of tracks from each fitter in each sector + matrix>> mapmFitTrks(settings_.numPhiSectors(), settings_.numEtaRegions()); + // Final tracks after duplicate removal from each track fitter in entire tracker. + map> mapFinalTracks; //=== Initialization // Create utility for converting L1 tracks from our private format to official CMSSW EDM format. - const ConverterToTTTrack converter(settings_); -#ifdef OutputHT_TTracks - // Storage for EDM L1 track collection to be produced directly from HT output. - std::unique_ptr htTTTracksForOutput(new TTTrackCollection); - // Storage for EDM L1 track collection to be produced directly from r-z track filter output (if run). - std::unique_ptr rzTTTracksForOutput(new TTTrackCollection); -#endif - // Storage for EDM L1 track collection to be produced from fitted tracks (one for each fit algorithm being used). - // auto_ptr cant be stored in std containers, so use C one, together with map noting which element corresponds to which algorithm. + const ConverterToTTTrack converter(&settings_); + + // Pointers to TTTrack collections for ED output. + auto htTTTracksForOutput = std::make_unique(); + auto rzTTTracksForOutput = std::make_unique(); const unsigned int nFitAlgs = trackFitters_.size(); - std::unique_ptr allFitTTTracksForOutput[nFitAlgs]; - map locationInsideArray; - unsigned int ialg = 0; + map> allFitTTTracksForOutput; for (const string& fitterName : trackFitters_) { - std::unique_ptr fitTTTracksForOutput(new TTTrackCollection); - allFitTTTracksForOutput[ialg] = std::move(fitTTTracksForOutput); - locationInsideArray[fitterName] = ialg++; + auto fitTTTracksForOutput = std::make_unique(); + allFitTTTracksForOutput[fitterName] = std::move(fitTTTracksForOutput); } //=== Do tracking in the r-phi Hough transform within each sector. // Fill Hough-Transform arrays with stubs. - for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { - for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { - Sector& sector = mSectors(iPhiSec, iEtaReg); - HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); - + for (unsigned int iPhiSec = 0; iPhiSec < settings_.numPhiSectors(); iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < settings_.numEtaRegions(); iEtaReg++) { // Initialize constants for this sector. - sector.init(settings_, iPhiSec, iEtaReg); - htRphi.init(settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), sector.phiCentre()); + mSectors(iPhiSec, iEtaReg) = std::make_unique(&settings_, iPhiSec, iEtaReg); + Sector* sector = mSectors(iPhiSec, iEtaReg).get(); + + mHtRphis(iPhiSec, iEtaReg) = std::make_unique( + &settings_, iPhiSec, iEtaReg, sector->etaMin(), sector->etaMax(), sector->phiCentre(), &htRphiErrMon_); + HTrphi* htRphi = mHtRphis(iPhiSec, iEtaReg).get(); // Check sector is enabled (always true, except if user disabled some for special studies). - if (settings_->isHTRPhiEtaRegWhitelisted(iEtaReg)) { - for (const Stub* stub : vStubs) { + if (settings_.isHTRPhiEtaRegWhitelisted(iEtaReg)) { + for (Stub* stub : vStubs) { // Digitize stub as would be at input to GP. This doesn't need the nonant number, since we assumed an integer number of // phi digitisation bins inside an nonant. N.B. This changes the coordinates & bend stored in the stub. - // The cast allows us to ignore the "const". - if (settings_->enableDigitize()) - (const_cast(stub))->digitizeForGPinput(iPhiSec); + + if (settings_.enableDigitize()) + stub->digitize(iPhiSec, Stub::DigiStage::GP); // Check if stub is inside this sector - bool inside = sector.inside(stub); + bool inside = sector->inside(stub); if (inside) { // Check which eta subsectors within the sector the stub is compatible with (if subsectors being used). - const vector inEtaSubSecs = sector.insideEtaSubSecs(stub); + const vector inEtaSubSecs = sector->insideEtaSubSecs(stub); // Digitize stub if as would be at input to HT, which slightly degrades its coord. & bend resolution, affecting the HT performance. - if (settings_->enableDigitize()) - (const_cast(stub))->digitizeForHTinput(iPhiSec); + if (settings_.enableDigitize()) + stub->digitize(iPhiSec, Stub::DigiStage::HT); // Store stub in Hough transform array for this sector, indicating its compatibility with eta subsectors with sector. - htRphi.store(stub, inEtaSubSecs); + htRphi->store(stub, inEtaSubSecs); } } } // Find tracks in r-phi HT array. - htRphi.end(); // Calls htArrayRphi_.end() -> HTBase::end() + htRphi->end(); // Calls htArrayRphi_.end() -> HTBase::end() } } - if (settings_->muxOutputsHT() > 0) { + if (settings_.muxOutputsHT() > 0) { // Multiplex outputs of several HT onto one pair of output opto-links. // This only affects tracking performance if option busySectorKill is enabled, so that tracks that // can't be sent down the link within the time-multiplexed period are killed. - MuxHToutputs muxHT(settings_); + MuxHToutputs muxHT(&settings_); muxHT.exec(mHtRphis); } // Optionally, run 2nd stage mini HT -- WITHOUT TRUNCATION ??? - if (settings_->miniHTstage()) { - MiniHTstage miniHTstage(settings_); + if (settings_.miniHTstage()) { + MiniHTstage miniHTstage(&settings_); miniHTstage.exec(mHtRphis); } //=== Make 3D tracks, optionally running r-z track filters (such as Seed Filter) & duplicate track removal. - for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { - for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { - const Sector& sector = mSectors(iPhiSec, iEtaReg); + for (unsigned int iPhiSec = 0; iPhiSec < settings_.numPhiSectors(); iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < settings_.numEtaRegions(); iEtaReg++) { + const Sector* sector = mSectors(iPhiSec, iEtaReg).get(); // Get tracks found by r-phi HT. - const HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); - const vector& vecTracksRphi = htRphi.trackCands2D(); + const HTrphi* htRphi = mHtRphis(iPhiSec, iEtaReg).get(); + const list& vecTracksRphi = htRphi->trackCands2D(); - Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); // Initialize utility for making 3D tracks from 2D ones. - get3Dtrk.init(settings_, iPhiSec, iEtaReg, sector.etaMin(), sector.etaMax(), sector.phiCentre()); + mMake3Dtrks(iPhiSec, iEtaReg) = std::make_unique( + &settings_, iPhiSec, iEtaReg, sector->etaMin(), sector->etaMax(), sector->phiCentre()); + Make3Dtracks* make3Dtrk = mMake3Dtrks(iPhiSec, iEtaReg).get(); // Convert 2D tracks found by HT to 3D tracks (optionally by running r-z filters & duplicate track removal) - get3Dtrk.run(vecTracksRphi); - -#ifdef OutputHT_TTracks - // Convert these tracks to EDM format for output (used for collaborative work outside TMTT group). - // Do this for tracks output by HT & optionally also for those output by r-z track filter. - const vector& vecTrk3D_ht = get3Dtrk.trackCands3D(false); - for (const L1track3D& trk : vecTrk3D_ht) { - TTTrack htTTTrack = converter.makeTTTrack(trk, iPhiSec, iEtaReg); - htTTTracksForOutput->push_back(htTTTrack); - } + make3Dtrk->run(vecTracksRphi); + + if (settings_.enableOutputIntermediateTTTracks()) { + // Convert these tracks to EDM format for output (used for collaborative work outside TMTT group). + // Do this for tracks output by HT & optionally also for those output by r-z track filter. + const list& vecTrk3D_ht = make3Dtrk->trackCands3D(false); + for (const L1track3D& trk : vecTrk3D_ht) { + TTTrack htTTTrack = converter.makeTTTrack(&trk, iPhiSec, iEtaReg); + htTTTracksForOutput->push_back(htTTTrack); + } - if (runRZfilter_) { - const vector& vecTrk3D_rz = get3Dtrk.trackCands3D(true); - for (const L1track3D& trk : vecTrk3D_rz) { - TTTrack rzTTTrack = converter.makeTTTrack(trk, iPhiSec, iEtaReg); - rzTTTracksForOutput->push_back(rzTTTrack); + if (runRZfilter_) { + const list& vecTrk3D_rz = make3Dtrk->trackCands3D(true); + for (const L1track3D& trk : vecTrk3D_rz) { + TTTrack rzTTTrack = converter.makeTTTrack(&trk, iPhiSec, iEtaReg); + rzTTTracksForOutput->push_back(rzTTTrack); + } } } -#endif } } - // Initialize the duplicate track removal algorithm that can optionally be run after the track fit. - KillDupFitTrks killDupFitTrks; - killDupFitTrks.init(settings_, settings_->dupTrkAlgFit()); - //=== Do a helix fit to all the track candidates. - map> fittedTracks; - // Initialize with empty vector in case no fitted tracks found. - for (const string& fitterName : trackFitters_) { // Loop over fit algos. - fittedTracks[fitterName] = vector(); - } - - for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { - for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { - const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); + // Loop over all the fitting algorithms we are trying. + for (const string& fitterName : trackFitters_) { + for (unsigned int iPhiSec = 0; iPhiSec < settings_.numPhiSectors(); iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < settings_.numEtaRegions(); iEtaReg++) { + const Make3Dtracks* make3Dtrk = mMake3Dtrks(iPhiSec, iEtaReg).get(); - // Loop over all the fitting algorithms we are trying. - for (const string& fitterName : trackFitters_) { // Does this fitter require r-z track filter to be run before it? bool useRZfilt = (std::count(useRZfilter_.begin(), useRZfilter_.end(), fitterName) > 0); // Get 3D track candidates found by Hough transform (plus optional r-z filters/duplicate removal) in this sector. - const vector& vecTrk3D = get3Dtrk.trackCands3D(useRZfilt); + const list& vecTrk3D = make3Dtrk->trackCands3D(useRZfilt); + + // Find list where fitted tracks will be stored. + list& fitTrksInSec = mapmFitTrks(iPhiSec, iEtaReg)[fitterName]; // Fit all tracks in this sector - vector fittedTracksInSec; for (const L1track3D& trk : vecTrk3D) { - // IRT - //bool OK = (trk.getMatchedTP() != nullptr && trk.getMatchedTP()->pt() > 50 && fabs(trk.getMatchedTP()->eta()) > 1.4 && fabs(trk.getMatchedTP()->eta()) < 1.8); - //if (trk.getNumStubs() != trk.getNumLayers()) OK = false; - //if (not OK) continue; - // Ensure stubs assigned to this track is digitized with respect to the phi sector the track is in. - if (settings_->enableDigitize()) { - const vector& stubsOnTrk = trk.getStubs(); - for (const Stub* s : stubsOnTrk) { - (const_cast(s))->digitizeForHTinput(iPhiSec); + if (settings_.enableDigitize()) { + const vector& stubsOnTrk = trk.stubs(); + for (Stub* s : stubsOnTrk) { // Also digitize stub in way this specific track fitter uses it. - (const_cast(s))->digitizeForSForTFinput(fitterName); + s->digitize(iPhiSec, Stub::DigiStage::TF); } } - L1fittedTrack fitTrack = fitterWorkerMap_[fitterName]->fit(trk); + L1fittedTrack fitTrk = fitterWorkerMap_[fitterName]->fit(trk); - if (fitTrack.accepted()) { // If fitter accepted track, then store it. + if (fitTrk.accepted()) { // If fitter accepted track, then store it. // Optionally digitize fitted track, degrading slightly resolution. - if (settings_->enableDigitize()) - fitTrack.digitizeTrack(fitterName); + if (settings_.enableDigitize()) + fitTrk.digitizeTrack(fitterName); // Store fitted tracks, such that there is one fittedTracks corresponding to each HT tracks. - // N.B. Tracks rejected by the fit are also stored, but marked. - fittedTracksInSec.push_back(fitTrack); + fitTrksInSec.push_back(fitTrk); } } + } + } + } - // Run duplicate track removal on the fitted tracks if requested. - const vector filtFittedTracksInSec = killDupFitTrks.filter(fittedTracksInSec); + // Run duplicate track removal on the fitted tracks if requested. - // Store fitted tracks from entire tracker. - for (const L1fittedTrack& fitTrk : filtFittedTracksInSec) { - fittedTracks[fitterName].push_back(fitTrk); + // Initialize the duplicate track removal algorithm that can optionally be run after the track fit. + DupFitTrkKiller killDupFitTrks(&settings_); + + // Loop over all the fitting algorithms we used. + for (const string& fitterName : trackFitters_) { + for (unsigned int iPhiSec = 0; iPhiSec < settings_.numPhiSectors(); iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < settings_.numEtaRegions(); iEtaReg++) { + // Get fitted tracks in sector + const list& fitTrksInSec = mapmFitTrks(iPhiSec, iEtaReg)[fitterName]; + + // Run duplicate removal + list filteredFitTrksInSec = killDupFitTrks.filter(fitTrksInSec); + + // Prepare TTTrack collection. + for (const L1fittedTrack* fitTrk : filteredFitTrksInSec) { // Convert these fitted tracks to EDM format for output (used for collaborative work outside TMTT group). TTTrack fitTTTrack = converter.makeTTTrack(fitTrk, iPhiSec, iEtaReg); - allFitTTTracksForOutput[locationInsideArray[fitterName]]->push_back(fitTTTrack); + allFitTTTracksForOutput[fitterName]->push_back(fitTTTrack); } + + // Store fitted tracks from entire tracker. + mapFinalTracks[fitterName].insert( + mapFinalTracks[fitterName].end(), filteredFitTrksInSec.begin(), filteredFitTrksInSec.end()); } } } // Debug printout - unsigned int static nEvents = 0; - nEvents++; - if (settings_->debug() >= 1 && nEvents <= 1000) { - cout << "INPUT #TPs = " << vTPs.size() << " #STUBs = " << vStubs.size() << endl; + if (debug_) { + PrintL1trk() << "INPUT #TPs = " << vTPs.size() << " #STUBs = " << vStubs.size(); unsigned int numHTtracks = 0; - for (unsigned int iPhiSec = 0; iPhiSec < settings_->numPhiSectors(); iPhiSec++) { - for (unsigned int iEtaReg = 0; iEtaReg < settings_->numEtaRegions(); iEtaReg++) { - const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); - numHTtracks += get3Dtrk.trackCands3D(false).size(); + for (unsigned int iPhiSec = 0; iPhiSec < settings_.numPhiSectors(); iPhiSec++) { + for (unsigned int iEtaReg = 0; iEtaReg < settings_.numEtaRegions(); iEtaReg++) { + const Make3Dtracks* make3Dtrk = mMake3Dtrks(iPhiSec, iEtaReg).get(); + numHTtracks += make3Dtrk->trackCands3D(false).size(); } } - cout << "Number of tracks after HT = " << numHTtracks << endl; - for (const auto& p : fittedTracks) { + PrintL1trk() << "Number of tracks after HT = " << numHTtracks; + for (const auto p : mapFinalTracks) { const string& fitName = p.first; - const vector& fittedTracks = p.second; - cout << "Number of tracks after " << fitName << " track helix fit = " << fittedTracks.size() << endl; + const list fittedTracks = p.second; + PrintL1trk() << "Number of tracks after " << fitName << " track helix fit = " << fittedTracks.size(); } } // Allow histogramming to plot undigitized variables. - for (const Stub* stub : vStubs) { - if (settings_->enableDigitize()) - (const_cast(stub))->setDigitizeWarningsOn(false); + for (Stub* stub : vStubs) { + if (settings_.enableDigitize()) + stub->setDigitizeWarningsOn(false); } // Fill histograms to monitor input data & tracking performance. - hists_->fill(inputData, mSectors, mHtRphis, mGet3Dtrks, fittedTracks); + hists_.fill(inputData, mSectors, mHtRphis, mMake3Dtrks, mapFinalTracks); //=== Store output EDM track and hardware stub collections. -#ifdef OutputHT_TTracks - iEvent.put(std::move(htTTTracksForOutput), "TML1TracksHT"); - if (runRZfilter_) - iEvent.put(std::move(rzTTTracksForOutput), "TML1TracksRZ"); -#endif + if (settings_.enableOutputIntermediateTTTracks()) { + iEvent.put(std::move(htTTTracksForOutput), "TML1TracksHT"); + if (runRZfilter_) + iEvent.put(std::move(rzTTTracksForOutput), "TML1TracksRZ"); + } for (const string& fitterName : trackFitters_) { string edmName = string("TML1Tracks") + fitterName; - iEvent.put(std::move(allFitTTTracksForOutput[locationInsideArray[fitterName]]), edmName); + iEvent.put(std::move(allFitTTTracksForOutput[fitterName]), edmName); } } - void TMTrackProducer::endJob() { - // Print stub window sizes that TMTT recommends CMS uses in FE chips. - if (settings_->printStubWindows()) - StubWindowSuggest::printResults(); + void TMTrackProducer::globalEndJob(GlobalCacheTMTT* globalCacheTMTT) { + const Settings& settings = globalCacheTMTT->settings(); - // Optional debug printout from track fitters at end of job. - for (const string& fitterName : trackFitters_) { - fitterWorkerMap_[fitterName]->endJob(); - } + // Print stub window sizes that TMTT recommends CMS uses in FE chips. + if (settings.printStubWindows()) + globalCacheTMTT->stubWindowSuggest().printResults(); - // Print job summary - hists_->trackerGeometryAnalysis(trackerGeometryInfo_); - hists_->endJobAnalysis(); + // Print (once) info about tracker geometry. + globalCacheTMTT->hists().trackerGeometryAnalysis(globalCacheTMTT->listTrackerModule()); - for (const string& fitterName : trackFitters_) { - //cout << "# of duplicated stubs = " << fitterWorkerMap_[fitterName]->nDupStubs() << endl; - delete fitterWorkerMap_[string(fitterName)]; - } + PrintL1trk() << "\n Number of (eta,phi) sectors used = (" << settings.numEtaRegions() << "," + << settings.numPhiSectors() << ")"; - cout << endl - << "Number of (eta,phi) sectors used = (" << settings_->numEtaRegions() << "," << settings_->numPhiSectors() - << ")" << endl; + // Print job summary + globalCacheTMTT->hists().endJobAnalysis(&(globalCacheTMTT->htRphiErrMon())); } - DEFINE_FWK_MODULE(TMTrackProducer); - } // namespace tmtt + +DEFINE_FWK_MODULE(tmtt::TMTrackProducer); diff --git a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h index d9c9927b9e3cb..9e3aa6bc3f9d8 100644 --- a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h +++ b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h @@ -1,59 +1,83 @@ #ifndef L1Trigger_TrackFindingTMTT_TMTrackProducer_h #define L1Trigger_TrackFindingTMTT_TMTrackProducer_h -#include "FWCore/Framework/interface/EDProducer.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/Histos.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" +#include "L1Trigger/TrackFindingTMTT/interface/TrackerModule.h" +#include "L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h" +#include "L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h" + +#include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" #include "DataFormats/L1TrackTrigger/interface/TTTypes.h" #include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h" #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h" #include "SimTracker/TrackTriggerAssociation/interface/TTClusterAssociationMap.h" #include "SimTracker/TrackTriggerAssociation/interface/TTStubAssociationMap.h" -#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" -#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" -#include "L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" +#include "MagneticField/Engine/interface/MagneticField.h" +#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" #include -#include +#include #include - -using namespace std; +#include namespace tmtt { - class Settings; - class Histos; class TrackFitGeneric; - class TMTrackProducer : public edm::EDProducer { + class TMTrackProducer : public edm::stream::EDProducer> { public: - explicit TMTrackProducer(const edm::ParameterSet &); + explicit TMTrackProducer(const edm::ParameterSet &, GlobalCacheTMTT const *globalCacheTMTT); ~TMTrackProducer() {} + static std::unique_ptr initializeGlobalCache(edm::ParameterSet const &iConfig); + + static void globalEndJob(GlobalCacheTMTT *globalCacheTMTT); + private: - typedef std::vector > TTTrackCollection; + typedef std::vector> TTTrackCollection; virtual void beginRun(const edm::Run &, const edm::EventSetup &); + virtual void produce(edm::Event &, const edm::EventSetup &); - virtual void endJob(); private: - edm::EDGetTokenT stubInputTag; - edm::EDGetTokenT tpInputTag; - edm::EDGetTokenT stubTruthInputTag; - edm::EDGetTokenT clusterTruthInputTag; - edm::EDGetTokenT genJetInputTag_; + bool debug_; + + // ES tokens + edm::ESGetToken magneticFieldToken_; + edm::ESGetToken trackerGeometryToken_; + edm::ESGetToken trackerTopologyToken_; + // ED tokens + edm::EDGetTokenT stubToken_; + edm::EDGetTokenT tpToken_; + edm::EDGetTokenT stubTruthToken_; + edm::EDGetTokenT clusterTruthToken_; + edm::EDGetTokenT genJetToken_; + + // Info about tracker geometry + const TrackerGeometry *trackerGeometry_; + const TrackerTopology *trackerTopology_; + std::list listTrackerModule_; // Configuration parameters - Settings *settings_; - vector trackFitters_; - vector useRZfilter_; + Settings settings_; + std::vector trackFitters_; + std::vector useRZfilter_; bool runRZfilter_; - Histos *hists_; - map fitterWorkerMap_; + Histos &hists_; + HTrphi::ErrorMonitor &htRphiErrMon_; + StubWindowSuggest &stubWindowSuggest_; - TrackerGeometryInfo trackerGeometryInfo_; + std::map> fitterWorkerMap_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py index 15097a143b3f5..e1dce6df2721a 100644 --- a/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py +++ b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py @@ -9,16 +9,25 @@ TMTrackProducer_params = cms.PSet( + # Tags for ES products + magneticFieldInputTag = cms.ESInputTag( "VolumeBasedMagneticFieldESProducer", "" ), + trackerGeometryInputTag = cms.ESInputTag( "trackerGeometry", "" ), + trackerTopologyInputTag = cms.ESInputTag( "trackerTopology", "" ), + + # Tags for ED products tpInputTag = cms.InputTag("mix", "MergedTrackTruth"), stubInputTag = cms.InputTag("TTStubsFromPhase2TrackerDigis", "StubAccepted"), stubTruthInputTag = cms.InputTag("TTStubAssociatorFromPixelDigis", "StubAccepted"), clusterTruthInputTag = cms.InputTag("TTClusterAssociatorFromPixelDigis", "ClusterAccepted"), genJetInputTag = cms.InputTag("ak4GenJets", ""), + # Enable output of TTTracks from part-way through tracking chain (after HT & RZ). + EnableOutputIntermediateTTTracks = cms.bool(False), + # Enable all use of MC truth info (disable to save CPU) - EnableMCtruth = cms.bool(True), + EnableMCtruth = cms.bool(False), # Enable output histograms & job tracking performance summary (disable to save CPU) - EnableHistos = cms.bool(True), + EnableHistos = cms.bool(False), #=== Cuts on MC truth particles (i.e., tracking particles) used for tracking efficiency measurements. @@ -31,9 +40,7 @@ GenMaxZ0 = cms.double(999.0), # Max transverse impact parameter. GenPdgIds = cms.vuint32(), # Only particles with these PDG codes used for efficiency measurement. - # Additional cut on MC truth tracks used for algorithmic tracking efficiency measurements. - # You should usually set this equal to value of L1TrackDef.MinStubLayers below, unless L1TrackDef.MinPtToReduceLayers - # is < 10000, in which case, set it equal to (L1TrackDef.MinStubLayers - 1). + # Cut on MC truth tracks used for algorithmic tracking efficiency measurements. GenMinStubLayers = cms.uint32(4) ), @@ -47,16 +54,16 @@ MaxStubEta = cms.double(2.4), # Don't use stubs whose measured Pt from bend info is significantly below HTArraySpec.HoughMinPt, where "significantly" means allowing for resolution in q/Pt derived from stub bend resolution specified below. KillLowPtStubs = cms.bool(True), - # Print stub windows corresponding to KillLowPtStubs, in python cfg format used by CMSSW. + # Print FE stub window sizes recommended by this code (in python cfg format used by CMSSW). PrintStubWindows = cms.bool(False), # Bend resolution assumed by bend filter in units of strip pitch. Also used when assigning stubs to sectors if EtaPhiSectors.CalcPhiTrkRes=True. And by the bend filter if HTFillingRphi.UseBendFilter=True. # Suggested value: 1.19 if DegradeBendRes = 0, or 1.249 if it > 0. # N.B. Avoid 1/4-integer values due to rounding error issues. - BendResolution = cms.double(1.249), + BendCut = cms.double(1.249), # Additional contribution to bend resolution from its encoding into a reduced number of bits. # This number is the assumed resolution relative to the naive guess of its value. # It is ignored in DegradeBendRes = 0. - BendResolutionExtra = cms.double(0.0), + BendCutExtra = cms.double(0.0), # Order stubs by bend in DTC, such that highest Pt stubs are transmitted first. OrderStubsByBend = cms.bool(True) ), @@ -72,17 +79,29 @@ PhiSBits = cms.uint32(14), # Bits used to store phiS coord. (13 enough?) PhiSRange = cms.double(0.698131700), # Range phiS coord. covers in radians. RtBits = cms.uint32(12), # Bits used to store Rt coord. - RtRange = cms.double(91.652837), # Range Rt coord. covers in units of cm. + RtRange = cms.double(91.652837), # Range Rt coord. covers in units of cm. ZBits = cms.uint32(14), # Bits used to store z coord. - ZRange = cms.double(733.2227), # Range z coord. covers in units of cm. + ZRange = cms.double(733.2227), # Range z coord. covers in units of cm. # #--- Parameters available in GP board (excluding any in common with MP specified above). # - PhiOBits = cms.uint32(15), # Bits used to store PhiO parameter. - PhiORange = cms.double(1.3962634), # Range PhiO parameter covers. + PhiNBits = cms.uint32(15), # Bits used to store PhiO parameter. + PhiNRange = cms.double(1.3962634), # Range PhiO parameter covers. BendBits = cms.uint32(6) # Bits used to store stub bend. ), + #=== Configuration of tracker module type. Only provides test data for firmware. + + TrackerModuleType = cms.PSet( + # Modules matching these criteria are type 0, 1, 2, 3 ... + PitchVsType = cms.vdouble(0.0099, 0.0099, 0.0099, 0.0099, 0.0089, 0.0099, 0.0089, 0.0089), + SpaceVsType = cms.vdouble(0.26 , 0.26 , 0.16 , 0.4 , 0.18 , 0.4 , 0.18 , 0.4 ), + # (Type vbool not implemented, so use vuint32 instead ...) + BarrelVsType = cms.vuint32( 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 ), + PSVsType = cms.vuint32( 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 ), + TiltedVsType = cms.vuint32( 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 ) + ), + #=== Configuration of Geometric Processor. GeometricProc = cms.PSet( @@ -103,8 +122,7 @@ UseStubPhi = cms.bool(True), # Require stub phi to be consistent with track of Pt > HTArraySpec.HoughMinPt that crosses HT phi axis? UseStubPhiTrk = cms.bool(True), # Require stub phi0 (or phi65 etc.) as estimated from stub bend, to lie within HT phi axis, allowing tolerance(s) specified below? AssumedPhiTrkRes = cms.double(0.5), # Tolerance in stub phi0 (or phi65) assumed to be this fraction of phi sector width. (N.B. If > 0.5, then stubs can be shared by more than 2 phi sectors). - CalcPhiTrkRes = cms.bool(True), # If true, tolerance in stub phi0 (or phi65 etc.) will be reduced below AssumedPhiTrkRes if stub bend resolution specified in StubCuts.BendResolution suggests it is safe to do so. - HandleStripsPhiSec = cms.bool(False) # If True, adjust algorithm to allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when assigning stubs to phi sectors. + CalcPhiTrkRes = cms.bool(True) # If true, tolerance in stub phi0 (or phi65 etc.) will be reduced below AssumedPhiTrkRes if stub bend resolution specified in StubCuts.BendCut suggests it is safe to do so. ), #=== Division of Tracker into eta sectors @@ -116,7 +134,6 @@ EtaRegions = cms.vdouble(-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), ChosenRofZ = cms.double(50.), # 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! BeamWindowZ = cms.double(15), # Half-width of window assumed to contain beam-spot in z. - HandleStripsEtaSec = cms.bool(False), # If True, adjust algorithm to allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when assigning stubs to eta sectors. AllowOver2EtaSecs = cms.bool(True) # If True, the code will not throw an error if a stub is assigned to 3 or more eta sectors. ), @@ -125,9 +142,8 @@ HTArraySpecRphi = cms.PSet( HoughMinPt = cms.double(3.0), # Min track Pt that Hough Transform must find. Also used by StubCuts.KillLowPtStubs and by EtaPhiSectors.UseStubPhi. # If MiniHTstage = True, these refers to mini cells in whole HT array. - HoughNbinsPt = cms.uint32(32), # HT array dimension in track q/Pt. Ignored if HoughNcellsRphi > 0. (If MiniHTstage = True, this refers to mini cells in whole HT array). - HoughNbinsPhi = cms.uint32(64), # HT array dimension in track phi0 (or phi65 or any other track phi angle. Ignored if HoughNcellsRphi > 0. (If MiniHTstage = True, this refers to mini cells in whole HT array). - HoughNcellsRphi = cms.int32(-1), # If > 0, then parameters HoughNbinsPt and HoughNbinsPhi will be calculated from the constraints that their product should equal HoughNcellsRphi and their ratio should make the maximum |gradient|" of stub lines in the HT array equal to 1. If <= 0, then HoughNbinsPt and HoughNbinsPhi will be taken from the values configured above. + HoughNbinsPt = cms.uint32(32), # HT array dimension in track q/Pt. (If MiniHTstage = True, this refers to mini cells in whole HT array). + HoughNbinsPhi = cms.uint32(64), # HT array dimension in track phi0 (or phi65 or any other track phi angle. (If MiniHTstage = True, this refers to mini cells in whole HT array). EnableMerge2x2 = cms.bool(False), # Groups of neighbouring 2x2 cells in HT will be treated as if they are a single large cell? N.B. You can only enable this option if your HT array has even numbers of bins in both dimensions. And this cfg param ignored if MiniHTstage = True. HISTORIC OPTION. SUGGEST NOT USING! MaxPtToMerge2x2 = cms.double(3.5), # but only cells with pt < MaxPtToMerge2x2 will be merged in this way (irrelevant if EnableMerge2x2 = false). NumSubSecsEta = cms.uint32(2), # Subdivide each sector into this number of subsectors in eta within r-phi HT. @@ -144,19 +160,17 @@ #=== Rules governing how stubs are filled into the r-phi Hough Transform array. HTFillingRphi = cms.PSet( - # If True, adjust algorithm to allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when filling r-phi HT with stubs. - HandleStripsRphiHT = cms.bool(False), # Take all cells in r-phi HT array crossed by line corresponding to each stub (= 0) or take only some to reduce rate at cost # of efficiency ( > 0). If this option is > 0, it can be 1 or 2, corresponding to different algorithms for rejecting # some of the cells. "1" is an algorithm invented by Ian, whereas "2" corresponds to Thomas' 1st firmware implementation which only handled 1 cell per HT column. # Suggest setting KillSomeHTCellsRphi=1 (=0) if HTArraySpec.ChosenRofPhi=0 (>0) KillSomeHTCellsRphi = cms.uint32(0), # Use filter in each r-phi HT cell, filling it only with stubs that have consistent bend information? - # The assumed bend resolution is specified in StubCuts.BendResolution. + # The assumed bend resolution is specified in StubCuts.BendCut. UseBendFilter = cms.bool(True), # Use filter in each HT cell, preventing more than the specified number of stubs being stored in the cell. (Reflecting memory limit of hardware). N.B. Results depend on assumed order of stubs. # N.B. If mini-HT is in use, then this cut applies to coarse-HT. - #MaxStubsInCell = cms.uint32(99999), # Setting this to anything more than 99 disables this option + #MaxStubsInCell = cms.uint32(99999), # Setting this to anything more than 999 disables this option MaxStubsInCell = cms.uint32(32), # set it equal to value used in hardware. MaxStubsInCellMiniHough = cms.uint32(16), # Same type of cut for mini-HT (if in use) # If BusySectorKill = True, and more than BusySectorNumStubs stubs are assigned to tracks by an r-phi HT array, then the excess tracks are killed, with lowest Pt ones killed first. This is because HT hardware has finite readout time. @@ -179,9 +193,8 @@ BusyInputSectorKill = cms.bool(True), BusyInputSectorNumStubs = cms.uint32(162), # Or 144 if only 320 MHz FW # Multiplex the outputs from several HTs onto a single pair of output optical links? - # Options: 0 = disable Mux; 1 = Dec. 2016 Mux; 2 = Mar 2018 Mux (for transverse HT readout by m-bin). - # (The mux algorithm is hard-wired in class MuxHToutputs, and currently only works if option BusySectorMbinRanges is being used); 3 = Sept 2019 Mux (transerse HT readout by m-bin), with single m bin in entire nonant going to each link. - MuxOutputsHT = cms.uint32(3), + # Options: 0 = disable Mux; 1 = Sept 2019 Mux (transerse HT readout by m-bin), with single m bin in entire nonant going to each link. + MuxOutputsHT = cms.uint32(1), # If this is non-empty, then only the specified eta sectors are enabled, to study them individually. EtaRegWhitelist = cms.vuint32() ), @@ -193,8 +206,8 @@ # Specify preferred r-z filter (from those available inside TrkRZfilter.cc) - currently only "SeedFilter". RZFilterName = cms.string("SeedFilter"), #--- Options relevant for Seed filter, (so only relevant if rzFilterName="SeedFilter"). - # Added resolution beyond that estimated from hit resolution. - SeedResolution = cms.double(0.), + # Cut at this many standard deviations on seed resolution. + SeedResCut = cms.double(1.732), # Store stubs compatible with all possible good seed. KeepAllSeed = cms.bool(False), # Maximum number of seed combinations to bother checking per track candidate. @@ -217,8 +230,8 @@ # Min. number of layers the track must have stubs in. MinStubLayers = cms.uint32(5), # Change min. number of layers cut to (MinStubLayers - 1) for tracks with Pt exceeding this cut. - # If this is set to > 10000 , this option is disabled. - MinPtToReduceLayers = cms.double(99999.), + # If this is set to a -ve number, this option is disabled. + MinPtToReduceLayers = cms.double(-99999.), # Change min. number of layers cut to (MinStubLayers - 1) for tracks in these rapidity sectors. # (Histogram "AlgEffVsEtaSec" will help you identify which sectors to declare). #EtaSecsReduceLayers = cms.vuint32(), @@ -232,21 +245,9 @@ #=== Specification of algorithm to eliminate duplicate tracks. DupTrkRemoval = cms.PSet( - #--- Specify which duplicate removal algorithm(s) to run: option 0 means disable duplicate track removal, whilst > 0 runs a specific algorithm (options 8 & 25 are only ones implemented). - # Algorithm used for duplicate removal of 2D tracks produced by r-phi HT. Assumed to run before tracks are output from HT board. - DupTrkAlgRphi = cms.uint32(0), - #DupTrkAlgRphi = cms.uint32(25), - # Algorithm run on all 3D tracks within each sector after r-z track filter. - # (Ignored if no r-z track filter is run). - DupTrkAlg3D = cms.uint32(0), - #DupTrkAlg3D = cms.uint32(8), - # Algorithm run on tracks after the track helix fit has been done. (Ian's talk in 26/8/2016 meeting) - # To use it, you must set DupTrkAlgRphi = DupTrkAlg3D = 0. - DupTrkAlgFit = cms.uint32(50), - #--- Options used by individual algorithms. - # Parameter for "inverse" OSU duplicate-removal algorithm - # Specifies minimum number of common stubs in same number of layers to keep smaller candidate in comparison. - DupTrkMinCommonHitsLayers = cms.uint32(5), + # Algorithm run on tracks after the track helix fit has been done. + # (Disable dup removal = 0; two alternative algos = 1 or 2). + DupTrkAlgFit = cms.uint32(1) ), #=== Rules for deciding when a reconstructed L1 track matches a MC truth particle (i.e. tracking particle). @@ -273,13 +274,13 @@ # # Track Fitting algortihms to use. You can run several in parallel. # TrackFitLinearAlgo & ChiSquared* are chi2 fits, KF* is a Kalman filter fit, - # & SimpleLR is a linear regression fit that neglects the hit uncertainties. + # & SimpleLR4 is a linear regression fit that neglects the hit uncertainties. # The number 4 or 5 in the name indicates if 4 or 5 helix parameters are fitted. - # Options KF4ParamsComb, KF5ParamsComb or SimpleLR are the best ones. + # Options KF4ParamsComb, KF5ParamsComb or SimpleLR4 are the best ones. # KF*ParamsCombHLS is the HLS version of the code, which only works if linked with Vivado libraries. TrackFitters = cms.vstring( - # "ChiSquared4ParamsApprox", - # "SimpleLR", + # "ChiSquaredFit4", + # "SimpleLR4", # "KF4ParamsCombHLS", # "KF5ParamsCombHLS", "KF5ParamsComb", @@ -288,8 +289,8 @@ # Indicate subset of fitters wanting r-z track filter to be run before them. (Irrelevant for those not specified in "TrackFitters"). # Typically, Chi2 & LR fits work best with r-z filter & KF works best without it. UseRZfilter = cms.vstring( - "ChiSquared4ParamsApprox", - "SimpleLR" + "ChiSquaredFit4", + "SimpleLR4" ), # Print detailed summary of track fit performance at end of job (as opposed to a brief one). DetailedFitOutput = cms.bool(False), @@ -311,8 +312,6 @@ # # Maximum allowed number of iterations of LR fitter. MaxIterationsLR = cms.uint32( 8 ), - # Internal histograms are filled if it is True - LRFillInternalHists = cms.bool(False), # If False: residual of a stub is the max of its r-phi & r-z residuals. # If True: the residual is the mean of these residuals. CombineResiduals = cms.bool( True ), @@ -335,7 +334,7 @@ #--- Additional options for Davide Cieri's Simple Linear Regression track fitter --- # # Digitize Simple Linear Regression variables and calculation. (Disabled if EnableDigitize=False). - DigitizeSLR = cms.bool(True), + DigitizeSLR = cms.bool(False), # Disable, as was never retuned for nonants # Number of bits to be used in hardware to compute the division needed to calculate the helix params DividerBitsHelix = cms.uint32(23), DividerBitsHelixZ = cms.uint32(23), @@ -352,7 +351,7 @@ # Number of bits to reduce the z0 parameter calculation weight ShiftingBitsZ0 = cms.uint32(16), # Fit ChiSquare Cut (tightening reduces fake track rate at cost of efficiency) - SLR_chi2cut = cms.double(100.), + SLR_chi2cut = cms.double(300.), # Cut on Rphi Residuals (radians) - stubs killed until only 4 left or all have residuals below this cut. ResidualCut = cms.double(0.0), #ResidualCut = cms.double(0.0005), # This allows more than 4 stubs per track. @@ -361,13 +360,11 @@ # # Larger number has more debug printout. "1" is useful for understanding why tracks are lost, best combined with TrackFitCheat=True. KalmanDebugLevel = cms.uint32(0), - # Internal histograms are filled if it is True - KalmanFillInternalHists = cms.bool(False), # Fit will reject fitted tracks unless it can assign at least this number of stubs to them. KalmanMinNumStubs = cms.uint32(4), # Fit will attempt to add up to this nummber of stubs to each fitted tracks, but won't bother adding more. KalmanMaxNumStubs = cms.uint32(4), - # For 5-param helix fits, calculate also beam-constrained helix params after fit is complete, & use them for duplicate removal if DupTrkAlgFit=50. + # For 5-param helix fits, calculate also beam-constrained helix params after fit is complete, & use them for duplicate removal if DupTrkAlgFit=1. KalmanAddBeamConstr = cms.bool(True), # Remove requirement of at least 2 PS layers per track. KalmanRemove2PScut = cms.bool(False), @@ -392,25 +389,15 @@ KalmanHOalpha = cms.uint32(0), # 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. KalmanHOprojZcorr = cms.uint32(0), - # Use dodgy calculation to account for non-radial endcap 2S modules that was used in Dec. 2016 demonstrator & use no special treatment for tilted modules. - KalmanHOdodgy = cms.bool(True) + # Use approx calc to account for non-radial endcap 2S modules corresponding to current FW, with no special treatment for tilted modules. + KalmanHOfw = cms.bool(True) ), #=== Treatment of dead modules. DeadModuleOpts = cms.PSet( - #--- Either use this private TMTT way of studying dead modules - # In (eta,phi) sectors containing dead modules, reduce the min. number of layers cut on tracks to (MinStubLayers - 1)? - # The sectors affected are hard-wired in DeadModuleDB::defineDeadTrackerRegions(). - DeadReduceLayers = cms.bool( False ), - # Emulate dead modules by killing fraction of stubs given by DeadSimulateFrac in certain layers & angular regions of - # the tracker that are hard-wired in DeadModuleDB::defineDeadSectors(). Disable by setting <= 0. Fully enable by setting to 1. - # Do not use if KillScenario > 0. - DeadSimulateFrac = cms.double(-999.), - # - #--- Or this use communal way developed with Tracklet of studying dead modules # Emulate dead/inefficient modules using the StubKiller code, with stubs killed according to the scenarios of the Stress Test group. - # (0=Don't kill any stubs; 1-5 = Scenarios from https://github.com/EmyrClement/StubKiller/blob/master/README.md). + # (0=Don't kill any stubs; 1-5 = Scenarios described in StubKiller.cc) KillScenario = cms.uint32(0), # Modify TMTT tracking to try to recover tracking efficiency in presence of dead modules. (Does nothing if KillScenario = 0). KillRecover = cms.bool (True) @@ -421,7 +408,7 @@ TrackDigi=cms.PSet( # For firmware reasons, can't use common digitisation cfg for all fitters. - #======= SimpleLR digi parameters ======== + #======= SimpleLR4 digi parameters ======== SLR_skipTrackDigi = cms.bool( False ), # Optionally skip track digitisation if done internally inside fitting code. SLR_oneOver2rBits = cms.uint32(13), SLR_oneOver2rRange = cms.double(0.01354135), @@ -433,8 +420,8 @@ SLR_z0Range = cms.double(51.555509), SLR_tanlambdaBits = cms.uint32(15), SLR_tanlambdaRange = cms.double(32.0), - SLR_chisquaredBits = cms.uint32(8), - SLR_chisquaredRange = cms.double(128.), + SLR_chisquaredBits = cms.uint32(10), + SLR_chisquaredRange = cms.double(512.), #====== Kalman Filter digi parameters ======== KF_skipTrackDigi = cms.bool( False ), # Optionally skip track digitisation if done internally inside fitting code. @@ -462,12 +449,8 @@ Hybrid = cms.bool( False), - #===== Debug printout & plots - Debug = cms.uint32(1), #(0=none, 1=print #tracks/event, 2+ print more info) + #===== Debug plot options # When making helix parameter resolution plots, only use particles from the physics event (True) # or also use particles from pileup (False) ? - ResPlotOpt = cms.bool (True), - # Specify sector for which debug histos for hexagonal HT will be made. - iPhiPlot = cms.uint32(0), - iEtaPlot = cms.uint32(9) + ResPlotOpt = cms.bool (True) ) diff --git a/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Ultimate_cff.py b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Ultimate_cff.py index 82b0b171af04b..03638a3fc59fb 100644 --- a/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Ultimate_cff.py +++ b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Ultimate_cff.py @@ -3,8 +3,8 @@ #--------------------------------------------------------------------------------------------------------- # This describes the full TMTT track reconstruction chain with 2 GeV threshold, where: # the GP divides the tracker into 18 eta sectors (each sub-divided into 2 virtual eta subsectors); -# the HT uses a 32x18 array followed by 2x2 Mini-HT array, with transverese HT readout & multiplexing, -# followed by the KF (or optionally SF+SLR) track fit; duplicate track removal (Algo50) is run. +# the HT uses a 32x24 array followed by 2x2 Mini-HT array, with transverese HT readout & multiplexing, +# followed by the track fit (KF); duplicate track removal (Algo1) is run. # # It represents the tracking as planned for 2026. It is a good basis for L1 trigger studies etc. #--------------------------------------------------------------------------------------------------------- @@ -13,18 +13,18 @@ from L1Trigger.TrackFindingTMTT.TMTrackProducer_Defaults_cfi import TMTrackProducer_params -TMTrackProducer = cms.EDProducer('TMTrackProducer', +TMTrackProducer = cms.EDProducer('tmtt::TMTrackProducer', # Load cfg parameters from TMTrackProducer_Defaults_cfi.py TMTrackProducer_params ) #=================================================================================================== -# Uncomment the following 2 lines to disable all use of MC truth info & all output histograms. -# THIS SAVES CPU, SO IS GOOD IDEA IF YOU ONLY CARE ABOUT PRODUCING TTTrack COLLECTION! +# Uncomment the following 2 lines to enable use of MC truth info & output histograms. +# (This costs CPU, and is unnecessary if you only care about producing TTTrack collection). #=================================================================================================== -#TMTrackProducer.EnableMCtruth = cms.bool(False) -#TMTrackProducer.EnableHistos = cms.bool(False) +#TMTrackProducer.EnableMCtruth = True +#TMTrackProducer.EnableHistos = True #=================================================================================================== #=== The following override the default values. @@ -33,38 +33,35 @@ #--- Configure track fitter(s). # Use only 4 parameter helix fit Kalman Filter. -TMTrackProducer.TrackFitSettings.TrackFitters = cms.vstring("KF4ParamsComb") +TMTrackProducer.TrackFitSettings.TrackFitters = ["KF4ParamsComb"] # Allow KF to assign stubs in up to this many layers to fitted tracks. -TMTrackProducer.TrackFitSettings.KalmanMaxNumStubs = cms.uint32(6) +TMTrackProducer.TrackFitSettings.KalmanMaxNumStubs = 6 # Enable more sophisticated fit mathematics in KF. -TMTrackProducer.TrackFitSettings.KalmanHOtilted = cms.bool(True) -TMTrackProducer.TrackFitSettings.KalmanHOhelixExp = cms.bool(True) -TMTrackProducer.TrackFitSettings.KalmanHOalpha = cms.uint32(1) -TMTrackProducer.TrackFitSettings.KalmanHOprojZcorr = cms.uint32(1) -TMTrackProducer.TrackFitSettings.KalmanHOdodgy = cms.bool(False) - -# Disable internal digitisation of SimpleLR fitter, as was never retuned for nonants. -TMTrackProducer.TrackFitSettings.DigitizeSLR = cms.bool(False) +TMTrackProducer.TrackFitSettings.KalmanHOtilted = True +TMTrackProducer.TrackFitSettings.KalmanHOhelixExp = True +TMTrackProducer.TrackFitSettings.KalmanHOalpha = 1 +TMTrackProducer.TrackFitSettings.KalmanHOprojZcorr = 1 +TMTrackProducer.TrackFitSettings.KalmanHOfw = False #--- Switch on 2nd stage Mini HT with 2 GeV Pt threshold & allow it to find tracks with stubs in as few as 4 layers. -TMTrackProducer.HTArraySpecRphi.HoughNbinsPt = cms.uint32(48) -TMTrackProducer.HTArraySpecRphi.HoughNbinsPhi = cms.uint32(64) -TMTrackProducer.GenCuts.GenMinPt = cms.double(2.0) -TMTrackProducer.HTArraySpecRphi.HoughMinPt = cms.double(2.0) -TMTrackProducer.HTArraySpecRphi.MiniHoughMinPt = cms.double(3.0) # Mini-HT not used below this Pt, to reduce sensitivity to scattering. -TMTrackProducer.L1TrackDef.MinStubLayers = cms.uint32(4) -TMTrackProducer.HTFillingRphi.BusySectorMbinRanges = cms.vuint32(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 24) -TMTrackProducer.HTFillingRphi.BusySectorMbinOrder = cms.vuint32(0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47) +TMTrackProducer.HTArraySpecRphi.HoughNbinsPt = 48 +TMTrackProducer.HTArraySpecRphi.HoughNbinsPhi = 64 +TMTrackProducer.GenCuts.GenMinPt = 2.0 +TMTrackProducer.HTArraySpecRphi.HoughMinPt = 2.0 +TMTrackProducer.HTArraySpecRphi.MiniHoughMinPt = 3.0 # Mini-HT not used below this Pt, to reduce sensitivity to scattering. +TMTrackProducer.L1TrackDef.MinStubLayers = 4 +TMTrackProducer.HTFillingRphi.BusySectorMbinRanges = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 24] +TMTrackProducer.HTFillingRphi.BusySectorMbinOrder = [0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47] #--- phi digitisation range needs to be increased to go down to 2 GeV. #--- phi0 digitised relative to centre of sector. (Required range 2pi/18 + 2*overlap; overlap = 0.19206rads*(2GeV/ptCut)*(chosenR/67.24) -TMTrackProducer.TrackDigi.KF_phi0Range = cms.double(2*0.6981317) +TMTrackProducer.TrackDigi.KF_phi0Range = 2*0.6981317 # FIX: To make this change in KF FW, change phi0 bit selection in DRstate.vhd to bits 17-6 (instead of 16-5). # MuxHToutputs sends all HT outputs for an entire nonant and 1 m-bin to a single output link. # This works for Pt > 3 GeV, gives truncation for Pt > 2 GeV. To solve, need to double number of outputs, # with one for each phi sector in nonant. Not yet implemented, so for now disable HT output truncation. -TMTrackProducer.HTFillingRphi.BusySectorNumStubs = cms.uint32(999) +TMTrackProducer.HTFillingRphi.BusySectorNumStubs = 999 diff --git a/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_cff.py b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_cff.py index ab31246c691a4..1580c422b662b 100644 --- a/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_cff.py +++ b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_cff.py @@ -2,9 +2,9 @@ #--------------------------------------------------------------------------------------------------------- # This describes the full TMTT track reconstruction chain with 3 GeV threshold, where: -# the GP divides the tracker into 18 eta sectors (each sub-divided into 2 virtual eta subsectors); -# the HT uses a 32x18 array followed by 2x2 Mini-HT array, with transverese HT readout & multiplexing, -# followed by the KF (or optionally SF+SLR) track fit; duplicate track removal (Algo50) is run. +# the GP divides the tracker into 16 eta sectors; +# the HT uses a 32x16 array followed by 2x2 Mini-HT array, with transverese HT readout & multiplexing, +# followed by the track fit (KF); and duplicate track removal (Algo1) is run. # # This usually corresponds to the current firmware. #--------------------------------------------------------------------------------------------------------- @@ -13,17 +13,18 @@ from L1Trigger.TrackFindingTMTT.TMTrackProducer_Defaults_cfi import TMTrackProducer_params -TMTrackProducer = cms.EDProducer('TMTrackProducer', +TMTrackProducer = cms.EDProducer('tmtt::TMTrackProducer', # Load cfg parameters from TMTrackProducer_Defaults_cfi.py TMTrackProducer_params ) #=================================================================================================== -#=== Parameters changed from their default values. +# Uncomment the following 2 lines to enable use of MC truth info & output histograms. +# (This costs CPU, and is unnecessary if you only care about producing TTTrack collection). #=================================================================================================== -#--- Disable internal digitisation of SimpleLR fitter, as it was never retuned for nonants. -TMTrackProducer.TrackFitSettings.DigitizeSLR = cms.bool(False) +#TMTrackProducer.EnableMCtruth = cms.bool(True) +#TMTrackProducer.EnableHistos = cms.bool(True) #=================================================================================================== #=== All the following parameters already have identical values in TMTrackProducer_Defaults_cfi . @@ -32,10 +33,8 @@ #--- Configure track fitting -# Use only 4 or 5 parameter helix fit Kalman Filter (which automatically runs on tracks produced with no r-z track filter) -#TMTrackProducer.TrackFitSettings.TrackFitters = cms.vstring("KF5ParamsComb", "KF4ParamsComb") -# Use only Linear Regression Fitter (which automatically runs on tracks produced by r-z track filter). -#TMTrackProducer.TrackFitSettings.TrackFitters = cms.vstring("SimpleLR") +# Use only 4 parameter helix fit Kalman Filter (which automatically runs on tracks produced with no r-z track filter) +#TMTrackProducer.TrackFitSettings.TrackFitters = cms.vstring("KF4ParamsComb") # Allow KF to assign stubs in up to this many layers to fitted tracks. #TMTrackProducer.TrackFitSettings.KalmanMaxNumStubs = cms.uint32(6) @@ -44,12 +43,10 @@ #TMTrackProducer.TrackFitSettings.KalmanHOhelixExp = cms.bool(True) #TMTrackProducer.TrackFitSettings.KalmanHOalpha = cms.uint32(2) #TMTrackProducer.TrackFitSettings.KalmanHOprojZcorr = cms.uint32(2) -#TMTrackProducer.TrackFitSettings.KalmanHOdodgy = cms.bool(False) +#TMTrackProducer.TrackFitSettings.KalmanHOfw = cms.bool(False) #--- Switch off parts of the track reconstruction chain. -#TMTrackProducer.DupTrkRemoval.DupTrkAlgRphi = cms.uint32(0) -#TMTrackProducer.DupTrkRemoval.DupTrkAlg3D = cms.uint32(0) #TMTrackProducer.DupTrkRemoval.DupTrkAlgFit = cms.uint32(0) #TMTrackProducer.TrackFitSettings.TrackFitters = cms.vstring() diff --git a/L1Trigger/TrackFindingTMTT/src/ChiSquared4ParamsApprox.cc b/L1Trigger/TrackFindingTMTT/src/ChiSquared4ParamsApprox.cc deleted file mode 100644 index 7ea929d3db2f5..0000000000000 --- a/L1Trigger/TrackFindingTMTT/src/ChiSquared4ParamsApprox.cc +++ /dev/null @@ -1,221 +0,0 @@ -#include "L1Trigger/TrackFindingTMTT/interface/ChiSquared4ParamsApprox.h" - -namespace tmtt { - - ChiSquared4ParamsApprox::ChiSquared4ParamsApprox(const Settings* settings, const uint nPar) - : L1ChiSquared(settings, nPar) { - //parameterStream_ << "4Params_TrackletStyle_MCTruthSeed"; - //configParameters_ = (lsStr_.str()); - largestresid_ = -1.0; - ilargestresid_ = -1; - } - - std::map ChiSquared4ParamsApprox::vecToMap(std::vector x) { - // Convert a vector of track parameters to a labelled map for ease of use - std::map result; - result["rInv"] = x[0]; - result["phi0"] = x[1]; - result["t"] = x[2]; - result["z0"] = x[3]; - return result; - } - - std::vector ChiSquared4ParamsApprox::mapToVec(std::map x) { - // Conevrt the map of labelled track parameters to a vector (in correct order) - std::vector result; - result.resize(4); - result[0] = x["rInv"]; - result[1] = x["phi0"]; - result[2] = x["t"]; - result[3] = x["z0"]; - return result; - } - - std::vector ChiSquared4ParamsApprox::seed(const L1track3D& l1track3D) { - /* Cheat by using MC trutth to initialize helix parameters. Useful to check if conevrgence is the problem */ - std::map x; - x["rInv"] = getSettings()->invPtToInvR() * l1track3D.qOverPt(); - x["phi0"] = l1track3D.phi0(); - x["z0"] = l1track3D.z0(); - x["t"] = l1track3D.tanLambda(); - return mapToVec(x); - } - - Matrix ChiSquared4ParamsApprox::D(std::vector x) { - Matrix D(2 * stubs_.size(), nPar_, 0.0); // Empty matrix - int j = 0; - std::map y = vecToMap(x); // Get the track params by label - double rInv = y["rInv"]; - double phi0 = y["phi0"]; - double t = y["t"]; - for (unsigned i = 0; i < stubs_.size(); i++) { - double ri = stubs_[i]->r(); - if (stubs_[i]->barrel()) { - D(j, 0) = -0.5 * ri * ri; // Fine for now; - D(j, 1) = ri; // Fine - //D(j, 2); - //D(j, 3); - j++; - //D(j, 0) - //D(j, 1) - D(j, 2) = ri; // ri; // Fine for now - D(j, 3) = 1; // Fine - j++; - } else { - //here we handle a disk hit - //first we have the r position - double phii = stubs_[i]->phi(); - int iphi = stubs_[i]->iphi(); - - // N.B. These represent HALF the width and number of strips of sensor. - double width = stubs_[i]->width() / 2.0; - double nstrip = stubs_[i]->nstrip() / 2.0; - - double Deltai = width * (iphi - nstrip) / nstrip; //A bit of a hack... - - if (stubs_[i]->z() > 0.0) - Deltai = -Deltai; - double DeltaiOverRi = Deltai / ri; - double theta0 = (DeltaiOverRi) + 0.67 * (DeltaiOverRi) * (DeltaiOverRi) * (DeltaiOverRi); - - double phi_track = phi0 - 0.5 * rInv * ri; //Expected phi hit given the track - //std::cout << phi_track << "/" << phi0 << "/" << rInv << "/" << t << std::endl; - - double tInv = 1 / t; - - D(j, 0) = -0.167 * ri * ri * ri * rInv; // Tweaking of constant? - D(j, 1) = 0; // Exact - D(j, 2) = -ri * tInv; // Fine; - D(j, 3) = -1 * tInv; // Fine - j++; - //second the rphi position - D(j, 0) = -0.5 * ri * ri; // Needs fine tuning, was (phimultiplier*-0.5*(zi-z0)/t+rmultiplier*drdrinv); - D(j, 1) = ri; // Fine, originally phimultiplier - D(j, 2) = ri * 0.5 * rInv * ri * tInv - ((phi_track - phii) - theta0) * ri * tInv; - D(j, 3) = ri * 0.5 * rInv * tInv - ((phi_track - phii) - theta0) * tInv; - j++; - } - } - return D; - } - - Matrix ChiSquared4ParamsApprox::Vinv() { - Matrix Vinv(2 * stubs_.size(), 2 * stubs_.size(), 0.0); - for (unsigned i = 0; i < stubs_.size(); i++) { - if (stubs_[i]->barrel()) { - Vinv(2 * i, 2 * i) = 1 / stubs_[i]->sigmaX(); - Vinv(2 * i + 1, 2 * i + 1) = 1 / stubs_[i]->sigmaZ(); - } else { - Vinv(2 * i, 2 * i) = 1 / stubs_[i]->sigmaZ(); - Vinv(2 * i + 1, 2 * i + 1) = 1 / stubs_[i]->sigmaX(); - } - } - return Vinv; - } - - std::vector ChiSquared4ParamsApprox::residuals(std::vector x) { - unsigned int n = stubs_.size(); - - std::vector delta; - delta.resize(2 * n); - - std::map trackParams = vecToMap(x); // Get the track params by label - double rInv = trackParams["rInv"]; - double phi0 = trackParams["phi0"]; - double t = trackParams["t"]; - double z0 = trackParams["z0"]; - - double chiSq = 0.0; - - unsigned int j = 0; - - if (getSettings()->debug() == 6) - std::cout << "Residuals (" << chiSq << ") [" << getSettings()->invPtToInvR() / rInv << "]: "; - - largestresid_ = -1.0; - ilargestresid_ = -1; - - for (unsigned int i = 0; i < n; i++) { - double ri = stubs_[i]->r(); - double zi = stubs_[i]->z(); - double phii = stubs_[i]->phi(); - const double sigmax = stubs_[i]->sigmaX(); - const double sigmaz = stubs_[i]->sigmaZ(); - - if (stubs_[i]->barrel()) { - //we are dealing with a barrel stub - - double halfRinvRi = 0.5 * ri * rInv; - double aSinHalfRinvRi = halfRinvRi + 0.67 * halfRinvRi * halfRinvRi * halfRinvRi; - - double deltaphi = phi0 - aSinHalfRinvRi - phii; - if (deltaphi > M_PI) - deltaphi -= 2 * M_PI; - if (deltaphi < -M_PI) - deltaphi += 2 * M_PI; - delta[j++] = (ri * deltaphi) / sigmax; // TODO this is different from tracklet - delta[j++] = (z0 + (2.0 / rInv) * t * aSinHalfRinvRi - zi) / sigmaz; - } else { - //we are dealing with a disk hit - - double tInv = 1 / t; - - double r_track = (zi - z0) * tInv; - double phi_track = phi0 - 0.5 * rInv * (zi - z0) * tInv; - int iphi = stubs_[i]->iphi(); - - // N.B. These represent HALF the width and number of strips of sensor. - double width = stubs_[i]->width() / 2.0; - double nstrip = stubs_[i]->nstrip() / 2.0; - - double Deltai = width * (iphi - nstrip) / nstrip; //A bit of a hack... - - if (stubs_[i]->z() > 0.0) - Deltai = -Deltai; - - double DeltaiOverRi = Deltai / ri; - double theta0 = (DeltaiOverRi) + - 0.67 * (DeltaiOverRi) * (DeltaiOverRi) * - (DeltaiOverRi); //+0.125*DeltaiOverRi*DeltaiOverRi*DeltaiOverRi*DeltaiOverRi*DeltaiOverRi; - - double Delta = Deltai - r_track * (theta0 - (phi_track - phii)); - - delta[j++] = (r_track - ri) / sigmaz; - delta[j++] = Delta / sigmax; - } - - if (getSettings()->debug() == 6) - std::cout << delta[j - 2] << " " << delta[j - 1] << " "; - - chiSq += delta[j - 2] * delta[j - 2] + delta[j - 1] * delta[j - 1]; - - if (fabs(delta[j - 2]) > largestresid_) { - largestresid_ = fabs(delta[j - 2]); - ilargestresid_ = i; - } - - if (fabs(delta[j - 1]) > largestresid_) { - largestresid_ = fabs(delta[j - 1]); - ilargestresid_ = i; - } - if (getSettings()->debug() == 6) - std::cout << __FILE__ << ":" << __LINE__ << " - Residuals(): delta[" << j - 2 << "]/delta[" << j - 1 - << "]: " << delta[j - 2] << "/" << delta[j - 1] << std::endl; - if (getSettings()->debug() == 6) - std::cout << __FILE__ << ":" << __LINE__ << " - Residuals(): chisq: " << chiSq << std::endl; - } - - return delta; - } - - std::map ChiSquared4ParamsApprox::convertParams(std::vector x) { - std::map y = vecToMap(x); // Get track parameters by label - std::map result; - result["qOverPt"] = y["rInv"] / getSettings()->invPtToInvR(); - result["phi0"] = y["phi0"]; - result["z0"] = y["z0"]; - result["t"] = y["t"]; - return result; - } - -} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/ChiSquaredFit4.cc b/L1Trigger/TrackFindingTMTT/src/ChiSquaredFit4.cc new file mode 100644 index 0000000000000..74091c0127070 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/ChiSquaredFit4.cc @@ -0,0 +1,174 @@ +#include "L1Trigger/TrackFindingTMTT/interface/ChiSquaredFit4.h" +#include "DataFormats/Math/interface/deltaPhi.h" + +using namespace std; + +namespace tmtt { + + ChiSquaredFit4::ChiSquaredFit4(const Settings* settings, const uint nPar) : ChiSquaredFitBase(settings, nPar) { + largestresid_ = -1.0; + ilargestresid_ = -1; + } + + TVectorD ChiSquaredFit4::seed(const L1track3D& l1track3D) { + TVectorD x(4); + x[INVR] = settings_->invPtToInvR() * l1track3D.qOverPt(); + x[PHI0] = l1track3D.phi0(); + x[T] = l1track3D.tanLambda(); + x[Z0] = l1track3D.z0(); + return x; + } + + //=== Calculate derivatives of track intercept with respect to track parameters + + TMatrixD ChiSquaredFit4::D(const TVectorD& x) { + TMatrixD D(2 * stubs_.size(), nPar_); // Empty matrix + D.Zero(); + int j = 0; + double rInv = x[INVR]; + double phi0 = x[PHI0]; + double t = x[T]; + for (unsigned i = 0; i < stubs_.size(); i++) { + double ri = stubs_[i]->r(); + if (stubs_[i]->barrel()) { + // Derivatives of r*phi + D(j, INVR) = -0.5 * ri * ri; + D(j, PHI0) = ri; + j++; + // Derivatives of z + D(j, T) = ri; + D(j, Z0) = 1; + j++; + } else { + double phii = stubs_[i]->phi(); + int iphi = stubs_[i]->iphi(); + + // N.B. These represent HALF the width and number of strips of sensor. + double width = 0.5 * stubs_[i]->trackerModule()->sensorWidth(); + double nstrip = 0.5 * stubs_[i]->nStrips(); + + double Deltai = width * (iphi - nstrip) / nstrip; // Non-radial endcap 2S strip correction + if (stubs_[i]->z() > 0.0) + Deltai = -Deltai; + double DeltaiOverRi = Deltai / ri; + double theta0 = DeltaiOverRi + (2. / 3.) * DeltaiOverRi * DeltaiOverRi * DeltaiOverRi; + + double phi_track = phi0 - 0.5 * rInv * ri; //Expected phi hit given the track + + double tInv = 1 / t; + // Derivatives of r + D(j, INVR) = -1 * ri * ri * ri * rInv; + D(j, PHI0) = 0; + D(j, T) = -ri * tInv; + D(j, Z0) = -1 * tInv; + j++; + // Derivatives of r*phi + D(j, INVR) = -0.5 * ri * ri; + D(j, PHI0) = ri; + D(j, T) = ri * 0.5 * rInv * ri * tInv - ((phi_track - phii) - theta0) * ri * tInv; + D(j, Z0) = ri * 0.5 * rInv * tInv - ((phi_track - phii) - theta0) * tInv; + j++; + } + } + return D; + } + + //=== In principle, this is the stub position covariance matrix. + //=== In practice, it misses a factor "sigma", because unconventionally, this is absorbed into residuals() function. + + TMatrixD ChiSquaredFit4::Vinv() { + TMatrixD Vinv(2 * stubs_.size(), 2 * stubs_.size()); + // Scattering term scaling as 1/Pt. + double sigmaScat = settings_->kalmanMultiScattTerm() * std::abs(qOverPt_seed_); + for (unsigned i = 0; i < stubs_.size(); i++) { + double sigmaPerp = stubs_[i]->sigmaPerp(); + double sigmaPar = stubs_[i]->sigmaPar(); + double ri = stubs_[i]->r(); + sigmaPerp = sqrt(sigmaPerp * sigmaPerp + sigmaScat * sigmaScat * ri * ri); + if (stubs_[i]->barrel()) { + Vinv(2 * i, 2 * i) = 1 / sigmaPerp; + Vinv(2 * i + 1, 2 * i + 1) = 1 / sigmaPar; + } else { + Vinv(2 * i, 2 * i) = 1 / sigmaPar; + Vinv(2 * i + 1, 2 * i + 1) = 1 / sigmaPerp; + } + } + return Vinv; + } + + //=== Calculate residuals w.r.t. track divided by uncertainty. + + TVectorD ChiSquaredFit4::residuals(const TVectorD& x) { + unsigned int n = stubs_.size(); + + TVectorD delta(2 * n); + + double rInv = x[INVR]; + double phi0 = x[PHI0]; + double t = x[T]; + double z0 = x[Z0]; + + double chiSq = 0.0; + + unsigned int j = 0; + + largestresid_ = -1.0; + ilargestresid_ = -1; + + // Scattering term scaling as 1/Pt. + double sigmaScat = settings_->kalmanMultiScattTerm() * std::abs(qOverPt_seed_); + + for (unsigned int i = 0; i < n; i++) { + double ri = stubs_[i]->r(); + double zi = stubs_[i]->z(); + double phii = stubs_[i]->phi(); + double sigmaPerp = stubs_[i]->sigmaPerp(); + double sigmaPar = stubs_[i]->sigmaPar(); + sigmaPerp = sqrt(sigmaPerp * sigmaPerp + sigmaScat * sigmaScat * ri * ri); + + if (stubs_[i]->barrel()) { + double halfRinvRi = 0.5 * ri * rInv; + double aSinHalfRinvRi = halfRinvRi + (2. / 3.) * halfRinvRi * halfRinvRi * halfRinvRi; + double deltaphi = reco::deltaPhi(phi0 - aSinHalfRinvRi - phii, 0.); + delta[j++] = (ri * deltaphi) / sigmaPerp; + delta[j++] = (z0 + (2.0 / rInv) * t * aSinHalfRinvRi - zi) / sigmaPar; + } else { + double tInv = 1 / t; + double r_track = (zi - z0) * tInv; + double phi_track = phi0 - 0.5 * rInv * (zi - z0) * tInv; + int iphi = stubs_[i]->iphi(); + + // N.B. These represent HALF the width and number of strips of sensor. + double width = 0.5 * stubs_[i]->trackerModule()->sensorWidth(); + double nstrip = 0.5 * stubs_[i]->nStrips(); + + double Deltai = width * (iphi - nstrip) / nstrip; // Non-radial endcap 2S strip correction + + if (stubs_[i]->z() > 0.0) + Deltai = -Deltai; + + double DeltaiOverRi = Deltai / ri; + double theta0 = DeltaiOverRi + (2. / 3.) * DeltaiOverRi * DeltaiOverRi * DeltaiOverRi; + double Delta = Deltai - r_track * (theta0 - (phi_track - phii)); + + delta[j++] = (r_track - ri) / sigmaPar; + delta[j++] = Delta / sigmaPerp; + } + + chiSq += delta[j - 2] * delta[j - 2] + delta[j - 1] * delta[j - 1]; + + if (std::abs(delta[j - 2]) > largestresid_) { + largestresid_ = std::abs(delta[j - 2]); + ilargestresid_ = i; + } + + if (std::abs(delta[j - 1]) > largestresid_) { + largestresid_ = std::abs(delta[j - 1]); + ilargestresid_ = i; + } + } + + return delta; + } + +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/ChiSquaredFitBase.cc b/L1Trigger/TrackFindingTMTT/src/ChiSquaredFitBase.cc new file mode 100644 index 0000000000000..168e19269af71 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/ChiSquaredFitBase.cc @@ -0,0 +1,136 @@ +///=== This is the base class for the linearised chi-squared track fit algorithms. + +///=== Written by: Sioni Summers and Alexander D. Morton + +#include "L1Trigger/TrackFindingTMTT/interface/ChiSquaredFitBase.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" +#include "L1Trigger/TrackFindingTMTT/interface/Utility.h" + +#include +#include +#include + +namespace tmtt { + + ChiSquaredFitBase::ChiSquaredFitBase(const Settings* settings, const uint nPar) + : TrackFitGeneric(settings), chiSq_(0.0) { + // Bad stub killing settings + numFittingIterations_ = settings_->numTrackFitIterations(); + killTrackFitWorstHit_ = settings_->killTrackFitWorstHit(); + generalResidualCut_ = settings_->generalResidualCut(); // The cut used to remove bad stubs (if nStubs > minLayers) + killingResidualCut_ = settings_->killingResidualCut(); // The cut used to kill off tracks entirely + + //--- These two parameters are used to check if after the fit, there are still enough stubs on the track + minStubLayers_ = settings_->minStubLayers(); + nPar_ = nPar; + } + + void ChiSquaredFitBase::calculateChiSq(const TVectorD& resids) { + chiSq_ = 0.0; + uint j = 0; + for (uint i = 0; i < stubs_.size(); i++) { + chiSq_ += resids[j] * resids[j] + resids[j + 1] * resids[j + 1]; + j = j + 2; + } + } + + void ChiSquaredFitBase::calculateDeltaChiSq(const TVectorD& delX, const TVectorD& covX) { + for (int i = 0; i < covX.GetNrows(); i++) { + chiSq_ -= (delX[i]) * covX[i]; + } + } + + L1fittedTrack ChiSquaredFitBase::fit(const L1track3D& l1track3D) { + qOverPt_seed_ = l1track3D.qOverPt(); + stubs_ = l1track3D.stubs(); + + // Get cut on number of layers including variation due to dead sectors, pt dependence etc. + minStubLayersRed_ = Utility::numLayerCut(Utility::AlgoStep::FIT, + settings_, + l1track3D.iPhiSec(), + l1track3D.iEtaReg(), + std::abs(l1track3D.qOverPt()), + l1track3D.eta()); + + TVectorD x = seed(l1track3D); + + for (int i = 0; i < numFittingIterations_; i++) { + TMatrixD d = D(x); + TMatrixD dTrans(TMatrixD::kTransposed, d); + TMatrixD dtVinv = dTrans * Vinv(); + TMatrixD dtVinvTrans(TMatrixD::kTransposed, dtVinv); + //TMatrixD M = dtVinv * d; // Must insert extra factor Vinv, due to unconventional Vinv() definition. + TMatrixD M = dtVinv * dtVinvTrans; + TMatrixD Minv(TMatrixD::kInverted, M); + TVectorD resids = residuals(x); + TVectorD deltaX = Minv * dtVinv * resids; + x = x - deltaX; + TVectorD covX = dTrans * Vinv() * resids; + calculateChiSq(resids); + calculateDeltaChiSq(deltaX, covX); + + if (i < numFittingIterations_ - 1) { // Don't kill stub if will not refit. + + resids = residuals(x); // update resids & largestresid_ + + bool killWorstStub = false; + if (killTrackFitWorstHit_) { + if (largestresid_ > killingResidualCut_) { + killWorstStub = true; + } else if (largestresid_ > generalResidualCut_) { + std::vector stubsTmp = stubs_; + stubsTmp.erase(stubsTmp.begin() + ilargestresid_); + if (Utility::countLayers(settings_, stubsTmp) >= minStubLayersRed_) + killWorstStub = true; + } else { + // Get better apparent tracking performance by always killing worst stub until only 4 layers left. + if (Utility::countLayers(settings_, stubs_) > minStubLayersRed_) + killWorstStub = true; + } + } + + if (killWorstStub) { + stubs_.erase(stubs_.begin() + ilargestresid_); + + // Reject tracks with too many killed stubs & stop iterating. + unsigned int nLayers = Utility::countLayers(settings_, stubs_); // Count tracker layers with stubs + bool valid = nLayers >= minStubLayersRed_; + + if (not valid) { + L1fittedTrack rejectedTrk; + return rejectedTrk; + } + } else { + break; + } + } + } + + // Reject tracks with too many killed stubs + unsigned int nLayers = Utility::countLayers(settings_, stubs_); // Count tracker layers with stubs + bool valid = nLayers >= minStubLayersRed_; + + if (valid) { + const unsigned int hitPattern = 0; // FIX: Needs setting + const float chi2rz = 0; // FIX: Needs setting + return L1fittedTrack(settings_, + &l1track3D, + stubs_, + hitPattern, + x[INVR] / (settings_->invPtToInvR()), + 0, + x[PHI0], + x[Z0], + x[T], + chiSq_, + chi2rz, + nPar_); + } else { + L1fittedTrack rejectedTrk; + return rejectedTrk; + } + } + +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc b/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc index def71b561ff19..cae57cb0ba943 100644 --- a/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc +++ b/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc @@ -1,143 +1,76 @@ #include "L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h" #include "FWCore/Utilities/interface/Exception.h" -//=== Convert our non-persistent L1track3D object (track candidate found by Hough transform prior to fit) -//=== to the official persistent CMSSW EDM TTrack format. +using namespace std; namespace tmtt { - TTTrack ConverterToTTTrack::makeTTTrack(const L1track3D& trk, + //=== Convert L1fittedTrack or L1track3D (track candidates after/before fit) to TTTrack format. + + TTTrack ConverterToTTTrack::makeTTTrack(const L1trackBase* trk, unsigned int iPhiSec, unsigned int iEtaReg) const { - // Get references to stubs on this track. - std::vector ttstubrefs = this->getStubRefs(trk); - - // Set helix parameters. - const unsigned int nPar4 = 4; // Number of helix parameters determined by HT. - - /* - // Create TTTrack object using these stubs. - TTTrack< Ref_Phase2TrackerDigi_ > track(ttstubrefs); + unsigned int nPar, hitPattern; + double d0, z0, tanL, chi2rphi, chi2rz; + + const L1fittedTrack* fitTrk = dynamic_cast(trk); + + // Handle variables that differ for L1fittedTrack & L1track3D + if (fitTrk == nullptr) { + // This is an L1track3D type (track before fit) + nPar = 4; // Before fit, TMTT algorithm assumes 4 helix params + // Set to zero variables that are unavailable for this track type. + hitPattern = 0; + d0 = 0.; + z0 = 0; + ; + tanL = 0; + chi2rphi = 0.; + chi2rz = 0; + } else { + // This is an L1fittedTrack type (track after fit) + if (not fitTrk->accepted()) + throw cms::Exception("LogicError") << "ConverterToTTTrack ERROR: requested to convert invalid L1fittedTrack"; + nPar = fitTrk->nHelixParam(); // Number of helix parameters in track fit + hitPattern = fitTrk->hitPattern(); + d0 = fitTrk->d0(); + z0 = fitTrk->z0(); + tanL = fitTrk->tanLambda(); + chi2rphi = fitTrk->chi2rphi(); + chi2rz = fitTrk->chi2rz(); + } + + const double& rinv = invPtToInvR_ * trk->qOverPt(); + const double& phi0 = trk->phi0(); + constexpr double mva = -1.; // MVA quality flags not yet set. + const double& magneticField = settings_->magneticField(); - // Note which (eta,phi) sector this track was reconstructed in by HT. - track.setSector(iPhiSec); - track.setWedge(iEtaReg); - - // Set helix parameters. - const unsigned int nPar = trk.nHelixParam(); // Number of helix parameters determined by HT. - // Get and store fitted track parameters - GlobalPoint bsPosition(-trk.d0()*sin(trk.phi0()), - trk.d0()*cos(trk.phi0()), - trk.z0()); // Point of closest approach of track to beam-line. - track.setPOCA(bsPosition, nPar); - float pt = trk.pt(); // pt - track.setMomentum( - GlobalVector( - GlobalVector::Cylindrical( - pt, - trk.phi0(), // phi - pt*trk.tanLambda() // pz - ) - ), - nPar - ); - track.setRInv(invPtToInvR_ * trk.qOverPt(), nPar); - track.setChi2(trk.chi2(), nPar); - track.setStubPtConsistency(-1, nPar); - */ - - // new TTTrack constructor - double tmp_rinv = invPtToInvR_ * trk.qOverPt(); - double tmp_phi = trk.phi0(); - double tmp_tanL = trk.tanLambda(); - double tmp_z0 = trk.z0(); - double tmp_d0 = trk.d0(); - double tmp_chi2 = -1; - unsigned int tmp_hit = 0; - unsigned int tmp_npar = nPar4; - double tmp_Bfield = settings_->getBfield(); TTTrack track( - tmp_rinv, tmp_phi, tmp_tanL, tmp_z0, tmp_d0, tmp_chi2, 0, 0, 0, tmp_hit, tmp_npar, tmp_Bfield); + rinv, phi0, tanL, z0, d0, chi2rphi, chi2rz, mva, mva, mva, hitPattern, nPar, magneticField); - // set stub references + // Set references to stubs on this track. + std::vector ttstubrefs = this->stubRefs(trk); track.setStubRefs(ttstubrefs); - // Note which (eta,phi) sector this track was reconstructed in by HT. + // Note which (eta,phi) sector this track was reconstructed in. track.setPhiSector(iPhiSec); track.setEtaSector(iEtaReg); - track.setStubPtConsistency(-1); // not filled. + track.setStubPtConsistency(-1); // not yet filled. return track; } - //=== Convert our non-persistent L1fittedTrack object (fitted track candidate) - //=== to the official persistent CMSSW EDM TTrack format. - - TTTrack ConverterToTTTrack::makeTTTrack(const L1fittedTrack& trk, - unsigned int iPhiSec, - unsigned int iEtaReg) const { - // Check that this track is valid. - if (!trk.accepted()) - throw cms::Exception("ConverterToTTTrack ERROR: requested to convert invalid L1fittedTrack."); - - // Get references to stubs on this track. - std::vector ttstubrefs = this->getStubRefs(trk); - - const unsigned int nPar = trk.nHelixParam(); // Number of helix parameters determined by HT. - - /* - // Create TTTrack object using these stubs. - TTTrack< Ref_Phase2TrackerDigi_ > track(ttstubrefs); - - // Note which (eta,phi) sector this track was reconstructed in by HT. - track.setSector(iPhiSec); - track.setWedge(iEtaReg); + //=== Get references to stubs on track. (Works for either L1track3D or L1fittedTrack). - // Set helix parameters. - // Get and store fitted track parameters - GlobalPoint bsPosition(-trk.d0()*sin(trk.phi0()), - trk.d0()*cos(trk.phi0()), - trk.z0()); // Point of closest approach of track to beam-line. - track.setPOCA(bsPosition, nPar); - float pt = trk.pt(); // pt - track.setMomentum( - GlobalVector( - GlobalVector::Cylindrical( - pt, - trk.phi0(), // phi - pt*trk.tanLambda() // pz - ) - ), - nPar - ); - track.setRInv(invPtToInvR_ * trk.qOverPt(), nPar); - track.setChi2(trk.chi2(), nPar); - track.setStubPtConsistency(-1, nPar); - */ - - // new TTTrack constructor - double tmp_rinv = invPtToInvR_ * trk.qOverPt(); - double tmp_phi = trk.phi0(); - double tmp_tanL = trk.tanLambda(); - double tmp_z0 = trk.z0(); - double tmp_d0 = trk.d0(); - double tmp_chi2 = -1; - unsigned int tmp_hit = 0; - unsigned int tmp_npar = nPar; - double tmp_Bfield = settings_->getBfield(); - TTTrack track( - tmp_rinv, tmp_phi, tmp_tanL, tmp_z0, tmp_d0, tmp_chi2, 0, 0, 0, tmp_hit, tmp_npar, tmp_Bfield); - - // set stub references - track.setStubRefs(ttstubrefs); - - // Note which (eta,phi) sector this track was reconstructed in by HT. - track.setPhiSector(iPhiSec); - track.setEtaSector(iEtaReg); - - track.setStubPtConsistency(-1); // not filled. - - return track; + std::vector ConverterToTTTrack::stubRefs(const L1trackBase* trk) const { + std::vector ttstubrefs; + const std::vector stubs = trk->stubs(); + for (Stub* s : stubs) { + const TTStubRef& ref = s->ttStubRef(); + ttstubrefs.push_back(ref); + } + return ttstubrefs; } + } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/DeadModuleDB.cc b/L1Trigger/TrackFindingTMTT/src/DeadModuleDB.cc deleted file mode 100644 index cac393629fd32..0000000000000 --- a/L1Trigger/TrackFindingTMTT/src/DeadModuleDB.cc +++ /dev/null @@ -1,65 +0,0 @@ -#include -#include - -//=== Does this stub lie in a dead region of the tracker? -//=== This function is only invoked if cfg param DeadSimulate = True & used to kill stubs to emulate dead regions. - -namespace tmtt { - - bool DeadModuleDB::killStub(const Stub* stub) const { - bool dead = false; - if (stub->barrel()) { - if (deadBarrelRegions_.find(stub->layerId()) != deadBarrelRegions_.end()) { - const vector& bRegions = deadBarrelRegions_.at(stub->layerId()); - for (const DeadModuleDB::DeadBarrelRegion& bDead : bRegions) { - if (this->deltaPhiPos(stub->phi(), bDead.phiMin_) < this->deltaPhiPos(bDead.phiMax_, bDead.phiMin_) && - stub->z() > bDead.zMin_ && stub->z() < bDead.zMax_) - dead = true; - } - } - } else { - if (deadEndcapRegions_.find(stub->layerId()) != deadEndcapRegions_.end()) { - const vector& eRegions = deadEndcapRegions_.at(stub->layerId()); - for (const DeadModuleDB::DeadEndcapRegion& eDead : eRegions) { - if (this->deltaPhiPos(stub->phi(), eDead.phiMin_) < this->deltaPhiPos(eDead.phiMax_, eDead.phiMin_) && - stub->r() > eDead.rMin_ && stub->r() < eDead.rMax_) - dead = true; - } - } - } - return dead; - } - - //=== Define regions of the tracker in which the modules are dead. - //=== This function is only involed if cfg param DeadSimulate = True, when any stubs in modules within these regions are killed, - //=== so emulating MC with dead regions. - - void DeadModuleDB::defineDeadTrackerRegions() { - // Example of how to declare a region of the tracker barrel as dead. - const unsigned int iLayer = 5; // (1-6 = barrel layer; 11-15 = endcap A disk; 21-25 = endcap B disk) - //=== Should this stub be killed to emulate dead modules lying within a dead tracker region? - //=== This function is only invoked if cfg param DeadSimulate = True - - const float phiMin = 0.5; - const float phiMax = 2.5; - const float zMin = -100.0; - const float zMax = 0.0; - deadBarrelRegions_[iLayer].push_back(DeadModuleDB::DeadBarrelRegion(phiMin, phiMax, zMin, zMax)); - } - - //=== Define sectors in which the cut on number of layer numbers on tracks should be reduced by 1, because - //=== they contain dead modules. This function is only invoked if cfg param DeadReduceLayers = True. - //=== Ideally these sectors would be derived from the regions declared in definedDeadTrackerRegions(). - - void DeadModuleDB::defineDeadSectors() { - // Example of how to declare sectors as dead. - // N.B. Histograms "AlgEffVsPhiSec", "AlgEffVsEtaSec", "AlgEffFitVsPhiSec*" and "AlgEffFitVsEtaSec*" - // will help you determine which sectors you need to declare here. - for (unsigned int iPhiSec = 9; iPhiSec <= 13; iPhiSec++) { - for (unsigned int iEtaReg = 5; iEtaReg <= 8; iEtaReg++) { - reduceLayerCut_.insert(pair(iPhiSec, iEtaReg)); - } - } - } - -} // namespace tmtt \ No newline at end of file diff --git a/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc b/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc index d579c0ca4471e..a2c7c8e74a81b 100644 --- a/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc +++ b/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc @@ -1,4 +1,5 @@ #include "L1Trigger/TrackFindingTMTT/interface/DegradeBend.h" +#include "L1Trigger/TrackFindingTMTT/interface/TrackerModule.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "DataFormats/SiStripDetId/interface/StripSubdetector.h" @@ -16,7 +17,7 @@ namespace tmtt { //--- Stub window sizes copied from L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py - const std::vector DegradeBend::barrelCut_ = {0, 2.0, 2.0, 3.5, 4.5, 5.5, 6.5}; + const std::vector DegradeBend::barrelCut_ = {0, 2, 2.5, 3.5, 4.5, 5.5, 7}; const std::vector > DegradeBend::ringCut_ = { // EndcapCutSet {0}, {0, 1, 2.5, 2.5, 3, 2.5, 3, 3.5, 4, 4, 4.5, 3.5, 4, 4.5, 5, 5.5}, @@ -26,9 +27,9 @@ namespace tmtt { {0, 0.5, 1.5, 3, 2.5, 3.5, 3, 3, 3.5, 4, 3.5, 4, 3.5}}; const std::vector > DegradeBend::tiltedCut_ = { // TiltedBarrelCutSet {0}, - {0, 3, 3, 2.5, 3, 3, 2.5, 2.5, 2, 1.5, 1.5, 1, 1}, - {0, 3.5, 3, 3, 3, 3, 2.5, 2.5, 3, 3, 2.5, 2.5, 2.5}, - {0, 4, 4, 4, 3.5, 3.5, 3.5, 3.5, 3, 3, 3, 3, 3}}; + {0, 3, 3., 2.5, 3., 3., 2.5, 2.5, 2., 1.5, 1.5, 1, 1}, + {0, 4., 4, 4, 4, 4., 4., 4.5, 5, 4., 3.5, 3.5, 3}, + {0, 5, 5, 5, 5, 5, 5, 5.5, 5, 5, 5.5, 5.5, 5.5}}; const std::vector DegradeBend::barrelNTilt_ = {0., 12., 12., 12., 0., 0., 0.}; //--- Given the original bend, flag indicating if this is a PS or 2S module, & detector identifier, @@ -41,14 +42,10 @@ namespace tmtt { const DetId& stDetId, float windowFEnew, float& degradedBend, - bool& reject, unsigned int& numInGroup) const { // Get degraded bend value. unsigned int windowHalfStrips; - this->work(bend, psModule, stDetId, windowFEnew, degradedBend, reject, numInGroup, windowHalfStrips); - - // Check for mistakes. - this->sanityChecks(psModule, stDetId, windowFEnew, degradedBend, numInGroup, windowHalfStrips); + this->work(bend, psModule, stDetId, windowFEnew, degradedBend, numInGroup, windowHalfStrips); } //--- Does the actual work of degrading the bend. @@ -58,7 +55,6 @@ namespace tmtt { const DetId& stDetId, float windowFEnew, float& degradedBend, - bool& reject, unsigned int& numInGroup, unsigned int& windowHalfStrips) const { // Calculate stub window size in half-strip units used to produce stubs. @@ -73,7 +69,7 @@ namespace tmtt { int type = 2 * theTrackerTopo_->tobSide(stDetId) - 3; // -1 for tilted-, 1 for tilted+, 3 for flat double corr = 0; - if (type < 3) // Only for tilted modules + if (type != TrackerModule::BarrelModuleType::flat) // Only for tilted modules { corr = (barrelNTilt_.at(layer) + 1) / 2.; ladder = @@ -107,7 +103,6 @@ namespace tmtt { int b = std::round(2 * bend); if ((unsigned int)(abs(b)) <= window) { - reject = false; float degradedB; unsigned int numBends = 2 * window + 1; unsigned int numAllowed = (psModule) ? pow(2, bitsPS_) : pow(2, bits2S_); @@ -122,19 +117,20 @@ namespace tmtt { unsigned int numLargeGroups = numBends % numAllowed; unsigned int inLargeGroup = inSmallGroup + 1; unsigned int numSmallGroups = numAllowed - numLargeGroups; + // Bend encoding in groups (some large, some small, one large/small, some small, some large). vector groups; for (unsigned int i = 0; i < numLargeGroups / 2; i++) groups.push_back(inLargeGroup); for (unsigned int i = 0; i < numSmallGroups / 2; i++) groups.push_back(inSmallGroup); // Only one of numLargeGroups & numSmallGroups can be odd, since numAllowed is odd. - // And whichever one is odd is associated to a group with an odd number of elements since numBends is odd, + // And whichever is odd is associated to a group with an odd number of elements since numBends is odd, if (numLargeGroups % 2 == 1 && inLargeGroup % 2 == 1) { groups.push_back(inLargeGroup); } else if (numSmallGroups % 2 == 1 && inSmallGroup % 2 == 1) { groups.push_back(inSmallGroup); } else { - throw cms::Exception("DegradeBend: logic error with odd numbers"); + throw cms::Exception("LogicError") << "DegradeBend: logic error with odd numbers"; } for (unsigned int i = 0; i < numSmallGroups / 2; i++) groups.push_back(inSmallGroup); @@ -152,80 +148,17 @@ namespace tmtt { } } if (degradedB == 999) - throw cms::Exception("DegradeResolution: Logic error in loop over groups"); + throw cms::Exception("LogicError") << "DegradeResolution: Logic error in loop over groups"; } // This is degraded bend in full strip units (neglecting bend sign). degradedBend = float(degradedB) / 2.; } else { - // This shouldn't happen. If it does, the the window sizes assumed in this code are tighter than the ones - // actually used to produce the stubs. - reject = true; + // This should only happen for stubs subsequently rejected by the FE. numInGroup = 0; - degradedBend = 99999; + constexpr float rejectedStubBend = 99999.; + degradedBend = rejectedStubBend; } } - - //--- Check for mistakes. - - void DegradeBend::sanityChecks(bool psModule, - const DetId& stDetId, - float windowFEnew, - float degradedBend, - unsigned int numInGroup, - unsigned int windowHalfStrips) const { - pair p(windowHalfStrips, psModule); - - // Map notes if this (window size, psModule) combination has already been checked. - static thread_local map, bool> checked; - - if (checked.find(p) == checked.end()) { - bool wasDegraded = false; // Was any stub bend encoding required for this window size? - set degradedBendTmpValues; - set bendTmpMatches; - - // Loop over all bend values allowed within the window size. - for (int bendHalfStrips = -int(windowHalfStrips); bendHalfStrips <= int(windowHalfStrips); bendHalfStrips++) { - float bendTmp = float(bendHalfStrips) / 2.; - float degradedBendTmp; - bool rejectTmp; - unsigned int numInGroupTmp = 0; - unsigned int windowHalfStripsTmp = 0; - this->work( - bendTmp, psModule, stDetId, windowFEnew, degradedBendTmp, rejectTmp, numInGroupTmp, windowHalfStripsTmp); - if (numInGroupTmp > 1) - wasDegraded = true; - degradedBendTmpValues.insert(degradedBendTmp); - if (degradedBend == degradedBendTmp) - bendTmpMatches.insert(bendTmp); // Gives same degraded bend as original problem. - - // Sanity checks. - if (rejectTmp) - throw cms::Exception("DegradeBend: `rejected' flag set, despite bend being within window") - << " fabs(" << bendTmp << ") <= " << float(windowHalfStrips) / 2. << endl; - if (4 * fabs(bendTmp - degradedBendTmp) > std::round(numInGroupTmp - 1)) - throw cms::Exception("DegradeBend: degraded bend differs by more than expected from input bend.") - << " bendTmp=" << bendTmp << " degradedBendTmp=" << degradedBendTmp << " numInGroupTmp=" << numInGroupTmp - << endl; - } - - // Sanity checks. - unsigned int numRedValues = degradedBendTmpValues.size(); - unsigned int maxAllowed = (psModule) ? pow(2, bitsPS_) : pow(2, bits2S_); - if (wasDegraded) { - if (numRedValues != maxAllowed - 1) - throw cms::Exception("DegradeBend: Bend encoding using wrong number of bits") - << numRedValues << " > " << maxAllowed << endl; - } else { - if (numRedValues > maxAllowed) - throw cms::Exception("DegradeBend: Bend encoding using too many bits") - << numRedValues << " > " << maxAllowed << endl; - } - if (bendTmpMatches.size() != numInGroup) - throw cms::Exception("DegradeBend: number of bend values in group inconsistent.") - << bendTmpMatches.size() << " is not equal to " << numInGroup << endl; - } - } - } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/DigitalStub.cc b/L1Trigger/TrackFindingTMTT/src/DigitalStub.cc index 9aea553c839f3..f7db8523855a6 100644 --- a/L1Trigger/TrackFindingTMTT/src/DigitalStub.cc +++ b/L1Trigger/TrackFindingTMTT/src/DigitalStub.cc @@ -2,19 +2,18 @@ #include "L1Trigger/TrackFindingTMTT/interface/DigitalStub.h" #include "DataFormats/Math/interface/deltaPhi.h" +#include "FWCore/Utilities/interface/Exception.h" #include +using namespace std; + namespace tmtt { - //=== Simplified version of DigitalStub for use with KF in Hybrid tracking. + //=== Hybrid tracking: simplified digitization for KF. DigitalStub::DigitalStub(const Settings* settings, double r, double phi, double z, unsigned int iPhiSec) - : ranInit_(true), - ranMakeGPinput_(true), - ranMakeHTinput_(true), - ranMakeSForTFinput_("KF"), - phiSBits_(settings->phiSBits()), // No. of bits to store phiS coord. + : phiSBits_(settings->phiSBits()), // No. of bits to store phiS coord. phiSRange_(settings->phiSRange()), // Range of phiS coord. in radians. rtBits_(settings->rtBits()), // No. of bits to store rT coord. rtRange_(settings->rtRange()), // Range of rT coord. in cm. @@ -23,436 +22,228 @@ namespace tmtt { phiSMult_(pow(2, phiSBits_) / phiSRange_), rtMult_(pow(2, rtBits_) / rtRange_), zMult_(pow(2, zBits_) / zRange_), - // Radius from beamline with respect to which stub r coord. is measured. numPhiSectors_(settings->numPhiSectors()), numPhiNonants_(9), - phiSectorWidth_(2. * M_PI / float(numPhiSectors_)), + phiSectorWidth_(2. * M_PI / double(numPhiSectors_)), chosenRofPhi_(settings->chosenRofPhi()) { // Centre of this sector in phi. (Nonant 0 is centred on x-axis). - double phiCentreSec0 = -M_PI / float(numPhiNonants_) + M_PI / float(numPhiSectors_); - double phiSectorCentre = phiSectorWidth_ * float(iPhiSec) + phiCentreSec0; + phiCentreSec0_ = -M_PI / double(numPhiNonants_) + M_PI / double(numPhiSectors_); + phiSectorCentre_ = phiSectorWidth_ * double(iPhiSec) + phiCentreSec0_; + + // Used to check if new digi requests are for same sector as old + iPhiSec_done_ = iPhiSec; r_orig_ = r; phi_orig_ = phi; z_orig_ = z; rt_orig_ = r_orig_ - chosenRofPhi_; - phiS_orig_ = reco::deltaPhi(phi_orig_, phiSectorCentre); + phiS_orig_ = reco::deltaPhi(phi_orig_, phiSectorCentre_); // Digitize iDigi_Rt_ = floor(rt_orig_ * rtMult_); iDigi_PhiS_ = floor(phiS_orig_ * phiSMult_); iDigi_Z_ = floor(z_orig_ * zMult_); - iDigi_Z_KF_ = iDigi_Z_; - - /* - - // SKIP UNTIL HYBRID DIGITISATION PARAMS IMPLEMENTED - - // Undigitize - r_ = (iDigi_R_ + 0.5)/rtMult_; - phiS_ = (iDigi_PhiS_ + 0.5)/phiSMult_; - phi_ = reco::deltaPhi(phiS_, -phiSectorRef); // N.B. phi_ measured w.r.t sector here, but w.r.t. - z_ = (iDigi_Z_ + 0.5)/zMult_; - - // Check that stub coords. are within assumed digitization range. - this->checkInRange(); - - // Check that digitization followed by undigitization doesn't change results too much. - this->checkAccuracy(); - - */ } - //=== Note configuration parameters (for use with TMTT tracking). - - DigitalStub::DigitalStub(const Settings* settings) - : - - // To check that DigitalStub is correctly initialized. - ranInit_(false), - ranMakeGPinput_(false), - ranMakeHTinput_(false), - ranMakeSForTFinput_(""), - - // Digitization configuration parameters - phiSectorBits_(settings->phiSectorBits()), // No. of bits to store phi sector number - //--- Parameters available in HT board. - phiSBits_(settings->phiSBits()), // No. of bits to store phiS coord. - phiSRange_(settings->phiSRange()), // Range of phiS coord. in radians. - rtBits_(settings->rtBits()), // No. of bits to store rT coord. - rtRange_(settings->rtRange()), // Range of rT coord. in cm. - zBits_(settings->zBits()), // No. of bits to store z coord. - zRange_(settings->zRange()), // Range of z coord in cm. - //--- Parameters available in GP board (excluding any in common with HT specified above). - phiOBits_(settings->phiOBits()), // No. of bits to store phiO parameter. - phiORange_(settings->phiORange()), // Range of phiO parameter - bendBits_(settings->bendBits()), // No. of bits to store stub bend. - - // Note if using reduced layer ID, so tracker layer can be encoded in 3 bits. - reduceLayerID_(settings->reduceLayerID()), - - // Number of phi sectors and phi nonants. - numPhiSectors_(settings->numPhiSectors()), - numPhiNonants_(settings->numPhiNonants()), - // Phi sector and phi nonant width (radians) - phiSectorWidth_(2. * M_PI / float(numPhiSectors_)), - phiNonantWidth_(2. * M_PI / float(numPhiNonants_)), - // Radius from beamline with respect to which stub r coord. is measured. - chosenRofPhi_(settings->chosenRofPhi()), - - // Number of q/Pt bins in Hough transform array. - nbinsPt_((int)settings->houghNbinsPt()) { - // Calculate multipliers to digitize the floating point numbers. - phiSMult_ = pow(2, phiSBits_) / phiSRange_; - rtMult_ = pow(2, rtBits_) / rtRange_; - zMult_ = pow(2, zBits_) / zRange_; - phiOMult_ = pow(2, phiOBits_) / phiORange_; - - bendMult_ = - 4.; // No precision lost by digitization, since original bend (after encoding) has steps of 0.25 (in units of pitch). - bendRange_ = round(pow(2, bendBits_) / bendMult_); // discrete values, so digitisation different - } - - //=== Initialize stub with original, floating point stub coords, - //=== range of m bin (= q/Pt bin) values allowed by bend filter, - //=== normal & "reduced" tracker layer of stub, stub bend, and pitch & seperation of module, - //=== and half-length of strip or pixel in r and in z, and if it's in barrel, tilted barrel and/or PS module. - - void DigitalStub::init(float phi_orig, - float r_orig, - float z_orig, - unsigned int min_qOverPt_bin_orig, - unsigned int max_qOverPt_bin_orig, - unsigned int layerID, - unsigned int layerIDreduced, - float bend_orig, - float pitch, - float sep, - float rErr, - float zErr, - bool barrel, - bool tiltedBarrel, - bool psModule) { - ranInit_ = true; // Note we ran init(). - // Variables in HT. - phi_orig_ = phi_orig; + //=== TMTT tracking algorithm: digitisaton for entire L1 tracking chain. + // Initialize stub with floating point stub coords, range of HT m-bin values consistent with bend, + // bend and phi sector. + + DigitalStub::DigitalStub(const Settings* settings, + double phi_orig, + double r_orig, + double z_orig, + unsigned int mbin_min_orig, + unsigned int mbin_max_orig, + double bend_orig, + unsigned int iPhiSec) { + // Set cfg params + this->setCfgParams(settings); + + // Store variable prior to digitisation r_orig_ = r_orig; + rt_orig_ = r_orig_ - chosenRofPhi_; + phi_orig_ = phi_orig; z_orig_ = z_orig; - min_qOverPt_bin_orig_ = min_qOverPt_bin_orig; - max_qOverPt_bin_orig_ = max_qOverPt_bin_orig; - layerID_ = layerID; - layerIDreduced_ = layerIDreduced; - // Variables exclusively in GP. + mbin_min_orig_ = mbin_min_orig; + mbin_max_orig_ = mbin_max_orig; bend_orig_ = bend_orig; - rErr_orig_ = rErr; - zErr_orig_ = zErr; - - // Calculate unique module type ID, allowing pitch/sep of module to be determined. - // (N.B. Module types 0 & 1 have identical pitch & sep, but one is tilted & one is flat barrel module). - - moduleType_ = 999; - // EJC new (additional) module type for tilted geometry - const vector pitchVsType = {0.0099, 0.0099, 0.0099, 0.0099, 0.0089, 0.0099, 0.0089, 0.0089}; - const vector sepVsType = {0.26, 0.26, 0.16, 0.4, 0.18, 0.4, 0.18, 0.4}; - const vector barrelVsType = {true, true, true, true, true, false, false, false}; - const vector psVsType = {true, true, true, true, false, true, false, false}; - const vector tiltedVsType = {false, true, false, true, false, false, false, false}; - if (pitchVsType.size() != sepVsType.size()) - throw cms::Exception("DigitalStub: module type array size wrong"); - const float tol = 0.001; // Tolerance - for (unsigned int i = 0; i < pitchVsType.size(); i++) { - if (fabs(pitch - pitchVsType[i]) < tol && fabs(sep - sepVsType[i]) < tol && barrel == barrelVsType[i] && - tiltedBarrel == tiltedVsType[i] && psModule == psVsType[i]) { - moduleType_ = i; - } - } - if (moduleType_ == 999) - throw cms::Exception("DigitalStub: unknown module type") - << "pitch=" << pitch << " separation=" << sep << " barrel=" << barrel << " tilted=" << tiltedBarrel - << " PS=" << psModule << endl; - } - //=== Digitize stub for input to Geographic Processor, with stub phi coord. measured relative to phi nonant that contains specified phi sector. + // Phi of centre of phi sector and of nonant. + unsigned int iNonant = this->iNonant(iPhiSec); + phiSectorCentre_ = phiSectorWidth_ * double(iPhiSec) + phiCentreSec0_; + phiNonantCentre_ = phiNonantWidth_ * double(iNonant); - void DigitalStub::makeGPinput(unsigned int iPhiSec) { - if (!ranInit_) - throw cms::Exception("DigitalStub: You forgot to call init() before makeGPinput()!"); + phiS_orig_ = reco::deltaPhi(phi_orig_, phiSectorCentre_); + phiN_orig_ = reco::deltaPhi(phi_orig_, phiNonantCentre_); - unsigned int iPhiNon = - floor(iPhiSec * numPhiNonants_ / numPhiSectors_); // Find nonant corresponding to this sector. - - // If this stub was already digitized, we don't have to redo all the work again. Save CPU. - if (ranMakeGPinput_) { - if (iPhiNon == iDigi_Nonant_) { - return; // Work already done. - } else { - this->quickMakeGPinput(iPhiSec); - return; - } - } - - ranMakeGPinput_ = true; // Note we ran make(). - - //--- Shift axes of coords. if required. - - // r coordinate relative to specified point. - rt_orig_ = r_orig_ - chosenRofPhi_; - - // Phi coord. of stub relative to centre of nonant. - double phiNonantCentre = phiNonantWidth_ * double(iPhiNon); - - phiO_orig_ = reco::deltaPhi(phi_orig_, phiNonantCentre); - - //--- Digitize variables used exclusively in GP. - iDigi_Nonant_ = iPhiNon; - iDigi_PhiO_ = floor(phiO_orig_ * phiOMult_); - iDigi_Bend_ = round(bend_orig_ * bendMult_); // discrete values, so digitisation different - //--- Digitize variables used in both GP & HT. - iDigi_Rt_ = floor(rt_orig_ * rtMult_); - iDigi_Z_ = floor(z_orig_ * zMult_); - - //--- Determine floating point stub coords. from digitized numbers (so with degraded resolution). - //--- First for variables used exclusively in GP. - phiO_ = (iDigi_PhiO_ + 0.5) / phiOMult_; - bend_ = iDigi_Bend_ / bendMult_; // discrete values, so digitisation different - phi_ = reco::deltaPhi(phiO_, -phiNonantCentre); - //--- Then for variables used in both GP & HT. - rt_ = (iDigi_Rt_ + 0.5) / rtMult_; - r_ = rt_ + chosenRofPhi_; - z_ = (iDigi_Z_ + 0.5) / zMult_; - } - - //=== Digitize stub for input to Hough transform, with stub phi coord. measured relative to specified phi sector. - - void DigitalStub::makeHTinput(unsigned int iPhiSec) { - if (!ranInit_) - throw cms::Exception("DigitalStub: You forgot to call init() before makeHTinput()!"); - - // Digitize for GP input if not already done, since some variables are shared by GP & HT. - this->makeGPinput(iPhiSec); - - // If this stub was already digitized, we don't have to redo all the work again. Save CPU. - if (ranMakeHTinput_) { - if (iPhiSec == iDigi_PhiSec_) { - return; // Work already done. - } else { - this->quickMakeHTinput(iPhiSec); - return; - } - } - - ranMakeHTinput_ = true; // Note we ran makeHTinput(). - - //--- Shift axes of coords. if required. - - // Centre of this sector in phi - double phiCentreSec0 = -M_PI / float(numPhiNonants_) + M_PI / float(numPhiSectors_); - double phiSectorCentre = phiSectorWidth_ * float(iPhiSec) + phiCentreSec0; - - // Point in sector from which stub phiS should be measured. - double phiSectorRef = phiSectorCentre; - - // Phi coord. of stub relative to centre of sector. - phiS_orig_ = reco::deltaPhi(phi_orig_, phiSectorRef); - - //--- Digitize variables used exclusively by HT. - iDigi_PhiSec_ = iPhiSec; - iDigi_PhiS_ = floor(phiS_orig_ * phiSMult_); - // Don't bother digitising here variables used by both GP & HT, as makeGPinput() will already have digitized them. - - // N.B. If using daisy-chain firmware, then should logically recalculate m bin range here, since it depends on the now - // digitized r and z coordinates. But too lazy to move code here from Stub::digitizeForHTinput(), where calculation - // actually done. - - //--- Determine floating point stub coords. from digitized numbers (so with degraded resolution). - //--- First for variables used exclusively by HT - phiS_ = (iDigi_PhiS_ + 0.5) / phiSMult_; - phi_ = reco::deltaPhi(phiS_, - -phiSectorRef); // N.B. phi_ measured w.r.t sector here, but w.r.t. nonant in makeGPinput() - // Don't bother with variables used by both GP & HT, as makeGPinput() will already have already calculated them. - - //--- Do next two checks here rather than in makeGPinput(), as the latter may be called for stubs in the wrong nonant, so out of range. + // Used to check if new digi requests are for same sector as old + iPhiSec_done_ = iPhiSec; // Check that stub coords. are within assumed digitization range. this->checkInRange(); + // Digitize and then undigitize stub. + this->digitize(iPhiSec); + this->undigitize(iPhiSec); + // Check that digitization followed by undigitization doesn't change results too much. this->checkAccuracy(); - - // Adjust m-bin range, as hardware counts q/Pt bins in HT array using a signed integer in a symmetric range about zero. - const int min_array_bin = (nbinsPt_ % 2 == 0) ? -(nbinsPt_ / 2) : -(nbinsPt_ - 1) / 2; - m_min_ = min_qOverPt_bin_orig_ + min_array_bin; - m_max_ = max_qOverPt_bin_orig_ + min_array_bin; - - //--- Produce tracker layer identifier, encoded as it is sent along the optical link. - - if (reduceLayerID_) { - // Firmware is using "reduced" layer ID, which can be packed into 3 bits in range 1-7. - iDigi_LayerID_ = layerIDreduced_; - - } else { - // Firmware is using normal layer ID, which needs more than 3 bits to store it. - // Encode barrel layers as 0 to 5. - iDigi_LayerID_ = layerID_ - 1; - // Endcode endcap layers as 6 to 10, not bothering to distinguish the two endcaps. - if (iDigi_LayerID_ == 10 || iDigi_LayerID_ == 20) { - iDigi_LayerID_ = 6; - } else if (iDigi_LayerID_ == 11 || iDigi_LayerID_ == 21) { - iDigi_LayerID_ = 7; - } else if (iDigi_LayerID_ == 12 || iDigi_LayerID_ == 22) { - iDigi_LayerID_ = 8; - } else if (iDigi_LayerID_ == 13 || iDigi_LayerID_ == 23) { - iDigi_LayerID_ = 9; - } else if (iDigi_LayerID_ == 14 || iDigi_LayerID_ == 24) { - iDigi_LayerID_ = 10; - } - } } - //=== Digitize stub for input to r-z Seed Filter or Track Fitter. - //=== Argument is "SeedFilter" or name of Track Fitter. - //=== N.B. This digitisation is done internally within the FPGA not for transmission along opto-links. - - void DigitalStub::makeSForTFinput(string SForTF) { - if (!ranInit_) - throw cms::Exception("DigitalStub: You forgot to call init() before makeSForTFinput()!"); - - // Save CPU by not digitizing stub again if already done. - if (ranMakeSForTFinput_ != SForTF) { - ranMakeSForTFinput_ = SForTF; // Note we ran makeSForTFinput(). - - // The stub r coordinate is calculated inside the seed filter from the value of rT. - // Best to choose a ref. radius such that digitising then undigitising it leaves it unchanged. - iDigi_R_ = iDigi_Rt_ + std::round(chosenRofPhi_ * rtMult_); - - //--- Determine floating point variables from digtized numbers. - r_ = (iDigi_R_ + 0.5) / rtMult_; - rt_ = r_ - chosenRofPhi_; - - if (SForTF.find("KF") != string::npos) { - // Digitize variables that are exclusive to Kalman filter. - // Data format uses z directly from HT, as its multiplier is exactly a factor 2 - // smaller than for r, which is easy to fix in VHDL-HLS interface. - iDigi_Z_KF_ = iDigi_Z_; - // Determine floating point variable from digitized one, using z multiplier. - z_ = (iDigi_Z_KF_ + 0.5) / zMult_; - } else { - // If not using KF, then restore z value from HT. - iDigi_Z_KF_ = 0; // Shoudln't be used in this case. - z_ = (iDigi_Z_ + 0.5) / zMult_; - } - - if (SForTF == "SeedFilter") { - //--- Digitize variables used exclusively in seed filter. - // The stub (r,z) uncertainties are actually calculated inside the seed filter and not passed to it along optical links. - iDigi_rErr_ = ceil(rErr_orig_ * rtMult_); // Round up to avoid zero uncertainty ... - iDigi_zErr_ = ceil(zErr_orig_ * zMult_); - //--- Determine floating point variables from digtized numbers - rErr_ = (iDigi_rErr_ - 0.5) / rtMult_; - zErr_ = (iDigi_zErr_ - 0.5) / zMult_; - } else { - // Restore original value. Although perhaps better to leave? - rErr_ = rErr_orig_; - zErr_ = zErr_orig_; - } + //=== Redo phi digitisation assigning stub to a different phi sector; + + bool DigitalStub::changePhiSec(unsigned int iPhiSec) { + bool doUpdate = (iPhiSec != iPhiSec_done_); + + if (doUpdate) { + // phi sector has changed since last time digitisation was done, so update. + iPhiSec_done_ = iPhiSec; + unsigned int iNonant = this->iNonant(iPhiSec); + // Update original, floating point phi w.r.t. phi sector/nonant centre. + phiSectorCentre_ = phiSectorWidth_ * double(iPhiSec) + phiCentreSec0_; + phiNonantCentre_ = phiNonantWidth_ * double(iNonant); + phiS_orig_ = reco::deltaPhi(phi_orig_, phiSectorCentre_); + phiN_orig_ = reco::deltaPhi(phi_orig_, phiNonantCentre_); + // Update digitised phi. + iDigi_PhiN_ = floor(phiN_orig_ * phiNMult_); + iDigi_PhiS_ = floor(phiS_orig_ * phiSMult_); + // Update digitized then undigitized phi. + phiN_ = (iDigi_PhiN_ + 0.5) / phiNMult_; + phi_GP_ = reco::deltaPhi(phiN_, -phiNonantCentre_); + phiS_ = (iDigi_PhiS_ + 0.5) / phiSMult_; + phi_HT_TF_ = reco::deltaPhi(phiS_, -phiSectorCentre_); } + return doUpdate; } - void DigitalStub::makeDRinput(unsigned int stubId) { - if (!ranInit_) - throw cms::Exception("DigitalStub: You forgot to call init() before makeDRinput()!"); + //=== Set configuration parameters. + + void DigitalStub::setCfgParams(const Settings* settings) { + // Digitization configuration parameters + phiSectorBits_ = settings->phiSectorBits(); // No. of bits to store phi sector number + //--- Parameters available in HT board. + phiSBits_ = settings->phiSBits(); // No. of bits to store phiS coord. + phiSRange_ = settings->phiSRange(); // Range of phiS coord. in radians. + rtBits_ = settings->rtBits(); // No. of bits to store rT coord. + rtRange_ = settings->rtRange(); // Range of rT coord. in cm. + zBits_ = settings->zBits(); // No. of bits to store z coord. + zRange_ = settings->zRange(); // Range of z coord in cm. + //--- Parameters available in GP board (excluding any in common with HT specified above). + phiNBits_ = settings->phiNBits(); // No. of bits to store phiN parameter. + phiNRange_ = settings->phiNRange(); // Range of phiN parameter + bendBits_ = settings->bendBits(); // No. of bits to store stub bend. + + // Number of phi sectors and phi nonants. + numPhiSectors_ = settings->numPhiSectors(); + numPhiNonants_ = settings->numPhiNonants(); + // Phi sector and phi nonant width (radians) + phiSectorWidth_ = 2. * M_PI / double(numPhiSectors_); + phiNonantWidth_ = 2. * M_PI / double(numPhiNonants_); + // Centre of phi sector 0. + phiCentreSec0_ = -M_PI / double(numPhiNonants_) + M_PI / double(numPhiSectors_); + // Radius from beamline with respect to which stub r coord. is measured. + chosenRofPhi_ = settings->chosenRofPhi(); + + // Number of q/Pt bins in Hough transform array. + nbinsPt_ = (int)settings->houghNbinsPt(); + // Min. of m-bin range in firmware, + min_array_mbin_ = (nbinsPt_ % 2 == 0) ? -(nbinsPt_ / 2) : -(nbinsPt_ - 1) / 2; - ranMakeDRinput_ = true; // Note we ran makeDRinput(). - stubId_ = stubId; + // Calculate multipliers to digitize the floating point numbers. + phiSMult_ = pow(2, phiSBits_) / phiSRange_; + rtMult_ = pow(2, rtBits_) / rtRange_; + zMult_ = pow(2, zBits_) / zRange_; + phiNMult_ = pow(2, phiNBits_) / phiNRange_; + + // No precision lost by digitization, since original bend (after encoding) has steps of 0.25 (in units of pitch). + bendMult_ = 4.; + bendRange_ = round(pow(2, bendBits_) / bendMult_); // discrete values, so digitisation different } - //=== Redigitize stub for input to Geographic Processor, if it was previously digitized for a different phi sector. + //=== Digitize stub - void DigitalStub::quickMakeGPinput(int iPhiSec) { - //--- Shift axes of coords. if required. + void DigitalStub::digitize(unsigned int iPhiSec) { + //--- Digitize variables used exclusively in GP input. + iDigi_PhiN_ = floor(phiN_orig_ * phiNMult_); + iDigi_Bend_ = round(bend_orig_ * bendMult_); // discrete values, so digitisation different - // Phi coord. of stub relative to centre of nonant. - unsigned int iPhiNon = floor(iPhiSec * numPhiNonants_ / numPhiSectors_); - double phiNonantCentre = phiNonantWidth_ * double(iPhiNon); - phiO_orig_ = reco::deltaPhi(phi_orig_, phiNonantCentre); + //--- Digitize variables used exclusively in HT input. + iDigi_PhiS_ = floor(phiS_orig_ * phiSMult_); - //--- Digitize variables used exclusively in GP. - iDigi_Nonant_ = iPhiNon; - iDigi_PhiO_ = floor(phiO_orig_ * phiOMult_); + // Offset m-bin range allowed by bend to correspond to firmware. + mbin_min_ = mbin_min_orig_ + min_array_mbin_; + mbin_max_ = mbin_max_orig_ + min_array_mbin_; - //--- Determine floating point stub coords. from digitized numbers (so with degraded resolution). - //--- Variables used exclusively in GP. - phiO_ = (iDigi_PhiO_) / phiOMult_; - phi_ = reco::deltaPhi(phiO_, -phiNonantCentre); - } + //--- Digitize variables used in both GP & HT input. + iDigi_Rt_ = floor(rt_orig_ * rtMult_); - //=== Redigitize stub for input to Hough transform, if it was previously digitized for a different phi sector. + //-- Digitize variables used by SF & TF input + iDigi_R_ = iDigi_Rt_ + std::round(chosenRofPhi_ * rtMult_); - void DigitalStub::quickMakeHTinput(int iPhiSec) { - //--- Shift axes of coords. if required. + //-- Digitize variables used by everything + iDigi_Z_ = floor(z_orig_ * zMult_); + } - // Centre of this sector in phi - double phiCentreSec0 = -M_PI / float(numPhiNonants_) + M_PI / float(numPhiSectors_); - double phiSectorCentre = phiSectorWidth_ * float(iPhiSec) + phiCentreSec0; + //=== Undigitize stub again. - // Point in sector from which stub phiS should be measured. - double phiSectorRef = phiSectorCentre; + void DigitalStub::undigitize(unsigned int iPhiSec) { + //--- Undigitize variables used exclusively in GP. + phiN_ = (iDigi_PhiN_ + 0.5) / phiNMult_; + phi_GP_ = reco::deltaPhi(phiN_, -phiNonantCentre_); + bend_ = iDigi_Bend_ / bendMult_; // discrete values, so digitisation different - // Phi coord. of stub relative to centre of sector. - phiS_orig_ = reco::deltaPhi(phi_orig_, phiSectorRef); + //--- Undigitize variables used exclusively by HT & SF/TF + phiS_ = (iDigi_PhiS_ + 0.5) / phiSMult_; + phi_HT_TF_ = reco::deltaPhi(phiS_, -phiSectorCentre_); - // Check that stub coords. are within assumed digitization range. - this->checkInRange(); + //--- Undigitize variables used in both GP & HT. + rt_GP_HT_ = (iDigi_Rt_ + 0.5) / rtMult_; + r_GP_HT_ = rt_GP_HT_ + chosenRofPhi_; - //--- Digitize variables used in HT. - iDigi_PhiSec_ = iPhiSec; - iDigi_PhiS_ = floor(phiS_orig_ * phiSMult_); + //--- Undigitize variables used exclusively by SF/TF. + r_SF_TF_ = (iDigi_R_ + 0.5) / rtMult_; + rt_SF_TF_ = r_SF_TF_ - chosenRofPhi_; - //--- Determine floating point stub coords. from digitized numbers (so with degraded resolution). - //--- First for variables used in HT. - phiS_ = (iDigi_PhiS_) / phiSMult_; - phi_ = reco::deltaPhi(phiS_, -phiSectorRef); + //--- Undigitize variables used exclusively by everything. + z_ = (iDigi_Z_ + 0.5) / zMult_; } //=== Check that stub coords. are within assumed digitization range. void DigitalStub::checkInRange() const { - // All ranges are centred at zero, except for rho, which is +ve-definate. - if (fabs(phiS_orig_) >= 0.5 * phiSRange_) - throw cms::Exception("DigitalStub: Stub phiS is out of assumed digitization range.") - << " |phiS| = " << fabs(phiS_orig_) << " > " << 0.5 * phiSRange_ << endl; - if (fabs(rt_orig_) >= 0.5 * rtRange_) - throw cms::Exception("DigitalStub: Stub rT is out of assumed digitization range.") - << " |rt| = " << fabs(rt_orig_) << " > " << 0.5 * rtRange_ << endl; - if (fabs(z_orig_) >= 0.5 * zRange_) - throw cms::Exception("DigitalStub: Stub z is out of assumed digitization range.") - << " |z| = " << fabs(z_orig_) << " > " << 0.5 * zRange_ << endl; - if (fabs(phiO_orig_) >= 0.5 * phiORange_) - throw cms::Exception("DigitalStub: Stub phiO is out of assumed digitization range.") - << " |phiO| = " << fabs(phiO_orig_) << " > " << 0.5 * phiORange_ << endl; - if (fabs(bend_orig_) >= 0.5 * bendRange_) - throw cms::Exception("DigitalStub: Stub bend is out of assumed digitization range.") - << " |bend| = " << fabs(bend_orig_) << " > " << 0.5 * bendRange_ << endl; + if (std::abs(rt_orig_) >= 0.5 * rtRange_) + throw cms::Exception("BadConfig") << "DigitalStub: Stub rT is out of assumed digitization range." + << " |rt| = " << std::abs(rt_orig_) << " > " << 0.5 * rtRange_; + if (std::abs(z_orig_) >= 0.5 * zRange_) + throw cms::Exception("BadConfig") << "DigitalStub: Stub z is out of assumed digitization range." + << " |z| = " << std::abs(z_orig_) << " > " << 0.5 * zRange_; + if (std::abs(bend_orig_) >= 0.5 * bendRange_) + throw cms::Exception("BadConfig") << "DigitalStub: Stub bend is out of assumed digitization range." + << " |bend| = " << std::abs(bend_orig_) << " > " << 0.5 * bendRange_; + //--- Can't check phi range, as DigitalStub called for stubs before sector assignment. + //if (std::abs(phiS_orig_) >= 0.5 * phiSRange_) + // throw cms::Exception("BadConfig") << "DigitalStub: Stub phiS is out of assumed digitization range." + // << " |phiS| = " << std::abs(phiS_orig_) << " > " << 0.5 * phiSRange_; + //if (std::abs(phiN_orig_) >= 0.5 * phiNRange_) + // throw cms::Exception("BadConfig") << "DigitalStub: Stub phiN is out of assumed digitization range." + // << " |phiN| = " << std::abs(phiN_orig_) << " > " << 0.5 * phiNRange_; } //=== Check that digitisation followed by undigitisation doesn't change significantly the stub coordinates. void DigitalStub::checkAccuracy() const { - float TA = reco::deltaPhi(phi_, phi_orig_); - float TB = r_ - r_orig_; - float TC = z_ - z_orig_; - float TD = phiO_ - phiO_orig_; - float TE = bend_ - bend_orig_; - - static std::atomic nErr = 0; - const unsigned int maxErr = 20; // Print error message only this number of times. - if (nErr < maxErr) { - if (fabs(TA) > 0.001 || fabs(TB) > 0.3 || fabs(TC) > 0.25 || fabs(TD) > 0.005 || fabs(TE) > 0.01) { - nErr++; - cout << "WARNING: DigitalStub lost precision: " << TA << " " << TB << " " << TC << " " << TD << " " << TE - << endl; - } + double TA = reco::deltaPhi(phi_HT_TF_, phi_orig_); + double TB = r_GP_HT_ - r_orig_; + double TC = z_ - z_orig_; + double TD = bend_ - bend_orig_; + + // Compare to small numbers, representing acceptable precision loss. + constexpr double smallTA = 0.001, smallTB = 0.3, smallTC = 0.25, smallTD = 0.01; + if (std::abs(TA) > smallTA || std::abs(TB) > smallTB || std::abs(TC) > smallTC || std::abs(TD) > smallTD) { + throw cms::Exception("LogicError") << "WARNING: DigitalStub lost precision: " << TA << " " << TB << " " << TC + << " " << TD; } } diff --git a/L1Trigger/TrackFindingTMTT/src/DigitalTrack.cc b/L1Trigger/TrackFindingTMTT/src/DigitalTrack.cc index 9fa8693bcb0a2..f99fa085ca5c6 100644 --- a/L1Trigger/TrackFindingTMTT/src/DigitalTrack.cc +++ b/L1Trigger/TrackFindingTMTT/src/DigitalTrack.cc @@ -1,21 +1,19 @@ #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" #include "L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" #include "DataFormats/Math/interface/deltaPhi.h" +#include "FWCore/Utilities/interface/Exception.h" -#include +using namespace std; namespace tmtt { //=== Note configuration parameters. - DigitalTrack::DigitalTrack(const Settings* settings) + DigitalTrack::DigitalTrack(const Settings* settings, const string& fitterName, const L1fittedTrack* fitTrk) : - // Check DigitalTrack correctly initialized. - ranInit_(false), - ranMake_(false), - // Digitization configuration parameters settings_(settings), @@ -30,13 +28,77 @@ namespace tmtt { // Number of q/Pt bins in Hough transform array. nbinsPt_((int)settings->houghNbinsPt()), - invPtToDPhi_(settings->invPtToDphi()) {} + invPtToDPhi_(settings->invPtToDphi()), + + // Info about fitted track + fitterName_(fitterName), + nHelixParams_(fitTrk->nHelixParam()), + + nlayers_(fitTrk->numLayers()), + iPhiSec_(fitTrk->iPhiSec()), + iEtaReg_(fitTrk->iEtaReg()), + mBin_(int(fitTrk->cellLocationHT().first) - floor(settings_->houghNbinsPt() / 2)), + cBin_(int(fitTrk->cellLocationHT().second) - floor(settings_->houghNbinsPhi() / 2)), + mBinhelix_(int(fitTrk->cellLocationFit().first) - floor(settings_->houghNbinsPt() / 2)), + cBinhelix_(int(fitTrk->cellLocationFit().second) - floor(settings_->houghNbinsPhi() / 2)), + hitPattern_(fitTrk->hitPattern()), + consistent_(fitTrk->consistentHTcell()), + consistentSect_(fitTrk->consistentSector()), + accepted_(fitTrk->accepted()), + + qOverPt_orig_(fitTrk->qOverPt()), + oneOver2r_orig_(fitTrk->qOverPt() * invPtToDPhi_), + d0_orig_(fitTrk->d0()), + phi0_orig_(fitTrk->phi0()), + tanLambda_orig_(fitTrk->tanLambda()), + z0_orig_(fitTrk->z0()), + chisquaredRphi_orig_(fitTrk->chi2rphi()), + chisquaredRz_orig_(fitTrk->chi2rz()), + + // Same again with beam-spot constraint. + qOverPt_bcon_orig_(fitTrk->qOverPt_bcon()), + oneOver2r_bcon_orig_(fitTrk->qOverPt_bcon() * invPtToDPhi_), + phi0_bcon_orig_(fitTrk->phi0_bcon()), + chisquaredRphi_bcon_orig_(fitTrk->chi2rphi_bcon()) { + // Get digitisation parameters for this particular track fitter. + this->loadDigiCfg(fitterName); - //=== Get digitisation configuration parameters for the specific track fitter being used here. + // Complete storage of info about fitted track & truth particle. + double phiCentreSec0 = -M_PI / float(numPhiNonants_) + M_PI / float(numPhiSectors_); + phiSectorCentre_ = phiSectorWidth_ * float(iPhiSec_) + phiCentreSec0; + phi0rel_orig_ = reco::deltaPhi(fitTrk->phi0(), phiSectorCentre_); + phi0rel_bcon_orig_ = reco::deltaPhi(fitTrk->phi0_bcon(), phiSectorCentre_); - void DigitalTrack::getDigiCfg(const string& fitterName) { - if (fitterName == "SimpleLR") { - // SimpleLR track fitter + // FIX: Remove this BODGE once BCHI increased to 11 in KFstate.h + if (chisquaredRphi_orig_ >= chisquaredRange_) + chisquaredRphi_orig_ = chisquaredRange_ - 0.1; + if (chisquaredRphi_bcon_orig_ >= chisquaredRange_) + chisquaredRphi_bcon_orig_ = chisquaredRange_ - 0.1; + + // Associated truth, if any. + const TP* tp = fitTrk->matchedTP(); + bool tpOK = (tp != nullptr); + tp_tanLambda_ = tpOK ? tp->tanLambda() : 0; + tp_qoverpt_ = tpOK ? tp->qOverPt() : 0; + tp_pt_ = tpOK ? tp->pt() : 0; + tp_d0_ = tpOK ? tp->d0() : 0; + tp_eta_ = tpOK ? tp->eta() : 0; + tp_phi0_ = tpOK ? tp->phi0() : 0; + tp_z0_ = tpOK ? tp->z0() : 0; + tp_index_ = tpOK ? tp->index() : -1; + tp_useForAlgEff_ = tpOK ? tp->useForAlgEff() : 0; + tp_useForEff_ = tpOK ? tp->useForEff() : 0; + tp_pdgId_ = tpOK ? tp->pdgId() : 0; + + // Digitize track. + this->makeDigitalTrack(); + } + + //=== Load digitisation configuration parameters for the specific track fitter being used here. + + void DigitalTrack::loadDigiCfg(const string& fitterName) { + if (fitterName == "SimpleLR4") { + // SimpleLR4 track fitter skipTrackDigi_ = settings_->slr_skipTrackDigi(); oneOver2rBits_ = settings_->slr_oneOver2rBits(); oneOver2rRange_ = settings_->slr_oneOver2rRange(); @@ -81,108 +143,9 @@ namespace tmtt { chisquaredMult_ = pow(2., chisquaredBits_) / chisquaredRange_; } - //=== Initialize track with original, floating point track params - - void DigitalTrack::init(const string& fitterName, - unsigned int nHelixParams, - unsigned int iPhiSec, - unsigned int iEtaReg, - int mbin, - int cbin, - int mBinhelix, - int cBinhelix, - unsigned int hitPattern, - float qOverPt_orig, - float d0_orig, - float phi0_orig, - float tanLambda_orig, - float z0_orig, - float chisquaredRphi_orig, - float chisquaredRz_orig, - float qOverPt_bcon_orig, - float phi0_bcon_orig, - float chisquaredRphi_bcon_orig, // beam-spot constrained values. - unsigned int nLayers, - bool consistent, - bool consistentSect, - bool accepted, - float tp_qOverPt, - float tp_d0, - float tp_phi0, - float tp_tanLambda, - float tp_z0, - float tp_eta, - int tp_index, - bool tp_useForAlgEff, - bool tp_useForEff, - int tp_pdgId) { - ranInit_ = true; // Note we ran init(). - - fitterName_ = fitterName; - nHelixParams_ = nHelixParams; - - // Get digitisation parameters for this particular track fitter. - this->getDigiCfg(fitterName); - - double phiCentreSec0 = -M_PI / float(numPhiNonants_) + M_PI / float(numPhiSectors_); - phiSectorCentre_ = phiSectorWidth_ * float(iPhiSec) + phiCentreSec0; - - // FIX: Remove this BODGE once BCHI increased to 11 in KFstate.h - if (chisquaredRphi_orig >= chisquaredRange_) - chisquaredRphi_orig = chisquaredRange_ - 0.1; - if (chisquaredRphi_bcon_orig >= chisquaredRange_) - chisquaredRphi_bcon_orig = chisquaredRange_ - 0.1; - - qOverPt_orig_ = qOverPt_orig; - oneOver2r_orig_ = qOverPt_orig * invPtToDPhi_; - d0_orig_ = d0_orig; - phi0_orig_ = phi0_orig; - phi0rel_orig_ = reco::deltaPhi(phi0_orig_, phiSectorCentre_); - tanLambda_orig_ = tanLambda_orig; - z0_orig_ = z0_orig; - chisquaredRphi_orig_ = chisquaredRphi_orig; - chisquaredRz_orig_ = chisquaredRz_orig; - - // Same again with beam-spot constraint. - qOverPt_bcon_orig_ = qOverPt_bcon_orig; - oneOver2r_bcon_orig_ = qOverPt_bcon_orig * invPtToDPhi_; - phi0_bcon_orig_ = phi0_bcon_orig; - phi0rel_bcon_orig_ = reco::deltaPhi(phi0_bcon_orig_, phiSectorCentre_); - chisquaredRphi_bcon_orig_ = chisquaredRphi_bcon_orig; - - nlayers_ = nLayers; - iPhiSec_ = iPhiSec; - iEtaReg_ = iEtaReg; - mBin_ = mbin; - cBin_ = cbin; - mBinhelix_ = mBinhelix; - cBinhelix_ = cBinhelix; - hitPattern_ = hitPattern; - - consistent_ = consistent; - consistentSect_ = consistentSect; - accepted_ = accepted; - tp_tanLambda_ = tp_tanLambda; - tp_qoverpt_ = tp_qOverPt; - tp_pt_ = 1. / (1.0e-6 + fabs(tp_qOverPt)); - tp_d0_ = tp_d0; - tp_eta_ = tp_eta; - tp_phi0_ = tp_phi0; - tp_z0_ = tp_z0; - tp_index_ = tp_index; - tp_useForAlgEff_ = tp_useForAlgEff; - tp_useForEff_ = tp_useForEff; - tp_pdgId_ = tp_pdgId; - } - //=== Digitize track void DigitalTrack::makeDigitalTrack() { - if (!ranInit_) - throw cms::Exception("DigitalTrack: You forgot to call init() before makeDigitalTrack()!"); - - ranMake_ = true; // Note we ran makeDigitalTrack() - if (skipTrackDigi_) { // Optionally skip track digitisaton if done internally inside track fitting code, so // retain original helix params. @@ -240,11 +203,6 @@ namespace tmtt { if (!accepted_) iDigi_chisquaredRphi_bcon_ = pow(2., chisquaredBits_) - 1; - // if(settings_->digitizeSLR()){ - // mBinhelix_ = floor(iDigi_1over2r_/pow(2,5)); - // cBinhelix_ = floor(iDigi_phiT_/pow(2,7)); - // } - //--- Determine floating point track params from digitized numbers (so with degraded resolution). oneOver2r_ = (iDigi_oneOver2r_ + 0.5) / oneOver2rMult_; @@ -288,37 +246,41 @@ namespace tmtt { void DigitalTrack::checkInRange() const { if (accepted_) { // Don't bother apply to tracks rejected by the fitter. - if (fabs(oneOver2r_orig_) >= 0.5 * oneOver2rRange_) - throw cms::Exception("DigitalTrack: Track oneOver2r is out of assumed digitization range.") - << " |oneOver2r| = " << fabs(oneOver2r_orig_) << " > " << 0.5 * oneOver2rRange_ - << "; Fitter=" << fitterName_ << "; track accepted = " << accepted_ << endl; + if (std::abs(oneOver2r_orig_) >= 0.5 * oneOver2rRange_) + throw cms::Exception("BadConfig") + << "DigitalTrack: Track oneOver2r is out of assumed digitization range." + << " |oneOver2r| = " << std::abs(oneOver2r_orig_) << " > " << 0.5 * oneOver2rRange_ + << "; Fitter=" << fitterName_ << "; track accepted = " << accepted_; if (consistentSect_) { // don't bother if track will fail sector consistency cut. - if (fabs(phi0rel_orig_) >= 0.5 * phi0Range_) - throw cms::Exception("DigitalTrack: Track phi0rel is out of assumed digitization range.") - << " |phi0rel| = " << fabs(phi0rel_orig_) << " > " << 0.5 * phi0Range_ << "; Fitter=" << fitterName_ - << "; track accepted = " << accepted_ << endl; + if (std::abs(phi0rel_orig_) >= 0.5 * phi0Range_) + throw cms::Exception("BadConfig") << "DigitalTrack: Track phi0rel is out of assumed digitization range." + << " |phi0rel| = " << std::abs(phi0rel_orig_) << " > " << 0.5 * phi0Range_ + << "; Fitter=" << fitterName_ << "; track accepted = " << accepted_; } - if (fabs(z0_orig_) >= 0.5 * z0Range_) - throw cms::Exception("DigitalTrack: Track z0 is out of assumed digitization range.") - << " |z0| = " << fabs(z0_orig_) << " > " << 0.5 * z0Range_ << "; Fitter=" << fitterName_ - << "; track accepted = " << accepted_ << endl; - if (fabs(d0_orig_) >= 0.5 * d0Range_) - throw cms::Exception("DigitalTrack: Track d0 is out of assumed digitization range.") - << " |d0| = " << fabs(d0_orig_) << " > " << 0.5 * d0Range_ << "; Fitter=" << fitterName_ - << "; track accepted = " << accepted_ << endl; - if (fabs(tanLambda_orig_) >= 0.5 * tanLambdaRange_) - throw cms::Exception("DigitalTrack: Track tanLambda is out of assumed digitization range.") - << " |tanLambda| = " << fabs(tanLambda_orig_) << " > " << 0.5 * tanLambdaRange_ - << "; Fitter=" << fitterName_ << "; track accepted = " << accepted_ << endl; + if (std::abs(z0_orig_) >= 0.5 * z0Range_) + throw cms::Exception("BadConfig") << "DigitalTrack: Track z0 is out of assumed digitization range." + << " |z0| = " << std::abs(z0_orig_) << " > " << 0.5 * z0Range_ + << "; Fitter=" << fitterName_ << "; track accepted = " << accepted_; + if (std::abs(d0_orig_) >= 0.5 * d0Range_) + throw cms::Exception("BadConfig") << "DigitalTrack: Track d0 is out of assumed digitization range." + << " |d0| = " << std::abs(d0_orig_) << " > " << 0.5 * d0Range_ + << "; Fitter=" << fitterName_ << "; track accepted = " << accepted_; + if (std::abs(tanLambda_orig_) >= 0.5 * tanLambdaRange_) + throw cms::Exception("BadConfig") + << "DigitalTrack: Track tanLambda is out of assumed digitization range." + << " |tanLambda| = " << std::abs(tanLambda_orig_) << " > " << 0.5 * tanLambdaRange_ + << "; Fitter=" << fitterName_ << "; track accepted = " << accepted_; if (accepted_) { // Tracks declared invalid by fitter can have very large original chi2. if (chisquaredRphi_orig_ >= chisquaredRange_ or chisquaredRphi_orig_ < 0.) - throw cms::Exception("DigitalTrack: Track chisquaredRphi is out of assumed digitization range.") + throw cms::Exception("BadConfig") + << "DigitalTrack: Track chisquaredRphi is out of assumed digitization range." << " chisquaredRphi = " << chisquaredRphi_orig_ << " > " << chisquaredRange_ << " or < 0" - << "; Fitter=" << fitterName_ << "; track accepted = " << accepted_ << endl; + << "; Fitter=" << fitterName_ << "; track accepted = " << accepted_; if (chisquaredRz_orig_ >= chisquaredRange_ or chisquaredRz_orig_ < 0.) - throw cms::Exception("DigitalTrack: Track chisquaredRz is out of assumed digitization range.") + throw cms::Exception("BadConfig") + << "DigitalTrack: Track chisquaredRz is out of assumed digitization range." << " chisquaredRz = " << chisquaredRz_orig_ << " > " << chisquaredRange_ << " or < 0" - << "; Fitter=" << fitterName_ << "; track accepted = " << accepted_ << endl; + << "; Fitter=" << fitterName_ << "; track accepted = " << accepted_; } } } @@ -335,17 +297,14 @@ namespace tmtt { float TF = chisquaredRphi_ - chisquaredRphi_orig_; float TG = chisquaredRz_ - chisquaredRz_orig_; - static thread_local map nErr; // Count precision errors from each fitter. - if (nErr.find(fitterName_) == nErr.end()) - nErr[fitterName_] = 0; // Initialize error count. - const unsigned int maxErr = 20; // Print error message only this number of times. - if (nErr[fitterName_] < maxErr) { - if (fabs(TA) > 0.01 || fabs(TB) > 0.001 || fabs(TC) > 0.05 || fabs(TD) > 0.002 || fabs(TE) > 0.05 || - fabs(TF) > 0.5 || fabs(TG) > 0.5) { - nErr[fitterName_]++; - cout << "WARNING: DigitalTrack lost precision: " << fitterName_ << " accepted=" << accepted_ << " " << TA - << " " << TB << " " << TC << " " << TD << " " << TE << " " << TF << " " << TG << endl; - } + // Compare to small numbers, representing acceptable precision loss. + constexpr float smallTA = 0.01, smallTB = 0.001, smallTC = 0.05, smallTD = 0.002, smallTE = 0.05, smallTF = 0.5, + smallTG = 0.5; + if (std::abs(TA) > smallTA || std::abs(TB) > smallTB || std::abs(TC) > smallTC || std::abs(TD) > smallTD || + std::abs(TE) > smallTE || std::abs(TF) > smallTF || std::abs(TG) > smallTG) { + throw cms::Exception("LogicError") + << "WARNING: DigitalTrack lost precision: " << fitterName_ << " accepted=" << accepted_ << " " << TA << " " + << TB << " " << TC << " " << TD << " " << TE << " " << TF << " " << TG; } } } diff --git a/L1Trigger/TrackFindingTMTT/src/KillDupFitTrks.cc b/L1Trigger/TrackFindingTMTT/src/DupFitTrkKiller.cc similarity index 54% rename from L1Trigger/TrackFindingTMTT/src/KillDupFitTrks.cc rename to L1Trigger/TrackFindingTMTT/src/DupFitTrkKiller.cc index 4d815ac50d0bd..4e810cbc745f6 100644 --- a/L1Trigger/TrackFindingTMTT/src/KillDupFitTrks.cc +++ b/L1Trigger/TrackFindingTMTT/src/DupFitTrkKiller.cc @@ -1,41 +1,42 @@ -#include "L1Trigger/TrackFindingTMTT/interface/KillDupFitTrks.h" +#include "L1Trigger/TrackFindingTMTT/interface/DupFitTrkKiller.h" #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h" #include "FWCore/Utilities/interface/Exception.h" #include +using namespace std; + namespace tmtt { //=== Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. - void KillDupFitTrks::init(const Settings* settings, unsigned int dupTrkAlg) { - settings_ = settings; - dupTrkAlg_ = dupTrkAlg; - killDupTrks_.init(settings, dupTrkAlg); // Initialise duplicate removal algorithms that are common to all tracks. - } + DupFitTrkKiller::DupFitTrkKiller(const Settings* settings) + : settings_(settings), dupTrkAlg_(settings->dupTrkAlgFit()) {} //=== Eliminate duplicate tracks from the input collection, and so return a reduced list of tracks. - vector KillDupFitTrks::filter(const vector& vecTracks) const { + list DupFitTrkKiller::filter(const list& vecTracks) const { if (dupTrkAlg_ == 0) { // We are not running duplicate removal, so return original fitted track collection. - return vecTracks; + list copyTracks; + for (const L1fittedTrack& trk : vecTracks) { + copyTracks.push_back(&trk); + } + return copyTracks; } else { // Choose which algorithm to run, based on parameter dupTrkAlg_. switch (dupTrkAlg_) { // Run filters that only work on fitted tracks. - case 50: - return filterAlg50(vecTracks); + case 1: + return filterAlg1(vecTracks); break; - case 51: - return filterAlg51(vecTracks); + case 2: + return filterAlg2(vecTracks); break; - // Run filters that work on any type of track (l1track2d, l1track3d, l1fittedtrack). default: - return killDupTrks_.filter(vecTracks); + throw cms::Exception("BadConfig") << "KillDupTrks: Cfg option DupFitTrkAlg has invalid value."; } - - // Should never get here ... } } @@ -45,30 +46,28 @@ namespace tmtt { //=== N.B. This code runs on tracks in a single sector. It could be extended to run on tracks in entire //=== tracker by adding the track's sector number to memory "htCellUsed" below. - vector KillDupFitTrks::filterAlg50(const vector& tracks) const { + list DupFitTrkKiller::filterAlg1(const list& tracks) const { // Hard-wired options to play with. - const bool debug = false; - const bool doRecoveryStep = true; // Do 2nd pass through rejected tracks to see if any should be rescued. - const bool reduceDups = true; // Option attempting to reduce duplicate tracks during 2nd pass. - const bool memorizeAllHTcells = + constexpr bool debug = false; + constexpr bool doRecoveryStep = true; // Do 2nd pass through rejected tracks to see if any should be rescued. + constexpr bool reduceDups = true; // Option attempting to reduce duplicate tracks during 2nd pass. + constexpr bool memorizeAllHTcells = false; // First pass stores in memory all cells that the HT found tracks in, not just those of tracks accepted by the first pass. - const bool doSectorCheck = false; // Require fitted helix to lie within sector. - const bool usePtAndZ0Cuts = false; - // IRT - was false - const bool goOutsideArray = true; // Also store in memory stubs outside the HT array during 2nd pass. - // IRT - was false - const bool limitDiff = true; // Limit allowed diff. between HT & Fit cell to <= 1. + constexpr bool doSectorCheck = false; // Require fitted helix to lie within sector. + constexpr bool usePtAndZ0Cuts = false; + constexpr bool goOutsideArray = true; // Also store in memory stubs outside the HT array during 2nd pass. + constexpr bool limitDiff = true; // Limit allowed diff. between HT & Fit cell to <= 1. if (debug && tracks.size() > 0) - cout << "START " << tracks.size() << endl; + PrintL1trk() << "Start DupFitTrkKiller" << tracks.size(); - vector tracksFiltered; + list tracksFiltered; // Make a first pass through the tracks, doing initial identification of duplicate tracks. // N.B. BY FILLING THIS WITH CELLS AROUND SELECTED TRACKS, RATHER THAN JUST THE CELL CONTAINING THE // TRACK, ONE CAN REDUCE THE DUPLICATE RATE FURTHER, AT COST TO EFFICIENCY. set> htCellUsed; - vector tracksRejected; + list tracksRejected; // For checking if multiple tracks corresponding to same TP are accepted by duplicate removal. map> tpFound; @@ -78,20 +77,20 @@ namespace tmtt { // Only consider tracks whose fitted helix parameters are in the same sector as the HT originally used to find the track. if ((!doSectorCheck) || trk.consistentSector()) { if ((!usePtAndZ0Cuts) || - (fabs(trk.z0()) < settings_->beamWindowZ() && trk.pt() > settings_->houghMinPt() - 0.2)) { + (std::abs(trk.z0()) < settings_->beamWindowZ() && trk.pt() > settings_->houghMinPt() - 0.2)) { // For debugging. - const TP* tp = trk.getMatchedTP(); + const TP* tp = trk.matchedTP(); // Check if this track's fitted (q/pt, phi0) helix parameters correspond to the same HT cell as the HT originally found the track in. bool consistentCell = trk.consistentHTcell(); if (consistentCell) { // This track is probably not a duplicate, so keep & and store its HT cell location (which equals the HT cell corresponding to the fitted track). - tracksFiltered.push_back(trk); + tracksFiltered.push_back(&trk); // Memorize HT cell location corresponding to this track (identical for HT track & fitted track). if (!memorizeAllHTcells) { - pair htCell = trk.getCellLocationHT(); + pair htCell = trk.cellLocationHT(); htCellUsed.insert(htCell); - if (trk.getL1track3D().mergedHTcell()) { + if (trk.l1track3D()->mergedHTcell()) { // If this is a merged cell, block the other elements too, in case a track found by the HT in an unmerged cell // has a fitted cell there. pair htCell10(htCell.first + 1, htCell.second); @@ -104,48 +103,48 @@ namespace tmtt { } if (debug && tp != nullptr) { - cout << "FIRST PASS: m=" << trk.getCellLocationHT().first << "/" << trk.getCellLocationFit().first - << " c=" << trk.getCellLocationHT().second << "/" << trk.getCellLocationFit().second - << " Delta(m,c)=(" << int(trk.getCellLocationHT().first) - int(trk.getCellLocationFit().first) << "," - << int(trk.getCellLocationHT().second) - int(trk.getCellLocationFit().second) - << ") pure=" << trk.getPurity() << " merged=" << trk.getL1track3D().mergedHTcell() - << " #layers=" << trk.getL1track3D().getNumLayers() << " tp=" << tp->index() << " dupCell=(" - << tpFound[tp->index()].first << "," << tpFound[tp->index()].second - << ") dup=" << tpFoundAtPass[tp->index()] << endl; + PrintL1trk() << "FIRST PASS: m=" << trk.cellLocationHT().first << "/" << trk.cellLocationFit().first + << " c=" << trk.cellLocationHT().second << "/" << trk.cellLocationFit().second + << " Delta(m,c)=(" << int(trk.cellLocationHT().first) - int(trk.cellLocationFit().first) + << "," << int(trk.cellLocationHT().second) - int(trk.cellLocationFit().second) + << ") pure=" << trk.purity() << " merged=" << trk.l1track3D()->mergedHTcell() + << " #layers=" << trk.l1track3D()->numLayers() << " tp=" << tp->index() << " dupCell=(" + << tpFound[tp->index()].first << "," << tpFound[tp->index()].second + << ") dup=" << tpFoundAtPass[tp->index()]; // If the following two variables are non-zero in printout, then track has already been found, // so we have mistakenly kept a duplicate. if (tpFound.find(tp->index()) != tpFound.end()) - tpFound[tp->index()] = trk.getCellLocationFit(); + tpFound[tp->index()] = trk.cellLocationFit(); tpFoundAtPass[tp->index()] = 1; } } else { if (limitDiff) { const unsigned int maxDiff = 1; - if (abs(int(trk.getCellLocationHT().first) - int(trk.getCellLocationFit().first)) <= int(maxDiff) && - abs(int(trk.getCellLocationHT().second) - int(trk.getCellLocationFit().second)) <= int(maxDiff)) + if (abs(int(trk.cellLocationHT().first) - int(trk.cellLocationFit().first)) <= int(maxDiff) && + abs(int(trk.cellLocationHT().second) - int(trk.cellLocationFit().second)) <= int(maxDiff)) tracksRejected.push_back(&trk); } else { tracksRejected.push_back(&trk); } if (debug && tp != nullptr) { - cout << "FIRST REJECT: m=" << trk.getCellLocationHT().first << "/" << trk.getCellLocationFit().first - << " c=" << trk.getCellLocationHT().second << "/" << trk.getCellLocationFit().second - << " Delta(m,c)=(" << int(trk.getCellLocationHT().first) - int(trk.getCellLocationFit().first) << "," - << int(trk.getCellLocationHT().second) - int(trk.getCellLocationFit().second) - << ") pure=" << trk.getPurity() << " merged=" << trk.getL1track3D().mergedHTcell() - << " #layers=" << trk.getL1track3D().getNumLayers() << " tp=" << tp->index() << " dupCell=(" - << tpFound[tp->index()].first << "," << tpFound[tp->index()].second - << ") dup=" << tpFoundAtPass[tp->index()] << endl; + PrintL1trk() << "FIRST REJECT: m=" << trk.cellLocationHT().first << "/" << trk.cellLocationFit().first + << " c=" << trk.cellLocationHT().second << "/" << trk.cellLocationFit().second + << " Delta(m,c)=(" << int(trk.cellLocationHT().first) - int(trk.cellLocationFit().first) + << "," << int(trk.cellLocationHT().second) - int(trk.cellLocationFit().second) + << ") pure=" << trk.purity() << " merged=" << trk.l1track3D()->mergedHTcell() + << " #layers=" << trk.l1track3D()->numLayers() << " tp=" << tp->index() << " dupCell=(" + << tpFound[tp->index()].first << "," << tpFound[tp->index()].second + << ") dup=" << tpFoundAtPass[tp->index()]; } } // Memorize HT cell location corresponding to this track, even if it was not accepted by first pass.. if (memorizeAllHTcells) { pair htCell = - trk.getCellLocationFit(); // Intentionally used fit instead of HT here. + trk.cellLocationFit(); // Intentionally used fit instead of HT here. htCellUsed.insert(htCell); - if (trk.getL1track3D().mergedHTcell()) { + if (trk.l1track3D()->mergedHTcell()) { // If this is a merged cell, block the other elements too, in case a track found by the HT in an unmerged cell // has a fitted cell there. // N.B. NO GOOD REASON WHY "-1" IS NOT DONE HERE TOO. MIGHT REDUCE DUPLICATE RATE? @@ -165,28 +164,28 @@ namespace tmtt { // Making a second pass through the rejected tracks, checking if any should be rescued. for (const L1fittedTrack* trk : tracksRejected) { // Get location in HT array corresponding to fitted track helix parameters. - pair htCell = trk->getCellLocationFit(); + pair htCell = trk->cellLocationFit(); // If this HT cell was not already memorized, rescue this track, since it is probably not a duplicate, // but just a track whose fitted helix parameters are a bit wierd for some reason. if (std::count(htCellUsed.begin(), htCellUsed.end(), htCell) == 0) { - tracksFiltered.push_back(*trk); // Rescue track. + tracksFiltered.push_back(trk); // Rescue track. // Optionally store cell location to avoid rescuing other tracks at the same location, which may be duplicates of this track. bool outsideCheck = (goOutsideArray || trk->pt() > settings_->houghMinPt()); if (reduceDups && outsideCheck) htCellUsed.insert(htCell); // For debugging. - const TP* tp = trk->getMatchedTP(); + const TP* tp = trk->matchedTP(); if (debug && tp != nullptr) { - cout << "SECOND PASS: m=" << trk->getCellLocationHT().first << "/" << trk->getCellLocationFit().first - << " c=" << trk->getCellLocationHT().second << "/" << trk->getCellLocationFit().second - << " Delta(m,c)=(" << int(trk->getCellLocationHT().first) - int(trk->getCellLocationFit().first) << "," - << int(trk->getCellLocationHT().second) - int(trk->getCellLocationFit().second) - << ") pure=" << trk->getPurity() << " merged=" << trk->getL1track3D().mergedHTcell() - << " #layers=" << trk->getL1track3D().getNumLayers() << " tp=" << tp->index() << " dupCell=(" - << tpFound[tp->index()].first << "," << tpFound[tp->index()].second - << ") dup=" << tpFoundAtPass[tp->index()] << endl; + PrintL1trk() << "SECOND PASS: m=" << trk->cellLocationHT().first << "/" << trk->cellLocationFit().first + << " c=" << trk->cellLocationHT().second << "/" << trk->cellLocationFit().second + << " Delta(m,c)=(" << int(trk->cellLocationHT().first) - int(trk->cellLocationFit().first) + << "," << int(trk->cellLocationHT().second) - int(trk->cellLocationFit().second) + << ") pure=" << trk->purity() << " merged=" << trk->l1track3D()->mergedHTcell() + << " #layers=" << trk->l1track3D()->numLayers() << " tp=" << tp->index() << " dupCell=(" + << tpFound[tp->index()].first << "," << tpFound[tp->index()].second + << ") dup=" << tpFoundAtPass[tp->index()]; if (tpFound.find(tp->index()) != tpFound.end()) tpFound[tp->index()] = htCell; tpFoundAtPass[tp->index()] = 2; @@ -201,37 +200,38 @@ namespace tmtt { return tracksFiltered; } + //=== Duplicate removal algorithm designed to run after the track helix fit, which eliminates duplicates //=== simply by requiring that no two tracks should have fitted (q/Pt, phi0) that correspond to the same HT //=== cell. If they do, then only the first to arrive is kept. //=== N.B. This code runs on tracks in a single sector. It could be extended to run on tracks in entire //=== tracker by adding the track's sector number to memory "htCellUsed" below. - vector KillDupFitTrks::filterAlg51(const vector& tracks) const { + list DupFitTrkKiller::filterAlg2(const list& tracks) const { // Hard-wired options to play with. const bool debug = false; if (debug && tracks.size() > 0) - cout << "START " << tracks.size() << endl; + PrintL1trk() << "START " << tracks.size(); - vector tracksFiltered; + list tracksFiltered; set> htCellUsed; for (const L1fittedTrack& trk : tracks) { // Get location in HT array corresponding to fitted track helix parameters. - pair htCell = trk.getCellLocationFit(); + pair htCell = trk.cellLocationFit(); // If this HT cell was not already memorized, rescue this track, since it is probably not a duplicate, // but just a track whose fitted helix parameters are a bit wierd for some reason. if (std::count(htCellUsed.begin(), htCellUsed.end(), htCell) == 0) { - tracksFiltered.push_back(trk); // Rescue track. + tracksFiltered.push_back(&trk); // Rescue track. // Store cell location to avoid rescuing other tracks at the same location, which may be duplicates of this track. htCellUsed.insert(htCell); if (debug) { - const TP* tp = trk.getMatchedTP(); + const TP* tp = trk.matchedTP(); int tpIndex = (tp != nullptr) ? tp->index() : -999; - cout << "ALG51: m=" << trk.getCellLocationHT().first << "/" << trk.getCellLocationFit().first - << " c=" << trk.getCellLocationHT().second << "/" << trk.getCellLocationFit().second << " tp=" << tpIndex - << " pure=" << trk.getPurity() << endl; + PrintL1trk() << "ALG51: m=" << trk.cellLocationHT().first << "/" << trk.cellLocationFit().first + << " c=" << trk.cellLocationHT().second << "/" << trk.cellLocationFit().second + << " tp=" << tpIndex << " pure=" << trk.purity(); } } } @@ -244,32 +244,32 @@ namespace tmtt { } // Debug printout of which tracks are duplicates. - void KillDupFitTrks::printDuplicateTracks(const vector& tracks) const { - map> tpMap; - for (const L1fittedTrack& trk : tracks) { - const TP* tp = trk.getMatchedTP(); + void DupFitTrkKiller::printDuplicateTracks(const list& tracks) const { + map> tpMap; + for (const L1fittedTrack* trk : tracks) { + const TP* tp = trk->matchedTP(); if (tp != nullptr) { - tpMap[tp].push_back(&trk); + tpMap[tp].push_back(trk); } } for (const auto& p : tpMap) { const TP* tp = p.first; - const vector vecTrk = p.second; + const list vecTrk = p.second; if (vecTrk.size() > 1) { for (const L1fittedTrack* trk : vecTrk) { - cout << " MESS UP : m=" << trk->getCellLocationHT().first << "/" << trk->getCellLocationFit().first - << " c=" << trk->getCellLocationHT().second << "/" << trk->getCellLocationFit().second - << " tp=" << tp->index() << " tp_pt=" << tp->pt() << " fit_pt=" << trk->pt() - << " pure=" << trk->getPurity() << endl; - cout << " stubs = "; - for (const Stub* s : trk->getStubs()) - cout << s->index() << " "; - cout << endl; + PrintL1trk() << " MESS UP : m=" << trk->cellLocationHT().first << "/" << trk->cellLocationFit().first + << " c=" << trk->cellLocationHT().second << "/" << trk->cellLocationFit().second + << " tp=" << tp->index() << " tp_pt=" << tp->pt() << " fit_pt=" << trk->pt() + << " pure=" << trk->purity(); + PrintL1trk() << " stubs = "; + for (const Stub* s : trk->stubs()) + PrintL1trk() << s->index() << " "; + PrintL1trk(); } } } if (tracks.size() > 0) - cout << "FOUND " << tracks.size() << endl; + PrintL1trk() << "FOUND " << tracks.size(); } } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/HTbase.cc b/L1Trigger/TrackFindingTMTT/src/HTbase.cc index 32502e38635a6..d5560e92fbbc3 100644 --- a/L1Trigger/TrackFindingTMTT/src/HTbase.cc +++ b/L1Trigger/TrackFindingTMTT/src/HTbase.cc @@ -4,20 +4,30 @@ #include "DataFormats/Math/interface/deltaPhi.h" -#include #include using namespace std; namespace tmtt { + // Initialization. + HTbase::HTbase( + const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, unsigned int nBinsX, unsigned int nBinsY) + : settings_(settings), + iPhiSec_(iPhiSec), + iEtaReg_(iEtaReg), + nBinsX_(nBinsX), + nBinsY_(nBinsY), + htArray_(nBinsX, nBinsY), + optoLinkID_(this->calcOptoLinkID()) {} + //=== Termination. Causes HT array to search for tracks etc. void HTbase::end() { // Calculate useful info about each cell in array. - for (unsigned int i = 0; i < htArray_.size1(); i++) { - for (unsigned int j = 0; j < htArray_.size2(); j++) { - htArray_(i, j).end(); // Calls HTcell::end() + for (unsigned int i = 0; i < nBinsX_; i++) { + for (unsigned int j = 0; j < nBinsY_; j++) { + htArray_(i, j)->end(); // Calls HTcell::end() } } @@ -25,9 +35,6 @@ namespace tmtt { // and the track helix parameters, plus the associated truth particle (if any). trackCands2D_ = this->calcTrackCands2D(); - // Run algorithm to kill duplicate tracks (e.g. those sharing many hits in common). - trackCands2D_ = killDupTrks_.filter(trackCands2D_); - // If requested, kill those tracks in this sector that can't be read out during the time-multiplexed period, because // the HT has associated too many stubs to tracks. if (settings_->busySectorKill()) { @@ -41,9 +48,9 @@ namespace tmtt { unsigned int nStubs = 0; // Loop over cells in HT array. - for (unsigned int i = 0; i < htArray_.size1(); i++) { - for (unsigned int j = 0; j < htArray_.size2(); j++) { - nStubs += htArray_(i, j).numStubs(); // Calls HTcell::numStubs() + for (unsigned int i = 0; i < nBinsX_; i++) { + for (unsigned int j = 0; j < nBinsY_; j++) { + nStubs += htArray_(i, j)->numStubs(); // Calls HTcell::numStubs() } } @@ -56,10 +63,10 @@ namespace tmtt { unordered_set stubIDs; // Each ID stored only once, no matter how often it is added. // Loop over cells in HT array. - for (unsigned int i = 0; i < htArray_.size1(); i++) { - for (unsigned int j = 0; j < htArray_.size2(); j++) { + for (unsigned int i = 0; i < nBinsX_; i++) { + for (unsigned int j = 0; j < nBinsY_; j++) { // Loop over stubs in each cells, storing their IDs. - const vector& vStubs = htArray_(i, j).stubs(); // Calls HTcell::stubs() + const vector& vStubs = htArray_(i, j)->stubs(); // Calls HTcell::stubs() for (const Stub* stub : vStubs) { stubIDs.insert(stub->index()); } @@ -76,7 +83,7 @@ namespace tmtt { // Loop over track candidates for (const L1track2D& trk : trackCands2D_) { - nStubs += trk.getStubs().size(); + nStubs += trk.stubs().size(); } return nStubs; @@ -90,8 +97,8 @@ namespace tmtt { // Loop over track candidates, looking for those associated to given TP. for (const L1track2D& trk : trackCands2D_) { - if (trk.getMatchedTP() != nullptr) { - if (trk.getMatchedTP()->index() == tp.index()) + if (trk.matchedTP() != nullptr) { + if (trk.matchedTP()->index() == tp.index()) assocRecoTrk.push_back(&trk); } } @@ -99,25 +106,13 @@ namespace tmtt { return assocRecoTrk; } - //=== Function to replace the collection of 2D tracks found by this HT. - //=== (This is used by class MuxHToutputs to kill tracks that can't be output in the time-multiplexed period). - - void HTbase::replaceTrackCands2D(const vector& newTracks) { - vector tmpTracks; - for (const L1track2D* trk : newTracks) { - tmpTracks.push_back(*trk); - } - trackCands2D_.clear(); - trackCands2D_ = tmpTracks; - } - //=== Disable filters (used for debugging). void HTbase::disableBendFilter() { // Loop over cells in HT array. - for (unsigned int i = 0; i < htArray_.size1(); i++) { - for (unsigned int j = 0; j < htArray_.size2(); j++) { - htArray_(i, j).disableBendFilter(); + for (unsigned int i = 0; i < nBinsX_; i++) { + for (unsigned int j = 0; j < nBinsY_; j++) { + htArray_(i, j)->disableBendFilter(); } } } @@ -128,8 +123,7 @@ namespace tmtt { unsigned int nBinsAxis, float coordAxisMin, float coordAxisBinSize, - unsigned int killSomeHTcells, - bool debug) const { + unsigned int killSomeHTcells) const { float coordMin = coordRange.first; float coordMax = coordRange.second; float coordAvg = (coordRange.first + coordRange.second) / 2.; @@ -157,9 +151,9 @@ namespace tmtt { // Calculate fractional amount of min and max bin that this stub uses. float extraLow = (lower - coordMin) / coordAxisBinSize; float extraUp = (coordMax - upper) / coordAxisBinSize; - if (min(extraLow, extraUp) < -0.001 || max(extraLow, extraUp) > 1.001) - cout << "THIS SHOULD NOT HAPPEN " << extraLow - << endl; // allowing 0.001 tolerance for floating point precision here. + constexpr float small = 0.001; // allow tolerance on floating point precision. + if (min(extraLow, extraUp) < -small || max(extraLow, extraUp) > (1.0 + small)) + throw cms::Exception("LogicError") << "HTbase: convertCoordRangeToBinRange error"; if (extraLow < fracCut && (nbins >= 3 || extraLow < extraUp)) iCoordBinMin += 1; if (extraUp < fracCut && (nbins >= 3 || extraUp < extraLow)) @@ -170,24 +164,13 @@ namespace tmtt { iCoordBinMin = floor((coordAvg - coordAxisMin) / coordAxisBinSize); iCoordBinMax = iCoordBinMin; } else { - throw cms::Exception("HT: invalid HoughUseFullRange option in cfg"); + throw cms::Exception("BadConfig") << "HT: invalid KillSomeHTCells option in cfg"; } - if (debug) - cout << "Initial Coord range: " << coordMin << " " << coordMax << " " << iCoordBinMin << " " << iCoordBinMax - << endl; - // Limit range to dimensions of HT array. iCoordBinMin = max(iCoordBinMin, 0); iCoordBinMax = min(iCoordBinMax, int(nBinsAxis) - 1); - if (debug) { - float downPhiLim = coordAxisMin + iCoordBinMin * coordAxisBinSize; - float upPhiLim = coordAxisMin + (iCoordBinMax + 1) * coordAxisBinSize; - cout << "Final Coord range: " << downPhiLim << " " << upPhiLim << " " << iCoordBinMin << " " << iCoordBinMax - << endl; - } - // If whole range is outside HT array, flag this by setting range to specific values with min > max. if (iCoordBinMin > int(nBinsAxis) - 1 || iCoordBinMax < 0) { iCoordBinMin = int(nBinsAxis) - 1; @@ -200,36 +183,27 @@ namespace tmtt { //=== Return a list of all track candidates found in this array, giving access to all the stubs on each one //=== and the track helix parameters, plus the associated truth particle (if any). - vector HTbase::calcTrackCands2D() const { - vector trackCands2D; - - if (settings_->debug() == 3) - cout << "Printing track candidates in an HT array" << endl; - - const unsigned int numRows = htArray_.size1(); - const unsigned int numCols = htArray_.size2(); + list HTbase::calcTrackCands2D() const { + list trackCands2D; // Check if the hardware processes rows of the HT array in a specific order when outputting track candidates. // Currently this is by decreasing Pt for r-phi HT and unordered for r-z HT. - const vector iOrder = this->rowOrder(numRows); + const vector iOrder = this->rowOrder(nBinsX_); bool wantOrdering = (iOrder.size() > 0); - unsigned int numStubsLeft = 0; - unsigned int numStubsRight = 0; - // Loop over cells in HT array. - for (unsigned int i = 0; i < numRows; i++) { + for (unsigned int i = 0; i < nBinsX_; i++) { // Access rows in specific order if required. unsigned int iPos = wantOrdering ? iOrder[i] : i; - for (unsigned int j = 0; j < numCols; j++) { - if (htArray_(iPos, j).trackCandFound()) { // track candidate found in this cell. + for (unsigned int j = 0; j < nBinsY_; j++) { + if (htArray_(iPos, j)->trackCandFound()) { // track candidate found in this cell. // Note if this corresponds to a merged HT cell (e.g. 2x2). - const bool merged = htArray_(iPos, j).mergedCell(); + const bool merged = htArray_(iPos, j)->mergedCell(); // Get stubs on this track candidate. - const vector& stubs = htArray_(iPos, j).stubs(); + const vector& stubs = htArray_(iPos, j)->stubs(); // And note location of cell inside HT array. const pair cellLocation(iPos, j); @@ -237,20 +211,11 @@ namespace tmtt { // Get (q/Pt, phi0) or (tan_lambda, z0) corresponding to middle of this cell. const pair helixParams2D = this->helix2Dconventional(iPos, j); - // Store all this reconstruction info about this track. - // The L1track2D class automatically finds the associated MC truth Tracking Particle particle (if any) - L1track2D l1Trk2D(settings_, stubs, cellLocation, helixParams2D, iPhiSec_, iEtaReg_, optoLinkID_, merged); - - // Store all this info about the track. - trackCands2D.push_back(l1Trk2D); - - } else { - if (settings_->debug() == 3) - cout << " ."; // Indicate no track in this cell. + // Create track and store it. + trackCands2D.emplace_back( + settings_, stubs, cellLocation, helixParams2D, iPhiSec_, iEtaReg_, optoLinkID_, merged); } } - if (settings_->debug() == 3) - cout << endl; } return trackCands2D; diff --git a/L1Trigger/TrackFindingTMTT/src/HTcell.cc b/L1Trigger/TrackFindingTMTT/src/HTcell.cc index b77667af46bf2..6893f4597745d 100644 --- a/L1Trigger/TrackFindingTMTT/src/HTcell.cc +++ b/L1Trigger/TrackFindingTMTT/src/HTcell.cc @@ -2,6 +2,8 @@ #include "L1Trigger/TrackFindingTMTT/interface/TP.h" #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +using namespace std; + namespace tmtt { //=== Initialization with cfg params, @@ -9,48 +11,40 @@ namespace tmtt { //=== and the bin number of the cell along the q/Pt axis of the r-phi HT array, //=== and a flag indicating if this cell is the merge of smaller HT cells. - void HTcell::init(const Settings* settings, - unsigned int iPhiSec, - unsigned int iEtaReg, - float etaMinSector, - float etaMaxSector, - float qOverPt, - unsigned int ibin_qOverPt, - bool mergedCell, - bool miniHTcell) { - settings_ = settings; - - // Sector number - iPhiSec_ = iPhiSec; - iEtaReg_ = iEtaReg; - - // Note track q/Pt. - // In this case of an r-phi HT, each cell corresponds to a unique q/Pt. - // In the case of an r-z HT, it is assumed that we know q/Pt from previously run r-phi HT. - qOverPtCell_ = qOverPt; - // Note bin number of cell along q/Pt axis of r-phi HT array. (Not used if r-z HT). - ibin_qOverPt_ = ibin_qOverPt; - mergedCell_ = mergedCell; - // Is cell in Mini-HT? - miniHTcell_ = miniHTcell; - // Rapidity range of sector. - etaMinSector_ = etaMinSector; - etaMaxSector_ = etaMaxSector; - - invPtToDphi_ = settings->invPtToDphi(); // B*c/2E11 - - // Use filter in each HT cell using only stubs which have consistent bend? - useBendFilter_ = settings->useBendFilter(); - + HTcell::HTcell(const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float etaMinSector, + float etaMaxSector, + float qOverPt, + unsigned int ibin_qOverPt, + bool mergedCell, + bool miniHTcell) + : settings_(settings), + // Sector number + iPhiSec_(iPhiSec), + iEtaReg_(iEtaReg), + // Rapidity range of sector. + etaMinSector_(etaMinSector), + etaMaxSector_(etaMaxSector), + // Track q/Pt. + qOverPtCell_(qOverPt), + // Note bin number of cell along q/Pt axis of r-phi HT array. (Not used if r-z HT). + ibin_qOverPt_(ibin_qOverPt), + mergedCell_(mergedCell), + // Is cell in Mini-HT? + miniHTcell_(miniHTcell), + invPtToDphi_(settings->invPtToDphi()), // B*c/2E11 + // Use filter in each HT cell using only stubs which have consistent bend? + useBendFilter_(settings->useBendFilter()), + // Check if subsectors are being used within each sector. These are only ever used for r-phi HT. + numSubSecs_(settings->numSubSecsEta()) { // A filter is used each HT cell, which prevents more than the specified number of stubs being stored in the cell. (Reflecting memory limit of hardware). if (miniHTcell_) { maxStubsInCell_ = settings->maxStubsInCellMiniHough(); } else { maxStubsInCell_ = settings->maxStubsInCell(); } - - // Check if subsectors are being used within each sector. These are only ever used for r-phi HT. - numSubSecs_ = settings->numSubSecsEta(); } //=== Termination. Search for track in this HT cell etc. @@ -68,7 +62,8 @@ namespace tmtt { // Prevent too many stubs being stored in a single HT cell if requested (to reflect hardware memory limits). // N.B. This MUST be the last filter applied. - if (maxStubsInCell_ <= 99) + constexpr unsigned int disableThreshold = 999; + if (maxStubsInCell_ < disableThreshold) vFilteredStubs_ = this->maxStubCountFilter(vFilteredStubs_); // Calculate the number of layers the filtered stubs in this cell are in. @@ -105,10 +100,10 @@ namespace tmtt { //=== Produce a filtered collection of stubs in this cell that all have consistent bend. //=== Only called for r-phi Hough transform. - vector HTcell::bendFilter(const vector& stubs) const { + vector HTcell::bendFilter(const vector& stubs) const { // Create bend-filtered stub collection. - vector filteredStubs; - for (const Stub* s : stubs) { + vector filteredStubs; + for (Stub* s : stubs) { // Require stub bend to be consistent with q/Pt of this cell. unsigned int minBin = s->min_qOverPt_bin(); @@ -116,8 +111,6 @@ namespace tmtt { if (mergedCell_) { if (minBin % 2 == 1) minBin--; - // Next line not wanted with current m-bin range definition in Stub::calcQoverPtRange(). - //if ( maxBin % 2 == 1 ) maxBin++; } if (minBin <= ibin_qOverPt_ && ibin_qOverPt_ <= maxBin) filteredStubs.push_back(s); @@ -129,8 +122,8 @@ namespace tmtt { //=== Filter stubs so as to prevent more than specified number of stubs being stored in one cell. //=== This reflects finite memory of hardware. - vector HTcell::maxStubCountFilter(const vector& stubs) const { - vector filteredStubs; + vector HTcell::maxStubCountFilter(const vector& stubs) const { + vector filteredStubs; // If there are too many stubs in a cell, the hardware keeps (maxStubsInCell - 1) of the first stubs in the list // plus the last stub. if (stubs.size() > maxStubsInCell_) { diff --git a/L1Trigger/TrackFindingTMTT/src/HTrphi.cc b/L1Trigger/TrackFindingTMTT/src/HTrphi.cc index 5e9748b44d8ad..f49d88d866376 100644 --- a/L1Trigger/TrackFindingTMTT/src/HTrphi.cc +++ b/L1Trigger/TrackFindingTMTT/src/HTrphi.cc @@ -3,6 +3,8 @@ #include "L1Trigger/TrackFindingTMTT/interface/TP.h" #include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h" +#include "FWCore/ServiceRegistry/interface/Service.h" #include "DataFormats/Math/interface/deltaPhi.h" #include "FWCore/Utilities/interface/Exception.h" @@ -10,6 +12,10 @@ #include #include #include +#include +#include + +using namespace std; namespace tmtt { @@ -18,75 +24,49 @@ namespace tmtt { //=== Its axes are (q/Pt, phiTrk), where phiTrk is the phi at which the track crosses a //=== user-configurable radius from the beam-line. - using namespace std; - - // Maximum |gradient| of line corresponding to any stub. Should be less than the value of 1.0 assumed by the firmware. - std::atomic HTrphi::maxLineGradient_ = 0.; - // Error count when stub added to cell which does not lie NE, E or SE of stub added to previous HT column. - std::atomic HTrphi::numErrorsTypeA_ = 0; - // Error count when stub added to more than 2 cells in one HT column (problem only for Thomas' firmware). - std::atomic HTrphi::numErrorsTypeB_ = 0; - // Error count normalisation - std::atomic HTrphi::numErrorsNormalisation_ = 0; + namespace { + std::once_flag printOnce; + } //=== Initialise - void HTrphi::init(const Settings* settings, - unsigned int iPhiSec, - unsigned int iEtaReg, - float etaMinSector, - float etaMaxSector, - float phiCentreSector) { - HTbase::init(settings, iPhiSec, iEtaReg); - - invPtToDphi_ = settings->invPtToDphi(); - shape_ = settings->shape(); - - int nCellsHT = settings->houghNcellsRphi(); // Total number of required cells in HT array (if > 0) - - //--- Specification of HT q/Pt axis. - - maxAbsQoverPtAxis_ = 1. / settings->houghMinPt(); // Max. |q/Pt| covered by HT array. - nBinsQoverPtAxis_ = settings->houghNbinsPt(); // No. of bins in HT array in q/Pt. - if (nCellsHT > 0) - nBinsQoverPtAxis_ = 1; // Will calculate number of bins automatically. Initialize it to non-zero value. - binSizeQoverPtAxis_ = 2 * maxAbsQoverPtAxis_ / nBinsQoverPtAxis_; - if (shape_ == 2 || shape_ == 1 || settings_->shape() == 3) + HTrphi::HTrphi(const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float etaMinSector, + float etaMaxSector, + float phiCentreSector, + HTrphi::ErrorMonitor* errMon) + : HTbase(settings, iPhiSec, iEtaReg, settings->houghNbinsPt(), settings->houghNbinsPhi()), + invPtToDphi_((settings->invPtToDphi())), + shape_(static_cast(settings->shape())), // shape of HT cells + + //--- Specification of HT q/Pt axis. + maxAbsQoverPtAxis_(1. / settings->houghMinPt()), // Max. |q/Pt| covered by HT array. + nBinsQoverPtAxis_(settings->houghNbinsPt()), // No. of bins in HT array in q/Pt. + binSizeQoverPtAxis_(2 * maxAbsQoverPtAxis_ / nBinsQoverPtAxis_), + + //--- Specification of HT phiTrk axis + // (phiTrk corresponds to phi where track crosses radius = chosenRofPhi_). + chosenRofPhi_(settings->chosenRofPhi()), + phiCentreSector_(phiCentreSector), // Centre of phiTrk sector. + maxAbsPhiTrkAxis_(M_PI / float(settings->numPhiSectors())), // Half-width of phiTrk axis in HT array. + nBinsPhiTrkAxis_(settings->houghNbinsPhi()), // No. of bins in HT array phiTrk + binSizePhiTrkAxis_(2 * maxAbsPhiTrkAxis_ / nBinsPhiTrkAxis_), + errMon_(errMon) { + // Deal with unusually shaped HT cells. + if (shape_ != HTshape::square) binSizeQoverPtAxis_ = 2. * maxAbsQoverPtAxis_ / (nBinsQoverPtAxis_ - 1.); - - //--- Specification of HT phiTrk axis - - // N.B. phiTrk corresponds to phi where track crosses radius = chosenRofPhi_. - chosenRofPhi_ = settings->chosenRofPhi(); - phiCentreSector_ = phiCentreSector; // Centre of phiTrk sector. - maxAbsPhiTrkAxis_ = M_PI / float(settings->numPhiSectors()); // Half-width of phiTrk axis in HT array. - nBinsPhiTrkAxis_ = settings->houghNbinsPhi(); // No. of bins in HT array phiTrk - if (nCellsHT > 0) - nBinsPhiTrkAxis_ = 1; // Will calculate number of bins automatically. Initialize it to non-zero value. - binSizePhiTrkAxis_ = 2 * maxAbsPhiTrkAxis_ / nBinsPhiTrkAxis_; - if (shape_ == 2) + if (shape_ == HTshape::hexagon) binSizePhiTrkAxis_ = 2. * maxAbsPhiTrkAxis_ / (nBinsPhiTrkAxis_ - 1. / 6.); - else if (shape_ == 1) + else if (shape_ == HTshape::diamond) binSizePhiTrkAxis_ = 2. * maxAbsPhiTrkAxis_ / (nBinsPhiTrkAxis_ - 1. / 2.); - // Did user specify number of cells required in HT array? If so, determine number of bins along - // array axes such that their product equals required number of cells, and that their ratio gives - // a maximum line |gradient| of stubs crossing the array of 1.0. - if (nCellsHT > 0) { - // Get line gradient with current array axes. - float currentLineGrad = this->calcMaxLineGradArray(); - // Calculate new number of bins on each axis to meet constraint. - float fact = nBinsQoverPtAxis_ * currentLineGrad / nBinsPhiTrkAxis_; - nBinsQoverPtAxis_ = ceil(sqrt(nCellsHT * fact)); - nBinsPhiTrkAxis_ = int(sqrt(nCellsHT / fact)); - // And recalculate bin size accordingly. - binSizeQoverPtAxis_ = 2 * maxAbsQoverPtAxis_ / nBinsQoverPtAxis_; - binSizePhiTrkAxis_ = 2 * maxAbsPhiTrkAxis_ / nBinsPhiTrkAxis_; - } - // Note max. |gradient| that the line corresponding to any stub in any of the r-phi HT arrays could have. // Firmware assumes this should not exceed 1.0; - HTrphi::maxLineGradient_ = max(HTrphi::maxLineGradient_.load(), this->calcMaxLineGradArray()); + if (errMon_ != nullptr) { + errMon_->maxLineGradient = max(errMon_->maxLineGradient.load(), this->calcMaxLineGradArray()); + } // Optionally merge 2x2 neighbouring cells into a single cell at low Pt, to reduce efficiency loss due to // scattering. (Do this if either of options EnableMerge2x2 or MiniHTstage are enabled. @@ -107,17 +87,15 @@ namespace tmtt { // would require correcting the code after each called to mergedCell() below, since // "if (i%2 == 1) iStore = i - 1" not correct in this case). if (enableMerge2x2_ && (nBinsQoverPtAxis_ % 2 != 0 || nBinsPhiTrkAxis_ % 2 != 0)) - throw cms::Exception( - "HTrphi: You are not allowed to set EnableMerge2x2 or MiniHTstage = True if you have an odd number of bins " - "in r-phi HT array ") - << nBinsQoverPtAxis_ << " " << nBinsPhiTrkAxis_ << endl; + throw cms::Exception("BadConfig") << "HTrphi: You are not allowed to set EnableMerge2x2 or MiniHTstage = True if " + "you have an odd number of bins " + "in r-phi HT array " + << nBinsQoverPtAxis_ << " " << nBinsPhiTrkAxis_; //--- Other options used when filling the HT. // Don't fill all HT cells nominally crossed by line corresponding to stub. killSomeHTCellsRphi_ = settings->killSomeHTCellsRphi(); - // Should algorithm allow for uncertainty in stub (r,z) coordinate caused by length of 2S module strips when fill stubs in r-phi HT? - handleStripsRphiHT_ = settings->handleStripsRphiHT(); // Used to kill excess stubs or tracks that can't be transmitted within time-multiplexed period. nReceivedStubs_ = 0; @@ -147,7 +125,7 @@ namespace tmtt { rescaleMbins = (nTotalBins != nBinsQoverPtAxis_); // No rescaling allowed with MBinOrder option. if (rescaleMbins && busySectorUseMbinOrder_) - throw cms::Exception("HTrphi: BusySectorUserMbin error"); + throw cms::Exception("BadConfig") << "HTrphi: BusySectorUserMbin error"; float rescaleFactor = rescaleMbins ? float(nBinsQoverPtAxis_) / float(nTotalBins) : 1.; // Find lower and upper inclusive limits of each m bin range to be sent to a separate optical link. busySectorMbinLow_.resize(busySectorMbinRanges_.size()); @@ -159,13 +137,6 @@ namespace tmtt { mBinSum += rescaleFactor * busySectorMbinRanges_[i]; } } - - //--- Options for duplicate track removal after running HT. - unsigned int dupTrkAlgRphi = settings->dupTrkAlgRphi(); - HTbase::killDupTrks_.init(settings, dupTrkAlgRphi); - - // Resize HT array to suit these specifications, and initialise each cell with configuration parameters. - HTbase::htArray_.resize(nBinsQoverPtAxis_, nBinsPhiTrkAxis_, false); // for (unsigned int i = 0; i < nBinsQoverPtAxis_; i++) { for (unsigned int j = 0; j < nBinsPhiTrkAxis_; j++) { @@ -175,32 +146,29 @@ namespace tmtt { bool mergedCell = false; if (enableMerge2x2_ && this->mergedCell(i, j)) mergedCell = true; - HTbase::htArray_(i, j).init( - settings, iPhiSec, iEtaReg, etaMinSector, etaMaxSector, qOverPt, i, mergedCell); // Calls HTcell::init() + // Initialize each cell in HT array. + HTbase::htArray_(i, j) = + std::make_unique(settings, iPhiSec, iEtaReg, etaMinSector, etaMaxSector, qOverPt, i, mergedCell); } } - static std::atomic first = true; - if (first) { - first = false; - cout << "=== R-PHI HOUGH TRANSFORM AXES RANGES: abs(q/Pt) < " << maxAbsQoverPtAxis_ << " & abs(track-phi) < " - << maxAbsPhiTrkAxis_ << " ===" << endl; - cout << "=== R-PHI HOUGH TRANSFORM ARRAY SIZE: q/Pt bins = " << nBinsQoverPtAxis_ - << " & track-phi bins = " << nBinsPhiTrkAxis_ << " ===" << endl; - cout << "=== R-PHI HOUGH TRANSFORM BIN SIZE: BIN(q/Pt) = " << binSizeQoverPtAxis_ - << " & BIN(track-phi) = " << binSizePhiTrkAxis_ << " ===" << endl - << endl; - if (busySectorKill_ && busySectorUseMbinRanges_ && rescaleMbins) { - cout << "=== R-PHI HOUGH TRANSFORM WARNING: Rescaled m bin ranges specified by cfg parameter " - "BusySectorMbinRanges, as they were inconsistent with total number of m bins in HT." - << endl; - cout << "=== Rescaled values for BusySectorMbinRanges ="; - for (unsigned int i = 0; i < busySectorMbinRanges_.size(); i++) { - cout << " " << (busySectorMbinHigh_[i] - busySectorMbinLow_[i] + 1); - } - cout << endl; + std::stringstream text; + text << "=== R-PHI HOUGH TRANSFORM AXES RANGES: abs(q/Pt) < " << maxAbsQoverPtAxis_ << " & abs(track-phi) < " + << maxAbsPhiTrkAxis_ << " ===\n"; + text << "=== R-PHI HOUGH TRANSFORM ARRAY SIZE: q/Pt bins = " << nBinsQoverPtAxis_ + << " & track-phi bins = " << nBinsPhiTrkAxis_ << " ===\n"; + text << "=== R-PHI HOUGH TRANSFORM BIN SIZE: BIN(q/Pt) = " << binSizeQoverPtAxis_ + << " & BIN(track-phi) = " << binSizePhiTrkAxis_ << " ===\n\n"; + if (busySectorKill_ && busySectorUseMbinRanges_ && rescaleMbins) { + text << "=== R-PHI HOUGH TRANSFORM WARNING: Rescaled m bin ranges specified by cfg parameter " + "BusySectorMbinRanges, as they were inconsistent with total number of m bins in HT.\n"; + text << "=== Rescaled values for BusySectorMbinRanges ="; + for (unsigned int i = 0; i < busySectorMbinRanges_.size(); i++) { + text << " " << (busySectorMbinHigh_[i] - busySectorMbinLow_[i] + 1); } } + std::call_once( + printOnce, [](string t) { PrintL1trk() << t; }, text.str()); // Note helix parameters at the centre of each HT cell. cellCenters_.clear(); @@ -215,23 +183,26 @@ namespace tmtt { //=== Add stub to HT array. //=== If eta subsectors are being used within each sector, specify which ones the stub is compatible with. - void HTrphi::store(const Stub* stub, const vector& inEtaSubSecs) { + void HTrphi::store(Stub* stub, const vector& inEtaSubSecs) { // Optionally, only store stubs that can be sent from GP to HT within TM period. if ((!busyInputSectorKill_) || (nReceivedStubs_ < busyInputSectorNumStubs_)) { nReceivedStubs_++; + unsigned int jPhiTrkBinMinLast = 0; // Used for error checking + unsigned int jPhiTrkBinMaxLast = 99999; + // Loop over q/Pt related bins in HT array. for (unsigned int i = 0; i < nBinsQoverPtAxis_; i++) { - if (shape_ == 0) { + if (shape_ == HTshape::square) { //--- This is a traditional HT with square cells. // In this q/Pt bin, find the range of phi bins that this stub is consistent with. - pair iRange = this->iPhiRange(stub, i); - unsigned int iPhiTrkBinMin = iRange.first; - unsigned int iPhiTrkBinMax = iRange.second; + pair jRange = this->iPhiRange(stub, i); + unsigned int jPhiTrkBinMin = jRange.first; + unsigned int jPhiTrkBinMax = jRange.second; // Store stubs in these cells. - for (unsigned int j = iPhiTrkBinMin; j <= iPhiTrkBinMax; j++) { + for (unsigned int j = jPhiTrkBinMin; j <= jPhiTrkBinMax; j++) { bool canStoreStub = true; unsigned int iStore = i; unsigned int jStore = j; @@ -248,22 +219,26 @@ namespace tmtt { if (j % 2 == 1) jStore = j - 1; // If this stub was already stored in this merged 2x2 cell, then don't store it again. - if (HTbase::htArray_(iStore, jStore).stubStoredInCell(stub)) + if (HTbase::htArray_(iStore, jStore)->stubStoredInCell(stub)) canStoreStub = false; } } if (canStoreStub) - HTbase::htArray_(iStore, jStore).store(stub, inEtaSubSecs); // Calls HTcell::store() + HTbase::htArray_(iStore, jStore)->store(stub, inEtaSubSecs); // Calls HTcell::store() } // Check that limitations of firmware would not prevent stub being stored correctly in this HT column. - this->countFirmwareErrors(i, iPhiTrkBinMin, iPhiTrkBinMax); + if (errMon_ != nullptr) { + this->countFirmwareErrors(i, jPhiTrkBinMin, jPhiTrkBinMax, jPhiTrkBinMinLast, jPhiTrkBinMaxLast); + jPhiTrkBinMinLast = jPhiTrkBinMin; + jPhiTrkBinMaxLast = jPhiTrkBinMax; + } } else { //--- This is are novel HT with unusual shaped cells. - if (shape_ == 1) { + if (shape_ == HTshape::diamond) { //--- This HT has diamond shaped cells. float qOverPtBin = -maxAbsQoverPtAxis_ + i * binSizeQoverPtAxis_; @@ -273,16 +248,16 @@ namespace tmtt { phiTrk += binSizePhiTrkAxis_ / 2.; unsigned int binCenter = std::floor(phiTrk / binSizePhiTrkAxis_); if (binCenter < nBinsPhiTrkAxis_) - HTbase::htArray_(i, binCenter).store(stub, inEtaSubSecs); + HTbase::htArray_(i, binCenter)->store(stub, inEtaSubSecs); - } else if (shape_ == 2) { + } else if (shape_ == HTshape::hexagon) { //--- This HT has hexagonal cells (with two of its sides parallel to the phi axis). float qOverPtBin = -maxAbsQoverPtAxis_ + i * binSizeQoverPtAxis_; float qOverPtBinVar = binSizeQoverPtAxis_; float phiTrk = reco::deltaPhi(stub->phi(), phiCentreSector_) + invPtToDphi_ * qOverPtBin * (stub->r() - chosenRofPhi_) + maxAbsPhiTrkAxis_; - float phiTrkVar = invPtToDphi_ * qOverPtBinVar * std::fabs(stub->r() - chosenRofPhi_); + float phiTrkVar = invPtToDphi_ * qOverPtBinVar * std::abs(stub->r() - chosenRofPhi_); float phiTrkMin = phiTrk - phiTrkVar; float phiTrkMax = phiTrk + phiTrkVar; if (i % 2 == 0) @@ -305,20 +280,20 @@ namespace tmtt { binMin.first = (iMin % 3 == 0); binMax.first = (iMax % 3 == 0); if (binCenter.first && binCenter.second < nBinsPhiTrkAxis_) - HTbase::htArray_(i, binCenter.second).store(stub, inEtaSubSecs); + HTbase::htArray_(i, binCenter.second)->store(stub, inEtaSubSecs); else if (binMin.first && binMin.second < nBinsPhiTrkAxis_) - HTbase::htArray_(i, binMin.second).store(stub, inEtaSubSecs); + HTbase::htArray_(i, binMin.second)->store(stub, inEtaSubSecs); else if (binMax.first && binMax.second < nBinsPhiTrkAxis_) - HTbase::htArray_(i, binMax.second).store(stub, inEtaSubSecs); + HTbase::htArray_(i, binMax.second)->store(stub, inEtaSubSecs); - } else if (shape_ == 3) { + } else if (shape_ == HTshape::brick) { //--- This HT has square cells with alternate rows shifted horizontally by 0.5*cell_width. float qOverPtBin = -maxAbsQoverPtAxis_ + i * binSizeQoverPtAxis_; float qOverPtBinVar = binSizeQoverPtAxis_; float phiTrk = reco::deltaPhi(stub->phi(), phiCentreSector_) + invPtToDphi_ * qOverPtBin * (stub->r() - chosenRofPhi_) + maxAbsPhiTrkAxis_; - float phiTrkVar = invPtToDphi_ * qOverPtBinVar * std::fabs(stub->r() - chosenRofPhi_); + float phiTrkVar = invPtToDphi_ * qOverPtBinVar * std::abs(stub->r() - chosenRofPhi_); float phiTrkMin = phiTrk - phiTrkVar; float phiTrkMax = phiTrk + phiTrkVar; unsigned int iMin = std::floor(phiTrkMin / binSizePhiTrkAxis_ * 2.); @@ -330,9 +305,9 @@ namespace tmtt { binMin.first = (iMin % 2 == i % 2); binMax.first = (iMax % 2 == i % 2); if (binMin.first && binMin.second < nBinsPhiTrkAxis_) - HTbase::htArray_(i, binMin.second).store(stub, inEtaSubSecs); + HTbase::htArray_(i, binMin.second)->store(stub, inEtaSubSecs); else if (binMax.first && binMax.second < nBinsPhiTrkAxis_) - HTbase::htArray_(i, binMax.second).store(stub, inEtaSubSecs); + HTbase::htArray_(i, binMax.second)->store(stub, inEtaSubSecs); } } } @@ -343,7 +318,7 @@ namespace tmtt { unsigned int HTrphi::getMbinRange(const L1track2D& trk) const { if (busySectorUseMbinRanges_) { - unsigned int mBin = trk.getCellLocationHT().first; + unsigned int mBin = trk.cellLocationHT().first; unsigned int mBinOrder; if (busySectorUseMbinOrder_) { // User wants to group bins in a wierd order. @@ -353,7 +328,7 @@ namespace tmtt { mBinOrder = k; } if (mBinOrder == 99999) - throw cms::Exception("HTrphi::getMbinRange() mBinOrder calculation wrong."); + throw cms::Exception("LogicError") << "HTrphi::getMbinRange() mBinOrder calculation wrong."; } else { // User grouping bins in numerical order 0,1,2,3,4,5... mBinOrder = mBin; @@ -362,7 +337,7 @@ namespace tmtt { if (mBinOrder >= busySectorMbinLow_[i] && mBinOrder <= busySectorMbinHigh_[i]) return i; } - throw cms::Exception("HTrphi::getMbinRange() messed up"); + throw cms::Exception("LogicError") << "HTrphi::getMbinRange() messed up"; } else { return 0; } @@ -386,28 +361,10 @@ namespace tmtt { // The next line does the phiTrk calculation without the usual approximation, but it doesn't // improve performance. //float phiTrk = stub->phi() + asin(invPtToDphi_ * qOverPtBin * stub->r()) - asin(invPtToDphi_ * qOverPtBin * chosenRofPhi_); - float phiTrkVar = invPtToDphi_ * qOverPtBinVar * fabs(stub->r() - chosenRofPhi_); + float phiTrkVar = invPtToDphi_ * qOverPtBinVar * std::abs(stub->r() - chosenRofPhi_); float phiTrkMin = phiTrk - phiTrkVar; float phiTrkMax = phiTrk + phiTrkVar; - // Allow for uncertainty due to strip length if requested. - if (handleStripsRphiHT_) { - // Estimate uncertainty due to strip length, using first order derivative of phiTrk w.r.t. stub coords. - // Note that barrel modules only care about zErr and endcap ones about rErr. - float phiTrkVarStub; - if (stub->barrel()) { - phiTrkVarStub = 0.; - } else { - phiTrkVarStub = invPtToDphi_ * fabs(qOverPtBin) * stub->rErr(); - } - phiTrkMin -= phiTrkVarStub; - phiTrkMax += phiTrkVarStub; - } - - // Allow for multiple scattering/resolution - // phiTrkMin -= 0.005; - // phiTrkMax += 0.005; - float deltaPhiMin = reco::deltaPhi(phiTrkMin, phiCentreSector_); // Offset to centre of sector. float deltaPhiMax = reco::deltaPhi(phiTrkMax, phiCentreSector_); pair phiTrkRange(deltaPhiMin, deltaPhiMax); @@ -421,31 +378,24 @@ namespace tmtt { //=== Check that limitations of firmware would not prevent stub being stored correctly in this HT column. - void HTrphi::countFirmwareErrors(unsigned int iQoverPtBin, unsigned int iPhiTrkBinMin, unsigned int iPhiTrkBinMax) { - static std::atomic iPhiTrkBinMinLast = 0; - static std::atomic iPhiTrkBinMaxLast = 99999; - // Reinitialize if this is left-most column in HT array. - if (iQoverPtBin == 0) { - iPhiTrkBinMinLast = 0; - iPhiTrkBinMaxLast = 99999; - } - + void HTrphi::countFirmwareErrors(unsigned int iQoverPtBin, + unsigned int jPhiTrkBinMin, + unsigned int jPhiTrkBinMax, + unsigned int jPhiTrkBinMinLast, + unsigned int jPhiTrkBinMaxLast) { // Only do check if stub is being stored somewhere in this HT column. - if (iPhiTrkBinMax >= iPhiTrkBinMin) { + if (jPhiTrkBinMax >= jPhiTrkBinMin) { //--- Remaining code below checks that firmware could successfully store this stub in this column. // (a) Does cell lie NE, E or SE of cell filled in previous column? - bool OK_a = (iPhiTrkBinMin + 1 >= iPhiTrkBinMinLast) && (iPhiTrkBinMax <= iPhiTrkBinMaxLast + 1); - // (b) Are no more than 2 cells filled in this column (problem only for Thomas' firmware) - bool OK_b = (iPhiTrkBinMax - iPhiTrkBinMin + 1 <= 2); + bool OK_a = (jPhiTrkBinMin + 1 >= jPhiTrkBinMinLast) && (jPhiTrkBinMax <= jPhiTrkBinMaxLast + 1); + // (b) Are no more than 2 cells filled in this column + bool OK_b = (jPhiTrkBinMax - jPhiTrkBinMin + 1 <= 2); if (!OK_a) - numErrorsTypeA_++; + errMon_->numErrorsTypeA++; if (!OK_b) - numErrorsTypeB_++; - numErrorsNormalisation_++; // No. of times a stub is added to an HT column. - - iPhiTrkBinMinLast = iPhiTrkBinMin; - iPhiTrkBinMaxLast = iPhiTrkBinMax; + errMon_->numErrorsTypeB++; + errMon_->numErrorsNorm++; // No. of times a stub is added to an HT column. } } @@ -475,15 +425,22 @@ namespace tmtt { float qOverPtBinCenter = .5; float phiTrkBinCenter = .5; - if (shape_ == 2 || shape_ == 1 || shape_ == 3) + if (shape_ != HTshape::square) { qOverPtBinCenter = 0.; - if (shape_ == 2) - phiTrkBinCenter = (qOverPtBin % 2 == 0) ? 1. / 6. : 2. / 3.; - else if (shape_ == 1) - phiTrkBinCenter = (qOverPtBin % 2 == 0) ? 0. : 1. / 2.; - else if (shape_ == 3) - phiTrkBinCenter = (qOverPtBin % 2 == 0) ? 1. / 4. : 3. / 4.; + float evenPhiPos = 0., oddPhiPos = 0.; + if (shape_ == HTshape::hexagon) { + evenPhiPos = 1. / 6.; + oddPhiPos = 2. / 3.; + } else if (shape_ == HTshape::diamond) { + evenPhiPos = 0.; + oddPhiPos = 0.5; + } else if (shape_ == HTshape::brick) { + evenPhiPos = 0.25; + oddPhiPos = 0.75; + } + phiTrkBinCenter = (qOverPtBin % 2 == 0) ? evenPhiPos : oddPhiPos; + } float qOverPt = -maxAbsQoverPtAxis_ + (qOverPtBin + qOverPtBinCenter) * binSizeQoverPtAxis_; float phiTrk = -maxAbsPhiTrkAxis_ + (phiTrkBin + phiTrkBinCenter) * binSizePhiTrkAxis_; @@ -493,8 +450,8 @@ namespace tmtt { phiTrk += 0.5 * binSizePhiTrkAxis_; } - phiTrk = reco::deltaPhi(phiTrk + phiCentreSector_, - 0.); // Correct phiTrk to centre of sector, taking care of 2*pi wrapping + // Correct phiTrk to centre of sector, taking care of 2*pi wrapping + phiTrk = reco::deltaPhi(phiTrk + phiCentreSector_, 0.); return pair(qOverPt, phiTrk); } @@ -507,9 +464,8 @@ namespace tmtt { pair helix2Dht = this->helix2Dhough(i, j); // Convert to the conventionally agreed pair of helix parameters, (q/pt, phi0). float qOverPt = helix2Dht.first; // easy - float phi0 = reco::deltaPhi( - helix2Dht.second + invPtToDphi_ * chosenRofPhi_ * qOverPt, - 0.); // If HT defined track phi other than at r=0, must correct to get phi0. Allow for 2*pi wrapping of phi. + // If HT defined track phi other than at r=0, must correct to get phi0. Allow for 2*pi wrapping of phi. + float phi0 = reco::deltaPhi(helix2Dht.second + invPtToDphi_ * chosenRofPhi_ * qOverPt, 0.); return pair(qOverPt, phi0); } @@ -528,12 +484,10 @@ namespace tmtt { // Check if this cell was within the HT array. if (iQoverPt >= 0 && iQoverPt < int(nBinsQoverPtAxis_) && iPhiTrk >= 0 && iPhiTrk < int(nBinsPhiTrkAxis_)) { // Check if this cell is merged with its neighbours (as in low Pt region), and if so return merged cell location. - /* - if (this->mergedCell((unsigned int) iQoverPt, (unsigned int) iPhiTrk)) { - if (iQoverPt%2 == 1) iQoverPt -= 1; - if (iPhiTrk%2 == 1) iPhiTrk -= 1; - } - */ + // New: because 2nd stage mini HT may recreate tracks from merged cells with finer cell granularity, one can't predict + // if a merged cell was used to create a track merely by looking at its cell location. + // So instead ask L1track3D, which knows if it was created from a merged HT cell or not. + ; } else { // TP is not in this HT array at all. Flag this by setting "outside" bin index to 0 (Nbins) if outside array below (above). if (iQoverPt < 0) @@ -552,7 +506,7 @@ namespace tmtt { //=== Always uses beam-spot constrained trajectory if available. //=== (If fitted track is outside HT array, it it put in the closest bin inside it). - pair HTrphi::getCell(const L1fittedTrack* fitTrk) const { + pair HTrphi::cell(const L1fittedTrack* fitTrk) const { bool beamConstraint = fitTrk->done_bcon(); // Is beam-spot constraint available? (e.g. 5 param helix fit) // Get HT axis variables corresponding to this fitted track. float qOverPt = beamConstraint ? fitTrk->qOverPt_bcon() : fitTrk->qOverPt(); @@ -564,7 +518,7 @@ namespace tmtt { int iQoverPt = 999999; int iPhiTrk = 999999; - if (shape_ == 0) { + if (shape_ == HTshape::square) { //--- This is a traditional HT with square cells. iQoverPt = floor((qOverPt - (-maxAbsQoverPtAxis_)) / binSizeQoverPtAxis_); @@ -576,13 +530,7 @@ namespace tmtt { // New: because 2nd stage mini HT may recreate tracks from merged cells with finer cell granularity, one can't predict // if a merged cell was used to create a track merely by looking at its cell location. // So instead ask L1track3D, which knows if it was created from a merged HT cell or not. - - /* - if (fitTrk->getL1track3D().mergedHTcell()) { - if (iQoverPt%2 == 1) iQoverPt -= 1; - if (iPhiTrk%2 == 1) iPhiTrk -= 1; - } - */ + ; } else { // Fitted track is not in this HT array at all. Flag this by setting "outside" bin index to 0 (Nbins-1) if outside array below (above). if (iQoverPt < 0) @@ -637,13 +585,12 @@ namespace tmtt { if (enableMerge2x2_) { unsigned int i = iQoverPtBin; - unsigned int j = jPhiTrkBin; + //unsigned int j = jPhiTrkBin; // Calculate number of merged bins on each q/Pt side of array. float fMergeBins = (maxAbsQoverPtAxis_ - minInvPtToMerge2x2_) / (2. * binSizeQoverPtAxis_); // Number of unmerged bins this corresponds to, which must be even, since each merged bin comprises two normal q/pt bins. unsigned int numQoverPtBinsToMerge = 2 * min((unsigned int)(std::round(fMergeBins)), (nBinsQoverPtAxis_ / 4)); - // IRT - bug fix const float small = 0.001; if (minInvPtToMerge2x2_ < small && (unsigned int)(std::round(2. * fMergeBins)) % 2 == 1) numQoverPtBinsToMerge++; @@ -659,16 +606,16 @@ namespace tmtt { float HTrphi::calcMaxLineGradArray() const { // Get max. |gradient| possible in this HT array. - float gradOuter = fabs(invPtToDphi_ * (settings_->trackerOuterRadius() - chosenRofPhi_)); - float gradInner = fabs(invPtToDphi_ * (settings_->trackerInnerRadius() - chosenRofPhi_)); + float gradOuter = std::abs(invPtToDphi_ * (settings_->trackerOuterRadius() - chosenRofPhi_)); + float gradInner = std::abs(invPtToDphi_ * (settings_->trackerInnerRadius() - chosenRofPhi_)); float maxGrad = max(gradOuter, gradInner); // Convert it to units of bin width. maxGrad *= binSizeQoverPtAxis_ / binSizePhiTrkAxis_; - if (shape_ == 2) + if (shape_ == HTshape::hexagon) maxGrad *= 3.; - else if (shape_ == 1) + else if (shape_ == HTshape::diamond) maxGrad *= 2.; - else if (shape_ == 3) + else if (shape_ == HTshape::brick) maxGrad *= 4.; return maxGrad; } @@ -676,17 +623,17 @@ namespace tmtt { //=== If requested, kill those tracks in this sector that can't be read out during the time-multiplexed period, because //=== the HT has associated too many stubs to tracks. - vector HTrphi::killTracksBusySec(const vector& tracks) const { - vector outTracks; + list HTrphi::killTracksBusySec(const list& tracks) const { + list outTracks; if (busySectorKill_) { unsigned int nStubsOut = 0; // #stubs assigned to tracks in this sector. - vector nStubsOutInRange(busySectorMbinRanges_.size(), - 0); // #stubs assigned to each m bin range in this sector. + // #stubs assigned to each m bin range in this sector. + vector nStubsOutInRange(busySectorMbinRanges_.size(), 0); for (const L1track2D& trk : tracks) { bool keep = true; - unsigned int nStubs = trk.getNumStubs(); // #stubs on this track. + unsigned int nStubs = trk.numStubs(); // #stubs on this track. if (busySectorUseMbinRanges_) { // Are tracks from different m bin ranges output seperately to increase bandwidth? unsigned int mBinRange = this->getMbinRange(trk); // Which m bin range is this track in? nStubsOutInRange[mBinRange] += nStubs; diff --git a/L1Trigger/TrackFindingTMTT/src/Histos.cc b/L1Trigger/TrackFindingTMTT/src/Histos.cc index 8faa5b209886b..eb4c0163be66c 100644 --- a/L1Trigger/TrackFindingTMTT/src/Histos.cc +++ b/L1Trigger/TrackFindingTMTT/src/Histos.cc @@ -2,37 +2,46 @@ #include "L1Trigger/TrackFindingTMTT/interface/InputData.h" #include "L1Trigger/TrackFindingTMTT/interface/Sector.h" #include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h" -#include "L1Trigger/TrackFindingTMTT/interface/Get3Dtracks.h" +#include "L1Trigger/TrackFindingTMTT/interface/Make3Dtracks.h" #include "L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h" #include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" #include "L1Trigger/TrackFindingTMTT/interface/Utility.h" +#include "L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h" #include "DataFormats/Math/interface/deltaPhi.h" #include "DataFormats/Math/interface/deltaR.h" #include "FWCore/Utilities/interface/Exception.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "TH1F.h" +#include "TH2F.h" +#include "TH2Poly.h" +#include "TF1.h" +#include "TPad.h" +#include "TProfile.h" +#include "TGraphAsymmErrors.h" +#include "TGraph.h" +#include "TEfficiency.h" #include #include #include -#include +#include +#include +#include +#include using namespace std; namespace tmtt { + namespace { + std::once_flag printOnce; + std::mutex myMutex[6]; + } // namespace + //=== Store cfg parameters. - Histos::Histos(const Settings* settings) : settings_(settings), plotFirst_(true), bApproxMistake_(false) { + Histos::Histos(const Settings* settings) : settings_(settings), oldSumW2opt_(false), bApproxMistake_(false) { genMinStubLayers_ = settings->genMinStubLayers(); numPhiSectors_ = settings->numPhiSectors(); numEtaRegions_ = settings->numEtaRegions(); @@ -50,9 +59,10 @@ namespace tmtt { void Histos::book() { // Don't bother booking histograms if user didn't request them via TFileService in their cfg. - if (!this->enabled()) + if (not this->enabled()) return; + oldSumW2opt_ = TH1::GetDefaultSumw2(); TH1::SetDefaultSumw2(true); // Book histograms about input data. @@ -64,8 +74,6 @@ namespace tmtt { // Book histograms about r-z track filters. if (ranRZfilter_) this->bookRZfilters(); - // Book histograms for studying freak, extra large events at HT. - this->bookStudyBusyEvents(); // Book histograms studying 3D track candidates found after HT. this->bookTrackCands("HT"); // Book histograms studying 3D track candidates found after r-z track filter. @@ -78,49 +86,39 @@ namespace tmtt { //=== Fill all histograms void Histos::fill(const InputData& inputData, - const matrix& mSectors, - const matrix& mHtRphis, - const matrix mGet3Dtrks, - const std::map>& fittedTracks) { + const matrix>& mSectors, + const matrix>& mHtRphis, + const matrix>& mMake3Dtrks, + const std::map>& mapFinalTracks) { + // Each function here protected by a mytex lock, so only one thread can run it at a time. + // Don't bother filling histograms if user didn't request them via TFileService in their cfg. - if (!this->enabled()) + if (not this->enabled()) return; // Fill histograms about input data. this->fillInputData(inputData); + // Fill histograms checking if (eta,phi) sector definition choices are good. this->fillEtaPhiSectors(inputData, mSectors); + // Fill histograms checking filling of r-phi HT array. this->fillRphiHT(mHtRphis); + // Fill histograms about r-z track filters. if (ranRZfilter_) - this->fillRZfilters(mGet3Dtrks); - // Fill histograms for studying freak, extra large events at HT. - this->fillStudyBusyEvents(inputData, mSectors, mHtRphis, mGet3Dtrks); + this->fillRZfilters(mMake3Dtrks); + // Fill histograms studying 3D track candidates found after HT. - vector tracksHT; - bool withRZfilter = false; - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); - const std::vector& tracks = get3Dtrk.trackCands3D(withRZfilter); - tracksHT.insert(tracksHT.end(), tracks.begin(), tracks.end()); - } - this->fillTrackCands(inputData, tracksHT, "HT"); + this->fillTrackCands(inputData, mMake3Dtrks, "HT"); + // Fill histograms studying 3D track candidates found after r-z track filter. if (ranRZfilter_) { - vector tracksRZ; - bool withRZfilter = true; - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); - const std::vector& tracks = get3Dtrk.trackCands3D(withRZfilter); - tracksRZ.insert(tracksRZ.end(), tracks.begin(), tracks.end()); - } - this->fillTrackCands(inputData, tracksRZ, "RZ"); + this->fillTrackCands(inputData, mMake3Dtrks, "RZ"); } + // Fill histograms studying track fitting performance - this->fillTrackFitting(inputData, fittedTracks); + this->fillTrackFitting(inputData, mapFinalTracks); } //=== Book histograms using input stubs and tracking particles. @@ -128,113 +126,13 @@ namespace tmtt { TFileDirectory Histos::bookInputData() { TFileDirectory inputDir = fs_->mkdir("InputData"); - // N.B. Histograms of the kinematics and production vertex of tracking particles - // are booked in bookTrackCands(), since they are used to study the tracking efficiency. - - hisNumEvents_ = inputDir.make("NumEvents", ";; No. of events", 1, -0.5, 0.5); - - // Count stubs & tracking particles. - - profNumStubs_ = inputDir.make("NumStubs", "; Category; No. stubs in tracker", 4, 0.5, 4.5); - profNumStubs_->GetXaxis()->SetBinLabel(1, "All stubs"); - profNumStubs_->GetXaxis()->SetBinLabel(2, "Genuine stubs"); - profNumStubs_->GetXaxis()->SetBinLabel(3, "Stubs matched to TP"); - profNumStubs_->GetXaxis()->SetBinLabel(4, "Stubs matched to TP for eff"); - profNumStubs_->LabelsOption("d"); - hisStubsVsEta_ = inputDir.make("StubsVsEta", "; #eta; No. stubs in tracker", 30, -3.0, 3.0); hisStubsVsR_ = inputDir.make("StubsVsR", "; radius (cm); No. stubs in tracker", 1200, 0., 120.); - hisStubsVsRVsZ_ = inputDir.make( - "StubsVsRVsZ", "; z (cm); radius (cm); No. stubs in tracker", 1000, -280, 280, 1000, 0, 130); - hisStubsModuleVsRVsZ_ = inputDir.make( - "StubsModuleVsRVsZ", "; z (cm); radius (cm); No. stubs in tracker", 1000, -280, 280, 1000, 0, 130); - hisStubsVsRVsPhi_ = inputDir.make( - "StubsVsRVsPhi", "; x (cm); y (cm); No. stubs in tracker", 1000, -130, 130, 1000, -130, 130); - hisStubsModuleVsRVsPhi_ = inputDir.make( - "StubsModuleVsRVsPhi", "; x (cm); y (cm); No. stubs in tracker", 1000, -130, 130, 1000, -130, 130); - hisStubsModuleTiltVsZ_ = - inputDir.make("StubsModuleTiltVsZ", "; z (cm); Tilt; Module tilt vs z", 1000, -280, 280, 128, -3.2, 3.2); - hisStubsdPhiCorrectionVsZ_ = inputDir.make( - "StubsdPhiCorrectionVsZ", "; z (cm); Correction; dPhi Correction vs z", 1000, -280, 280, 100, -1, 10); - - hisStubsVsRVsZ_outerModuleAtSmallerR_ = inputDir.make("StubsVsRVsZ_outerModuleAtSmallerR", - "; z (cm); radius (cm); No. stubs in tracker", - 1000, - -280, - 280, - 1000, - 0, - 130); - hisStubsVsRVsPhi_outerModuleAtSmallerR_ = inputDir.make("StubsVsRVsPhi_outerModuleAtSmallerR", - "; x (cm); y (cm); No. stubs in tracker", - 1000, - -130, - 130, - 1000, - -130, - 130); - - profNumTPs_ = inputDir.make("NumTPs", "; Category; No. of TPs in tracker", 3, 0.5, 3.5); - profNumTPs_->GetXaxis()->SetBinLabel(1, "All TPs"); - profNumTPs_->GetXaxis()->SetBinLabel(2, "TPs for eff."); - profNumTPs_->GetXaxis()->SetBinLabel(3, "TPs for alg. eff."); - profNumTPs_->LabelsOption("d"); - - hisNumStubsPerTP_ = inputDir.make("NumStubsPerTP", "; Number of stubs per TP for alg. eff.", 50, -0.5, 49.5); - hisNumPSStubsPerTP_ = - inputDir.make("NumPSStubsPerTP", "; Number of PS stubs per TP for alg. eff.", 50, -0.5, 49.5); - hisNum2SStubsPerTP_ = - inputDir.make("Num2SStubsPerTP", "; Number of 2S stubs per TP for alg. eff.", 50, -0.5, 49.5); - hisNumLayersPerTP_ = inputDir.make("NumLayersPerTP", "; Number of layers per TP for alg. eff.", 50, -0.5, 49.5); hisNumPSLayersPerTP_ = inputDir.make("NumPSLayersPerTP", "; Number of PS layers per TP for alg. eff.", 50, -0.5, 49.5); - hisNum2SLayersPerTP_ = - inputDir.make("Num2SLayersPerTP", "; Number of 2S layers per TP for alg. eff.", 50, -0.5, 49.5); - - hisNumLayersPerTP_muons_ = - inputDir.make("NumLayersPerTP_muons", "; Number of layers per TP for alg. eff.", 50, -0.5, 49.5); - hisNumPSLayersPerTP_muons_ = - inputDir.make("NumPSLayersPerTP_muons", "; Number of PS layers per TP for alg. eff.", 50, -0.5, 49.5); - hisNum2SLayersPerTP_muons_ = - inputDir.make("Num2SLayersPerTP_muons", "; Number of 2S layers per TP for alg. eff.", 50, -0.5, 49.5); - - hisNumLayersPerTP_electrons_ = - inputDir.make("NumLayersPerTP_electrons", "; Number of layers per TP for alg. eff.", 50, -0.5, 49.5); - hisNumPSLayersPerTP_electrons_ = - inputDir.make("NumPSLayersPerTP_electrons", "; Number of PS layers per TP for alg. eff.", 50, -0.5, 49.5); - hisNum2SLayersPerTP_electrons_ = - inputDir.make("Num2SLayersPerTP_electrons", "; Number of 2S layers per TP for alg. eff.", 50, -0.5, 49.5); - - hisNumLayersPerTP_pions_ = - inputDir.make("NumLayersPerTP_pions", "; Number of layers per TP for alg. eff.", 50, -0.5, 49.5); - hisNumPSLayersPerTP_pions_ = - inputDir.make("NumPSLayersPerTP_pions", "; Number of PS layers per TP for alg. eff.", 50, -0.5, 49.5); - hisNum2SLayersPerTP_pions_ = - inputDir.make("Num2SLayersPerTP_pions", "; Number of 2S layers per TP for alg. eff.", 50, -0.5, 49.5); - - hisNumLayersPerTP_lowPt_ = - inputDir.make("NumLayersPerTP_lowPt", "; Number of layers per TP for alg. eff.", 50, -0.5, 49.5); - hisNumPSLayersPerTP_lowPt_ = - inputDir.make("NumPSLayersPerTP_lowPt", "; Number of PS layers per TP for alg. eff.", 50, -0.5, 49.5); - hisNum2SLayersPerTP_lowPt_ = - inputDir.make("Num2SLayersPerTP_lowPt", "; Number of 2S layers per TP for alg. eff.", 50, -0.5, 49.5); - - hisNumLayersPerTP_mediumPt_ = - inputDir.make("NumLayersPerTP_mediumPt", "; Number of layers per TP for alg. eff.", 50, -0.5, 49.5); - hisNumPSLayersPerTP_mediumPt_ = - inputDir.make("NumPSLayersPerTP_mediumPt", "; Number of PS layers per TP for alg. eff.", 50, -0.5, 49.5); - hisNum2SLayersPerTP_mediumPt_ = - inputDir.make("Num2SLayersPerTP_mediumPt", "; Number of 2S layers per TP for alg. eff.", 50, -0.5, 49.5); - - hisNumLayersPerTP_highPt_ = - inputDir.make("NumLayersPerTP_highPt", "; Number of layers per TP for alg. eff.", 50, -0.5, 49.5); - hisNumPSLayersPerTP_highPt_ = - inputDir.make("NumPSLayersPerTP_highPt", "; Number of PS layers per TP for alg. eff.", 50, -0.5, 49.5); - hisNum2SLayersPerTP_highPt_ = - inputDir.make("Num2SLayersPerTP_highPt", "; Number of 2S layers per TP for alg. eff.", 50, -0.5, 49.5); // Study efficiency of tightened front end-electronics cuts. @@ -244,85 +142,16 @@ namespace tmtt { inputDir.make("StubIneffiVsPt", "; 1/Pt; Inefficiency of readout chip for good stubs", 30, 0.0, 1.0); hisStubIneffiVsEta_ = inputDir.make( "StubIneffiVsEta", "; |#eta|; Inefficiency of readout chip for good stubs", 30, 0.0, 3.0); - hisStubKillDegradeBend_ = - inputDir.make("StubKillDegradeBend", - "; barrelLayer or 10+endcapRing; Stub fraction killed by DegradeBend.h window cut", - 30, - -0.5, - 29.5); // Study stub resolution. - hisPtStub_ = inputDir.make("PtStub", "; Stub q/Pt", 50, -0.5, 0.5); - hisPtResStub_ = inputDir.make("PtResStub", "; Stub q/Pt minus TP q/Pt", 50, -0.5, 0.5); - hisBendFilterPower_ = inputDir.make("BendFilterPower", "; Fraction of q/Pt range allowed", 102, -0.01, 1.01); - hisDelPhiStub_ = inputDir.make("DelPhiStub", "; Stub bend angle", 50, -0.2, 0.2); - hisDelPhiResStub_ = inputDir.make("DelPhiResStub", "; Stub bend angle minus TP bend angle", 200, -0.2, 0.2); - - hisDelPhiResStub_tilted_ = - inputDir.make("DelPhiResStub_tilted", "; Stub bend angle minus TP bend angle", 200, -0.2, 0.2); - hisDelPhiResStub_notTilted_ = - inputDir.make("DelPhiResStub_notTilted", "; Stub bend angle minus TP bend angle", 200, -0.2, 0.2); - hisBendStub_ = inputDir.make("BendStub", "; Stub bend in units of strips", 57, -7.125, 7.125); hisBendResStub_ = inputDir.make("BendResStub", "; Stub bend minus TP bend in units of strips", 100, -5., 5.); - hisNumMergedBend_ = - inputDir.make("NumMergedBend", "; No. of bend values merged together by loss of bit", 10, -0.5, 9.5); - hisBendVsLayerOrRingPS_ = inputDir.make( - "BendVsLayerOrRingPS", "; PS barrelLayer or 10+endcapRing; Stub bend", 30, -0.5, 29.5, 57, -7.125, 7.125); - hisBendVsLayerOrRing2S_ = inputDir.make( - "BendVsLayerOrRing2S", "; 2S barrelLayer or 10+endcapRing; Stub bend", 30, -0.5, 29.5, 57, -7.125, 7.125); - hisBendFEVsLayerOrRingPS_ = inputDir.make("BendFEVsLayerOrRingPS", - "; PS barrelLayer or 10+endcapRing; Stub bend in FE chip", - 30, - -0.5, - 29.5, - 57, - -7.125, - 7.125); - hisBendFEVsLayerOrRing2S_ = inputDir.make("BendFEVsLayerOrRing2S", - "; 2S barrelLayer or 10+endcapRing; Stub bend in FE chip", - 30, - -0.5, - 29.5, - 57, - -7.125, - 7.125); - - hisPhiStubVsPhiTP_ = - inputDir.make("PhiStubVsPhiTP", "; Stub #phi minus TP #phi at stub radius", 100, -0.05, 0.05); - hisPhiStubVsPhi0TP_ = inputDir.make("PhiStubVsPhi0TP", "; Stub #phi minus TP #phi0", 100, -0.3, 0.3); - hisPhi0StubVsPhi0TP_ = inputDir.make("Phi0StubVsPhi0TP", "; #phi0 of Stub minus TP", 100, -0.2, 0.2); - hisPhi0StubVsPhi0TPres_ = - inputDir.make("Phi0StubVsPhi0TPres", "; #phi0 of Stub minus TP / resolution", 100, -5.0, 5.0); - hisPhiStubVsPhi65TP_ = inputDir.make("PhiStubVsPhi65TP", "; Stub #phi minus TP phitrk65", 100, -0.2, 0.2); - hisPhi65StubVsPhi65TP_ = inputDir.make("Phi65StubVsPhi65TP", "; phitrk65 of Stub minus TP", 100, -0.2, 0.2); - hisPhi65StubVsPhi65TPres_ = - inputDir.make("Phi65StubVsPhi65TPres", "; phitrk65 of Stub minus TP / resolution", 100, -5.0, 5.0); - - // Note ratio of sensor pitch to separation (needed to understand how many bits this can be packed into). - hisPitchOverSep_ = inputDir.make("PitchOverSep", "; ratio of sensor pitch / separation", 100, 0.0, 0.1); - hisRhoParameter_ = inputDir.make("RhoParameter", "; rho parameter", 100, 0.0, 0.2); - // Check alpha correction. - hisAlphaCheck_ = - inputDir.make("AlphaCheck", "; #phi from stub; #phi from strip", 40, -0.2, 0.2, 40, -0.2, 0.2); - // Count stubs sharing a common cluster. - hisFracStubsSharingClus0_ = inputDir.make( - "FracStubsSharingClus0", "Fraction of stubs sharing cluster in seed sensor", 102, -0.01, 1.01); - hisFracStubsSharingClus1_ = inputDir.make( - "FracStubsSharingClus1", "Fraction of stubs sharing cluster in correlation sensor", 102, -0.01, 1.01); - - hisStubB_ = inputDir.make("StubB", "Variable B for all stubs on TP", 100, 0.9, 10); - hisStubBApproxDiff_tilted_ = inputDir.make( - "StubBApproxDiff_tilted_", "Difference between exact and approximate values for B", 100, -1, 1); // Histos for denominator of tracking efficiency float maxAbsQoverPt = 1. / houghMinPt_; // Max. |q/Pt| covered by HT array. - unsigned int nPhi = numPhiSectors_; - unsigned int nEta = numEtaRegions_; hisTPinvptForEff_ = inputDir.make("TPinvptForEff", "; 1/Pt of TP (used for effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); - hisTPptForEff_ = inputDir.make("TPptForEff", "; Pt of TP (used for effi. measurement);", 25, 0.0, 100.0); hisTPetaForEff_ = inputDir.make("TPetaForEff", "; #eta of TP (used for effi. measurement);", 20, -3., 3.); hisTPphiForEff_ = inputDir.make("TPphiForEff", "; #phi of TP (used for effi. measurement);", 20, -M_PI, M_PI); hisTPd0ForEff_ = inputDir.make("TPd0ForEff", "; d0 of TP (used for effi. measurement);", 40, 0., 4.); @@ -330,8 +159,6 @@ namespace tmtt { // hisTPinvptForAlgEff_ = inputDir.make( "TPinvptForAlgEff", "; 1/Pt of TP (used for alg. effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); - hisTPptForAlgEff_ = - inputDir.make("TPptForAlgEff", "; Pt of TP (used for alg. effi. measurement);", 25, 0.0, 100.0); hisTPetaForAlgEff_ = inputDir.make("TPetaForAlgEff", "; #eta of TP (used for alg. effi. measurement);", 20, -3., 3.); hisTPphiForAlgEff_ = @@ -340,18 +167,6 @@ namespace tmtt { inputDir.make("TPd0ForAlgEff", "; d0 of TP (used for alg. effi. measurement);", 40, 0., 4.); hisTPz0ForAlgEff_ = inputDir.make("TPz0ForAlgEff", "; z0 of TP (used for alg. effi. measurement);", 50, 0., 25.); - // - hisTPphisecForAlgEff_ = inputDir.make( - "TPphisecForAlgEff", "; #phi sectorof TP (used for alg. effi. measurement);", nPhi, -0.5, nPhi - 0.5); - hisTPetasecForAlgEff_ = inputDir.make( - "TPetasecForAlgEff", "; #eta sector of TP (used for alg. effi. measurement);", nEta, -0.5, nEta - 0.5); - // - hisTPinvptForAlgEff_inJetPtG30_ = inputDir.make( - "TPinvptForAlgEff_inJetPtG30", "; 1/Pt of TP (used for effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); - hisTPinvptForAlgEff_inJetPtG100_ = inputDir.make( - "TPinvptForAlgEff_inJetPtG100", "; 1/Pt of TP (used for effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); - hisTPinvptForAlgEff_inJetPtG200_ = inputDir.make( - "TPinvptForAlgEff_inJetPtG200", "; 1/Pt of TP (used for effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); return inputDir; } @@ -359,78 +174,24 @@ namespace tmtt { //=== Fill histograms using input stubs and tracking particles. void Histos::fillInputData(const InputData& inputData) { - const vector& vStubs = inputData.getStubs(); - const vector& vTPs = inputData.getTPs(); - - hisNumEvents_->Fill(0.); + // Allow only one thread to run this function at a time + std::lock_guard myGuard(myMutex[0]); - // Count stubs. - unsigned int nStubsGenuine = 0; - unsigned int nStubsWithTP = 0; - unsigned int nStubsWithTPforEff = 0; - for (const Stub* stub : vStubs) { - if (stub->genuine()) { - nStubsGenuine++; - if (stub->assocTP() != nullptr) { - nStubsWithTP++; - if (stub->assocTP()->useForEff()) - nStubsWithTPforEff++; - } - } - } - profNumStubs_->Fill(1, vStubs.size()); - profNumStubs_->Fill(2, nStubsGenuine); - profNumStubs_->Fill(3, nStubsWithTP); - profNumStubs_->Fill(4, nStubsWithTPforEff); + const list& vStubs = inputData.stubsConst(); + const list& vTPs = inputData.getTPs(); for (const Stub* stub : vStubs) { hisStubsVsEta_->Fill(stub->eta()); hisStubsVsR_->Fill(stub->r()); - hisStubsVsRVsZ_->Fill(stub->z(), stub->r()); - hisStubsModuleVsRVsZ_->Fill(stub->minZ(), stub->minR()); - hisStubsModuleVsRVsZ_->Fill(stub->maxZ(), stub->maxR()); - - hisStubsModuleTiltVsZ_->Fill(stub->minZ(), stub->moduleTilt()); - hisStubsModuleTiltVsZ_->Fill(stub->maxZ(), stub->moduleTilt()); - - if (stub->barrel() && stub->outerModuleAtSmallerR()) { - hisStubsVsRVsZ_outerModuleAtSmallerR_->Fill(stub->z(), stub->r()); - } - - hisStubsdPhiCorrectionVsZ_->Fill(stub->minZ(), stub->dphiOverBendCorrection()); - - hisStubsVsRVsPhi_->Fill(stub->r() * sin(stub->phi()), stub->r() * cos(stub->phi())); - hisStubsModuleVsRVsPhi_->Fill(stub->minR() * sin(stub->minPhi()), stub->minR() * cos(stub->minPhi())); - hisStubsModuleVsRVsPhi_->Fill(stub->maxR() * sin(stub->maxPhi()), stub->maxR() * cos(stub->maxPhi())); - - if (stub->barrel() && stub->outerModuleAtSmallerR()) { - hisStubsVsRVsPhi_outerModuleAtSmallerR_->Fill(stub->r() * sin(stub->phi()), stub->r() * cos(stub->phi())); - } } - // Count tracking particles. - unsigned int nTPforEff = 0; - unsigned int nTPforAlgEff = 0; - for (const TP& tp : vTPs) { - if (tp.useForEff()) - nTPforEff++; - if (tp.useForAlgEff()) - nTPforAlgEff++; - } - profNumTPs_->Fill(1, vTPs.size()); - profNumTPs_->Fill(2, nTPforEff); - profNumTPs_->Fill(3, nTPforAlgEff); - // Study efficiency of stubs to pass front-end electronics cuts. - const vector& vAllStubs = inputData.getAllStubs(); // Get all stubs prior to FE cuts to do this. - for (const Stub s : vAllStubs) { - unsigned int layerOrTenPlusRing = s.barrel() ? s.layerId() : 10 + s.endcapRing(); + const list& vAllStubs = inputData.allStubs(); // Get all stubs prior to FE cuts to do this. + for (const Stub& s : vAllStubs) { + unsigned int layerOrTenPlusRing = s.barrel() ? s.layerId() : 10 + s.trackerModule()->endcapRing(); // Fraction of all stubs (good and bad) failing tightened front-end electronics cuts. hisStubKillFE_->Fill(layerOrTenPlusRing, (!s.frontendPass())); - // Fraction of stubs rejected by window cut in DegradeBend.h - // If it is non-zero, then encoding in DegradeBend.h should ideally be changed to make it zero. - hisStubKillDegradeBend_->Fill(layerOrTenPlusRing, s.stubFailedDegradeWindow()); } // Study efficiency for good stubs of tightened front end-electronics cuts. @@ -439,172 +200,32 @@ namespace tmtt { const vector stubs = tp.assocStubs(); for (const Stub* s : stubs) { hisStubIneffiVsInvPt_->Fill(1. / tp.pt(), (!s->frontendPass())); - hisStubIneffiVsEta_->Fill(fabs(tp.eta()), (!s->frontendPass())); + hisStubIneffiVsEta_->Fill(std::abs(tp.eta()), (!s->frontendPass())); } } } // Plot stub bend-derived information. for (const Stub* stub : vStubs) { - hisPtStub_->Fill(stub->qOverPt()); - hisDelPhiStub_->Fill(stub->dphi()); - hisBendStub_->Fill(stub->dphi() / stub->dphiOverBend()); - // Number of bend values merged together by loss of a bit. - hisNumMergedBend_->Fill(stub->numMergedBend()); - // Min. & max allowed q/Pt obtained from stub bend. - float minQoverPt = max(float(-1. / (houghMinPt_)), stub->qOverPt() - stub->qOverPtres()); - float maxQoverPt = min(float(1. / (houghMinPt_)), stub->qOverPt() + stub->qOverPtres()); - // Frac. of full q/Pt range allowed by stub bend. - float fracAllowed = (maxQoverPt - minQoverPt) / (2. / (houghMinPt_)); - hisBendFilterPower_->Fill(fracAllowed); - unsigned int layerOrTenPlusRing = stub->barrel() ? stub->layerId() : 10 + stub->endcapRing(); - // Also plot bend before & after to degradation. - if (stub->psModule()) { - hisBendFEVsLayerOrRingPS_->Fill(layerOrTenPlusRing, stub->bendInFrontend()); - hisBendVsLayerOrRingPS_->Fill(layerOrTenPlusRing, stub->bend()); - } else { - hisBendFEVsLayerOrRing2S_->Fill(layerOrTenPlusRing, stub->bendInFrontend()); - hisBendVsLayerOrRing2S_->Fill(layerOrTenPlusRing, stub->bend()); - } + hisBendStub_->Fill(stub->bend()); } // Look at stub resolution. for (const TP& tp : vTPs) { if (tp.useForAlgEff()) { const vector& assStubs = tp.assocStubs(); - hisNumStubsPerTP_->Fill(assStubs.size()); - - unsigned int numPSstubs = 0; - unsigned int num2Sstubs = 0; - //cout<<"=== TP === : index="<pitchOverSep(); - if (!stub->barrel()) - rho *= fabs(stub->z()) / stub->r(); - hisRhoParameter_->Fill(rho); - - // Check how strip number correlates with phi coordinate relative to module centre. - // (Useful for "alpha" correction for non-radial strips in endcap 2S modules). - float fracPosInModule = (float(2 * stub->iphi()) - float(stub->nstrip())) / float(stub->nstrip()); - float phiFromStrip = 0.5 * stub->width() * fracPosInModule / stub->r(); - if (stub->z() < 0 && (not stub->barrel())) - phiFromStrip *= -1; - if (stub->outerModuleAtSmallerR()) - phiFromStrip *= -1; // Module flipped. - float phiFromStub = reco::deltaPhi(stub->phi(), 0.5 * (stub->minPhi() + stub->maxPhi())); - hisAlphaCheck_->Fill(phiFromStub, phiFromStrip); - } - - // Check fraction of stubs sharing a common cluster. - // Loop over both clusters in each stub, so looking for common clusters in seed (0) or correlation (1) sensor of module. - typedef pair> ClusterLocation; - for (unsigned int iClus = 0; iClus <= 1; iClus++) { - map commonClusterMap; - for (const Stub* stub : vStubs) { - // Encode detector ID & strip (or pixel) numbers in both dimensions. - const ClusterLocation loc(stub->idDet(), - pair(stub->localU_cluster()[iClus], stub->localV_cluster()[iClus])); - if (commonClusterMap.find(loc) == commonClusterMap.end()) { - commonClusterMap[loc] = 1; - } else { - commonClusterMap[loc]++; } } - unsigned int nShare = 0; - for (map::const_iterator it = commonClusterMap.begin(); - it != commonClusterMap.end(); - it++) { - if (it->second != 1) - nShare += it->second; // 2 or more stubs share a cluster at this detid*strip. - } - if (iClus == 0) { - hisFracStubsSharingClus0_->Fill(float(nShare) / float(vStubs.size())); - } else { - hisFracStubsSharingClus1_->Fill(float(nShare) / float(vStubs.size())); - } } // Determine r (z) range of each barrel layer (endcap wheel). @@ -626,7 +247,7 @@ namespace tmtt { } else { layer = layer % 10; // Range in |z| of each endcap wheel. - float z = fabs(stub->z()); + float z = std::abs(stub->z()); if (mapEndcapWheelMinZ_.find(layer) == mapEndcapWheelMinZ_.end()) { mapEndcapWheelMinZ_[layer] = z; mapEndcapWheelMaxZ_[layer] = z; @@ -643,8 +264,8 @@ namespace tmtt { for (const Stub* stub : vStubs) { float r = stub->r(); - float z = fabs(stub->z()); - unsigned int modType = stub->digitalStub().moduleType(); + float z = std::abs(stub->z()); + unsigned int modType = stub->trackerModule()->moduleTypeID(); // Do something ugly, as modules in 1-2nd & 3-4th endcap wheels are different to those in wheel 5 ... // And boundary between flat & tilted modules in barrel layers 1-3 varies in z. if (stub->barrel() && stub->layerId() == 1) { // barrel layer 1 @@ -734,53 +355,21 @@ namespace tmtt { for (const TP& tp : vTPs) { if (tp.useForEff()) { // Check TP is good for efficiency measurement. - - // Check which eta and phi sectors this TP is in. - int iPhiSec_TP = -1; - int iEtaReg_TP = -1; - Sector sectorTmp; - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - sectorTmp.init(settings_, iPhiSec, 0); - if (sectorTmp.insidePhiSec(tp)) - iPhiSec_TP = iPhiSec; - } - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - sectorTmp.init(settings_, 0, iEtaReg); - if (sectorTmp.insideEtaReg(tp)) - iEtaReg_TP = iEtaReg; - } - // Plot kinematics of all good TP. hisTPinvptForEff_->Fill(1. / tp.pt()); - hisTPptForEff_->Fill(tp.pt()); hisTPetaForEff_->Fill(tp.eta()); hisTPphiForEff_->Fill(tp.phi0()); // Plot also production point of all good TP. - hisTPd0ForEff_->Fill(fabs(tp.d0())); - hisTPz0ForEff_->Fill(fabs(tp.z0())); + hisTPd0ForEff_->Fill(std::abs(tp.d0())); + hisTPz0ForEff_->Fill(std::abs(tp.z0())); if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. hisTPinvptForAlgEff_->Fill(1. / tp.pt()); - hisTPptForAlgEff_->Fill(tp.pt()); hisTPetaForAlgEff_->Fill(tp.eta()); hisTPphiForAlgEff_->Fill(tp.phi0()); // Plot also production point of all good TP. - hisTPd0ForAlgEff_->Fill(fabs(tp.d0())); - hisTPz0ForAlgEff_->Fill(fabs(tp.z0())); - // Plot sector nunber. - hisTPphisecForAlgEff_->Fill(iPhiSec_TP); - hisTPetasecForAlgEff_->Fill(iEtaReg_TP); - - // Plot 1/pt for TPs inside a jet - if (tp.tpInJet()) { - hisTPinvptForAlgEff_inJetPtG30_->Fill(1. / tp.pt()); - } - if (tp.tpInHighPtJet()) { - hisTPinvptForAlgEff_inJetPtG100_->Fill(1. / tp.pt()); - } - if (tp.tpInVeryHighPtJet()) { - hisTPinvptForAlgEff_inJetPtG200_->Fill(1. / tp.pt()); - } + hisTPd0ForAlgEff_->Fill(std::abs(tp.d0())); + hisTPz0ForAlgEff_->Fill(std::abs(tp.z0())); } } } @@ -791,19 +380,7 @@ namespace tmtt { TFileDirectory Histos::bookEtaPhiSectors() { TFileDirectory inputDir = fs_->mkdir("CheckSectors"); - // Check if TP lose stubs because not all in same sector. - - hisFracStubsInSec_ = inputDir.make( - "FracStubsInSec", "; Fraction of stubs on TP in best (#eta,#phi) sector;", 102, -0.01, 1.01); - hisFracStubsInEtaSec_ = - inputDir.make("FracStubsInEtaSec", "; Fraction of stubs on TP in best #eta sector;", 102, -0.01, 1.01); - hisFracStubsInPhiSec_ = - inputDir.make("FracStubsInPhiSec", "; Fraction of stubs on TP in best #phi sector;", 102, -0.01, 1.01); - // Check if stubs excessively duplicated between overlapping sectors. - - hisNumSecsPerStub_ = - inputDir.make("NumSecPerStub", "; Number of (#eta,#phi) sectors each stub appears in", 20, -0.5, 19.5); hisNumEtaSecsPerStub_ = inputDir.make("NumEtaSecPerStub", "; Number of #eta sectors each stub appears in", 20, -0.5, 19.5); hisNumPhiSecsPerStub_ = @@ -811,130 +388,57 @@ namespace tmtt { // Count stubs per (eta,phi) sector. hisNumStubsPerSec_ = inputDir.make("NumStubsPerSec", "; Number of stubs per sector", 250, -0.5, 249.5); - // Ditto, summed over all phi. This checks if equal stubs go into each eta region, important for latency. - unsigned int nEta = numEtaRegions_; - profNumStubsPerEtaSec_ = inputDir.make( - "NumStubsPerEtaSec", ";#eta sector; Number of stubs per #eta sector", nEta, -0.5, nEta - 0.5); - - // Check which tracker layers are present in each eta sector. - hisLayerIDvsEtaSec_ = - inputDir.make("LayerIDvsEtaSec", ";#eta sector; layer ID", nEta, -0.5, nEta - 0.5, 20, 0.5, 20.5); - hisLayerIDreducedvsEtaSec_ = inputDir.make( - "LayerIDreducedvsEtaSec", ";#eta sector; reduced layer ID", nEta, -0.5, nEta - 0.5, 20, 0.5, 20.5); return inputDir; } //=== Fill histograms checking if (eta,phi) sector definition choices are good. - void Histos::fillEtaPhiSectors(const InputData& inputData, const matrix& mSectors) { - const vector& vStubs = inputData.getStubs(); - const vector& vTPs = inputData.getTPs(); + void Histos::fillEtaPhiSectors(const InputData& inputData, const matrix>& mSectors) { + // Allow only one thread to run this function at a time + std::lock_guard myGuard(myMutex[1]); - //=== Loop over good tracking particles, looking for the (eta,phi) sector in which each has the most stubs. - //=== and checking what fraction of its stubs were in this sector. - - for (const TP& tp : vTPs) { - if (tp.useForAlgEff()) { - unsigned int nStubs = tp.numAssocStubs(); // no. of stubs in this TP. - - // Number of stubs this TP has in best (eta,phi) sector, and also just dividing sectors in phi or just in eta. - unsigned int nStubsInBestSec = 0; - unsigned int nStubsInBestEtaSec = 0; - unsigned int nStubsInBestPhiSec = 0; - - // Loop over (eta, phi) sectors. - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - const Sector& sector = mSectors(iPhiSec, iEtaReg); - - // Count number of stubs in given tracking particle which are inside this (phi,eta) sector; - // or inside it if only the eta cuts are applied; or inside it if only the phi cuts are applied. - unsigned int nStubsInSec, nStubsInEtaSec, nStubsInPhiSec; - sector.numStubsInside(tp, nStubsInSec, nStubsInEtaSec, nStubsInPhiSec); - - // Note best results obtained in any sector. - nStubsInBestSec = max(nStubsInBestSec, nStubsInSec); - nStubsInBestEtaSec = max(nStubsInBestEtaSec, nStubsInEtaSec); - nStubsInBestPhiSec = max(nStubsInBestPhiSec, nStubsInPhiSec); - } - } - - // Plot fraction of stubs on each TP in its best sector. - hisFracStubsInSec_->Fill(float(nStubsInBestSec) / float(nStubs)); - hisFracStubsInEtaSec_->Fill(float(nStubsInBestEtaSec) / float(nStubs)); - hisFracStubsInPhiSec_->Fill(float(nStubsInBestPhiSec) / float(nStubs)); - } - } + const list& vStubs = inputData.stubsConst(); + //const list& vTPs = inputData.getTPs(); //=== Loop over all stubs, counting how many sectors each one appears in. for (const Stub* stub : vStubs) { // Number of (eta,phi), phi & eta sectors containing this stub. - unsigned int nSecs = 0; unsigned int nEtaSecs = 0; unsigned int nPhiSecs = 0; // Loop over (eta, phi) sectors. for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - const Sector& sector = mSectors(iPhiSec, iEtaReg); + const Sector* sector = mSectors(iPhiSec, iEtaReg).get(); // Check if sector contains stub stub, and if so count it. // Take care to just use one eta (phi) typical region when counting phi (eta) sectors. - if (sector.inside(stub)) - nSecs++; - if (iPhiSec == 0 && sector.insideEta(stub)) + if (iPhiSec == 0 && sector->insideEta(stub)) nEtaSecs++; - if (iEtaReg == 0 && sector.insidePhi(stub)) + if (iEtaReg == 0 && sector->insidePhi(stub)) nPhiSecs++; - - // Also note which tracker layers are present in each eta sector. - if (iPhiSec == 0 && sector.insideEta(stub)) { - const TP* assocTP = stub->assocTP(); - if (assocTP != nullptr) { - if (assocTP->useForAlgEff()) { - unsigned int lay = stub->layerId(); - if (lay > 20) - lay -= 10; // Don't bother distinguishing two endcaps. - hisLayerIDvsEtaSec_->Fill(iEtaReg, lay); - hisLayerIDreducedvsEtaSec_->Fill( - iEtaReg, - stub->layerIdReduced()); // Plot also simplified layerID for hardware, which tries to avoid more than 8 ID in any given eta region. - } - } - } } } // Plot number of sectors each stub appears in. - hisNumSecsPerStub_->Fill(nSecs); hisNumEtaSecsPerStub_->Fill(nEtaSecs); hisNumPhiSecsPerStub_->Fill(nPhiSecs); - - if (!settings_->allowOver2EtaSecs()) { - if (nEtaSecs > 2) - throw cms::Exception( - "Histos ERROR: Stub assigned to more than 2 eta regions. Please redefine eta regions to avoid this!") - << " stub r=" << stub->r() << " eta=" << stub->eta() << endl; - } } //=== Loop over all sectors, counting the stubs in each one. for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - unsigned int nStubsInEtaSec = 0; // Also counts stubs in eta sector, summed over all phi. for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - const Sector& sector = mSectors(iPhiSec, iEtaReg); + const Sector* sector = mSectors(iPhiSec, iEtaReg).get(); unsigned int nStubs = 0; for (const Stub* stub : vStubs) { - if (sector.inside(stub)) + if (sector->inside(stub)) nStubs++; } hisNumStubsPerSec_->Fill(nStubs); - nStubsInEtaSec += nStubs; } - profNumStubsPerEtaSec_->Fill(iEtaReg, nStubsInEtaSec); } } @@ -943,236 +447,16 @@ namespace tmtt { TFileDirectory Histos::bookRphiHT() { TFileDirectory inputDir = fs_->mkdir("HTrphi"); - // The next block of code is to book a histogram to study unusual HT cell shapes. - - unsigned int shape = settings_->shape(); - float maxAbsQoverPtAxis = 1. / houghMinPt_; // Max. |q/Pt| covered by HT array. - float maxAbsPhiTrkAxis = M_PI / (float)numPhiSectors_; // Half-width of phiTrk axis in HT array. - float binSizeQoverPtAxis = 2. * maxAbsQoverPtAxis / (float)houghNbinsPt_; - if (shape == 2 || shape == 1 || shape == 3) - binSizeQoverPtAxis = 2. * maxAbsQoverPtAxis / (houghNbinsPt_ - 1.); - float binSizePhiTrkAxis = 2. * maxAbsPhiTrkAxis / (float)houghNbinsPhi_; - if (shape == 2) - binSizePhiTrkAxis = 2. * maxAbsPhiTrkAxis / (houghNbinsPhi_ - 1. / 6.); - else if (shape == 1) - binSizePhiTrkAxis = 2. * maxAbsPhiTrkAxis / (houghNbinsPhi_ - 1. / 2.); - hisArrayHT_ = inputDir.make("ArrayHT", - "HT Array; m Bins; c Bins", - -maxAbsQoverPtAxis, - maxAbsQoverPtAxis, - -maxAbsPhiTrkAxis, - maxAbsPhiTrkAxis); - //hisStubHT_ = inputDir.make< TF1 >( "StubHT", "[0]+[1]*x", -maxAbsQoverPtAxis, maxAbsQoverPtAxis ); - //hisStubHT_->SetMinimum( -maxAbsPhiTrkAxis ); - //hisStubHT_->SetMaximum( maxAbsPhiTrkAxis ); - float xloop, yloop, xtemp; - Double_t x[7], y[7]; - switch (shape) { - case 0: - xloop = -maxAbsQoverPtAxis; - yloop = -maxAbsPhiTrkAxis; - for (unsigned int row = 0; row < houghNbinsPhi_; row++) { - xtemp = xloop; - for (unsigned int column = 0; column < houghNbinsPt_; column++) { - // Go around the square - x[0] = xtemp; - y[0] = yloop; - x[1] = x[0]; - y[1] = y[0] + binSizePhiTrkAxis; - x[2] = x[1] + binSizeQoverPtAxis; - y[2] = y[1]; - x[3] = x[2]; - y[3] = y[0]; - x[4] = x[0]; - y[4] = y[0]; - hisArrayHT_->AddBin(5, x, y); - // Go right - xtemp += binSizeQoverPtAxis; - } - yloop += binSizePhiTrkAxis; - } - break; - case 1: - xloop = -maxAbsQoverPtAxis - binSizeQoverPtAxis; - yloop = -maxAbsPhiTrkAxis; - for (unsigned int row = 0; row < houghNbinsPhi_ * 2; row++) { - xtemp = xloop; - for (unsigned int column = 0; column < houghNbinsPt_; column++) { - // Go around the square - x[0] = xtemp; - y[0] = yloop; - x[1] = x[0] + binSizeQoverPtAxis; - y[1] = y[0] + binSizePhiTrkAxis / 2.; - x[2] = x[1] + binSizeQoverPtAxis; - y[2] = y[0]; - x[3] = x[1]; - y[3] = y[0] - binSizePhiTrkAxis / 2.; - x[4] = x[0]; - y[4] = y[0]; - hisArrayHT_->AddBin(5, x, y); - // Go right - xtemp += binSizeQoverPtAxis * 2.; - } - xloop += (row % 2 == 0) ? binSizeQoverPtAxis : -binSizeQoverPtAxis; - yloop += binSizePhiTrkAxis / 2.; - } - break; - case 2: - xloop = -maxAbsQoverPtAxis - binSizeQoverPtAxis; - yloop = -maxAbsPhiTrkAxis; - for (unsigned int row = 0; row < houghNbinsPhi_ * 2; row++) { - xtemp = xloop; - for (unsigned int column = 0; column < houghNbinsPt_; column++) { - // Go around the hexagon - x[0] = xtemp; - y[0] = yloop; - x[1] = x[0]; - y[1] = y[0] + binSizePhiTrkAxis / 3.; - x[2] = x[1] + binSizeQoverPtAxis; - y[2] = y[1] + binSizePhiTrkAxis / 6.; - x[3] = x[2] + binSizeQoverPtAxis; - y[3] = y[1]; - x[4] = x[3]; - y[4] = y[0]; - x[5] = x[2]; - y[5] = y[4] - binSizePhiTrkAxis / 6.; - x[6] = x[0]; - y[6] = y[0]; - hisArrayHT_->AddBin(7, x, y); - // Go right - xtemp += binSizeQoverPtAxis * 2.; - } - xloop += (row % 2 == 0) ? binSizeQoverPtAxis : -binSizeQoverPtAxis; - yloop += binSizePhiTrkAxis / 2.; - } - break; - case 3: - xloop = -maxAbsQoverPtAxis - binSizeQoverPtAxis; - yloop = -maxAbsPhiTrkAxis; - for (unsigned int row = 0; row < houghNbinsPhi_ * 2; row++) { - xtemp = xloop; - for (unsigned int column = 0; column < houghNbinsPt_; column++) { - // Go around the square - x[0] = xtemp; - y[0] = yloop; - x[1] = x[0]; - y[1] = y[0] + binSizePhiTrkAxis / 2.; - x[2] = x[1] + binSizeQoverPtAxis * 2.; - y[2] = y[1]; - x[3] = x[2]; - y[3] = y[0]; - x[4] = x[0]; - y[4] = y[0]; - hisArrayHT_->AddBin(5, x, y); - // Go right - xtemp += binSizeQoverPtAxis * 2.; - } - xloop += (row % 2 == 0) ? binSizeQoverPtAxis : -binSizeQoverPtAxis; - yloop += binSizePhiTrkAxis / 2.; - } - break; - } - - hisIncStubsPerHT_ = inputDir.make( - "IncStubsPerHT", "; Number of filtered stubs per r#phi HT array (inc. duplicates)", 100, 0., -1.); - hisExcStubsPerHT_ = inputDir.make( - "ExcStubsPerHT", "; Number of filtered stubs per r#phi HT array (exc. duplicates)", 250, -0.5, 249.5); - - hisNumStubsInCellVsEta_ = inputDir.make("NumStubsInCellVsEta", - "; no. of stubs per HT cell summed over phi sector; #eta region", - 100, - -0.5, - 499.5, - numEtaRegions_, - -0.5, - numEtaRegions_ - 0.5); - - hisStubsOnRphiTracksPerHT_ = inputDir.make( - "StubsOnRphiTracksPerHT", "; Number of stubs assigned to tracks per r#phi HT array", 500, -0.5, 499.5); - - hisHTstubsPerTrack_ = inputDir.make("stubsPerTrk", "No. stubs per track", 25, -0.5, 24.5); - hisHTmBin_ = inputDir.make("mBin", "HT m bin", houghNbinsPt_, -0.5, houghNbinsPt_ - 0.5); - hisHTcBin_ = inputDir.make("cBin", "HT c bin", houghNbinsPhi_, -0.5, houghNbinsPhi_ - 0.5); - return inputDir; } //=== Fill histograms checking filling of r-phi HT array. - void Histos::fillRphiHT(const matrix& mHtRphis) { + void Histos::fillRphiHT(const matrix>& mHtRphis) { //--- Loop over (eta,phi) sectors, counting the number of stubs in the HT array of each. - if (plotFirst_) { - const HTrphi& htRphi = mHtRphis(settings_->iPhiPlot(), settings_->iEtaPlot()); - float phiCentreSector = -M_PI + (1. + 2. * settings_->iPhiPlot()) * M_PI / (float)numPhiSectors_; - const matrix& htRphiMatrix = htRphi.getAllCells(); - const Stub* stub(nullptr); - for (unsigned int i = 0; i < htRphiMatrix.size1(); i++) - for (unsigned int j = 0; j < htRphiMatrix.size2(); j++) { - std::pair cell = htRphi.helix2Dhough(i, j); - unsigned int numStubs = htRphiMatrix(i, j).numStubs(); - hisArrayHT_->Fill(cell.first, reco::deltaPhi(cell.second, phiCentreSector), numStubs); - if (numStubs > 0) - stub = htRphiMatrix(i, j).stubs().front(); - } - if (stub != nullptr) { - //hisStubHT_->SetParameters( reco::deltaPhi( stub->phi(), phiCentreSector ), settings_->invPtToDphi() * ( stub->r() - settings_->chosenRofPhi() ) ); - //hisStubHT_->Draw(); - } - } - plotFirst_ = false; - - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - const HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); - - // Here, if a stub appears in multiple cells, it is counted multiple times. - hisIncStubsPerHT_->Fill(htRphi.numStubsInc()); - // Here, if a stub appears in multiple cells, it is counted only once. - hisExcStubsPerHT_->Fill(htRphi.numStubsExc()); - } - } - - //--- Count number of stubs in each cell of HT array, summing over all the phi sectors within a given - //--- eta region. This determines the buffer size needed to store them in the firmware. - - // Loop over eta regions. - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - // Get dimensions of HT array (assumed same for all phi sectors) - unsigned int iPhiSecDummy = 0; - const matrix& rphiHTcellsDummy = mHtRphis(iPhiSecDummy, iEtaReg).getAllCells(); - const unsigned int nbins1 = rphiHTcellsDummy.size1(); - const unsigned int nbins2 = rphiHTcellsDummy.size2(); - // Loop over cells inside HT array - for (unsigned int m = 0; m < nbins1; m++) { - for (unsigned int n = 0; n < nbins2; n++) { - // Loop over phi sectors - unsigned int nStubsInCellPhiSum = 0; - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - const HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); - const matrix& rphiHTcells = htRphi.getAllCells(); - nStubsInCellPhiSum += rphiHTcells(m, n).numStubs(); - } - // Plot total number of stubs in this cell, summed over all phi sectors. - hisNumStubsInCellVsEta_->Fill(nStubsInCellPhiSum, iEtaReg); - } - } - } - - //--- Count number of cells assigned to track candidates by r-phi HT (before any rz filtering - //--- or rz HT has been run). - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - const HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); - hisStubsOnRphiTracksPerHT_->Fill(htRphi.numStubsOnTrackCands2D()); - // Also note cell location of HT tracks. - for (const L1track2D& trk : htRphi.trackCands2D()) { - hisHTstubsPerTrack_->Fill(trk.getNumStubs()); - hisHTmBin_->Fill(trk.getCellLocationHT().first); - hisHTcBin_->Fill(trk.getCellLocationHT().second); - } - } - } + // Allow only one thread to run this function at a time + std::lock_guard myGuard(myMutex[2]); } //=== Book histograms about r-z track filters (or other filters applied after r-phi HT array). @@ -1180,49 +464,22 @@ namespace tmtt { TFileDirectory Histos::bookRZfilters() { TFileDirectory inputDir = fs_->mkdir("RZfilters"); - //--- Histograms for Seed Filter - if (settings_->rzFilterName() == "SeedFilter") { - // Check number of track seeds that r-z filters must check. - hisNumSeedCombinations_ = inputDir.make( - "NumSeedCombinations_", "; Number of seed combinations per track cand; no. seeds ; ", 50, -0.5, 49.5); - hisNumGoodSeedCombinations_ = inputDir.make( - "NumGoodSeedCombinations_", "; Number of good seed combinations per track cand; ", 30, -0.5, 29.5); - } return inputDir; } //=== Fill histograms about r-z track filters. - void Histos::fillRZfilters(const matrix& mGet3Dtrks) { - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); - - //--- Histograms for Seed Filter - if (settings_->rzFilterName() == "SeedFilter") { - // Check number of track seeds per sector that r-z "seed" filter checked. - const vector numSeedComb = get3Dtrk.getRZfilter().numSeedCombsPerTrk(); - for (const unsigned int& num : numSeedComb) { - hisNumSeedCombinations_->Fill(num); - } - // Same again, but this time only considering seeds the r-z filters defined as "good". - const vector numGoodSeedComb = get3Dtrk.getRZfilter().numGoodSeedCombsPerTrk(); - for (const unsigned int& num : numGoodSeedComb) { - hisNumGoodSeedCombinations_->Fill(num); - } - } - } - } + void Histos::fillRZfilters(const matrix>& mMake3Dtrks) { + // Allow only one thread to run this function at a time + std::lock_guard myGuard(myMutex[3]); } //=== Book histograms studying track candidates found by Hough Transform. - TFileDirectory Histos::bookTrackCands(string tName) { + TFileDirectory Histos::bookTrackCands(const string& tName) { // Now book histograms for studying tracking in general. - // Define lambda function to facilitate adding "tName" to directory & histogram names. - //auto addn = [tName](string s){ return TString::Format("%s_%s", s.c_str(), tName.c_str()).Data(); }; - auto addn = [tName](string s) { return TString::Format("%s_%s", s.c_str(), tName.c_str()); }; + auto addn = [tName](const string& s) { return TString::Format("%s_%s", s.c_str(), tName.c_str()); }; TFileDirectory inputDir = fs_->mkdir(addn("TrackCands").Data()); @@ -1239,7 +496,6 @@ namespace tmtt { profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(1, "reco tracks including fakes"); profNumTrackCands_[tName]->LabelsOption("d"); - unsigned int nPhi = numPhiSectors_; unsigned int nEta = numEtaRegions_; float maxAbsQoverPt = 1. / houghMinPt_; // Max. |q/Pt| covered by HT array. hisNumTracksVsQoverPt_[tName] = inputDir.make( @@ -1248,8 +504,6 @@ namespace tmtt { if (TMTT) { profNumTracksVsEta_[tName] = inputDir.make( addn("NumTracksVsEta"), "; #eta region; No. of tracks in tracker", nEta, -0.5, nEta - 0.5); - hisNumTrksPerSect_[tName] = - inputDir.make(addn("NumTrksPerSect"), "; No. tracks per sector;", 100, -0.5, 99.5); } // Count stubs per event assigned to tracks (determines HT data output rate) @@ -1258,60 +512,21 @@ namespace tmtt { inputDir.make(addn("StubsOnTracks"), "; ; No. of stubs on tracks per event", 1, 0.5, 1.5); hisStubsOnTracksPerNon_[tName] = inputDir.make(addn("StubsOnTracksPerNon"), "; No. of stubs on tracks per nonant", 1000, -0.5, 999.5); - hisUniqueStubsOnTrksPerNon_[tName] = inputDir.make( - addn("UniqueStubsOnTrksPerNon"), "; No. of unique stubs on tracks per nonant", 500, -0.5, 499.5); - if (TMTT) { - profStubsOnTracksVsEta_[tName] = inputDir.make( - addn("StubsOnTracksVsEta"), "; #eta region; No. of stubs on tracks per event", nEta, -0.5, nEta - 0.5); - hisStubsOnTracksPerSect_[tName] = - inputDir.make(addn("StubsOnTracksPerSect"), "; No. of stubs on tracks per sector", 500, -0.5, 499.5); - hisUniqueStubsOnTrksPerSect_[tName] = inputDir.make( - addn("UniqueStubsOnTrksPerSect"), "; No. of unique stubs on tracks per sector", 500, -0.5, 499.5); - } hisStubsPerTrack_[tName] = inputDir.make(addn("StubsPerTrack"), ";No. of stubs per track;", 50, -0.5, 49.5); hisLayersPerTrack_[tName] = inputDir.make(addn("LayersPerTrack"), ";No. of layers with stubs per track;", 20, -0.5, 19.5); - hisPSLayersPerTrack_[tName] = - inputDir.make(addn("PSLayersPerTrack"), ";No. of PS layers with stubs per track;", 20, -0.5, 19.5); - hisLayersPerTrueTrack_[tName] = - inputDir.make(addn("LayersPerTrueTrack"), ";No. of layers with stubs per genuine track;", 20, -0.5, 19.5); - hisPSLayersPerTrueTrack_[tName] = inputDir.make( - addn("PSLayersPerTrueTrack"), ";No. of PS layers with stubs per genuine track;", 20, -0.5, 19.5); if (TMTT) { hisNumStubsPerLink_[tName] = inputDir.make(addn("NumStubsPerLink"), "; Mean #stubs per MHT output opto-link;", 50, -0.5, 199.5); - hisNumStubsVsLink_[tName] = inputDir.make( - addn("NumStubsVsLink"), "; MHT output opto-link; No. stubs/event", 36, -0.5, 35.5, 20, -0.5, 199.5); profMeanStubsPerLink_[tName] = inputDir.make(addn("MeanStubsPerLink"), "; Mean #stubs per MHT output opto-link;", 36, -0.5, 35.5); - hisNumTrksPerLink_[tName] = - inputDir.make(addn("NumTrksPerLink"), "; Mean #tracks per MHT output opto-link;", 50, -0.5, 49.5); - hisNumTrksVsLink_[tName] = inputDir.make( - addn("NumTrksVsLink"), "; MHT output opto-link; No. tracks/event", 72, -0.5, 71.5, 20, -0.5, 49.5); - profMeanTrksPerLink_[tName] = - inputDir.make(addn("MeanTrksPerLink"), "; Mean #tracks per MHT output opto-link;", 36, -0.5, 35.5); - } - - if (TMTT) { - // Checks if tracks have too many stubs to be stored in memory in each cell. - profExcessStubsPerTrackVsPt_[tName] = inputDir.make( - addn("ExcessStubsPerTrackVsPt"), ";q/Pt; Prob. of too many stubs per track", 16, 0., maxAbsQoverPt); } hisFracMatchStubsOnTracks_[tName] = inputDir.make( addn("FracMatchStubsOnTracks"), "; Fraction of stubs on tracks matching best TP;", 101, -0.005, 1.005); - profFracTrueStubsVsLayer_[tName] = - inputDir.make(addn("FracTrueStubsVsLayer"), ";Layer ID; fraction of true stubs", 30, 0.5, 30.5); - - // Check how much stub bend differs from predicted one. - hisDeltaBendTrue_[tName] = - inputDir.make(addn("DeltaBendTrue"), "True stubs; stub bend minus true bend / resolution;", 100, -2., 2.); - hisDeltaBendFake_[tName] = - inputDir.make(addn("DeltaBendFake"), "Fake stubs; stub bend minus true bend / resolution;", 100, -2., 2.); - if (TMTT) { // Study duplication of tracks within HT. profDupTracksVsEta_[tName] = inputDir.make( @@ -1332,22 +547,9 @@ namespace tmtt { hisEtaRes_[tName] = inputDir.make(addn("EtaRes"), "; track resolution in #eta", 100, -1.0, 1.0); hisZ0Res_[tName] = inputDir.make(addn("Z0Res"), "; track resolution in z0", 100, -10.0, 10.0); - hisRecoVsTrueQinvPt_[tName] = inputDir.make( - addn("RecoVsTrueQinvPt"), "; TP q/p_{T}; Reco q/p_{T} (good #chi^{2})", 60, -0.6, 0.6, 240, -0.6, 0.6); - hisRecoVsTruePhi0_[tName] = inputDir.make( - addn("RecoVsTruePhi0"), "; TP #phi_{0}; Reco #phi_{0} (good #chi^{2})", 70, -3.5, 3.5, 280, -3.5, 3.5); - hisRecoVsTrueD0_[tName] = - inputDir.make(addn("RecoVsTrueD0"), "; TP d_{0}; Reco d_{0} (good #chi^{2})", 100, -2., 2., 100, -2., 2.); - hisRecoVsTrueZ0_[tName] = inputDir.make( - addn("RecoVsTrueZ0"), "; TP z_{0}; Reco z_{0} (good #chi^{2})", 100, -25., 25., 100, -25., 25.); - hisRecoVsTrueEta_[tName] = inputDir.make( - addn("RecoVsTrueEta"), "; TP #eta; Reco #eta (good #chi^{2})", 70, -3.5, 3.5, 70, -3.5, 3.5); - // Histos for tracking efficiency vs. TP kinematics hisRecoTPinvptForEff_[tName] = inputDir.make( addn("RecoTPinvptForEff"), "; 1/Pt of TP (used for effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); - hisRecoTPptForEff_[tName] = - inputDir.make(addn("RecoTPptForEff"), "; Pt of TP (used for effi. measurement);", 25, 0.0, 100.0); hisRecoTPetaForEff_[tName] = inputDir.make(addn("RecoTPetaForEff"), "; #eta of TP (used for effi. measurement);", 20, -3., 3.); hisRecoTPphiForEff_[tName] = @@ -1356,8 +558,6 @@ namespace tmtt { // Histo for efficiency to reconstruct track perfectly (no incorrect hits). hisPerfRecoTPinvptForEff_[tName] = inputDir.make( addn("PerfRecoTPinvptForEff"), "; 1/Pt of TP (used for perf. effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); - hisPerfRecoTPptForEff_[tName] = inputDir.make( - addn("PerfRecoTPptForEff"), "; Pt of TP (used for perf. effi. measurement);", 25, 0.0, 100.0); hisPerfRecoTPetaForEff_[tName] = inputDir.make( addn("PerfRecoTPetaForEff"), "; #eta of TP (used for perf. effi. measurement);", 20, -3., 3.); @@ -1370,38 +570,17 @@ namespace tmtt { // Histos for algorithmic tracking efficiency vs. TP kinematics hisRecoTPinvptForAlgEff_[tName] = inputDir.make( addn("RecoTPinvptForAlgEff"), "; 1/Pt of TP (used for alg. effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); - hisRecoTPptForAlgEff_[tName] = - inputDir.make(addn("RecoTPptForAlgEff"), "; Pt of TP (used for alg. effi. measurement);", 25, 0.0, 100.0); hisRecoTPetaForAlgEff_[tName] = inputDir.make(addn("RecoTPetaForAlgEff"), "; #eta of TP (used for alg. effi. measurement);", 20, -3., 3.); hisRecoTPphiForAlgEff_[tName] = inputDir.make( addn("RecoTPphiForAlgEff"), "; #phi of TP (used for alg. effi. measurement);", 20, -M_PI, M_PI); - // Histos for algorithmic tracking efficiency in jets. - hisRecoTPinvptForAlgEff_inJetPtG30_[tName] = inputDir.make(addn("RecoTPinvptForAlgEff_inJetPtG30"), - "; 1/Pt of TP (used for effi. measurement);", - 24, - 0., - 1.5 * maxAbsQoverPt); - hisRecoTPinvptForAlgEff_inJetPtG100_[tName] = inputDir.make(addn("RecoTPinvptForAlgEff_inJetPtG100"), - "; 1/Pt of TP (used for effi. measurement);", - 24, - 0., - 1.5 * maxAbsQoverPt); - hisRecoTPinvptForAlgEff_inJetPtG200_[tName] = inputDir.make(addn("RecoTPinvptForAlgEff_inJetPtG200"), - "; 1/Pt of TP (used for effi. measurement);", - 24, - 0., - 1.5 * maxAbsQoverPt); - // Histo for efficiency to reconstruct track perfectly (no incorrect hits). hisPerfRecoTPinvptForAlgEff_[tName] = inputDir.make(addn("PerfRecoTPinvptForAlgEff"), "; 1/Pt of TP (used for perf. alg. effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); - hisPerfRecoTPptForAlgEff_[tName] = inputDir.make( - addn("PerfRecoTPptForAlgEff"), "; Pt of TP (used for perf. alg. effi. measurement);", 25, 0.0, 100.0); hisPerfRecoTPetaForAlgEff_[tName] = inputDir.make( addn("PerfRecoTPetaForAlgEff"), "; #eta of TP (used for perf. alg. effi. measurement);", 20, -3., 3.); @@ -1411,82 +590,52 @@ namespace tmtt { hisRecoTPz0ForAlgEff_[tName] = inputDir.make(addn("RecoTPz0ForAlgEff"), "; z0 of TP (used for alg. effi. measurement);", 50, 0., 25.); - // Histos for algorithmic tracking efficiency vs sector number (to check if looser cuts are needed in certain regions) - hisRecoTPphisecForAlgEff_[tName] = inputDir.make( - addn("RecoTPphisecForAlgEff"), "; #phi sector of TP (used for alg. effi. measurement);", nPhi, -0.5, nPhi - 0.5); - hisRecoTPetasecForAlgEff_[tName] = inputDir.make( - addn("RecoTPetasecForAlgEff"), "; #eta sector of TP (used for alg. effi. measurement);", nEta, -0.5, nEta - 0.5); - - // Histo for efficiency to reconstruct tracks perfectly (no incorrect hits). - hisPerfRecoTPphisecForAlgEff_[tName] = - inputDir.make(addn("PerfRecoTPphisecForAlgEff"), - "; #phi sector of TP (used for perf. alg. effi. measurement);", - nPhi, - -0.5, - nPhi - 0.5); - hisPerfRecoTPetasecForAlgEff_[tName] = - inputDir.make(addn("PerfRecoTPetasecForAlgEff"), - "; #eta sector of TP (used for perf. alg. effi. measurement);", - nEta, - -0.5, - nEta - 0.5); - - if (TMTT) { - // For those tracking particles causing the algorithmic efficiency to be below 100%, plot a flag indicating why. - hisRecoFailureReason_[tName] = inputDir.make( - addn("RecoFailureReason"), "; Reason TP (used for alg. effi.) not reconstructed;", 1, -0.5, 0.5); - //hisRecoFailureLayer_[tName] = inputDir.make(addn("RecoFailureLayer"),"; Layer ID of lost stubs on unreconstructed TP;",30,-0.5,29.5); - } + return inputDir; + } - //hisWrongSignStubRZ_pBend_[tName] = inputDir.make(addn("WrongSignStubRZ_pBend"),"RZ of stubs with positive bend, but with wrong sign; z (cm); radius (cm); No. stubs in tracker",100,-280,280,100,0,130); - //hisWrongSignStubRZ_nBend_[tName] = inputDir.make(addn("WrongSignStubRZ_nBend"),"RZ of stubs with negative bend, but with wrong sign; z (cm); radius (cm); No. stubs in tracker",100,-280,280,100,0,130); + //=== Fill histograms studying track candidates found before track fit is run. - hisNumStubsOnLayer_[tName] = inputDir.make(addn("NumStubsOnLayer"), "; Layer occupancy;", 16, 1, 17); + void Histos::fillTrackCands(const InputData& inputData, + const matrix>& mMake3Dtrks, + const string& tName) { + // Allow only one thread to run this function at a time + std::lock_guard myGuard(myMutex[4]); - return inputDir; + vector tracks; + bool withRZfilter = (tName == "RZ") ? true : false; + for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { + for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { + const Make3Dtracks* make3Dtrk = mMake3Dtrks(iPhiSec, iEtaReg).get(); + const std::list& tracksSec = make3Dtrk->trackCands3D(withRZfilter); + tracks.insert(tracks.end(), tracksSec.begin(), tracksSec.end()); + } + } + this->fillTrackCands(inputData, tracks, tName); } //=== Fill histograms studying track candidates found before track fit is run. - void Histos::fillTrackCands(const InputData& inputData, const vector& tracks, string tName) { + void Histos::fillTrackCands(const InputData& inputData, const vector& tracks, const string& tName) { bool withRZfilter = (tName == "RZ"); - bool TMTT = (tName == "HT" || tName == "RZ"); - - // Now fill histograms for studying tracking in general. - - const vector& vTPs = inputData.getTPs(); + bool algoTMTT = (tName == "HT" || tName == "RZ"); // Check if running TMTT or Hybrid L1 tracking. - // Debug histogram for LR track fitter. - for (const L1track3D& t : tracks) { - const std::vector stubs = t.getStubs(); - std::map layerMap; - for (auto s : stubs) - layerMap[s->layerIdReduced()]++; - for (auto l : layerMap) - hisNumStubsOnLayer_[tName]->Fill(l.second); - } + const list& vTPs = inputData.getTPs(); //=== Count track candidates found in the tracker. const unsigned int numPhiNonants = settings_->numPhiNonants(); - ; - matrix nTrksPerSec(numPhiSectors_, numEtaRegions_, 0); vector nTrksPerEtaReg(numEtaRegions_, 0); vector nTrksPerNonant(numPhiNonants, 0); for (const L1track3D& t : tracks) { unsigned int iNonant = floor((t.iPhiSec()) * numPhiNonants / (numPhiSectors_)); // phi nonant number - nTrksPerSec(t.iPhiSec(), t.iEtaReg())++; nTrksPerEtaReg[t.iEtaReg()]++; nTrksPerNonant[iNonant]++; } profNumTrackCands_[tName]->Fill(1.0, tracks.size()); // Plot mean number of tracks/event. - if (TMTT) { + if (algoTMTT) { for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - hisNumTrksPerSect_[tName]->Fill(nTrksPerSec(iPhiSec, iEtaReg)); - } profNumTracksVsEta_[tName]->Fill(iEtaReg, nTrksPerEtaReg[iEtaReg]); } } @@ -1498,66 +647,44 @@ namespace tmtt { unsigned int nStubsOnTracks = 0; matrix nStubsOnTracksInSec(numPhiSectors_, numEtaRegions_, 0); - vector nStubsOnTracksInEtaReg(numEtaRegions_, 0); vector nStubsOnTracksInNonant(numPhiNonants, 0); - map, set> uniqueStubsOnTracksInSect; - map> uniqueStubsOnTracksInNonant; - matrix nStubsOnTrksInSec(numPhiSectors_, numEtaRegions_, 0); for (const L1track3D& t : tracks) { - const vector& stubs = t.getStubs(); + const vector& stubs = t.stubsConst(); unsigned int nStubs = stubs.size(); unsigned int iNonant = floor((t.iPhiSec()) * numPhiNonants / (numPhiSectors_)); // phi nonant number // Count stubs on all tracks in this sector & nonant. nStubsOnTracks += nStubs; - nStubsOnTrksInSec(t.iPhiSec(), t.iEtaReg()) += nStubs; - nStubsOnTracksInEtaReg[t.iEtaReg()] += nStubs; nStubsOnTracksInNonant[iNonant] += nStubs; - // Note unique stubs in sector & nonant. - uniqueStubsOnTracksInSect[pair(t.iPhiSec(), t.iEtaReg())].insert(stubs.begin(), - stubs.end()); - uniqueStubsOnTracksInNonant[iNonant].insert(stubs.begin(), stubs.end()); } profStubsOnTracks_[tName]->Fill(1.0, nStubsOnTracks); - if (TMTT) { - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - hisStubsOnTracksPerSect_[tName]->Fill(nStubsOnTrksInSec(iPhiSec, iEtaReg)); - // Plot number of stubs assigned to tracks per sector, never counting each individual stub more than once. - hisUniqueStubsOnTrksPerSect_[tName]->Fill(uniqueStubsOnTracksInSect[pair(iPhiSec, iEtaReg)].size()); - } - profStubsOnTracksVsEta_[tName]->Fill(iEtaReg, nStubsOnTracksInEtaReg[iEtaReg]); - } - } + for (unsigned int iNonant = 0; iNonant < numPhiNonants; iNonant++) { hisStubsOnTracksPerNon_[tName]->Fill(nStubsOnTracksInNonant[iNonant]); - // Plot number of stubs assigned to tracks per nonant, never counting each individual stub more than once. - hisUniqueStubsOnTrksPerNon_[tName]->Fill(uniqueStubsOnTracksInNonant[iNonant].size()); } // Plot number of tracks & number of stubs per output HT opto-link. - if (TMTT && not withRZfilter) { - static std::atomic firstMess = true; - const unsigned int numPhiSecPerNon = numPhiSectors_ / numPhiNonants; + if (algoTMTT && not withRZfilter) { + //const unsigned int numPhiSecPerNon = numPhiSectors_ / numPhiNonants; // Hard-wired bodge const unsigned int nLinks = houghNbinsPt_ / 2; // Hard-wired to number of course HT bins. Check. for (unsigned int iPhiNon = 0; iPhiNon < numPhiNonants; iPhiNon++) { // Each nonant has a separate set of links. vector stubsToLinkCount(nLinks, 0); // Must use vectors to count links with zero entries. - vector trksToLinkCount(nLinks, 0); for (const L1track3D& trk : tracks) { unsigned int iNonantTrk = floor((trk.iPhiSec()) * numPhiNonants / (numPhiSectors_)); // phi nonant number if (iPhiNon == iNonantTrk) { unsigned int link = trk.optoLinkID(); if (link < nLinks) { - stubsToLinkCount[link] += trk.getNumStubs(); - trksToLinkCount[link] += 1; - } else if (firstMess) { - firstMess = false; - cout << endl << "===== HISTOS MESS UP: Increase size of nLinks ===== " << link << endl << endl; + stubsToLinkCount[link] += trk.numStubs(); + } else { + std::stringstream text; + text << "\n ===== HISTOS MESS UP: Increase size of nLinks ===== " << link << "\n"; + std::call_once( + printOnce, [](string t) { edm::LogWarning("L1track") << t; }, text.str()); } } } @@ -1565,88 +692,25 @@ namespace tmtt { for (unsigned int link = 0; link < nLinks; link++) { unsigned int nstbs = stubsToLinkCount[link]; hisNumStubsPerLink_[tName]->Fill(nstbs); - hisNumStubsVsLink_[tName]->Fill(link, nstbs); profMeanStubsPerLink_[tName]->Fill(link, nstbs); } - - for (unsigned int link = 0; link < nLinks; link++) { - unsigned int ntrks = trksToLinkCount[link]; - hisNumTrksPerLink_[tName]->Fill(ntrks); - hisNumTrksVsLink_[tName]->Fill(link, ntrks); - profMeanTrksPerLink_[tName]->Fill(link, ntrks); - } } } // Plot q/pt spectrum of track candidates, and number of stubs/tracks for (const L1track3D& trk : tracks) { hisNumTracksVsQoverPt_[tName]->Fill(trk.qOverPt()); // Plot reconstructed q/Pt of track cands. - hisStubsPerTrack_[tName]->Fill(trk.getNumStubs()); // Stubs per track. - const TP* tp = trk.getMatchedTP(); - if (TMTT) { - // For genuine tracks, check how often they have too many stubs to be stored in cell memory. (Perhaps worse for high Pt particles in jets?). - if (tp != nullptr) { - if (tp->useForAlgEff()) - profExcessStubsPerTrackVsPt_[tName]->Fill(1. / tp->pt(), trk.getNumStubs() > 16); - } - } - hisLayersPerTrack_[tName]->Fill(trk.getNumLayers()); // Number of reduced layers with stubs per track. - hisPSLayersPerTrack_[tName]->Fill(Utility::countLayers( - settings_, trk.getStubs(), false, true)); // Number of reduced PS layers with stubs per track. - // Also plot just for genuine tracks. - if (tp != nullptr && tp->useForAlgEff()) { - hisLayersPerTrueTrack_[tName]->Fill(trk.getNumLayers()); // Number of reduced layers with stubs per track. - hisPSLayersPerTrueTrack_[tName]->Fill(Utility::countLayers( - settings_, trk.getStubs(), false, true)); // Number of reduced PS layers with stubs per track. - } + hisStubsPerTrack_[tName]->Fill(trk.numStubs()); // Stubs per track. } // Count fraction of stubs on each track matched to a TP that are from same TP. for (const L1track3D& trk : tracks) { // Only consider tracks that match a tracking particle used for the alg. efficiency measurement. - const TP* tp = trk.getMatchedTP(); + const TP* tp = trk.matchedTP(); if (tp != nullptr) { if (tp->useForAlgEff()) { - hisFracMatchStubsOnTracks_[tName]->Fill(trk.getPurity()); - - const vector stubs = trk.getStubs(); - for (const Stub* s : stubs) { - // Was this stub produced by correct truth particle? - const set stubTPs = s->assocTPs(); - bool trueStub = (stubTPs.find(tp) != stubTPs.end()); - - // Fraction of wrong stubs vs. tracker layer. - profFracTrueStubsVsLayer_[tName]->Fill(s->layerId(), trueStub); - - // Check how much stub bend differs from predicted one, relative to nominal bend resolution. - float diffBend = (s->qOverPt() - trk.qOverPt()) / s->qOverPtOverBend(); - if (trueStub) { - hisDeltaBendTrue_[tName]->Fill(diffBend / s->bendRes()); - } else { - hisDeltaBendFake_[tName]->Fill(diffBend / s->bendRes()); - } - - // Debug printout to understand for matched tracks, how far stubs lie from true particle trajectory - // Only prints for tracks with huge number of stubs, to also understand why these tracks exist. - //if (trk.getNumStubs() > 20) { - /* - if (trk.pt() > 20) { - cout<<"--- Checking how far stubs on matched tracks lie from true particle trajectory. ---"<pt()<<" "<d0()<sigmaPerp(); - float sigRorZ = deltaRorZ/s->sigmaPar(); - string ohoh = (fabs(sigPhiR) > 5 || fabs(sigRorZ) > 5) ? "FAR" : "NEAR"; - if (trueStub) { - cout<<" Real stub "<phi()<<" "<eta()<<" bend="<bend()<<" iphi="<iphi()<minPhi()<<" "<minZ()<Fill(trk.purity()); } } } @@ -1664,7 +728,7 @@ namespace tmtt { for (const TP& tp : vTPs) { vector matchedTrks; for (const L1track3D& trk : tracks) { - const TP* tpAssoc = trk.getMatchedTP(); + const TP* tpAssoc = trk.matchedTP(); if (tpAssoc != nullptr) { if (tpAssoc->index() == tp.index()) matchedTrks.push_back(&trk); @@ -1688,7 +752,7 @@ namespace tmtt { iSecRecoed.insert({trk->iPhiSec(), trk->iEtaReg()}); nSecsMatchingTPs = iSecRecoed.size(); - if (TMTT) { + if (algoTMTT) { for (const auto& p : iSecRecoed) { unsigned int nTrkInSec = 0; for (const L1track3D* trk : matchedTrks) { @@ -1697,9 +761,9 @@ namespace tmtt { } if (nTrkInSec > 0) { profDupTracksVsEta_[tName]->Fill( - fabs(tp.eta()), nTrkInSec - 1); // Study duplication of tracks within an individual HT array. + std::abs(tp.eta()), nTrkInSec - 1); // Study duplication of tracks within an individual HT array. profDupTracksVsInvPt_[tName]->Fill( - fabs(tp.qOverPt()), nTrkInSec - 1); // Study duplication of tracks within an individual HT array. + std::abs(tp.qOverPt()), nTrkInSec - 1); // Study duplication of tracks within an individual HT array. } } } @@ -1742,19 +806,13 @@ namespace tmtt { // For each tracking particle, find the corresponding reconstructed track(s). for (const L1track3D& trk : tracks) { - const TP* tpAssoc = trk.getMatchedTP(); + const TP* tpAssoc = trk.matchedTP(); if (tpAssoc != nullptr) { if (tpAssoc->index() == tp.index()) { hisQoverPtRes_[tName]->Fill(trk.qOverPt() - tp.qOverPt()); hisPhi0Res_[tName]->Fill(reco::deltaPhi(trk.phi0(), tp.phi0())); hisEtaRes_[tName]->Fill(trk.eta() - tp.eta()); hisZ0Res_[tName]->Fill(trk.z0() - tp.z0()); - - hisRecoVsTrueQinvPt_[tName]->Fill(tp.qOverPt(), trk.qOverPt()); - hisRecoVsTruePhi0_[tName]->Fill(tp.phi0(), trk.phi0()); - hisRecoVsTrueD0_[tName]->Fill(tp.d0(), trk.d0()); - hisRecoVsTrueZ0_[tName]->Fill(tp.z0(), trk.z0()); - hisRecoVsTrueEta_[tName]->Fill(tp.eta(), trk.eta()); } } } @@ -1766,30 +824,15 @@ namespace tmtt { for (const TP& tp : vTPs) { if (tp.useForEff()) { // Check TP is good for efficiency measurement. - // Check which eta and phi sectors this TP is in. - int iPhiSec_TP = -1; - int iEtaReg_TP = -1; - Sector sectorTmp; - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - sectorTmp.init(settings_, iPhiSec, 0); - if (sectorTmp.insidePhiSec(tp)) - iPhiSec_TP = iPhiSec; - } - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - sectorTmp.init(settings_, 0, iEtaReg); - if (sectorTmp.insideEtaReg(tp)) - iEtaReg_TP = iEtaReg; - } - // Check if this TP was reconstructed anywhere in the tracker.. bool tpRecoed = false; bool tpRecoedPerfect = false; for (const L1track3D& trk : tracks) { - const TP* tpAssoc = trk.getMatchedTP(); + const TP* tpAssoc = trk.matchedTP(); if (tpAssoc != nullptr) { if (tpAssoc->index() == tp.index()) { tpRecoed = true; - if (trk.getPurity() == 1.) + if (trk.purity() == 1.) tpRecoedPerfect = true; } } @@ -1798,548 +841,33 @@ namespace tmtt { // If TP was reconstucted by HT, then plot its kinematics. if (tpRecoed) { hisRecoTPinvptForEff_[tName]->Fill(1. / tp.pt()); - hisRecoTPptForEff_[tName]->Fill(tp.pt()); hisRecoTPetaForEff_[tName]->Fill(tp.eta()); hisRecoTPphiForEff_[tName]->Fill(tp.phi0()); // Plot also production point of all good reconstructed TP. - hisRecoTPd0ForEff_[tName]->Fill(fabs(tp.d0())); - hisRecoTPz0ForEff_[tName]->Fill(fabs(tp.z0())); + hisRecoTPd0ForEff_[tName]->Fill(std::abs(tp.d0())); + hisRecoTPz0ForEff_[tName]->Fill(std::abs(tp.z0())); // Also plot efficiency to perfectly reconstruct the track (no fake hits) if (tpRecoedPerfect) { hisPerfRecoTPinvptForEff_[tName]->Fill(1. / tp.pt()); - hisPerfRecoTPptForEff_[tName]->Fill(tp.pt()); hisPerfRecoTPetaForEff_[tName]->Fill(tp.eta()); } if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. hisRecoTPinvptForAlgEff_[tName]->Fill(1. / tp.pt()); - hisRecoTPptForAlgEff_[tName]->Fill(tp.pt()); hisRecoTPetaForAlgEff_[tName]->Fill(tp.eta()); hisRecoTPphiForAlgEff_[tName]->Fill(tp.phi0()); // Plot also production point of all good reconstructed TP. - hisRecoTPd0ForAlgEff_[tName]->Fill(fabs(tp.d0())); - hisRecoTPz0ForAlgEff_[tName]->Fill(fabs(tp.z0())); - // Plot sector number to understand if looser cuts are needed in certain eta regions. - hisRecoTPphisecForAlgEff_[tName]->Fill(iPhiSec_TP); - hisRecoTPetasecForAlgEff_[tName]->Fill(iEtaReg_TP); - - // Plot efficiency in jets - if (tp.tpInJet()) { - hisRecoTPinvptForAlgEff_inJetPtG30_[tName]->Fill(1. / tp.pt()); - } - if (tp.tpInHighPtJet()) { - hisRecoTPinvptForAlgEff_inJetPtG100_[tName]->Fill(1. / tp.pt()); - } - if (tp.tpInVeryHighPtJet()) { - hisRecoTPinvptForAlgEff_inJetPtG200_[tName]->Fill(1. / tp.pt()); - } + hisRecoTPd0ForAlgEff_[tName]->Fill(std::abs(tp.d0())); + hisRecoTPz0ForAlgEff_[tName]->Fill(std::abs(tp.z0())); // Also plot efficiency to perfectly reconstruct the track (no fake hits) if (tpRecoedPerfect) { hisPerfRecoTPinvptForAlgEff_[tName]->Fill(1. / tp.pt()); - hisPerfRecoTPptForAlgEff_[tName]->Fill(tp.pt()); hisPerfRecoTPetaForAlgEff_[tName]->Fill(tp.eta()); - hisPerfRecoTPphisecForAlgEff_[tName]->Fill(iPhiSec_TP); - hisPerfRecoTPetasecForAlgEff_[tName]->Fill(iEtaReg_TP); - } - } - } - } - } - - if (TMTT) { - // Diagnose reason why not all viable tracking particles were reconstructed. - const map diagnosis = this->diagnoseTracking(inputData.getTPs(), tracks, withRZfilter); - for (const auto& iter : diagnosis) { - hisRecoFailureReason_[tName]->Fill(iter.second.c_str(), 1.); // Stores flag indicating failure reason. - } - } - } - - //=== Understand why not all tracking particles were reconstructed. - //=== Returns list of tracking particles that were not reconstructed and an string indicating why. - //=== Only considers TP used for algorithmic efficiency measurement. - - // (If string = "mystery", reason for loss unknown. This may be a result of reconstruction of one - // track candidate preventing reconstruction of another. e.g. Due to duplicate track removal). - - map Histos::diagnoseTracking(const vector& allTPs, - const vector& tracks, - bool withRZfilter) const { - map diagnosis; - - for (const TP& tp : allTPs) { - string recoFlag = "unknown"; - - if (tp.useForAlgEff()) { //--- Only consider TP that are reconstructable. - - //--- Check if this TP was reconstructed anywhere in the tracker.. - bool tpRecoed = false; - for (const L1track3D& trk : tracks) { - const TP* tpAssoc = trk.getMatchedTP(); - if (tpAssoc != nullptr) { - if (tpAssoc->index() == tp.index()) - tpRecoed = true; - } - } - - if (tpRecoed) { - recoFlag = "success"; // successfully reconstructed so don't bother studying. - - } else { - //--- Check if TP was still reconstructable after cuts applied to stubs by front-end electronics. - vector fePassStubs; - for (const Stub* s : tp.assocStubs()) { - if (s->frontendPass()) - fePassStubs.push_back(s); - } - bool fePass = (Utility::countLayers(settings_, fePassStubs) >= genMinStubLayers_); - - if (!fePass) { - recoFlag = "FE electronics"; // Tracking failed because of front-end electronics cuts. - - } else { - //--- Check if assignment to (eta,phi) sectors prevented this TP being reconstruted. - bool insideSecPass = false; - bool insidePhiSecPass = false; - bool insideEtaRegPass = false; - unsigned int nLayers = 0; - // The next to variables are vectors in case track could be recontructed in more than one sector. - vector> insideSecStubs; - vector sectorBest; - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - Sector sectorTmp; - sectorTmp.init(settings_, iPhiSec, iEtaReg); - - // Get stubs on given tracking particle which are inside this (phi,eta) sector; - vector insideSecStubsTmp; - vector insidePhiSecStubsTmp; - vector insideEtaRegStubsTmp; - for (const Stub* s : fePassStubs) { - if (sectorTmp.inside(s)) - insideSecStubsTmp.push_back(s); - if (sectorTmp.insidePhi(s)) - insidePhiSecStubsTmp.push_back(s); - if (sectorTmp.insideEta(s)) - insideEtaRegStubsTmp.push_back(s); - } - // Check if TP could be reconstructed in this (phi,eta) sector. - unsigned int nLayersTmp = Utility::countLayers(settings_, insideSecStubsTmp); - if (nLayersTmp >= genMinStubLayers_) { - insideSecPass = true; - if (nLayers <= nLayersTmp) { - if (nLayers < nLayersTmp) { - nLayers = nLayersTmp; - insideSecStubs.clear(); - sectorBest.clear(); - } - insideSecStubs.push_back(insideSecStubsTmp); - sectorBest.push_back(sectorTmp); - } - } - // Check if TP could be reconstructed in this (phi) sector. - unsigned int nLayersPhiTmp = Utility::countLayers(settings_, insidePhiSecStubsTmp); - if (nLayersPhiTmp >= genMinStubLayers_) - insidePhiSecPass = true; - // Check if TP could be reconstructed in this (eta) region. - unsigned int nLayersEtaTmp = Utility::countLayers(settings_, insideEtaRegStubsTmp); - if (nLayersEtaTmp >= genMinStubLayers_) - insideEtaRegPass = true; - } - } - - if (!insideSecPass) { - // Tracking failed because of stub to sector assignment. - if (!insideEtaRegPass) { - recoFlag = "#eta sector"; // failed because of stub assignment to eta region. - } else if (!insidePhiSecPass) { - recoFlag = "#phi sector"; // failed because of stub assignment to phi sector. - } else { - recoFlag = "sector"; // failed because of stub assignment to (eta,phi) sector. - } - - } else { - //--- Check if TP was reconstructed by r-phi Hough transform with its bend filted turned off. - - // Consider all sectors in which the track might be reconstructed. - bool rphiHTunfilteredPass = false; - for (unsigned int iSec = 0; iSec < sectorBest.size(); iSec++) { - const Sector& secBest = sectorBest[iSec]; - HTrphi htRphiUnfiltered; - htRphiUnfiltered.init(settings_, - secBest.iPhiSec(), - secBest.iEtaReg(), - secBest.etaMin(), - secBest.etaMax(), - secBest.phiCentre()); - htRphiUnfiltered.disableBendFilter(); // Switch off bend filter - for (const Stub* s : insideSecStubs[iSec]) { - // Check which eta subsectors within the sector the stub is compatible with (if subsectors being used). - const vector inEtaSubSecs = secBest.insideEtaSubSecs(s); - htRphiUnfiltered.store(s, inEtaSubSecs); - } - htRphiUnfiltered.end(); - // Check if r-phi HT with its filters switched off found the track - if (htRphiUnfiltered.numTrackCands2D() > 0) - rphiHTunfilteredPass = true; - } - - if (!rphiHTunfilteredPass) { - recoFlag = "r-#phi HT UNfiltered"; // Tracking failed r-phi HT even with its bend filter turned off. - - } else { - //--- Check if TP was reconstructed by filtered r-phi HT. - - // Consider all sectors in which the track might be reconstructed. - bool rphiHTpass = false; - bool rzFilterPass = false; - for (unsigned int iSec = 0; iSec < sectorBest.size(); iSec++) { - const Sector& secBest = sectorBest[iSec]; - HTrphi htRphiTmp; - htRphiTmp.init(settings_, - secBest.iPhiSec(), - secBest.iEtaReg(), - secBest.etaMin(), - secBest.etaMax(), - secBest.phiCentre()); - for (const Stub* s : insideSecStubs[iSec]) { - // Check which eta subsectors within the sector the stub is compatible with (if subsectors being used). - const vector inEtaSubSecs = secBest.insideEtaSubSecs(s); - htRphiTmp.store(s, inEtaSubSecs); - } - htRphiTmp.end(); - - // Check if r-phi HT found the track - if (htRphiTmp.numTrackCands2D() > 0) - rphiHTpass = true; - // Check if track r-z filters run after r-phi HT kept track. - if (rphiHTpass) { - // Do so by getting tracks found by r-phi HT and running them through r-z filter. - const vector& trksRphi = htRphiTmp.trackCands2D(); - - // Initialize utility for making 3D tracks from 2S ones. - Get3Dtracks get3DtrkTmp; - get3DtrkTmp.init(settings_, - secBest.iPhiSec(), - secBest.iEtaReg(), - secBest.etaMin(), - secBest.etaMax(), - secBest.phiCentre()); - // Convert 2D tracks found by HT to 3D tracks (optionally by running r-z filters & duplicate track removal) - get3DtrkTmp.run(trksRphi); - if (get3DtrkTmp.trackCands3D(withRZfilter).size() > 0) - rzFilterPass = true; - } - } - - if (!rphiHTpass) { - recoFlag = "r-#phi HT BENDfiltered"; // Tracking failed r-phi HT with its bend filter on. - - //--- Debug printout to understand stubs failing bend filter. - - // cout<<"TRACK FAILING BEND FILTER: pt="<bend(); - // float bendRes = s->bendRes(); - // float theory = tp.qOverPt()/s->qOverPtOverBend(); - // cout<<" BEND: measured="<z() << " " << s->layerId()<<" PS="<psModule()<<" Barrel="<barrel() << endl; - - // if (fabs(bend - theory) > bendRes) { - // bool cluster0_OK = false; - // if (s->genuineCluster()[0]) cluster0_OK = (s->assocTPofCluster()[0]->index() == tp.index()); - // bool cluster1_OK = false; - // if (s->genuineCluster()[1]) cluster1_OK = (s->assocTPofCluster()[1]->index() == tp.index()); - // cout<< " STUB FAILED: layer="<layerId()<<" PS="<psModule()<<" clusters match="<bend() << " " << s->stripPitch() << " " << s->stripPitch() / s->pitchOverSep() << " " << s->dphiOverBend() << " " << s->dphi() << std::endl; - // cout << "Min R, Z : " << s->minR() << " " << s->minZ() << std::endl; - - // if ( fabs( bend * -1.0 - theory ) > bendRes ) { - // okIfBendMinus1 = false; - // } - // else { - // if ( bend > 0 ) hisWrongSignStubRZ_pBend_->Fill( s->z(), s->r() ); - // else if ( bend < 0 ) hisWrongSignStubRZ_nBend_->Fill( s->z(), s->r() ); - // } - // } - // } - // } - - // if ( okIfBendMinus1 ) { - // recoFlag = "BEND WRONG SIGN"; // Tracking failed r-phi HT with its bend filter on, but would have passed if bend of stubs had opposite sign. - // } - - } else { - if (!rzFilterPass) { - recoFlag = "r-z filter"; // Tracking failed r-z filter. - - } else { - recoFlag = - "mystery"; // Mystery: logically this tracking particle should have been reconstructed. This may be a result of a duplicate track removal algorithm (or something else where finding one track candidate prevents another being found). - } - } - } - } - } - diagnosis[&tp] = recoFlag; - } - } - } - return diagnosis; - } - - //=== Book histograms studying freak, large events with too many stubs. - - TFileDirectory Histos::bookStudyBusyEvents() { - TFileDirectory inputDir = fs_->mkdir("BusyEvents"); - - // Look at (eta, phi) sectors with too many input stubs or too many output (= assigned to tracks) stubs. - - unsigned int nEta = numEtaRegions_; - - hisNumBusySecsInPerEvent_ = - inputDir.make("NumBusySecsInPerEvent", "; No. sectors with too many input stubs/event", 20, -0.5, 19.5); - hisNumBusySecsOutPerEvent_ = - inputDir.make("NumBusySecsOutPerEvent", "; No. sectors with too many output stubs/event", 20, -0.5, 19.5); - profFracBusyInVsEtaReg_ = inputDir.make( - "FracBusyInVsEtaReg", "; #eta region; Frac. of sectors with too many input stubs", nEta, -0.5, nEta - 0.5); - profFracBusyOutVsEtaReg_ = inputDir.make( - "FracBusyOutVsEtaReg", "; #eta region; Frac. of sectors with too many output stubs", nEta, -0.5, nEta - 0.5); - profFracStubsKilledVsEtaReg_ = inputDir.make( - "FracStubsKilledInVsEtaReg", "; #eta region; Frac. of input stubs killed", nEta, -0.5, nEta - 0.5); - profFracTracksKilledVsEtaReg_ = inputDir.make( - "FracTracksKilledInVsEtaReg", "; #eta region; Frac. of track killed", nEta, -0.5, nEta - 0.5); - profFracTracksKilledVsInvPt_ = - inputDir.make("FracTracksKilledInVsInvPt", ";1/Pt; Frac. of track killed", 16, 0., 1. / houghMinPt_); - profFracTPKilledVsEta_ = inputDir.make( - "FracTPKilledInVsEta", ";#eta; Efficiency loss due to busy sectors", 16, 0., settings_->maxStubEta()); - profFracTPKilledVsInvPt_ = inputDir.make( - "FracTPKilledInVsInvPt", ";1/Pt; Efficiency loss due to busy sectors", 16, 0., 1. / houghMinPt_); - hisNumTPkilledBusySec_ = - inputDir.make("NumTPkilledBusySec", "; No. of TP killed in each busy sector", 30, -0.5, 29.5); - - // Compare properties of sectors with/without too many output stubs. - - const vector tnames = {"BusyOutSec", "QuietOutSec"}; - const vector enames = {" in busy output sector", " in quiet output sector"}; - for (unsigned int i = 0; i <= 1; i++) { - const string tn = tnames[i]; - const string en = enames[i]; - - hisNumInputStubs_[tn] = - inputDir.make(("NumInputStubs" + (tn)).c_str(), ("; No. input stubs" + (en)).c_str(), 250, -0.5, 249.5); - hisQoverPtInputStubs_[tn] = inputDir.make( - ("QoverPtInputStubs" + (tn)).c_str(), ("; q/Pt of input stubs" + (en)).c_str(), 30, 0., 1. / houghMinPt_); - hisNumOutputStubs_[tn] = inputDir.make( - ("NumOutputStubs" + (tn)).c_str(), ("; No. output stubs" + (en)).c_str(), 1000, -0.5, 999.5); - hisNumTracks_[tn] = - inputDir.make(("NumTracks" + (tn)).c_str(), ("; No. tracks" + (en)).c_str(), 200, -0.5, 199.5); - hisNumStubsPerTrack_[tn] = inputDir.make( - ("NumStubsPerTrack" + (tn)).c_str(), ("; No. stubs/track" + (en)).c_str(), 50, -0.5, 49.5); - hisTrackQoverPt_[tn] = inputDir.make( - ("TrackQoverPt" + (tn)).c_str(), ("; Track q/pt" + (en)).c_str(), 30, 0., 1. / houghMinPt_); - hisTrackPurity_[tn] = - inputDir.make(("TrackPurity" + (tn)).c_str(), ("; Track purity" + (en)).c_str(), 102, -0.01, 1.01); - hisNumTPphysics_[tn] = - inputDir.make(("NumTPphysics" + (tn)).c_str(), ("; No. physics TP" + (en)).c_str(), 30, -0.5, 29.5); - hisNumTPpileup_[tn] = - inputDir.make(("NumTPpileup" + (tn)).c_str(), ("; No. pileup TP" + (en)).c_str(), 30, -0.5, 29.5); - hisSumPtTPphysics_[tn] = inputDir.make( - ("SumPtTPphysics" + (tn)).c_str(), ("; Sum Pt physics TP" + (en)).c_str(), 100, 0.0, 100.); - hisSumPtTPpileup_[tn] = - inputDir.make(("SumPtTPpileup" + (tn)).c_str(), ("; Sum Pt pileup TP" + (en)).c_str(), 100, 0.0, 100.); - } - - return inputDir; - } - - //=== Fill histograms studying freak, large events with too many stubs at HT. - - void Histos::fillStudyBusyEvents(const InputData& inputData, - const matrix& mSectors, - const matrix& mHtRphis, - const matrix& mGet3Dtrks) { - const bool withRZfilter = false; // Care about events at HT. - - const unsigned int numStubsCut = - settings_->busySectorNumStubs(); // No. of stubs per HT array the hardware can output. - - const vector& vStubs = inputData.getStubs(); - const vector& vTPs = inputData.getTPs(); - - // Create map containing L1 tracks found in whole of tracker together with flag indicating if the - // track was killed because it was in a busy sector. - map trksInEntireTracker; - - unsigned int nBusySecIn = 0; - unsigned int nBusySecOut = 0; - - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - const Sector& sector = mSectors(iPhiSec, iEtaReg); - const HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); - const Get3Dtracks& get3Dtrk = mGet3Dtrks(iPhiSec, iEtaReg); - const vector& tracks = get3Dtrk.trackCands3D(withRZfilter); - - //--- Look for too many stubs input to sector. - - unsigned int nStubsIn = htRphi.nReceivedStubs(); - // Plot fraction of input stubs that would be killed by 36BX period. - for (unsigned int j = 0; j < nStubsIn; j++) { - bool kill = (j >= numStubsCut); - profFracStubsKilledVsEtaReg_->Fill(iEtaReg, kill); - } - bool tooBusyIn = (nStubsIn > numStubsCut); - if (tooBusyIn) - nBusySecIn++; - profFracBusyInVsEtaReg_->Fill(iEtaReg, tooBusyIn); // Sector had too many input stubs. - - //--- Look for too many stubs assigned to output tracks. - - // Order tracks in increasing order of abs(q/Pt). - // Use multimap rather than map to do this, as some tracks may have identical q/Pt, and it will store all of them, unlike map. - multimap orderedTrks; - for (const L1track3D& trk : tracks) { - orderedTrks.insert(pair(fabs(trk.qOverPt()), &trk)); - } - - // Create map containing L1 tracks found in whole of tracker together with flag indicating if the - // track was killed because it was in a busy sector. - map trksInSector; - - // Check how many tracks would be killed by 36BX period, assuming we kill preferentially low Pt ones. - bool tooBusyOut = false; - unsigned int nStubsOut = 0; - - for (const auto& oTrk : orderedTrks) { - float ptInv = oTrk.first; - const L1track3D* trk = oTrk.second; - bool kill = false; - nStubsOut += trk->getNumStubs(); - if (nStubsOut > numStubsCut) - kill = true; - - if (kill) - tooBusyOut = true; // Note that some tracks were killed in this sector. - - profFracTracksKilledVsEtaReg_->Fill(iEtaReg, kill); - profFracTracksKilledVsInvPt_->Fill(ptInv, kill); - - // Form a map of all tracks in the entire tracker & also just in this sector, with a flag indicating if they were killed as in a busy sector. - trksInEntireTracker[trk] = kill; - trksInSector[trk] = kill; - } - - if (tooBusyOut) - nBusySecOut++; - profFracBusyOutVsEtaReg_->Fill(iEtaReg, tooBusyOut); // Sector had too many output stubs. - - //--- Compare properties of sectors with/without too many output stubs. - - const vector tnames = {"BusyOutSec", "QuietOutSec"}; - - // Loop over sectors with too many/not too many output stubs. - for (const string& tn : tnames) { - if ((tn == "BusyOutSec" && tooBusyOut) || (tn == "QuietOutSec" && (!tooBusyOut))) { - hisNumInputStubs_[tn]->Fill(nStubsIn); - - // Check if q/Pt estimated from stub bend differs in busy & quiet sectors. - for (const Stub* stub : vStubs) { - if (sector.inside(stub)) - hisQoverPtInputStubs_[tn]->Fill(abs(stub->qOverPt())); - } - - // Look at reconstructed tracks in this sector. - hisNumOutputStubs_[tn]->Fill(nStubsOut); - hisNumTracks_[tn]->Fill(tracks.size()); - for (const L1track3D& trk : tracks) { - hisNumStubsPerTrack_[tn]->Fill(trk.getNumStubs()); - hisTrackQoverPt_[tn]->Fill(trk.qOverPt()); - hisTrackPurity_[tn]->Fill(trk.getPurity()); - } - - // Look at total Pt of truth particles in this sector to understand if it contains a jet. - unsigned int num_TP_physics = 0; - unsigned int num_TP_pileup = 0; - float sumPt_TP_physics = 0.; - float sumPt_TP_pileup = 0.; - for (const TP& tp : vTPs) { - bool tpInSector = - (fabs(tp.trkPhiAtR(settings_->chosenRofPhi()) - sector.phiCentre()) < sector.sectorHalfWidth() && - tp.trkZAtR(chosenRofZ_) > sector.zAtChosenR_Min() && - tp.trkZAtR(chosenRofZ_) < sector.zAtChosenR_Max()); - if (tpInSector) { - if (tp.physicsCollision()) { // distinguish truth particles from physics collision vs from pileup. - num_TP_physics++; - sumPt_TP_physics += tp.pt(); - } else { - num_TP_pileup++; - sumPt_TP_pileup += tp.pt(); - } - } - } - hisNumTPphysics_[tn]->Fill(num_TP_physics); - hisNumTPpileup_[tn]->Fill(num_TP_pileup); - hisSumPtTPphysics_[tn]->Fill(sumPt_TP_physics); - hisSumPtTPpileup_[tn]->Fill(sumPt_TP_pileup); - } - } - - //--- Count tracking particles lost by killing tracks in individual busy sectors. - if (tooBusyOut) { - unsigned int nTPkilled = 0; - for (const TP& tp : vTPs) { - if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. - - bool tpRecoed = false; - bool tpRecoedSurvived = false; - for (const auto& trkm : trksInSector) { - const L1track3D* trk = trkm.first; - bool kill = trkm.second; - if (trk->getMatchedTP() == &tp) { - tpRecoed = true; // Truth particle was reconstructed - if (!kill) - tpRecoedSurvived = true; // Ditto & reconstructed track wasn't killed by busy sector. - } - } - - bool tpKilled = tpRecoed && (!tpRecoedSurvived); - if (tpKilled) - nTPkilled++; } } - hisNumTPkilledBusySec_->Fill(nTPkilled); } } } - - hisNumBusySecsInPerEvent_->Fill(nBusySecIn); // No. of sectors per event with too many input stubs. - hisNumBusySecsOutPerEvent_->Fill(nBusySecOut); // No. of sectors per event with too many output stubs. - - //--- Check loss in tracking efficiency caused by killing tracks in busy sectors. - - for (const TP& tp : vTPs) { - if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. - - bool tpRecoed = false; - bool tpRecoedSurvived = false; - for (const auto& trkm : trksInEntireTracker) { - const L1track3D* trk = trkm.first; - bool kill = trkm.second; - if (trk->getMatchedTP() == &tp) { - tpRecoed = true; // Truth particle was reconstructed - if (!kill) - tpRecoedSurvived = true; // Ditto & reconstructed track wasn't killed by busy sector. - } - } - bool tpKilled = tpRecoed && (!tpRecoedSurvived); - profFracTPKilledVsEta_->Fill(fabs(tp.eta()), tpKilled); - profFracTPKilledVsInvPt_->Fill(fabs(tp.qOverPt()), tpKilled); - } - } } //=== Book histograms for studying track fitting. @@ -2348,15 +876,12 @@ namespace tmtt { const float maxEta = settings_->maxStubEta(); const float maxAbsQoverPt = 1. / houghMinPt_; // Max. |q/Pt| covered by HT array. - // Book histograms for 4 and 5 parameter helix fits. - map inputDirMap; for (const string& fitName : trackFitters_) { // Define lambda function to facilitate adding "fitName" histogram names. - auto addn = [fitName](string s) { return TString::Format("%s_%s", s.c_str(), fitName.c_str()); }; + auto addn = [fitName](const string& s) { return TString::Format("%s_%s", s.c_str(), fitName.c_str()); }; - //std::cout << "Booking histograms for " << fitName << std::endl; TFileDirectory inputDir = fs_->mkdir(fitName); inputDirMap[fitName] = inputDir; @@ -2372,8 +897,6 @@ namespace tmtt { inputDir.make(addn("NumFitTrks"), "; No. fitted tracks in tracker;", 200, -0.5, 399.5); hisNumFitTrksPerNon_[fitName] = inputDir.make(addn("NumFitTrksPerNon"), "; No. fitted tracks per nonant;", 200, -0.5, 199.5); - hisNumFitTrksPerSect_[fitName] = - inputDir.make(addn("NumFitTrksPerSect"), "; No. fitted tracks per sector;", 100, -0.5, 99.5); hisStubsPerFitTrack_[fitName] = inputDir.make(addn("StubsPerFitTrack"), "; No. of stubs per fitted track", 20, -0.5, 19.5); @@ -2406,209 +929,46 @@ namespace tmtt { const float chi2dofBins[nBinsChi2 + 1] = {0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.4, 2.8, 3.2, 3.6, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 25.0, 30.0}; - float chi2Bins[nBinsChi2 + 1]; - for (unsigned int k = 0; k < nBinsChi2 + 1; k++) - chi2Bins[k] = chi2dofBins[k] * 6; - hisFitChi2Matched_[fitName] = inputDir.make(addn("FitChi2Matched"), ";#chi^{2};", nBinsChi2, chi2Bins); hisFitChi2DofMatched_[fitName] = inputDir.make(addn("FitChi2DofMatched"), ";#chi^{2}/DOF;", nBinsChi2, chi2dofBins); hisFitChi2DofRphiMatched_[fitName] = - inputDir.make(addn("FitChi2DofRphiMatched"), ";#chi^{2}rphi;", nBinsChi2, chi2Bins); + inputDir.make(addn("FitChi2DofRphiMatched"), ";#chi^{2}rphi;", nBinsChi2, chi2dofBins); hisFitChi2DofRzMatched_[fitName] = - inputDir.make(addn("FitChi2DofRzMatched"), ";#chi^{2}rz/DOF;", nBinsChi2, chi2Bins); - if (settings_->kalmanAddBeamConstr() && - fitName.find("KF5") != - string::npos) { // Histograms of chi2 with beam-spot constraint only make sense for 5 param fit. - hisFitBeamChi2Matched_[fitName] = - inputDir.make(addn("FitBeamChi2Matched"), "; Beam constr #chi^{2};", nBinsChi2, chi2Bins); - hisFitBeamChi2DofMatched_[fitName] = - inputDir.make(addn("FitBeamChi2DofMatched"), ";Beam constr #chi^{2}/DOF;", nBinsChi2, chi2dofBins); - } - profFitChi2VsEtaMatched_[fitName] = - inputDir.make(addn("FitChi2VsEtaMatched"), "; #eta; Fit #chi^{2}", 24, 0., maxEta); - profFitChi2DofVsEtaMatched_[fitName] = - inputDir.make(addn("FitChi2DofVsEtaMatched"), "; #eta; Fit #chi^{2}/dof", 24, 0., maxEta); - profFitChi2VsInvPtMatched_[fitName] = - inputDir.make(addn("FitChi2VsInvPtMatched"), "; 1/p_{T}; Fit #chi^{2}", 25, 0., maxAbsQoverPt); + inputDir.make(addn("FitChi2DofRzMatched"), ";#chi^{2}rz/DOF;", nBinsChi2, chi2dofBins); profFitChi2DofVsInvPtMatched_[fitName] = inputDir.make( addn("FitChi2DofVsInvPtMatched"), "; 1/p_{T}; Fit #chi^{2}/dof", 25, 0., maxAbsQoverPt); - const unsigned int nBinsD0 = 8; - const float d0Bins[nBinsD0 + 1] = {0.0, 0.05, 0.10, 0.15, 0.20, 0.3, 0.5, 1.0, 2.0}; - profFitChi2VsTrueD0Matched_[fitName] = - inputDir.make(addn("FitChi2VsTrueD0Matched"), "; true d0 (cm); Fit #chi^{2}", nBinsD0, d0Bins); - profFitChi2DofVsTrueD0Matched_[fitName] = inputDir.make( - addn("FitChi2DofVsTrueD0Matched"), "; true d0 (cm); Fit #chi^{2}/dof", nBinsD0, d0Bins); - - hisFitChi2PerfMatched_[fitName] = - inputDir.make(addn("FitChi2PerfMatched"), ";#chi^{2};", nBinsChi2, chi2Bins); - hisFitChi2DofPerfMatched_[fitName] = - inputDir.make(addn("FitChi2DofPerfMatched"), ";#chi^{2}/DOF;", nBinsChi2, chi2dofBins); - - hisFitChi2Unmatched_[fitName] = inputDir.make(addn("FitChi2Unmatched"), ";#chi^{2};", nBinsChi2, chi2Bins); + hisFitChi2DofUnmatched_[fitName] = inputDir.make(addn("FitChi2DofUnmatched"), ";#chi^{2}/DOF;", nBinsChi2, chi2dofBins); hisFitChi2DofRphiUnmatched_[fitName] = - inputDir.make(addn("FitChi2DofRphiUnmatched"), ";#chi^{2}rphi/DOF;", nBinsChi2, chi2Bins); + inputDir.make(addn("FitChi2DofRphiUnmatched"), ";#chi^{2}rphi/DOF;", nBinsChi2, chi2dofBins); hisFitChi2DofRzUnmatched_[fitName] = - inputDir.make(addn("FitChi2DofRzUnmatched"), ";#chi^{2}rz/DOF;", nBinsChi2, chi2Bins); - if (settings_->kalmanAddBeamConstr() && - fitName.find("KF5") != - string::npos) { // Histograms of chi2 with beam-spot constraint only make sense for 5 param fit. - hisFitBeamChi2Unmatched_[fitName] = - inputDir.make(addn("FitBeamChi2Unmatched"), "; Beam constr #Chi^{2};", nBinsChi2, chi2Bins); - hisFitBeamChi2DofUnmatched_[fitName] = - inputDir.make(addn("FitBeamChi2DofUnmatched"), "; Beam constr #Chi^{2}/DOF;", nBinsChi2, chi2dofBins); - } - profFitChi2VsEtaUnmatched_[fitName] = - inputDir.make(addn("FitChi2VsEtaUnmatched"), "; #eta; Fit #chi2", 24, 0., maxEta); - profFitChi2DofVsEtaUnmatched_[fitName] = - inputDir.make(addn("FitChi2DofVsEtaUnmatched"), "; #eta; Fit #chi2/dof", 24, 0., maxEta); - profFitChi2VsInvPtUnmatched_[fitName] = - inputDir.make(addn("FitChi2VsInvPtUnmatched"), "; 1/p_{T}; Fit #chi2", 25, 0., maxAbsQoverPt); + inputDir.make(addn("FitChi2DofRzUnmatched"), ";#chi^{2}rz/DOF;", nBinsChi2, chi2dofBins); profFitChi2DofVsInvPtUnmatched_[fitName] = inputDir.make( addn("FitChi2DofVsInvPtUnmatched"), "; 1/p_{T}; Fit #chi2/dof", 25, 0., maxAbsQoverPt); - profFitChi2VsPurity_[fitName] = - inputDir.make(addn("FitChi2VsPurity"), "#Chi^{2} vs stub purity", 102, -0.01, 1.01); - profFitChi2DofVsPurity_[fitName] = - inputDir.make(addn("FitChi2DofVsPurity"), "#Chi^{2}/DOF vs stub purity", 102, -0.01, 1.01); - // Monitoring specific track fit algorithms. if (fitName.find("KF") != string::npos) { hisKalmanNumUpdateCalls_[fitName] = inputDir.make(addn("KalmanNumUpdateCalls"), "; Calls to KF updator;", 100, -0.5, 99.5); + hisKalmanChi2DofSkipLay0Matched_[fitName] = inputDir.make( - addn("KalmanChi2DofSkipLay0Matched"), ";#chi^{2} for nSkippedLayers = 0;", nBinsChi2, chi2Bins); + addn("KalmanChi2DofSkipLay0Matched"), ";#chi^{2} for nSkippedLayers = 0;", nBinsChi2, chi2dofBins); hisKalmanChi2DofSkipLay1Matched_[fitName] = inputDir.make( - addn("KalmanChi2DofSkipLay1Matched"), ";#chi^{2} for nSkippedLayers = 1;", nBinsChi2, chi2Bins); + addn("KalmanChi2DofSkipLay1Matched"), ";#chi^{2} for nSkippedLayers = 1;", nBinsChi2, chi2dofBins); hisKalmanChi2DofSkipLay2Matched_[fitName] = inputDir.make( - addn("KalmanChi2DofSkipLay2Matched"), ";#chi^{2} for nSkippedLayers = 2;", nBinsChi2, chi2Bins); + addn("KalmanChi2DofSkipLay2Matched"), ";#chi^{2} for nSkippedLayers = 2;", nBinsChi2, chi2dofBins); hisKalmanChi2DofSkipLay0Unmatched_[fitName] = inputDir.make( - addn("KalmanChi2DofSkipLay0Unmatched"), ";#chi^{2} for nSkippedLayers = 0;", nBinsChi2, chi2Bins); + addn("KalmanChi2DofSkipLay0Unmatched"), ";#chi^{2} for nSkippedLayers = 0;", nBinsChi2, chi2dofBins); hisKalmanChi2DofSkipLay1Unmatched_[fitName] = inputDir.make( - addn("KalmanChi2DofSkipLay1Unmatched"), ";#chi^{2} for nSkippedLayers = 1;", nBinsChi2, chi2Bins); + addn("KalmanChi2DofSkipLay1Unmatched"), ";#chi^{2} for nSkippedLayers = 1;", nBinsChi2, chi2dofBins); hisKalmanChi2DofSkipLay2Unmatched_[fitName] = inputDir.make( - addn("KalmanChi2DofSkipLay2Unmatched"), ";#chi^{2} for nSkippedLayers = 2;", nBinsChi2, chi2Bins); + addn("KalmanChi2DofSkipLay2Unmatched"), ";#chi^{2} for nSkippedLayers = 2;", nBinsChi2, chi2dofBins); } - // See how far stubs lie from fitted (or true) trajectory - hisDeltaPhitruePSbarrel_[fitName] = inputDir.make( - addn("DeltaPhitruePSbarrel"), "PS modules; ##sigma of true stubs from true traj. in phi;", 100, -5.0, 5.0); - hisDeltaRorZtruePSbarrel_[fitName] = inputDir.make( - addn("DeltaRorZtruePSbarrel"), "PS modules; ##sigma of true stubs from true traj. in r-z;", 100, -5.0, 5.0); - hisDeltaPhitrue2Sbarrel_[fitName] = inputDir.make( - addn("DeltaPhitrue2Sbarrel"), "2S modules; ##sigma of true stubs from true traj. in phi;", 100, -5.0, 5.0); - hisDeltaRorZtrue2Sbarrel_[fitName] = inputDir.make( - addn("DeltaRorZtrue2Sbarrel"), "2S modules; ##sigma of true stubs from true traj. in r-z;", 100, -5.0, 5.0); - hisDeltaPhitruePSendcap_[fitName] = inputDir.make( - addn("DeltaPhitruePSendcap"), "PS modules; ##sigma of true stubs from true traj. in phi;", 100, -5.0, 5.0); - hisDeltaRorZtruePSendcap_[fitName] = inputDir.make( - addn("DeltaRorZtruePSendcap"), "PS modules; ##sigma of true stubs from true traj. in r-z;", 100, -5.0, 5.0); - hisDeltaPhitrue2Sendcap_[fitName] = inputDir.make( - addn("DeltaPhitrue2Sendcap"), "2S modules; ##sigma of true stubs from true traj. in phi;", 100, -5.0, 5.0); - hisDeltaRorZtrue2Sendcap_[fitName] = inputDir.make( - addn("DeltaRorZtrue2Sendcap"), "2S modules; ##sigma of true stubs from true traj. in r-z;", 100, -5.0, 5.0); - hisDeltaPhifakePSbarrel_[fitName] = inputDir.make( - addn("DeltaPhifakePSbarrel"), "PS modules; ##sigma of fake stubs from true traj. in phi;", 100, -5.0, 5.0); - hisDeltaRorZfakePSbarrel_[fitName] = inputDir.make( - addn("DeltaRorZfakePSbarrel"), "PS modules; ##sigma of fake stubs from true traj. in r-z;", 100, -5.0, 5.0); - hisDeltaPhifake2Sbarrel_[fitName] = inputDir.make( - addn("DeltaPhifake2Sbarrel"), "2S modules; ##sigma of fake stubs from true traj. in phi;", 100, -5.0, 5.0); - hisDeltaRorZfake2Sbarrel_[fitName] = inputDir.make( - addn("DeltaRorZfake2Sbarrel"), "2S modules; ##sigma of fake stubs from true traj. in r-z;", 100, -5.0, 5.0); - hisDeltaPhifakePSendcap_[fitName] = inputDir.make( - addn("DeltaPhifakePSendcap"), "PS modules; ##sigma of fake stubs from true traj. in phi;", 100, -5.0, 5.0); - hisDeltaRorZfakePSendcap_[fitName] = inputDir.make( - addn("DeltaRorZfakePSendcap"), "PS modules; ##sigma of fake stubs from true traj. in r-z;", 100, -5.0, 5.0); - hisDeltaPhifake2Sendcap_[fitName] = inputDir.make( - addn("DeltaPhifake2Sendcap"), "2S modules; ##sigma of fake stubs from true traj. in phi;", 100, -5.0, 5.0); - hisDeltaRorZfake2Sendcap_[fitName] = inputDir.make( - addn("DeltaRorZfake2Sendcap"), "2S modules; ##sigma of fake stubs from true traj. in r-z;", 100, -5.0, 5.0); - profRecalcRphiChi2VsEtaTrue1_[fitName] = - inputDir.make(addn("RecalcRphiChi2VsEtaTrue1"), - "; #eta; Recalculated r-#phi #chi2 method 1 for matched tracks", - 24, - 0., - maxEta); - profRecalcRzChi2VsEtaTrue1_[fitName] = inputDir.make( - addn("RecalcRzChi2VsEtaTrue1"), "; #eta; Recalculated r-z #chi2 method 1 for matched tracks", 24, 0., maxEta); - profRecalcChi2VsEtaTrue1_[fitName] = inputDir.make( - addn("RecalcChi2VsEtaTrue1"), "; #eta; Recalculated #chi2 method 1 for matched tracks", 24, 0., maxEta); - profRecalcChi2VsEtaTrue2_[fitName] = inputDir.make( - addn("RecalcChi2VsEtaTrue2"), "; #eta; Recalculated #chi2 method 2 for matched tracks", 24, 0., maxEta); - profNsigmaPhivsInvPt_[fitName] = inputDir.make( - addn("NsigmaPhivsInvPt"), "; 1/Pt; Num #sigma of true stubs from true traj.", 16, 0., maxAbsQoverPt); - profNsigmaPhivsR_[fitName] = - inputDir.make(addn("NsigmaPhivsR"), "; r; Num #sigma of true stubs from true traj.", 22, 0., 110.); - profNsigmaPhivsTanl_[fitName] = inputDir.make( - addn("NsigmaPhivsTanl"), "; tan #lambda; Num #sigma of true stubs from true traj.", 20, 0., 6.); - - hisFitVsSeedQinvPtMatched_[fitName] = inputDir.make(addn("FitVsSeedQinvPtMatched"), - "; Seed q/p_{T} (Genuine Cand); Fitted q/p_{T}", - 120, - -0.6, - 0.6, - 120, - -0.6, - 0.6); - hisFitVsSeedPhi0Matched_[fitName] = inputDir.make( - addn("FitVsSeedPhi0Matched"), "; Seed #phi_{0} (Genuine Cand); Fitted #phi_{0}", 70, -3.5, 3.5, 70, -3.5, 3.5); - hisFitVsSeedD0Matched_[fitName] = inputDir.make( - addn("FitVsSeedD0Matched"), "; Seed d_{0} (Genuine Cand); Fitted d_{0}", 100, -2., 2., 100, -2., 2.); - hisFitVsSeedZ0Matched_[fitName] = inputDir.make( - addn("FitVsSeedZ0Matched"), "; Seed z_{0} (Genuine Cand); Fitted z_{0}", 100, -25., 25., 100, -25., 25.); - hisFitVsSeedEtaMatched_[fitName] = inputDir.make( - addn("FitVsSeedEtaMatched"), "; Seed #eta (Genuine Cand); Fitted #eta", 70, -3.5, 3.5, 70, -3.5, 3.5); - - hisFitVsSeedQinvPtUnmatched_[fitName] = inputDir.make(addn("FitVsSeedQinvPtUnmatched"), - "; Seed q/p_{T} (Fake Cand); Fitted q/p_{T}", - 120, - -0.6, - 0.6, - 120, - -0.6, - 0.6); - hisFitVsSeedPhi0Unmatched_[fitName] = inputDir.make( - addn("FitVsSeedPhi0Unmatched"), "; Seed #phi_{0} (Fake Cand); Fitted #phi_{0}", 70, -3.5, 3.5, 70, -3.5, 3.5); - hisFitVsSeedD0Unmatched_[fitName] = inputDir.make( - addn("FitVsSeedD0Unmatched"), "; Seed d_{0} (Fake Cand); Fitted d_{0}", 100, -2., 2., 100, -2., 2.); - hisFitVsSeedZ0Unmatched_[fitName] = inputDir.make( - addn("FitVsSeedZ0Unmatched"), "; Seed z_{0} (Fake Cand); Fitted z_{0}", 100, -25., 25., 100, -25., 25.); - hisFitVsSeedEtaUnmatched_[fitName] = inputDir.make( - addn("FitVsSeedEtaUnmatched"), "; Seed #eta (Fake Cand); Fitted #eta", 70, -3.5, 3.5, 70, -3.5, 3.5); - - hisNumStubsVsPurityMatched_[fitName] = inputDir.make( - addn("NumStubsVsPurityMatched"), "; Purity; Number of stubs", 102, -0.01, 1.01, 30, 0.0, 30.0); - profFitFracTrueStubsVsLayerMatched_[fitName] = inputDir.make( - addn("FitFracTrueStubsVsLayerMatched"), ";Layer ID; fraction of true stubs", 30, 0.5, 30.5); - profFitFracTrueStubsVsEtaMatched_[fitName] = - inputDir.make(addn("FitFracTrueStubsVsEtaMatched"), ";#eta; fraction of true stubs", 24, 0., 3.); - // Plots of helix param resolution. - hisFitVsTrueQinvPt_[fitName] = inputDir.make( - addn("FitVsTrueQinvPt"), "; TP q/p_{T}; Fitted q/p_{T} (good #chi^{2})", 120, -0.6, 0.6, 120, -0.6, 0.6); - hisFitVsTruePhi0_[fitName] = inputDir.make( - addn("FitVsTruePhi0"), "; TP #phi_{0}; Fitted #phi_{0} (good #chi^{2})", 70, -3.5, 3.5, 70, -3.5, 3.5); - hisFitVsTrueD0_[fitName] = inputDir.make( - addn("FitVsTrueD0"), "; TP d_{0}; Fitted d_{0} (good #chi^{2})", 100, -2., 2., 100, -2., 2.); - hisFitVsTrueZ0_[fitName] = inputDir.make( - addn("FitVsTrueZ0"), "; TP z_{0}; Fitted z_{0} (good #chi^{2})", 100, -25., 25., 100, -25., 25.); - hisFitVsTrueEta_[fitName] = inputDir.make( - addn("FitVsTrueEta"), "; TP #eta; Fitted #eta (good #chi^{2})", 70, -3.5, 3.5, 70, -3.5, 3.5); - - hisFitQinvPtRes_[fitName] = - inputDir.make(addn("FitQinvPtRes"), "Fitted minus true q/p_{T} (good #chi^{2})", 100, -0.1, 0.1); - hisFitPhi0Res_[fitName] = - inputDir.make(addn("FitPhi0Res"), "Fitted minus true #phi_{0} (good #chi^{2})", 100, -0.02, 0.02); - hisFitD0Res_[fitName] = - inputDir.make(addn("FitD0Res"), "Fitted minus true d_{0} (good #chi^{2})", 100, -0.2, 0.2); - hisFitZ0Res_[fitName] = - inputDir.make(addn("FitZ0Res"), "Fitted minus true z_{0} (good #chi^{2})", 100, -2., 2.); - hisFitEtaRes_[fitName] = - inputDir.make(addn("FitEtaRes"), "Fitted minus true #eta (good #chi^{2})", 100, -0.02, 0.02); - hisQoverPtResVsTrueEta_[fitName] = inputDir.make( addn("QoverPtResVsTrueEta"), "q/p_{T} resolution; |#eta|; q/p_{T} resolution", 24, 0.0, maxEta); hisPhi0ResVsTrueEta_[fitName] = inputDir.make( @@ -2631,36 +991,6 @@ namespace tmtt { hisD0ResVsTrueInvPt_[fitName] = inputDir.make( addn("D0ResVsTrueInvPt"), "d_{0} resolution; 1/p_{T}; d_{0} resolution", 25, 0.0, maxAbsQoverPt); - if (settings_->kalmanAddBeamConstr() && - fitName.find("KF5") != - string::npos) { // Histograms of resolution with beam-spot constraint only make sense for 5 param fit. - hisQoverPtResBeamVsTrueEta_[fitName] = - inputDir.make(addn("QoverPtResBeamVsTrueEta"), - "q/p_{T} resolution with beam constr; |#eta|; q/p_{T} resolution", - 24, - 0.0, - maxEta); - hisPhi0ResBeamVsTrueEta_[fitName] = - inputDir.make(addn("PhiResBeamVsTrueEta"), - "#phi_{0} resolution with beam constr; |#eta|; #phi_{0} resolution", - 24, - 0.0, - maxEta); - - hisQoverPtResBeamVsTrueInvPt_[fitName] = - inputDir.make(addn("QoverPtResBeamVsTrueInvPt"), - "q/p_{T} resolution with beam constr; 1/p_{T}; q/p_{T} resolution", - 25, - 0.0, - maxAbsQoverPt); - hisPhi0ResBeamVsTrueInvPt_[fitName] = - inputDir.make(addn("PhiResBeamVsTrueInvPt"), - "#phi_{0} resolution with beam constr; 1/p_{T}; #phi_{0} resolution", - 25, - 0.0, - maxAbsQoverPt); - } - // Duplicate track histos. profDupFitTrksVsEta_[fitName] = inputDir.make(addn("DupFitTrksVsEta"), "; #eta; No. of duplicate tracks per TP", 12, 0., 3.); @@ -2670,8 +1000,6 @@ namespace tmtt { // Histos for tracking efficiency vs. TP kinematics. (Binning must match similar histos in bookTrackCands()). hisFitTPinvptForEff_[fitName] = inputDir.make( addn("FitTPinvptForEff"), "; 1/Pt of TP (used for effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); - hisFitTPptForEff_[fitName] = - inputDir.make(addn("FitTPptForEff"), "; Pt of TP (used for effi. measurement);", 25, 0.0, 100.0); hisFitTPetaForEff_[fitName] = inputDir.make(addn("FitTPetaForEff"), "; #eta of TP (used for effi. measurement);", 20, -3., 3.); hisFitTPphiForEff_[fitName] = @@ -2680,8 +1008,6 @@ namespace tmtt { // Histo for efficiency to reconstruct track perfectly (no incorrect hits). (Binning must match similar histos in bookTrackCands()). hisPerfFitTPinvptForEff_[fitName] = inputDir.make( addn("PerfFitTPinvptForEff"), "; 1/Pt of TP (used for perf. effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); - hisPerfFitTPptForEff_[fitName] = inputDir.make( - addn("PerfFitTPptForEff"), "; Pt of TP (used for perf. effi. measurement);", 25, 0.0, 100.0); hisPerfFitTPetaForEff_[fitName] = inputDir.make( addn("PerfFitTPetaForEff"), "; #eta of TP (used for perfect effi. measurement);", 20, -3., 3.); @@ -2694,8 +1020,6 @@ namespace tmtt { // Histos for algorithmic tracking efficiency vs. TP kinematics. (Binning must match similar histos in bookTrackCands()). hisFitTPinvptForAlgEff_[fitName] = inputDir.make( addn("FitTPinvptForAlgEff"), "; 1/Pt of TP (used for alg. effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); - hisFitTPptForAlgEff_[fitName] = inputDir.make( - addn("FitTPptForAlgEff"), "; Pt of TP (used for alg. effi. measurement);", 25, 0.0, 100.0); hisFitTPetaForAlgEff_[fitName] = inputDir.make( addn("FitTPetaForAlgEff"), "; #eta of TP (used for alg. effi. measurement);", 20, -3., 3.); hisFitTPphiForAlgEff_[fitName] = inputDir.make( @@ -2708,75 +1032,30 @@ namespace tmtt { 24, 0., 1.5 * maxAbsQoverPt); - hisPerfFitTPptForAlgEff_[fitName] = inputDir.make( - addn("PerfFitTPptForAlgEff"), "; Pt of TP (used for perf. alg. effi. measurement);", 25, 0.0, 100.0); hisPerfFitTPetaForAlgEff_[fitName] = inputDir.make( addn("PerfFitTPetaForAlgEff"), "; #eta of TP (used for perf. alg. effi. measurement);", 20, -3., 3.); - // Ditto for tracks inside jets. - hisPerfFitTPinvptForAlgEff_inJetPtG30_[fitName] = - inputDir.make(addn("PerfFitTPinvptForAlgEff_inJetPtG30"), - "; 1/Pt of TP (used for perf. alg. effi. measurement);", - 24, - 0., - 1.5 * maxAbsQoverPt); - hisPerfFitTPinvptForAlgEff_inJetPtG100_[fitName] = - inputDir.make(addn("PerfFitTPinvptForAlgEff_inJetPtG100"), - "; 1/Pt of TP (used for perf. alg. effi. measurement);", - 24, - 0., - 1.5 * maxAbsQoverPt); - hisPerfFitTPinvptForAlgEff_inJetPtG200_[fitName] = - inputDir.make(addn("PerfFitTPinvptForAlgEff_inJetPtG200"), - "; 1/Pt of TP (used for perf. alg. effi. measurement);", - 24, - 0., - 1.5 * maxAbsQoverPt); - // Histos for algorithmic tracking efficiency vs. TP production point. (Binning must match similar histos in bookTrackCands()). hisFitTPd0ForAlgEff_[fitName] = inputDir.make(addn("FitTPd0ForAlgEff"), "; d0 of TP (used for alg. effi. measurement);", 40, 0., 4.); hisFitTPz0ForAlgEff_[fitName] = inputDir.make(addn("FitTPz0ForAlgEff"), "; z0 of TP (used for alg. effi. measurement);", 50, 0., 25.); - - // Histo for algorithmic tracking efficiency vs sector number (to check if looser cuts are needed in certain regions) - unsigned int nPhi = numPhiSectors_; - unsigned int nEta = numEtaRegions_; - hisFitTPphisecForAlgEff_[fitName] = inputDir.make(addn("FitTPphisecForAlgEff"), - "; #phi sector of TP (used for alg. effi. measurement);", - nPhi, - -0.5, - nPhi - 0.5); - hisFitTPetasecForAlgEff_[fitName] = inputDir.make(addn("FitTPetasecForAlgEff"), - "; #eta sector of TP (used for alg. effi. measurement);", - nEta, - -0.5, - nEta - 0.5); - hisPerfFitTPphisecForAlgEff_[fitName] = - inputDir.make(addn("PerfFitTPphisecForAlgEff"), - "; #phi sector of TP (used for perf. alg. effi. measurement);", - nPhi, - -0.5, - nPhi - 0.5); - hisPerfFitTPetasecForAlgEff_[fitName] = - inputDir.make(addn("PerfFitTPetasecForAlgEff"), - "; #eta sector of TP (used for perf. alg. effi. measurement);", - nEta, - -0.5, - nEta - 0.5); } - return inputDirMap; } //=== Fill histograms for studying track fitting. - void Histos::fillTrackFitting(const InputData& inputData, const map>& mFittedTracks) { - const vector& vTPs = inputData.getTPs(); + void Histos::fillTrackFitting(const InputData& inputData, + const map>& mapFinalTracks) { + // Allow only one thread to run this function at a time + std::lock_guard myGuard(myMutex[5]); + + const list& vTPs = inputData.getTPs(); // Loop over all the fitting algorithms we are trying. for (const string& fitName : trackFitters_) { - const vector& fittedTracks = mFittedTracks.at(fitName); // Get fitted tracks. + const list& fittedTracks = mapFinalTracks.at(fitName); // Get fitted tracks. // Count tracks unsigned int nFitTracks = 0; @@ -2784,19 +1063,17 @@ namespace tmtt { const unsigned int numPhiNonants = settings_->numPhiNonants(); vector nFitTracksPerNonant(numPhiNonants, 0); - map, unsigned int> nFitTracksPerSector; - for (const L1fittedTrack& fitTrk : fittedTracks) { + for (const L1fittedTrack* fitTrk : fittedTracks) { nFitTracks++; // Get matched truth particle, if any. - const TP* tp = fitTrk.getMatchedTP(); + const TP* tp = fitTrk->matchedTP(); if (tp != nullptr) nFitsMatchingTP++; // Count fitted tracks per nonant. - unsigned int iNonant = - (numPhiSectors_ > 0) ? floor(fitTrk.iPhiSec() * numPhiNonants / (numPhiSectors_)) : 0; // phi nonant number + unsigned int iNonant = (numPhiSectors_ > 0) ? floor(fitTrk->iPhiSec() * numPhiNonants / (numPhiSectors_)) + : 0; // phi nonant number nFitTracksPerNonant[iNonant]++; - nFitTracksPerSector[pair(fitTrk.iPhiSec(), fitTrk.iEtaReg())]++; } profNumFitTracks_[fitName]->Fill(1, nFitTracks); @@ -2806,14 +1083,11 @@ namespace tmtt { for (const unsigned int& num : nFitTracksPerNonant) { hisNumFitTrksPerNon_[fitName]->Fill(num); } - for (const auto& p : nFitTracksPerSector) { - hisNumFitTrksPerSect_[fitName]->Fill(p.second); - } // Count stubs assigned to fitted tracks. unsigned int nTotStubs = 0; - for (const L1fittedTrack& fitTrk : fittedTracks) { - unsigned int nStubs = fitTrk.getNumStubs(); + for (const L1fittedTrack* fitTrk : fittedTracks) { + unsigned int nStubs = fitTrk->numStubs(); hisStubsPerFitTrack_[fitName]->Fill(nStubs); nTotStubs += nStubs; } @@ -2829,11 +1103,11 @@ namespace tmtt { tpRecoedMap[&tp] = false; tpPerfRecoedMap[&tp] = false; unsigned int nMatch = 0; - for (const L1fittedTrack& fitTrk : fittedTracks) { - const TP* assocTP = fitTrk.getMatchedTP(); // Get the TP the fitted track matches to, if any. + for (const L1fittedTrack* fitTrk : fittedTracks) { + const TP* assocTP = fitTrk->matchedTP(); // Get the TP the fitted track matches to, if any. if (assocTP == &tp) { tpRecoedMap[&tp] = true; - if (fitTrk.getPurity() == 1.) + if (fitTrk->purity() == 1.) tpPerfRecoedMap[&tp] = true; nMatch++; } @@ -2858,383 +1132,92 @@ namespace tmtt { // Loop over fitted tracks again. - for (const L1fittedTrack& fitTrk : fittedTracks) { + for (const L1fittedTrack* fitTrk : fittedTracks) { // Info for specific track fit algorithms. unsigned int nSkippedLayers = 0; unsigned int numUpdateCalls = 0; if (fitName.find("KF") != string::npos) { - fitTrk.getInfoKF(nSkippedLayers, numUpdateCalls); + fitTrk->infoKF(nSkippedLayers, numUpdateCalls); hisKalmanNumUpdateCalls_[fitName]->Fill(numUpdateCalls); } //--- Compare fitted tracks that match truth particles to those that don't. - // Get original HT track candidate prior to fit for comparison. - const L1track3D& htTrk = fitTrk.getL1track3D(); - // Get matched truth particle, if any. - const TP* tp = fitTrk.getMatchedTP(); + const TP* tp = fitTrk->matchedTP(); if (tp != nullptr) { - hisFitQinvPtMatched_[fitName]->Fill(fitTrk.qOverPt()); - hisFitPhi0Matched_[fitName]->Fill(fitTrk.phi0()); - hisFitD0Matched_[fitName]->Fill(fitTrk.d0()); - hisFitZ0Matched_[fitName]->Fill(fitTrk.z0()); - hisFitEtaMatched_[fitName]->Fill(fitTrk.eta()); - - hisFitChi2Matched_[fitName]->Fill(fitTrk.chi2()); - hisFitChi2DofMatched_[fitName]->Fill(fitTrk.chi2dof()); - hisFitChi2DofRphiMatched_[fitName]->Fill(fitTrk.chi2rphi() / fitTrk.numDOFrphi()); - hisFitChi2DofRzMatched_[fitName]->Fill(fitTrk.chi2rz() / fitTrk.numDOFrz()); - if (settings_->kalmanAddBeamConstr() && - fitName.find("KF5") != - string::npos) { // Histograms of chi2 with beam-spot constraint only make sense for 5 param fit. - hisFitBeamChi2Matched_[fitName]->Fill(fitTrk.chi2_bcon()); - hisFitBeamChi2DofMatched_[fitName]->Fill(fitTrk.chi2dof_bcon()); - } - profFitChi2VsEtaMatched_[fitName]->Fill(fabs(fitTrk.eta()), fitTrk.chi2()); - profFitChi2DofVsEtaMatched_[fitName]->Fill(fabs(fitTrk.eta()), fitTrk.chi2dof()); - profFitChi2VsInvPtMatched_[fitName]->Fill(fabs(fitTrk.qOverPt()), fitTrk.chi2()); - profFitChi2DofVsInvPtMatched_[fitName]->Fill(fabs(fitTrk.qOverPt()), fitTrk.chi2dof()); - profFitChi2VsTrueD0Matched_[fitName]->Fill(fabs(tp->d0()), fitTrk.chi2()); - profFitChi2DofVsTrueD0Matched_[fitName]->Fill(fabs(tp->d0()), fitTrk.chi2dof()); - - // Check chi2/dof for perfectly reconstructed tracks. - if (fitTrk.getPurity() == 1.) { - hisFitChi2PerfMatched_[fitName]->Fill(fitTrk.chi2()); - hisFitChi2DofPerfMatched_[fitName]->Fill(fitTrk.chi2dof()); - } + hisFitQinvPtMatched_[fitName]->Fill(fitTrk->qOverPt()); + hisFitPhi0Matched_[fitName]->Fill(fitTrk->phi0()); + hisFitD0Matched_[fitName]->Fill(fitTrk->d0()); + hisFitZ0Matched_[fitName]->Fill(fitTrk->z0()); + hisFitEtaMatched_[fitName]->Fill(fitTrk->eta()); + + hisFitChi2DofMatched_[fitName]->Fill(fitTrk->chi2dof()); + hisFitChi2DofRphiMatched_[fitName]->Fill(fitTrk->chi2rphi() / fitTrk->numDOFrphi()); + hisFitChi2DofRzMatched_[fitName]->Fill(fitTrk->chi2rz() / fitTrk->numDOFrz()); + profFitChi2DofVsInvPtMatched_[fitName]->Fill(std::abs(fitTrk->qOverPt()), fitTrk->chi2dof()); if (fitName.find("KF") != string::npos) { // No. of skipped layers on track during Kalman track fit. if (nSkippedLayers == 0) { - hisKalmanChi2DofSkipLay0Matched_[fitName]->Fill(fitTrk.chi2dof()); + hisKalmanChi2DofSkipLay0Matched_[fitName]->Fill(fitTrk->chi2dof()); } else if (nSkippedLayers == 1) { - hisKalmanChi2DofSkipLay1Matched_[fitName]->Fill(fitTrk.chi2dof()); + hisKalmanChi2DofSkipLay1Matched_[fitName]->Fill(fitTrk->chi2dof()); } else if (nSkippedLayers >= 2) { - hisKalmanChi2DofSkipLay2Matched_[fitName]->Fill(fitTrk.chi2dof()); + hisKalmanChi2DofSkipLay2Matched_[fitName]->Fill(fitTrk->chi2dof()); } } - // Compared fitted track helix params with seed track from HT. - hisFitVsSeedQinvPtMatched_[fitName]->Fill(htTrk.qOverPt(), fitTrk.qOverPt()); - hisFitVsSeedPhi0Matched_[fitName]->Fill(htTrk.phi0(), fitTrk.phi0()); - hisFitVsSeedD0Matched_[fitName]->Fill(htTrk.d0(), fitTrk.d0()); - hisFitVsSeedZ0Matched_[fitName]->Fill(htTrk.z0(), fitTrk.z0()); - hisFitVsSeedEtaMatched_[fitName]->Fill(htTrk.eta(), fitTrk.eta()); - - // Study incorrect hits on matched tracks. - hisNumStubsVsPurityMatched_[fitName]->Fill(fitTrk.getNumStubs(), fitTrk.getPurity()); - - const vector stubs = fitTrk.getStubs(); - for (const Stub* s : stubs) { - // Was this stub produced by correct truth particle? - const set stubTPs = s->assocTPs(); - bool trueStub = (stubTPs.find(tp) != stubTPs.end()); - profFitFracTrueStubsVsLayerMatched_[fitName]->Fill(s->layerId(), trueStub); - profFitFracTrueStubsVsEtaMatched_[fitName]->Fill(fabs(s->eta()), trueStub); - } - } else { - hisFitQinvPtUnmatched_[fitName]->Fill(fitTrk.qOverPt()); - hisFitPhi0Unmatched_[fitName]->Fill(fitTrk.phi0()); - hisFitD0Unmatched_[fitName]->Fill(fitTrk.d0()); - hisFitZ0Unmatched_[fitName]->Fill(fitTrk.z0()); - hisFitEtaUnmatched_[fitName]->Fill(fitTrk.eta()); - - hisFitChi2Unmatched_[fitName]->Fill(fitTrk.chi2()); - hisFitChi2DofUnmatched_[fitName]->Fill(fitTrk.chi2dof()); - hisFitChi2DofRphiUnmatched_[fitName]->Fill(fitTrk.chi2rphi() / fitTrk.numDOFrphi()); - hisFitChi2DofRzUnmatched_[fitName]->Fill(fitTrk.chi2rz() / fitTrk.numDOFrz()); - if (settings_->kalmanAddBeamConstr() && - fitName.find("KF5") != - string::npos) { // Histograms of chi2 with beam-spot constraint only make sense for 5 param fit. - hisFitBeamChi2Unmatched_[fitName]->Fill(fitTrk.chi2_bcon()); - hisFitBeamChi2DofUnmatched_[fitName]->Fill(fitTrk.chi2dof_bcon()); - } - profFitChi2VsEtaUnmatched_[fitName]->Fill(fabs(fitTrk.eta()), fitTrk.chi2()); - profFitChi2DofVsEtaUnmatched_[fitName]->Fill(fabs(fitTrk.eta()), fitTrk.chi2dof()); - profFitChi2VsInvPtUnmatched_[fitName]->Fill(fabs(fitTrk.qOverPt()), fitTrk.chi2()); - profFitChi2DofVsInvPtUnmatched_[fitName]->Fill(fabs(fitTrk.qOverPt()), fitTrk.chi2dof()); + hisFitQinvPtUnmatched_[fitName]->Fill(fitTrk->qOverPt()); + hisFitPhi0Unmatched_[fitName]->Fill(fitTrk->phi0()); + hisFitD0Unmatched_[fitName]->Fill(fitTrk->d0()); + hisFitZ0Unmatched_[fitName]->Fill(fitTrk->z0()); + hisFitEtaUnmatched_[fitName]->Fill(fitTrk->eta()); + + hisFitChi2DofUnmatched_[fitName]->Fill(fitTrk->chi2dof()); + hisFitChi2DofRphiUnmatched_[fitName]->Fill(fitTrk->chi2rphi() / fitTrk->numDOFrphi()); + hisFitChi2DofRzUnmatched_[fitName]->Fill(fitTrk->chi2rz() / fitTrk->numDOFrz()); + profFitChi2DofVsInvPtUnmatched_[fitName]->Fill(std::abs(fitTrk->qOverPt()), fitTrk->chi2dof()); if (fitName.find("KF") != string::npos) { // No. of skipped layers on track during Kalman track fit. if (nSkippedLayers == 0) { - hisKalmanChi2DofSkipLay0Unmatched_[fitName]->Fill(fitTrk.chi2dof()); + hisKalmanChi2DofSkipLay0Unmatched_[fitName]->Fill(fitTrk->chi2dof()); } else if (nSkippedLayers == 1) { - hisKalmanChi2DofSkipLay1Unmatched_[fitName]->Fill(fitTrk.chi2dof()); + hisKalmanChi2DofSkipLay1Unmatched_[fitName]->Fill(fitTrk->chi2dof()); } else if (nSkippedLayers >= 2) { - hisKalmanChi2DofSkipLay2Unmatched_[fitName]->Fill(fitTrk.chi2dof()); + hisKalmanChi2DofSkipLay2Unmatched_[fitName]->Fill(fitTrk->chi2dof()); } } - - hisFitVsSeedQinvPtUnmatched_[fitName]->Fill(htTrk.qOverPt(), fitTrk.qOverPt()); - hisFitVsSeedPhi0Unmatched_[fitName]->Fill(htTrk.phi0(), fitTrk.phi0()); - hisFitVsSeedD0Unmatched_[fitName]->Fill(htTrk.d0(), fitTrk.d0()); - hisFitVsSeedZ0Unmatched_[fitName]->Fill(htTrk.z0(), fitTrk.z0()); - hisFitVsSeedEtaUnmatched_[fitName]->Fill(htTrk.eta(), fitTrk.eta()); - } - - // Study how incorrect stubs on track affect fit chi2. - profFitChi2VsPurity_[fitName]->Fill(fitTrk.getPurity(), fitTrk.chi2()); - profFitChi2DofVsPurity_[fitName]->Fill(fitTrk.getPurity(), fitTrk.chi2dof()); - - // Look at stub residuals w.r.t. fitted (or true) track. - if (tp != nullptr) { - //if (tp != nullptr && tp->pt() > 50 && fabs(tp->pdgId()) == 13 && tp->charge() > 0) { - //if (tp != nullptr && tp->pt() > 2 && tp->pt() < 2.5 && fabs(tp->pdgId()) == 13 && tp->charge() > 0) { - // --- Options for recalc histograms - // Choose to get residuals from truth particle or fitted track? - // (Only applies to chi2 method 2 below). - const bool recalc_useTP = false; - // debug printout - const bool recalc_debug = false; - // In residual plots, use residuals from method 2. (Imperfect, as neglects r-phi to r-z correlation). - const bool recalc_method2 = true; - - float recalcChiSquared_1_rphi = 0.; - float recalcChiSquared_1_rz = 0.; - float recalcChiSquared_2 = 0.; - const vector stubs = fitTrk.getStubs(); - if (recalc_debug) - cout << "RECALC loop stubs : HT cell=(" << fitTrk.getCellLocationHT().first << "," - << fitTrk.getCellLocationHT().second << ") TP PDG_ID=" << tp->pdgId() << endl; - for (const Stub* s : stubs) { - // Was this stub produced by correct truth particle? - const set stubTPs = s->assocTPs(); - bool trueStub = (stubTPs.find(tp) != stubTPs.end()); - - //--- Calculation of chi2 (method 1 -- works with residuals in (z,phi) in barrel & (r,phi) in endcap & allows for non-radial 2S endcap strips by shifting stub phi coords.) - - //--- Calculate residuals - // Distance of stub from true trajectory in z (barrel) or r (endcap) - float deltaRorZ = s->barrel() ? (s->z() - tp->trkZAtStub(s)) : (s->r() - tp->trkRAtStub(s)); - // Distance of stub from true trajectory in phi. - float deltaPhi = reco::deltaPhi(s->phi(), tp->trkPhiAtStub(s)); - - // Nasty correction to stub phi coordinate to take into account non-radial strips in endcap 2S modules. - float phiCorr = (tp->trkRAtStub(s) - s->r()) * s->alpha(); - deltaPhi += phiCorr; - - // Local calculation of chi2, to check that from fitter. - float sigmaPhi2_raw = pow(s->sigmaPerp() / s->r(), 2); - float sigmaZ2_raw = s->sigmaPar() * s->sigmaPar(); - float sigmaZ2 = sigmaZ2_raw; - // Scattering term scaling as 1/Pt. - double phiExtra = settings_->kalmanMultiScattTerm() / (tp->pt()); - double phiExtra2 = phiExtra * phiExtra; - float sigmaPhi2 = sigmaPhi2_raw + phiExtra2; - if (s->tiltedBarrel()) { - float tilt = s->moduleTilt(); - float scaleTilted = sin(tilt) + cos(tilt) * (tp->tanLambda()); - float scaleTilted2 = scaleTilted * scaleTilted; - sigmaZ2 *= scaleTilted2; - } - if (trueStub) { - recalcChiSquared_1_rphi += pow((deltaPhi), 2) / sigmaPhi2; - recalcChiSquared_1_rz += pow(deltaRorZ, 2) / sigmaZ2; - } - - //--- Calculation of chi2 (method 2 -- works with residuals in (z,phi) everywhere & allows for non-radial 2S endcap strips via correlation matrix in stub coords - copied from KF4ParamsComb.cc) - - //--- Calculate residuals - float deltaZ_proj, deltaPhi_proj; - float inv2R_proj, tanL_proj, z0_proj; - if (recalc_useTP) { - inv2R_proj = tp->qOverPt() * (0.5 * settings_->invPtToInvR()); - tanL_proj = tp->tanLambda(); - z0_proj = tp->z0(); - // Distance of stub from true trajectory in z, evalulated at nominal radius of stub. - //deltaZ_proj = s->z() - tp->trkZAtR(s->r()); - deltaZ_proj = s->z() - (tp->z0() + tp->tanLambda() * s->r()); - // Distance of stub from true trajectory in r*phi, evaluated at nominal radius of stub. - //deltaPhi_proj = reco::deltaPhi(s->phi(), tp->trkPhiAtR(s->r())); - deltaPhi_proj = reco::deltaPhi(s->phi(), tp->phi0() - (s->r() * inv2R_proj)); - } else { - inv2R_proj = fitTrk.qOverPt() * (0.5 * settings_->invPtToInvR()); - tanL_proj = fitTrk.tanLambda(); - z0_proj = fitTrk.z0(); - deltaZ_proj = s->z() - (fitTrk.z0() + fitTrk.tanLambda() * s->r()); - deltaPhi_proj = reco::deltaPhi(s->phi(), fitTrk.phi0() - (s->r() * inv2R_proj)); - } - - // Higher order correction correction to circle expansion for improved accuracy at low Pt. - float corr = s->r() * inv2R_proj; // = r/2R - deltaPhi_proj += (1. / 6.) * pow(corr, 3); - - if ((not s->barrel()) && not(s->psModule())) { - // These corrections rely on inside --> outside tracking, so r-z track params in 2S modules known. - float rShift = (s->z() - z0_proj) / tanL_proj - s->r(); - - if (settings_->kalmanHOprojZcorr() == 1) { - // Add correlation term related to conversion of stub residuals from (r,phi) to (z,phi). - deltaPhi_proj += inv2R_proj * rShift; - } - - if (settings_->kalmanHOalpha() == 1) { - // Add alpha correction for non-radial 2S endcap strips.. - deltaPhi_proj += s->alpha() * rShift; - } - } - - float sigmaZ2_proj = (s->barrel()) ? sigmaZ2 : sigmaZ2 * pow(tp->tanLambda(), 2); - float beta = 0.; - if (not s->barrel()) { - // Add correlation term related to conversion of stub residuals from (r,phi) to (z,phi). - if (settings_->kalmanHOprojZcorr() == 2) - beta += -inv2R_proj; - // Add alpha correction for non-radial 2S endcap strips.. - if (settings_->kalmanHOalpha() == 2) - beta += -s->alpha(); - } - float beta2 = beta * beta; - float sigmaPhi2_proj = sigmaPhi2_raw + sigmaZ2_raw * beta2; - // Add scatterign uncertainty - if (recalc_useTP) { - sigmaPhi2_proj += phiExtra2; - } else { - // Fit uses Pt of L1track3D to estimate scattering. - double phiExtra_fit = settings_->kalmanMultiScattTerm() / (fitTrk.getL1track3D().pt()); - double phiExtra2_fit = phiExtra_fit * phiExtra_fit; - sigmaPhi2_proj += phiExtra2_fit; - } - // Correlation of stub phi & stub z coordinates. - float sigmaCorr = (s->barrel()) ? 0.0 : sigmaZ2_raw * beta * tp->tanLambda(); - - // Invert covariance matrix in stub position uncertainty. - float det = sigmaPhi2_proj * sigmaZ2_proj - sigmaCorr * sigmaCorr; - float V00 = sigmaZ2_proj / det; - float V01 = -sigmaCorr / det; - float V11 = sigmaPhi2_proj / det; - if (trueStub) { - recalcChiSquared_2 += - V00 * pow(deltaPhi_proj, 2) + V11 * pow(deltaZ_proj, 2) + 2 * V01 * deltaPhi_proj * deltaZ_proj; - if (recalc_debug) { - cout << " RECALC BARREL=" << s->barrel() << " PS=" << s->psModule() << " ID=" << s->index() << endl; - cout << " RECALC RESID: 1000*rphi=" << 1000 * deltaPhi_proj << " rz=" << deltaZ_proj << endl; - cout << " RECALC SIGMA: 1000*rphi=" << 1000 * sqrt(sigmaPhi2_proj) << " rz=" << sqrt(sigmaZ2_proj) - << endl; - cout << " RECALC CHI2=" << recalcChiSquared_2 << " & DELTA CHI2: rphi=" << V00 * pow(deltaPhi_proj, 2) - << " rz=" << V11 * pow(deltaZ_proj, 2) << endl - << endl; - } - } - - float sigmaPhi = sqrt(sigmaPhi2); - float sigmaZ = sqrt(sigmaZ2); - - if (recalc_method2) { - // Plot residuals from method 2. - // (Neglects effect of correlation term sigmaCorr). - deltaPhi = deltaPhi_proj; - deltaRorZ = deltaZ_proj; - sigmaPhi = sqrt(sigmaPhi2_proj); - sigmaZ = sqrt(sigmaZ2_proj); - } - - if (trueStub) { - if (s->psModule()) { - if (s->barrel()) { - hisDeltaPhitruePSbarrel_[fitName]->Fill(deltaPhi / sigmaPhi); - hisDeltaRorZtruePSbarrel_[fitName]->Fill(deltaRorZ / sigmaZ); - } else { - hisDeltaPhitruePSendcap_[fitName]->Fill(deltaPhi / sigmaPhi); - hisDeltaRorZtruePSendcap_[fitName]->Fill(deltaRorZ / sigmaZ); - } - } else { - if (s->barrel()) { - hisDeltaPhitrue2Sbarrel_[fitName]->Fill(deltaPhi / sigmaPhi); - hisDeltaRorZtrue2Sbarrel_[fitName]->Fill(deltaRorZ / sigmaZ); - } else { - hisDeltaPhitrue2Sendcap_[fitName]->Fill(deltaPhi / sigmaPhi); - hisDeltaRorZtrue2Sendcap_[fitName]->Fill(deltaRorZ / sigmaZ); - } - } - // More detailed plots for true stubs to study effect of multiple scattering. - profNsigmaPhivsInvPt_[fitName]->Fill(1. / tp->pt(), fabs(deltaPhi / sigmaPhi)); - profNsigmaPhivsR_[fitName]->Fill(s->r(), fabs(deltaPhi / sigmaPhi)); - profNsigmaPhivsTanl_[fitName]->Fill(fabs(tp->tanLambda()), fabs(deltaPhi / sigmaPhi)); - } else { - if (s->psModule()) { - if (s->barrel()) { - hisDeltaPhifakePSbarrel_[fitName]->Fill(deltaPhi / sigmaPhi); - hisDeltaRorZfakePSbarrel_[fitName]->Fill(deltaRorZ / sigmaZ); - } else { - hisDeltaPhifakePSendcap_[fitName]->Fill(deltaPhi / sigmaPhi); - hisDeltaRorZfakePSendcap_[fitName]->Fill(deltaRorZ / sigmaZ); - } - } else { - if (s->barrel()) { - hisDeltaPhifake2Sbarrel_[fitName]->Fill(deltaPhi / sigmaPhi); - hisDeltaRorZfake2Sbarrel_[fitName]->Fill(deltaRorZ / sigmaZ); - } else { - hisDeltaPhifake2Sendcap_[fitName]->Fill(deltaPhi / sigmaPhi); - hisDeltaRorZfake2Sendcap_[fitName]->Fill(deltaRorZ / sigmaZ); - } - } - } - } - // Plot recalculated chi2 for correct stubs on matched tracks. - profRecalcRphiChi2VsEtaTrue1_[fitName]->Fill(fabs(fitTrk.eta()), recalcChiSquared_1_rphi); - profRecalcRzChi2VsEtaTrue1_[fitName]->Fill(fabs(fitTrk.eta()), recalcChiSquared_1_rz); - float recalcChiSquared_1 = recalcChiSquared_1_rphi + recalcChiSquared_1_rz; - profRecalcChi2VsEtaTrue1_[fitName]->Fill(fabs(fitTrk.eta()), recalcChiSquared_1); - profRecalcChi2VsEtaTrue2_[fitName]->Fill(fabs(fitTrk.eta()), recalcChiSquared_2); } } // Study helix param resolution. - for (const L1fittedTrack& fitTrk : fittedTracks) { - const TP* tp = fitTrk.getMatchedTP(); + for (const L1fittedTrack* fitTrk : fittedTracks) { + const TP* tp = fitTrk->matchedTP(); if (tp != nullptr) { // IRT if ((resPlotOpt_ && tp->useForAlgEff()) || (not resPlotOpt_)) { // Check TP is good for efficiency measurement (& also comes from signal event if requested) - //if (not (abs(tp->pdgId()) == 11)) continue; - //if (not (abs(tp->pdgId()) == 13) || (abs(tp->pdgId()) == 211) || (abs(tp->pdgId()) == 321) || (abs(tp->pdgId()) == 2212)) continue; - // Fitted vs True parameter distribution 2D plots - hisFitVsTrueQinvPt_[fitName]->Fill(tp->qOverPt(), fitTrk.qOverPt()); - hisFitVsTruePhi0_[fitName]->Fill(tp->phi0(), fitTrk.phi0()); - hisFitVsTrueD0_[fitName]->Fill(tp->d0(), fitTrk.d0()); - hisFitVsTrueZ0_[fitName]->Fill(tp->z0(), fitTrk.z0()); - hisFitVsTrueEta_[fitName]->Fill(tp->eta(), fitTrk.eta()); - - // Residuals between fitted and true helix params as 1D plot. - hisFitQinvPtRes_[fitName]->Fill(fitTrk.qOverPt() - tp->qOverPt()); - hisFitPhi0Res_[fitName]->Fill(reco::deltaPhi(fitTrk.phi0(), tp->phi0())); - hisFitD0Res_[fitName]->Fill(fitTrk.d0() - tp->d0()); - hisFitZ0Res_[fitName]->Fill(fitTrk.z0() - tp->z0()); - hisFitEtaRes_[fitName]->Fill(fitTrk.eta() - tp->eta()); // Plot helix parameter resolution against eta or Pt. - hisQoverPtResVsTrueEta_[fitName]->Fill(std::abs(tp->eta()), std::abs(fitTrk.qOverPt() - tp->qOverPt())); + hisQoverPtResVsTrueEta_[fitName]->Fill(std::abs(tp->eta()), std::abs(fitTrk->qOverPt() - tp->qOverPt())); hisPhi0ResVsTrueEta_[fitName]->Fill(std::abs(tp->eta()), - std::abs(reco::deltaPhi(fitTrk.phi0(), tp->phi0()))); - hisEtaResVsTrueEta_[fitName]->Fill(std::abs(tp->eta()), std::abs(fitTrk.eta() - tp->eta())); - hisZ0ResVsTrueEta_[fitName]->Fill(std::abs(tp->eta()), std::abs(fitTrk.z0() - tp->z0())); - hisD0ResVsTrueEta_[fitName]->Fill(std::abs(tp->eta()), std::abs(fitTrk.d0() - tp->d0())); + std::abs(reco::deltaPhi(fitTrk->phi0(), tp->phi0()))); + hisEtaResVsTrueEta_[fitName]->Fill(std::abs(tp->eta()), std::abs(fitTrk->eta() - tp->eta())); + hisZ0ResVsTrueEta_[fitName]->Fill(std::abs(tp->eta()), std::abs(fitTrk->z0() - tp->z0())); + hisD0ResVsTrueEta_[fitName]->Fill(std::abs(tp->eta()), std::abs(fitTrk->d0() - tp->d0())); hisQoverPtResVsTrueInvPt_[fitName]->Fill(std::abs(tp->qOverPt()), - std::abs(fitTrk.qOverPt() - tp->qOverPt())); + std::abs(fitTrk->qOverPt() - tp->qOverPt())); hisPhi0ResVsTrueInvPt_[fitName]->Fill(std::abs(tp->qOverPt()), - std::abs(reco::deltaPhi(fitTrk.phi0(), tp->phi0()))); - hisEtaResVsTrueInvPt_[fitName]->Fill(std::abs(tp->qOverPt()), std::abs(fitTrk.eta() - tp->eta())); - hisZ0ResVsTrueInvPt_[fitName]->Fill(std::abs(tp->qOverPt()), std::abs(fitTrk.z0() - tp->z0())); - hisD0ResVsTrueInvPt_[fitName]->Fill(std::abs(tp->qOverPt()), std::abs(fitTrk.d0() - tp->d0())); - - // Also plot resolution for 5 parameter fits after beam-spot constraint it applied post-fit. - if (settings_->kalmanAddBeamConstr() && fitName.find("KF5") != string::npos) { - hisQoverPtResBeamVsTrueEta_[fitName]->Fill(std::abs(tp->eta()), - std::abs(fitTrk.qOverPt_bcon() - tp->qOverPt())); - hisPhi0ResBeamVsTrueEta_[fitName]->Fill(std::abs(tp->eta()), - std::abs(reco::deltaPhi(fitTrk.phi0_bcon(), tp->phi0()))); - - hisQoverPtResBeamVsTrueInvPt_[fitName]->Fill(std::abs(tp->qOverPt()), - std::abs(fitTrk.qOverPt_bcon() - tp->qOverPt())); - hisPhi0ResBeamVsTrueInvPt_[fitName]->Fill(std::abs(tp->qOverPt()), - std::abs(reco::deltaPhi(fitTrk.phi0_bcon(), tp->phi0()))); - } + std::abs(reco::deltaPhi(fitTrk->phi0(), tp->phi0()))); + hisEtaResVsTrueInvPt_[fitName]->Fill(std::abs(tp->qOverPt()), std::abs(fitTrk->eta() - tp->eta())); + hisZ0ResVsTrueInvPt_[fitName]->Fill(std::abs(tp->qOverPt()), std::abs(fitTrk->z0() - tp->z0())); + hisD0ResVsTrueInvPt_[fitName]->Fill(std::abs(tp->qOverPt()), std::abs(fitTrk->d0() - tp->d0())); } } } @@ -3243,8 +1226,8 @@ namespace tmtt { for (const TP& tp : vTPs) { if (tpRecoedMap[&tp]) { // Was this truth particle successfully fitted? - profDupFitTrksVsEta_[fitName]->Fill(fabs(tp.eta()), tpRecoedDup[&tp] - 1); - profDupFitTrksVsInvPt_[fitName]->Fill(fabs(tp.qOverPt()), tpRecoedDup[&tp] - 1); + profDupFitTrksVsEta_[fitName]->Fill(std::abs(tp.eta()), tpRecoedDup[&tp] - 1); + profDupFitTrksVsInvPt_[fitName]->Fill(std::abs(tp.qOverPt()), tpRecoedDup[&tp] - 1); } } @@ -3253,65 +1236,30 @@ namespace tmtt { for (const TP& tp : vTPs) { if (tp.useForEff()) { // Check TP is good for efficiency measurement. - // Check which phi & eta sectors this TP is in. - int iEtaReg_TP = -1; - int iPhiSec_TP = -1; - for (unsigned int iPhiSec = 0; iPhiSec < numPhiSectors_; iPhiSec++) { - Sector secTmp; - secTmp.init(settings_, iPhiSec, 0); - if (secTmp.insidePhiSec(tp)) - iPhiSec_TP = iPhiSec; - } - for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - Sector secTmp; - secTmp.init(settings_, 0, iEtaReg); - if (secTmp.insideEtaReg(tp)) - iEtaReg_TP = iEtaReg; - } - // If TP was reconstucted by HT, then plot its kinematics. if (tpRecoedMap[&tp]) { // This truth particle was successfully fitted. hisFitTPinvptForEff_[fitName]->Fill(1. / tp.pt()); - hisFitTPptForEff_[fitName]->Fill(tp.pt()); hisFitTPetaForEff_[fitName]->Fill(tp.eta()); hisFitTPphiForEff_[fitName]->Fill(tp.phi0()); // Plot also production point of all good reconstructed TP. - hisFitTPd0ForEff_[fitName]->Fill(fabs(tp.d0())); - hisFitTPz0ForEff_[fitName]->Fill(fabs(tp.z0())); + hisFitTPd0ForEff_[fitName]->Fill(std::abs(tp.d0())); + hisFitTPz0ForEff_[fitName]->Fill(std::abs(tp.z0())); // Also plot efficiency to perfectly reconstruct the track (no fake hits) if (tpPerfRecoedMap[&tp]) { // This truth particle was successfully fitted with no incorrect hits. hisPerfFitTPinvptForEff_[fitName]->Fill(1. / tp.pt()); - hisPerfFitTPptForEff_[fitName]->Fill(tp.pt()); hisPerfFitTPetaForEff_[fitName]->Fill(tp.eta()); } if (tp.useForAlgEff()) { // Check TP is good for algorithmic efficiency measurement. hisFitTPinvptForAlgEff_[fitName]->Fill(1. / tp.pt()); - hisFitTPptForAlgEff_[fitName]->Fill(tp.pt()); hisFitTPetaForAlgEff_[fitName]->Fill(tp.eta()); hisFitTPphiForAlgEff_[fitName]->Fill(tp.phi0()); // Plot also production point of all good reconstructed TP. - hisFitTPd0ForAlgEff_[fitName]->Fill(fabs(tp.d0())); - hisFitTPz0ForAlgEff_[fitName]->Fill(fabs(tp.z0())); - // Plot sector number to understand if looser cuts are needed in certain regions. - hisFitTPphisecForAlgEff_[fitName]->Fill(iPhiSec_TP); - hisFitTPetasecForAlgEff_[fitName]->Fill(iEtaReg_TP); + hisFitTPd0ForAlgEff_[fitName]->Fill(std::abs(tp.d0())); + hisFitTPz0ForAlgEff_[fitName]->Fill(std::abs(tp.z0())); // Also plot efficiency to perfectly reconstruct the track (no fake hits) if (tpPerfRecoedMap[&tp]) { hisPerfFitTPinvptForAlgEff_[fitName]->Fill(1. / tp.pt()); - hisPerfFitTPptForAlgEff_[fitName]->Fill(tp.pt()); hisPerfFitTPetaForAlgEff_[fitName]->Fill(tp.eta()); - hisPerfFitTPphisecForAlgEff_[fitName]->Fill(iPhiSec_TP); - hisPerfFitTPetasecForAlgEff_[fitName]->Fill(iEtaReg_TP); - // Efficiency inside jets. - if (tp.tpInJet()) { - hisPerfFitTPinvptForAlgEff_inJetPtG30_[fitName]->Fill(1. / tp.pt()); - } - if (tp.tpInHighPtJet()) { - hisPerfFitTPinvptForAlgEff_inJetPtG100_[fitName]->Fill(1. / tp.pt()); - } - if (tp.tpInVeryHighPtJet()) { - hisPerfFitTPinvptForAlgEff_inJetPtG200_[fitName]->Fill(1. / tp.pt()); - } } } } @@ -3322,9 +1270,9 @@ namespace tmtt { //=== Produce plots of tracking efficiency after HT or after r-z track filter (run at end of job). - TFileDirectory Histos::plotTrackEfficiency(string tName) { + TFileDirectory Histos::plotTrackEfficiency(const string& tName) { // Define lambda function to facilitate adding "tName" to directory & histogram names. - auto addn = [tName](string s) { return TString::Format("%s_%s", s.c_str(), tName.c_str()); }; + auto addn = [tName](const string& s) { return TString::Format("%s_%s", s.c_str(), tName.c_str()); }; TFileDirectory inputDir = fs_->mkdir(addn("Effi").Data()); // Plot tracking efficiency @@ -3334,12 +1282,6 @@ namespace tmtt { hisTPinvptForEff_, addn("EffVsInvPt"), "; 1/Pt; Tracking efficiency"); - makeEfficiencyPlot(inputDir, - teffEffVsPt_[tName], - hisRecoTPptForEff_[tName], - hisTPptForEff_, - addn("EffVsPt"), - "; Pt; Tracking efficiency"); makeEfficiencyPlot(inputDir, teffEffVsEta_[tName], hisRecoTPetaForEff_[tName], @@ -3347,9 +1289,6 @@ namespace tmtt { addn("EffVsEta"), "; #eta; Tracking efficiency"); - // std::cout << "Made first graph" << std::endl; - // graphEffVsEta_[tName] = inputDir.make(hisRecoTPetaForEff_[tName], hisTPetaForEff_); - // graphEffVsEta_[tName]->SetNameTitle("EffVsEta","; #eta; Tracking efficiency"); makeEfficiencyPlot(inputDir, teffEffVsPhi_[tName], hisRecoTPphiForEff_[tName], @@ -3377,12 +1316,6 @@ namespace tmtt { hisTPinvptForEff_, addn("PerfEffVsInvPt"), "; 1/Pt; Tracking perfect efficiency"); - makeEfficiencyPlot(inputDir, - teffPerfEffVsPt_[tName], - hisPerfRecoTPptForEff_[tName], - hisTPptForEff_, - addn("PerfEffVsPt"), - "; Pt; Tracking perfect efficiency"); makeEfficiencyPlot(inputDir, teffPerfEffVsEta_[tName], hisPerfRecoTPetaForEff_[tName], @@ -3397,12 +1330,6 @@ namespace tmtt { hisTPinvptForAlgEff_, addn("AlgEffVsInvPt"), "; 1/Pt; Tracking efficiency"); - makeEfficiencyPlot(inputDir, - teffAlgEffVsPt_[tName], - hisRecoTPptForAlgEff_[tName], - hisTPptForAlgEff_, - addn("AlgEffVsPt"), - "; Pt; Tracking efficiency"); makeEfficiencyPlot(inputDir, teffAlgEffVsEta_[tName], hisRecoTPetaForAlgEff_[tName], @@ -3429,40 +1356,6 @@ namespace tmtt { addn("AlgEffVsZ0"), "; z0 (cm); Tracking efficiency"); - makeEfficiencyPlot(inputDir, - teffAlgEffVsPhiSec_[tName], - hisRecoTPphisecForAlgEff_[tName], - hisTPphisecForAlgEff_, - addn("AlgEffVsPhiSec"), - "; #phi sector; Tracking efficiency"); - makeEfficiencyPlot(inputDir, - teffAlgEffVsEtaSec_[tName], - hisRecoTPetasecForAlgEff_[tName], - hisTPetasecForAlgEff_, - addn("AlgEffVsEtaSec"), - "; #eta sector; Tracking efficiency"); - - makeEfficiencyPlot(inputDir, - teffAlgEffVsInvPt_inJetPtG30_[tName], - hisRecoTPinvptForAlgEff_inJetPtG30_[tName], - hisTPinvptForAlgEff_inJetPtG30_, - addn("AlgEffVsInvPt_inJetPtG30"), - "; 1/Pt; Tracking efficiency"); - - makeEfficiencyPlot(inputDir, - teffAlgEffVsInvPt_inJetPtG100_[tName], - hisRecoTPinvptForAlgEff_inJetPtG100_[tName], - hisTPinvptForAlgEff_inJetPtG100_, - addn("AlgEffVsInvPt_inJetPtG100"), - "; 1/Pt; Tracking efficiency"); - - makeEfficiencyPlot(inputDir, - teffAlgEffVsInvPt_inJetPtG200_[tName], - hisRecoTPinvptForAlgEff_inJetPtG200_[tName], - hisTPinvptForAlgEff_inJetPtG200_, - addn("AlgEffVsInvPt_inJetPtG200"), - "; 1/Pt; Tracking efficiency"); - // Also plot algorithmic efficiency to reconstruct track perfectly. makeEfficiencyPlot(inputDir, teffPerfAlgEffVsInvPt_[tName], @@ -3470,12 +1363,6 @@ namespace tmtt { hisTPinvptForAlgEff_, addn("PerfAlgEffVsInvPt"), "; 1/Pt; Tracking perfect efficiency"); - makeEfficiencyPlot(inputDir, - teffPerfAlgEffVsPt_[tName], - hisPerfRecoTPptForAlgEff_[tName], - hisTPptForAlgEff_, - addn("PerfAlgEffVsPt"), - "; Pt; Tracking perfect efficiency"); makeEfficiencyPlot(inputDir, teffPerfAlgEffVsEta_[tName], hisPerfRecoTPetaForAlgEff_[tName], @@ -3483,27 +1370,14 @@ namespace tmtt { addn("PerfAlgEffVsEta"), "; #eta; Tracking perfect efficiency"); - makeEfficiencyPlot(inputDir, - teffPerfAlgEffVsPhiSec_[tName], - hisPerfRecoTPphisecForAlgEff_[tName], - hisTPphisecForAlgEff_, - addn("PerfAlgEffVsPhiSec"), - "; #phi sector; Tracking perfect efficiency"); - makeEfficiencyPlot(inputDir, - teffPerfAlgEffVsEtaSec_[tName], - hisPerfRecoTPetasecForAlgEff_[tName], - hisTPetasecForAlgEff_, - addn("PerfAlgEffVsEtaSec"), - "; #eta sector; Tracking perfect efficiency"); - return inputDir; } //=== Produce plots of tracking efficiency after track fit (run at end of job). - TFileDirectory Histos::plotTrackEffAfterFit(string fitName) { + TFileDirectory Histos::plotTrackEffAfterFit(const string& fitName) { // Define lambda function to facilitate adding "fitName" to directory & histogram names. - auto addn = [fitName](string s) { return TString::Format("%s_%s", s.c_str(), fitName.c_str()); }; + auto addn = [fitName](const string& s) { return TString::Format("%s_%s", s.c_str(), fitName.c_str()); }; TFileDirectory inputDir = fs_->mkdir(addn("Effi").Data()); // Plot tracking efficiency @@ -3513,12 +1387,6 @@ namespace tmtt { hisTPinvptForEff_, addn("EffFitVsInvPt"), "; 1/Pt; Tracking efficiency"); - makeEfficiencyPlot(inputDir, - teffEffFitVsPt_[fitName], - hisFitTPptForEff_[fitName], - hisTPptForEff_, - addn("EffFitVsPt"), - "; Pt; Tracking efficiency"); makeEfficiencyPlot(inputDir, teffEffFitVsEta_[fitName], hisFitTPetaForEff_[fitName], @@ -3552,12 +1420,6 @@ namespace tmtt { hisTPinvptForEff_, addn("PerfEffFitVsInvPt"), "; 1/Pt; Tracking perfect efficiency"); - makeEfficiencyPlot(inputDir, - teffPerfEffFitVsPt_[fitName], - hisPerfFitTPptForEff_[fitName], - hisTPptForEff_, - addn("PerfEffFitVsPt"), - "; Pt; Tracking perfect efficiency"); makeEfficiencyPlot(inputDir, teffPerfEffFitVsEta_[fitName], hisPerfFitTPetaForEff_[fitName], @@ -3572,12 +1434,6 @@ namespace tmtt { hisTPinvptForAlgEff_, addn("AlgEffFitVsInvPt"), "; 1/Pt; Tracking efficiency"); - makeEfficiencyPlot(inputDir, - teffAlgEffFitVsPt_[fitName], - hisFitTPptForAlgEff_[fitName], - hisTPptForAlgEff_, - addn("AlgEffFitVsPt"), - "; Pt; Tracking efficiency"); makeEfficiencyPlot(inputDir, teffAlgEffFitVsEta_[fitName], hisFitTPetaForAlgEff_[fitName], @@ -3604,19 +1460,6 @@ namespace tmtt { addn("AlgEffFitVsZ0"), "; z0 (cm); Tracking efficiency"); - makeEfficiencyPlot(inputDir, - teffAlgEffFitVsPhiSec_[fitName], - hisFitTPphisecForAlgEff_[fitName], - hisTPphisecForAlgEff_, - addn("AlgEffFitVsPhiSec"), - "; #phi sector; Tracking efficiency"); - makeEfficiencyPlot(inputDir, - teffAlgEffFitVsEtaSec_[fitName], - hisFitTPetasecForAlgEff_[fitName], - hisTPetasecForAlgEff_, - addn("AlgEffFitVsEtaSec"), - "; #eta sector; Tracking efficiency"); - // Also plot algorithmic efficiency to reconstruct track perfectly. makeEfficiencyPlot(inputDir, teffPerfAlgEffFitVsInvPt_[fitName], @@ -3624,50 +1467,12 @@ namespace tmtt { hisTPinvptForAlgEff_, addn("PerfAlgEffFitVsInvPt"), "; 1/Pt; Tracking perfect efficiency"); - makeEfficiencyPlot(inputDir, - teffPerfAlgEffFitVsPt_[fitName], - hisPerfFitTPptForAlgEff_[fitName], - hisTPptForAlgEff_, - addn("PerfAlgEffFitVsPt"), - "; Pt; Tracking perfect efficiency"); makeEfficiencyPlot(inputDir, teffPerfAlgEffFitVsEta_[fitName], hisPerfFitTPetaForAlgEff_[fitName], hisTPetaForAlgEff_, addn("Perf AlgEffFitVsEta"), "; #eta; Tracking perfect efficiency"); - makeEfficiencyPlot(inputDir, - teffPerfAlgEffFitVsInvPt_inJetPtG30_[fitName], - hisPerfFitTPinvptForAlgEff_inJetPtG30_[fitName], - hisTPinvptForAlgEff_inJetPtG30_, - addn("PerfAlgEffFitVsInvPt_inJetPtG30"), - "; 1/Pt; Tracking perfect efficiency"); - makeEfficiencyPlot(inputDir, - teffPerfAlgEffFitVsInvPt_inJetPtG100_[fitName], - hisPerfFitTPinvptForAlgEff_inJetPtG100_[fitName], - hisTPinvptForAlgEff_inJetPtG100_, - addn("PerfAlgEffFitVsInvPt_inJetPtG100"), - "; 1/Pt; Tracking perfect efficiency"); - makeEfficiencyPlot(inputDir, - teffPerfAlgEffFitVsInvPt_inJetPtG200_[fitName], - hisPerfFitTPinvptForAlgEff_inJetPtG200_[fitName], - hisTPinvptForAlgEff_inJetPtG200_, - addn("PerfAlgEffFitVsInvPt_inJetPtG200"), - "; 1/Pt; Tracking perfect efficiency"); - - makeEfficiencyPlot(inputDir, - teffPerfAlgEffFitVsPhiSec_[fitName], - hisPerfFitTPphisecForAlgEff_[fitName], - hisTPphisecForAlgEff_, - addn("PerfAlgEffFitVsPhiSec"), - "; #phi sector; Tracking perfect efficiency"); - makeEfficiencyPlot(inputDir, - teffPerfAlgEffFitVsEtaSec_[fitName], - hisPerfFitTPetasecForAlgEff_[fitName], - hisTPetasecForAlgEff_, - addn("PerfAlgEffFitVsEtaSec"), - "; #eta sector; Tracking perfect efficiency"); - return inputDir; } @@ -3680,7 +1485,7 @@ namespace tmtt { //=== Print summary of track-finding performance after track pattern reco. - void Histos::printTrackPerformance(string tName) { + void Histos::printTrackPerformance(const string& tName) { float numTrackCands = profNumTrackCands_[tName]->GetBinContent(1); // No. of track cands float numTrackCandsErr = profNumTrackCands_[tName]->GetBinError(1); // No. of track cands uncertainty float numMatchedTrackCandsIncDups = @@ -3705,30 +1510,28 @@ namespace tmtt { float(numPerfRecoTPforAlg) / (numTPforAlg + 1.0e-6); //protection against demoninator equals zero. float algPerfEffErr = sqrt(algPerfEff * (1 - algPerfEff) / (numTPforAlg + 1.0e-6)); // uncertainty - cout.setf(ios::fixed, ios::floatfield); - cout.precision(4); - - cout << "=========================================================================" << endl; + PrintL1trk() << "========================================================================="; if (tName == "HT") { - cout << " TRACK-FINDING SUMMARY AFTER HOUGH TRANSFORM " << endl; + PrintL1trk() << " TRACK-FINDING SUMMARY AFTER HOUGH TRANSFORM "; } else if (tName == "RZ") { - cout << " TRACK-FINDING SUMMARY AFTER R-Z TRACK FILTER " << endl; + PrintL1trk() << " TRACK-FINDING SUMMARY AFTER R-Z TRACK FILTER "; } else if (tName == "TRACKLET") { - cout << " TRACK-FINDING SUMMARY AFTER TRACKLET PATTERN RECO " << endl; + PrintL1trk() << " TRACK-FINDING SUMMARY AFTER TRACKLET PATTERN RECO "; } - cout << "Number of track candidates found per event = " << numTrackCands << " +- " << numTrackCandsErr << endl; - cout << " with mean stubs/track = " << meanStubsPerTrack << endl; - cout << "Fraction of track cands that are fake = " << fracFake << endl; - cout << "Fraction of track cands that are genuine, but extra duplicates = " << fracDup << endl; - cout << "Algorithmic tracking efficiency = " << numRecoTPforAlg << "/" << numTPforAlg << " = " << algEff << " +- " - << algEffErr << endl; - cout << "Perfect algorithmic tracking efficiency = " << numPerfRecoTPforAlg << "/" << numTPforAlg << " = " - << algPerfEff << " +- " << algPerfEffErr << " (no incorrect hits)" << endl; + PrintL1trk() << "Number of track candidates found per event = " << numTrackCands << " +- " << numTrackCandsErr; + PrintL1trk() << " with mean stubs/track = " << meanStubsPerTrack; + PrintL1trk() << "Fraction of track cands that are fake = " << fracFake; + PrintL1trk() << "Fraction of track cands that are genuine, but extra duplicates = " << fracDup; + + PrintL1trk() << std::fixed << std::setprecision(4) << "Algorithmic tracking efficiency = " << numRecoTPforAlg << "/" + << numTPforAlg << " = " << algEff << " +- " << algEffErr; + PrintL1trk() << "Perfect algorithmic tracking efficiency = " << numPerfRecoTPforAlg << "/" << numTPforAlg << " = " + << algPerfEff << " +- " << algPerfEffErr << " (no incorrect hits)"; } //=== Print summary of track-finding performance after helix fit for given track fitter. - void Histos::printFitTrackPerformance(string fitName) { + void Histos::printFitTrackPerformance(const string& fitName) { float numFitTracks = profNumFitTracks_[fitName]->GetBinContent(1); // No. of track cands float numFitTracksErr = profNumFitTracks_[fitName]->GetBinError(1); // No. of track cands uncertainty float numMatchedFitTracksIncDups = @@ -3756,31 +1559,25 @@ namespace tmtt { // Does this fitter require r-z track filter to be run before it? bool useRZfilt = (std::count(useRZfilter_.begin(), useRZfilter_.end(), fitName) > 0); - cout << "=========================================================================" << endl; - cout << " TRACK FIT SUMMARY FOR: " << fitName << endl; - cout << "Number of fitted track candidates found per event = " << numFitTracks << " +- " << numFitTracksErr << endl; - cout << " with mean stubs/track = " << meanStubsPerFitTrack << endl; - cout << "Fraction of fitted tracks that are fake = " << fracFakeFit << endl; - cout << "Fraction of fitted tracks that are genuine, but extra duplicates = " << fracDupFit << endl; - cout << "Algorithmic fitting efficiency = " << numFitTPforAlg << "/" << numTPforAlg << " = " << fitEff << " +- " - << fitEffErr << endl; - cout << "Perfect algorithmic fitting efficiency = " << numPerfFitTPforAlg << "/" << numTPforAlg << " = " - << fitPerfEff << " +- " << fitPerfEffErr << " (no incorrect hits)" << endl; + PrintL1trk() << "========================================================================="; + PrintL1trk() << " TRACK FIT SUMMARY FOR: " << fitName; + PrintL1trk() << "Number of fitted track candidates found per event = " << numFitTracks << " +- " << numFitTracksErr; + PrintL1trk() << " with mean stubs/track = " << meanStubsPerFitTrack; + PrintL1trk() << "Fraction of fitted tracks that are fake = " << fracFakeFit; + PrintL1trk() << "Fraction of fitted tracks that are genuine, but extra duplicates = " << fracDupFit; + PrintL1trk() << "Algorithmic fitting efficiency = " << numFitTPforAlg << "/" << numTPforAlg << " = " << fitEff + << " +- " << fitEffErr; + PrintL1trk() << "Perfect algorithmic fitting efficiency = " << numPerfFitTPforAlg << "/" << numTPforAlg << " = " + << fitPerfEff << " +- " << fitPerfEffErr << " (no incorrect hits)"; if (useRZfilt) - cout << "(The above fitter used the '" << settings_->rzFilterName() << "' r-z track filter.)" << endl; - - /* - if ( settings_->detailedFitOutput() ){ - cout << endl<< "More detailed information about helix fit:"<rzFilterName() << "' r-z track filter.)"; } //=== Print tracking performance summary & make tracking efficiency histograms. - void Histos::endJobAnalysis() { + void Histos::endJobAnalysis(const HTrphi::ErrorMonitor* htRphiErrMon) { // Don't bother producing summary if user didn't request histograms via TFileService in their cfg. - if (!this->enabled()) + if (not this->enabled()) return; // Protection when running in wierd mixed hybrid-TMTT modes. @@ -3806,64 +1603,64 @@ namespace tmtt { this->plotTrackEffAfterFit(fitName); } - cout << "=========================================================================" << endl; + PrintL1trk() << "========================================================================="; // Print r (z) range in which each barrel layer (endcap wheel) appears. // (Needed by firmware). - cout << endl; - cout << "--- r range in which stubs in each barrel layer appear ---" << endl; + PrintL1trk(); + PrintL1trk() << "--- r range in which stubs in each barrel layer appear ---"; for (const auto& p : mapBarrelLayerMinR_) { unsigned int layer = p.first; - cout << " layer = " << layer << " : " << mapBarrelLayerMinR_[layer] << " < r < " << mapBarrelLayerMaxR_[layer] - << endl; + PrintL1trk() << " layer = " << layer << " : " << mapBarrelLayerMinR_[layer] << " < r < " + << mapBarrelLayerMaxR_[layer]; } - cout << "--- |z| range in which stubs in each endcap wheel appear ---" << endl; + PrintL1trk() << "--- |z| range in which stubs in each endcap wheel appear ---"; for (const auto& p : mapEndcapWheelMinZ_) { unsigned int layer = p.first; - cout << " wheel = " << layer << " : " << mapEndcapWheelMinZ_[layer] << " < |z| < " << mapEndcapWheelMaxZ_[layer] - << endl; + PrintL1trk() << " wheel = " << layer << " : " << mapEndcapWheelMinZ_[layer] << " < |z| < " + << mapEndcapWheelMaxZ_[layer]; } // Print (r,|z|) range in which each module type (defined in DigitalStub) appears. // (Needed by firmware). - cout << endl; - cout << "--- (r,|z|) range in which each module type (defined in DigitalStub) appears ---" << endl; + PrintL1trk(); + PrintL1trk() << "--- (r,|z|) range in which each module type (defined in DigitalStub) appears ---"; for (const auto& p : mapModuleTypeMinR_) { unsigned int modType = p.first; - cout << " Module type = " << modType << setprecision(1) << " : r range = (" << mapModuleTypeMinR_[modType] - << "," << mapModuleTypeMaxR_[modType] << "); z range = (" << mapModuleTypeMinZ_[modType] << "," - << mapModuleTypeMaxZ_[modType] << ")" << endl; + PrintL1trk() << " Module type = " << modType << setprecision(1) << " : r range = (" + << mapModuleTypeMinR_[modType] << "," << mapModuleTypeMaxR_[modType] << "); z range = (" + << mapModuleTypeMinZ_[modType] << "," << mapModuleTypeMaxZ_[modType] << ")"; } // Ugly bodge to allow for modules in barrel layers 1-2 & endcap wheels 3-5 being different. - cout << "and in addition" << endl; + PrintL1trk() << "and in addition"; for (const auto& p : mapExtraAModuleTypeMinR_) { unsigned int modType = p.first; - cout << " Module type = " << modType << setprecision(1) << " : r range = (" << mapExtraAModuleTypeMinR_[modType] - << "," << mapExtraAModuleTypeMaxR_[modType] << "); z range = (" << mapExtraAModuleTypeMinZ_[modType] << "," - << mapExtraAModuleTypeMaxZ_[modType] << ")" << endl; + PrintL1trk() << " Module type = " << modType << setprecision(1) << " : r range = (" + << mapExtraAModuleTypeMinR_[modType] << "," << mapExtraAModuleTypeMaxR_[modType] << "); z range = (" + << mapExtraAModuleTypeMinZ_[modType] << "," << mapExtraAModuleTypeMaxZ_[modType] << ")"; } - cout << "and in addition" << endl; + PrintL1trk() << "and in addition"; for (const auto& p : mapExtraBModuleTypeMinR_) { unsigned int modType = p.first; - cout << " Module type = " << modType << setprecision(1) << " : r range = (" << mapExtraBModuleTypeMinR_[modType] - << "," << mapExtraBModuleTypeMaxR_[modType] << "); z range = (" << mapExtraBModuleTypeMinZ_[modType] << "," - << mapExtraBModuleTypeMaxZ_[modType] << ")" << endl; + PrintL1trk() << " Module type = " << modType << setprecision(1) << " : r range = (" + << mapExtraBModuleTypeMinR_[modType] << "," << mapExtraBModuleTypeMaxR_[modType] << "); z range = (" + << mapExtraBModuleTypeMinZ_[modType] << "," << mapExtraBModuleTypeMaxZ_[modType] << ")"; } - cout << "and in addition" << endl; + PrintL1trk() << "and in addition"; for (const auto& p : mapExtraCModuleTypeMinR_) { unsigned int modType = p.first; - cout << " Module type = " << modType << setprecision(1) << " : r range = (" << mapExtraCModuleTypeMinR_[modType] - << "," << mapExtraCModuleTypeMaxR_[modType] << "); z range = (" << mapExtraCModuleTypeMinZ_[modType] << "," - << mapExtraCModuleTypeMaxZ_[modType] << ")" << endl; + PrintL1trk() << " Module type = " << modType << setprecision(1) << " : r range = (" + << mapExtraCModuleTypeMinR_[modType] << "," << mapExtraCModuleTypeMaxR_[modType] << "); z range = (" + << mapExtraCModuleTypeMinZ_[modType] << "," << mapExtraCModuleTypeMaxZ_[modType] << ")"; } - cout << "and in addition" << endl; + PrintL1trk() << "and in addition"; for (const auto& p : mapExtraDModuleTypeMinR_) { unsigned int modType = p.first; - cout << " Module type = " << modType << setprecision(1) << " : r range = (" << mapExtraDModuleTypeMinR_[modType] - << "," << mapExtraDModuleTypeMaxR_[modType] << "); z range = (" << mapExtraDModuleTypeMinZ_[modType] << "," - << mapExtraDModuleTypeMaxZ_[modType] << ")" << endl; + PrintL1trk() << " Module type = " << modType << setprecision(1) << " : r range = (" + << mapExtraDModuleTypeMinR_[modType] << "," << mapExtraDModuleTypeMaxR_[modType] << "); z range = (" + << mapExtraDModuleTypeMinZ_[modType] << "," << mapExtraDModuleTypeMaxZ_[modType] << ")"; } - cout << endl; + PrintL1trk(); if (settings_->hybrid() && not wierdMixedMode) { //--- Print summary of tracklet pattern reco @@ -3882,87 +1679,95 @@ namespace tmtt { for (const string& fitName : trackFitters_) { this->printFitTrackPerformance(fitName); } - cout << "=========================================================================" << endl; + PrintL1trk() << "========================================================================="; - if (not settings_->hybrid()) { + if (htRphiErrMon != nullptr && not settings_->hybrid()) { // Check that stub filling was consistent with known limitations of HT firmware design. - cout << endl << "Max. |gradients| of stub lines in HT array is: r-phi = " << HTrphi::maxLineGrad() << endl; - - if (HTrphi::maxLineGrad() > 1.) { - cout << "WARNING: Line |gradient| exceeds 1, which firmware will not be able to cope with! Please adjust HT " - "array size to avoid this." - << endl; - - } else if (HTrphi::fracErrorsTypeA() > 0.) { - cout << "WARNING: Despite line gradients being less than one, some fraction of HT columns have filled cells " - "with no filled neighbours in W, SW or NW direction. Firmware will object to this! "; - cout << "This fraction = " << HTrphi::fracErrorsTypeA() << " for r-phi HT" << endl; - - } else if (HTrphi::fracErrorsTypeB() > 0.) { - cout << "WARNING: Despite line gradients being less than one, some fraction of HT columns recorded individual " - "stubs being added to more than two cells! Thomas firmware will object to this! "; - cout << "This fraction = " << HTrphi::fracErrorsTypeB() << " for r-phi HT" << endl; + PrintL1trk() << "Max. |gradients| of stub lines in HT array is: r-phi = " << htRphiErrMon->maxLineGradient; + + if (htRphiErrMon->maxLineGradient > 1.) { + PrintL1trk() + << "WARNING: Line |gradient| exceeds 1, which firmware will not be able to cope with! Please adjust HT " + "array size to avoid this."; + + } else if (htRphiErrMon->numErrorsTypeA > 0.) { + float frac = float(htRphiErrMon->numErrorsTypeA) / float(htRphiErrMon->numErrorsNorm); + PrintL1trk() + << "WARNING: Despite line gradients being less than one, some fraction of HT columns have filled cells " + "with no filled neighbours in W, SW or NW direction. Firmware will object to this! "; + PrintL1trk() << "This fraction = " << frac << " for r-phi HT"; + + } else if (htRphiErrMon->numErrorsTypeB > 0.) { + float frac = float(htRphiErrMon->numErrorsTypeB) / float(htRphiErrMon->numErrorsNorm); + PrintL1trk() + << "WARNING: Despite line gradients being less than one, some fraction of HT columns recorded individual " + "stubs being added to more than two cells! Thomas firmware will object to this! "; + PrintL1trk() << "This fraction = " << frac << " for r-phi HT"; } } - // Check for presence of common MC bug. - - float meanShared = hisFracStubsSharingClus0_->GetMean(); - if (meanShared > 0.01) - cout << endl - << "WARNING: You are using buggy MC. A fraction " << meanShared - << " of stubs share clusters in the module seed sensor, which front-end electronics forbids." << endl; - - // Check that the constants in class DegradeBend are up to date. - float meanFracStubsLost = hisStubKillDegradeBend_->GetMean(2); - if (meanFracStubsLost > 0.001) - cout << endl - << "WARNING: You should update the constants in class DegradeBend, since some stubs had bend outside the " - "expected window range." - << endl; - // Check if GP B approximation cfg params are inconsistent. if (bApproxMistake_) - cout << endl << "WARNING: BApprox cfg params are inconsistent - see printout above." << endl; + PrintL1trk() << "\n WARNING: BApprox cfg params are inconsistent - see printout above."; + + // Restore original ROOT default cfg. + TH1::SetDefaultSumw2(oldSumW2opt_); } //=== Determine "B" parameter, used in GP firmware to allow for tilted modules. - void Histos::trackerGeometryAnalysis(const TrackerGeometryInfo trackerGeometryInfo) { + void Histos::trackerGeometryAnalysis(const list& listTrackerModule) { // Don't bother producing summary if user didn't request histograms via TFileService in their cfg. - if (!this->enabled()) + if (not this->enabled()) return; - cout << endl << "=========================================================================" << endl; - cout << "--- Fit to cfg params for FPGA-friendly approximation to B parameter in GP & KF ---" << endl; - cout << "--- (used to allowed for tilted barrel modules) ---" << endl; - // Check that info on the correct number of modules has been stored - if (trackerGeometryInfo.moduleZoR().size() != - trackerGeometryInfo.barrelNTiltedModules() * trackerGeometryInfo.barrelNLayersWithTiltedModules() * 2) { - cout << "WARNING : Expected " - << trackerGeometryInfo.barrelNTiltedModules() * trackerGeometryInfo.barrelNLayersWithTiltedModules() * 2 - << " modules, but only recorded info on " << trackerGeometryInfo.moduleZoR().size() << endl; + map dataForGraph; + for (const TrackerModule& trackerModule : listTrackerModule) { + if (trackerModule.tiltedBarrel()) { + float paramB = trackerModule.paramB(); + float zOverR = std::abs(trackerModule.minZ()) / trackerModule.minR(); + dataForGraph[paramB] = zOverR; // Only store each unique paramB once, to get better histo weights. + } } - TFileDirectory inputDir = fs_->mkdir("InputData"); - graphBVsZoverR_ = inputDir.make( - trackerGeometryInfo.moduleZoR().size(), &trackerGeometryInfo.moduleZoR()[0], &trackerGeometryInfo.moduleB()[0]); + const int nEntries = dataForGraph.size(); + vector vecParamB(nEntries); + vector vecZoverR(nEntries); + unsigned int i = 0; + for (const auto& p : dataForGraph) { + vecParamB[i] = p.first; + vecZoverR[i] = p.second; + i++; + } + + PrintL1trk() << "========================================================================="; + PrintL1trk() << "--- Fit to cfg params for FPGA-friendly approximation to B parameter in GP & KF ---"; + PrintL1trk() << "--- (used to allowed for tilted barrel modules) ---"; + + TFileDirectory inputDir = fs_->mkdir("InputDataB"); + graphBVsZoverR_ = inputDir.make(nEntries, &vecZoverR[0], &vecParamB[0]); graphBVsZoverR_->SetNameTitle("B vs module Z/R", "; Module Z/R; B"); graphBVsZoverR_->Fit("pol1", "q"); TF1* fittedFunction = graphBVsZoverR_->GetFunction("pol1"); double gradient = fittedFunction->GetParameter(1); double intercept = fittedFunction->GetParameter(0); - cout << " BApprox_gradient (fitted) = " << gradient << endl; - cout << " BApprox_intercept (fitted) = " << intercept << endl; + double gradient_err = fittedFunction->GetParError(1); + double intercept_err = fittedFunction->GetParError(0); + PrintL1trk() << " BApprox_gradient (fitted) = " << gradient << " +- " << gradient_err; + PrintL1trk() << " BApprox_intercept (fitted) = " << intercept << " +- " << intercept_err; + PrintL1trk() << "========================================================================="; + // Check fitted params consistent with those assumed in cfg file. if (settings_->useApproxB()) { - double gradientDiff = fabs(gradient - settings_->bApprox_gradient()); - double interceptDiff = fabs(intercept - settings_->bApprox_intercept()); - if (gradientDiff > 0.001 || interceptDiff > 0.001) { // Uncertainty independent of number of events - cout << endl << "WARNING: fitted parameters inconsistent with those specified in cfg file:" << endl; - cout << " BApprox_gradient (cfg) = " << settings_->bApprox_gradient() << endl; - cout << " BApprox_intercept (cfg) = " << settings_->bApprox_intercept() << endl; + double gradientDiff = std::abs(gradient - settings_->bApprox_gradient()); + double interceptDiff = std::abs(intercept - settings_->bApprox_intercept()); + constexpr unsigned int nSigma = 5; + if (gradientDiff > nSigma * gradient_err || + interceptDiff > nSigma * intercept_err) { // Uncertainty independent of number of events + PrintL1trk() << "\n WARNING: fitted parameters inconsistent with those specified in cfg file:"; + PrintL1trk() << " BApprox_gradient (cfg) = " << settings_->bApprox_gradient(); + PrintL1trk() << " BApprox_intercept (cfg) = " << settings_->bApprox_intercept(); bApproxMistake_ = true; // Note that problem has occurred. } } diff --git a/L1Trigger/TrackFindingTMTT/src/InputData.cc b/L1Trigger/TrackFindingTMTT/src/InputData.cc index 89f7dfb67bcc4..173cee073bfbb 100644 --- a/L1Trigger/TrackFindingTMTT/src/InputData.cc +++ b/L1Trigger/TrackFindingTMTT/src/InputData.cc @@ -3,27 +3,22 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Framework/interface/EDAnalyzer.h" - #include "SimDataFormats/Track/interface/SimTrack.h" #include "SimDataFormats/EncodedEventId/interface/EncodedEventId.h" - -// #include "Geometry/Records/interface/StackedTrackerGeometryRecord.h" +#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" - -// TTStubAssociationMap.h forgets to two needed files, so must include them here ... -#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h" -#include "SimTracker/TrackTriggerAssociation/interface/TTClusterAssociationMap.h" -#include "SimTracker/TrackTriggerAssociation/interface/TTStubAssociationMap.h" - #include "DataFormats/JetReco/interface/GenJetCollection.h" #include "DataFormats/JetReco/interface/GenJet.h" #include "L1Trigger/TrackFindingTMTT/interface/InputData.h" #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/StubKiller.h" +#include "L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h" #include +#include using namespace std; @@ -31,39 +26,46 @@ namespace tmtt { InputData::InputData(const edm::Event& iEvent, const edm::EventSetup& iSetup, - Settings* settings, - const edm::EDGetTokenT tpInputTag, - const edm::EDGetTokenT stubInputTag, - const edm::EDGetTokenT stubTruthInputTag, - const edm::EDGetTokenT clusterTruthInputTag, - const edm::EDGetTokenT genJetInputTag) { - vTPs_.reserve(2500); - vStubs_.reserve(35000); - vAllStubs_.reserve(35000); - - // Note if job will use MC truth info (or skip it to save CPU). - enableMCtruth_ = settings->enableMCtruth(); + const Settings* settings, + StubWindowSuggest* stubWindowSuggest, + const TrackerGeometry* trackerGeometry, + const TrackerTopology* trackerTopology, + const list& listTrackerModule, + const edm::EDGetTokenT tpToken, + const edm::EDGetTokenT stubToken, + const edm::EDGetTokenT stubTruthToken, + const edm::EDGetTokenT clusterTruthToken, + const edm::EDGetTokenT genJetToken) + : // Note if job will use MC truth info (or skip it to save CPU). + enableMCtruth_(settings->enableMCtruth()) { + edm::Handle tpHandle; + edm::Handle ttStubHandle; + edm::Handle mcTruthTTStubHandle; + edm::Handle mcTruthTTClusterHandle; + edm::Handle genJetHandle; + iEvent.getByToken(stubToken, ttStubHandle); + if (enableMCtruth_) { + iEvent.getByToken(tpToken, tpHandle); + iEvent.getByToken(stubTruthToken, mcTruthTTStubHandle); + iEvent.getByToken(clusterTruthToken, mcTruthTTClusterHandle); + iEvent.getByToken(genJetToken, genJetHandle); + } // Get TrackingParticle info - edm::Handle tpHandle; - if (enableMCtruth_) { - iEvent.getByToken(tpInputTag, tpHandle); - unsigned int tpCount = 0; for (unsigned int i = 0; i < tpHandle->size(); i++) { const TrackingParticle& tPart = tpHandle->at(i); // Creating Ptr uses CPU, so apply Pt cut here, copied from TP::fillUse(), to avoid doing it too often. - const float ptMin = min(settings->genMinPt(), 0.7 * settings->houghMinPt()); + constexpr float ptMinScale = 0.7; + const float ptMin = min(settings->genMinPt(), ptMinScale * settings->houghMinPt()); if (tPart.pt() > ptMin) { TrackingParticlePtr tpPtr(tpHandle, i); // Store the TrackingParticle info, using class TP to provide easy access to the most useful info. TP tp(tpPtr, tpCount, settings); // Only bother storing tp if it could be useful for tracking efficiency or fake rate measurements. if (tp.use()) { - edm::Handle genJetHandle; - iEvent.getByToken(genJetInputTag, genJetHandle); if (genJetHandle.isValid()) { tp.fillNearestJetInfo(genJetHandle.product()); } @@ -81,68 +83,68 @@ namespace tmtt { if (enableMCtruth_) { for (const TP& tp : vTPs_) { - TrackingParticlePtr tpPtr(tp); + const TrackingParticlePtr& tpPtr = tp.trackingParticlePtr(); translateTP[tpPtr] = &tp; } } - // Get the tracker geometry info needed to unpack the stub info. - - edm::ESHandle trackerGeometryHandle; - iSetup.get().get(trackerGeometryHandle); - - const TrackerGeometry* trackerGeometry = trackerGeometryHandle.product(); - - edm::ESHandle trackerTopologyHandle; - iSetup.get().get(trackerTopologyHandle); - - const TrackerTopology* trackerTopology = trackerTopologyHandle.product(); - - // Get stub info, by looping over modules and then stubs inside each module. - // Also get the association map from stubs to tracking particles. - - edm::Handle ttStubHandle; - edm::Handle mcTruthTTStubHandle; - edm::Handle mcTruthTTClusterHandle; - iEvent.getByToken(stubInputTag, ttStubHandle); - if (enableMCtruth_) { - iEvent.getByToken(stubTruthInputTag, mcTruthTTStubHandle); - iEvent.getByToken(clusterTruthInputTag, mcTruthTTClusterHandle); + // Initialize code for killing some stubs to model detector problems. + const StubKiller::KillOptions killOpt = static_cast(settings->killScenario()); + std::unique_ptr stubKiller; + if (killOpt != StubKiller::KillOptions::none) { + stubKiller = std::make_unique(killOpt, trackerTopology, trackerGeometry, iEvent); } - unsigned int stubCount = 0; + // Loop over tracker modules to get module info & stubs. + + for (const TrackerModule& trackerModule : listTrackerModule) { + const DetId& stackedDetId = trackerModule.stackedDetId(); + TTStubDetSetVec::const_iterator p_module = ttStubHandle->find(stackedDetId); + if (p_module != ttStubHandle->end()) { + for (TTStubDetSet::const_iterator p_ttstub = p_module->begin(); p_ttstub != p_module->end(); p_ttstub++) { + TTStubRef ttStubRef = edmNew::makeRefTo(ttStubHandle, p_ttstub); + const unsigned int stubIndex = vAllStubs_.size(); - for (DetSetVec::const_iterator p_module = ttStubHandle->begin(); p_module != ttStubHandle->end(); p_module++) { - for (DetSet::const_iterator p_ttstub = p_module->begin(); p_ttstub != p_module->end(); p_ttstub++) { - TTStubRef ttStubRef = edmNew::makeRefTo(ttStubHandle, p_ttstub); + // Store the Stub info, using class Stub to provide easy access to the most useful info. + vAllStubs_.emplace_back(ttStubRef, stubIndex, settings, trackerTopology, &trackerModule, stubKiller.get()); - // Store the Stub info, using class Stub to provide easy access to the most useful info. - Stub stub(ttStubRef, stubCount, settings, trackerGeometry, trackerTopology); - // Also fill truth associating stubs to tracking particles. - if (enableMCtruth_) - stub.fillTruth(translateTP, mcTruthTTStubHandle, mcTruthTTClusterHandle); - vAllStubs_.push_back(stub); - stubCount++; + // Also fill truth associating stubs to tracking particles. + if (enableMCtruth_) { + Stub& stub = vAllStubs_.back(); + stub.fillTruth(translateTP, mcTruthTTStubHandle, mcTruthTTClusterHandle); + } + } } } // Produced reduced list containing only the subset of stubs that the user has declared will be // output by the front-end readout electronics. - for (const Stub& s : vAllStubs_) { - if (s.frontendPass()) + for (Stub& s : vAllStubs_) { + if (s.frontendPass()) { vStubs_.push_back(&s); + vStubsConst_.push_back(&s); + } } // Optionally sort stubs according to bend, so highest Pt ones are sent from DTC to GP first. - if (settings->orderStubsByBend()) - std::sort(vStubs_.begin(), vStubs_.end(), SortStubsInBend()); + if (settings->orderStubsByBend()) { + auto orderStubsByBend = [](const Stub* a, const Stub* b) { return (std::abs(a->bend()) < std::abs(b->bend())); }; + vStubs_.sort(orderStubsByBend); + } // Note list of stubs produced by each tracking particle. // (By passing vAllStubs_ here instead of vStubs_, it means that any algorithmic efficiencies // measured will be reduced if the tightened frontend electronics cuts, specified in section StubCuts // of Analyze_Defaults_cfi.py, are not 100% efficient). if (enableMCtruth_) { - for (unsigned int j = 0; j < vTPs_.size(); j++) { - vTPs_[j].fillTruth(vAllStubs_); + for (TP& tp : vTPs_) { + tp.fillTruth(vAllStubs_); + } + } + + // If requested, recommend better FE stub window cuts. + if (settings->printStubWindows()) { + for (const Stub& s : vAllStubs_) { + stubWindowSuggest->process(trackerTopology, &s); } } } diff --git a/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc b/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc index 4a7a34f124add..2021ef597164c 100644 --- a/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc +++ b/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc @@ -2,276 +2,112 @@ #include "L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h" #include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" -#include "L1Trigger/TrackFindingTMTT/interface/StubCluster.h" +#include "L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h" #include "DataFormats/Math/interface/deltaPhi.h" -//#define CKF_DEBUG -namespace tmtt { - - /* -// Scattering constants - HISTORIC NOT USED. - -constexpr unsigned nlayer_eta[25] = -{ 6, 6, 6, 6, -6, 6, 6, 6, 6, 6, 6, 7, 7, 7, -7, 7, 7, 7, 6, 6, 6, 6, 6, 6}; - -constexpr double matx_outer[25] = { -0.16, 0.17, 0.18, 0.19, 0.20, -0.21, 0.26, 0.22, 0.26, 0.38, -0.41, 0.40, 0.44, 0.50, 0.54, -0.60, 0.44, 0.48, 0.60, 0.68, -0.50, 0.48, 0.64, 0.39, 0.20 -}; - -constexpr double matx_inner[25] = { -0.14, 0.1, 0.1, 0.1, 0.1, -0.1, 0.1, 0.1, 0.1, 0.1, -0.12, 0.1, 0.1, 0.1, 0.15, -0.20, 0.25, 0.25, 0.3, 0.3, -0.35, 0.40, 0.40, 0.6, 0.6 -}; -*/ - - KFParamsComb::KFParamsComb(const Settings* settings, const uint nPar, const string& fitterName) - : L1KalmanComb(settings, nPar, fitterName) { - hdxmin[INV2R] = -1.1e-4; - hdxmax[INV2R] = +1.1e-4; - hdxmin[PHI0] = -6.e-3; - hdxmax[PHI0] = +6.e-3; - hdxmin[Z0] = -4.1; - hdxmax[Z0] = +4.1; - hdxmin[T] = -6.; - hdxmax[T] = +6.; - if (nPar_ == 5) { - hdxmin[D0] = -1.001; - hdxmax[D0] = +1.001; - } - - hxmin[INV2R] = -0.3 * 0.0057; - hxmax[INV2R] = +0.3 * 0.0057; - hxmin[PHI0] = -0.3; - hxmax[PHI0] = +0.3; - hxmin[Z0] = -120; - hxmax[Z0] = +120; - hxmin[T] = -6.; - hxmax[T] = +6.; - if (nPar_ == 5) { - hxmin[D0] = -3.5; - hxmax[D0] = +3.5; - } - - hddMeasmin[PHI0] = -1.e1; - hddMeasmax[PHI0] = +1.e1; +#include - hresmin[PHI0] = -0.5; - hresmax[PHI0] = +0.5; +using namespace std; - hresmin[PHI0] = -10.; - hresmax[PHI0] = +10.; - - hxaxtmin[INV2R] = -1.e-3; - hxaxtmax[INV2R] = +1.e-3; - hxaxtmin[PHI0] = -1.e-1; - hxaxtmax[PHI0] = +1.e-1; - hxaxtmin[Z0] = -10.; - hxaxtmax[Z0] = +10.; - hxaxtmin[T] = -1.e-0; - hxaxtmax[T] = +1.e-0; - if (nPar_ == 5) { - hxaxtmin[D0] = -1.001; - hxaxtmax[D0] = +1.001; - } - } - - std::map KFParamsComb::getTrackParams(const KalmanState* state) const { - std::vector x = state->xa(); - std::map y; - y["qOverPt"] = 2. * x.at(INV2R) / getSettings()->invPtToInvR(); - y["phi0"] = reco::deltaPhi(x.at(PHI0) + sectorPhi(), 0.); - y["z0"] = x.at(Z0); - y["t"] = x.at(T); - if (nPar_ == 5) { - y["d0"] = x.at(D0); - } - return y; - } +namespace tmtt { - /* If using 5 param helix fit, get track params with beam-spot constraint & track fit chi2 from applying it. */ - /* (N.B. chi2rz unchanged by constraint) */ + /* Helix state seed */ - std::map KFParamsComb::getTrackParams_BeamConstr(const KalmanState* state, - double& chi2rphi) const { + TVectorD KFParamsComb::seedX(const L1track3D& l1track3D) const { + TVectorD vecX(nPar_); + vecX[INV2R] = settings_->invPtToInvR() * l1track3D.qOverPt() / 2; + vecX[PHI0] = reco::deltaPhi(l1track3D.phi0() - sectorPhi(), 0.); + vecX[Z0] = l1track3D.z0(); + vecX[T] = l1track3D.tanLambda(); if (nPar_ == 5) { - std::map y; - std::vector x = state->xa(); - TMatrixD cov_xa = state->pxxa(); - double deltaChi2rphi = (x.at(D0) * x.at(D0)) / cov_xa[D0][D0]; - chi2rphi = state->chi2rphi() + deltaChi2rphi; - // Apply beam-spot constraint to helix params in transverse plane only, as most sensitive to it. - x[INV2R] -= x.at(D0) * (cov_xa[INV2R][D0] / cov_xa[D0][D0]); - x[PHI0] -= x.at(D0) * (cov_xa[PHI0][D0] / cov_xa[D0][D0]); - x[D0] = 0.0; - y["qOverPt"] = 2. * x.at(INV2R) / getSettings()->invPtToInvR(); - y["phi0"] = reco::deltaPhi(x.at(PHI0) + sectorPhi(), 0.); - y["z0"] = x.at(Z0); - y["t"] = x.at(T); - y["d0"] = x.at(D0); - return y; - } else { - return (this->getTrackParams(state)); + vecX[D0] = l1track3D.d0(); } - } - /* The Kalman measurement matrix = derivative of helix intercept w.r.t. helix params - * Here I always measure phi(r), and z(r) */ - TMatrixD KFParamsComb::H(const StubCluster* stubCluster) const { - TMatrixD h(2, nPar_); - double r = stubCluster->r(); - h(PHI, INV2R) = -r; - h(PHI, PHI0) = 1; - if (nPar_ == 5) { - h(PHI, D0) = -1. / r; - } - h(Z, Z0) = 1; - h(Z, T) = r; - return h; + return vecX; } - // Not used? + /* Helix state seed covariance matrix */ - TMatrixD KFParamsComb::dH(const StubCluster* stubCluster) const { - double dr(0); - if (stubCluster->layerId() > 10) { - dr = stubCluster->sigmaZ(); - } - - double r = stubCluster->r(); + TMatrixD KFParamsComb::seedC(const L1track3D& l1track3D) const { + TMatrixD matC(nPar_, nPar_); - TMatrixD h(2, nPar_); - h(PHI, INV2R) = -dr; - if (nPar_ == 5) { - h(PHI, D0) = dr / (r * r); - } - h(Z, T) = dr; + double invPtToInv2R = settings_->invPtToInvR() / 2; - return h; - } + // Assumed track seed (from HT) uncertainty in transverse impact parameter. - /* Seed the state vector */ - std::vector KFParamsComb::seedx(const L1track3D& l1track3D) const { - std::vector x(nPar_); - x[INV2R] = getSettings()->invPtToInvR() * l1track3D.qOverPt() / 2; - x[PHI0] = reco::deltaPhi(l1track3D.phi0() - sectorPhi(), 0.); - x[Z0] = l1track3D.z0(); - x[T] = l1track3D.tanLambda(); + // Constants optimised by hand for TMTT algo. + const float inv2Rsigma2 = pow(0.0314 * invPtToInv2R, 2); + constexpr float phi0sigma2 = pow(0.0102, 2); + constexpr float z0sigma2 = pow(5.0, 2); + constexpr float tanLsigma2 = pow(0.5, 2); + constexpr float d0Sigma2 = pow(1.0, 2); + matC[INV2R][INV2R] = inv2Rsigma2; + matC[PHI0][PHI0] = phi0sigma2; + matC[Z0][Z0] = z0sigma2; + matC[T][T] = tanLsigma2; if (nPar_ == 5) { - x[D0] = l1track3D.d0(); + matC[D0][D0] = d0Sigma2; } - return x; - } - - /* Seed the covariance matrix */ - TMatrixD KFParamsComb::seedP(const L1track3D& l1track3D) const { - TMatrixD p(nPar_, nPar_); + //if (settings_->hybrid()) { + // N.B. (z0, tanL, d0) seed uncertainties could be smaller for hybrid, if seeded in PS? -- not tried + //if (l1track3D.seedPS() > 0) { // Tracklet seed used PS layers + // matC[Z0][Z0] /= (4.*4.).; + // matC[T][T] /= (4.*4.); + // } + //} - double invPtToInv2R = getSettings()->invPtToInvR() / 2; - - // Assumed track seed (from HT) uncertainty in transverse impact parameter. - const float d0Sigma = 1.0; - - if (getSettings()->hybrid()) { - p(INV2R, INV2R) = 0.0157 * 0.0157 * invPtToInv2R * invPtToInv2R * 4; - p(PHI0, PHI0) = 0.0051 * 0.0051 * 4; - p(Z0, Z0) = 5.0 * 5.0; - p(T, T) = 0.25 * 0.25 * 4; - // N.B. (z0, tanL, d0) seed uncertainties could be smaller for hybrid, if seeded in PS? -- not tried - //if (l1track3D.seedPS() > 0) { // Tracklet seed used PS layers - // p(Z0,Z0) /= (4.*4.).; - // p(T,T) /= (4.*4.); - // } - if (nPar_ == 5) { - p(D0, D0) = d0Sigma * d0Sigma; - } - - } else { - // optimised for 18x2 with additional error factor in pt/phi to avoid pulling towards wrong HT params - p(INV2R, INV2R) = 0.0157 * 0.0157 * invPtToInv2R * invPtToInv2R * 4; // Base on HT cell size - p(PHI0, PHI0) = 0.0051 * 0.0051 * 4; // Based on HT cell size. - p(Z0, Z0) = 5.0 * 5.0; - p(T, T) = 0.25 * 0.25 * 4; // IRT: increased by factor 4, as was affecting fit chi2. - if (nPar_ == 5) { - p(D0, D0) = d0Sigma * d0Sigma; - } - - if (getSettings()->numEtaRegions() <= 12) { - // Inflate eta errors - p(T, T) = p(T, T) * 2 * 2; - } - } - - return p; + return matC; } - /* The forecast matrix - * (here equals identity matrix) */ - TMatrixD KFParamsComb::F(const StubCluster* stubCluster, const KalmanState* state) const { - TMatrixD F(nPar_, nPar_); - for (unsigned int n = 0; n < nPar_; n++) - F(n, n) = 1; - return F; - } + /* Stub position measurements in (phi,z) */ - /* the vector of measurements */ - std::vector KFParamsComb::d(const StubCluster* stubCluster) const { - std::vector meas; - meas.resize(2); - meas[PHI] = reco::deltaPhi(stubCluster->phi(), sectorPhi()); - meas[Z] = stubCluster->z(); + TVectorD KFParamsComb::vectorM(const Stub* stub) const { + TVectorD meas(2); + meas[PHI] = reco::deltaPhi(stub->phi(), sectorPhi()); + meas[Z] = stub->z(); return meas; } - // Assumed hit resolution in (phi,z) - TMatrixD KFParamsComb::PddMeas(const StubCluster* stubCluster, const KalmanState* state) const { - double inv2R = - (getSettings()->invPtToInvR()) * 0.5 * state->candidate().qOverPt(); // alternatively use state->xa().at(INV2R) + // Stub position resolution in (phi,z) + + TMatrixD KFParamsComb::matrixV(const Stub* stub, const KalmanState* state) const { + // Take Pt from input track candidate as more stable. + double inv2R = (settings_->invPtToInvR()) * 0.5 * state->candidate().qOverPt(); double inv2R2 = inv2R * inv2R; - double tanl = state->xa().at(T); // factor of 0.9 improves rejection + double tanl = state->vectorX()(T); // factor of 0.9 improves rejection double tanl2 = tanl * tanl; - TMatrixD p(2, 2); - double vphi(0); double vz(0); double vcorr(0); // consider error due to integerisation only for z (r in encap) coord when enabled double err_digi2(0); - if (getSettings()->enableDigitize()) + if (settings_->enableDigitize()) err_digi2 = 0.15625 * 0.15625 / 12.0; - double a = stubCluster->sigmaX() * stubCluster->sigmaX(); - double b = stubCluster->sigmaZ() * stubCluster->sigmaZ() + err_digi2; - double r2 = stubCluster->r() * stubCluster->r(); + double a = stub->sigmaPerp() * stub->sigmaPerp(); + double b = stub->sigmaPar() * stub->sigmaPar() + err_digi2; + double r2 = stub->r() * stub->r(); double invr2 = 1. / r2; // Scattering term scaling as 1/Pt. - double sigmaScat = getSettings()->kalmanMultiScattTerm() / (state->candidate().pt()); + double sigmaScat = settings_->kalmanMultiScattTerm() / (state->candidate().pt()); double sigmaScat2 = sigmaScat * sigmaScat; - if (stubCluster->barrel()) { + if (stub->barrel()) { vphi = (a * invr2) + sigmaScat2; - if (stubCluster->tiltedBarrel()) { + if (stub->tiltedBarrel()) { // Convert uncertainty in (r,phi) to (z,phi). float scaleTilted = 1.; - if (getSettings()->kalmanHOtilted()) { - if (getSettings()->useApproxB()) { // Simple firmware approximation - scaleTilted = getApproxB(stubCluster->z(), stubCluster->r()); + if (settings_->kalmanHOtilted()) { + if (settings_->useApproxB()) { // Simple firmware approximation + scaleTilted = approxB(stub->z(), stub->r()); } else { // Exact C++ implementation. - float tilt = stubCluster->moduleTilt(); + float tilt = stub->tiltAngle(); scaleTilted = sin(tilt) + cos(tilt) * tanl; } } @@ -282,8 +118,8 @@ constexpr double matx_inner[25] = { vz = b; } - if (getSettings()->kalmanHOdodgy()) { - // Use original (Dec. 2016) dodgy implementation was this. + if (settings_->kalmanHOfw()) { + // Use approximation corresponding to current firmware. vz = b; } @@ -291,33 +127,21 @@ constexpr double matx_inner[25] = { vphi = a * invr2 + sigmaScat2; vz = (b * tanl2); - if (not stubCluster->psModule()) { // Neglect these terms in PS + if (not stub->psModule()) { // Neglect these terms in PS double beta = 0.; // Add correlation term related to conversion of stub residuals from (r,phi) to (z,phi). - if (getSettings()->kalmanHOprojZcorr() == 2) + if (settings_->kalmanHOprojZcorr() == 2) beta += -inv2R; // Add alpha correction for non-radial 2S endcap strips.. - if (getSettings()->kalmanHOalpha() == 2) - beta += -stubCluster->alpha(); // alpha is 0 except in endcap 2S disks + if (settings_->kalmanHOalpha() == 2) + beta += -stub->alpha(); // alpha is 0 except in endcap 2S disks double beta2 = beta * beta; vphi += b * beta2; vcorr = b * (beta * tanl); - // IRT - for checking efficiency of removing phi-z correlation from projection. - // "ultimate_off1" - //vphi = a * invr2 + b * pow(-stubCluster->alpha(), 2) + b * inv2R2 + sigmaScat2; - //vcorr = b * ((-stubCluster->alpha()) * tanl); - - // IRT - This higher order correction doesn't significantly improve the track fit performance, so commented out. - //if (getSettings()->kalmanHOhelixExp()) { - // float dsByDr = 1. + (1./2.)*r2*inv2R2; // Allows for z = z0 + s*tanL, where s is not exactly r due to circle. - // vcorr *= dsByDr; - // vz *= dsByDr * dsByDr; - //} - - if (getSettings()->kalmanHOdodgy()) { - // Use original (Dec. 2016) dodgy implementation was this. + if (settings_->kalmanHOfw()) { + // Use approximation corresponding to current firmware. vphi = (a * invr2) + (b * inv2R2) + sigmaScat2; vcorr = 0.; vz = (b * tanl2); @@ -325,44 +149,80 @@ constexpr double matx_inner[25] = { } } - p(PHI, PHI) = vphi; - p(Z, Z) = vz; - p(PHI, Z) = vcorr; - p(Z, PHI) = vcorr; + TMatrixD matV(2, 2); + matV(PHI, PHI) = vphi; + matV(Z, Z) = vz; + matV(PHI, Z) = vcorr; + matV(Z, PHI) = vcorr; - return p; + return matV; } - // State uncertainty due to scattering -- HISTORIC NOT USED - TMatrixD KFParamsComb::PxxModel(const KalmanState* state, const StubCluster* stubCluster) const { - TMatrixD p(nPar_, nPar_); + /* The Kalman measurement matrix = derivative of helix intercept w.r.t. helix params */ + /* Here I always measure phi(r), and z(r) */ - /* - if( getSettings()->kalmanMultiScattFactor() ){ + TMatrixD KFParamsComb::matrixH(const Stub* stub) const { + TMatrixD matH(2, nPar_); + double r = stub->r(); + matH(PHI, INV2R) = -r; + matH(PHI, PHI0) = 1; + if (nPar_ == 5) { + matH(PHI, D0) = -1. / r; + } + matH(Z, Z0) = 1; + matH(Z, T) = r; + return matH; + } - unsigned i_eta = abs( stubCluster->eta() / 0.1 ); - if( i_eta > 24 ) i_eta = 24; - double dl = matx_outer[i_eta] / nlayer_eta[i_eta]; + /* Kalman helix ref point extrapolation matrix */ - unsigned stub_itr = state->nextLayer(); + TMatrixD KFParamsComb::matrixF(const Stub* stub, const KalmanState* state) const { + const TMatrixD unitMatrix(TMatrixD::kUnit, TMatrixD(nPar_, nPar_)); + return unitMatrix; + } - const KalmanState * last_update_state = state->last_update_state(); - unsigned last_itr(1); - if( last_update_state ) last_itr = last_update_state->nextLayer(); - dl = ( stub_itr - last_itr ) * dl; + /* Get physical helix params */ - if( dl ){ - std::map y = getTrackParams( state ); - double dtheta0 = 1./sqrt(3) * 0.0136 * fabs(y["qOverPt"]) * sqrt(dl)*( 1+0.038*log(dl) ); - dtheta0 *= getSettings()->kalmanMultiScattFactor(); - p(PHI0, PHI0) = dtheta0 * dtheta0; // Despite the name, I think this is uncertainty in phi0. I guess uncertainty in theta0 neglected compared to detector resolution. - } + TVectorD KFParamsComb::trackParams(const KalmanState* state) const { + TVectorD vecX = state->vectorX(); + TVectorD vecY(nPar_); + vecY[QOVERPT] = 2. * vecX[INV2R] / settings_->invPtToInvR(); + vecY[PHI0] = reco::deltaPhi(vecX[PHI0] + sectorPhi(), 0.); + vecY[Z0] = vecX[Z0]; + vecY[T] = vecX[T]; + if (nPar_ == 5) { + vecY[D0] = vecX[D0]; } - */ + return vecY; + } + + /* If using 5 param helix fit, get track params with beam-spot constraint & track fit chi2 from applying it. */ + /* (N.B. chi2rz unchanged by constraint) */ - return p; + TVectorD KFParamsComb::trackParams_BeamConstr(const KalmanState* state, double& chi2rphi) const { + if (nPar_ == 5) { + TVectorD vecX = state->vectorX(); + TMatrixD matC = state->matrixC(); + TVectorD vecY(nPar_); + double delChi2rphi = (vecX[D0] * vecX[D0]) / matC[D0][D0]; + chi2rphi = state->chi2rphi() + delChi2rphi; + // Apply beam-spot constraint to helix params in transverse plane only, as most sensitive to it. + vecX[INV2R] -= vecX[D0] * (matC[INV2R][D0] / matC[D0][D0]); + vecX[PHI0] -= vecX[D0] * (matC[PHI0][D0] / matC[D0][D0]); + vecX[D0] = 0.0; + vecY[QOVERPT] = 2. * vecX[INV2R] / settings_->invPtToInvR(); + vecY[PHI0] = reco::deltaPhi(vecX[PHI0] + sectorPhi(), 0.); + vecY[Z0] = vecX[Z0]; + vecY[T] = vecX[T]; + vecY[D0] = vecX[D0]; + return vecY; + } else { + return (this->trackParams(state)); + } } + /* Check if helix state passes cuts */ + bool KFParamsComb::isGoodState(const KalmanState& state) const { // Cut values. (Layer 0 entry here is dummy). -- todo : make configurable @@ -370,7 +230,8 @@ constexpr double matx_inner[25] = { // Layer = 0 1 2 3 4 5 6 ptTolerance = {999., 999., 0.1, 0.1, 0.05, 0.05, 0.05}; d0Cut = {999., 999., 999., 10., 10., 10., 10.}; // Only used for 5 param fit. - if (nPar_ == 5) { // specific cuts for displaced tracking case. + // Chi2 cuts should be retuned if cfg param KalmanMultiScattTerm is changed! + if (nPar_ == 5) { // specific cuts for displaced tracking case. // Layer = 0 1 2 3 4 5 6 z0Cut = { 999., 999., 1.7 * 15., 1.7 * 15., 1.7 * 15., 1.7 * 15., 1.7 * 15.}; // Larger values require digisation change. @@ -384,19 +245,19 @@ constexpr double matx_inner[25] = { unsigned nStubLayers = state.nStubLayers(); bool goodState(true); - std::map y = getTrackParams(&state); - double qOverPt = y["qOverPt"]; - double pt = fabs(1 / qOverPt); - double z0 = fabs(y["z0"]); + TVectorD vecY = trackParams(&state); + double qOverPt = vecY[QOVERPT]; + double pt = std::abs(1 / qOverPt); + double z0 = std::abs(vecY[Z0]); // state parameter selections if (z0 > z0Cut[nStubLayers]) goodState = false; - if (pt < getSettings()->houghMinPt() - ptTolerance[nStubLayers]) + if (pt < settings_->houghMinPt() - ptTolerance[nStubLayers]) goodState = false; if (nPar_ == 5) { - double d0 = fabs(state.xa()[D0]); + double d0 = std::abs(state.vectorX()[D0]); if (d0 > d0Cut[nStubLayers]) goodState = false; } @@ -405,58 +266,30 @@ constexpr double matx_inner[25] = { double chi2scaled = state.chi2scaled(); // chi2(r-phi) scaled down to improve electron performance. - if (getSettings()->kalmanMultiScattTerm() > 0.0001) { // Scattering taken into account - - if (chi2scaled > chi2Cut[nStubLayers]) - goodState = false; // No separate pT selection needed - - } else { // scattering ignored - HISTORIC - - // N.B. Code below changed by Alexander Morton to allow tracking down to Pt = 2 GeV. - if (nStubLayers == 2) { - if (chi2scaled > 15.0) - goodState = false; // No separate pT selection needed - } else if (nStubLayers == 3) { - if (chi2scaled > 100.0 && pt > 2.7) - goodState = false; - if (chi2scaled > 120.0 && pt <= 2.7) - goodState = false; - } else if (nStubLayers == 4) { - if (chi2scaled > 320.0 && pt > 2.7) - goodState = false; - if (chi2scaled > 1420.0 && pt <= 2.7) - goodState = false; - } else if (nStubLayers == 5) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! - if (chi2scaled > 480.0 && pt > 2.7) - goodState = false; - if (chi2scaled > 2130.0 && pt <= 2.7) - goodState = false; - } else if (nStubLayers >= 6) { // NEEDS TUNING FOR 5 OR 6 LAYERS !!! - if (chi2scaled > 640.0 && pt > 2.7) - goodState = false; - if (chi2scaled > 2840.0 && pt <= 2.7) - goodState = false; - } - } + if (chi2scaled > chi2Cut[nStubLayers]) + goodState = false; // No separate pT selection needed const bool countUpdateCalls = false; // Print statement to count calls to Updator. - if (countUpdateCalls || (getSettings()->kalmanDebugLevel() >= 2 && tpa_ != nullptr) || - (getSettings()->kalmanDebugLevel() >= 2 && getSettings()->hybrid())) { + if (countUpdateCalls || (settings_->kalmanDebugLevel() >= 2 && tpa_ != nullptr) || + (settings_->kalmanDebugLevel() >= 2 && settings_->hybrid())) { + std::stringstream text; + text << std::fixed << std::setprecision(4); if (not goodState) - cout << "State veto:"; + text << "State veto:"; if (goodState) - cout << "State kept:"; - cout << " nlay=" << nStubLayers << " nskip=" << state.nSkippedLayers() << " chi2_scaled=" << chi2scaled; + text << "State kept:"; + text << " nlay=" << nStubLayers << " nskip=" << state.nSkippedLayers() << " chi2_scaled=" << chi2scaled; if (tpa_ != nullptr) - cout << " pt(mc)=" << tpa_->pt(); - cout << " pt=" << pt << " q/pt=" << qOverPt << " tanL=" << y["t"] << " z0=" << y["z0"] << " phi0=" << y["phi0"]; + text << " pt(mc)=" << tpa_->pt(); + text << " pt=" << pt << " q/pt=" << qOverPt << " tanL=" << vecY[T] << " z0=" << vecY[Z0] + << " phi0=" << vecY[PHI0]; if (nPar_ == 5) - cout << " d0=" << y["d0"]; - cout << " fake" << (tpa_ == nullptr); + text << " d0=" << vecY[D0]; + text << " fake" << (tpa_ == nullptr); if (tpa_ != nullptr) - cout << " pt(mc)=" << tpa_->pt(); - cout << endl; + text << " pt(mc)=" << tpa_->pt(); + PrintL1trk() << text.str(); } return goodState; diff --git a/L1Trigger/TrackFindingTMTT/src/KFTrackletTrack.cc b/L1Trigger/TrackFindingTMTT/src/KFTrackletTrack.cc deleted file mode 100644 index 83f4cf0448d1d..0000000000000 --- a/L1Trigger/TrackFindingTMTT/src/KFTrackletTrack.cc +++ /dev/null @@ -1,7 +0,0 @@ -#include "L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h" - -namespace tmtt { - - // Digitize track and degrade helix parameter resolution according to effect of digitisation. - -} diff --git a/L1Trigger/TrackFindingTMTT/src/KFbase.cc b/L1Trigger/TrackFindingTMTT/src/KFbase.cc new file mode 100644 index 0000000000000..88ac5fb54c5e0 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/KFbase.cc @@ -0,0 +1,983 @@ +///=== This is the base class for the Kalman Combinatorial Filter track fit algorithm. + +///=== Written by: S. Summers, K. Uchida, M. Pesaresi, I.Tomalin + +#include "L1Trigger/TrackFindingTMTT/interface/KFbase.h" +#include "L1Trigger/TrackFindingTMTT/interface/Utility.h" +#include "L1Trigger/TrackFindingTMTT/interface/TP.h" +#include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" +#include "L1Trigger/TrackFindingTMTT/interface/StubKiller.h" +#include "L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "CommonTools/UtilAlgos/interface/TFileService.h" +#include "DataFormats/Math/interface/deltaPhi.h" +#include "TMatrixD.h" + +#include +#include +#include +#include +#include +#include + +using namespace std; + +namespace tmtt { + + /* Initialize cfg parameters */ + + KFbase::KFbase(const Settings *settings, const uint nPar, const string &fitterName, const uint nMeas) + : TrackFitGeneric(settings, fitterName) { + nPar_ = nPar; + nMeas_ = nMeas; + numEtaRegions_ = settings->numEtaRegions(); + } + + /* Do track fit */ + + L1fittedTrack KFbase::fit(const L1track3D &l1track3D) { + iPhiSec_ = l1track3D.iPhiSec(); + iEtaReg_ = l1track3D.iEtaReg(); + resetStates(); + numUpdateCalls_ = 0; + + vector stubs = l1track3D.stubs(); + + auto orderByLayer = [](const Stub *a, const Stub *b) { return bool(a->layerId() < b->layerId()); }; + sort(stubs.begin(), stubs.end(), orderByLayer); // Makes debug printout pretty. + + //TP + const TP *tpa(0); + if (l1track3D.matchedTP()) { + tpa = l1track3D.matchedTP(); + } + tpa_ = tpa; + + //track information dump + if (settings_->kalmanDebugLevel() >= 1) { + PrintL1trk() << "==============================================================================="; + std::stringstream text; + text << std::fixed << std::setprecision(4); + text << "Input track cand: [phiSec,etaReg]=[" << l1track3D.iPhiSec() << "," << l1track3D.iEtaReg() << "]"; + text << " HT(m,c)=(" << l1track3D.cellLocationHT().first << "," << l1track3D.cellLocationHT().second + << ") q/pt=" << l1track3D.qOverPt() << " tanL=" << l1track3D.tanLambda() << " z0=" << l1track3D.z0() + << " phi0=" << l1track3D.phi0() << " nStubs=" << l1track3D.numStubs() << " d0=" << l1track3D.d0(); + PrintL1trk() << text.str(); + if (not settings_->hybrid()) + printTP(tpa); + if (settings_->kalmanDebugLevel() >= 2) { + printStubLayers(stubs, l1track3D.iEtaReg()); + printStubs(stubs); + } + } + + //Kalman Filter + const KalmanState *cand = doKF(l1track3D, stubs, tpa); + + //return L1fittedTrk for the selected state (if KF produced one it was happy with). + if (cand != nullptr) { + // Get track helix params. + TVectorD trackPars = trackParams(cand); + double d0 = (nPar_ == 5) ? trackPars[D0] : 0.; + + L1fittedTrack fitTrk(settings_, + &l1track3D, + cand->stubs(), + cand->hitPattern(), + trackPars[QOVERPT], + d0, + trackPars[PHI0], + trackPars[Z0], + trackPars[T], + cand->chi2rphi(), + cand->chi2rz(), + nPar_); + + bool consistentHLS = false; // No longer used + // if (this->isHLS()) { + // unsigned int mBinHelixHLS, cBinHelixHLS; + // cand->getHLSselect(mBinHelixHLS, cBinHelixHLS, consistentHLS); + // if( settings_->kalmanDebugLevel() >= 3 ){ + // // Check if (m,c) corresponding to helix params are correctly calculated by HLS code. + // bool HLS_OK = ((mBinHelixHLS == fitTrk.cellLocationFit().first) && (cBinHelixHLS == fitTrk.cellLocationFit().second)); + // if (not HLS_OK) PrintL1trk()<<"WARNING HLS mBinHelix disagrees with C++:" + // <<" (HLS,C++) m=("<isHLS() && nPar_ == 4) { + fitTrk.setInfoKF(cand->nSkippedLayers(), numUpdateCalls_, consistentHLS); + } else { + fitTrk.setInfoKF(cand->nSkippedLayers(), numUpdateCalls_); + } + + // If doing 5 parameter fit, optionally also calculate helix params & chi2 with beam-spot constraint applied, + // and store inside L1fittedTrack object. + if (settings_->kalmanAddBeamConstr()) { + if (nPar_ == 5) { + double chi2rphi_bcon = 0.; + TVectorD trackPars_bcon = trackParams_BeamConstr(cand, chi2rphi_bcon); + fitTrk.setBeamConstr(trackPars_bcon[QOVERPT], trackPars_bcon[PHI0], chi2rphi_bcon); + } + } + + // Fitted track params must lie in same sector as HT originally found track in. + if (!settings_->hybrid()) { // consistentSector() function not yet working for Hybrid. + + // Bodge to take into account digitisation in sector consistency check. + if (settings_->enableDigitize()) + fitTrk.digitizeTrack("KF4ParamsComb"); + + if (!fitTrk.consistentSector()) { + if (settings_->kalmanDebugLevel() >= 1) + PrintL1trk() << "Track rejected by sector consistency test"; + L1fittedTrack rejectedTrk; + return rejectedTrk; + } + } + + return fitTrk; + + } else { // Track rejected by fitter + + if (settings_->kalmanDebugLevel() >= 1) { + bool goodTrack = (tpa && tpa->useForAlgEff()); // Matches truth particle. + if (goodTrack) { + int tpin = tpa->index(); + PrintL1trk() << "TRACK LOST: eta=" << l1track3D.iEtaReg() << " pt=" << l1track3D.pt() << " tp=" << tpin; + + for (auto stub : stubs) { + int kalmanLay = + this->kalmanLayer(l1track3D.iEtaReg(), stub->layerIdReduced(), stub->barrel(), stub->r(), stub->z()); + std::stringstream text; + text << std::fixed << std::setprecision(4); + text << " Stub: lay_red=" << stub->layerIdReduced() << " KFlay=" << kalmanLay << " r=" << stub->r() + << " z=" << stub->z() << " assoc TPs ="; + for (const TP *tp_i : stub->assocTPs()) + text << " " << tp_i->index(); + PrintL1trk() << text.str(); + if (stub->assocTPs().size() == 0) + PrintL1trk() << " none"; + } + PrintL1trk() << "====================="; + } + } + + //dump on the missed TP for efficiency calculation. + if (settings_->kalmanDebugLevel() >= 3) { + if (tpa && tpa->useForAlgEff()) { + PrintL1trk() << "TP for eff. missed addr. index : " << tpa << " " << tpa->index(); + printStubs(stubs); + } + } + + L1fittedTrack rejectedTrk; + return rejectedTrk; + } + } + + /* Do track fit (internal function) */ + + const KalmanState *KFbase::doKF(const L1track3D &l1track3D, const vector &stubs, const TP *tpa) { + const KalmanState *finished_state = nullptr; + + map> + best_state_by_nstubs; // Best state (if any) for each viable no. of stubs on track value. + + // seed helix params & their covariance. + TVectorD x0 = seedX(l1track3D); + TMatrixD pxx0 = seedC(l1track3D); + TMatrixD K(nPar_, 2); + TMatrixD dcov(2, 2); + + const KalmanState *state0 = mkState(l1track3D, 0, -1, nullptr, x0, pxx0, K, dcov, nullptr, 0, 0); + + // internal containers - i.e. the state FIFO. Contains estimate of helix params in last/next layer, with multiple entries if there were multiple stubs, yielding multiple states. + vector new_states; + vector prev_states; + prev_states.push_back(state0); + + // Get dead layers, if any. + bool remove2PSCut = settings_->kalmanRemove2PScut(); + set kfDeadLayers = kalmanDeadLayers(remove2PSCut); + + // arrange stubs into Kalman layers according to eta region + int etaReg = l1track3D.iEtaReg(); + map> layerStubs; + + for (auto stub : stubs) { + // Get Kalman encoded layer ID for this stub. + int kalmanLay = this->kalmanLayer(etaReg, stub->layerIdReduced(), stub->barrel(), stub->r(), stub->z()); + + if (kalmanLay != 7) { + if (layerStubs[kalmanLay].size() < settings_->kalmanMaxStubsPerLayer()) { + layerStubs[kalmanLay].push_back(stub); + } else { + // If too many stubs, FW keeps the last stub. + layerStubs[kalmanLay].back() = stub; + } + } + } + + // iterate using state->nextLayer() to determine next Kalman layer(s) to add stubs from + const unsigned int maxIterations = 6; // Increase if you want to allow 7 stubs per fitted track. + for (unsigned iteration = 0; iteration < maxIterations; iteration++) { + int combinations_per_iteration = 0; + + bool easy = (l1track3D.numStubs() < settings_->kalmanMaxStubsEasy()); + unsigned int kalmanMaxSkipLayers = + easy ? settings_->kalmanMaxSkipLayersEasy() : settings_->kalmanMaxSkipLayersHard(); + + // update each state from previous iteration (or seed) using stubs in next Kalman layer + vector::const_iterator i_state = prev_states.begin(); + for (; i_state != prev_states.end(); i_state++) { + const KalmanState *the_state = *i_state; + + unsigned int layer = the_state->nextLayer(); // Get KF layer where stubs to be searched for next + unsigned nSkipped = the_state->nSkippedLayers(); + + // If this layer is known to be dead, skip to the next layer (layer+1) + // The next_states_skipped will then look at layer+2 + // However, if there are stubs in this layer, then don't skip (e.g. our phi/eta boundaries might not line up exactly with a dead region) + // Continue to skip until you reach a functioning layer (or a layer with stubs) + unsigned nSkippedDeadLayers = 0; + unsigned nSkippedAmbiguousLayers = 0; + while (kfDeadLayers.find(layer) != kfDeadLayers.end() && layerStubs[layer].size() == 0) { + layer += 1; + ++nSkippedDeadLayers; + } + while (this->kalmanAmbiguousLayer(etaReg, layer) && layerStubs[layer].size() == 0) { + layer += 1; + ++nSkippedAmbiguousLayers; + } + + // containers for updated state+stub combinations + vector next_states; + vector next_states_skipped; + + // find stubs for this layer + // (If layer > 6, this will return empty vector, so safe). + vector thislay_stubs = layerStubs[layer]; + + // find stubs for next layer if we skip a layer, except when we are on the penultimate layer, + // or we have exceeded the max skipped layers + vector nextlay_stubs; + + // If the next layer (layer+1) is a dead layer, then proceed to the layer after next (layer+2), if possible + // Also note if we need to increase "skipped" by one more for these states + unsigned nSkippedDeadLayers_nextStubs = 0; + unsigned nSkippedAmbiguousLayers_nextStubs = 0; + if (nSkipped < kalmanMaxSkipLayers) { + if (kfDeadLayers.find(layer + 1) != kfDeadLayers.end() && layerStubs[layer + 1].size() == 0) { + nextlay_stubs = layerStubs[layer + 2]; + nSkippedDeadLayers_nextStubs++; + } else if (this->kalmanAmbiguousLayer(etaReg, layer) && layerStubs[layer + 1].size() == 0) { + nextlay_stubs = layerStubs[layer + 2]; + nSkippedAmbiguousLayers_nextStubs++; + } else { + nextlay_stubs = layerStubs[layer + 1]; + } + } + + // If track was not rejected by isGoodState() is previous iteration, failure here usually means the tracker ran out of layers to explore. + // (Due to "kalmanLay" not having unique ID for each layer within a given eta sector). + if (settings_->kalmanDebugLevel() >= 2 && best_state_by_nstubs.size() == 0 && thislay_stubs.size() == 0 && + nextlay_stubs.size() == 0) + PrintL1trk() << "State is lost by start of iteration " << iteration + << " : #thislay_stubs=" << thislay_stubs.size() << " #nextlay_stubs=" << nextlay_stubs.size() + << " layer=" << layer << " eta=" << l1track3D.iEtaReg(); + + // If we skipped over a dead layer, only increment "nSkipped" after the stubs in next+1 layer have been obtained + nSkipped += nSkippedDeadLayers; + nSkipped += nSkippedAmbiguousLayers; + + // check to guarantee no fewer than 2PS hits per state at iteration 1 + // (iteration 0 will always include a PS hit, but iteration 1 could use 2S hits + // unless we include this) + if (iteration == 1 && !remove2PSCut) { + vector temp_thislaystubs; + vector temp_nextlaystubs; + for (auto stub : thislay_stubs) { + if (stub->psModule()) + temp_thislaystubs.push_back(stub); + } + for (auto stub : nextlay_stubs) { + if (stub->psModule()) + temp_nextlaystubs.push_back(stub); + } + thislay_stubs = temp_thislaystubs; + nextlay_stubs = temp_nextlaystubs; + } + + combinations_per_iteration += thislay_stubs.size() + nextlay_stubs.size(); + + // loop over each stub in this layer and check for compatibility with this state + for (unsigned i = 0; i < thislay_stubs.size(); i++) { + Stub *stub = thislay_stubs[i]; + + // Update helix params by adding this stub. + const KalmanState *new_state = kalmanUpdate(nSkipped, layer, stub, the_state, tpa); + + // Cut on track chi2, pt etc. + if (isGoodState(*new_state)) + next_states.push_back(new_state); + } + + // loop over each stub in next layer if we skip, and check for compatibility with this state + for (unsigned i = 0; i < nextlay_stubs.size(); i++) { + Stub *stub = nextlay_stubs[i]; + + const KalmanState *new_state = + kalmanUpdate(nSkipped + 1 + nSkippedDeadLayers_nextStubs + nSkippedAmbiguousLayers_nextStubs, + layer + 1 + nSkippedDeadLayers_nextStubs + nSkippedAmbiguousLayers_nextStubs, + stub, + the_state, + tpa); + + if (isGoodState(*new_state)) + next_states_skipped.push_back(new_state); + } + + // post Kalman filter local sorting per state + auto orderByChi2 = [](const KalmanState *a, const KalmanState *b) { + return bool(a->chi2scaled() < b->chi2scaled()); + }; + sort(next_states.begin(), next_states.end(), orderByChi2); + sort(next_states_skipped.begin(), next_states_skipped.end(), orderByChi2); + + new_states.insert(new_states.end(), next_states.begin(), next_states.end()); + new_states.insert(new_states.end(), next_states_skipped.begin(), next_states_skipped.end()); + /* + i = 0; + for (auto state : next_states) { + new_states.push_back(state); + i++; + } + + i = 0; + for (auto state : next_states_skipped) { + new_states.push_back(state); + i++; + } +*/ + } //end of state loop + + // copy new_states into prev_states for next iteration or end if we are on + // last iteration by clearing all states and making final state selection + + auto orderByMinSkipChi2 = [](const KalmanState *a, const KalmanState *b) { + return bool((a->chi2scaled()) * (a->nSkippedLayers() + 1) < (b->chi2scaled()) * (b->nSkippedLayers() + 1)); + }; + sort(new_states.begin(), new_states.end(), orderByMinSkipChi2); // Sort by chi2*(skippedLayers+1) + + unsigned int nStubs = iteration + 1; + // Success. We have at least one state that passes all cuts. Save best state found with this number of stubs. + if (nStubs >= settings_->kalmanMinNumStubs() && new_states.size() > 0) + best_state_by_nstubs[nStubs] = new_states[0]; + + if (nStubs == settings_->kalmanMaxNumStubs()) { + // We're done. + prev_states.clear(); + new_states.clear(); + + } else { + // Continue iterating. + prev_states = new_states; + new_states.clear(); + } + } + + if (best_state_by_nstubs.size()) { + // Select state with largest number of stubs. + finished_state = best_state_by_nstubs.begin()->second; // First element has largest number of stubs. + if (settings_->kalmanDebugLevel() >= 1) { + std::stringstream text; + text << std::fixed << std::setprecision(4); + text << "Track found! final state selection: nLay=" << finished_state->nStubLayers() + << " hitPattern=" << std::hex << finished_state->hitPattern() << std::dec + << " phiSec=" << l1track3D.iPhiSec() << " etaReg=" << l1track3D.iEtaReg() << " HT(m,c)=(" + << l1track3D.cellLocationHT().first << "," << l1track3D.cellLocationHT().second << ")"; + TVectorD y = trackParams(finished_state); + text << " q/pt=" << y[QOVERPT] << " tanL=" << y[T] << " z0=" << y[Z0] << " phi0=" << y[PHI0]; + if (nPar_ == 5) + text << " d0=" << y[D0]; + text << " chosen from states:"; + for (const auto &p : best_state_by_nstubs) + text << " " << p.second->chi2() << "/" << p.second->nStubLayers(); + PrintL1trk() << text.str(); + } + } else { + if (settings_->kalmanDebugLevel() >= 1) { + PrintL1trk() << "Track lost"; + } + } + + return finished_state; + } + + /*--- Update a helix state by adding a stub. */ + + const KalmanState *KFbase::kalmanUpdate( + unsigned nSkipped, unsigned int layer, Stub *stub, const KalmanState *state, const TP *tpa) { + if (settings_->kalmanDebugLevel() >= 4) { + PrintL1trk() << "---------------"; + PrintL1trk() << "kalmanUpdate"; + PrintL1trk() << "---------------"; + printStub(stub); + } + + numUpdateCalls_++; // For monitoring, count calls to updator per track. + + // Helix params & their covariance. + TVectorD vecX = state->vectorX(); + TMatrixD matC = state->matrixC(); + if (state->barrel() && !stub->barrel()) { + if (settings_->kalmanDebugLevel() >= 4) { + PrintL1trk() << "STATE BARREL TO ENDCAP BEFORE "; + PrintL1trk() << "state : " << vecX[0] << " " << vecX[1] << " " << vecX[2] << " " << vecX[3]; + PrintL1trk() << "cov(x): "; + matC.Print(); + } + if (settings_->kalmanDebugLevel() >= 4) { + PrintL1trk() << "STATE BARREL TO ENDCAP AFTER "; + PrintL1trk() << "state : " << vecX[0] << " " << vecX[1] << " " << vecX[2] << " " << vecX[3]; + PrintL1trk() << "cov(x): "; + matC.Print(); + } + } + // Matrix to propagate helix reference point from one layer to next. + TMatrixD matF = matrixF(stub, state); + TMatrixD matFtrans(TMatrixD::kTransposed, matF); + if (settings_->kalmanDebugLevel() >= 4) { + PrintL1trk() << "matF"; + matF.Print(); + } + + // Multiply matrices to get helix params relative to reference point at next layer. + TVectorD vecXref = matF * vecX; + if (settings_->kalmanDebugLevel() >= 4) { + PrintL1trk() << "vecFref = ["; + for (unsigned i = 0; i < nPar_; i++) + PrintL1trk() << vecXref[i] << ", "; + PrintL1trk() << "]"; + } + + // Get stub residuals. + TVectorD delta = residual(stub, vecXref, state->candidate().qOverPt()); + if (settings_->kalmanDebugLevel() >= 4) { + PrintL1trk() << "delta = " << delta[0] << ", " << delta[1]; + } + + // Derivative of predicted (phi,z) intercept with layer w.r.t. helix params. + TMatrixD matH = matrixH(stub); + if (settings_->kalmanDebugLevel() >= 4) { + PrintL1trk() << "matH"; + matH.Print(); + } + + if (settings_->kalmanDebugLevel() >= 4) { + PrintL1trk() << "previous state covariance"; + matC.Print(); + } + // Get scattering contribution to helix parameter covariance (currently zero). + TMatrixD matScat(nPar_, nPar_); + + // Get covariance on helix parameters at new reference point including scattering.. + TMatrixD matCref = matF * matC * matFtrans + matScat; + if (settings_->kalmanDebugLevel() >= 4) { + PrintL1trk() << "matCref"; + matCref.Print(); + } + // Get hit position covariance matrix. + TMatrixD matV = matrixV(stub, state); + if (settings_->kalmanDebugLevel() >= 4) { + PrintL1trk() << "matV"; + matV.Print(); + } + + TMatrixD matRinv = matrixRinv(matH, matCref, matV); + if (settings_->kalmanDebugLevel() >= 4) { + PrintL1trk() << "matRinv"; + matRinv.Print(); + } + + // Calculate Kalman Gain matrix. + TMatrixD matK = getKalmanGainMatrix(matH, matCref, matRinv); + if (settings_->kalmanDebugLevel() >= 4) { + PrintL1trk() << "matK"; + matK.Print(); + } + + // Update helix state & its covariance matrix with new stub. + TVectorD new_vecX(nPar_); + TMatrixD new_matC(nPar_, nPar_); + adjustState(matK, matCref, vecXref, matH, delta, new_vecX, new_matC); + + // Update track fit chi2 with new stub. + double new_chi2rphi = 0, new_chi2rz = 0; + this->adjustChi2(state, matRinv, delta, new_chi2rphi, new_chi2rz); + + if (settings_->kalmanDebugLevel() >= 4) { + if (nPar_ == 4) + PrintL1trk() << "adjusted x = " << new_vecX[0] << ", " << new_vecX[1] << ", " << new_vecX[2] << ", " + << new_vecX[3]; + else if (nPar_ == 5) + PrintL1trk() << "adjusted x = " << new_vecX[0] << ", " << new_vecX[1] << ", " << new_vecX[2] << ", " + << new_vecX[3] << ", " << new_vecX[4]; + PrintL1trk() << "adjusted C "; + new_matC.Print(); + PrintL1trk() << "adjust chi2rphi=" << new_chi2rphi << " chi2rz=" << new_chi2rz; + } + + const KalmanState *new_state = mkState( + state->candidate(), nSkipped, layer, state, new_vecX, new_matC, matK, matV, stub, new_chi2rphi, new_chi2rz); + + return new_state; + } + + /* Create a KalmanState, containing a helix state & next stub it is to be updated with. */ + + const KalmanState *KFbase::mkState(const L1track3D &candidate, + unsigned nSkipped, + unsigned layer, + const KalmanState *last_state, + const TVectorD &vecX, + const TMatrixD &matC, + const TMatrixD &matK, + const TMatrixD &matV, + Stub *stub, + double chi2rphi, + double chi2rz) { + auto new_state = std::make_unique( + settings_, candidate, nSkipped, layer, last_state, vecX, matC, matK, matV, stub, chi2rphi, chi2rz); + + const KalmanState *p_new_state = new_state.get(); + listAllStates_.push_back(std::move(new_state)); // Vector keeps ownership of all states. + return p_new_state; + } + + /* Product of H*C*H(transpose) (where C = helix covariance matrix) */ + + TMatrixD KFbase::matrixHCHt(const TMatrixD &matH, const TMatrixD &matC) const { + TMatrixD matHtrans(TMatrixD::kTransposed, matH); + return matH * matC * matHtrans; + } + + /* Get inverted Kalman R matrix: inverse(V + HCHt) */ + + TMatrixD KFbase::matrixRinv(const TMatrixD &matH, const TMatrixD &matCref, const TMatrixD &matV) const { + TMatrixD matHCHt = matrixHCHt(matH, matCref); + TMatrixD matR = matV + matHCHt; + TMatrixD matRinv(2, 2); + if (matR.Determinant() > 0) { + matRinv = TMatrixD(TMatrixD::kInverted, matR); + } else { + // Protection against rare maths instability. + const TMatrixD unitMatrix(TMatrixD::kUnit, TMatrixD(nPar_, nPar_)); + const double big = 9.9e9; + matRinv = big * unitMatrix; + } + if (settings_->kalmanDebugLevel() >= 4) { + PrintL1trk() << "matHCHt"; + matHCHt.Print(); + PrintL1trk() << "matR"; + matR.Print(); + } + return matRinv; + } + + /* Determine Kalman gain matrix K */ + + TMatrixD KFbase::getKalmanGainMatrix(const TMatrixD &matH, const TMatrixD &matCref, const TMatrixD &matRinv) const { + TMatrixD matHtrans(TMatrixD::kTransposed, matH); + TMatrixD matCrefht = matCref * matHtrans; + TMatrixD matK = matCrefht * matRinv; + return matK; + } + + /* Calculate stub residual w.r.t. helix */ + + TVectorD KFbase::residual(const Stub *stub, const TVectorD &vecX, double candQoverPt) const { + TVectorD vd = vectorM(stub); // Get (phi relative to sector, z) of hit. + TMatrixD h = matrixH(stub); + TVectorD hx = h * vecX; // Get intercept of helix with layer (linear approx). + TVectorD delta = vd - hx; + + // Calculate higher order corrections to residuals. + + if (not settings_->kalmanHOfw()) { + TVectorD correction(2); + + float inv2R = (settings_->invPtToInvR()) * 0.5 * candQoverPt; + float tanL = vecX[T]; + float z0 = vecX[Z0]; + + float deltaS = 0.; + if (settings_->kalmanHOhelixExp()) { + // Higher order correction correction to circle expansion for improved accuracy at low Pt. + double corr = stub->r() * inv2R; + + // N.B. In endcap 2S, this correction to correction[0] is exactly cancelled by the deltaS-dependent correction to it below. + correction[0] += (1. / 6.) * pow(corr, 3); + + deltaS = (1. / 6.) * (stub->r()) * pow(corr, 2); + correction[1] -= deltaS * tanL; + } + + if ((not stub->barrel()) && not(stub->psModule())) { + // These corrections rely on inside --> outside tracking, so r-z track params in 2S modules known. + float rShift = (stub->z() - z0) / tanL - stub->r(); + + if (settings_->kalmanHOhelixExp()) + rShift -= deltaS; + + if (settings_->kalmanHOprojZcorr() == 1) { + // Add correlation term related to conversion of stub residuals from (r,phi) to (z,phi). + correction[0] += inv2R * rShift; + } + + if (settings_->kalmanHOalpha() == 1) { + // Add alpha correction for non-radial 2S endcap strips.. + correction[0] += stub->alpha() * rShift; + } + } + + // Apply correction to residuals. + delta += correction; + } + + delta[0] = reco::deltaPhi(delta[0], 0.); + + return delta; + } + + /* Update helix state & its covariance matrix with new stub */ + + void KFbase::adjustState(const TMatrixD &matK, + const TMatrixD &matCref, + const TVectorD &vecXref, + const TMatrixD &matH, + const TVectorD &delta, + TVectorD &new_vecX, + TMatrixD &new_matC) const { + new_vecX = vecXref + matK * delta; + const TMatrixD unitMatrix(TMatrixD::kUnit, TMatrixD(nPar_, nPar_)); + TMatrixD tmp = unitMatrix - matK * matH; + new_matC = tmp * matCref; + } + + /* Update track fit chi2 with new stub */ + + void KFbase::adjustChi2(const KalmanState *state, + const TMatrixD &matRinv, + const TVectorD &delta, + double &chi2rphi, + double &chi2rz) const { + // Change in chi2 (with r-phi/r-z correlation term included in r-phi component) + double delChi2rphi = delta[PHI] * delta[PHI] * matRinv[PHI][PHI] + 2 * delta[PHI] * delta[Z] * matRinv[PHI][Z]; + double delChi2rz = delta[Z] * delta[Z] * matRinv[Z][Z]; + + if (settings_->kalmanDebugLevel() >= 4) { + PrintL1trk() << "delta(chi2rphi)=" << delChi2rphi << " delta(chi2rz)= " << delChi2rz; + } + chi2rphi = state->chi2rphi() + delChi2rphi; + chi2rz = state->chi2rz() + delChi2rz; + return; + } + + /* Reset internal data ready for next track. */ + + void KFbase::resetStates() { listAllStates_.clear(); } + + /* Get Kalman layer mapping (i.e. layer order in which stubs should be processed) */ + + unsigned int KFbase::kalmanLayer( + unsigned int iEtaReg, unsigned int layerIDreduced, bool barrel, float r, float z) const { + // index across is GP encoded layer ID (where barrel layers=1,2,7,5,4,3 & endcap wheels=3,4,5,6,7 & 0 never occurs) + // index down is eta reg + // element is kalman layer, where 7 is invalid + + // If stub with given GP encoded layer ID can have different KF layer ID depending on whether it + // is barrel or endcap, then in layerMap, the the barrel case is assumed. + // The endcap case is fixed by hand later in this function. + + const unsigned int nEta = 16; + const unsigned int nGPlayID = 7; + + if (nEta != numEtaRegions_) + throw cms::Exception("LogicError") + << "ERROR KFbase::getKalmanLayer hardwired value of nEta differs from NumEtaRegions cfg param"; + + // In cases where identical GP encoded layer ID present in this sector from both barrel & endcap, this array filled considering barrel. The endcap is fixed by subsequent code. + + constexpr unsigned layerMap[nEta / 2][nGPlayID + 1] = { + {7, 0, 1, 5, 4, 3, 7, 2}, // B1 B2 B3 B4 B5 B6 + {7, 0, 1, 5, 4, 3, 7, 2}, // B1 B2 B3 B4 B5 B6 + {7, 0, 1, 5, 4, 3, 7, 2}, // B1 B2 B3 B4 B5 B6 + {7, 0, 1, 5, 4, 3, 7, 2}, // B1 B2 B3 B4 B5 B6 + {7, 0, 1, 5, 4, 3, 7, 2}, // B1 B2 B3 B4(/D3) B5(/D2) B6(/D1) + + {7, 0, 1, 3, 4, 2, 6, 2}, // B1 B2 B3(/D5)+B4(/D3) D1 D2 X D4 -- current FW + //{ 7, 0, 1, 3, 4, 3, 6, 2 }, // B1 B2 B3(/D5) D1+B4(/D3) D2 X D4 -- for use with "Fix cases" below. + + {7, 0, 1, 1, 2, 3, 4, 5}, // B1 B2+D1 D2 D3 D5 D6 + + //{ 7, 0, 7, 1, 2, 3, 4, 5 }, // B1 D1 D2 D3 D4 D5 = current FW (or when Ambiguous function used) + {7, 0, 7, 0, 1, 2, 3, 4}, // Avoid effi loss for eta > 2.3 when Ambiguous function not used. + }; + + unsigned int kfEtaReg; // KF VHDL eta sector def: small in barrel & large in endcap. + if (iEtaReg < numEtaRegions_ / 2) { + kfEtaReg = numEtaRegions_ / 2 - 1 - iEtaReg; + } else { + kfEtaReg = iEtaReg - numEtaRegions_ / 2; + } + + unsigned int kalmanLay = layerMap[kfEtaReg][layerIDreduced]; + + // Fixes to endcap stubs, for cases where identical GP encoded layer ID present in this sector from both barrel & endcap. + + if (not barrel) { + switch (kfEtaReg) { + case 4: // B1 B2 B3 B4 B5/D1 B6/D2 D3 + if (layerIDreduced == 3) + kalmanLay = 4; + if (layerIDreduced == 4) + kalmanLay = 5; + if (layerIDreduced == 5) + kalmanLay = 6; + break; + //case 5: // B1 B2 B3+B4 D1 D2 D3 D4/D5 + case 5: // B1 B2 B3 D1+B4 D2 D3 D4/D5 + if (layerIDreduced == 5) + kalmanLay = 5; + if (layerIDreduced == 7) + kalmanLay = 6; + break; + default: + break; + } + } + + /* + // Fix cases where a barrel layer only partially crosses the eta sector. + // (Logically should work, but actually reduces efficiency). + + const float barrelHalfLength = 120.; + const float barrel4Radius = 68.8; + const float barrel5Radius = 86.1; + + if ( not barrel) { + switch ( kfEtaReg ) { + case 4: + if (layerIDreduced==3) { // D1 + float disk1_rCut = barrel5Radius*(std::abs(z)/barrelHalfLength); + if (r > disk1_rCut) kalmanLay++; + } + break; + case 5: + if (layerIDreduced==3) { // D1 + float disk1_rCut = barrel4Radius*(std::abs(z)/barrelHalfLength); + if (r > disk1_rCut) kalmanLay++; + } + if (layerIDreduced==4) { // D2 + float disk2_rCut = barrel4Radius*(std::abs(z)/barrelHalfLength); + if (r > disk2_rCut) kalmanLay++; + } + break; + default: + break; + } + } + */ + + return kalmanLay; + } + + /*=== Check if particles in given eta sector are uncertain to go through the given KF layer. */ + /*=== (If so, count layer for numbers of hit layers, but not for number of skipped layers). */ + + bool KFbase::kalmanAmbiguousLayer(unsigned int iEtaReg, unsigned int kfLayer) { + // Only helps in extreme forward sector, and there not significantly. + + /* + const unsigned int nEta = 16; + const unsigned int nKFlayer = 7; + constexpr bool ambiguityMap[nEta/2][nKFlayer] = + { + {false, false, false, false, false, false, false}, + {false, false, false, false, false, false, false}, + {false, false, false, false, false, false, false}, + {false, false, false, false, false, false, false}, + {false, false, false, false, false, false, false}, + {false, false, false, false, false, false, false}, + {false, false, false, false, false, false, false}, + {true , false, false, false, false, false, false}, + }; + + unsigned int kfEtaReg; // KF VHDL eta sector def: small in barrel & large in endcap. + if (iEtaReg < numEtaRegions_/2) { + kfEtaReg = numEtaRegions_/2 - 1 - iEtaReg; + } else { + kfEtaReg = iEtaReg - numEtaRegions_/2; + } + + bool ambiguous = ambiguityMap[kfEtaReg][kfLayer]; + */ + + bool ambiguous = false; + return ambiguous; + } + + /* Adjust KF algorithm to allow for any dead tracker layers */ + + set KFbase::kalmanDeadLayers(bool &remove2PSCut) const { + // Kill scenarios described StubKiller.cc + + // By which Stress Test scenario (if any) are dead modules being emulated? + const StubKiller::KillOptions killScenario = static_cast(settings_->killScenario()); + // Should TMTT tracking be modified to reduce efficiency loss due to dead modules? + const bool killRecover = settings_->killRecover(); + + set> deadLayers; // GP layer ID & boolean indicating if in barrel. + + if (killRecover) { + if (killScenario == StubKiller::KillOptions::layer5) { // barrel layer 5 + deadLayers.insert(pair(4, true)); + if (iEtaReg_ < 5 || iEtaReg_ > 8 || iPhiSec_ < 8 || iPhiSec_ > 11) { + deadLayers.clear(); + } + + } else if (killScenario == StubKiller::KillOptions::layer1) { // barrel layer 1 + deadLayers.insert(pair(1, true)); + if (iEtaReg_ > 8 || iPhiSec_ < 8 || iPhiSec_ > 11) { + deadLayers.clear(); + } + remove2PSCut = true; + } else if (killScenario == StubKiller::KillOptions::layer1layer2) { // barrel layers 1 & 2 + deadLayers.insert(pair(1, true)); + deadLayers.insert(pair(2, true)); + if (iEtaReg_ > 8 || iPhiSec_ < 8 || iPhiSec_ > 11) { + deadLayers.clear(); + } else if (iEtaReg_ < 1) { + deadLayers.insert(pair(0, true)); // What is this doing? + } + remove2PSCut = true; + } else if (killScenario == StubKiller::KillOptions::layer1disk1) { // barrel layer 1 & disk 1 + deadLayers.insert(pair(1, true)); + deadLayers.insert(pair(3, false)); + if (iEtaReg_ > 8 || iPhiSec_ < 8 || iPhiSec_ > 11) { + deadLayers.clear(); + } else if (iEtaReg_ > 3) { + deadLayers.insert(pair(0, true)); + } + remove2PSCut = true; + } + } + + set kfDeadLayers; + for (const auto &p : deadLayers) { + unsigned int layer = p.first; + bool barrel = p.second; + float r = 0.; // This fails for r-dependent parts of kalmanLayer(). FIX + float z = 999.; + unsigned int kalmanLay = this->kalmanLayer(iEtaReg_, layer, barrel, r, z); + kfDeadLayers.insert(kalmanLay); + } + + return kfDeadLayers; + } + + //=== Function to calculate approximation for tilted barrel modules (aka B) copied from Stub class. + + float KFbase::approxB(float z, float r) const { + return settings_->bApprox_gradient() * std::abs(z) / r + settings_->bApprox_intercept(); + } + + /* Print truth particle */ + + void KFbase::printTP(const TP *tp) const { + TVectorD tpParams(5); + bool useForAlgEff(false); + if (tp) { + useForAlgEff = tp->useForAlgEff(); + tpParams[QOVERPT] = tp->qOverPt(); + tpParams[PHI0] = tp->phi0(); + tpParams[Z0] = tp->z0(); + tpParams[T] = tp->tanLambda(); + tpParams[D0] = tp->d0(); + } + std::stringstream text; + text << std::fixed << std::setprecision(4); + if (tp) { + text << " TP index = " << tp->index() << " useForAlgEff = " << useForAlgEff << " "; + const string helixNames[5] = {"qOverPt", "phi0", "z0", "tanL", "d0"}; + for (int i = 0; i < tpParams.GetNrows(); i++) { + text << helixNames[i] << ":" << tpParams[i] << ", "; + } + text << " inv2R = " << tp->qOverPt() * settings_->invPtToInvR() * 0.5; + } else { + text << " Fake"; + } + PrintL1trk() << text.str(); + } + + /* Print tracker layers with stubs */ + + void KFbase::printStubLayers(const vector &stubs, unsigned int iEtaReg) const { + std::stringstream text; + text << std::fixed << std::setprecision(4); + if (stubs.size() == 0) + text << "stub layers = []\n"; + else { + text << "stub layers = [ "; + for (unsigned i = 0; i < stubs.size(); i++) { + text << stubs[i]->layerId(); + if (i != stubs.size() - 1) + text << ", "; + } + text << " ] "; + text << "KF stub layers = [ "; + for (unsigned j = 0; j < stubs.size(); j++) { + unsigned int kalmanLay = + this->kalmanLayer(iEtaReg, stubs[j]->layerIdReduced(), stubs[j]->barrel(), stubs[j]->r(), stubs[j]->z()); + text << kalmanLay; + if (j != stubs.size() - 1) + text << ", "; + } + text << " ]\n"; + } + PrintL1trk() << text.str(); + } + + /* Print a stub */ + + void KFbase::printStub(const Stub *stub) const { + std::stringstream text; + text << std::fixed << std::setprecision(4); + text << "stub "; + text << "index=" << stub->index() << " "; + text << "layerId=" << stub->layerId() << " "; + text << "r=" << stub->r() << " "; + text << "phi=" << stub->phi() << " "; + text << "z=" << stub->z() << " "; + text << "sigmaX=" << stub->sigmaPerp() << " "; + text << "sigmaZ=" << stub->sigmaPar() << " "; + text << "TPids="; + std::set tps = stub->assocTPs(); + for (auto tp : tps) + text << tp->index() << ","; + PrintL1trk() << text.str(); + } + + /* Print all stubs */ + + void KFbase::printStubs(const vector &stubs) const { + for (auto &stub : stubs) { + printStub(stub); + } + } + +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/KalmanState.cc b/L1Trigger/TrackFindingTMTT/src/KalmanState.cc index dfa43948fa084..a73140feb59bb 100644 --- a/L1Trigger/TrackFindingTMTT/src/KalmanState.cc +++ b/L1Trigger/TrackFindingTMTT/src/KalmanState.cc @@ -1,138 +1,118 @@ #include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" -#include "L1Trigger/TrackFindingTMTT/interface/StubCluster.h" -#include +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "TMatrixD.h" + +using namespace std; namespace tmtt { KalmanState::KalmanState() - : kLayerNext_(0), - layerId_(0), - xa_(0), - pxxa_(), - K_(), - dcov_(), - stubCluster_(0), + : settings_(nullptr), + kLayer_(0), + last_state_(nullptr), + stub_(nullptr), chi2rphi_(0), chi2rz_(0), - fitter_(0), - fXtoTrackParams_(0), barrel_(true), - n_skipped_(0) {} + nSkipped_(0), + hitPattern_(0) {} - KalmanState::KalmanState(const L1track3D &candidate, - unsigned n_skipped, - unsigned kLayer_next, - unsigned layerId, + KalmanState::KalmanState(const Settings *settings, + const L1track3D &candidate, + unsigned nSkipped, + int kLayer, const KalmanState *last_state, - const std::vector &x, - const TMatrixD &pxx, - const TMatrixD &K, - const TMatrixD &dcov, - const StubCluster *stubCluster, + const TVectorD &vecX, + const TMatrixD &matC, + const TMatrixD &matK, + const TMatrixD &matV, + Stub *stub, double chi2rphi, - double chi2rz, - L1KalmanComb *fitter, - GET_TRACK_PARAMS f) { - l1track3D_ = candidate; - n_skipped_ = n_skipped; - kLayerNext_ = kLayer_next; - layerId_ = layerId; - last_state_ = last_state; - xa_ = x; - pxxa_.Clear(); - pxxa_.ResizeTo(pxx.GetNrows(), pxx.GetNcols()); - pxxa_ = pxx; - K_.ResizeTo(K.GetNrows(), K.GetNcols()); - K_ = K; - dcov_.ResizeTo(dcov.GetNrows(), dcov.GetNcols()); - dcov_ = dcov; - stubCluster_ = stubCluster; - chi2rphi_ = chi2rphi; - chi2rz_ = chi2rz; - kalmanChi2RphiScale_ = fitter->getSettings()->kalmanChi2RphiScale(); + double chi2rz) + : settings_(settings), + kLayer_(kLayer), + last_state_(last_state), + vecX_(vecX), + stub_(stub), + chi2rphi_(chi2rphi), + chi2rz_(chi2rz), + nSkipped_(nSkipped), + l1track3D_(candidate) { + matC_.Clear(); + matC_.ResizeTo(matC.GetNrows(), matC.GetNcols()); + matC_ = matC; + matK_.ResizeTo(matK.GetNrows(), matK.GetNcols()); + matK_ = matK; + matV_.ResizeTo(matV.GetNrows(), matV.GetNcols()); + matV_ = matV; + kalmanChi2RphiScale_ = settings_->kalmanChi2RphiScale(); hitPattern_ = 0; if (last_state != nullptr) hitPattern_ = last_state->hitPattern(); // Bit encoded list of hit layers - if (stubCluster != nullptr) - hitPattern_ |= (1 << (stubCluster->layerKF())); - - // EJC CLANG complains about this line, - // const KalmanState *state = this; + if (stub != nullptr && kLayer_ >= 0) + hitPattern_ |= (1 << (kLayer_)); r_ = 0.1; z_ = 0; barrel_ = true; - endcapRing_ = 0; - if (stubCluster) { - r_ = stubCluster->r(); - z_ = stubCluster->z(); - barrel_ = stubCluster->barrel(); - endcapRing_ = stubCluster->endcapRing(); + if (stub != nullptr) { + r_ = stub->r(); + z_ = stub->z(); + barrel_ = stub->barrel(); } - n_stubs_ = kLayerNext_ - n_skipped_; - - fitter_ = fitter; - fXtoTrackParams_ = f; + n_stubs_ = 1 + kLayer_ - nSkipped_; } - KalmanState::KalmanState(const KalmanState &p) { - l1track3D_ = p.candidate(); - n_skipped_ = p.nSkippedLayers(); - kLayerNext_ = p.nextLayer(); - layerId_ = p.layerId(); - endcapRing_ = p.endcapRing(); - r_ = p.r(); - z_ = p.z(); - last_state_ = p.last_state(); - xa_ = p.xa(); - pxxa_ = p.pxxa(); - K_ = p.K(); - dcov_ = p.dcov(); - stubCluster_ = p.stubCluster(); - chi2rphi_ = p.chi2rphi(); - chi2rz_ = p.chi2rz(); - n_stubs_ = p.nStubLayers(); - fitter_ = p.fitter(); - fXtoTrackParams_ = p.fXtoTrackParams(); - barrel_ = p.barrel(); - } + KalmanState::KalmanState(const KalmanState &p) + : settings_(p.settings()), + kLayer_(p.layer()), + r_(p.r()), + z_(p.z()), + last_state_(p.last_state()), + vecX_(p.vectorX()), + matC_(p.matrixC()), + matK_(p.matrixK()), + matV_(p.matrixV()), + stub_(p.stub()), + chi2rphi_(p.chi2rphi()), + chi2rz_(p.chi2rz()), + n_stubs_(p.nStubLayers()), + barrel_(p.barrel()), + nSkipped_(p.nSkippedLayers()), + l1track3D_(p.candidate()) {} KalmanState &KalmanState::operator=(const KalmanState &other) { if (&other == this) return *this; - l1track3D_ = other.candidate(); - n_skipped_ = other.nSkippedLayers(); - kLayerNext_ = other.nextLayer(); - layerId_ = other.layerId(); - endcapRing_ = other.endcapRing(); + settings_ = other.settings(); + kLayer_ = other.layer(); r_ = other.r(); z_ = other.z(); last_state_ = other.last_state(); - xa_ = other.xa(); - pxxa_ = other.pxxa(); - K_ = other.K(); - dcov_ = other.dcov(); - stubCluster_ = other.stubCluster(); + vecX_ = other.vectorX(); + matC_ = other.matrixC(); + matK_ = other.matrixK(); + matV_ = other.matrixV(); + stub_ = other.stub(); chi2rphi_ = other.chi2rphi(); chi2rz_ = other.chi2rz(); n_stubs_ = other.nStubLayers(); - fitter_ = other.fitter(); - fXtoTrackParams_ = other.fXtoTrackParams(); barrel_ = other.barrel(); + nSkipped_ = other.nSkippedLayers(); + l1track3D_ = other.candidate(); return *this; } bool KalmanState::good(const TP *tp) const { const KalmanState *state = this; while (state) { - const StubCluster *stubCluster = state->stubCluster(); - if (stubCluster) { - set tps = stubCluster->assocTPs(); - + Stub *stub = state->stub(); + if (stub != nullptr) { + const set &tps = stub->assocTPs(); if (tps.find(tp) == tps.end()) return false; } @@ -142,8 +122,8 @@ namespace tmtt { } double KalmanState::reducedChi2() const { - if (2 * n_stubs_ - xa_.size() > 0) - return (this->chi2()) / (2 * n_stubs_ - xa_.size()); + if (2 * n_stubs_ - vecX_.GetNrows() > 0) + return (this->chi2()) / (2 * n_stubs_ - vecX_.GetNrows()); else return 0; } @@ -151,125 +131,25 @@ namespace tmtt { const KalmanState *KalmanState::last_update_state() const { const KalmanState *state = this; while (state) { - if (state->stubCluster()) + if (state->stub() != nullptr) return state; state = state->last_state(); } return 0; } - std::vector KalmanState::stubs() const { - std::vector all_stubs; + std::vector KalmanState::stubs() const { + std::vector all_stubs; const KalmanState *state = this; while (state) { - const StubCluster *stbcl = state->stubCluster(); - if (stbcl) { - std::vector stubs = stbcl->stubs(); - for (unsigned i = 0; i < stubs.size(); i++) { - all_stubs.push_back(stubs.at(i)); - } - } + Stub *stub = state->stub(); + if (stub != nullptr) + all_stubs.push_back(stub); state = state->last_state(); } std::reverse(all_stubs.begin(), all_stubs.end()); // Put innermost stub first. return all_stubs; } - bool KalmanState::order(const KalmanState *left, const KalmanState *right) { - return (left->nStubLayers() > right->nStubLayers()); - } - - bool KalmanState::orderMinSkipChi2(const KalmanState *left, const KalmanState *right) { - return (left->chi2scaled() * (left->nSkippedLayers() + 1) < right->chi2scaled() * (right->nSkippedLayers() + 1)); - } - - bool KalmanState::orderChi2(const KalmanState *left, const KalmanState *right) { - return (left->chi2scaled() < right->chi2scaled()); - } - - void KalmanState::dump(ostream &os, const TP *tp, bool all) const { - std::map tp_x; - bool useForAlgEff(false); - if (tp) { - useForAlgEff = tp->useForAlgEff(); - tp_x["qOverPt"] = tp->qOverPt(); - tp_x["phi0"] = tp->phi0(); - tp_x["z0"] = tp->z0(); - tp_x["t"] = tp->tanLambda(); - tp_x["d0"] = tp->d0(); - } - std::map y = fXtoTrackParams_(fitter_, this); - - os << "KalmanState : "; - os << "next Kalman layer = " << kLayerNext_ << ", "; - os << "layerId = " << layerId_ << ", "; - os << " n_skipped = " << n_skipped_ << ", "; - os << "barrel = " << barrel_ << ", "; - os << "endcapRing = " << endcapRing_ << ", "; - os << "r = " << r_ << ", "; - os << "z = " << z_ << ", "; - for (auto pair : y) { - os << pair.first << ":" << y[pair.first] << " "; - } - os << endl; - os << "xa = ( "; - for (unsigned i = 0; i < xa_.size() - 1; i++) - os << xa_[i] << ", "; - os << xa_.back() << " )" << endl; - - os << "xcov" << endl; - pxxa_.Print(); - os << " chi2rphi = " << chi2rphi_ << ", "; - os << " chi2rz = " << chi2rz_ << ", "; - os << " # of stublayers = " << n_stubs_ << endl; - std::vector stub_list = stubs(); - for (auto &stub : stub_list) { - os << " stub "; - // os << "[" << stub << "] "; - os << "index : " << stub->index() << " "; - os << "layerId : " << stub->layerId() << " "; - os << "[r,phi,z] = "; - os << "[" << stub->r() << ", " << stub->phi() << ", " << stub->z() << "] "; - os << " assoc TP indices = [ "; - std::set tps = stub->assocTPs(); - for (auto tp : tps) - os << tp->index() << " "; - os << "] "; - os << endl; - } - if (tp) { - os << "\tTP index = " << tp->index() << " useForAlgEff = " << useForAlgEff << " "; - os << "rel. residual "; - for (auto pair : tp_x) { - os << pair.first << ":" << (y[pair.first] - pair.second) / pair.second << " "; - } - } else { - os << "\tTP index = "; - } - os << endl; - - if (stubCluster_) { - os << "\tstub [r,phi,z] = "; - os << "[" << stubCluster_->r() << ", " << stubCluster_->phi() << ", " << stubCluster_->z() << "] "; - os << " assoc TP indices = [ "; - std::set tps = stubCluster_->assocTPs(); - for (auto tp : tps) - os << tp->index() << " "; - os << "] "; - } else { - os << "\tvirtual stub"; - } - os << endl; - - if (all) { - const KalmanState *state = last_state(); - if (state) { - state->dump(os, tp, all); - // state = state->last_state(); - } else - return; - } - } - } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/L1ChiSquared.cc b/L1Trigger/TrackFindingTMTT/src/L1ChiSquared.cc deleted file mode 100644 index 19599064191cf..0000000000000 --- a/L1Trigger/TrackFindingTMTT/src/L1ChiSquared.cc +++ /dev/null @@ -1,183 +0,0 @@ -///=== This is the base class for the linearised chi-squared track fit algorithms. - -///=== Written by: Sioni Summers and Alexander D. Morton - -#include "L1Trigger/TrackFindingTMTT/interface/L1ChiSquared.h" -#include "L1Trigger/TrackFindingTMTT/interface/Matrix.h" -#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" -#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" -#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" -#include "L1Trigger/TrackFindingTMTT/interface/Utility.h" - -#include -#include -#include - -namespace tmtt { - - template - std::vector operator-(const std::vector& a, const std::vector& b) { - assert(a.size() == b.size()); - std::vector result; - result.reserve(a.size()); - std::transform(a.begin(), a.end(), b.begin(), std::back_inserter(result), std::minus()); - return result; - } - - L1ChiSquared::L1ChiSquared(const Settings* settings, const uint nPar) : TrackFitGeneric(settings), chiSq_(0.0) { - // Bad stub killing settings - numFittingIterations_ = getSettings()->numTrackFitIterations(); - killTrackFitWorstHit_ = getSettings()->killTrackFitWorstHit(); - generalResidualCut_ = - getSettings()->generalResidualCut(); // The cut used to remove bad stubs (if nStubs > minLayers) - killingResidualCut_ = getSettings()->killingResidualCut(); // The cut used to kill off tracks entirely - - //--- These two parameters are used to check if after the fit, there are still enough stubs on the track - minStubLayers_ = getSettings()->minStubLayers(); - nPar_ = nPar; - } - - void L1ChiSquared::calculateChiSq(std::vector resids) { - chiSq_ = 0.0; - uint j = 0; - for (uint i = 0; i < stubs_.size(); i++) { - chiSq_ += resids[j] * resids[j] + resids[j + 1] * resids[j + 1]; - j = j + 2; - } - } - - void L1ChiSquared::calculateDeltaChiSq(std::vector delX, std::vector covX) { - for (uint i = 0; i < covX.size(); i++) { - chiSq_ += (-delX[i]) * covX[i]; - } - } - - L1fittedTrack L1ChiSquared::fit(const L1track3D& l1track3D) { - stubs_ = l1track3D.getStubs(); - - // Get cut on number of layers including variation due to dead sectors, pt dependence etc. - minStubLayersRed_ = Utility::numLayerCut( - "FIT", getSettings(), l1track3D.iPhiSec(), l1track3D.iEtaReg(), fabs(l1track3D.qOverPt()), l1track3D.eta()); - - std::vector x = seed(l1track3D); - - Matrix d = D(x); - Matrix dtVinv = d.transpose() * Vinv(); - // Matrix M = dtVinv * d; - Matrix M = dtVinv * (dtVinv.transpose()); //TODO this match tracklet code, but not literature:w - - std::vector resids = residuals(x); - // std::cout << "resids.size(): " << resids.size() << std::endl; - std::vector deltaX = M.inverse() * dtVinv * resids; - x = x - deltaX; - std::vector covX = d.transpose() * Vinv() * resids; - - calculateChiSq(resids); - calculateDeltaChiSq(deltaX, covX); - resids = residuals(x); // update resids. - - for (int i = 1; i < numFittingIterations_ + 1; ++i) { - if (i > 1) { - /* - // Original buggy code of 18th April 2018 - if ( killTrackFitWorstHit_ && (largestresid_ > killingResidualCut_ || (largestresid_ > generalResidualCut_ && Utility::countLayers( getSettings(), stubs_ ) > minStubLayersRed_)) ) { - cout<<"RATS KILLED STUB "< "< "<debug() == 6) std::cout << __FILE__ " : Killed stub " << ilargestresid_ << "." << std::endl; - } - */ - - // IRT - Debugged code of 19th April 2018 - bool killWorstStub = false; - if (killTrackFitWorstHit_) { - if (largestresid_ > killingResidualCut_) { - killWorstStub = true; - } else if (largestresid_ > generalResidualCut_) { - std::vector stubsTmp = stubs_; - stubsTmp.erase(stubsTmp.begin() + ilargestresid_); - if (Utility::countLayers(getSettings(), stubsTmp) >= minStubLayersRed_) - killWorstStub = true; - } else { - // Get better apparent tracking performance by always killing worst stub until only 4 layers left. - if (Utility::countLayers(getSettings(), stubs_) > minStubLayersRed_) - killWorstStub = true; - } - } - - if (killWorstStub) { - stubs_.erase(stubs_.begin() + ilargestresid_); - if (getSettings()->debug() == 6) - std::cout << __FILE__ " : Killed stub " << ilargestresid_ << "." << std::endl; - - // Reject tracks with too many killed stubs & stop iterating. - unsigned int nLayers = Utility::countLayers(getSettings(), stubs_); // Count tracker layers with stubs - bool valid = nLayers >= minStubLayersRed_; - - if (!valid) { - const unsigned int hitPattern = 0; // FIX: Needs setting - return L1fittedTrack(getSettings(), - l1track3D, - stubs_, - hitPattern, - l1track3D.qOverPt(), - 0., - l1track3D.phi0(), - l1track3D.z0(), - l1track3D.tanLambda(), - 999999., - 4, - valid); - } - } - - d = D(x); // Calculate derivatives - dtVinv = d.transpose() * Vinv(); - M = dtVinv * (dtVinv.transpose()); - resids = residuals(x); // Calculate new residuals - std::vector deltaX = M.inverse() * dtVinv * resids; - x = x - deltaX; - std::vector covX = d.transpose() * Vinv() * resids; - resids = residuals(x); // update resids. - - calculateChiSq(resids); - calculateDeltaChiSq(deltaX, covX); - } - } - - std::map tp = convertParams(x); // tp = track params - - // Reject tracks with too many killed stubs - unsigned int nLayers = Utility::countLayers(getSettings(), stubs_); // Count tracker layers with stubs - bool valid4par = nLayers >= minStubLayersRed_; - - const unsigned int hitPattern = 0; // FIX: Needs setting - if (valid4par) { - return L1fittedTrack(getSettings(), - l1track3D, - stubs_, - hitPattern, - tp["qOverPt"], - 0, - tp["phi0"], - tp["z0"], - tp["t"], - chiSq_, - nPar_, - valid4par); - } else { - return L1fittedTrack(getSettings(), - l1track3D, - stubs_, - hitPattern, - l1track3D.qOverPt(), - 0., - l1track3D.phi0(), - l1track3D.z0(), - l1track3D.tanLambda(), - 999999., - 4, - valid4par); - } - } - -} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc b/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc deleted file mode 100644 index fd4b641325f2d..0000000000000 --- a/L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc +++ /dev/null @@ -1,1829 +0,0 @@ -///=== This is the base class for the Kalman Combinatorial Filter track fit algorithm. - -///=== Written by: S. Summers, K. Uchida, M. Pesaresi, I.Tomalin - -#include "L1Trigger/TrackFindingTMTT/interface/L1KalmanComb.h" -#include "L1Trigger/TrackFindingTMTT/interface/Utility.h" - -#include -#include -#include "L1Trigger/TrackFindingTMTT/interface/TP.h" -#include "L1Trigger/TrackFindingTMTT/interface/KalmanState.h" -#include "L1Trigger/TrackFindingTMTT/interface/StubCluster.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "CommonTools/UtilAlgos/interface/TFileService.h" -#include "DataFormats/Math/interface/deltaPhi.h" - -#include -#include -#include -#include -#include -//#define CKF_DEBUG -// Enable debug printout to pair with that in Histos.cc enabled by recalc_debug. -//#define RECALC_DEBUG - -// Enable merging of nearby stubs. -//#define MERGE_STUBS - -namespace tmtt { - - unsigned LayerId[16] = {1, 2, 3, 4, 5, 6, 11, 12, 13, 14, 15, 21, 22, 23, 24, 25}; - - static bool orderStubsByLayer(const Stub *a, const Stub *b) { return (a->layerId() < b->layerId()); } - -#ifdef MERGE_STUBS - static bool orderStubsByZ(const Stub *a, const Stub *b) { return (a->z() < b->z()); } - - static bool orderStubsByR(const Stub *a, const Stub *b) { return (a->r() < b->r()); } -#endif - - void L1KalmanComb::printTPSummary(std::ostream &os, const TP *tp, bool addReturn) const { - if (tp) { - os << "TP "; - // os << "addr=" << tp << " "; - os << "index=" << tp->index() << " "; - os << "qOverPt=" << tp->qOverPt() << " "; - os << "phi0=" << tp->phi0() << " "; - os << "z0=" << tp->z0() << " "; - os << "t=" << tp->tanLambda() << " "; - os << "d0=" << tp->d0(); - if (addReturn) - os << endl; - else - os << " | "; - } - } - - void L1KalmanComb::printTP(std::ostream &os, const TP *tp) const { - std::map tpParams; - bool useForAlgEff(false); - if (tp) { - useForAlgEff = tp->useForAlgEff(); - tpParams["qOverPt"] = tp->qOverPt(); - tpParams["phi0"] = tp->phi0(); - tpParams["z0"] = tp->z0(); - tpParams["t"] = tp->tanLambda(); - tpParams["d0"] = tp->d0(); - } - if (tp) { - os << " TP index = " << tp->index() << " useForAlgEff = " << useForAlgEff << " "; - for (auto pair : tpParams) { - os << pair.first << ":" << pair.second << ", "; - } - os << " inv2R = " << tp->qOverPt() * getSettings()->invPtToInvR() * 0.5; - } else { - os << " Fake"; - } - os << endl; - } - - void L1KalmanComb::printStubLayers(std::ostream &os, std::vector &stubs, unsigned int iEtaReg) const { - if (stubs.size() == 0) - os << "stub layers = []" << endl; - else { - os << "stub layers = [ "; - for (unsigned i = 0; i < stubs.size(); i++) { - os << stubs[i]->layerId(); - if (i != stubs.size() - 1) - os << ", "; - } - os << " ] "; - os << "KF stub layers = [ "; - for (unsigned j = 0; j < stubs.size(); j++) { - unsigned int kalmanLayer = - this->getKalmanLayer(iEtaReg, stubs[j]->layerIdReduced(), stubs[j]->barrel(), stubs[j]->r(), stubs[j]->z()); - os << kalmanLayer; - if (j != stubs.size() - 1) - os << ", "; - } - os << " ]" << endl; - } - } - - void L1KalmanComb::printStubCluster(std::ostream &os, const StubCluster *stubCluster, bool addReturn) const { - os << "stub: "; - // os << "addr=" << stub << " "; - os << "index=" << stubCluster->stubs()[0]->index() << " "; - os << "layer=" << stubCluster->layerId() << " "; - os << "ring=" << stubCluster->endcapRing() << " "; - os << "r=" << stubCluster->r() << " "; - os << "phi=" << stubCluster->phi() << " "; - os << "z=" << stubCluster->z() << " "; - os << "sigmaX=" << stubCluster->sigmaX() << " "; - os << "sigmaZ=" << stubCluster->sigmaZ() << " "; - os << "dphi_dr=" << stubCluster->dphi_dr() << " "; - os << "#stubs= " << stubCluster->nStubs() << " "; - os << "TPids="; - std::set tps = stubCluster->assocTPs(); - for (auto tp : tps) - os << tp->index() << ","; - if (addReturn) - os << endl; - else - os << " | "; - } - - void L1KalmanComb::printStubClusters(std::ostream &os, std::vector &stubClusters) const { - for (auto &stubcl : stubClusters) { - printStubCluster(os, stubcl); - } - } - - void L1KalmanComb::printStub(std::ostream &os, const Stub *stub, bool addReturn) const { - os << "stub "; - // os << "addr=" << stub << " "; - os << "index=" << stub->index() << " "; - os << "layerId=" << stub->layerId() << " "; - os << "endcapRing=" << stub->endcapRing() << " "; - os << "r=" << stub->r() << " "; - os << "phi=" << stub->phi() << " "; - os << "z=" << stub->z() << " "; - os << "sigmaX=" << stub->sigmaX() << " "; - os << "sigmaZ=" << stub->sigmaZ() << " "; - os << "TPids="; - std::set tps = stub->assocTPs(); - for (auto tp : tps) - os << tp->index() << ","; - if (addReturn) - os << endl; - else - os << " | "; - } - - void L1KalmanComb::printStubs(std::ostream &os, std::vector &stubs) const { - for (auto &stub : stubs) { - printStub(os, stub); - } - } - - //=== Get Kalman layer mapping (i.e. layer order in which stubs should be processed) - - unsigned int L1KalmanComb::getKalmanLayer( - unsigned int iEtaReg, unsigned int layerIDreduced, bool barrel, float r, float z) const { - // index across is GP encoded layer ID (where barrel layers=1,2,7,5,4,3 & endcap wheels=3,4,5,6,7 & 0 never occurs) - // index down is eta reg - // element is kalman layer, where 7 is invalid - - // If stub with given GP encoded layer ID can have different KF layer ID depending on whether it - // is barrel or endcap, then in layerMap, the the barrel case is assumed. - // The endcap case is fixed by hand later in this function. - - const unsigned int nEta = 16; - const unsigned int nGPlayID = 7; - - if (nEta != numEtaRegions_) - throw cms::Exception( - "ERROR L1KalmanComb::getKalmanLayer hardwired value of nEta differs from NumEtaRegions cfg param"); - - // In cases where identical GP encoded layer ID present in this sector from both barrel & endcap, this array filled considering barrel. The endcap is fixed by subsequent code. - - constexpr unsigned layerMap[nEta / 2][nGPlayID + 1] = { - {7, 0, 1, 5, 4, 3, 7, 2}, // B1 B2 B3 B4 B5 B6 - {7, 0, 1, 5, 4, 3, 7, 2}, // B1 B2 B3 B4 B5 B6 - {7, 0, 1, 5, 4, 3, 7, 2}, // B1 B2 B3 B4 B5 B6 - {7, 0, 1, 5, 4, 3, 7, 2}, // B1 B2 B3 B4 B5 B6 - {7, 0, 1, 5, 4, 3, 7, 2}, // B1 B2 B3 B4(/D3) B5(/D2) B6(/D1) - - {7, 0, 1, 3, 4, 2, 6, 2}, // B1 B2 B3(/D5)+B4(/D3) D1 D2 X D4 -- current FW - //{ 7, 0, 1, 3, 4, 3, 6, 2 }, // B1 B2 B3(/D5) D1+B4(/D3) D2 X D4 -- for use with "Fix cases" below. - - {7, 0, 1, 1, 2, 3, 4, 5}, // B1 B2+D1 D2 D3 D5 D6 - - //{ 7, 0, 7, 1, 2, 3, 4, 5 }, // B1 D1 D2 D3 D4 D5 = current FW (or when Ambiguous function used) - {7, 0, 7, 0, 1, 2, 3, 4}, // Avoid effi loss for eta > 2.3 when Ambiguous function not used. - }; - - unsigned int kfEtaReg; // KF VHDL eta sector def: small in barrel & large in endcap. - if (iEtaReg < numEtaRegions_ / 2) { - kfEtaReg = numEtaRegions_ / 2 - 1 - iEtaReg; - } else { - kfEtaReg = iEtaReg - numEtaRegions_ / 2; - } - - unsigned int kalmanLayer = layerMap[kfEtaReg][layerIDreduced]; - - // Fixes to endcap stubs, for cases where identical GP encoded layer ID present in this sector from both barrel & endcap. - - if (not barrel) { - switch (kfEtaReg) { - case 4: // B1 B2 B3 B4 B5/D1 B6/D2 D3 - if (layerIDreduced == 3) - kalmanLayer = 4; - if (layerIDreduced == 4) - kalmanLayer = 5; - if (layerIDreduced == 5) - kalmanLayer = 6; - break; - //case 5: // B1 B2 B3+B4 D1 D2 D3 D4/D5 - case 5: // B1 B2 B3 D1+B4 D2 D3 D4/D5 - if (layerIDreduced == 5) - kalmanLayer = 5; - if (layerIDreduced == 7) - kalmanLayer = 6; - break; - default: - break; - } - } - - /* - // Fix cases where a barrel layer only partially crosses the eta sector. - // (Logically should work, but actually reduces efficiency). - - const float barrelHalfLength = 120.; - const float barrel4Radius = 68.8; - const float barrel5Radius = 86.1; - - if ( not barrel) { - switch ( kfEtaReg ) { - case 4: - if (layerIDreduced==3) { // D1 - float disk1_rCut = barrel5Radius*(fabs(z)/barrelHalfLength); - if (r > disk1_rCut) kalmanLayer++; - } - break; - case 5: - if (layerIDreduced==3) { // D1 - float disk1_rCut = barrel4Radius*(fabs(z)/barrelHalfLength); - if (r > disk1_rCut) kalmanLayer++; - } - if (layerIDreduced==4) { // D2 - float disk2_rCut = barrel4Radius*(fabs(z)/barrelHalfLength); - if (r > disk2_rCut) kalmanLayer++; - } - break; - default: - break; - } - } - */ - - return kalmanLayer; - } - - //=== Check if particles in given eta sector are uncertain to go through the given KF layer. - //=== (If so, count layer for numbers of hit layers, but not for number of skipped layers). - - bool L1KalmanComb::getKalmanAmbiguousLayer(unsigned int iEtaReg, unsigned int kfLayer) { - // Only helps in extreme forward sector, and there not significantly. - - /* - const unsigned int nEta = 16; - const unsigned int nKFlayer = 7; - constexpr bool ambiguityMap[nEta/2][nKFlayer] = - { - {false, false, false, false, false, false, false}, - {false, false, false, false, false, false, false}, - {false, false, false, false, false, false, false}, - {false, false, false, false, false, false, false}, - {false, false, false, false, false, false, false}, - {false, false, false, false, false, false, false}, - {false, false, false, false, false, false, false}, - {true , false, false, false, false, false, false}, - }; - - unsigned int kfEtaReg; // KF VHDL eta sector def: small in barrel & large in endcap. - if (iEtaReg < numEtaRegions_/2) { - kfEtaReg = numEtaRegions_/2 - 1 - iEtaReg; - } else { - kfEtaReg = iEtaReg - numEtaRegions_/2; - } - - bool ambiguous = ambiguityMap[kfEtaReg][kfLayer]; - */ - - bool ambiguous = false; - return ambiguous; - } - - L1KalmanComb::L1KalmanComb(const Settings *settings, const uint nPar, const string &fitterName, const uint nMeas) - : TrackFitGeneric(settings, fitterName) { - nPar_ = nPar; - nMeas_ = nMeas; - numEtaRegions_ = settings->numEtaRegions(); - - hymin = vector(nPar_, -1); - hymax = vector(nPar_, 1); - hymin[0] = -0.05; - hymax[0] = +0.05; - hymin[1] = -3.2; - hymax[1] = +3.2; - hymin[2] = -20; - hymax[2] = +20; - hymin[3] = -6; - hymax[3] = +6; - if (nPar_ == 5) { - hymin[4] = -5; - hymax[4] = +5; - } - - hxmin = vector(nPar_, -1); - hxmax = vector(nPar_, 1); - - hddMeasmin = vector(2, -1e-3); - hddMeasmax = vector(2, 1e-3); - - hresmin = vector(2, -1e-2); - hresmax = vector(2, 1e-2); - - hxaxtmin = vector(nPar_, -1); - hxaxtmax = vector(nPar_, 1); - - hdxmin = vector(nPar_, -1); - hdxmax = vector(nPar_, 1); - - hchi2min = 0; - hchi2max = 50; - - maxNfitForDump_ = 10; - dump_ = false; - - iLastPhiSec_ = 999; - iLastEtaReg_ = 999; - } - - L1fittedTrack L1KalmanComb::fit(const L1track3D &l1track3D) { - iLastPhiSec_ = iCurrentPhiSec_; - iLastEtaReg_ = iCurrentEtaReg_; - iCurrentPhiSec_ = l1track3D.iPhiSec(); - iCurrentEtaReg_ = l1track3D.iEtaReg(); - resetStates(); - deleteStubClusters(); - numUpdateCalls_ = 0; - - // Get cut on number of layers including variation due to dead sectors, pt dependence etc. - minStubLayersRed_ = Utility::numLayerCut( - "FIT", getSettings(), l1track3D.iPhiSec(), l1track3D.iEtaReg(), fabs(l1track3D.qOverPt()), l1track3D.eta()); - - //TP - const TP *tpa(0); - if (l1track3D.getMatchedTP()) { - tpa = l1track3D.getMatchedTP(); - } - tpa_ = tpa; - - //dump flag - static std::atomic nthFit(0); - nthFit++; - if (getSettings()->kalmanDebugLevel() >= 3 && nthFit <= maxNfitForDump_) { - if (tpa) - dump_ = true; - else - dump_ = false; - } else - dump_ = false; - - //stub list from L1track3D, sorted in layer order - necessary for clustering only - std::vector stubs = l1track3D.getStubs(); - - sort(stubs.begin(), stubs.end(), orderStubsByLayer); // Unnecessary? - -#ifdef MERGE_STUBS - // Eliminate identical duplicate stubs. - for (unsigned i = 0; i < stubs.size(); i++) { - const Stub *stub_a = stubs.at(i); - for (unsigned j = i + 1; j < stubs.size(); j++) { - const Stub *stub_b = stubs.at(j); - if (stub_a->r() == stub_b->r() && stub_a->phi() == stub_b->phi() && stub_a->z() == stub_b->z()) { - stubs.erase(stubs.begin() + j); - if (getSettings()->kalmanFillInternalHists()) - hndupStub_->Fill(1); - j--; - } - } - } -#endif - - std::vector stubcls; - - for (unsigned j_layer = 0; j_layer < 16; j_layer++) { - std::vector layer_stubs; - for (unsigned i = 0; i < stubs.size(); i++) { - const Stub *stub = stubs.at(i); - if (stub->layerId() == LayerId[j_layer]) { - layer_stubs.push_back(stub); - } - } - -#ifdef MERGE_STUBS - if (LayerId[j_layer] < 10) - sort(layer_stubs.begin(), layer_stubs.end(), orderStubsByZ); // barrel - else - sort(layer_stubs.begin(), layer_stubs.end(), orderStubsByR); // endcap -#endif - - for (unsigned i = 0; i < layer_stubs.size(); i++) { // Stubs in single layer, ordered by z or r. - - std::vector stubs_for_cls; - stubs_for_cls.push_back(layer_stubs.at(i)); - -#ifdef MERGE_STUBS - while (layer_stubs.at(i) != layer_stubs.back()) { - if (isOverlap(layer_stubs.at(i), layer_stubs.at(i + 1), TYPE_NORMAL)) { - stubs_for_cls.push_back(layer_stubs.at(i + 1)); - if (getSettings()->kalmanFillInternalHists()) - hnmergeStub_->Fill(0); - i++; - } else - break; - } -#endif - - if (getSettings()->kalmanFillInternalHists()) { - if (tpa && tpa->useForAlgEff()) { - if (stubs_for_cls.size() > 1) { - std::set s_tps = stubs_for_cls.at(0)->assocTPs(); - if (s_tps.find(tpa) != s_tps.end()) { - const Stub *sa = stubs_for_cls.front(); - const Stub *sb = stubs_for_cls.back(); - - double drphi = fabs(sa->r() * reco::deltaPhi(sa->phi(), sectorPhi()) - - sb->r() * reco::deltaPhi(sb->phi(), sectorPhi())); - double dz = fabs(sa->z() - sb->z()); - double dr = fabs(sa->r() - sb->r()); - TString hname; - if (LayerId[j_layer] < 10) { - hname = Form("hBarrelStubMaxDistanceLayer%02d", LayerId[j_layer]); - - if (hBarrelStubMaxDistanceMap.find(hname) == hBarrelStubMaxDistanceMap.end()) { - cout << hname << " does not exist." << endl; - } else { - hBarrelStubMaxDistanceMap[hname]->Fill(drphi, dz); - } - } else { - hname = Form("hEndcapStubMaxDistanceRing%02d", sa->endcapRing()); - - if (hEndcapStubMaxDistanceMap.find(hname) == hEndcapStubMaxDistanceMap.end()) { - cout << hname << " does not exist." << endl; - } else { - hEndcapStubMaxDistanceMap[hname]->Fill(drphi, dr); - } - } - } - } - } - } - - // dl error now disabled - StubCluster *stbcl = new StubCluster(stubs_for_cls, sectorPhi(), 0); - stbcl_list_.push_back(stbcl); - stubcls.push_back(stbcl); - - if (getSettings()->kalmanFillInternalHists()) { - if (!stbcl->barrel()) { - TString hname = Form("hphiErrorRatioRing%d", stbcl->endcapRing()); - if (hphiErrorRatioMap.find(hname) == hphiErrorRatioMap.end()) { - cout << hname << " does not exist." << endl; - } else { - hphiErrorRatioMap[hname]->Fill(fabs(stbcl->deltai() + 0.5), fabs(stbcl->dphi_dr()) / stbcl->dphi_dl()); - } - } - } - } - } - if (getSettings()->kalmanFillInternalHists()) { - if (tpa && tpa->useForAlgEff()) { - hTrackEta_->Fill(tpa->eta()); - static thread_local set set_tp; - if (iCurrentPhiSec_ < iLastPhiSec_ && iCurrentEtaReg_ < iLastEtaReg_) - set_tp.clear(); - if (set_tp.find(tpa) == set_tp.end()) { - hUniqueTrackEta_->Fill(tpa->eta()); - } - set_tp.insert(tpa); - } - } - - //track information dump - if (getSettings()->kalmanDebugLevel() >= 1) { - std::cout << "===============================================================================" << endl; - std::cout << "Input track cand: [phiSec,etaReg]=[" << l1track3D.iPhiSec() << "," << l1track3D.iEtaReg() << "]"; - std::cout << " HT(m,c)=(" << l1track3D.getCellLocationHT().first << "," << l1track3D.getCellLocationHT().second - << ") q/pt=" << l1track3D.qOverPt() << " tanL=" << l1track3D.tanLambda() << " z0=" << l1track3D.z0() - << " phi0=" << l1track3D.phi0() << " nStubs=" << l1track3D.getNumStubs() << " d0=" << l1track3D.d0() - << std::endl; - if (not getSettings()->hybrid()) - printTP(cout, tpa); - if (getSettings()->kalmanDebugLevel() >= 2) { - printStubLayers(cout, stubs, l1track3D.iEtaReg()); - printStubClusters(cout, stubcls); - } - } - - //Kalman Filter - std::vector cands = doKF(l1track3D, stubcls, tpa); - - //return L1fittedTrk for the selected state (if KF produced one it was happy with). - if (cands.size()) { - const KalmanState *cand = cands[0]; - - //cout<<"Final KF candidate eta="<candidate().iEtaReg()<<" ns="<nSkippedLayers()<<" klid="<nextLayer()-1<<" n="<nStubLayers()< trackParams = getTrackParams(cand); - - L1fittedTrack returnTrk(getSettings(), - l1track3D, - cand->stubs(), - cand->hitPattern(), - trackParams["qOverPt"], - trackParams["d0"], - trackParams["phi0"], - trackParams["z0"], - trackParams["t"], - cand->chi2rphi(), - cand->chi2rz(), - nPar_, - true); - - bool consistentHLS = false; // No longer used - // if (this->isHLS()) { - // unsigned int mBinHelixHLS, cBinHelixHLS; - // cand->getHLSselect(mBinHelixHLS, cBinHelixHLS, consistentHLS); - // if( getSettings()->kalmanDebugLevel() >= 3 ){ - // // Check if (m,c) corresponding to helix params are correctly calculated by HLS code. - // bool HLS_OK = ((mBinHelixHLS == returnTrk.getCellLocationFit().first) && (cBinHelixHLS == returnTrk.getCellLocationFit().second)); - // if (not HLS_OK) std::cout<<"WARNING HLS mBinHelix disagrees with C++:" - // <<" (HLS,C++) m=("<isHLS() && nPar_ == 4) { - returnTrk.setInfoKF(cand->nSkippedLayers(), numUpdateCalls_, consistentHLS); - } else { - returnTrk.setInfoKF(cand->nSkippedLayers(), numUpdateCalls_); - } - - // If doing 5 parameter fit, optionally also calculate helix params & chi2 with beam-spot constraint applied, - // and store inside L1fittedTrack object. - if (getSettings()->kalmanAddBeamConstr()) { - if (nPar_ == 5) { - double chi2rphi_bcon = 0.; - std::map trackParams_bcon = getTrackParams_BeamConstr(cand, chi2rphi_bcon); - returnTrk.setBeamConstr(trackParams_bcon["qOverPt"], trackParams_bcon["phi0"], chi2rphi_bcon); - } - } - - // Fitted track params must lie in same sector as HT originally found track in. - if (!getSettings()->hybrid()) { // consistentSector() function not yet working for Hybrid. - - // Bodge to take into account digitisation in sector consistency check. - if (getSettings()->enableDigitize()) - returnTrk.digitizeTrack("KF4ParamsComb"); - - if (!returnTrk.consistentSector()) { - L1fittedTrack failedTrk(getSettings(), - l1track3D, - cand->stubs(), - cand->hitPattern(), - trackParams["qOverPt"], - trackParams["d0"], - trackParams["phi0"], - trackParams["z0"], - trackParams["t"], - cand->chi2rphi(), - cand->chi2rz(), - nPar_, - false); - if (this->isHLS() && nPar_ == 4) { - failedTrk.setInfoKF(cand->nSkippedLayers(), numUpdateCalls_, consistentHLS); - } else { - failedTrk.setInfoKF(cand->nSkippedLayers(), numUpdateCalls_); - } - if (getSettings()->kalmanDebugLevel() >= 1) - cout << "Track rejected by sector consistency test" << endl; - return failedTrk; - } - } - - //candidate dump - if (getSettings()->kalmanDebugLevel() >= 3) { - cout << "------------------------------------" << endl; - if (tpa && tpa->useForAlgEff()) { - cout << "TP for eff. : index " << tpa->index() << endl; - } - cout << "Candidate : " << endl; - if (tpa && tpa->useForAlgEff() && returnTrk.getPurity() != 1) { - cout << "The candidate is not pure" << endl; - } - cand->dump(cout, tpa, true); - cout << "------------------------------------" << endl; - } - - //fill histograms for the selected state with TP for algEff - if (getSettings()->kalmanFillInternalHists()) - fillCandHists(*cand, tpa); - - return returnTrk; - - } else { - if (getSettings()->kalmanDebugLevel() >= 1) { - bool goodTrack = (tpa && tpa->useForAlgEff()); // Matches truth particle. - if (goodTrack) { - // Debug printout for Mark to understand why tracks are lost. - - int tpin = tpa->index(); - cout << "TRACK LOST: eta=" << l1track3D.iEtaReg() << " pt=" << l1track3D.pt() << " tp=" << tpin << endl; - - for (auto stubCluster : stubcls) { - int kalmanLayer = this->getKalmanLayer(l1track3D.iEtaReg(), - stubCluster->layerIdReduced(), - stubCluster->barrel(), - stubCluster->r(), - stubCluster->z()); - cout << " Stub: lay_red=" << stubCluster->layerIdReduced() << " KFlay=" << kalmanLayer - << " r=" << stubCluster->r() << " z=" << stubCluster->z() << " assoc TPs ="; - std::vector stubs = stubCluster->stubs(); - for (auto stub : stubs) { - for (const TP *tp_i : stub->assocTPs()) - cout << " " << tp_i->index(); - cout << endl; - if (stub->assocTPs().size() == 0) - cout << " none" << endl; - } - } - cout << "---------------------" << endl; - /* - for( it_last = last_states.begin(); it_last != last_states.end(); it_last++ ){ - const KalmanState *state = *it_last; - - //std::map trackParams = getTrackParams(state); - //L1fittedTrack returnTrk(getSettings(), l1track3D, state->stubs(), state->hitPattern(), trackParams["qOverPt"], trackParams["d0"], trackParams["phi0"], trackParams["z0"], trackParams["t"], state->chi2rphi(), state->chi2rz(), nPar_, true); - - - std::vector sstubs = state->stubs(); - for( auto stub : sstubs ){ - - for (const TP* tp_i : stub->assocTPs()) { - cout<index()<r()<<" "<z()<<" "<nStubLayers()<kalmanDebugLevel() >= 3) { - if (tpa && tpa->useForAlgEff()) { - cout << "TP for eff. missed addr. index : " << tpa << " " << tpa->index() << endl; - printStubClusters(cout, stubcls); - printStubs(cout, stubs); - } - } - - L1fittedTrack returnTrk(getSettings(), - l1track3D, - l1track3D.getStubs(), - 0, - l1track3D.qOverPt(), - 0, - l1track3D.phi0(), - l1track3D.z0(), - l1track3D.tanLambda(), - 9999, - 9999, - nPar_, - false); - returnTrk.setInfoKF(0, numUpdateCalls_); - return returnTrk; - } - } - - std::vector L1KalmanComb::doKF(const L1track3D &l1track3D, - const std::vector &stubClusters, - const TP *tpa) { -#ifdef RECALC_DEBUG - cout << "FITTER new track: HT cell=(" << l1track3D.getCellLocationHT().first << "," - << l1track3D.getCellLocationHT().second << ")" << endl; -#endif - - // output container (contains 0 or 1 states). - std::vector finished_states; - - std::map> - best_state_by_nstubs; // Best state (if any) for each viable no. of stubs on track value. - - // seed helix params & their covariance. - std::vector x0 = seedx(l1track3D); - TMatrixD pxx0 = seedP(l1track3D); - TMatrixD K(nPar_, 2); - TMatrixD dcov(2, 2); - - const KalmanState *state0 = mkState(l1track3D, 0, 0, 0, nullptr, x0, pxx0, K, dcov, nullptr, 0, 0); - - if (getSettings()->kalmanFillInternalHists()) - fillSeedHists(state0, tpa); - - // internal containers - i.e. the state FIFO. Contains estimate of helix params in last/next layer, with multiple entries if there were multiple stubs, yielding multiple states. - std::vector new_states; - std::vector prev_states; - prev_states.push_back(state0); - - // arrange stubs into Kalman layers according to eta region - int etaReg = l1track3D.iEtaReg(); - std::map> layerStubs; - - // Get dead layers, if any. - // They are assumed to be idetnical to those defined in StubKiller.cc - bool remove2PSCut = getSettings()->kalmanRemove2PScut(); - set kalmanDeadLayers = getKalmanDeadLayers(remove2PSCut); - - for (auto stubCluster : stubClusters) { - // Get Kalman encoded layer ID for this stub. - int kalmanLayer = this->getKalmanLayer( - etaReg, stubCluster->layerIdReduced(), stubCluster->barrel(), stubCluster->r(), stubCluster->z()); - - if (kalmanLayer != 7) { - const_cast(stubCluster) - ->setLayerKF(kalmanLayer); // Ugly trick to store KF layer inside stub cluster. - if (layerStubs[kalmanLayer].size() < getSettings()->kalmanMaxStubsPerLayer()) { - layerStubs[kalmanLayer].push_back(stubCluster); - } else { - // If too many stubs, FW keeps the last stub. - layerStubs[kalmanLayer].back() = stubCluster; - } - } - } - - // iterate using state->nextLayer() to determine next Kalman layer(s) to add stubs from - const unsigned int maxIterations = 6; // Increase if you want to allow 7 stubs per fitted track. - for (unsigned iteration = 0; iteration < maxIterations; iteration++) { - int combinations_per_iteration = 0; - - bool easy = (l1track3D.getNumStubs() < getSettings()->kalmanMaxStubsEasy()); - unsigned int kalmanMaxSkipLayers = - easy ? getSettings()->kalmanMaxSkipLayersEasy() : getSettings()->kalmanMaxSkipLayersHard(); - - // update each state from previous iteration (or seed) using stubs in next Kalman layer - std::vector::const_iterator i_state = prev_states.begin(); - for (; i_state != prev_states.end(); i_state++) { - const KalmanState *the_state = *i_state; - - unsigned int layer = the_state->nextLayer(); - unsigned skipped = the_state->nSkippedLayers(); - - // If this layer is known to be dead, skip to the next layer (layer+1) - // The next_states_skipped will then look at layer+2 - // However, if there are stubs in this layer, then don't skip (e.g. our phi/eta boundaries might not line up exactly with a dead region) - // Continue to skip until you reach a functioning layer (or a layer with stubs) - unsigned nSkippedDeadLayers = 0; - unsigned nSkippedAmbiguousLayers = 0; - while (kalmanDeadLayers.find(layer) != kalmanDeadLayers.end() && layerStubs[layer].size() == 0) { - layer += 1; - ++nSkippedDeadLayers; - } - while (this->getKalmanAmbiguousLayer(etaReg, layer) && layerStubs[layer].size() == 0) { - layer += 1; - ++nSkippedAmbiguousLayers; - } - - // containers for updated state+stub combinations - std::vector next_states; - std::vector next_states_skipped; - - // find stubs for this layer - std::vector stubs = - layerStubs[layer]; // If layer > 6, this will return empty vector, so safe. - - // find stubs for next layer if we skip a layer, except when we are on the penultimate layer, - // or we have exceeded the max skipped layers - std::vector next_stubs; - - // If the next layer (layer+1) is a dead layer, then proceed to the layer after next (layer+2), if possible - // Also note if we need to increase "skipped" by one more for these states - unsigned nSkippedDeadLayers_nextStubs = 0; - unsigned nSkippedAmbiguousLayers_nextStubs = 0; - if (skipped < kalmanMaxSkipLayers) { - if (kalmanDeadLayers.find(layer + 1) != kalmanDeadLayers.end() && layerStubs[layer + 1].size() == 0) { - next_stubs = layerStubs[layer + 2]; - nSkippedDeadLayers_nextStubs++; - } else if (this->getKalmanAmbiguousLayer(etaReg, layer) && layerStubs[layer + 1].size() == 0) { - next_stubs = layerStubs[layer + 2]; - nSkippedAmbiguousLayers_nextStubs++; - } else { - next_stubs = layerStubs[layer + 1]; - } - } - - // If track was not rejected by isGoodState() is previous iteration, failure here usually means the tracker ran out of layers to explore. - // (Due to "kalmanLayer" not having unique ID for each layer within a given eta sector). - if (getSettings()->kalmanDebugLevel() >= 2 && best_state_by_nstubs.size() == 0 && stubs.size() == 0 && - next_stubs.size() == 0) - cout << "State is lost by start of iteration " << iteration << " : #stubs=" << stubs.size() - << " #next_stubs=" << next_stubs.size() << " layer=" << layer << " eta=" << l1track3D.iEtaReg() << endl; - - // If we skipped over a dead layer, only increment "skipped" after the stubs in next+1 layer have been obtained - skipped += nSkippedDeadLayers; - skipped += nSkippedAmbiguousLayers; - - // check to guarantee no fewer than 2PS hits per state at iteration 1 (r<60cm) - // iteration 0 will always include a PS hit, but iteration 1 could use 2S hits unless we include this - if (iteration == 1 && !remove2PSCut) { - std::vector temp_stubs; - std::vector temp_nextstubs; - for (auto stub : stubs) { - if (stub->r() < 60.0) - temp_stubs.push_back(stub); - } - for (auto stub : next_stubs) { - if (stub->r() < 60.0) - temp_nextstubs.push_back(stub); - } - stubs = temp_stubs; - next_stubs = temp_nextstubs; - } - - combinations_per_iteration += stubs.size() + next_stubs.size(); - - // loop over each stub in this layer and check for compatibility with this state - for (unsigned i = 0; i < stubs.size(); i++) { - const StubCluster *next_stubCluster = stubs[i]; - - // Update helix params by adding this stub. - const KalmanState *new_state = kalmanUpdate(skipped, layer + 1, next_stubCluster, *the_state, tpa); - - if (getSettings()->kalmanFillInternalHists()) - fillStepHists(tpa, iteration, new_state); - - // Cut on track chi2, pt etc. - if (isGoodState(*new_state)) - next_states.push_back(new_state); - } - - // loop over each stub in next layer if we skip, and check for compatibility with this state - for (unsigned i = 0; i < next_stubs.size(); i++) { - const StubCluster *next_stubCluster = next_stubs[i]; - - const KalmanState *new_state = - kalmanUpdate(skipped + 1 + nSkippedDeadLayers_nextStubs + nSkippedAmbiguousLayers_nextStubs, - layer + 2 + nSkippedDeadLayers_nextStubs + nSkippedAmbiguousLayers_nextStubs, - next_stubCluster, - *the_state, - tpa); - - if (getSettings()->kalmanFillInternalHists()) - fillStepHists(tpa, iteration, new_state); - - if (isGoodState(*new_state)) - next_states_skipped.push_back(new_state); - } - - // post Kalman filter local sorting per state - sort(next_states.begin(), next_states.end(), KalmanState::orderChi2); - sort(next_states_skipped.begin(), next_states_skipped.end(), KalmanState::orderChi2); - - int i, max_states, max_states_skip; - - // If layer contained several stubs, so several states now exist, select only the best ones. - // -- Disable this by setting to large values, as not used in latest KF firmware. - // (But not too big as this wastes CPU). - - switch (iteration) { - case 0: - max_states = 15; - max_states_skip = 15; - break; - case 1: - max_states = 15; - max_states_skip = 15; - break; - case 2: - max_states = 15; - max_states_skip = 15; - break; - case 3: - max_states = 15; - max_states_skip = 15; - break; - case 4: - max_states = 15; - max_states_skip = 15; - break; - case 5: - max_states = 15; - max_states_skip = 15; - break; - default: - max_states = 15; - max_states_skip = 15; - break; - } - - i = 0; - for (auto state : next_states) { - if (i < max_states) { - new_states.push_back(state); - } else { - break; - } - i++; - } - - i = 0; - for (auto state : next_states_skipped) { - if (i < max_states_skip) { - new_states.push_back(state); - } else { - break; - } - i++; - } - - } //end of state loop - - if (getSettings()->kalmanFillInternalHists()) { - TString hname = Form("hstubComb_itr%d", iteration); - if (hstubCombMap.find(hname) == hstubCombMap.end()) { - cout << hname << " does not exist." << endl; - } else { - hstubCombMap[hname]->Fill(combinations_per_iteration); - } - } - - // copy new_states into prev_states for next iteration or end if we are on - // last iteration by clearing all states and making final state selection - - sort(new_states.begin(), new_states.end(), KalmanState::orderMinSkipChi2); // Sort by chi2*(skippedLayers+1) - - unsigned int nStubs = iteration + 1; - // Success. We have at least one state that passes all cuts. Save best state found with this number of stubs. - if (nStubs >= getSettings()->kalmanMinNumStubs() && new_states.size() > 0) - best_state_by_nstubs[nStubs] = new_states[0]; - - //if ( getSettings()->kalmanDebugLevel() >= 1 && best_state_by_nstubs.size() == 0 && new_states.size() == 0) cout<<"Track is lost by end iteration "<chi2rphi(), best_state->chi2rz(), nPar_, true); - if (returnTrk.getNumMatchedLayers()>=4) { - //temp_states.push_back(best_state); - if(i==0) found = true; - if (!found) cout<<"Lost this cand "<chi2()<<" "<reducedChi2()<<" "<path()<<" chose instead "<chi2()<<" "<reducedChi2()<<" "<path()<second; // First element has largest number of stubs. - finished_states.push_back(stateFinal); - if (getSettings()->kalmanDebugLevel() >= 1) { - cout << "Track found! final state selection: nLay=" << stateFinal->nStubLayers() << " hitPattern=" << std::hex - << stateFinal->hitPattern() << std::dec << " phiSec=" << l1track3D.iPhiSec() - << " etaReg=" << l1track3D.iEtaReg() << " HT(m,c)=(" << l1track3D.getCellLocationHT().first << "," - << l1track3D.getCellLocationHT().second << ")"; - std::map y = getTrackParams(stateFinal); - cout << " q/pt=" << y["qOverPt"] << " tanL=" << y["t"] << " z0=" << y["z0"] << " phi0=" << y["phi0"]; - if (nPar_ == 5) - cout << " d0=" << y["d0"]; - cout << " chosen from states:"; - for (const auto &p : best_state_by_nstubs) - cout << " " << p.second->chi2() << "/" << p.second->nStubLayers(); - cout << endl; - } - } else { - if (getSettings()->kalmanDebugLevel() >= 1) { - cout << "Track lost" << endl; - } - } - - return finished_states; - } - - //--- Update a helix state by adding a stub. - //--- ("layer" is not the layer of the stub being added now, but rather the next layer that will be searched after this stub has been added). - - const KalmanState *L1KalmanComb::kalmanUpdate( - unsigned skipped, unsigned layer, const StubCluster *stubCluster, const KalmanState &state, const TP *tpa) { - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "---------------" << endl; - cout << "kalmanUpdate" << endl; - cout << "---------------" << endl; - printStubCluster(cout, stubCluster); - } - - numUpdateCalls_++; // For monitoring, count calls to updator per track. - - // Helix params & their covariance. - std::vector xa = state.xa(); - TMatrixD cov_xa = state.pxxa(); - if (state.barrel() && !stubCluster->barrel()) { - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "STATE BARREL TO ENDCAP BEFORE " << endl; - cout << "state : " << xa.at(0) << " " << xa.at(1) << " " << xa.at(2) << " " << xa.at(3) << endl; - cout << "cov(x): " << endl; - cov_xa.Print(); - } - barrelToEndcap(state.r(), stubCluster, xa, cov_xa); - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "STATE BARREL TO ENDCAP AFTER " << endl; - cout << "state : " << xa.at(0) << " " << xa.at(1) << " " << xa.at(2) << " " << xa.at(3) << endl; - cout << "cov(x): " << endl; - cov_xa.Print(); - } - } - // Matrix to propagate helix params from one layer to next (=identity matrix). - TMatrixD f = F(stubCluster, &state); - TMatrixD ft(TMatrixD::kTransposed, f); - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "f" << endl; - f.Print(); - cout << "ft" << endl; - ft.Print(); - } - - std::vector fx = Fx(f, xa); // Multiply matrices to get helix params at next layer. - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "fx = ["; - for (unsigned i = 0; i < nPar_; i++) - cout << fx.at(i) << ", "; - cout << "]" << endl; - } - - std::vector delta = residual(stubCluster, fx, state.candidate().qOverPt()); - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "delta = " << delta[0] << ", " << delta[1] << endl; - } - - // Derivative of predicted (phi,z) intercept with layer w.r.t. helix params. - TMatrixD h = H(stubCluster); - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "h" << endl; - h.Print(); - } - - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "previous state covariance" << endl; - cov_xa.Print(); - } - // Get contribution to helix parameter covariance from scattering (NOT USED). - TMatrixD pxxm = PxxModel(&state, stubCluster); - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "model xcov" << endl; - pxxm.Print(); - } - // Get covariance on helix parameters. - TMatrixD pxcov = f * cov_xa * ft + pxxm; - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "forcast xcov + model xcov" << endl; - pxcov.Print(); - } - // Get hit position covariance matrix. - TMatrixD dcov = PddMeas(stubCluster, &state); - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "dcov" << endl; - dcov.Print(); - } - // Calculate Kalman Gain matrix. - TMatrixD k = GetKalmanMatrix(h, pxcov, dcov); - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "k" << endl; - k.Print(); - } - - std::vector new_xa(nPar_); - TMatrixD new_pxxa; - GetAdjustedState(k, pxcov, fx, stubCluster, delta, new_xa, new_pxxa); - if (getSettings()->kalmanDebugLevel() >= 4) { - if (nPar_ == 4) - cout << "adjusted x = " << new_xa[0] << ", " << new_xa[1] << ", " << new_xa[2] << ", " << new_xa[3] << endl; - else if (nPar_ == 5) - cout << "adjusted x = " << new_xa[0] << ", " << new_xa[1] << ", " << new_xa[2] << ", " << new_xa[3] << ", " - << new_xa[4] << endl; - cout << "adjusted covx " << endl; - new_pxxa.Print(); - } - - const KalmanState *new_state = mkState( - state.candidate(), skipped, layer, stubCluster->layerId(), &state, new_xa, new_pxxa, k, dcov, stubCluster, 0, 0); - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "new state" << endl; - new_state->dump(cout, tpa); - } - - return new_state; - } - - void L1KalmanComb::calcChi2(const KalmanState &state, double &chi2rphi, double &chi2rz) const { - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "calcChi2 " << endl; - } - double deltaChi2rphi(0), deltaChi2rz(0); - - if (state.last_state()) { - const StubCluster *stubCluster = state.stubCluster(); - -#ifdef RECALC_DEBUG - unsigned int ID = (stubCluster != nullptr) ? stubCluster->stubs()[0]->index() : 99999; -#endif - - if (stubCluster) { - std::vector delta = - residual(stubCluster, state.last_state()->xa(), state.last_state()->candidate().qOverPt()); - TMatrixD dcov = PddMeas(stubCluster, &state); -#ifdef RECALC_DEBUG - cout << " FITTER SIGMA: rphi=" << 1000 * sqrt(dcov(0, 0)) << " rz=" << sqrt(dcov(1, 1)) << " ID=" << ID - << endl; -#endif - - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "dcov" << endl; - dcov.Print(); - cout << "xcov" << endl; - state.last_state()->pxxa().Print(); - } - TMatrixD h = H(stubCluster); - TMatrixD hxxh = HxxH(h, state.last_state()->pxxa()); - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "h" << endl; - h.Print(); - cout << "hxcovh" << endl; - hxxh.Print(); - } - TMatrixD covR = dcov + hxxh; - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "covR" << endl; - covR.Print(); - cout << "---" << endl; - cout << scientific << "delta = " << delta[0] << ", " << delta[1] << endl; - } - this->getDeltaChi2(covR, delta, false, deltaChi2rphi, deltaChi2rz); - } - chi2rphi = state.last_state()->chi2rphi() + deltaChi2rphi; - chi2rz = state.last_state()->chi2rz() + deltaChi2rz; -#ifdef RECALC_DEBUG - cout << " FITTER CHI2 UPDATE = " << (chi2rphi + chi2rz) << " delta chi2=" << (deltaChi2rphi + deltaChi2rz) - << " ID=" << ID << endl; -#endif - } - return; - } - - void L1KalmanComb::getDeltaChi2(const TMatrixD &dcov, - const std::vector &delta, - bool debug, - double &deltaChi2rphi, - double &deltaChi2rz) const { - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "dcov" << endl; - dcov.Print(); - } - - if (dcov.Determinant() == 0) { - deltaChi2rphi = 999; - deltaChi2rz = 999; - return; - }; - - TMatrixD dcovi(dcov); - dcovi.Invert(); - - // Change in chi2 (with r-phi/r-z correlation term included in r-phi component) - deltaChi2rphi = delta.at(0) * delta.at(0) * dcovi(0, 0) + 2 * delta.at(0) * delta.at(1) * dcovi(0, 1); - deltaChi2rz = delta.at(1) * delta.at(1) * dcovi(1, 1); - -#ifdef RECALC_DEBUG - cout << " FITTER DELTA CHI2: rphi=" << deltaCii2rphi << " rz=" << deltaChi2rz << endl; -#endif - - if (debug) { - cout << "CHI SQUARE OUTPUT" << endl; - cout << "cov" << endl; - dcov.Print(); - cout << "cov inv" << endl; - dcovi.Print(); - for (unsigned i = 0; i < delta.size(); i++) - cout << delta.at(i) << " "; - cout << endl; - } - return; - } - - std::map L1KalmanComb::getTrackParams(const L1KalmanComb *p, const KalmanState *state) { - return p->getTrackParams(state); - } - - std::vector L1KalmanComb::Hx(const TMatrixD &pH, const std::vector &x) const { - std::vector m((unsigned)pH.GetNrows(), 0); - if (pH.GetNcols() != (int)x.size()) { - cerr << "Hx() : H and x have different dimensions" << endl; - } else { - for (int i = 0; i < pH.GetNcols(); i++) { - for (int j = 0; j < pH.GetNrows(); j++) { - m.at(j) += pH(j, i) * x.at(i); - } - } - } - return m; - } - - std::vector L1KalmanComb::Fx(const TMatrixD &pF, const std::vector &x) const { return Hx(pF, x); } - - TMatrixD L1KalmanComb::HxxH(const TMatrixD &pH, const TMatrixD &xx) const { - int nd = (unsigned)pH.GetNrows(); - TMatrixD tmp(nd, nPar_); - TMatrixD mHxxH(nd, nd); - if (pH.GetNcols() != xx.GetNcols() || pH.GetNcols() != xx.GetNrows()) { - cerr << "HxxH() : H and xx have different dimensions" << endl; - } else { - for (int i = 0; i < pH.GetNrows(); i++) { - for (int j = 0; j < xx.GetNrows(); j++) { - for (int k = 0; k < xx.GetNcols(); k++) { - tmp(i, k) += pH(i, j) * xx(j, k); - } - } - } - for (int i = 0; i < tmp.GetNrows(); i++) { - for (int j = 0; j < pH.GetNcols(); j++) { - for (int k = 0; k < pH.GetNrows(); k++) { - mHxxH(i, k) += tmp(i, j) * pH(k, j); - } - } - } - } - return mHxxH; - } - - TMatrixD L1KalmanComb::GetKalmanMatrix(const TMatrixD &h, const TMatrixD &pxcov, const TMatrixD &dcov) const { - TMatrixD pxcovht(pxcov.GetNrows(), 2); - for (int i = 0; i < pxcov.GetNrows(); i++) { - for (int j = 0; j < pxcov.GetNcols(); j++) { - for (int k = 0; k < h.GetNrows(); k++) { - pxcovht(i, k) += pxcov(i, j) * h(k, j); - } - } - } - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "pxcovht" << endl; - pxcovht.Print(); - } - - TMatrixD tmp(dcov.GetNrows(), dcov.GetNcols()); - TMatrixD hxxh = HxxH(h, pxcov); - tmp = dcov + hxxh; - - if (getSettings()->kalmanDebugLevel() >= 4) { - cout << "hxxh" << endl; - hxxh.Print(); - cout << "dcov + hxxh " << endl; - tmp.Print(); - } - - TMatrixD K(pxcovht.GetNrows(), tmp.GetNcols()); - - if (tmp.Determinant() == 0) - return K; - tmp.Invert(); - - for (int i = 0; i < pxcovht.GetNrows(); i++) { - for (int j = 0; j < pxcovht.GetNcols(); j++) { - for (int k = 0; k < tmp.GetNcols(); k++) { - K(i, k) += pxcovht(i, j) * tmp(j, k); - } - } - } - return K; - } - - void L1KalmanComb::GetAdjustedState(const TMatrixD &K, - const TMatrixD &pxcov, - const std::vector &x, - const StubCluster *stubCluster, - const std::vector &delta, - std::vector &new_x, - TMatrixD &new_xcov) const { - TMatrixD h = H(stubCluster); - - for (int i = 0; i < K.GetNrows(); i++) { - new_x.at(i) = x.at(i); - for (int j = 0; j < K.GetNcols(); j++) { - new_x.at(i) += K(i, j) * delta.at(j); - } - } - - TMatrixD tmp(K.GetNrows(), h.GetNcols()); - for (int i = 0; i < K.GetNrows(); i++) { - tmp(i, i) = 1; - } - for (int i = 0; i < K.GetNrows(); i++) { - for (int j = 0; j < K.GetNcols(); j++) { - for (int k = 0; k < h.GetNcols(); k++) { - tmp(i, k) += -1 * K(i, j) * h(j, k); - } - } - } - new_xcov.Clear(); - new_xcov.ResizeTo(pxcov.GetNrows(), pxcov.GetNcols()); - for (int i = 0; i < tmp.GetNrows(); i++) { - for (int j = 0; j < tmp.GetNcols(); j++) { - for (int k = 0; k < pxcov.GetNcols(); k++) { - new_xcov(i, k) += tmp(i, j) * pxcov(j, k); - } - } - } - } - - void L1KalmanComb::resetStates() { - for (unsigned int i = 0; i < state_list_.size(); i++) { - delete state_list_.at(i); - } - state_list_.clear(); - } - - const KalmanState *L1KalmanComb::mkState(const L1track3D &candidate, - unsigned skipped, - unsigned layer, - unsigned layerId, - const KalmanState *last_state, - const std::vector &x, - const TMatrixD &pxx, - const TMatrixD &K, - const TMatrixD &dcov, - const StubCluster *stubCluster, - double chi2rphi, - double chi2rz) { - KalmanState *new_state = new KalmanState(candidate, - skipped, - layer, - layerId, - last_state, - x, - pxx, - K, - dcov, - stubCluster, - chi2rphi, - chi2rz, - this, - &getTrackParams); - - if (chi2rphi + chi2rz == 0) { - double new_state_chi2rphi = 0., new_state_chi2rz = 0.; - this->calcChi2(*new_state, new_state_chi2rphi, new_state_chi2rz); - new_state->setChi2(new_state_chi2rphi, new_state_chi2rz); - } - - state_list_.push_back(new_state); - return new_state; - } - - std::vector L1KalmanComb::residual(const StubCluster *stubCluster, - const std::vector &x, - double candQoverPt) const { - std::vector vd = d(stubCluster); // Get (phi relative to sector, z) of hit. - std::vector hx = - Hx(H(stubCluster), x); // Ditto for intercept of helix with layer, in linear approximation. - std::vector delta(2); - for (unsigned i = 0; i < 2; i++) - delta.at(i) = vd.at(i) - hx.at(i); - - // Calculate higher order corrections to residuals. - - if (not getSettings()->kalmanHOdodgy()) { - std::vector correction = {0., 0.}; - - float inv2R = (getSettings()->invPtToInvR()) * 0.5 * candQoverPt; // alternatively use x().at(0) - float tanL = x.at(2); - float z0 = x.at(3); - - float deltaS = 0.; - if (getSettings()->kalmanHOhelixExp()) { - // Higher order correction correction to circle expansion for improved accuracy at low Pt. - double corr = stubCluster->r() * inv2R; - - // N.B. In endcap 2S, this correction to correction[0] is exactly cancelled by the deltaS-dependent correction to it below. - correction[0] += (1. / 6.) * pow(corr, 3); - - deltaS = (1. / 6.) * (stubCluster->r()) * pow(corr, 2); - correction[1] -= deltaS * tanL; - } - - if ((not stubCluster->barrel()) && not(stubCluster->psModule())) { - // These corrections rely on inside --> outside tracking, so r-z track params in 2S modules known. - float rShift = (stubCluster->z() - z0) / tanL - stubCluster->r(); - - // The above calc of rShift is approximate, so optionally check it with MC truth. - // if (tpa_ != nullptr) rShift = (stubCluster->z() - tpa_->z0())/tpa_->tanLambda() - stubCluster->r(); - - if (getSettings()->kalmanHOhelixExp()) - rShift -= deltaS; - - if (getSettings()->kalmanHOprojZcorr() == 1) { - // Add correlation term related to conversion of stub residuals from (r,phi) to (z,phi). - correction[0] += inv2R * rShift; - } - - if (getSettings()->kalmanHOalpha() == 1) { - // Add alpha correction for non-radial 2S endcap strips.. - correction[0] += stubCluster->alpha() * rShift; - } - - //cout<<"ENDCAP 2S STUB: (r,z)=("<r()<<","<z()<<") r*delta="<r() * correction[0]<<" r*alphaCorr="<r() * stubCluster->alpha() * rShift<<" rShift="<kalmanFillInternalHists()) { - edm::Service fs_; - string dirName; - if (fitterName_.compare("") == 0) - dirName = "L1KalmanCombInternal"; - else - dirName = fitterName_ + "Internal"; - - TFileDirectory inputDir = fs_->mkdir(dirName.c_str()); - - TString hname; - hTrackEta_ = inputDir.make("hTrackEta", "Track #eta; #eta", 50, -2.5, 2.5); - hUniqueTrackEta_ = inputDir.make("hUniqueTrackEta", "Unique Track #eta; #eta", 50, -2.5, 2.5); - hndupStub_ = inputDir.make("hndupStub", "# of duplicated stubs", 1, 0, 1); - hnmergeStub_ = inputDir.make("hnmergeStub", "# of merged stubs", 1, 0, 1); - - for (unsigned j_layer = 0; j_layer < 6; j_layer++) { - hname = Form("hBarrelStubMaxDistanceLayer%02d", LayerId[j_layer]); - hBarrelStubMaxDistanceMap[hname] = - inputDir.make(hname, - Form("max distance of stubs in barrel Layer %02d; dr#phi; dz", LayerId[j_layer]), - 100, - 0, - 1., - 100, - 0, - 10); - } - - for (unsigned j_ecring = 1; j_ecring < 16; j_ecring++) { - hname = Form("hEndcapStubMaxDistanceRing%02d", j_ecring); - hEndcapStubMaxDistanceMap[hname] = inputDir.make( - hname, Form("max distance of stubs in endcap Ring %02d; dr#phi; dr", j_ecring), 100, 0, 1., 100, 0, 10); - hname = Form("hphiErrorRatioRing%d", j_ecring); - hphiErrorRatioMap[hname] = - inputDir.make(hname, - Form("; fabs( strip id - 0.5 x nStrips + 0.5 ); #delta #phi_{r} / #delta #phi_{l}"), - 508, - 0.0, - 508.0, - 50, - -0.5, - 49.5); - } - - float nbins(2002); - for (unsigned i = 0; i < nPar_; i++) { - hname = Form("hyt_%d", i); - hytMap[hname] = - inputDir.make(hname, Form("; true track parameter values %d", i), nbins, hymin[i], hymax[i]); - hname = Form("hy0_%d", i); - hy0Map[hname] = - inputDir.make(hname, Form("; after HT track parameter values %d", i), nbins, hymin[i], hymax[i]); - hname = Form("hyf_%d", i); - hyfMap[hname] = - inputDir.make(hname, Form("; after KF track parameter values %d", i), nbins, hymin[i], hymax[i]); - hname = Form("hx_%d", i); - hxMap[hname] = inputDir.make(hname, Form("; x values %d", i), nbins, hxmin[i], hxmax[i]); - } - - for (unsigned itr = 0; itr <= 5; itr++) { - hname = Form("hstubComb_itr%d", itr); - hstubCombMap[hname] = - inputDir.make(hname, Form("; #state+stub combinations, iteration %d ", itr), 100, 0., 100.); - - for (unsigned i = 0; i < nPar_; i++) { - for (unsigned j = 0; j <= i; j++) { - hname = Form("hxcov_itr%d_%d_%d", itr, i, j); - hxcovMap[hname] = - inputDir.make(hname, - Form("; state covariance adjusted values, iteration %d (%d,%d)", itr, i, j), - nbins, - -1 * hdxmin[i] * hdxmin[j], - hdxmax[i] * hdxmax[j]); - } - } - for (unsigned i = 0; i < nPar_; i++) { - for (unsigned j = 0; j < nMeas_; j++) { - hname = Form("hk_itr%d_%d_%d", itr, i, j); - hkMap[hname] = inputDir.make(hname, Form("; K(%d,%d), Iteration %d", i, j, itr), 200, -1., 1.); - } - } - for (unsigned i = 0; i < nMeas_; i++) { - hname = Form("hres_itr%d_%d", itr, i); - hresMap[hname] = inputDir.make( - hname, Form("; residual values, iteration %d (%d)", itr, i), nbins, hresmin[i], hresmax[i]); - for (unsigned j = 0; j <= i; j++) { - hname = Form("hmcov_itr%d_%d_%d", itr, i, j); - hmcovMap[hname] = - inputDir.make(hname, - Form("; measurement covariance values, iteration %d (%d,%d)", itr, i, j), - nbins, - -1 * hddMeasmin[i] * hddMeasmin[i], - hddMeasmax[i] * hddMeasmax[j]); - } - } - } - } - } - - void L1KalmanComb::fillCandHists(const KalmanState &state, const TP *tpa) { - if (tpa && tpa->useForAlgEff()) { - const KalmanState *the_state = &state; - while (the_state) { - if (the_state->stubCluster()) { - std::vector x = the_state->xa(); - for (unsigned i = 0; i < nPar_; i++) { - TString hname = Form("hx_%d", i); - if (hxMap.find(hname) == hxMap.end()) { - cout << hname << " does not exist." << endl; - } else - hxMap[hname]->Fill(x.at(i)); - } - } - the_state = the_state->last_state(); - } - - std::map mx = getTrackParams(&state); - std::vector vx(nPar_); - vx[0] = mx["qOverPt"]; - vx[1] = mx["phi0"]; - vx[2] = mx["z0"]; - vx[3] = mx["t"]; - if (nPar_ == 5) - vx[4] = mx["d0"]; - for (unsigned i = 0; i < nPar_; i++) { - TString hname = Form("hyf_%d", i); - if (hyfMap.find(hname) == hyfMap.end()) { - cout << hname << " does not exist." << endl; - } else - hyfMap[hname]->Fill(vx[i]); - } - } - } - - void L1KalmanComb::fillSeedHists(const KalmanState *state, const TP *tpa) { - std::vector x0 = state->xa(); - TMatrixD pxx0 = state->pxxa(); - //Histogram Fill : seed pxxa - for (unsigned i = 0; i < nPar_; i++) { - for (unsigned j = 0; j <= i; j++) { - TString hname = Form("hxcov_itr%d_%d_%d", 0, i, j); - if (hxcovMap.find(hname) == hxcovMap.end()) { - cout << hname << " does not exist." << endl; - } else - hxcovMap[hname]->Fill(pxx0(i, j)); - } - } - - if (tpa && tpa->useForAlgEff()) { - std::vector tpParams(nPar_); - tpParams[0] = tpa->qOverPt(); - tpParams[1] = tpa->phi0(); - tpParams[2] = tpa->z0(); - tpParams[3] = tpa->tanLambda(); - if (nPar_ == 5) - tpParams[4] = tpa->d0(); - for (unsigned i = 0; i < nPar_; i++) { - TString hname = Form("hyt_%d", i); - if (hytMap.find(hname) == hytMap.end()) { - cout << hname << " does not exist." << endl; - } else - hytMap[hname]->Fill(tpParams[i]); - } - //Histogram Fill : Seed state - std::map trackParams = getTrackParams(state); - std::vector trackParVec(nPar_); - trackParVec[0] = trackParams["qOverPt"]; - trackParVec[1] = trackParams["phi0"]; - trackParVec[2] = trackParams["z0"]; - trackParVec[3] = trackParams["t"]; - if (nPar_ == 5) - trackParVec[4] = trackParams["d0"]; - for (unsigned i = 0; i < nPar_; i++) { - TString hname = Form("hy0_%d", i); - if (hy0Map.find(hname) == hy0Map.end()) { - cout << hname << " does not exist." << endl; - } else - hy0Map[hname]->Fill(trackParVec[i]); - } - } - } - - void L1KalmanComb::fillStepHists(const TP *tpa, unsigned nItr, const KalmanState *new_state) { - unsigned path = 0; - - const std::vector &xa = new_state->xa(); - const StubCluster *stubCluster = new_state->stubCluster(); - const TMatrixD &pxxa = new_state->pxxa(); - - TString hname; - - for (unsigned i = 0; i < nPar_; i++) { - for (unsigned j = 0; j <= i; j++) { - hname = Form("hxcov_itr%d_%d_%d", nItr, i, j); - if (hxcovMap.find(hname) == hxcovMap.end()) { - cout << hname << " does not exist." << endl; - } else - hxcovMap[hname]->Fill(pxxa(i, j)); - } - } - for (unsigned i = 0; i < nPar_; i++) { - for (int j = 0; j < 2; j++) { - TString hname = Form("hk_itr%d_%d_%d", nItr, i, j); - if (hkMap.find(hname) == hkMap.end()) { - cout << hname << " does not exist." << endl; - } else - hkMap[hname]->Fill(new_state->K()(i, j)); - } - } - std::vector delta_new = residual(stubCluster, xa, new_state->candidate().qOverPt()); - for (unsigned int i = 0; i < delta_new.size(); i++) { - TString hname = Form("hres_itr%d_%d", nItr, i); - if (hresMap.find(hname) == hresMap.end()) { - cout << hname << " does not exist." << endl; - } else - hresMap[hname]->Fill(delta_new[i]); - } - for (int i = 0; i < 2; i++) { - for (int j = 0; j < i; j++) { - TString hname = Form("hmcov_itr%d_%d_%d", nItr, i, j); - if (hmcovMap.find(hname) == hmcovMap.end()) { - cout << hname << " does not exist." << endl; - } else - hmcovMap[hname]->Fill(new_state->dcov()(i, j)); - } - } - } - - void L1KalmanComb::deleteStubClusters() { - for (unsigned int i = 0; i < stbcl_list_.size(); i++) { - delete stbcl_list_.at(i); - } - stbcl_list_.clear(); - } - - double L1KalmanComb::DeltaRphiForClustering(unsigned layerId, unsigned endcapRing) { - constexpr double barrel_drphi[6] = {0.05, 0.04, 0.05, 0.12, 0.13, 0.19}; - if (layerId < 10) - return barrel_drphi[layerId - 1]; - - constexpr double ec_drphi[16] = { - 0.04, 0.05, 0.04, 0.06, 0.06, 0.04, 0.06, 0.07, 0.15, 0.08, 0.27, 0.08, 0.27, 0.12, 0.09}; - return ec_drphi[endcapRing - 1]; - }; - - double L1KalmanComb::DeltaRForClustering(unsigned endcapRing) { - constexpr double ec_dr[16] = { - 0.52, 0.56, 0.59, 0.86, 0.66, 0.47, 0.55, 0.72, 1.53, 1.10, 2.72, 0.91, 2.69, 0.67, 0.09}; - return ec_dr[endcapRing - 1]; - } - - bool L1KalmanComb::isOverlap(const Stub *a, const Stub *b, OVERLAP_TYPE type) { - std::set a_tps = a->assocTPs(); - std::set b_tps = b->assocTPs(); - double drphi = DeltaRphiForClustering(a->layerId(), a->endcapRing()); - double dr(0); - switch (type) { - case TYPE_NORMAL: - if (a->layerId() != b->layerId()) - return false; - - if (a->layerId() < 7) { - if (fabs(b->z() - a->z()) > 0.5 * b->stripLength() || - fabs(reco::deltaPhi(b->phi(), sectorPhi()) * b->r() - reco::deltaPhi(a->phi(), sectorPhi()) * a->r()) > - 0.5 * b->stripPitch()) - return false; - } else { - if (fabs(b->r() - a->r()) > 0.5 * b->stripLength() || - fabs(reco::deltaPhi(b->phi(), sectorPhi()) * b->r() - reco::deltaPhi(a->phi(), sectorPhi()) * a->r()) > - 0.5 * b->stripPitch()) - return false; - } - return true; - case TYPE_V2: - if (a->layerId() != b->layerId()) - return false; - - if (a->layerId() < 7) { - if (fabs(b->z() - a->z()) > 0.5 * b->stripLength() || - fabs(reco::deltaPhi(b->phi(), sectorPhi()) * b->r() - reco::deltaPhi(a->phi(), sectorPhi()) * a->r()) > - drphi) - return false; - } else { - dr = DeltaRForClustering(a->endcapRing()); - if (fabs(b->r() - a->r()) > dr || fabs(reco::deltaPhi(b->phi(), sectorPhi()) * b->r() - - reco::deltaPhi(a->phi(), sectorPhi()) * a->r()) > drphi) - return false; - } - return true; - - case TYPE_NOCLUSTERING: - return false; - - case TYPE_TP: - for (auto a_tp : a_tps) - if (b_tps.find(a_tp) != b_tps.end()) - return true; - return false; - default: - return false; - } - } - - set L1KalmanComb::getKalmanDeadLayers(bool &remove2PSCut) const { - // Kill scenarios described in https://github.com/EmyrClement/StubKiller/blob/master/README.md - - // By which Stress Test scenario (if any) are dead modules being emulated? - const unsigned int killScenario = getSettings()->killScenario(); - // Should TMTT tracking be modified to reduce efficiency loss due to dead modules? - const bool killRecover = getSettings()->killRecover(); - - set> deadLayers; // GP layer ID & boolean indicating if in barrel. - - if (killRecover) { - if (killScenario == 1) { // barrel layer 5 - deadLayers.insert(pair(4, true)); - if (iCurrentEtaReg_ < 5 || iCurrentEtaReg_ > 8 || iCurrentPhiSec_ < 8 || iCurrentPhiSec_ > 11) { - deadLayers.clear(); - } - - } else if (killScenario == 2) { // barrel layer 1 - deadLayers.insert(pair(1, true)); - if (iCurrentEtaReg_ > 8 || iCurrentPhiSec_ < 8 || iCurrentPhiSec_ > 11) { - deadLayers.clear(); - } - remove2PSCut = true; - } else if (killScenario == 3) { // barrel layers 1 & 2 - deadLayers.insert(pair(1, true)); - deadLayers.insert(pair(2, true)); - if (iCurrentEtaReg_ > 8 || iCurrentPhiSec_ < 8 || iCurrentPhiSec_ > 11) { - deadLayers.clear(); - } else if (iCurrentEtaReg_ < 1) { - deadLayers.insert(pair(0, true)); // What is this doing? - } - remove2PSCut = true; - } else if (killScenario == 4) { // barrel layer 1 & disk 1 - deadLayers.insert(pair(1, true)); - deadLayers.insert(pair(3, false)); - if (iCurrentEtaReg_ > 8 || iCurrentPhiSec_ < 8 || iCurrentPhiSec_ > 11) { - deadLayers.clear(); - } else if (iCurrentEtaReg_ > 3) { - deadLayers.insert(pair(0, true)); - } - remove2PSCut = true; - } - } - - set kalmanDeadLayers; - for (const auto &p : deadLayers) { - unsigned int layer = p.first; - bool barrel = p.second; - float r = 0.; // This fails for r-dependent parts of getKalmanLayer(). FIX - float z = 999.; - unsigned int kalmanLayer = this->getKalmanLayer(iCurrentEtaReg_, layer, barrel, r, z); - kalmanDeadLayers.insert(kalmanLayer); - } - - return kalmanDeadLayers; - } - - //=== Function to calculate approximation for tilted barrel modules (aka B) copied from Stub class. - - float L1KalmanComb::getApproxB(float z, float r) const { - return getSettings()->bApprox_gradient() * fabs(z) / r + getSettings()->bApprox_intercept(); - } - -} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/L1fittedTrack.cc b/L1Trigger/TrackFindingTMTT/src/L1fittedTrack.cc index 0da0c64d45625..96eeac6ed7b5e 100644 --- a/L1Trigger/TrackFindingTMTT/src/L1fittedTrack.cc +++ b/L1Trigger/TrackFindingTMTT/src/L1fittedTrack.cc @@ -1,109 +1,35 @@ #include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" +using namespace std; + namespace tmtt { + // Empty vector used to initialize rejected tracks. + const std::vector L1fittedTrack::noStubs_; + // Digitize track and degrade helix parameter resolution according to effect of digitisation. void L1fittedTrack::digitizeTrack(const string& fitterName) { if (settings_->enableDigitize()) { - if (!digitizedTrack_) { - digitizedTrack_ = true; - - bool consistent = this->consistentHTcell(); - bool consistentSect = this->consistentSector(); - int mbinhelix = int(this->getCellLocationFit().first) - floor(settings_->houghNbinsPt() / 2); - int cbinhelix = int(this->getCellLocationFit().second) - floor(settings_->houghNbinsPhi() / 2); - int mBinHT = int(this->getCellLocationHT().first) - floor(settings_->houghNbinsPt() / 2); - int cBinHT = int(this->getCellLocationHT().second) - floor(settings_->houghNbinsPhi() / 2); - - if (matchedTP_ != nullptr) { - digitalTrack_.init(fitterName, - nHelixParam_, - iPhiSec_, - iEtaReg_, - mBinHT, - cBinHT, - mbinhelix, - cbinhelix, - hitPattern_, - qOverPt_, - d0_, - phi0_, - tanLambda_, - z0_, - chi2rphi_, - chi2rz_, - qOverPt_bcon_, - phi0_bcon_, - chi2rphi_bcon_, - nLayers_, - consistent, - consistentSect, - this->accepted(), - matchedTP_->qOverPt(), - matchedTP_->d0(), - matchedTP_->phi0(), - matchedTP_->tanLambda(), - matchedTP_->z0(), - matchedTP_->eta(), - matchedTP_->index(), - matchedTP_->useForAlgEff(), - matchedTP_->useForEff(), - matchedTP_->pdgId()); - } else { - digitalTrack_.init(fitterName, - nHelixParam_, - iPhiSec_, - iEtaReg_, - mBinHT, - cBinHT, - mbinhelix, - cbinhelix, - hitPattern_, - qOverPt_, - d0_, - phi0_, - tanLambda_, - z0_, - chi2rphi_, - chi2rz_, - qOverPt_bcon_, - phi0_bcon_, - chi2rphi_bcon_, - nLayers_, - consistent, - consistentSect, - this->accepted(), - 0, - 0, - 0, - 0, - 0, - 0, - -1, - 0, - 0, - 0); - } - - // Digitize track - digitalTrack_.makeDigitalTrack(); + if (not digitalTrack_) { + // Create & run digitizer. + digitalTrack_ = std::make_shared(settings_, fitterName, this); // Convert digitized track params back to floating point with degraded resolution. - qOverPt_ = digitalTrack_.qOverPt(); + qOverPt_ = digitalTrack_->qOverPt(); if (nHelixParam_ == 5) - d0_ = digitalTrack_.d0(); - phi0_ = digitalTrack_.phi0(); - z0_ = digitalTrack_.z0(); - tanLambda_ = digitalTrack_.tanLambda(); - chi2rphi_ = digitalTrack_.chisquaredRphi(); - chi2rz_ = digitalTrack_.chisquaredRz(); + d0_ = digitalTrack_->d0(); + phi0_ = digitalTrack_->phi0(); + z0_ = digitalTrack_->z0(); + tanLambda_ = digitalTrack_->tanLambda(); + chi2rphi_ = digitalTrack_->chisquaredRphi(); + chi2rz_ = digitalTrack_->chisquaredRz(); // Ditto for beam-spot constrained values. if (nHelixParam_ == 5) { - qOverPt_bcon_ = digitalTrack_.qOverPt_bcon(); - phi0_bcon_ = digitalTrack_.phi0_bcon(); - chi2rphi_bcon_ = digitalTrack_.chisquaredRphi_bcon(); + qOverPt_bcon_ = digitalTrack_->qOverPt_bcon(); + phi0_bcon_ = digitalTrack_->phi0_bcon(); + chi2rphi_bcon_ = digitalTrack_->chisquaredRphi_bcon(); } // Recalculate consistency flag using updated helix params. diff --git a/L1Trigger/TrackFindingTMTT/src/Get3Dtracks.cc b/L1Trigger/TrackFindingTMTT/src/Make3Dtracks.cc similarity index 61% rename from L1Trigger/TrackFindingTMTT/src/Get3Dtracks.cc rename to L1Trigger/TrackFindingTMTT/src/Make3Dtracks.cc index 07d3ce3cfc420..3bf0eae7191c5 100644 --- a/L1Trigger/TrackFindingTMTT/src/Get3Dtracks.cc +++ b/L1Trigger/TrackFindingTMTT/src/Make3Dtracks.cc @@ -1,4 +1,4 @@ -#include "L1Trigger/TrackFindingTMTT/interface/Get3Dtracks.h" +#include "L1Trigger/TrackFindingTMTT/interface/Make3Dtracks.h" #include "L1Trigger/TrackFindingTMTT/interface/L1track2D.h" #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" @@ -13,39 +13,39 @@ namespace tmtt { //=== Initialization - void Get3Dtracks::init(const Settings* settings, - unsigned int iPhiSec, - unsigned int iEtaReg, - float etaMinSector, - float etaMaxSector, - float phiCentreSector) { - // Store config params & arguments. - settings_ = settings; - iPhiSec_ = iPhiSec; // Sector number - iEtaReg_ = iEtaReg; - etaMinSector_ = etaMinSector; // Range of eta sector - etaMaxSector_ = etaMaxSector; // Range of eta sector - phiCentreSector_ = phiCentreSector; // Centre of phi sector - - // Note if any fitters require an r-z track filter to be run. - runRZfilter_ = (settings->useRZfilter().size() > 0); - + Make3Dtracks::Make3Dtracks(const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float etaMinSector, + float etaMaxSector, + float phiCentreSector) + : // Store config params & arguments. + settings_(settings), + iPhiSec_(iPhiSec), // Sector number + iEtaReg_(iEtaReg), + etaMinSector_(etaMinSector), // Range of eta sector + etaMaxSector_(etaMaxSector), // Range of eta sector + phiCentreSector_(phiCentreSector), // Centre of phi sector + + // Note if any fitters require an r-z track filter to be run. + runRZfilter_(settings->useRZfilter().size() > 0) { // Initialize any track filters (e.g. r-z) run after the r-phi Hough transform. if (runRZfilter_) - rzFilter_.init(settings_, iPhiSec_, iEtaReg_, etaMinSector_, etaMaxSector_, phiCentreSector_); + rzFilter_ = + std::make_unique(settings_, iPhiSec_, iEtaReg_, etaMinSector_, etaMaxSector_, phiCentreSector_); } //=== Convert 2D tracks found by HT within the current sector to 3D tracks, without running any r-z track filter. //=== by adding a rough estimate of their r-z helix parameters. - void Get3Dtracks::makeUnfilteredTrks(const vector& vecTracksRphi) { + void Make3Dtracks::makeUnfilteredTrks(const list& vecTracksRphi) { vecTracks3D_unfiltered_.clear(); for (const L1track2D& trkRphi : vecTracksRphi) { - const vector& stubsOnTrkRphi = trkRphi.getStubs(); // stubs assigned to track + const vector& stubsOnTrkRphi = trkRphi.stubs(); // stubs assigned to track - float qOverPt = trkRphi.getHelix2D().first; - float phi0 = trkRphi.getHelix2D().second; + float qOverPt = trkRphi.helix2D().first; + float phi0 = trkRphi.helix2D().second; if (settings_->enableDigitize()) { // Centre of HT bin lies on boundary of two fitted track digi bins, so nudge slightly +ve (like FW) @@ -61,25 +61,18 @@ namespace tmtt { float z0 = 0.; float tan_lambda = 0.5 * (1 / tan(2 * atan(exp(-etaMinSector_))) + 1 / tan(2 * atan(exp(-etaMaxSector_)))); - // float etaCentreSector = 0.5*(etaMinSector_ + etaMaxSector_); - // float theta = 2. * atan(exp(-etaCentreSector)); - // tan_lambda = 1./tan(theta); - pair helixRz(z0, tan_lambda); // Create 3D track, by adding r-z helix params to 2D track L1track3D trk3D(settings_, stubsOnTrkRphi, - trkRphi.getCellLocationHT(), + trkRphi.cellLocationHT(), helixRphi, helixRz, iPhiSec_, iEtaReg_, trkRphi.optoLinkID(), trkRphi.mergedHTcell()); - // L1track3D trk3D(settings_, stubsOnTrkRphi, - // trkRphi.getCellLocationHT(), trkRphi.getHelix2D(), helixRz, - // iPhiSec_ , iEtaReg_ , trkRphi.optoLinkID(), trkRphi.mergedHTcell()); // Optionally use MC truth to eliminate all fake tracks & all incorrect stubs assigned to tracks // before doing fit (for debugging). @@ -96,13 +89,13 @@ namespace tmtt { //=== Make 3D tracks from the 2D tracks found by the HT within the current sector, by running the r-z track filter. //=== The r-z filter also adds an estimate of the r-z helix parameters to each track. - void Get3Dtracks::makeRZfilteredTrks(const vector& vecTracksRphi) { - vecTracks3D_rzFiltered_ = rzFilter_.filterTracks(vecTracksRphi); + void Make3Dtracks::makeRZfilteredTrks(const list& vecTracksRphi) { + vecTracks3D_rzFiltered_ = rzFilter_->filterTracks(vecTracksRphi); // Optionally use MC truth to eliminate all fake tracks & all incorrect stubs assigned to tracks // before doing fit (for debugging). if (settings_->trackFitCheat()) { - vector vecTracks3D_tmp; + list vecTracks3D_tmp; for (const L1track3D& trk : vecTracks3D_rzFiltered_) { L1track3D trk_tmp = trk; bool cheat_keep = trk_tmp.cheat(); @@ -117,15 +110,15 @@ namespace tmtt { //=== that are associated to the given tracking particle. //=== (If the vector is empty, then the tracking particle was not reconstructed in this sector). - vector Get3Dtracks::assocTrackCands3D(const TP& tp, bool rzFiltered) const { - const vector& allTracks3D = (rzFiltered) ? vecTracks3D_rzFiltered_ : vecTracks3D_unfiltered_; + vector Make3Dtracks::assocTrackCands3D(const TP& tp, bool rzFiltered) const { + const list& allTracks3D = (rzFiltered) ? vecTracks3D_rzFiltered_ : vecTracks3D_unfiltered_; vector assocRecoTrk; // Loop over track candidates, looking for those associated to given TP. for (const L1track3D& trk : allTracks3D) { - if (trk.getMatchedTP() != nullptr) { - if (trk.getMatchedTP()->index() == tp.index()) + if (trk.matchedTP() != nullptr) { + if (trk.matchedTP()->index() == tp.index()) assocRecoTrk.push_back(&trk); } } diff --git a/L1Trigger/TrackFindingTMTT/src/Matrix.cc b/L1Trigger/TrackFindingTMTT/src/Matrix.cc deleted file mode 100644 index 8ae632cdea527..0000000000000 --- a/L1Trigger/TrackFindingTMTT/src/Matrix.cc +++ /dev/null @@ -1,372 +0,0 @@ -/* --- -* Matrix class supporting common operations such as multiplication, inverse, determinant. -* Derived from: https://www.cs.rochester.edu/~brown/Crypto/assts/projects/adj.html -* and https://www.quantstart.com/articles/Matrix-Classes-in-C-The-Source-File -* --- */ - -#include "L1Trigger/TrackFindingTMTT/interface/Matrix.h" -#include "FWCore/Utilities/interface/Exception.h" -#include -#include - -namespace tmtt { - - // Parameter Constructor - template - Matrix::Matrix() { - mat.resize(0); - rows = 0; - cols = 0; - } - template - Matrix::Matrix(unsigned _rows, unsigned _cols, const T& _initial) { - mat.resize(_rows); - for (unsigned i = 0; i < mat.size(); i++) { - mat[i].resize(_cols, _initial); - } - rows = _rows; - cols = _cols; - } - - // Copy Constructor - template - Matrix::Matrix(const Matrix& rhs) { - mat = rhs.mat; - rows = rhs.get_rows(); - cols = rhs.get_cols(); - } - - // (Virtual) Destructor - template - Matrix::~Matrix() {} - - // Assignment Operator - template - Matrix& Matrix::operator=(const Matrix& rhs) { - if (&rhs == this) - return *this; - - unsigned new_rows = rhs.get_rows(); - unsigned new_cols = rhs.get_cols(); - - mat.resize(new_rows); - for (unsigned i = 0; i < mat.size(); i++) { - mat[i].resize(new_cols); - } - - for (unsigned i = 0; i < new_rows; i++) { - for (unsigned j = 0; j < new_cols; j++) { - mat[i][j] = rhs(i, j); - } - } - rows = new_rows; - cols = new_cols; - - return *this; - } - - // Addition of two matrices - template - Matrix Matrix::operator+(const Matrix& rhs) { - Matrix result(rows, cols, 0.0); - - for (unsigned i = 0; i < rows; i++) { - for (unsigned j = 0; j < cols; j++) { - result(i, j) = this->mat[i][j] + rhs(i, j); - } - } - - return result; - } - - // Cumulative addition of this matrix and another - template - Matrix& Matrix::operator+=(const Matrix& rhs) { - unsigned rows = rhs.get_rows(); - unsigned cols = rhs.get_cols(); - - for (unsigned i = 0; i < rows; i++) { - for (unsigned j = 0; j < cols; j++) { - this->mat[i][j] += rhs(i, j); - } - } - - return *this; - } - - // Subtraction of this matrix and another - template - Matrix Matrix::operator-(const Matrix& rhs) { - unsigned rows = rhs.get_rows(); - unsigned cols = rhs.get_cols(); - Matrix result(rows, cols, 0.0); - - for (unsigned i = 0; i < rows; i++) { - for (unsigned j = 0; j < cols; j++) { - result(i, j) = this->mat[i][j] - rhs(i, j); - } - } - - return result; - } - - // Cumulative subtraction of this matrix and another - template - Matrix& Matrix::operator-=(const Matrix& rhs) { - unsigned rows = rhs.get_rows(); - unsigned cols = rhs.get_cols(); - - for (unsigned i = 0; i < rows; i++) { - for (unsigned j = 0; j < cols; j++) { - this->mat[i][j] -= rhs(i, j); - } - } - - return *this; - } - - // Left multiplication of this matrix and another - template - Matrix Matrix::operator*(const Matrix& rhs) { - assert(this->cols == rhs.get_rows()); - unsigned rRows = rhs.get_rows(); - unsigned rCols = rhs.get_cols(); - unsigned lRows = this->rows; - unsigned lCols = this->cols; - Matrix result(lRows, rCols, 0.0); - for (unsigned i = 0; i < lRows; i++) { - for (unsigned j = 0; j < rCols; j++) { - for (unsigned k = 0; k < lCols; k++) { - result(i, j) += this->mat[i][k] * rhs.mat[k][j]; - } - } - } - return result; - } - - // Cumulative left multiplication of this matrix and another - template - Matrix& Matrix::operator*=(const Matrix& rhs) { - Matrix result = (*this) * rhs; - (*this) = result; - return *this; - } - - // Calculate a transpose of this matrix - template - Matrix Matrix::transpose() { - Matrix result(cols, rows, 0.0); - - for (unsigned i = 0; i < cols; i++) { - for (unsigned j = 0; j < rows; j++) { - result(i, j) = this->mat[j][i]; - } - } - - return result; - } - - // Recursively calculate the determinant - template - T Matrix::determinant() { - T det = 0; - if (rows < 1) { - std::cerr << "Can't have determinant of matrix with " << rows << " rows." << std::endl; - } else if (rows == 1) { - det = this->mat[0][0]; - } else if (rows == 2) { - det = this->mat[0][0] * this->mat[1][1] - this->mat[1][0] * this->mat[0][1]; - } else { - for (unsigned i = 0; i < rows; i++) { - Matrix m(rows - 1, cols - 1, 0); - for (unsigned j = 1; j < rows; j++) { - unsigned k = 0; - for (unsigned l = 0; l < rows; l++) { - if (l == i) - continue; - m(j - 1, k) = this->mat[j][l]; - k++; - } - } - T sign; - if ((i + 2) % 2 == 0) - sign = 1; - else - sign = -1; - det += sign * this->mat[0][i] * m.determinant(); - } - } - return (det); - } - - template - Matrix Matrix::cofactor() { - Matrix result(rows, cols, 0); - Matrix c(rows - 1, cols - 1, 0); - if (rows != cols) { - std::cerr << "Can only compute cofactor of square matrix." << std::endl; - return result; - } - for (unsigned j = 0; j < rows; j++) { - for (unsigned i = 0; i < rows; i++) { - unsigned i1 = 0; - for (unsigned ii = 0; ii < rows; ii++) { - if (ii == i) - continue; - unsigned j1 = 0; - for (unsigned jj = 0; jj < rows; jj++) { - if (jj == j) - continue; - c(i1, j1) = this->mat[ii][jj]; - j1++; - } - i1++; - } - - T det = c.determinant(); - T sign; - if ((i + j + 2) % 2 == 0) - sign = 1; - else - sign = -1; - result(i, j) = sign * det; - } - } - return result; - } - - template - Matrix Matrix::inverse() { - if (rows != cols) { - std::cerr << "Matrix: cannot invert matrix with " << rows << " rows and " << cols << "cols" << std::endl; - } - if (this->determinant() == 0) - std::cerr << "Matrix with 0 determinant has no inverse." << std::endl; - Matrix result = this->cofactor().transpose() / this->determinant(); - return result; - } - - // Matrix/scalar addition - template - Matrix Matrix::operator+(const T& rhs) { - Matrix result(rows, cols, 0.0); - - for (unsigned i = 0; i < rows; i++) { - for (unsigned j = 0; j < cols; j++) { - result(i, j) = this->mat[i][j] + rhs; - } - } - - return result; - } - - // Matrix/scalar subtraction - template - Matrix Matrix::operator-(const T& rhs) { - Matrix result(rows, cols, 0.0); - - for (unsigned i = 0; i < rows; i++) { - for (unsigned j = 0; j < cols; j++) { - result(i, j) = this->mat[i][j] - rhs; - } - } - - return result; - } - - // Matrix/scalar multiplication - template - Matrix Matrix::operator*(const T& rhs) { - Matrix result(rows, cols, 0.0); - - for (unsigned i = 0; i < rows; i++) { - for (unsigned j = 0; j < cols; j++) { - result(i, j) = this->mat[i][j] * rhs; - } - } - - return result; - } - - // Matrix/scalar division - template - Matrix Matrix::operator/(const T& rhs) { - Matrix result(rows, cols, 0.0); - - if (rhs == 0) - throw cms::Exception("Matrix.cc: Trying to divide (matrix/scalar) by zero"); - - for (unsigned i = 0; i < rows; i++) { - for (unsigned j = 0; j < cols; j++) { - result(i, j) = this->mat[i][j] / rhs; - } - } - - return result; - } - - // Multiply a matrix with a vector - template - std::vector Matrix::operator*(const std::vector& rhs) { - std::vector result(this->rows, 0.0); - - for (unsigned i = 0; i < rows; i++) { - for (unsigned j = 0; j < cols; j++) { - result[i] += this->mat[i][j] * rhs[j]; - } - } - - return result; - } - - // Obtain a vector of the diagonal elements - template - std::vector Matrix::diag_vec() { - std::vector result(rows, 0.0); - - for (unsigned i = 0; i < rows; i++) { - result[i] = this->mat[i][i]; - } - - return result; - } - - // Access the individual elements - template - T& Matrix::operator()(const unsigned& row, const unsigned& col) { - return this->mat[row][col]; - } - - // Access the individual elements (const) - template - const T& Matrix::operator()(const unsigned& row, const unsigned& col) const { - return this->mat[row][col]; - } - - // Get the number of rows of the matrix - template - unsigned Matrix::get_rows() const { - return this->rows; - } - - // Get the number of columns of the matrix - template - unsigned Matrix::get_cols() const { - return this->cols; - } - - template - void Matrix::print() { - for (unsigned i = 0; i < this->rows; i++) { - for (unsigned j = 0; j < this->cols; j++) { - std::cout << this->mat[i][j] << ", "; - } - std::cout << std::endl; - } - } - - template class Matrix; - template class Matrix; - template class Matrix; - -} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc b/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc index 5215bff2cfaea..64cbcef54f054 100644 --- a/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc +++ b/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc @@ -1,7 +1,8 @@ #include "L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h" #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/Sector.h" -#include +using namespace std; namespace tmtt { @@ -32,19 +33,16 @@ namespace tmtt { nHTlinksPerNonant_(0) { nMiniHTcells_ = miniHoughNbinsPt_ * miniHoughNbinsPhi_; - if (miniHoughLoadBalance_ > 0) { - if (muxOutputsHT_ == 3) { + if (miniHoughLoadBalance_ != 0) { + if (muxOutputsHT_ == 1) { // Multiplexer at output of HT enabled. nHTlinksPerNonant_ = busySectorMbinRanges_.size() - 1; - } else if (muxOutputsHT_ == 2) { - nHTlinksPerNonant_ = (busySectorMbinRanges_.size() - 1) * numPhiSecPerNon_; } else { - throw cms::Exception( - "MiniHTState: hard-wired MHT load balancing can't be enabled as assumes HT output MUX scheme >= 2"); + throw cms::Exception("BadConfig") << "MiniHTstage: Unknown MuxOutputsHT configuration option!"; } } } - void MiniHTstage::exec(matrix& mHtRphis) { + void MiniHTstage::exec(matrix>& mHtRphis) { for (unsigned int iPhiNon = 0; iPhiNon < numPhiNonants_; iPhiNon++) { map, unsigned int> numStubsPerLinkStage1; // Indices are ([link ID, MHT cell], #stubs). @@ -54,23 +52,22 @@ namespace tmtt { for (unsigned int iSecInNon = 0; iSecInNon < numPhiSecPerNon_; iSecInNon++) { unsigned int iPhiSec = iPhiNon * numPhiSecPerNon_ + iSecInNon; for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - Sector sector; - sector.init(settings_, iPhiSec, iEtaReg); + Sector sector(settings_, iPhiSec, iEtaReg); const float& phiCentre = sector.phiCentre(); - HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); - const vector& roughTracks = htRphi.trackCands2D(); - vector fineTracks; + HTrphi* htRphi = mHtRphis(iPhiSec, iEtaReg).get(); + const list& roughTracks = htRphi->trackCands2D(); + list fineTracks; for (const L1track2D& roughTrk : roughTracks) { float roughTrkPhi = reco::deltaPhi(roughTrk.phi0() - chosenRofPhi_ * invPtToDphi_ * roughTrk.qOverPt() - phiCentre, 0.); - const pair& cell = roughTrk.getCellLocationHT(); - const vector& stubs = roughTrk.getStubs(); + const pair& cell = roughTrk.cellLocationHT(); + const vector& stubs = roughTrk.stubs(); bool fineTrksFound = false; bool storeCoarseTrack = false; const unsigned int& link = roughTrk.optoLinkID(); - if (fabs(roughTrk.qOverPt()) < + if (std::abs(roughTrk.qOverPt()) < 1. / miniHoughMinPt_) { // Not worth using mini-HT at low Pt due to scattering. for (unsigned int mBin = 0; mBin < miniHoughNbinsPt_; mBin++) { @@ -80,32 +77,31 @@ namespace tmtt { float phiBin = reco::deltaPhi(roughTrkPhi - binSizePhiTrkAxis_ / 2. + (cBin + .5) * binSizePhiTrkAxis_ / settings_->miniHoughNbinsPhi(), 0.); - HTcell htCell; const bool mergedCell = false; // This represents mini cell. const bool miniHTcell = true; - htCell.init(settings_, - iPhiSec, - iEtaReg, - sector.etaMin(), - sector.etaMax(), - qOverPtBin, - cell.first + mBin, - mergedCell, - miniHTcell); + HTcell htCell(settings_, + iPhiSec, + iEtaReg, + sector.etaMin(), + sector.etaMax(), + qOverPtBin, + cell.first + mBin, + mergedCell, + miniHTcell); // Firmware doesn't use bend filter in MHT. htCell.disableBendFilter(); for (auto& stub : stubs) { // Ensure stubs are digitized with respect to the current phi sector. if (settings_->enableDigitize()) - (const_cast(stub))->digitizeForHTinput(iPhiSec); + stub->digitize(iPhiSec, Stub::DigiStage::HT); float phiStub = reco::deltaPhi( stub->phi() + invPtToDphi_ * qOverPtBin * (stub->r() - chosenRofPhi_) - phiCentre, 0.); float dPhi = reco::deltaPhi(phiBin - phiStub, 0.); float dPhiMax = binSizePhiTrkAxis_ / miniHoughNbinsPhi_ / 2. + invPtToDphi_ * binSizeQoverPtAxis_ / (float)miniHoughNbinsPt_ * - fabs(stub->r() - chosenRofPhi_) / 2.; - if (fabs(dPhi) <= fabs(reco::deltaPhi(dPhiMax, 0.))) + std::abs(stub->r() - chosenRofPhi_) / 2.; + if (std::abs(dPhi) <= std::abs(reco::deltaPhi(dPhiMax, 0.))) htCell.store(stub, sector.insideEtaSubSecs(stub)); } htCell.end(); @@ -121,16 +117,6 @@ namespace tmtt { settings_, htCell.stubs(), cellLocation, helix2D, iPhiSec, iEtaReg, trueLinkID, mergedCell); // Truncation due to output opto-link bandwidth. bool keep(true); - /* - pair encodedLink; - if (miniHoughLoadBalance_ > 0) { - encodedLink = pair(newererLink, mhtCell); - } else { - encodedLink = pair(newererLink, 0); - } - numStubsPerLink[ encodedLink ] += htCell.numStubs(); - if ( busySectorKill_ && numStubsPerLink[ encodedLink ] > busySectorNumStubs_ ) keep = false; - */ numStubsPerLink[trueLinkID] += htCell.numStubs(); if (busySectorKill_ && numStubsPerLink[trueLinkID] > busySectorNumStubs_) keep = false; @@ -148,7 +134,7 @@ namespace tmtt { } if (storeCoarseTrack || ((not fineTrksFound) && miniHoughDontKill_ && - fabs(roughTrk.qOverPt()) < 1. / miniHoughDontKillMinPt_)) { + std::abs(roughTrk.qOverPt()) < 1. / miniHoughDontKillMinPt_)) { // Keeping original track instead of mini-HTtracks. // Invent dummy miniHT cells so as to be able to reuse load balancing, trying all combinations to identify the least used link. pair bestCell = {0, 0}; @@ -156,7 +142,7 @@ namespace tmtt { for (unsigned int mBin = 0; mBin < miniHoughNbinsPt_; mBin++) { for (unsigned int cBin = 0; cBin < miniHoughNbinsPhi_; cBin++) { unsigned int testLinkID = linkIDLoadBalanced( - link, mBin, cBin, roughTrk.getNumStubs(), numStubsPerLinkStage1, numStubsPerLinkStage2, true); + link, mBin, cBin, roughTrk.numStubs(), numStubsPerLinkStage1, numStubsPerLinkStage2, true); if (numStubsPerLink[testLinkID] < bestNumStubsPerLink) { bestCell = {mBin, cBin}; bestNumStubsPerLink = numStubsPerLink[testLinkID]; @@ -168,22 +154,12 @@ namespace tmtt { unsigned int trueLinkID = linkIDLoadBalanced(link, bestCell.first, bestCell.second, - roughTrk.getNumStubs(), + roughTrk.numStubs(), numStubsPerLinkStage1, numStubsPerLinkStage2); bool keep(true); - /* - pair encodedLink; - if (miniHoughLoadBalance_ > 0) { - encodedLink = pair(link/nMiniHTcells_, link%nMiniHTcells_); - } else { - encodedLink = pair(link, 0); - } - numStubsPerLink[ encodedLink ] += roughTrk.getNumStubs(); - if ( busySectorKill_ && numStubsPerLink[ encodedLink ] > busySectorNumStubs_ ) keep = false; - */ - numStubsPerLink[trueLinkID] += roughTrk.getNumStubs(); + numStubsPerLink[trueLinkID] += roughTrk.numStubs(); if (busySectorKill_ && numStubsPerLink[trueLinkID] > busySectorNumStubs_) keep = false; if (keep) { @@ -193,7 +169,7 @@ namespace tmtt { } } // Replace all existing tracks inside HT array with new ones. - htRphi.replaceTrackCands2D(fineTracks); + htRphi->replaceTrackCands2D(fineTracks); } } } @@ -219,14 +195,16 @@ namespace tmtt { unsigned int newLink, newerLink, newererLink; - if (miniHoughLoadBalance_ >= 1) { + enum LoadBalancing { None = 0, Static = 1, Dynamic = 2 }; // Load balancing options + + if (miniHoughLoadBalance_ >= LoadBalancing::Static) { // Static load balancing, 4 -> 1, with each MHT cell sent to seperate output link. newLink = link % nSep; // newLink in range 0 to nSep-1. } else { newLink = link; } - if (miniHoughLoadBalance_ >= 2) { + if (miniHoughLoadBalance_ >= LoadBalancing::Dynamic) { // 2-stage dynamic load balancing amongst links corresponding to same MHT cell. // Dynamically mix pairs of neighbouring links. @@ -247,7 +225,6 @@ namespace tmtt { // Dynamically mix pairs of next-to-neighbouring links. unsigned int balancedLinkY = newerLink; - //unsigned int balancedLinkZ = (newerLink%4<=1) ? balancedLinkY + 2 : balancedLinkY - 2; unsigned int balancedLinkZ = (newerLink + 2) % nSep; pair encodedLinkY(balancedLinkY, mhtCell); @@ -265,7 +242,8 @@ namespace tmtt { newerLink = newLink; newererLink = newLink; } - unsigned int trueLinkID = (miniHoughLoadBalance_ > 0) ? nMiniHTcells_ * newererLink + mhtCell : newererLink; + unsigned int trueLinkID = + (miniHoughLoadBalance_ != LoadBalancing::None) ? nMiniHTcells_ * newererLink + mhtCell : newererLink; return trueLinkID; } diff --git a/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc b/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc index 20937fc1c034e..650f1e14617fc 100644 --- a/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc +++ b/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc @@ -1,16 +1,23 @@ - //--- Note that the word "link" appearing in the C++ or comments in this class actually corresponds //--- to a pair of links in the hardware. #include "L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h" #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h" #include "FWCore/Utilities/interface/Exception.h" -#include +#include +#include + +using namespace std; namespace tmtt { + namespace { + std::once_flag printOnce; + } + //=== Initialize constants from configuration parameters. MuxHToutputs::MuxHToutputs(const Settings* settings) @@ -28,21 +35,21 @@ namespace tmtt { { // Implemented MUX algorithm relies on same number of sectors per nonant. if (numPhiSectors_ % numPhiNonants_ != 0) - throw cms::Exception("MuxHToutputs: Number of phi sectors is not a multiple of number of nonants!"); + throw cms::Exception("BadConfig") + << "MuxHToutputs: Number of phi sectors is not a multiple of number of nonants!"; if (!busySectorUseMbinRanges_) - throw cms::Exception( - "MuxHToutputs: The implemented MUX algorithm requires you to be using the busySectorMbinRanges cfg option!"); + throw cms::Exception("BadConfig") << "MuxHToutputs: The implemented MUX algorithm requires you to be using the " + "busySectorMbinRanges cfg option!"; // Check that the MUX algorithm implemented in linkID() is not obviously wrong. this->sanityCheck(); - static std::atomic first = true; - if (first) { - first = false; - cout << "=== The R-PHI HT output is multiplexed onto " << this->numLinksPerNonant() - << " pairs of opto-links per nonant." << endl; - } + std::stringstream text; + text << "=== The R-PHI HT output is multiplexed onto " << this->numLinksPerNonant() + << " pairs of opto-links per nonant."; + std::call_once( + printOnce, [](string t) { PrintL1trk() << t; }, text.str()); } //=== Determine which tracks are transmitted on each HT output optical link, taking into account the multiplexing @@ -50,7 +57,7 @@ namespace tmtt { //=== to output all the tracks within the time-multiplexed period. //=== This function replaces the 2D track collection in the r-phi HT with the subset surviving the TM cut. - void MuxHToutputs::exec(matrix& mHtRphis) const { + void MuxHToutputs::exec(matrix>& mHtRphis) const { // As this loops over sectors in order of increasing sector number, this MUX algorithm always transmits tracks // from the lowest sector numbers on each link first. So the highest sector numbers are more likely to be // truncated by the TM period. The algorithm assumes that two or more m-bin ranges from the same sector will never @@ -64,18 +71,19 @@ namespace tmtt { unsigned int iPhiSec = iPhiNon * numPhiSecPerNon_ + iSecInNon; for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - HTrphi& htRphi = mHtRphis(iPhiSec, iEtaReg); // Get a mutable version of the r-phi HT. + HTrphi* htRphi = mHtRphis(iPhiSec, iEtaReg).get(); // Get a mutable version of the r-phi HT. - vector keptTracks; - vector tracks = htRphi.trackCands2D(); + list keptTracks; + const list& tracks = htRphi->trackCands2D(); - for (L1track2D& trk : tracks) { - unsigned int nStubs = trk.getNumStubs(); // #stubs on this track. - unsigned int mBinRange = htRphi.getMbinRange(trk); // Which m bin range is this track in? + for (const L1track2D& trk : tracks) { + L1track2D trkTmp = trk; + unsigned int nStubs = trkTmp.numStubs(); // #stubs on this track. + unsigned int mBinRange = htRphi->getMbinRange(trkTmp); // Which m bin range is this track in? // Get the output optical link corresponding to this sector & m-bin range. unsigned int link = this->linkID(iSecInNon, iEtaReg, mBinRange); // Make a note of opto-link number inside track object. - trk.setOptoLinkID(link); + trkTmp.setOptoLinkID(link); numStubsPerLink[link] += nStubs; // Check if this track can be output within the time-multiplexed period. @@ -83,11 +91,11 @@ namespace tmtt { // FIX: with 2 GeV threshold, this causes significant truncation. // Consider using one output link for each phi sector in nonant if (keep) - keptTracks.push_back(&trk); + keptTracks.push_back(trkTmp); } // Replace the collection of 2D tracks in the r-phi HT with the subset of them surviving the TM cut. - htRphi.replaceTrackCands2D(keptTracks); + htRphi->replaceTrackCands2D(keptTracks); } } } @@ -97,11 +105,9 @@ namespace tmtt { unsigned int MuxHToutputs::muxFactor() const { if (muxOutputsHT_ == 1) { - return 6; - } else if (muxOutputsHT_ == 2) { - return numEtaRegions_; - } else { return numEtaRegions_ * numPhiSecPerNon_; + } else { + throw cms::Exception("BadConfig") << "MuxHToutputs: Unknown MuxOutputsHT configuration option!"; } } @@ -111,59 +117,19 @@ namespace tmtt { unsigned int MuxHToutputs::linkID(unsigned int iSecInNon, unsigned int iEtaReg, unsigned int mBinRange) const { unsigned int link; - // This algorithm multiplexes tracks from different eta sectors onto the a single optical link. - if (muxOutputsHT_ == 1) { - //--- This is Mux used for the Dec. 2016 demonstrator. - - // Link 0 contains eta sectors 0, 3, 6, 9, 12 & 15, whilst Link 1 contains eta sectors 1, 4, 7, 10, 13 & 16 etc. - // The multiplexing is independent of the phi sector or m-bin range, except in that two tracks that - // differ in either of these quantities will always be sent to different Links. - - if (numEtaRegions_ == 18) { - link = iEtaReg % 3; // In range 0 to 2 - link += 3 * iSecInNon; // In range 0 to (3*numPhiSecPerNon - 1) - link += 3 * numPhiSecPerNon_ * mBinRange; // In range 0 to (3*numPhiSecsPerNon*numMbinRanges - 1) - } else { - throw cms::Exception("MuxHToutputs: MUX algorithm only implemented for 18 eta sectors!"); - } - - } else if (muxOutputsHT_ == 2) { - //--- This is the Mar. 2018 Mux for the transverse HT readout organised by m-bin. (Each phi sector & m bin range go to a different link). - - link = 0; - //link += iSecInNon; - //link += numPhiSecPerNon_ * mBinRange; - - // IRT - match firmware, taking into account that fw uses mBin = -mBin relative to sw. - // NOT NEEDED ANYMORE, AS NOW FW USES MBIN SAME SIGN AS Q/PT. - // unsigned int iCorr = (settings_->miniHTstage()) ? 1 : 0; - // Sign flip for FW using opposite - //link += (busySectorMbinRanges_.size() - iCorr) - mBinRange - 1; - link += mBinRange; - link += iSecInNon * (busySectorMbinRanges_.size() - 1); - - } else if (muxOutputsHT_ == 3) { //--- This is the Sept. 2019 Mux for the transverse HT readout organised by m-bin. (Each m bin in entire nonant goes to a different link). link = 0; - //link += iSecInNon; - //link += numPhiSecPerNon_ * mBinRange; - - // IRT - match firmware, taking into account that fw uses mBin = -mBin relative to sw. - // NOT NEEDED ANYMORE, AS NOW FW USES MBIN SAME SIGN AS Q/PT. - // unsigned int iCorr = (settings_->miniHTstage()) ? 1 : 0; - // Sign flip for FW using opposite - //link += (busySectorMbinRanges_.size() - iCorr) - mBinRange - 1; link += mBinRange; } else { - throw cms::Exception("MuxHToutputs: Unknown MuxOutputsHT configuration option!"); + throw cms::Exception("BadConfig") << "MuxHToutputs: Unknown MuxOutputsHT configuration option!"; } if (link >= this->numLinksPerNonant()) - throw cms::Exception("MuxHToutputs: Calculated link ID exceeded expected number of links! ") - << link << " " << this->numLinksPerNonant() << endl; + throw cms::Exception("LogicError") << "MuxHToutputs: Calculated link ID exceeded expected number of links! " + << link << " " << this->numLinksPerNonant(); return link; } @@ -171,12 +137,12 @@ namespace tmtt { void MuxHToutputs::sanityCheck() { if (numPhiSecPerNon_ * numEtaRegions_ % this->muxFactor() != 0) - throw cms::Exception("MuxHToutputs: Number of sectors per phi nonant is not a multiple of muxFactor()."); + throw cms::Exception("LogicError") + << "MuxHToutputs: Number of sectors per phi nonant is not a multiple of muxFactor()."; vector nObsElementsPerLink(this->numLinksPerNonant(), 0); for (unsigned int iSecInNon = 0; iSecInNon < numPhiSecPerNon_; iSecInNon++) { for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { - // IRT unsigned int iCorr = (settings_->miniHTstage()) ? 1 : 0; for (unsigned int mBinRange = 0; mBinRange < busySectorMbinRanges_.size() - iCorr; mBinRange++) { unsigned int link = this->linkID(iSecInNon, iEtaReg, mBinRange); @@ -184,11 +150,6 @@ namespace tmtt { } } } - for (const unsigned int& n : nObsElementsPerLink) { - // Assume good algorithms will distribute sectors & m-bin ranges equally across links. - // IRT - // if (n != this->muxFactor()) throw cms::Exception("MuxHToutputs: MUX algorithm is not assigning equal numbers of elements per link! ")<muxFactor()<handleStripsPhiSec(); - handleStripsEtaSec_ = settings->handleStripsEtaSec(); - - //=== Characteristics of this eta region. - - iPhiSec_ = iPhiSec; - iEtaReg_ = iEtaReg; - // Using lines of specified rapidity drawn from centre of CMS, determine the z coords at which - // they cross the radius rChosenRofZ_. - etaMin_ = settings->etaRegions()[iEtaReg]; - etaMax_ = settings->etaRegions()[iEtaReg + 1]; - chosenRofZ_ = settings->chosenRofZ(); - // Get range in z of tracks covered by this sector at chosen radius from beam-line - zOuterMin_ = chosenRofZ_ / tan(2. * atan(exp(-etaMin_))); - zOuterMax_ = chosenRofZ_ / tan(2. * atan(exp(-etaMax_))); - beamWindowZ_ = settings->beamWindowZ(); // Assumed half-length of beam-spot - - // If rapidity line leaves tracker endcap before reaching r = rChosenOfZ_, try something different. - /* - trackerOuterRadius_ = settings->trackerOuterRadius(); - trackerInnerRadius_ = settings->trackerInnerRadius(); - trackerHalfLength_ = settings->trackerHalfLength(); - if (fabs(zOuterMin_) > trackerHalfLength_) { - float scale = trackerHalfLength_/fabs(zOuterMin_); - zOuterMin_ *= scale; - rOuterMin_ *= scale; - } - if (fabs(zOuterMax_) > trackerHalfLength_) { - float scale = trackerHalfLength_/fabs(zOuterMax_); - zOuterMax_ *= scale; - rOuterMax_ *= scale; - } - */ - - //=== Characteristics of this phi region. - unsigned int numPhiSecPerNonant = (settings->numPhiSectors()) / (settings->numPhiNonants()); + Sector::Sector(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg) + : settings_(settings), + // Sector number + iPhiSec_(iPhiSec), + iEtaReg_(iEtaReg), + + beamWindowZ_(settings->beamWindowZ()), // Assumed half-length of beam-spot + + //=== Characteristics of this eta region. + // Using lines of specified rapidity drawn from centre of CMS, determine the z coords at which + // they cross the radius chosenRofZ_. + etaMin_(settings->etaRegions()[iEtaReg]), + etaMax_(settings->etaRegions()[iEtaReg + 1]), + chosenRofZ_(settings->chosenRofZ()), + // Get range in z of tracks covered by this sector at chosen radius from beam-line + zOuterMin_(chosenRofZ_ / tan(2. * atan(exp(-etaMin_)))), + zOuterMax_(chosenRofZ_ / tan(2. * atan(exp(-etaMax_)))), + + //=== Characteristics of this phi region. + chosenRofPhi_(settings->chosenRofPhi()), + useStubPhi_(settings->useStubPhi()), + minPt_(settings->houghMinPt()), // Min Pt covered by HT array. + useStubPhiTrk_(settings->useStubPhiTrk()), + assumedPhiTrkRes_(settings->assumedPhiTrkRes()), + calcPhiTrkRes_(settings->calcPhiTrkRes()), + //=== Check if subsectors in eta are being used within each sector. + numSubSecsEta_(settings->numSubSecsEta()) { // Centre of phi (tracking) nonant zero must be along x-axis to be consistent with tracker cabling map. // Define phi sector zero to start at lower end of phi range in nonant 0. float phiCentreSec0 = -M_PI / float(settings->numPhiNonants()) + M_PI / float(settings->numPhiSectors()); - phiCentre_ = - 2. * M_PI * float(iPhiSec) / float(settings->numPhiSectors()) + phiCentreSec0; // Centre of sector in phi + // Centre of sector in phi + phiCentre_ = 2. * M_PI * float(iPhiSec) / float(settings->numPhiSectors()) + phiCentreSec0; sectorHalfWidth_ = M_PI / float(settings->numPhiSectors()); // Sector half width excluding overlaps. - chosenRofPhi_ = settings->chosenRofPhi(); - useStubPhi_ = settings->useStubPhi(); - minPt_ = settings->houghMinPt(); // Min Pt covered by HT array. - useStubPhiTrk_ = settings->useStubPhiTrk(); - assumedPhiTrkRes_ = settings->assumedPhiTrkRes(); - calcPhiTrkRes_ = settings->calcPhiTrkRes(); - - //=== Check if subsectors in eta are being used within each sector. - numSubSecsEta_ = settings->numSubSecsEta(); - /* - // If subsectors have equal width in z50, do this. - float subSecWidth = (zOuterMax_ - zOuterMin_)/float(numSubSecsEta_); - for (unsigned int i = 0; i < numSubSecsEta_; i++) { - zOuterMinSub_.push_back( zOuterMin_ + i *subSecWidth); - zOuterMaxSub_.push_back( zOuterMin_ + (i + 1)*subSecWidth); - } - */ - // If subsectors have equal width in rapidity, do this. + + // If eta subsectors have equal width in rapidity, do this. float subSecWidth = (etaMax_ - etaMin_) / float(numSubSecsEta_); for (unsigned int i = 0; i < numSubSecsEta_; i++) { float subSecEtaMin = etaMin_ + i * subSecWidth; @@ -100,7 +71,7 @@ namespace tmtt { vector Sector::insideEtaSubSecs(const Stub* stub) const { if (settings_->enableDigitize() && numSubSecsEta_ == 2) { // Use (complicated) digitized firmware emulation - return subEtaFwCalc(stub->digitalStub().iDigi_Rt(), stub->digitalStub().iDigi_Z()); + return subEtaFwCalc(stub->digitalStub()->iDigi_Rt(), stub->digitalStub()->iDigi_Z()); } else { // Use (simpler) floating point calculation. @@ -124,47 +95,14 @@ namespace tmtt { // Upper edge of this eta region defined by line from (r,z) = (0, beamWindowZ) to (chosenRofZ_, zRangeMax). float zMin, zMax; - bool inside; - if (!handleStripsEtaSec_) { - //--- Don't modify algorithm to allow for uncertainty in stub (r,z) coordinates caused by 2S module strip length? - - // Calculate z coordinate of lower edge of this eta region, evaluated at radius of stub. - zMin = (zRangeMin * stub->r() - beamWindowZ_ * fabs(stub->r() - chosenRofZ_)) / chosenRofZ_; - // Calculate z coordinate of upper edge of this eta region, evaluated at radius of stub. - zMax = (zRangeMax * stub->r() + beamWindowZ_ * fabs(stub->r() - chosenRofZ_)) / chosenRofZ_; - - // zMin = ( zRangeMin * stub->r() - beamWindowZ_ * fabs(stub->r() - rOuterMin_) ) / rOuterMin_; - // zMax = ( zRangeMax * stub->r() + beamWindowZ_ * fabs(stub->r() - rOuterMax_) ) / rOuterMax_; - - inside = (stub->z() > zMin && stub->z() < zMax); - - } else { - //--- Do modify algorithm to allow for uncertainty in stub (r,z) coordinates caused by 2S module strip length? - - float stubMinR = stub->r() - stub->rErr(); - float stubMaxR = stub->r() + stub->rErr(); - float stubMinZ = stub->z() - stub->zErr(); - float stubMaxZ = stub->z() + stub->zErr(); - - // Calculate z coordinate of lower edge of this eta region, evaluated at radius of stub. - float rStubA = - (zRangeMin + beamWindowZ_) >= 0 - ? stubMinR - : stubMaxR; // stub r coordinate uncertain (especially in endcap), so use one which gives most -ve zMin. - zMin = -beamWindowZ_ + (rStubA / chosenRofZ_) * (zRangeMin + beamWindowZ_); - - // Calculate z coordinate of upper edge of this eta region, evaluated at radius of stub. - float rStubB = - (zRangeMax - beamWindowZ_) >= 0 - ? stubMaxR - : stubMinR; // stub r coordinate uncertain (especially in endcap), so use one which gives most +ve zMax. - zMax = beamWindowZ_ + (rStubB / chosenRofZ_) * (zRangeMax - beamWindowZ_); - - inside = (stubMaxZ > zMin && stubMinZ < zMax); - } + // Calculate z coordinate of lower edge of this eta region, evaluated at radius of stub. + zMin = (zRangeMin * stub->r() - beamWindowZ_ * std::abs(stub->r() - chosenRofZ_)) / chosenRofZ_; + // Calculate z coordinate of upper edge of this eta region, evaluated at radius of stub. + zMax = (zRangeMax * stub->r() + beamWindowZ_ * std::abs(stub->r() - chosenRofZ_)) / chosenRofZ_; + inside = (stub->z() > zMin && stub->z() < zMax); return inside; } @@ -182,7 +120,7 @@ namespace tmtt { reco::deltaPhi(stub->phi(), phiCentre_); // Phi difference between stub & sector in range -PI to +PI. float tolerancePhi = stub->phiDiff( chosenRofPhi_, minPt_); // How much stub phi might differ from track phi because of track curvature. - float outsidePhi = fabs(delPhi) - sectorHalfWidth_ - + float outsidePhi = std::abs(delPhi) - sectorHalfWidth_ - tolerancePhi; // If > 0, then stub is not compatible with being inside this sector. if (outsidePhi > 0) okPhi = false; @@ -190,26 +128,19 @@ namespace tmtt { if (useStubPhiTrk_) { // Estimate either phi0 of track from stub info, or phi of the track at radius chosenRofPhi_. - float phiTrk = stub->trkPhiAtR(chosenRofPhi_).first; // N.B. This equals stub->beta() if chosenRofPhi_ = 0. - float delPhiTrk = - reco::deltaPhi(phiTrk, phiCentre_); // Phi difference between stub & sector in range -PI to +PI. - float tolerancePhiTrk = - assumedPhiTrkRes_ * (2 * sectorHalfWidth_); // Set tolerance equal to nominal resolution assumed in phiTrk + float phiTrk = stub->trkPhiAtR(chosenRofPhi_); + // Phi difference between stub & sector in range -PI to +PI. + float delPhiTrk = reco::deltaPhi(phiTrk, phiCentre_); + // Set tolerance equal to nominal resolution assumed in phiTrk + float tolerancePhiTrk = assumedPhiTrkRes_ * (2 * sectorHalfWidth_); if (calcPhiTrkRes_) { // Calculate uncertainty in phiTrk due to poor resolution in stub bend - float phiTrkRes = stub->trkPhiAtRres(chosenRofPhi_); + float phiTrkRes = stub->trkPhiAtRcut(chosenRofPhi_); // Reduce tolerance if this is smaller than the nominal assumed resolution. tolerancePhiTrk = min(tolerancePhiTrk, phiTrkRes); } - float outsidePhiTrk = fabs(delPhiTrk) - sectorHalfWidth_ - - tolerancePhiTrk; // If > 0, then stub is not compatible with being inside this sector. - - // Modify algorithm to allow for uncertainty due to 2S module strip length, if requested. - if (handleStripsPhiSec_) { - float chosenStubPhiErr = - stub->trkPhiAtR(chosenRofPhi_).second; // The "Err" here is uncertainty due to 2S strip length. - outsidePhiTrk -= chosenStubPhiErr; - } + // If following > 0, then stub is not compatible with being inside this sector. + float outsidePhiTrk = std::abs(delPhiTrk) - sectorHalfWidth_ - tolerancePhiTrk; if (outsidePhiTrk > 0) okPhiTrk = false; @@ -258,17 +189,18 @@ namespace tmtt { // Digitize a floating point number to 2s complement integer, dropping anything after the decimal point. (Kristian Harder) - Long64_t Sector::forceBitWidth(const float value, const UInt_t nBits) const { + int64_t Sector::forceBitWidth(const float value, const UInt_t nBits) const { // slightly hand-waving treatment of 2s complement - Long64_t sign = 1; + int64_t sign = 1; if (value < 0) sign = -1; - Long64_t iValue = Long64_t(fabs(value)); - Long64_t mask = (Long64_t(1) << nBits) - Long64_t(1); - Long64_t result = sign * (iValue & mask); - if (fabs(result - value) > 1) - throw cms::Exception("Sector::forceBitWidth is messing by using too few bits to digitize number") - << " nBits=" << nBits << " Input float=" << value << " Output digi = " << result << endl; + int64_t iValue = int64_t(std::abs(value)); + int64_t mask = (int64_t(1) << nBits) - int64_t(1); + int64_t result = sign * (iValue & mask); + if (std::abs(result - value) > 1) + throw cms::Exception("LogicError") + << "Sector::forceBitWidth is messing up by using too few bits to digitize number" + << " nBits=" << nBits << " Input float=" << value << " Output digi = " << result; return result; // Check that result is compatible with value. Throw error if not. } @@ -286,15 +218,15 @@ namespace tmtt { unsigned int zBits = settings_->zBits(); float rtRange = settings_->rtRange(); float zRange = settings_->zRange(); - const float cm_to_mm = 10.; // firwmare is in mm and CMSSW in cm. + constexpr float cm_to_mm = 10.; // firwmare is in mm and CMSSW in cm. float zBase = cm_to_mm / (pow(2, zBits) / zRange); float rTBase = cm_to_mm / (pow(2, rtBits) / rtRange); - // Number of bits used by DSP in Virtex7 FPGA (where DSP does D = A*B + C) - const unsigned int nDSPa = 25; - const unsigned int nDSPb = 18; - const unsigned int nDSPc = 48; - const unsigned int nDSPd = 48; + // Number of bits used by DSP in UltraScale-Plus FPGA (where DSP does D = A*B + C) + constexpr unsigned int nDSPa = 27; + //constexpr unsigned int nDSPb = 18; + constexpr unsigned int nDSPc = 48; + constexpr unsigned int nDSPd = 48; // unit transformations: firmware uses mm, software uses cm float BeamWindow = cm_to_mm * beamWindowZ_; @@ -303,43 +235,35 @@ namespace tmtt { // actual algorithm as used in firmware, mostly using same variable names float Beam_over_T = BeamWindow / T_rz; - unsigned int nShiftA = - 24; // Chosen by hand so that number digitized below when calculating "bot" uses most of the nDSPa bits, without overflowing them. This is done assuming reference number of bits for rT and z mentioned above. - nShiftA += - (rtBits - rtBitsRef) - - (zBits - - zBitsRef); // Guess from Ian & Luis to keep "bot" in correct range (nDSPa) if number of digitsation bits are changed. + // Value chosen so that number digitized below when calculating "bot" uses most of the nDSPa bits, without overflowing them. This is done assuming reference number of bits for rT and z mentioned above. + unsigned int nShiftA = 24; + // Guess from to keep "bot" in correct range (nDSPa) if number of digitsation bits are changed. + nShiftA += (rtBits - rtBitsRef) - (zBits - zBitsRef); float Beam_over_T_base = 1. / (1 << nShiftA); - Long64_t bot = forceBitWidth(Beam_over_T * rTBase / zBase / Beam_over_T_base, nDSPa); - Long64_t bw = forceBitWidth(BeamWindow / zBase / Beam_over_T_base, nDSPc); + int64_t bot = forceBitWidth(Beam_over_T * rTBase / zBase / Beam_over_T_base, nDSPa); + int64_t bw = forceBitWidth(BeamWindow / zBase / Beam_over_T_base, nDSPc); float etaSecMid = (settings_->etaRegions()[iEtaReg_] + settings_->etaRegions()[iEtaReg_ + 1]) / 2.0; float tanlSecMid = 1.0 / tan(2.0 * atan(exp(-etaSecMid))); - unsigned int nShiftB = - 16; // Chosen by hand so that number digitized below when calculating "tanlSec_Mid" uses most of the nDSPa bits, without overflowing them. This is done assuming reference number of bits for rT and z mentioned above. - nShiftB += - (rtBits - rtBitsRef) - - (zBits - - zBitsRef); // Guess from Ian & Luis to keep "tanlSec_Mid" in correct range (nDSPa) if number of digitsation bits are changed. + // Value chosen so that number digitized below when calculating "tanlSec_Mid" uses most of the nDSPa bits, without overflowing them. This is done assuming reference number of bits for rT and z mentioned above. + unsigned int nShiftB = 16; + // Guess to keep "tanlSec_Mid" in correct range (nDSPa) if number of digitsation bits are changed. + nShiftB += (rtBits - rtBitsRef) - (zBits - zBitsRef); float tanlSecBase = 1. / (1 << nShiftB); - Long64_t tanlSec_Mid = - forceBitWidth(int(tanlSecMid * rTBase / zBase / tanlSecBase), nDSPa); // 25 is a constant due to DSP - - const unsigned int nExtraBitsR = - 2; // Number of extra bits used to digitise r instead of rT within GP code, if both encoded as signed int. - const unsigned int rBits = rtBits + nExtraBitsR; - Long64_t r = forceBitWidth(rT + T_rphi / rTBase, rBits); - Long64_t g = forceBitWidth(bot * r - bw, nDSPd); - Long64_t absg = abs(g); - const unsigned nBitsRemainingA = - nDSPd - - nShiftA; // Number of useful bits left of the nDSPd assigned to "absg" after right-shifting by nShiftA bits. - Long64_t shift_g = forceBitWidth((absg >> nShiftA), nBitsRemainingA); - Long64_t tlsr = forceBitWidth(tanlSec_Mid * r, - nDSPa + rBits); // Number of bits is sum of those in two numbers being multiplied. - const unsigned nBitsRemainingB = - (nDSPa + rBits) - - nShiftB; // Number of useful bits left of (nDSPa + rBits) assigned to "tlsr" after right-shifting by nShiftB bits. - Long64_t shift_tlsr = forceBitWidth((tlsr >> nShiftB), nBitsRemainingB); + int64_t tanlSec_Mid = forceBitWidth(int(tanlSecMid * rTBase / zBase / tanlSecBase), nDSPa); + // Number of extra bits used to digitise r instead of rT within GP code, if both encoded as signed int. + constexpr unsigned int nExtraBitsR = 2; + unsigned int rBits = rtBits + nExtraBitsR; + int64_t r = forceBitWidth(rT + T_rphi / rTBase, rBits); + int64_t g = forceBitWidth(bot * r - bw, nDSPd); + int64_t absg = abs(g); + // Number of useful bits left of the nDSPd assigned to "absg" after right-shifting by nShiftA bits. + const unsigned nBitsRemainingA = nDSPd - nShiftA; + int64_t shift_g = forceBitWidth((absg >> nShiftA), nBitsRemainingA); + // Number of bits is sum of those in two numbers being multiplied. + int64_t tlsr = forceBitWidth(tanlSec_Mid * r, nDSPa + rBits); + // Number of useful bits left of (nDSPa + rBits) assigned to "tlsr" after right-shifting by nShiftB bits. + const unsigned nBitsRemainingB = (nDSPa + rBits) - nShiftB; + int64_t shift_tlsr = forceBitWidth((tlsr >> nShiftB), nBitsRemainingB); vector insideVec; insideVec.push_back(z <= (shift_tlsr + shift_g)); diff --git a/L1Trigger/TrackFindingTMTT/src/Settings.cc b/L1Trigger/TrackFindingTMTT/src/Settings.cc index f25126ca20345..514f3476bd527 100644 --- a/L1Trigger/TrackFindingTMTT/src/Settings.cc +++ b/L1Trigger/TrackFindingTMTT/src/Settings.cc @@ -1,11 +1,14 @@ -#include +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" #include "FWCore/Utilities/interface/Exception.h" #include #include +using namespace std; + namespace tmtt { - // Set config params for HYBRID TRACKING via hard-wired consts to allow use outside CMSSW. + ///=== Hybrid Tracking + ///=== Set config params for HYBRID TRACKING via hard-wired consts to allow use outside CMSSW. Settings::Settings() { // @@ -21,7 +24,6 @@ namespace tmtt { stubMatchStrict_ = false; minStubLayers_ = 4; minPtToReduceLayers_ = 99999.; - deadReduceLayers_ = false; kalmanMinNumStubs_ = 4; kalmanMaxNumStubs_ = 6; numPhiNonants_ = 9; @@ -56,39 +58,36 @@ namespace tmtt { chosenRofPhi_ = 67.240; chosenRofZ_ = 50.0; houghNbinsPt_ = 48; // Mini HT bins in 2 GeV HT array - handleStripsPhiSec_ = 1; useApproxB_ = true; kalmanHOtilted_ = true; kalmanHOhelixExp_ = true; kalmanHOalpha_ = 1; - kalmanHOdodgy_ = false; + kalmanHOfw_ = false; kalmanHOprojZcorr_ = 1; bApprox_gradient_ = 0.886454; bApprox_intercept_ = 0.504148; - handleStripsEtaSec_ = false; - kalmanFillInternalHists_ = false; kalmanMultiScattTerm_ = 0.00075; kalmanChi2RphiScale_ = 8; // // Cfg params & constants required only for HYBRID tracking (as taken from DB for TMTT). // hybrid_ = true; - psStripPitch_ = 0.01; + psPixelPitch_ = 0.01; psNStrips_ = 960; psPixelLength_ = 0.1467; ssStripPitch_ = 0.009; ssNStrips_ = 1016; ssStripLength_ = 5.0250; - zMaxNonTilted_[1] = 15.3; // max z at which non-tilted modules are found in inner 3 barrel layers. - zMaxNonTilted_[2] = 24.6; - zMaxNonTilted_[3] = 33.9; + // max z at which non-tilted modules are found in 3 barrel PS layers. (Element 0 not used). + zMaxNonTilted_ = {0, 15.3, 24.6, 33.9}; - bField_ = 3.81120228767395; + magneticField_ = 3.81120228767395; // Stub digitization params for hybrid (copied from TrackFindingTMTT/interface/HLS/KFconstants.h - double rMult_hybrid = 1. / 0.02929688; - double phiSMult_hybrid = 1. / (7.828293e-6 * 8); - double zMult_hybrid = rMult_hybrid / 2; // In KF VHDL, z/r mult = 1/2, whereas in HLS, they are identical. + constexpr double rMult_hybrid = 1. / 0.02929688; + constexpr double phiSMult_hybrid = 1. / (7.828293e-6 * 8); + constexpr double zMult_hybrid = + rMult_hybrid / 2; // In KF VHDL, z/r mult = 1/2, whereas in HLS, they are identical. // Number of bits copied from TrackFindingTMTT/interface/HLS/KFstub.h (BR1, BPHI, BZ) rtBits_ = 12; phiSBits_ = 14; @@ -99,12 +98,13 @@ namespace tmtt { if (hybrid_) { if (not useApproxB_) { - std::cout << "TMTT Settings Error: module tilt angle unknown, so must set useApproxB = true" << std::endl; - exit(1); + throw cms::Exception("BadConfig") + << "TMTT Settings Error: module tilt angle unknown, so must set useApproxB = true"; } } } + ///=== TMTT tracking. ///=== Get configuration parameters from python cfg for TMTT tracking. Settings::Settings(const edm::ParameterSet& iConfig) @@ -112,10 +112,21 @@ namespace tmtt { // See either Analyze_Defaults_cfi.py or Settings.h for description of these parameters. + //=== Tags for Input ES & ED data. + magneticFieldInputTag_(iConfig.getParameter("magneticFieldInputTag")), + trackerGeometryInputTag_(iConfig.getParameter("trackerGeometryInputTag")), + trackerTopologyInputTag_(iConfig.getParameter("trackerTopologyInputTag")), + stubInputTag_(iConfig.getParameter("stubInputTag")), + tpInputTag_(iConfig.getParameter("tpInputTag")), + stubTruthInputTag_(iConfig.getParameter("stubTruthInputTag")), + clusterTruthInputTag_(iConfig.getParameter("clusterTruthInputTag")), + genJetInputTag_(iConfig.getParameter("genJetInputTag")), + //=== Parameter sets for differents types of configuration parameter. genCuts_(iConfig.getParameter("GenCuts")), stubCuts_(iConfig.getParameter("StubCuts")), stubDigitize_(iConfig.getParameter("StubDigitize")), + trackerModuleType_(iConfig.getParameter("TrackerModuleType")), geometricProc_(iConfig.getParameter("GeometricProc")), phiSectors_(iConfig.getParameter("PhiSectors")), etaSectors_(iConfig.getParameter("EtaSectors")), @@ -133,6 +144,7 @@ namespace tmtt { enableMCtruth_(iConfig.getParameter("EnableMCtruth")), enableHistos_(iConfig.getParameter("EnableHistos")), + enableOutputIntermediateTTTracks_(iConfig.getParameter("EnableOutputIntermediateTTTracks")), //=== Cuts on MC truth tracks used for tracking efficiency measurements. @@ -150,8 +162,8 @@ namespace tmtt { maxStubEta_(stubCuts_.getParameter("MaxStubEta")), killLowPtStubs_(stubCuts_.getParameter("KillLowPtStubs")), printStubWindows_(stubCuts_.getParameter("PrintStubWindows")), - bendResolution_(stubCuts_.getParameter("BendResolution")), - bendResolutionExtra_(stubCuts_.getParameter("BendResolutionExtra")), + bendCut_(stubCuts_.getParameter("BendCut")), + bendCutExtra_(stubCuts_.getParameter("BendCutExtra")), orderStubsByBend_(stubCuts_.getParameter("OrderStubsByBend")), //=== Optional stub digitization. @@ -167,10 +179,17 @@ namespace tmtt { zBits_(stubDigitize_.getParameter("ZBits")), zRange_(stubDigitize_.getParameter("ZRange")), //--- Parameters available in GP board (excluding any in common with MP specified above). - phiOBits_(stubDigitize_.getParameter("PhiOBits")), - phiORange_(stubDigitize_.getParameter("PhiORange")), + phiNBits_(stubDigitize_.getParameter("PhiNBits")), + phiNRange_(stubDigitize_.getParameter("PhiNRange")), bendBits_(stubDigitize_.getParameter("BendBits")), + //=== Tracker Module Type for FW. + pitchVsType_(trackerModuleType_.getParameter>("PitchVsType")), + spaceVsType_(trackerModuleType_.getParameter>("SpaceVsType")), + barrelVsTypeTmp_(trackerModuleType_.getParameter>("BarrelVsType")), + psVsTypeTmp_(trackerModuleType_.getParameter>("PSVsType")), + tiltedVsTypeTmp_(trackerModuleType_.getParameter>("TiltedVsType")), + //=== Configuration of Geometric Processor. useApproxB_(geometricProc_.getParameter("UseApproxB")), bApprox_gradient_(geometricProc_.getParameter("BApprox_gradient")), @@ -184,20 +203,17 @@ namespace tmtt { useStubPhiTrk_(phiSectors_.getParameter("UseStubPhiTrk")), assumedPhiTrkRes_(phiSectors_.getParameter("AssumedPhiTrkRes")), calcPhiTrkRes_(phiSectors_.getParameter("CalcPhiTrkRes")), - handleStripsPhiSec_(phiSectors_.getParameter("HandleStripsPhiSec")), //=== Division of Tracker into eta sectors. etaRegions_(etaSectors_.getParameter>("EtaRegions")), chosenRofZ_(etaSectors_.getParameter("ChosenRofZ")), beamWindowZ_(etaSectors_.getParameter("BeamWindowZ")), - handleStripsEtaSec_(etaSectors_.getParameter("HandleStripsEtaSec")), allowOver2EtaSecs_(etaSectors_.getParameter("AllowOver2EtaSecs")), //=== r-phi Hough transform array specifications. houghMinPt_(htArraySpecRphi_.getParameter("HoughMinPt")), houghNbinsPt_(htArraySpecRphi_.getParameter("HoughNbinsPt")), houghNbinsPhi_(htArraySpecRphi_.getParameter("HoughNbinsPhi")), - houghNcellsRphi_(htArraySpecRphi_.getParameter("HoughNcellsRphi")), enableMerge2x2_(htArraySpecRphi_.getParameter("EnableMerge2x2")), maxPtToMerge2x2_(htArraySpecRphi_.getParameter("MaxPtToMerge2x2")), numSubSecsEta_(htArraySpecRphi_.getParameter("NumSubSecsEta")), @@ -211,7 +227,6 @@ namespace tmtt { miniHoughLoadBalance_(htArraySpecRphi_.getParameter("MiniHoughLoadBalance")), //=== Rules governing how stubs are filled into the r-phi Hough Transform array. - handleStripsRphiHT_(htFillingRphi_.getParameter("HandleStripsRphiHT")), killSomeHTCellsRphi_(htFillingRphi_.getParameter("KillSomeHTCellsRphi")), useBendFilter_(htFillingRphi_.getParameter("UseBendFilter")), maxStubsInCell_(htFillingRphi_.getParameter("MaxStubsInCell")), @@ -228,7 +243,7 @@ namespace tmtt { //=== Options controlling r-z track filters (or any other track filters run after the Hough transform, as opposed to inside it). rzFilterName_(rzFilterOpts_.getParameter("RZFilterName")), - seedResolution_(rzFilterOpts_.getParameter("SeedResolution")), + seedResCut_(rzFilterOpts_.getParameter("SeedResCut")), keepAllSeed_(rzFilterOpts_.getParameter("KeepAllSeed")), maxSeedCombinations_(rzFilterOpts_.getParameter("MaxSeedCombinations")), maxGoodSeedCombinations_(rzFilterOpts_.getParameter("MaxGoodSeedCombinations")), @@ -246,10 +261,7 @@ namespace tmtt { //=== Specification of algorithm to eliminate duplicate tracks. - dupTrkAlgRphi_(dupTrkRemoval_.getParameter("DupTrkAlgRphi")), - dupTrkAlg3D_(dupTrkRemoval_.getParameter("DupTrkAlg3D")), dupTrkAlgFit_(dupTrkRemoval_.getParameter("DupTrkAlgFit")), - dupTrkMinCommonHitsLayers_(dupTrkRemoval_.getParameter("DupTrkMinCommonHitsLayers")), //=== Rules for deciding when a reconstructed L1 track matches a MC truth particle (i.e. tracking particle). @@ -270,19 +282,6 @@ namespace tmtt { killTrackFitWorstHit_(trackFitSettings_.getParameter("KillTrackFitWorstHit")), generalResidualCut_(trackFitSettings_.getParameter("GeneralResidualCut")), killingResidualCut_(trackFitSettings_.getParameter("KillingResidualCut")), - maxIterationsLR_(trackFitSettings_.getParameter("MaxIterationsLR")), - LRFillInternalHists_(trackFitSettings_.getParameter("LRFillInternalHists")), - combineResiduals_(trackFitSettings_.getParameter("CombineResiduals")), - lineariseStubPosition_(trackFitSettings_.getParameter("LineariseStubPosition")), - checkSectorConsistency_(trackFitSettings_.getParameter("CheckSectorConsistency")), - checkHTCellConsistency_(trackFitSettings_.getParameter("CheckHTCellConsistency")), - minPSLayers_(trackFitSettings_.getParameter("MinPSLayers")), - digitizeLR_(trackFitSettings_.getParameter("DigitizeLR")), - PhiPrecision_(trackFitSettings_.getParameter("PhiPrecision")), - RPrecision_(trackFitSettings_.getParameter("RPrecision")), - ZPrecision_(trackFitSettings_.getParameter("ZPrecision")), - ZSlopeWidth_(trackFitSettings_.getParameter("ZSlopeWidth")), - ZInterceptWidth_(trackFitSettings_.getParameter("ZInterceptWidth")), // digitizeSLR_(trackFitSettings_.getParameter("DigitizeSLR")), dividerBitsHelix_(trackFitSettings_.getParameter("DividerBitsHelix")), @@ -298,7 +297,6 @@ namespace tmtt { residualCut_(trackFitSettings_.getParameter("ResidualCut")), // kalmanDebugLevel_(trackFitSettings_.getParameter("KalmanDebugLevel")), - kalmanFillInternalHists_(trackFitSettings_.getParameter("KalmanFillInternalHists")), kalmanMinNumStubs_(trackFitSettings_.getParameter("KalmanMinNumStubs")), kalmanMaxNumStubs_(trackFitSettings_.getParameter("KalmanMaxNumStubs")), kalmanAddBeamConstr_(trackFitSettings_.getParameter("KalmanAddBeamConstr")), @@ -313,12 +311,10 @@ namespace tmtt { kalmanHOhelixExp_(trackFitSettings_.getParameter("KalmanHOhelixExp")), kalmanHOalpha_(trackFitSettings_.getParameter("KalmanHOalpha")), kalmanHOprojZcorr_(trackFitSettings_.getParameter("KalmanHOprojZcorr")), - kalmanHOdodgy_(trackFitSettings_.getParameter("KalmanHOdodgy")), + kalmanHOfw_(trackFitSettings_.getParameter("KalmanHOfw")), //=== Treatment of dead modules. - deadReduceLayers_(deadModuleOpts_.getParameter("DeadReduceLayers")), - deadSimulateFrac_(deadModuleOpts_.getParameter("DeadSimulateFrac")), killScenario_(deadModuleOpts_.getParameter("KillScenario")), killRecover_(deadModuleOpts_.getParameter("KillRecover")), @@ -355,11 +351,8 @@ namespace tmtt { // other_skipTrackDigi_(trackDigi_.getParameter("Other_skipTrackDigi")), - // Debug printout - debug_(iConfig.getParameter("Debug")), + // Plot options resPlotOpt_(iConfig.getParameter("ResPlotOpt")), - iPhiPlot_(iConfig.getParameter("iPhiPlot")), - iEtaPlot_(iConfig.getParameter("iEtaPlot")), // Name of output EDM file if any. // N.B. This parameter does not appear inside TMTrackProducer_Defaults_cfi.py . It is created inside @@ -367,11 +360,11 @@ namespace tmtt { writeOutEdmFile_(iConfig.getUntrackedParameter("WriteOutEdmFile", true)), // Bfield in Tesla. (Unknown at job initiation. Set to true value for each event - bField_(0.), + magneticField_(0.), // Hybrid tracking hybrid_(iConfig.getParameter("Hybrid")), - psStripPitch_(0.), + psPixelPitch_(0.), psNStrips_(0.), psPixelLength_(0.), ssStripPitch_(0.), @@ -399,99 +392,96 @@ namespace tmtt { } useRZfilter_ = useRZfilterTmp; + // As python cfg doesn't know type "vbool", fix it here. + for (unsigned int i = 0; i < barrelVsTypeTmp_.size(); i++) { + barrelVsType_.push_back(bool(barrelVsTypeTmp_[i])); + psVsType_.push_back(bool(psVsTypeTmp_[i])); + tiltedVsType_.push_back(bool(tiltedVsTypeTmp_[i])); + } + //--- Sanity checks if (!(useStubPhi_ || useStubPhiTrk_)) - throw cms::Exception( - "Settings.cc: Invalid cfg parameters - You cant set both UseStubPhi & useStubPhiTrk to false."); + throw cms::Exception("BadConfig") + << "Settings: Invalid cfg parameters - You cant set both UseStubPhi & useStubPhiTrk to false."; if (minNumMatchLayers_ > minStubLayers_) - throw cms::Exception( - "Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type A."); + throw cms::Exception("BadConfig") + << "Settings: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type A."; if (genMinStubLayers_ > minStubLayers_) - throw cms::Exception( - "Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type B."); + throw cms::Exception("BadConfig") + << "Settings: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type B."; if (minNumMatchLayers_ > genMinStubLayers_) - throw cms::Exception( - "Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type C."); + throw cms::Exception("BadConfig") + << "Settings: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type C."; // If reducing number of required layers for high Pt tracks, then above checks must be redone. bool doReduceLayers = (minPtToReduceLayers_ < 10000. || etaSecsReduceLayers_.size() > 0); if (doReduceLayers && minStubLayers_ > 4) { if (minNumMatchLayers_ > minStubLayers_ - 1) - throw cms::Exception( - "Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type D."); + throw cms::Exception("BadConfig") + << "Settings: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type D."; if (genMinStubLayers_ > minStubLayers_ - 1) - throw cms::Exception( - "Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type E."); + throw cms::Exception("BadConfig") + << "Settings: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type E."; } for (const unsigned int& iEtaReg : etaSecsReduceLayers_) { if (iEtaReg >= etaRegions_.size()) - throw cms::Exception( - "Settings.cc: You specified an eta sector number in EtaSecsReduceLayers which exceeds the total number of " - "eta sectors!") - << iEtaReg << " " << etaRegions_.size() << endl; - } - - // Duplicate track removal algorithm 50 must not be run in parallel with any other. - if (dupTrkAlgFit_ == 50) { - if (dupTrkAlgRphi_ != 0 || dupTrkAlg3D_ != 0) - throw cms::Exception( - "Settings.c: Invalid cfg parameters -- If using DupTrkAlgFit = 50, you must disable all other duplicate " - "track removal algorithms."); + throw cms::Exception("BadConfig") << "Settings: You specified an eta sector number in EtaSecsReduceLayers " + "which exceeds the total number of eta sectors! " + << iEtaReg << " " << etaRegions_.size(); } // Chains of m bin ranges for output of HT. if (!busySectorMbinOrder_.empty()) { // User has specified an order in which the m bins should be chained together. Check if it makes sense. if (busySectorMbinOrder_.size() != houghNbinsPt_) - throw cms::Exception( - "Settings.cc: Invalid cfg parameters - BusySectorMbinOrder used by HT MUX contains wrong number of " - "elements. Unless you are optimising the MUX, suggest you configure it to an empty vector."); + throw cms::Exception("BadConfig") + << "Settings: Invalid cfg parameters - BusySectorMbinOrder used by HT MUX contains wrong number of " + "elements. Unless you are optimising the MUX, suggest you configure it to an empty vector."; set mOrderCheck; for (const unsigned int& m : busySectorMbinOrder_) { mOrderCheck.insert(m); } if (mOrderCheck.size() != houghNbinsPt_) - throw cms::Exception( - "Settings.cc: Invalid cfg parameters - BusySectorMbinOrder used by HT MUX contains duplicate elements."); + throw cms::Exception("BadConfig") + << "Settings: Invalid cfg parameters - BusySectorMbinOrder used by HT MUX contains duplicate elements."; unsigned int sum_nr = 0; for (unsigned int nr : busySectorMbinRanges_) { sum_nr += nr; } if (sum_nr != houghNbinsPt_) - throw cms::Exception( - "Settings.cc: Invalid cfg parameters - Sum of entries in BusySectorMbinRanges is incorrect."); + throw cms::Exception("BadConfig") + << "Settings: Invalid cfg parameters - Sum of entries in BusySectorMbinRanges is incorrect."; } if (miniHTstage_) { if (enableMerge2x2_) - throw cms::Exception("Settings.cc: it is not allowed to enable both MiniHTstage & EnableMerge2x2 options."); + throw cms::Exception("BadConfig") + << "Settings: it is not allowed to enable both MiniHTstage & EnableMerge2x2 options."; // Options for 2nd stage mini HT if (shape_ != 0) - throw cms::Exception( - "Settings.cc: Invalid cfg parameters - 2nd stage mini HT only allowed for square-shaped cells."); + throw cms::Exception("BadConfig") + << "Settings: Invalid cfg parameters - 2nd stage mini HT only allowed for square-shaped cells."; if (miniHoughNbinsPt_ != 2 || miniHoughNbinsPhi_ != 2) - throw cms::Exception("Settings.cc: 2nd mini HT has so dar only been implemented in C++ for 2x2."); + throw cms::Exception("BadConfig") << "Settings: 2nd mini HT has so dar only been implemented in C++ for 2x2."; } if (enableMerge2x2_) { if (miniHTstage_) - throw cms::Exception("Settings.cc: it is not allowed to enable both MiniHTstage & EnableMerge2x2 options."); + throw cms::Exception("BadConfig") + << "Settings: it is not allowed to enable both MiniHTstage & EnableMerge2x2 options."; // Merging of HT cells has not yet been implemented for diamond or hexagonal HT cell shape. if (enableMerge2x2_ && shape_ != 0) - throw cms::Exception("Settings.cc: Invalid cfg parameters - merging only allowed for square-shaped cells."); + throw cms::Exception("BadConfig") + << "Settings: Invalid cfg parameters - merging only allowed for square-shaped cells."; } - // Do not use our private dead module emulation together with the communal Tracklet/TMTT dead module emulation - // developed for the Stress Test. - if (deadSimulateFrac_ > 0. && killScenario_ > 0) - throw cms::Exception("Settings.cc: Invalid cfg parameters - don't enable both DeadSimulateFrac and KillScenario"); - // Check Kalman fit params. if (kalmanMaxNumStubs_ < kalmanMinNumStubs_) - throw cms::Exception("Settings.cc: Invalid cfg parameters - KalmanMaxNumStubs is less than KalmanMaxNumStubs."); + throw cms::Exception("BadConfig") + << "Settings: Invalid cfg parameters - KalmanMaxNumStubs is less than KalmanMaxNumStubs."; } bool Settings::isHTRPhiEtaRegWhitelisted(unsigned const iEtaReg) const { diff --git a/L1Trigger/TrackFindingTMTT/src/SimpleLR.cc b/L1Trigger/TrackFindingTMTT/src/SimpleLR.cc deleted file mode 100644 index 6002b0e5d85ff..0000000000000 --- a/L1Trigger/TrackFindingTMTT/src/SimpleLR.cc +++ /dev/null @@ -1,495 +0,0 @@ -///=== This is the global Linear Regression for 4 helix parameters track fit algorithm. - -///=== Written by: Davide Cieri - -#include "L1Trigger/TrackFindingTMTT/interface/SimpleLR.h" -#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" -#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" -#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" - -#include "DataFormats/Math/interface/deltaPhi.h" -#include -#include -#include -#include - -using namespace tmtt; - -static bool pair_compare(std::pair a, std::pair b) { - return (a.second < b.second); -} - -// Initialize some parameters -void SimpleLR::initRun() { - phiMult_ = pow(2., settings_->phiSBits()) / settings_->phiSRange(); - rTMult_ = pow(2., settings_->rtBits()) / settings_->rtRange(); - zMult_ = pow(2., settings_->zBits()) / settings_->zRange(); - z0Mult_ = pow(2., settings_->slr_z0Bits()) / settings_->slr_z0Range(); - phiTMult_ = pow(2., settings_->slr_phi0Bits()) / settings_->slr_phi0Range(); - - qOverPtMult_ = pow(2., settings_->slr_oneOver2rBits()) / settings_->slr_oneOver2rRange(); - tanLambdaMult_ = pow(2., settings_->slr_tanlambdaBits()) / settings_->slr_tanlambdaRange(); - chi2Mult_ = pow(2., settings_->slr_chisquaredBits()) / settings_->slr_chisquaredRange(); - - numeratorPtMult_ = rTMult_ * phiMult_; - numeratorPhiMult_ = rTMult_ * rTMult_ * phiMult_; - numeratorZ0Mult_ = rTMult_ * rTMult_ * z0Mult_; - numeratorLambdaMult_ = rTMult_ * z0Mult_; - denominatorMult_ = rTMult_ * rTMult_; - resMult_ = rTMult_ * qOverPtMult_; - - digitize_ = settings_->digitizeSLR() and settings_->enableDigitize(); - dividerBitsHelix_ = settings_->dividerBitsHelix(); - dividerBitsHelixZ_ = settings_->dividerBitsHelixZ(); - shiftingBitsDenRPhi_ = settings_->ShiftingBitsDenRPhi(); - shiftingBitsDenRZ_ = settings_->ShiftingBitsDenRZ(); - - shiftingBitsPhi_ = settings_->ShiftingBitsPhi(); - shiftingBitsz0_ = settings_->ShiftingBitsZ0(); - shiftingBitsPt_ = settings_->ShiftingBitsPt(); - shiftingBitsLambda_ = settings_->ShiftingBitsLambda(); - - phiSectorWidth_ = 2. * M_PI / float(settings_->numPhiSectors()); - phiNonantWidth_ = 2. * M_PI / float(settings_->numPhiNonants()); - - chi2cut_ = settings_->slr_chi2cut(); - invPtToDPhi_ = -settings_->invPtToDphi(); - chosenRofPhi_ = settings_->chosenRofPhi(); - if (digitize_) - chosenRofPhi_ = floor(chosenRofPhi_ * rTMult_) / rTMult_; -} - -L1fittedTrack SimpleLR::fit(const L1track3D& l1track3D) { - if (settings_->debug() == 6) - cout << "=============== FITTING TRACK ====================" << endl; - - double phiCentreSec0 = -0.5 * phiNonantWidth_ + 0.5 * phiSectorWidth_; - phiSectorCentre_ = phiSectorWidth_ * double(l1track3D.iPhiSec()) - phiCentreSec0; - - if (digitize_) - phiSectorCentre_ = floor(phiSectorCentre_ * phiTMult_) / phiTMult_; - - // Inizialise track fit parameters - double qOverPt = 0.; - double phiT = 0.; - double phi0 = 0.; - double z0 = 0.; - double zT = 0.; - double tanLambda = 0.; - - // Inizialise Sums - double SumRPhi = 0.; - double SumR = 0.; - double SumPhi = 0.; - double SumR2 = 0.; - double SumRZ = 0.; - double SumZ = 0.; - - unsigned int numStubs = 0; - // Calc helix parameters on Rphi Plane (STEP 1) - // This loop calculates the sums needed to calculate the numerators and the denominator to compute the helix parameters in the R-Phi plane (q/pT, phiT) - for (const Stub* stub : l1track3D.getStubs()) { - // if((const_cast(stub))->psModule()){ - numStubs++; - - if (digitize_) { - (const_cast(stub))->digitizeForHTinput(l1track3D.iPhiSec()); - (const_cast(stub))->digitizeForSFinput(); - const DigitalStub digiStub = (const_cast(stub))->digitalStub(); - - SumRPhi = SumRPhi + digiStub.rt() * digiStub.phiS(); - SumR = SumR + digiStub.rt(); - SumPhi = SumPhi + digiStub.phiS(); - SumR2 = SumR2 + digiStub.rt() * digiStub.rt(); - if (settings_->debug() == 6) - cout << "phiS " << digiStub.iDigi_PhiS() << " rT " << digiStub.iDigi_Rt() << " z " << digiStub.iDigi_Z() - << endl; - } else { - float phi = 0; - if (l1track3D.iPhiSec() == 0 and (const_cast(stub))->phi() > 0) { - phi = (const_cast(stub))->phi() - 2 * M_PI; - } else if (l1track3D.iPhiSec() == settings_->numPhiSectors() and (const_cast(stub))->phi() < 0) { - phi = (const_cast(stub))->phi() + 2 * M_PI; - } else { - phi = (const_cast(stub))->phi(); - } - SumRPhi = SumRPhi + (const_cast(stub))->r() * phi; - SumR = SumR + (const_cast(stub))->r(); - SumPhi = SumPhi + phi; - SumR2 = SumR2 + (const_cast(stub))->r() * (const_cast(stub))->r(); - if (settings_->debug() == 6) - cout << "phi " << phi << " r " << (const_cast(stub))->r() << " z " << (const_cast(stub))->z() - << endl; - } - // } - } - - double numeratorPt, digiNumeratorPt; - double denominator, digiDenominator; - double numeratorPhi, digiNumeratorPhi; - double reciprocal, digiReciprocal; - double numeratorZ0, digiNumeratorZ0; - double numeratorLambda, digiNumeratorLambda; - - digiNumeratorPt = (numStubs * SumRPhi - SumR * SumPhi); - digiDenominator = (numStubs * SumR2 - SumR * SumR); - digiNumeratorPhi = (SumR2 * SumPhi - SumR * SumRPhi); - - if (!digitize_) { - qOverPt = (numStubs * SumRPhi - SumR * SumPhi) / (numStubs * SumR2 - SumR * SumR); - phi0 = (SumR2 * SumPhi - SumR * SumRPhi) / (numStubs * SumR2 - SumR * SumR); - } else { - digiNumeratorPt /= pow(2., shiftingBitsPt_); - digiNumeratorPt = floor(digiNumeratorPt * numeratorPtMult_); - numeratorPt = digiNumeratorPt / numeratorPtMult_; - - digiNumeratorPhi /= pow(2., shiftingBitsPhi_); - digiNumeratorPhi = floor(digiNumeratorPhi * numeratorPhiMult_); - numeratorPhi = digiNumeratorPhi / numeratorPhiMult_; - - digiDenominator /= pow(2., shiftingBitsDenRPhi_); - digiDenominator = (floor(digiDenominator * denominatorMult_) + 0.5); - denominator = digiDenominator / denominatorMult_; - digiReciprocal = (pow(2., dividerBitsHelix_) - 1) / (denominator); // To be moved - digiReciprocal = floor(digiReciprocal / denominatorMult_); - reciprocal = digiReciprocal * denominatorMult_; - - qOverPt = numeratorPt * reciprocal / pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPt_); - phiT = numeratorPhi * reciprocal / pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPhi_); - - qOverPt = floor(qOverPt * qOverPtMult_) / (qOverPtMult_); - phiT = floor(phiT * phiTMult_) / phiTMult_; - } - - if (settings_->debug() == 6 and digitize_) - cout << setw(10) << "First Helix parameters: qOverPt = " << qOverPt << " (" << floor(qOverPt * qOverPtMult_) - << "), phiT = " << phiT << " (" << floor(phiT * phiTMult_) << ") " << endl; - - if (settings_->debug() == 6 and !digitize_) - cout << "First Helix Parameters: qOverPt = " << qOverPt << " phi0 " << phi0 << endl; - - // ================== RESIDUAL CALCULATION ON RPHI ======================== - std::vector > vRes; - unsigned int psStubs = 0; - for (const Stub* stub : l1track3D.getStubs()) { - if ((const_cast(stub))->psModule()) - psStubs++; - double ResPhi; - - if (digitize_) { - (const_cast(stub))->digitizeForHTinput(l1track3D.iPhiSec()); - (const_cast(stub))->digitizeForSFinput(); - const DigitalStub digiStub = (const_cast(stub))->digitalStub(); - - ResPhi = digiStub.iDigi_PhiS() * pow(2., shiftingBitsDenRPhi_ - shiftingBitsPt_) - - floor(phiT * phiTMult_) * - pow(2., shiftingBitsDenRPhi_ - shiftingBitsPt_ - settings_->slr_phi0Bits() + settings_->phiSBits()) - - floor(qOverPt * qOverPtMult_) * digiStub.iDigi_Rt(); - - if (settings_->debug() == 6) { - // cout << "floor(phiT*phiTMult_) " << floor(phiT*phiTMult_) << endl; - // cout << "dsp_PhiSPhiT "<< digiStub.iDigi_PhiS() - floor(phiT*phiTMult_) << " shift_right(dsp_QoverPt_Rt,divider_shift- divider_pt) "<< floor(qOverPt*qOverPtMult_)*digiStub.iDigi_Rt()/(pow(2., ShiftingBits_- shiftingBitsPt_ ) )<< " settings_->rtRange() "<< settings_->rtRange() << endl; - cout << "DIGI RESIDUAL " << ResPhi << endl; - } - ResPhi = floor(ResPhi) / resMult_; - } - - else { - ResPhi = reco::deltaPhi((const_cast(stub))->phi(), phi0 + qOverPt * (const_cast(stub))->r()); - } - - double Res = fabs(ResPhi); - // if(digitize_) Res = floor(Res*phiMult_)/phiMult_; - - std::pair ResStubPair(stub, Res); - vRes.push_back(ResStubPair); - if (settings_->debug() == 6) { - if (const_cast(stub)->assocTP() != nullptr) - cout << " Stub Residual " << Res << " TP " << const_cast(stub)->assocTP()->index() << endl; - else - cout << " Stub Residual " << Res << " TP nullptr" << endl; - } - } - - double LargResidual = 9999.; - // Find largest residuals - while (vRes.size() > 4 and LargResidual > settings_->ResidualCut()) { - std::vector >::iterator maxResIt = - max_element(vRes.begin(), vRes.end(), pair_compare); - LargResidual = (*maxResIt).second; - if (settings_->debug() == 6) - cout << "Largest Residual " << LargResidual << endl; - - if (LargResidual > settings_->ResidualCut()) { - if ((*maxResIt).first->psModule()) { - if (psStubs > 2) { - if (settings_->debug() == 6) - cout << "removing PS residual " << (*maxResIt).second << endl; - vRes.erase(maxResIt); - psStubs--; - } else { - if (settings_->debug() == 6) - cout << "residual " << (*maxResIt).second << " set to -1. " << endl; - (*maxResIt).second = -1.; - } - } else { - vRes.erase(maxResIt); - if (settings_->debug() == 6) - cout << "removing residual " << (*maxResIt).second << endl; - } - } - } - - std::vector fitStubs; - for (std::pair ResStubPair : vRes) { - fitStubs.push_back(ResStubPair.first); - } - - phiT = 0.; - zT = 0.; - - SumRPhi = 0.; - SumR = 0.; - SumPhi = 0.; - SumR2 = 0.; - SumRZ = 0.; - SumZ = 0.; - double SumR_ps = 0.; - double SumR2_ps = 0.; - - numStubs = 0; - psStubs = 0; - - for (const Stub* stub : fitStubs) { - if ((const_cast(stub))->psModule()) - psStubs++; - - numStubs++; - if (digitize_) { - (const_cast(stub))->digitizeForHTinput(l1track3D.iPhiSec()); - // (const_cast(stub))->digitizeForSFinput(); - const DigitalStub digiStub = (const_cast(stub))->digitalStub(); - SumRPhi += digiStub.rt() * digiStub.phiS(); - SumR += digiStub.rt(); - SumPhi += digiStub.phiS(); - SumR2 += digiStub.rt() * digiStub.rt(); - if ((const_cast(stub))->psModule()) { - SumRZ += digiStub.rt() * digiStub.z(); - SumZ += digiStub.z(); - SumR_ps += digiStub.rt(); - SumR2_ps += digiStub.rt() * digiStub.rt(); - } - if (settings_->debug() == 6) { - cout << "phiS " << digiStub.iDigi_PhiS() << " rT " << digiStub.iDigi_Rt() << " z " << digiStub.iDigi_Z() - << endl; - } - } else { - float phi = 0; - if (l1track3D.iPhiSec() == 0 and (const_cast(stub))->phi() > 0) { - phi = (const_cast(stub))->phi() - 2 * M_PI; - } else if (l1track3D.iPhiSec() == settings_->numPhiSectors() and (const_cast(stub))->phi() < 0) { - phi = (const_cast(stub))->phi() + 2 * M_PI; - } else { - phi = (const_cast(stub))->phi(); - } - - SumRPhi += (const_cast(stub))->r() * phi; - SumR += (const_cast(stub))->r(); - SumPhi += phi; - SumR2 += (const_cast(stub))->r() * (const_cast(stub))->r(); - if ((const_cast(stub))->psModule()) { - SumRZ += (const_cast(stub))->r() * (const_cast(stub))->z(); - SumZ += (const_cast(stub))->z(); - SumR_ps += (const_cast(stub))->r(); - SumR2_ps += (const_cast(stub))->r() * (const_cast(stub))->r(); - } - if (settings_->debug() == 6) - cout << "phi " << phi << " r " << (const_cast(stub))->r() << " z " << (const_cast(stub))->z() - << endl; - } - - // } - } - - numeratorZ0 = (SumR2_ps * SumZ - SumR_ps * SumRZ); - numeratorLambda = (psStubs * SumRZ - SumR_ps * SumZ); - numeratorPt = (numStubs * SumRPhi - SumR * SumPhi); - denominator = (numStubs * SumR2 - SumR * SumR); - double denominatorZ = (psStubs * SumR2_ps - SumR_ps * SumR_ps); - numeratorPhi = (SumR2 * SumPhi - SumR * SumRPhi); - double reciprocalZ; - if (!digitize_) { - z0 = numeratorZ0 / denominatorZ; - tanLambda = numeratorLambda / denominatorZ; - qOverPt = (numStubs * SumRPhi - SumR * SumPhi) / (numStubs * SumR2 - SumR * SumR); - phi0 = (SumR2 * SumPhi - SumR * SumRPhi) / (numStubs * SumR2 - SumR * SumR); - } else { - numeratorPt /= pow(2., shiftingBitsPt_); - numeratorPt = floor(numeratorPt * numeratorPtMult_) / numeratorPtMult_; - - numeratorPhi /= pow(2., shiftingBitsPhi_); - numeratorPhi = floor(numeratorPhi * numeratorPhiMult_) / numeratorPhiMult_; - - numeratorLambda /= pow(2., shiftingBitsLambda_); - numeratorLambda = floor(numeratorLambda * numeratorLambdaMult_) / numeratorLambdaMult_; - - numeratorZ0 /= pow(2., shiftingBitsz0_); - numeratorZ0 = floor(numeratorZ0 * numeratorZ0Mult_) / numeratorZ0Mult_; - - denominator /= pow(2., shiftingBitsDenRPhi_); - denominator = (floor(denominator * denominatorMult_) + 0.5) / denominatorMult_; - reciprocal = (pow(2., dividerBitsHelix_) - 1) / (denominator); - reciprocal = floor(reciprocal / denominatorMult_) * denominatorMult_; - - denominatorZ /= pow(2., shiftingBitsDenRZ_); - denominatorZ = (floor(denominatorZ * denominatorMult_) + 0.5) / denominatorMult_; - reciprocalZ = (pow(2., dividerBitsHelixZ_) - 1) / (denominatorZ); - reciprocalZ = floor(reciprocalZ / denominatorMult_) * denominatorMult_; - - qOverPt = numeratorPt * reciprocal / pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPt_); - phiT = numeratorPhi * reciprocal / pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPhi_); - - tanLambda = numeratorLambda * reciprocalZ / pow(2., dividerBitsHelixZ_ + shiftingBitsDenRZ_ - shiftingBitsLambda_); - zT = numeratorZ0 * reciprocalZ / pow(2., dividerBitsHelixZ_ + shiftingBitsDenRZ_ - shiftingBitsz0_); - - phi0 = phiSectorCentre_ + phiT - qOverPt * settings_->chosenRofPhi(); - z0 = zT - tanLambda * settings_->chosenRofPhi(); - - qOverPt = floor(qOverPt * qOverPtMult_) / qOverPtMult_; - phiT = floor(phiT * phiTMult_) / phiTMult_; - } - - // cout << "z0" - - // qOverPt /= -invPtToDPhi_; - - if (settings_->debug() == 6 and digitize_) { - cout << "HT mbin " << int(l1track3D.getCellLocationHT().first) - 16 << " cbin " - << int(l1track3D.getCellLocationHT().second) - 32 << " iPhi " << l1track3D.iPhiSec() << " iEta " - << l1track3D.iEtaReg() << endl; - cout << "Second Helix variables: numeratorPt = " << numeratorPt << ", numeratorPhi = " << numeratorPhi - << ", numeratorZ0 = " << numeratorZ0 << " numeratorLambda = " << numeratorLambda - << " denominator = " << denominator << " reciprocal = " << reciprocal << " denominatorZ = " << denominatorZ - << " reciprocalZ = " << reciprocalZ << endl; - cout << setw(10) << "Final Helix parameters: qOverPt = " << qOverPt << " (" << floor(qOverPt * qOverPtMult_) - << "), phiT = " << phiT << " (" << floor(phiT * phiTMult_) << "), zT = " << zT << " (" << floor(zT * z0Mult_) - << "), tanLambda = " << tanLambda << " (" << floor(tanLambda * tanLambdaMult_) << ")" - << " z0 " << z0 << endl; - } else if (settings_->debug() == 6) { - cout << setw(10) << "Final Helix parameters: qOverPt = " << qOverPt << ", phi0 = " << phi0 << ", z0 = " << z0 - << ", tanLambda = " << tanLambda << endl; - } - - double chi2_phi = 0.; - double chi2_z = 0.; - - for (const Stub* stub : fitStubs) { - double ResPhi = 0.; - double ResZ = 0.; - if (digitize_) { - (const_cast(stub))->digitizeForHTinput(l1track3D.iPhiSec()); - (const_cast(stub))->digitizeForSFinput(); - const DigitalStub digiStub = (const_cast(stub))->digitalStub(); - ResPhi = digiStub.phiS() - phiT - qOverPt * digiStub.rt(); - ResZ = digiStub.z() - zT - tanLambda * digiStub.rt(); - // ResZ = digiStub.z() - z0 - tanLambda*digiStub.r(); - } else { - ResPhi = reco::deltaPhi((const_cast(stub))->phi(), phi0 + qOverPt * (const_cast(stub))->r()); - ResZ = (const_cast(stub))->z() - z0 - tanLambda * (const_cast(stub))->r(); - } - - double RPhiSigma = 0.0002; - float RZSigma = (const_cast(stub))->zErr() + fabs(tanLambda) * (const_cast(stub))->rErr(); - - if (not(const_cast(stub))->barrel()) - RPhiSigma = 0.0004; - - if (digitize_) { - RPhiSigma = floor(RPhiSigma * phiMult_) / phiMult_; - } - - // if(!(const_cast(stub))->psModule()) RZSigma = 5; - - ResPhi /= RPhiSigma; - // cout << "zT "<< zT << " tanLambda "<< t<< RZSigma << endl; - ResZ /= RZSigma; - - chi2_phi += fabs(ResPhi * ResPhi); - chi2_z += fabs(ResZ * ResZ); - if (settings_->debug() == 6) { - cout << "Stub ResPhi " << ResPhi * RPhiSigma << " ResSigma " << RPhiSigma << " Res " << ResPhi << " chi2 " - << chi2_phi << endl; - cout << "Stub ResZ " << ResZ * RZSigma << " ResSigma " << RZSigma << " Res " << ResZ << " chi2 " << chi2_z - << endl; - } - } - qOverPt /= invPtToDPhi_; - - bool accepted = false; - // double chi2 = (chi2_phi + chi2_z)/2.; - // double chi2 = sqrt(chi2_phi*chi2_phi + chi2_z*chi2_z)/2; - - double chi2 = chi2_phi; // Ignore r-z residuals due to poor 2S resolution? - if (digitize_) - chi2 = floor(chi2 * chi2Mult_) / chi2Mult_; - - // cout << "chi2 "<< chi2 << " phi "<< chi2_phi << " z "<< chi2_z << endl; - float dof = 2 * fitStubs.size() - 4; - float chi2dof = chi2 / dof; - if (chi2 < chi2cut_) - accepted = true; - - if (settings_->debug() == 6) - cout << "qOverPt " << qOverPt << " phiT " << phiT << endl; - - // This condition can only happen if cfg param TrackFitCheat = True. - if (fitStubs.size() < 4) - accepted = false; - - // Kinematic cuts -- NOT YET IN FIRMWARE!!! - const float tolerance = 0.1; - if (fabs(qOverPt) > 1. / (settings_->houghMinPt() - 0.1)) - accepted = false; - if (fabs(z0) > 20.) - accepted = false; - - // Create the L1fittedTrack object - const unsigned int hitPattern = 0; // FIX: Needs setting - L1fittedTrack fitTrk( - settings_, l1track3D, fitStubs, hitPattern, qOverPt, 0., phi0, z0, tanLambda, chi2_phi, chi2_z, 4, accepted); - - if (settings_->enableDigitize()) - fitTrk.digitizeTrack("SimpleLR"); - - if (settings_->debug() == 6 and digitize_) { - cout << "Digitized parameters " << endl; - cout << "HT mbin " << int(l1track3D.getCellLocationHT().first) - 16 << " cbin " - << int(l1track3D.getCellLocationHT().second) - 32 << " iPhi " << l1track3D.iPhiSec() << " iEta " - << l1track3D.iEtaReg() << endl; - cout << setw(10) << "First Helix parameters: qOverPt = " << fitTrk.qOverPt() << " oneOver2r " - << fitTrk.digitaltrack().oneOver2r() << " (" << floor(fitTrk.digitaltrack().oneOver2r() * qOverPtMult_) - << "), phi0 = " << fitTrk.digitaltrack().phi0() << " (" << fitTrk.digitaltrack().iDigi_phi0rel() - << "), zT = " << zT << " (" << floor(zT * z0Mult_) << "), tanLambda = " << tanLambda << " (" - << floor(tanLambda * tanLambdaMult_) << ")" << endl; - } - - if (settings_->debug() == 6) { - cout << "FitTrack helix parameters " << int(fitTrk.getCellLocationFit().first) - 16 << ", " - << int(fitTrk.getCellLocationFit().second) - 32 << " HT parameters " - << int(fitTrk.getCellLocationHT().first) - 16 << ", " << int(fitTrk.getCellLocationHT().second) - 32 << endl; - - if (fitTrk.getMatchedTP() != nullptr) { - cout << "VERY GOOD! " << chi2dof << endl; - cout << "TP qOverPt " << fitTrk.getMatchedTP()->qOverPt() << " phi0 " << fitTrk.getMatchedTP()->phi0() << endl; - if (!accepted) - cout << "BAD CHI2 " << chi2 << " chi2/ndof " << chi2dof << endl; - } else { - cout << "FAKE TRACK!!! " << chi2 << " chi2/ndof " << chi2dof << endl; - if (l1track3D.getMatchedTP() != nullptr) - cout << "was good" << endl; - } - cout << "layers in track " << fitTrk.getNumLayers() << endl; - } - - return fitTrk; -} diff --git a/L1Trigger/TrackFindingTMTT/src/SimpleLR4.cc b/L1Trigger/TrackFindingTMTT/src/SimpleLR4.cc new file mode 100644 index 0000000000000..a88268975ceee --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/SimpleLR4.cc @@ -0,0 +1,490 @@ +///=== This is the global Linear Regression for 4 helix parameters track fit algorithm. + +///=== Written by: Davide Cieri + +#include "L1Trigger/TrackFindingTMTT/interface/SimpleLR4.h" +#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" +#include "L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h" +#include "DataFormats/Math/interface/deltaPhi.h" + +#include +#include +#include +#include + +using namespace std; + +namespace tmtt { + + SimpleLR4::SimpleLR4(const Settings* settings) : TrackFitGeneric(settings) { + debug_ = false; // Enable debug printout. + + // Initialize digitization parameters + phiMult_ = pow(2., settings_->phiSBits()) / settings_->phiSRange(); + rTMult_ = pow(2., settings_->rtBits()) / settings_->rtRange(); + zMult_ = pow(2., settings_->zBits()) / settings_->zRange(); + z0Mult_ = pow(2., settings_->slr_z0Bits()) / settings_->slr_z0Range(); + phiTMult_ = pow(2., settings_->slr_phi0Bits()) / settings_->slr_phi0Range(); + + qOverPtMult_ = pow(2., settings_->slr_oneOver2rBits()) / settings_->slr_oneOver2rRange(); + tanLambdaMult_ = pow(2., settings_->slr_tanlambdaBits()) / settings_->slr_tanlambdaRange(); + chi2Mult_ = pow(2., settings_->slr_chisquaredBits()) / settings_->slr_chisquaredRange(); + + numeratorPtMult_ = rTMult_ * phiMult_; + numeratorPhiMult_ = rTMult_ * rTMult_ * phiMult_; + numeratorZ0Mult_ = rTMult_ * rTMult_ * z0Mult_; + numeratorLambdaMult_ = rTMult_ * z0Mult_; + denominatorMult_ = rTMult_ * rTMult_; + resMult_ = rTMult_ * qOverPtMult_; + + digitize_ = settings_->digitizeSLR() and settings_->enableDigitize(); + dividerBitsHelix_ = settings_->dividerBitsHelix(); + dividerBitsHelixZ_ = settings_->dividerBitsHelixZ(); + shiftingBitsDenRPhi_ = settings_->ShiftingBitsDenRPhi(); + shiftingBitsDenRZ_ = settings_->ShiftingBitsDenRZ(); + + shiftingBitsPhi_ = settings_->ShiftingBitsPhi(); + shiftingBitsz0_ = settings_->ShiftingBitsZ0(); + shiftingBitsPt_ = settings_->ShiftingBitsPt(); + shiftingBitsLambda_ = settings_->ShiftingBitsLambda(); + + phiSectorWidth_ = 2. * M_PI / float(settings_->numPhiSectors()); + phiNonantWidth_ = 2. * M_PI / float(settings_->numPhiNonants()); + + chi2cut_ = settings_->slr_chi2cut(); + chosenRofPhi_ = settings_->chosenRofPhi(); + if (digitize_) + chosenRofPhi_ = floor(chosenRofPhi_ * rTMult_) / rTMult_; + }; + + static bool pair_compare(std::pair a, std::pair b) { + return (a.second < b.second); + } + + L1fittedTrack SimpleLR4::fit(const L1track3D& l1track3D) { + if (debug_) + PrintL1trk() << "=============== FITTING SimpleLR TRACK ===================="; + + minStubLayersRed_ = Utility::numLayerCut(Utility::AlgoStep::FIT, + settings_, + l1track3D.iPhiSec(), + l1track3D.iEtaReg(), + std::abs(l1track3D.qOverPt()), + l1track3D.eta()); + + invPtToDPhi_ = -settings_->invPtToDphi(); + + double phiCentreSec0 = -0.5 * phiNonantWidth_ + 0.5 * phiSectorWidth_; + phiSectorCentre_ = phiSectorWidth_ * double(l1track3D.iPhiSec()) - phiCentreSec0; + + if (digitize_) + phiSectorCentre_ = floor(phiSectorCentre_ * phiTMult_) / phiTMult_; + + // Inizialise track fit parameters + double qOverPt = 0.; + double phiT = 0.; + double phi0 = 0.; + double z0 = 0.; + double zT = 0.; + double tanLambda = 0.; + + // Inizialise Sums + double SumRPhi = 0.; + double SumR = 0.; + double SumPhi = 0.; + double SumR2 = 0.; + double SumRZ = 0.; + double SumZ = 0.; + + unsigned int numStubs = 0; + // Calc helix parameters on Rphi Plane (STEP 1) + // This loop calculates the sums needed to calculate the numerators and the denominator to compute the helix parameters in the R-Phi plane (q/pT, phiT) + for (Stub* stub : l1track3D.stubs()) { + numStubs++; + + if (digitize_) { + const DigitalStub* digiStub = stub->digitalStub(); + + SumRPhi = SumRPhi + digiStub->rt_SF_TF() * digiStub->phiS(); + SumR = SumR + digiStub->rt_SF_TF(); + SumPhi = SumPhi + digiStub->phiS(); + SumR2 = SumR2 + digiStub->rt_SF_TF() * digiStub->rt_SF_TF(); + if (debug_) + PrintL1trk() << "Input stub (digi): phiS " << digiStub->iDigi_PhiS() << " rT " << digiStub->iDigi_Rt() + << " z " << digiStub->iDigi_Z(); + } else { + float phi = 0; + if (l1track3D.iPhiSec() == 0 and stub->phi() > 0) { + phi = stub->phi() - 2 * M_PI; + } else if (l1track3D.iPhiSec() == settings_->numPhiSectors() and stub->phi() < 0) { + phi = stub->phi() + 2 * M_PI; + } else { + phi = stub->phi(); + } + SumRPhi = SumRPhi + stub->r() * phi; + SumR = SumR + stub->r(); + SumPhi = SumPhi + phi; + SumR2 = SumR2 + stub->r() * stub->r(); + if (debug_) + PrintL1trk() << "InputStub (float): phi " << phi << " r " << stub->r() << " z " << stub->z(); + } + } + + double numeratorPt, digiNumeratorPt; + double denominator, digiDenominator; + double numeratorPhi, digiNumeratorPhi; + double reciprocal, digiReciprocal; + double numeratorZ0; + double numeratorLambda; + + digiNumeratorPt = (numStubs * SumRPhi - SumR * SumPhi); + digiDenominator = (numStubs * SumR2 - SumR * SumR); + digiNumeratorPhi = (SumR2 * SumPhi - SumR * SumRPhi); + + if (!digitize_) { + qOverPt = (numStubs * SumRPhi - SumR * SumPhi) / (numStubs * SumR2 - SumR * SumR); + phi0 = (SumR2 * SumPhi - SumR * SumRPhi) / (numStubs * SumR2 - SumR * SumR); + } else { + digiNumeratorPt /= pow(2., shiftingBitsPt_); + digiNumeratorPt = floor(digiNumeratorPt * numeratorPtMult_); + numeratorPt = digiNumeratorPt / numeratorPtMult_; + + digiNumeratorPhi /= pow(2., shiftingBitsPhi_); + digiNumeratorPhi = floor(digiNumeratorPhi * numeratorPhiMult_); + numeratorPhi = digiNumeratorPhi / numeratorPhiMult_; + + digiDenominator /= pow(2., shiftingBitsDenRPhi_); + digiDenominator = (floor(digiDenominator * denominatorMult_) + 0.5); + denominator = digiDenominator / denominatorMult_; + digiReciprocal = (pow(2., dividerBitsHelix_) - 1) / (denominator); // To be moved + digiReciprocal = floor(digiReciprocal / denominatorMult_); + reciprocal = digiReciprocal * denominatorMult_; + + qOverPt = numeratorPt * reciprocal / pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPt_); + phiT = numeratorPhi * reciprocal / pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPhi_); + + qOverPt = floor(qOverPt * qOverPtMult_) / (qOverPtMult_); + phiT = floor(phiT * phiTMult_) / phiTMult_; + } + + if (debug_) { + if (digitize_) { + PrintL1trk() << setw(10) << "Input helix (digi): qOverPt = " << qOverPt << " (" << floor(qOverPt * qOverPtMult_) + << "), phiT = " << phiT << " (" << floor(phiT * phiTMult_) << ") "; + } else { + PrintL1trk() << "Input Helix (float): qOverPt = " << qOverPt << " phi0 " << phi0; + } + } + + // ================== RESIDUAL CALCULATION ON RPHI ======================== + std::vector > vRes; + unsigned int psStubs = 0; + for (Stub* stub : l1track3D.stubs()) { + if (stub->psModule()) + psStubs++; + double ResPhi; + + if (digitize_) { + const DigitalStub* digiStub = stub->digitalStub(); + + ResPhi = + digiStub->iDigi_PhiS() * pow(2., shiftingBitsDenRPhi_ - shiftingBitsPt_) - + floor(phiT * phiTMult_) * + pow(2., shiftingBitsDenRPhi_ - shiftingBitsPt_ - settings_->slr_phi0Bits() + settings_->phiSBits()) - + floor(qOverPt * qOverPtMult_) * digiStub->iDigi_Rt(); + + ResPhi = floor(ResPhi) / resMult_; + } + + else { + ResPhi = reco::deltaPhi(stub->phi(), phi0 + qOverPt * stub->r()); + } + + double Res = std::abs(ResPhi); + + std::pair ResStubPair(stub, Res); + vRes.push_back(ResStubPair); + if (debug_) { + if (stub->assocTP() != nullptr) + PrintL1trk() << " Stub rphi residual " << Res << " TP " << stub->assocTP()->index(); + else + PrintL1trk() << " Stub rphi residual " << Res << " TP nullptr"; + } + } + + double largestResidual = 9999.; + // Find largest residuals + while (vRes.size() > minStubLayersRed_ and largestResidual > settings_->ResidualCut()) { + std::vector >::iterator maxResIt = max_element(vRes.begin(), vRes.end(), pair_compare); + largestResidual = (*maxResIt).second; + if (debug_) + PrintL1trk() << "Largest Residual " << largestResidual; + + if (largestResidual > settings_->ResidualCut()) { + if ((*maxResIt).first->psModule()) { + if (psStubs > 2) { + if (debug_) + PrintL1trk() << "removing PS residual " << (*maxResIt).second; + vRes.erase(maxResIt); + psStubs--; + } else { + if (debug_) + PrintL1trk() << "residual " << (*maxResIt).second << " set to -1. "; + (*maxResIt).second = -1.; + } + } else { + vRes.erase(maxResIt); + if (debug_) + PrintL1trk() << "removing residual " << (*maxResIt).second; + } + } + } + + std::vector fitStubs; + for (std::pair ResStubPair : vRes) { + fitStubs.push_back(ResStubPair.first); + } + + phiT = 0.; + zT = 0.; + + SumRPhi = 0.; + SumR = 0.; + SumPhi = 0.; + SumR2 = 0.; + SumRZ = 0.; + SumZ = 0.; + double SumR_ps = 0.; + double SumR2_ps = 0.; + + numStubs = 0; + psStubs = 0; + + for (const Stub* stub : fitStubs) { + if (stub->psModule()) + psStubs++; + + numStubs++; + if (digitize_) { + const DigitalStub* digiStub = stub->digitalStub(); + SumRPhi += digiStub->rt_SF_TF() * digiStub->phiS(); + SumR += digiStub->rt_SF_TF(); + SumPhi += digiStub->phiS(); + SumR2 += digiStub->rt_SF_TF() * digiStub->rt_SF_TF(); + if (stub->psModule()) { + SumRZ += digiStub->rt_SF_TF() * digiStub->z(); + SumZ += digiStub->z(); + SumR_ps += digiStub->rt_SF_TF(); + SumR2_ps += digiStub->rt_SF_TF() * digiStub->rt_SF_TF(); + } + if (debug_) { + PrintL1trk() << "phiS " << digiStub->iDigi_PhiS() << " rT " << digiStub->iDigi_Rt() << " z " + << digiStub->iDigi_Z(); + } + } else { + float phi = 0; + if (l1track3D.iPhiSec() == 0 and stub->phi() > 0) { + phi = stub->phi() - 2 * M_PI; + } else if (l1track3D.iPhiSec() == settings_->numPhiSectors() and stub->phi() < 0) { + phi = stub->phi() + 2 * M_PI; + } else { + phi = stub->phi(); + } + + SumRPhi += stub->r() * phi; + SumR += stub->r(); + SumPhi += phi; + SumR2 += stub->r() * stub->r(); + if (stub->psModule()) { + SumRZ += stub->r() * stub->z(); + SumZ += stub->z(); + SumR_ps += stub->r(); + SumR2_ps += stub->r() * stub->r(); + } + if (debug_) + PrintL1trk() << "phi " << phi << " r " << stub->r() << " z " << stub->z(); + } + } + + numeratorZ0 = (SumR2_ps * SumZ - SumR_ps * SumRZ); + numeratorLambda = (psStubs * SumRZ - SumR_ps * SumZ); + numeratorPt = (numStubs * SumRPhi - SumR * SumPhi); + denominator = (numStubs * SumR2 - SumR * SumR); + double denominatorZ = (psStubs * SumR2_ps - SumR_ps * SumR_ps); + numeratorPhi = (SumR2 * SumPhi - SumR * SumRPhi); + double reciprocalZ; + if (!digitize_) { + z0 = numeratorZ0 / denominatorZ; + tanLambda = numeratorLambda / denominatorZ; + qOverPt = (numStubs * SumRPhi - SumR * SumPhi) / (numStubs * SumR2 - SumR * SumR); + phi0 = (SumR2 * SumPhi - SumR * SumRPhi) / (numStubs * SumR2 - SumR * SumR); + } else { + numeratorPt /= pow(2., shiftingBitsPt_); + numeratorPt = floor(numeratorPt * numeratorPtMult_) / numeratorPtMult_; + + numeratorPhi /= pow(2., shiftingBitsPhi_); + numeratorPhi = floor(numeratorPhi * numeratorPhiMult_) / numeratorPhiMult_; + + numeratorLambda /= pow(2., shiftingBitsLambda_); + numeratorLambda = floor(numeratorLambda * numeratorLambdaMult_) / numeratorLambdaMult_; + + numeratorZ0 /= pow(2., shiftingBitsz0_); + numeratorZ0 = floor(numeratorZ0 * numeratorZ0Mult_) / numeratorZ0Mult_; + + denominator /= pow(2., shiftingBitsDenRPhi_); + denominator = (floor(denominator * denominatorMult_) + 0.5) / denominatorMult_; + reciprocal = (pow(2., dividerBitsHelix_) - 1) / (denominator); + reciprocal = floor(reciprocal / denominatorMult_) * denominatorMult_; + + denominatorZ /= pow(2., shiftingBitsDenRZ_); + denominatorZ = (floor(denominatorZ * denominatorMult_) + 0.5) / denominatorMult_; + reciprocalZ = (pow(2., dividerBitsHelixZ_) - 1) / (denominatorZ); + reciprocalZ = floor(reciprocalZ / denominatorMult_) * denominatorMult_; + + qOverPt = numeratorPt * reciprocal / pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPt_); + phiT = numeratorPhi * reciprocal / pow(2., dividerBitsHelix_ + shiftingBitsDenRPhi_ - shiftingBitsPhi_); + + tanLambda = + numeratorLambda * reciprocalZ / pow(2., dividerBitsHelixZ_ + shiftingBitsDenRZ_ - shiftingBitsLambda_); + zT = numeratorZ0 * reciprocalZ / pow(2., dividerBitsHelixZ_ + shiftingBitsDenRZ_ - shiftingBitsz0_); + + phi0 = phiSectorCentre_ + phiT - qOverPt * settings_->chosenRofPhi(); + z0 = zT - tanLambda * settings_->chosenRofPhi(); + + qOverPt = floor(qOverPt * qOverPtMult_) / qOverPtMult_; + phiT = floor(phiT * phiTMult_) / phiTMult_; + } + + if (debug_ and digitize_) { + PrintL1trk() << "HT mbin " << int(l1track3D.cellLocationHT().first) - 16 << " cbin " + << int(l1track3D.cellLocationHT().second) - 32 << " iPhi " << l1track3D.iPhiSec() << " iEta " + << l1track3D.iEtaReg(); + PrintL1trk() << "Second Helix variables: numeratorPt = " << numeratorPt << ", numeratorPhi = " << numeratorPhi + << ", numeratorZ0 = " << numeratorZ0 << " numeratorLambda = " << numeratorLambda + << " denominator = " << denominator << " reciprocal = " << reciprocal + << " denominatorZ = " << denominatorZ << " reciprocalZ = " << reciprocalZ; + PrintL1trk() << setw(10) << "Final Helix parameters: qOverPt = " << qOverPt << " (" + << floor(qOverPt * qOverPtMult_) << "), phiT = " << phiT << " (" << floor(phiT * phiTMult_) + << "), zT = " << zT << " (" << floor(zT * z0Mult_) << "), tanLambda = " << tanLambda << " (" + << floor(tanLambda * tanLambdaMult_) << ")" + << " z0 " << z0; + } else if (debug_) { + PrintL1trk() << setw(10) << "Final Helix parameters: qOverPt = " << qOverPt << ", phi0 = " << phi0 + << ", z0 = " << z0 << ", tanLambda = " << tanLambda; + } + + double chi2_phi = 0.; + double chi2_z = 0.; + + for (const Stub* stub : fitStubs) { + double ResPhi = 0.; + double ResZ = 0.; + if (digitize_) { + const DigitalStub* digiStub = stub->digitalStub(); + ResPhi = digiStub->phiS() - phiT - qOverPt * digiStub->rt_SF_TF(); + ResZ = digiStub->z() - zT - tanLambda * digiStub->rt_SF_TF(); + } else { + ResPhi = reco::deltaPhi(stub->phi(), phi0 + qOverPt * stub->r()); + ResZ = stub->z() - z0 - tanLambda * stub->r(); + } + + double RPhiSigma = 0.0002; + float RZSigma = stub->sigmaZ() + std::abs(tanLambda) * stub->sigmaR(); + + if (not stub->barrel()) + RPhiSigma = 0.0004; + + if (digitize_) { + RPhiSigma = floor(RPhiSigma * phiMult_) / phiMult_; + } + + ResPhi /= RPhiSigma; + ResZ /= RZSigma; + + chi2_phi += std::abs(ResPhi * ResPhi); + chi2_z += std::abs(ResZ * ResZ); + if (debug_) { + PrintL1trk() << "Stub ResPhi " << ResPhi * RPhiSigma << " ResSigma " << RPhiSigma << " Res " << ResPhi + << " chi2 " << chi2_phi; + PrintL1trk() << "Stub ResZ " << ResZ * RZSigma << " ResSigma " << RZSigma << " Res " << ResZ << " chi2 " + << chi2_z; + } + } + qOverPt /= invPtToDPhi_; + + bool accepted = false; + + //double chi2 = chi2_phi; // Ignore r-z residuals due to poor 2S resolution? + double chi2 = chi2_phi + chi2_z; + if (digitize_) + chi2 = floor(chi2 * chi2Mult_) / chi2Mult_; + + constexpr unsigned int nHelixPar = 4; + float dof = 2 * fitStubs.size() - nHelixPar; + float chi2dof = chi2 / dof; + if (chi2 < chi2cut_) + accepted = true; + + if (debug_) + PrintL1trk() << "qOverPt " << qOverPt << " phiT " << phiT; + + // This condition can only happen if cfg param TrackFitCheat = True. + if (fitStubs.size() < minStubLayersRed_) + accepted = false; + + // Kinematic cuts -- NOT YET IN FIRMWARE!!! + constexpr float tolerance = 0.1; + if (std::abs(qOverPt) > 1. / (settings_->houghMinPt() - tolerance)) + accepted = false; + if (std::abs(z0) > 20.) + accepted = false; + + if (accepted) { + // Create the L1fittedTrack object + const unsigned int hitPattern = 0; // FIX: Needs setting + L1fittedTrack fitTrk( + settings_, &l1track3D, fitStubs, hitPattern, qOverPt, 0., phi0, z0, tanLambda, chi2_phi, chi2_z, nHelixPar); + + if (settings_->enableDigitize()) + fitTrk.digitizeTrack("SimpleLR4"); + + if (debug_ and digitize_) { + PrintL1trk() << "Digitized parameters "; + PrintL1trk() << "HT mbin " << int(l1track3D.cellLocationHT().first) - 16 << " cbin " + << int(l1track3D.cellLocationHT().second) - 32 << " iPhi " << l1track3D.iPhiSec() << " iEta " + << l1track3D.iEtaReg(); + PrintL1trk() << setw(10) << "First Helix parameters: qOverPt = " << fitTrk.qOverPt() << " oneOver2r " + << fitTrk.digitaltrack()->oneOver2r() << " (" + << floor(fitTrk.digitaltrack()->oneOver2r() * qOverPtMult_) + << "), phi0 = " << fitTrk.digitaltrack()->phi0() << " (" << fitTrk.digitaltrack()->iDigi_phi0rel() + << "), zT = " << zT << " (" << floor(zT * z0Mult_) << "), tanLambda = " << tanLambda << " (" + << floor(tanLambda * tanLambdaMult_) << ")"; + } + + if (debug_) { + PrintL1trk() << "FitTrack helix parameters " << int(fitTrk.cellLocationFit().first) - 16 << ", " + << int(fitTrk.cellLocationFit().second) - 32 << " HT parameters " + << int(fitTrk.cellLocationHT().first) - 16 << ", " << int(fitTrk.cellLocationHT().second) - 32; + + if (fitTrk.matchedTP() != nullptr) { + PrintL1trk() << "True track: chi2/ndf " << chi2dof; + PrintL1trk() << "TP qOverPt " << fitTrk.matchedTP()->qOverPt() << " phi0 " << fitTrk.matchedTP()->phi0(); + if (!accepted) + PrintL1trk() << "Track rejected " << chi2 << " chi2/ndof " << chi2dof; + } else { + PrintL1trk() << "Fake track!!! " << chi2 << " chi2/ndof " << chi2dof; + } + PrintL1trk() << "layers in track " << fitTrk.numLayers(); + } + + return fitTrk; + + } else { + L1fittedTrack rejectedTrk; + return rejectedTrk; + } + } + +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/Stub.cc b/L1Trigger/TrackFindingTMTT/src/Stub.cc index 9dca1b701d27c..71678b3b0d65d 100644 --- a/L1Trigger/TrackFindingTMTT/src/Stub.cc +++ b/L1Trigger/TrackFindingTMTT/src/Stub.cc @@ -2,15 +2,12 @@ #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "Geometry/CommonTopologies/interface/PixelGeomDetUnit.h" #include "Geometry/CommonTopologies/interface/PixelTopology.h" - -//#include "SimTracker/TrackTriggerAssociation/interface/TTStubAssociationMap.h" #include "DataFormats/Math/interface/deltaPhi.h" #include "FWCore/Utilities/interface/Exception.h" -#include "TRandom.h" #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" #include "L1Trigger/TrackFindingTMTT/interface/TP.h" -#include "L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h" +#include "L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h" #include @@ -18,25 +15,18 @@ using namespace std; namespace tmtt { - // Static variables - - std::atomic Stub::trackerGeometryVersion_ = 0; - std::atomic Stub::stubKillerInit_ = false; - thread_local StubKiller Stub::stubKiller_; - - //=== Store useful info about the stub (for use with HYBRID code), with hard-wired constants to allow use outside CMSSW. + //=== Hybrid L1 tracking: stub constructor. Stub::Stub(double phi, double r, double z, double bend, - int layerid, + unsigned int layerId, bool psModule, bool barrel, unsigned int iphi, double alpha, const Settings* settings, - const TrackerTopology* trackerTopology, unsigned int ID, unsigned int iPhiSec) : phi_(phi), @@ -45,121 +35,75 @@ namespace tmtt { bend_(bend), iphi_(iphi), alpha_(alpha), + digitalStub_(std::make_unique(settings, r, phi, z, iPhiSec)), psModule_(psModule), - layerId_(layerid), - endcapRing_(0), - barrel_(barrel), - digitalStub_(settings, r, phi, z, iPhiSec), - stubWindowSuggest_(settings) { //work in progress on better constructor for new hybrid + layerId_(layerId), + layerIdReduced_(TrackerModule::calcLayerIdReduced(layerId)), + barrel_(barrel) { //work in progress on better constructor for new hybrid if (psModule && barrel) { - double zMax[4]; - settings->get_zMaxNonTilted(zMax); - tiltedBarrel_ = (fabs(z) > zMax[layerid]); + // max z at which non-tilted modules are found in 3 barrel PS layers. (Element 0 not used). + const vector& zMax = settings->zMaxNonTilted(); + tiltedBarrel_ = (std::abs(z) > zMax[layerId]); } else { tiltedBarrel_ = false; } - if (!psModule) { + tiltAngle_ = 0.; // Not used if cfg uses "ApproxB". + if (psModule) { + stripPitch_ = settings->psPixelPitch(); + stripLength_ = settings->psPixelLength(); + nStrips_ = settings->psNStrips(); + } else { stripPitch_ = settings->ssStripPitch(); + stripLength_ = settings->ssStripLength(); nStrips_ = settings->ssNStrips(); - sigmaPar_ = settings->ssStripLength() / std::sqrt(12.0); - } else { - stripPitch_ = settings->psStripPitch(); - nStrips_ = settings->psNStrips(); - sigmaPar_ = settings->psPixelLength() / std::sqrt(12.0); } - sigmaPerp_ = stripPitch_ / std::sqrt(12.0); index_in_vStubs_ = ID; // A unique ID to label the stub. } - //=== Store useful info about stub (for use with TMTT tracking). + //=== TMTT L1 tracking: stub constructor. Stub::Stub(const TTStubRef& ttStubRef, unsigned int index_in_vStubs, const Settings* settings, - const TrackerGeometry* trackerGeometry, - const TrackerTopology* trackerTopology) - : TTStubRef(ttStubRef), + const TrackerTopology* trackerTopology, + const TrackerModule* trackerModule, + const StubKiller* stubKiller) + : ttStubRef_(ttStubRef), settings_(settings), index_in_vStubs_(index_in_vStubs), assocTP_(nullptr), // Initialize in case job is using no MC truth info. - digitalStub_(settings), - digitizedForGPinput_(false), // notes that stub has not yet been digitized for GP input. - digitizedForHTinput_(false), // notes that stub has not yet been digitized for HT input. - digitizedForSForTFinput_( - ""), // notes that stub has not yet been digitized for seed filter or track fitter input. digitizeWarningsOn_(true), - stubWindowSuggest_(settings, trackerTopology), // TMTT recommendations for stub window sizes to CMS. - degradeBend_(trackerTopology) // Used to degrade stub bend information. - { - // Determine tracker geometry version (T3, T4, T5 ...) - this->setTrackerGeometryVersion(trackerGeometry, trackerTopology); - - // Initialize tool to optionally emulate dead modules. - - if (not stubKillerInit_) { - stubKillerInit_ = true; - stubKiller_.initialise(settings->killScenario(), trackerTopology, trackerGeometry); - } - + lastDigiStep_(Stub::DigiStage::NONE), + trackerModule_(trackerModule), // Info about tracker module containing stub + degradeBend_(trackerTopology), // Used to degrade stub bend information. + // Module related variables (need to be stored for Hybrid) + psModule_(trackerModule->psModule()), + layerId_(trackerModule->layerId()), + layerIdReduced_(trackerModule->layerIdReduced()), + barrel_(trackerModule->barrel()), + tiltedBarrel_(trackerModule->tiltedBarrel()), + tiltAngle_(trackerModule->tiltAngle()), + stripPitch_(trackerModule->stripPitch()), + stripLength_(trackerModule->stripLength()), + nStrips_(trackerModule->nStrips()) { // Get coordinates of stub. - const TTStub* ttStubP = ttStubRef.get(); - - // The stub gives access to the DetId of the stacked module, but we want the DetId of the lower of - // the two sensors in the module. - - /* - // This the way CMS usually does this conversion, but it uses huge amounts of CPU. - DetId geoDetId; - for (const GeomDet* gd : trackerGeometry->dets()) { - DetId detid = gd->geographicalId(); - if (detid.subdetId() != StripSubdetector::TOB && detid.subdetId() != StripSubdetector::TID) continue; // Phase 2 Outer Tracker uses TOB for entire barrel & TID for entire endcap. - if ( trackerTopology->isLower(detid) ) { // Select only lower of the two sensors in a module. - DetId stackDetid = trackerTopology->stack(detid); // Det ID of stacked module containing stub. - if ( ttStubRef->getDetId() == stackDetid ) { - geoDetId = detid; // Note Det ID of lower sensor in stacked module containing stub. - break; - } - } - } - if (geoDetId.null()) throw cms::Exception("Stub: Det ID corresponding to Stub not found"); - */ - - // This is a faster way we found of doing the conversion. It seems to work ... - DetId stackDetid = ttStubRef->getDetId(); - DetId geoDetId(stackDetid.rawId() + 1); - if (not(trackerTopology->isLower(geoDetId) && trackerTopology->stack(geoDetId) == stackDetid)) - throw cms::Exception("Stub: determination of detId went wrong"); - - const GeomDetUnit* det0 = trackerGeometry->idToDetUnit(geoDetId); - // To get other module, can do this - // const GeomDetUnit* det1 = trackerGeometry->idToDetUnit( trackerTopology->partnerDetId( geoDetId ) ); + const TTStub* ttStubP = ttStubRef_.get(); - const PixelGeomDetUnit* theGeomDet = dynamic_cast(det0); - const PixelTopology* topol = dynamic_cast(&(theGeomDet->specificTopology())); - MeasurementPoint measurementPoint = ttStubRef->clusterRef(0)->findAverageLocalCoordinatesCentered(); - LocalPoint clustlp = topol->localPosition(measurementPoint); - GlobalPoint pos = theGeomDet->surface().toGlobal(clustlp); + const PixelGeomDetUnit* specDet = trackerModule_->specDet(); + const PixelTopology* specTopol = trackerModule_->specTopol(); + MeasurementPoint measurementPoint = ttStubRef_->clusterRef(0)->findAverageLocalCoordinatesCentered(); + LocalPoint clustlp = specTopol->localPosition(measurementPoint); + GlobalPoint pos = specDet->surface().toGlobal(clustlp); phi_ = pos.phi(); r_ = pos.perp(); z_ = pos.z(); if (r_ < settings_->trackerInnerRadius() || r_ > settings_->trackerOuterRadius() || - fabs(z_) > settings_->trackerHalfLength()) { - throw cms::Exception( - "Stub: Stub found outside assumed tracker volume. Please update tracker dimensions specified in Settings.h!") - << " r=" << r_ << " z=" << z_ << " " << ttStubRef->getDetId().subdetId() << endl; - } - - // Set info about the module this stub is in - this->setModuleInfo(trackerGeometry, trackerTopology, geoDetId); - // Uncertainty in stub coordinates due to strip or pixel length in r-z. - if (barrel_) { - rErr_ = 0.; - zErr_ = 0.5 * stripLength_; - } else { - rErr_ = 0.5 * stripLength_; - zErr_ = 0.; + std::abs(z_) > settings_->trackerHalfLength()) { + throw cms::Exception("BadConfig") << "Stub: Stub found outside assumed tracker volume. Please update tracker " + "dimensions specified in Settings.h!" + << " r=" << r_ << " z=" << z_ << " id=" << trackerModule_->detId().subdetId(); } // Get the coordinates of the two clusters that make up this stub, measured in units of strip pitch, and measured @@ -177,92 +121,52 @@ namespace tmtt { // Determine alpha correction for non-radial strips in endcap 2S modules. // (If true hit at larger r than stub r by deltaR, then stub phi needs correcting by +alpha*deltaR). alpha_ = 0.; - if ((not barrel_) && (not psModule_)) { - float fracPosInModule = (float(iphi_) - 0.5 * float(nStrips_)) / float(nStrips_); - float phiRelToModule = sensorWidth_ * fracPosInModule / r_; + if ((not barrel()) && (not psModule())) { + float fracPosInModule = (float(iphi_) - 0.5 * float(nStrips())) / float(nStrips()); + float phiRelToModule = trackerModule_->sensorWidth() * fracPosInModule / r_; if (z_ < 0) phiRelToModule *= -1; - if (outerModuleAtSmallerR_) + if (trackerModule_->outerModuleAtSmallerR()) phiRelToModule *= -1; // Module flipped. // If true hit at larger r than stub r by deltaR, then stub phi needs correcting by +alpha*deltaR. alpha_ = -phiRelToModule / r_; } - // Calculate constants used to interpret bend information. - - // float sensorSpacing = barrel_ ? (moduleMaxR_ - moduleMinR_) : (moduleMaxZ_ - moduleMinZ_); - // EJC Above not true for tilted modules - float sensorSpacing = sqrt((moduleMaxR_ - moduleMinR_) * (moduleMaxR_ - moduleMinR_) + - (moduleMaxZ_ - moduleMinZ_) * (moduleMaxZ_ - moduleMinZ_)); - - pitchOverSep_ = stripPitch_ / sensorSpacing; - // IRT - use stub (r,z) instead of module (r,z). Logically correct but has negligable effect on results. - // This old equation was valid for flat geom, where all modules are parallel or perpendicular to beam. - //dphiOverBend_ = barrel_ ? pitchOverSep_ : pitchOverSep_*fabs(z_)/r_; - // EJC - This new equation is valid in general case, so works for both flat and tilted geom. - dphiOverBendCorrection_ = fabs(cos(this->theta() - moduleTilt_) / sin(this->theta())); - dphiOverBendCorrection_approx_ = getApproxB(); - if (settings->useApproxB()) { - dphiOverBend_ = pitchOverSep_ * dphiOverBendCorrection_approx_; - } else { - dphiOverBend_ = pitchOverSep_ * dphiOverBendCorrection_; - } + // Calculate variables giving ratio of track intercept angle to stub bend. + this->calcDphiOverBend(); // Get stub bend that is available in front-end electronics, where bend is displacement between // two hits in stubs in units of strip pitch. - bendInFrontend_ = ttStubRef->bendFE(); - if ((not barrel_) && pos.z() > 0) + bendInFrontend_ = ttStubRef_->bendFE(); + if ((not barrel()) && pos.z() > 0) bendInFrontend_ *= -1; - // EJC Bend in barrel seems to be flipped in tilted geom. - if (barrel_) + if (barrel()) bendInFrontend_ *= -1; // Get stub bend that is available in off-detector electronics, allowing for degredation of // bend resolution due to bit encoding by FE chip if required. - bool rejectStub = false; // indicates if bend is outside window assumed in DegradeBend.h - numMergedBend_ = 1; // Number of bend values merged into single degraded one. + numMergedBend_ = 1; // Number of bend values merged into single degraded one. if (settings->degradeBendRes() == 2) { float degradedBend; // degraded bend - this->degradeResolution( - bendInFrontend_, degradedBend, rejectStub, numMergedBend_); // sets value of last 3 arguments. + // This returns values of degradedBend & numMergedBend_ + this->degradeResolution(bendInFrontend_, degradedBend, numMergedBend_); bend_ = degradedBend; } else if (settings->degradeBendRes() == 1) { - bend_ = ttStubRef->bendBE(); // Degraded bend from official CMS recipe. - if ((not barrel_) && pos.z() > 0) + bend_ = ttStubRef_->bendBE(); // Degraded bend from official CMS recipe. + if ((not barrel()) && pos.z() > 0) bend_ *= -1; - if (barrel_) + if (barrel()) bend_ *= -1; } else { bend_ = bendInFrontend_; } // Fill frontendPass_ flag, indicating if frontend readout electronics will output this stub. - this->setFrontend(rejectStub); + this->setFrontend(stubKiller); // Calculate bin range along q/Pt axis of r-phi Hough transform array consistent with bend of this stub. this->calcQoverPtrange(); - // Initialize class used to produce digital version of stub, with original stub parameters pre-digitization. - digitalStub_.init(phi_, - r_, - z_, - min_qOverPt_bin_, - max_qOverPt_bin_, - layerId_, - this->layerIdReduced(), - bend_, - stripPitch_, - sensorSpacing, - rErr_, - zErr_, - barrel_, - tiltedBarrel_, - psModule_); - - // Update recommended stub window sizes that TMTT recommends that CMS should use in FE electronics. - if (settings_->printStubWindows()) - stubWindowSuggest_.process(this); - // Initialize truth info to false in case job is using no MC truth info. for (unsigned int iClus = 0; iClus <= 1; iClus++) { assocTPofCluster_[iClus] = nullptr; @@ -273,13 +177,13 @@ namespace tmtt { void Stub::calcQoverPtrange() { // First determine bin range along q/Pt axis of HT array - const int nbinsPt = - (int)settings_->houghNbinsPt(); // Use "int" as nasty things happen if multiply "int" and "unsigned int". + // (Use "int" as nasty things happen if multiply "int" and "unsigned int"). + const int nbinsPt = (int)settings_->houghNbinsPt(); const int min_array_bin = 0; const int max_array_bin = nbinsPt - 1; // Now calculate range of q/Pt bins allowed by bend filter. - float qOverPtMin = this->qOverPtOverBend() * (this->bend() - this->bendRes()); - float qOverPtMax = this->qOverPtOverBend() * (this->bend() + this->bendRes()); + float qOverPtMin = this->qOverPtOverBend() * (this->bend() - this->bendCut()); + float qOverPtMax = this->qOverPtOverBend() * (this->bend() + this->bendCut()); int houghNbinsPt = settings_->houghNbinsPt(); const float houghMaxInvPt = 1. / settings_->houghMinPt(); float qOverPtBinSize = (2. * houghMaxInvPt) / houghNbinsPt; @@ -290,7 +194,6 @@ namespace tmtt { // with the stub bend. Instead using "tmp = 0.0" accepts cells if q/Pt at any point in cell is consistent with bend. // So if you use change from -0.5 to 0.0, you have to tighten the bend cut (by ~0.05) to get similar performance. // Decision to set tmp = 0.0 taken in softare & GP firmware on 9th August 2016. - //float tmp = ( settings_->shape() == 2 || settings_->shape() == 1 || settings_->shape() == 3 ) ? 1. : -0.5; float tmp = (settings_->shape() == 2 || settings_->shape() == 1 || settings_->shape() == 3) ? 1. : 0.; int min_bin = std::floor(-tmp + (qOverPtMin + houghMaxInvPt) / qOverPtBinSize); @@ -304,7 +207,6 @@ namespace tmtt { if (min_bin > max_bin) { min_bin = max_array_bin; max_bin = min_array_bin; - //if (frontendPass_) throw cms::Exception("Stub: m bin calculation found low Pt stub not killed by FE electronics cuts")<enableDigitize()) { - // Save CPU by not redoing digitization if stub was already digitized for this phi sector. - if (!(digitizedForGPinput_ && digitalStub_.iGetNonant(iPhiSec) == digitalStub_.iDigi_Nonant())) { - // Digitize - digitalStub_.makeGPinput(iPhiSec); - - // Replace stub coordinates with those degraded by digitization process. - phi_ = digitalStub_.phi(); - r_ = digitalStub_.r(); - z_ = digitalStub_.z(); - bend_ = digitalStub_.bend(); - - // If the Stub class contains any data members that are not input to the GP, but are derived from variables that - // are, then be sure to update these here too, unless Stub.h uses the check*() functions to declare them invalid. - dphiOverBendCorrection_ = fabs(cos(this->theta() - moduleTilt_) / sin(this->theta())); - dphiOverBend_ = pitchOverSep_ * dphiOverBendCorrection_; - - // Note that stub has been digitized for GP input - digitizedForGPinput_ = true; - } - digitizedForHTinput_ = false; - } - } - - //=== Digitize stub for input to Hough transform, with digitized phi coord. measured relative to specified phi sector. - - void Stub::digitizeForHTinput(unsigned int iPhiSec) { - if (settings_->enableDigitize()) { - // Save CPU by not redoing digitization if stub was already digitized for this phi sector. - if (!(digitizedForHTinput_ && iPhiSec == digitalStub_.iDigi_PhiSec())) { - // Call digitization for GP in case not already done. (Needed for variables that are common to GP & HT). - this->digitizeForGPinput(iPhiSec); - - // Digitize - digitalStub_.makeHTinput(iPhiSec); - - // Since GP and HT use same digitisation in r and z, don't bother updating their values. - // (Actually, the phi digitisation boundaries also match, except for systolic array, so could skip updating phi too). - - // Replace stub coordinates and bend with those degraded by digitization process. (Don't bother with r & z, as already done by GP digitisation). - phi_ = digitalStub_.phi(); - - // Recalculate bin range along q/Pt axis of r-phi Hough transform array - // consistent with bend of this stub, since it depends on r & z which have now been digitized. - // (This recalculation should really be done in DigitalStub::makeHTinput(), but too lazy to move it there ...). - this->calcQoverPtrange(); - - // If the Stub class contains any data members that are not input to the HT, but are derived from variables that - // are, then be sure to update these here too, unless Stub.h uses the check*() functions to declare them invalid. - // - currently none. - - // Note that stub has been digitized. - digitizedForHTinput_ = true; - } - } - } - - //=== Digitize stub for input to r-z Seed Filter or Track Fitter. - //=== Argument is "SeedFilter" or name of Track Fitter. - - void Stub::digitizeForSForTFinput(string SForTF) { - if (settings_->enableDigitize()) { - if (digitizedForSForTFinput_ != SForTF) { - // Digitize variables specific to seed filter or track fittr if not already done. - digitalStub_.makeSForTFinput(SForTF); - - // Replace stub (r,z) uncertainties, estimated from half-pixel/strip-length, by those degraded by the digitization process. - rErr_ = digitalStub_.rErr(); - zErr_ = digitalStub_.zErr(); - // Must also replace stub r coordinate, as seed filter & fitters work with digitized r instead of digitized rT. - r_ = digitalStub_.r(); - // And KF may also redigitize z. - z_ = digitalStub_.z(); - - digitizedForSForTFinput_ = SForTF; + bool updated = true; + if (not digitalStub_) { + // Digitize stub if not yet done. + digitalStub_ = + std::make_unique(settings_, phi_, r_, z_, min_qOverPt_bin_, max_qOverPt_bin_, bend_, iPhiSec); + } else { + // If digitization already done, redo phi digi if phi sector has changed. + updated = digitalStub_->changePhiSec(iPhiSec); } - } - } - //=== Digitize stub for input to r-z Seed Filter. + // Save CPU by only updating if something has changed. + if (updated || digiStep != lastDigiStep_) { + lastDigiStep_ = digiStep; - void Stub::digitizeForDRinput(unsigned int stubId) { - if (settings_->enableDigitize()) { - // Digitize variables specific to seed filter if not already done. - digitalStub_.makeDRinput(stubId); - // digitizedForDRinput_ = true; - } - } - - //=== Restore stub to pre-digitized state. i.e. Undo what function digitize() did. - - void Stub::reset_digitize() { - if (settings_->enableDigitize()) { - // Save CPU by not undoing digitization if stub was not already digitized. - if (digitizedForGPinput_ || digitizedForHTinput_) { - // Replace stub coordinates and bend with original coordinates stored prior to any digitization. - phi_ = digitalStub_.orig_phi(); - r_ = digitalStub_.orig_r(); - z_ = digitalStub_.orig_z(); - bend_ = digitalStub_.orig_bend(); - - // Also restore original uncertainties in stub coordinates (estimated from strip or pixel half-length). - rErr_ = digitalStub_.orig_rErr(); - zErr_ = digitalStub_.orig_zErr(); - - // Note that stub is (no longer) digitized. - digitizedForGPinput_ = false; - digitizedForHTinput_ = false; - digitizedForSForTFinput_ = ""; - - // If the Stub class contains any data members that are not input to the GP or HT, but are derived from - // variables that are, then be sure to update these here too. - dphiOverBendCorrection_ = fabs(cos(this->theta() - moduleTilt_) / sin(this->theta())); - dphiOverBend_ = pitchOverSep_ * dphiOverBendCorrection_; + // Replace stub coords with those degraded by digitization process. + if (digiStep == DigiStage::GP) { + phi_ = digitalStub_->phi_GP(); + } else { + phi_ = digitalStub_->phi_HT_TF(); + } + if (digiStep == DigiStage::GP || digiStep == DigiStage::HT) { + r_ = digitalStub_->r_GP_HT(); + } else { + r_ = digitalStub_->r_SF_TF(); + } + z_ = digitalStub_->z(); + bend_ = digitalStub_->bend(); + + // Update data members that depend on updated coords. + // (Logically part of digitisation, so disable warnings) + digitizeWarningsOn_ = false; + if (digiStep == DigiStage::GP) + this->calcDphiOverBend(); + if (digiStep == DigiStage::HT) + this->calcQoverPtrange(); + digitizeWarningsOn_ = true; } } } //=== Degrade assumed stub bend resolution. - //=== Also return boolean indicating if stub bend was outside assumed window, so stub should be rejected - //=== and return an integer indicating how many values of bend are merged into this single one. + //=== And return an integer indicating how many values of bend are merged into this single one. - void Stub::degradeResolution(float bend, float& degradedBend, bool& reject, unsigned int& num) const { + void Stub::degradeResolution(float bend, float& degradedBend, unsigned int& num) const { // If TMTT code is tightening official CMS FE stub window cuts, then calculate TMTT stub windows. float windowFE; if (settings_->killLowPtStubs()) { // Window size corresponding to Pt cut used for tracking. float invPtMax = 1. / (settings_->houghMinPt()); - windowFE = invPtMax / fabs(this->qOverPtOverBend()); + windowFE = invPtMax / std::abs(this->qOverPtOverBend()); // Increase half-indow size to allow for resolution in bend. - windowFE += this->bendResInFrontend(); + windowFE += this->bendCutInFrontend(); } else { - windowFE = 99999.; // TMTT is not tightening windows. - } - - static std::atomic firstErr = true; - if (trackerGeometryVersion_ < 5) { - if (firstErr) { - cout << "Stub: WARNING - Stub windows in DegradeBend class have not been tuned for flat tracker geometry, so " - "may need retuning " - << trackerGeometryVersion_ << endl; - firstErr = false; - } + windowFE = rejectedStubBend_; // TMTT is not tightening windows. } - degradeBend_.degrade(bend, psModule_, idDet_, windowFE, degradedBend, reject, num); + degradeBend_.degrade(bend, psModule(), trackerModule_->detId(), windowFE, degradedBend, num); } //=== Set flag indicating if stub will be output by front-end readout electronics //=== (where we can reconfigure the stub window size and rapidity cut). - //=== Argument indicates if stub bend was outside window size encoded in DegradeBend.h - //=== Note that this should run on quantities as available inside front-end chip, which are not - //=== degraded by loss of bits or digitisation. - void Stub::setFrontend(bool rejectStub) { + void Stub::setFrontend(const StubKiller* stubKiller) { frontendPass_ = true; // Did stub pass cuts applied in front-end chip stubFailedDegradeWindow_ = false; // Did it only fail cuts corresponding to windows encoded in DegradeBend.h? // Don't use stubs at large eta, since it is impossible to form L1 tracks from them, so they only contribute to combinatorics. - if (fabs(this->eta()) > settings_->maxStubEta()) + if (std::abs(this->eta()) > settings_->maxStubEta()) frontendPass_ = false; // Don't use stubs whose Pt is significantly below the Pt cut used in the L1 tracking, allowing for uncertainty in q/Pt due to stub bend resolution. + const float qOverPtCut = 1. / settings_->houghMinPt(); if (settings_->killLowPtStubs()) { - const float qOverPtCut = 1. / settings_->houghMinPt(); // Apply this cut in the front-end electronics. - if (fabs(this->bendInFrontend()) - this->bendResInFrontend() > qOverPtCut / this->qOverPtOverBend()) - frontendPass_ = false; - // Reapply the same cut using the degraded bend information available in the off-detector electronics. - // The reason is that the bend degredation can move the Pt below the Pt cut, making the stub useless to the off-detector electronics. - if (fabs(this->bend()) - this->bendRes() > qOverPtCut / this->qOverPtOverBend()) + if (std::abs(this->bendInFrontend()) - this->bendCutInFrontend() > qOverPtCut / this->qOverPtOverBend()) frontendPass_ = false; } - // Don't use stubs whose bend is outside the window encoded into DegradeBend.h - if (rejectStub) { - if (frontendPass_) - stubFailedDegradeWindow_ = true; - frontendPass_ = false; + + if (frontendPass_ && this->bend() == rejectedStubBend_) { + throw cms::Exception( + "LogicError: Window sizes assumed in DegradeBend are tighter than those used for TTStub production. Please " + "fix them"); } - // Emulate stubs in dead tracker regions using private TMTT emulation. - if (settings_->deadSimulateFrac() > 0.) { // Is option to emulate dead modules enabled? - const DeadModuleDB dead; - if (dead.killStub(this)) { - static thread_local TRandom randomGenerator; - if (randomGenerator.Rndm() < settings_->deadSimulateFrac()) - frontendPass_ = false; - } + if (settings_->killLowPtStubs()) { + // Reapply the same cut using the degraded bend information available in the off-detector electronics. + // The reason is that the bend degredation can move the Pt below the Pt cut, making the stub useless to the off-detector electronics. + if (std::abs(this->bend()) - this->bendCut() > qOverPtCut / this->qOverPtOverBend()) + frontendPass_ = false; } - // Or emulate stubs in dead tracker regions using communal emulation shared with Tracklet. - if (settings_->killScenario() > 0) { - TTStubRef ttStubRef(*this); // Cast to base class - bool kill = stubKiller_.killStub(ttStubRef.get()); + // Emulate stubs in dead tracker regions.. + StubKiller::KillOptions killScenario = static_cast(settings_->killScenario()); + if (killScenario != StubKiller::KillOptions::none) { + bool kill = stubKiller->killStub(ttStubRef_.get()); if (kill) frontendPass_ = false; } } //=== Function to calculate approximation for dphiOverBendCorrection aka B - double Stub::getApproxB() { - if (tiltedBarrel_) { - return settings_->bApprox_gradient() * fabs(z_) / r_ + settings_->bApprox_intercept(); + double Stub::approxB() { + if (tiltedBarrel()) { + return settings_->bApprox_gradient() * std::abs(z_) / r_ + settings_->bApprox_intercept(); + } else { + return barrel() ? 1 : std::abs(z_) / r_; + } + } + + //=== Calculate variables giving ratio of track intercept angle to stub bend. + + void Stub::calcDphiOverBend() { + // Uses stub (r,z) instead of module (r,z). Logically correct but has negligable effect on results. + if (settings_->useApproxB()) { + float dphiOverBendCorrection_approx_ = approxB(); + dphiOverBend_ = trackerModule_->pitchOverSep() * dphiOverBendCorrection_approx_; } else { - return barrel_ ? 1 : fabs(z_) / r_; + float dphiOverBendCorrection_ = std::abs(cos(this->theta() - trackerModule_->tiltAngle()) / sin(this->theta())); + dphiOverBend_ = trackerModule_->pitchOverSep() * dphiOverBendCorrection_; } } @@ -527,16 +343,14 @@ namespace tmtt { void Stub::fillTruth(const map, const TP*>& translateTP, const edm::Handle& mcTruthTTStubHandle, const edm::Handle& mcTruthTTClusterHandle) { - TTStubRef ttStubRef(*this); // Cast to base class - //--- Fill assocTP_ info. If both clusters in this stub were produced by the same single tracking particle, find out which one it was. - bool genuine = mcTruthTTStubHandle->isGenuine(ttStubRef); // Same TP contributed to both clusters? + bool genuine = mcTruthTTStubHandle->isGenuine(ttStubRef_); // Same TP contributed to both clusters? assocTP_ = nullptr; // Require same TP contributed to both clusters. if (genuine) { - edm::Ptr tpPtr = mcTruthTTStubHandle->findTrackingParticlePtr(ttStubRef); + edm::Ptr tpPtr = mcTruthTTStubHandle->findTrackingParticlePtr(ttStubRef_); if (translateTP.find(tpPtr) != translateTP.end()) { assocTP_ = translateTP.at(tpPtr); // N.B. Since not all tracking particles are stored in InputData::vTPs_, sometimes no match will be found. @@ -554,7 +368,7 @@ namespace tmtt { // We consider stubs in which this TP contributed to either cluster. for (unsigned int iClus = 0; iClus <= 1; iClus++) { // Loop over both clusters that make up stub. - const TTClusterRef& ttClusterRef = ttStubRef->clusterRef(iClus); + const TTClusterRef& ttClusterRef = ttStubRef_->clusterRef(iClus); // Now identify all TP's contributing to either cluster in stub. vector > vecTpPtr = mcTruthTTClusterHandle->findTrackingParticlePtrs(ttClusterRef); @@ -571,7 +385,7 @@ namespace tmtt { //--- Also note which tracking particles produced the two clusters that make up the stub for (unsigned int iClus = 0; iClus <= 1; iClus++) { // Loop over both clusters that make up stub. - const TTClusterRef& ttClusterRef = ttStubRef->clusterRef(iClus); + const TTClusterRef& ttClusterRef = ttStubRef_->clusterRef(iClus); bool genuineCluster = mcTruthTTClusterHandle->isGenuine(ttClusterRef); // Only 1 TP made cluster? assocTPofCluster_[iClus] = nullptr; @@ -586,203 +400,5 @@ namespace tmtt { } } } - - // Sanity check - is truth info of stub consistent with that of its clusters? - // Commented this out, as it throws errors for unknown reason with iErr=1. Apparently, "genuine" stubs can be composed of two clusters that are - // not "genuine", providing that one of the TP that contributed to each cluster was the same. - /* - unsigned int iErr = 0; - if (this->genuine()) { // Stub matches truth particle - if ( ! ( this->genuineCluster()[0] && (this->assocTPofCluster()[0] == this->assocTPofCluster()[1]) ) ) iErr = 1; - } else { - if ( ! ( ! this->genuineCluster()[0] || (this->assocTPofCluster()[0] != this->assocTPofCluster()[1]) ) ) iErr = 2; - } - if (iErr > 0) { - cout<<" DEBUGA "<<(this->assocTP() == nullptr)<assocTPofCluster()[0] == nullptr)<<" "<<(this->assocTPofCluster()[1] == nullptr)<genuineCluster()[0]<<" "<genuineCluster()[1]<assocTPofCluster()[0] != nullptr) cout<<" DEBUGD "<assocTPofCluster()[0]->index()<assocTPofCluster()[1] != nullptr) cout<<" DEBUGE "<assocTPofCluster()[1]->index()< Stub::trkPhiAtR(float rad) const { - float rStubMax = r_ + rErr_; // Uncertainty in radial stub coordinate due to strip length. - float rStubMin = r_ - rErr_; - float trkPhi1 = (phi_ + dphi() * (1. - rad / rStubMin)); - float trkPhi2 = (phi_ + dphi() * (1. - rad / rStubMax)); - float trkPhi = 0.5 * (trkPhi1 + trkPhi2); - float errTrkPhi = 0.5 * fabs(trkPhi1 - trkPhi2); - return pair(trkPhi, errTrkPhi); - } - - //=== Note if stub is a crazy distance from the tracking particle trajectory that produced it. - //=== If so, it was probably produced by a delta ray. - - bool Stub::crazyStub() const { - bool crazy; - if (assocTP_ == nullptr) { - crazy = false; // Stub is fake, but this is not crazy. It happens ... - } else { - // Stub was produced by TP. Check it lies not too far from TP trajectory. - crazy = fabs(reco::deltaPhi(phi_, assocTP_->trkPhiAtStub(this))) > settings_->crazyStubCut(); - } - return crazy; - } - - //=== Get reduced layer ID (in range 1-7), which can be packed into 3 bits so simplifying the firmware). - - unsigned int Stub::layerIdReduced() const { - // Don't bother distinguishing two endcaps, as no track can have stubs in both. - unsigned int lay = (layerId_ < 20) ? layerId_ : layerId_ - 10; - - // No genuine track can have stubs in both barrel layer 6 and endcap disk 11 etc., so merge their layer IDs. - // WARNING: This is tracker geometry dependent, so may need changing in future ... - if (lay == 6) - lay = 11; - if (lay == 5) - lay = 12; - if (lay == 4) - lay = 13; - if (lay == 3) - lay = 15; - // At this point, the reduced layer ID can have values of 1, 2, 11, 12, 13, 14, 15. So correct to put in range 1-7. - if (lay > 10) - lay -= 8; - - if (lay < 1 || lay > 7) - throw cms::Exception("Stub: Reduced layer ID out of expected range"); - - return lay; - } - - //=== Set info about the module that this stub is in. - - void Stub::setModuleInfo(const TrackerGeometry* trackerGeometry, - const TrackerTopology* trackerTopology, - const DetId& detId) { - idDet_ = detId; - - // Note if module is PS or 2S, and whether in barrel or endcap. - psModule_ = - trackerGeometry->getDetectorType(detId) == - TrackerGeometry::ModuleType:: - Ph2PSP; // From https://github.com/cms-sw/cmssw/blob/CMSSW_8_1_X/Geometry/TrackerGeometryBuilder/README.md - barrel_ = detId.subdetId() == StripSubdetector::TOB || detId.subdetId() == StripSubdetector::TIB; - - // Get min & max (r,phi,z) coordinates of the centre of the two sensors containing this stub. - const GeomDetUnit* det0 = trackerGeometry->idToDetUnit(detId); - const GeomDetUnit* det1 = trackerGeometry->idToDetUnit(trackerTopology->partnerDetId(detId)); - - float R0 = det0->position().perp(); - float R1 = det1->position().perp(); - float PHI0 = det0->position().phi(); - float PHI1 = det1->position().phi(); - float Z0 = det0->position().z(); - float Z1 = det1->position().z(); - moduleMinR_ = std::min(R0, R1); - moduleMaxR_ = std::max(R0, R1); - moduleMinPhi_ = std::min(PHI0, PHI1); - moduleMaxPhi_ = std::max(PHI0, PHI1); - moduleMinZ_ = std::min(Z0, Z1); - moduleMaxZ_ = std::max(Z0, Z1); - - // Note if tilted barrel module & get title angle (in range 0 to PI). - tiltedBarrel_ = barrel_ && (trackerTopology->tobSide(detId) != 3); - float deltaR = fabs(R1 - R0); - float deltaZ = (R1 - R0 > 0) ? (Z1 - Z0) : -(Z1 - Z0); - moduleTilt_ = atan2(deltaR, deltaZ); - if (moduleTilt_ > M_PI / 2.) - moduleTilt_ -= M_PI; // Put in range -PI/2 to +PI/2. - if (moduleTilt_ < -M_PI / 2.) - moduleTilt_ += M_PI; // - - // cout<<"DEBUG STUB "<layer(detId); // barrel layer 1-6 encoded as 1-6 - } else { - // layerId_ = 10*detId.iSide() + detId.iDisk(); // endcap layer 1-5 encoded as 11-15 (endcap A) or 21-25 (endcapB) - // EJC This seems to give the same encoding as what we had in CMSSW6 - layerId_ = 10 * trackerTopology->side(detId) + trackerTopology->tidWheel(detId); - } - - // Note module ring in endcap - endcapRing_ = barrel_ ? 0 : trackerTopology->tidRing(detId); - - if (trackerGeometryVersion_ >= 5) { // Tilted geometry - if (!barrel_) { - // Apply bodge, since Topology class annoyingly starts ring count at 1, even in endcap wheels where - // inner rings are absent. - unsigned int iWheel = trackerTopology->tidWheel(detId); - if (iWheel >= 3 && iWheel <= 5) - endcapRing_ += 3; - } - } - - // Get sensor strip or pixel pitch using innermost sensor of pair. - - const PixelGeomDetUnit* unit = reinterpret_cast(det0); - const PixelTopology& topo = unit->specificTopology(); - const Bounds& bounds = det0->surface().bounds(); - - std::pair pitch = topo.pitch(); - stripPitch_ = pitch.first; // Strip pitch (or pixel pitch along shortest axis) - stripLength_ = pitch.second; // Strip length (or pixel pitch along longest axis) - nStrips_ = topo.nrows(); // No. of strips in sensor - sensorWidth_ = bounds.width(); // Width of sensitive region of sensor (= stripPitch * nStrips). - - // Note if modules are flipped back-to-front. - outerModuleAtSmallerR_ = (det0->position().mag() > det1->position().mag()); - /* - if ( barrel_ && det0->position().perp() > det1->position().perp() ) { - outerModuleAtSmallerR_ = true; - } - */ - - sigmaPerp_ = stripPitch_ / sqrt(12.); // resolution perpendicular to strip (or to longest pixel axis) - sigmaPar_ = stripLength_ / sqrt(12.); // resolution parallel to strip (or to longest pixel axis) - } - - //=== Determine tracker geometry version by counting modules. - - void Stub::setTrackerGeometryVersion(const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology) { - // N.B. The relationship between Tracker geometry name (T3, T4, T5 ...) and CMS geometry name - // (D13, D17 ...) is documented in - // https://github.com/cms-sw/cmssw/blob/CMSSW_9_1_X/Configuration/Geometry/README.md . - - if (trackerGeometryVersion_ == 0) { - unsigned int numDet = 0; - for (const GeomDet* gd : trackerGeometry->dets()) { - DetId detid = gd->geographicalId(); - if (detid.subdetId() != StripSubdetector::TOB || - detid.subdetId() != - StripSubdetector::TID) { // Phase 2 Outer Tracker uses TOB for entire barrel & TID for entire endcap. - if (trackerTopology->isLower(detid)) { // Select only lower of the two sensors in a module. - numDet++; - } - } - } - - if (numDet == 13200) { - trackerGeometryVersion_ = 14; // Tilted geometry T14/T15 - } else if (numDet == 13296) { - trackerGeometryVersion_ = 5; // Tilted geometry T5/T6 - } else if (numDet == 14850) { - trackerGeometryVersion_ = 4; // Flat geometry T4 - } else { - trackerGeometryVersion_ = -1; - cout << "Stub: WARNING -- The tracker geometry you are using is yet not known to the stub class. Please update " - "Stub::degradeResolution() & Stub::setTrackerGeometryVersion(). Number of tracker modules = " - << numDet << endl; - } - } - } - } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/StubCluster.cc b/L1Trigger/TrackFindingTMTT/src/StubCluster.cc deleted file mode 100644 index 93d428bb21a20..0000000000000 --- a/L1Trigger/TrackFindingTMTT/src/StubCluster.cc +++ /dev/null @@ -1,125 +0,0 @@ -#include "L1Trigger/TrackFindingTMTT/interface/StubCluster.h" -#include "L1Trigger/TrackFindingTMTT/interface/Stub.h" -#include "L1Trigger/TrackFindingTMTT/interface/TP.h" -#include "DataFormats/Math/interface/deltaPhi.h" - -namespace tmtt { - - StubCluster::StubCluster(std::vector stubs, double SectorPhi, int lres_dr) : layerKF_(999) { - r_ = 0; - phi_ = 0; - z_ = 0; - eta_ = 0; - sigmaX_ = 0; - sigmaZ_ = 0; - layerId_ = 0; - endcapRing_ = 0; - barrel_ = false; - tiltedBarrel_ = false; - psModule_ = false; - nstubs_ = stubs.size(); - stubs_ = stubs; - dphi_dl_ = 0; - dphi_dr_ = 0; - dphi_ = 0; - deltai_ = 0; - alpha_ = 0; - moduleTilt_ = 0.; - - layerIdReduced_ = stubs.at(0)->layerIdReduced(); - layerId_ = stubs.at(0)->layerId(); - endcapRing_ = stubs.at(0)->endcapRing(); - barrel_ = stubs.at(0)->barrel(); - tiltedBarrel_ = stubs.at(0)->tiltedBarrel(); - psModule_ = stubs.at(0)->psModule(); - moduleTilt_ += stubs.at(0)->moduleTilt(); - - if (nstubs_ == 0) - return; - - double sum_r2(0), sum_z2(0), sum_phi2(0), sum_sigmaZ2(0), sum_dphi2_dr(0), sum_dphi2_dl(0); - int lsign(0); - - for (auto stub : stubs) { - r_ += stub->r(); - z_ += stub->z(); - eta_ += stub->eta(); - phi_ += reco::deltaPhi(stub->phi(), SectorPhi); - std::set assocTPs = stub->assocTPs(); - if (assocTPs.size()) { - assocTPs_.insert(assocTPs.begin(), assocTPs.end()); - } - sum_z2 += (stub->z() * stub->z()); - sum_r2 += (stub->r() * stub->r()); - sum_phi2 += (reco::deltaPhi(stub->phi(), SectorPhi) * reco::deltaPhi(stub->phi(), SectorPhi)); - - double dphi_dl = stub->sigmaX() / stub->r(); - sum_dphi2_dl += (dphi_dl * dphi_dl); - - int delta_i(0); - double delta_l(0); - if (0 < lres_dr && lres_dr < (int)stub->nStrips() / 3) { - delta_i = (stub->iphi() - 0.5 * stub->nStrips()) / lres_dr; - delta_l = (delta_i + 0.5) * stub->stripPitch() * lres_dr; - } else if (lres_dr == 0) { - delta_i = 0; - delta_l = 0; - } else { - delta_i = (stub->iphi() - 0.5 * stub->nStrips()); - delta_i = delta_i > 0 ? 0.5 * stub->nStrips() - 1 : -0.5 * stub->nStrips(); - delta_l = (delta_i + 0.5) * stub->stripPitch(); - } - - deltai_ += delta_i; - deltal_ += delta_l; - lsign += (delta_i > 0 ? +1 : -1); - - if (!stub->barrel()) { - double dphiOverdr = delta_l / (stub->r() * stub->r()); - double dphi_dr = dphiOverdr * stub->sigmaZ(); - sum_dphi2_dr += (dphi_dr * dphi_dr); - } - sum_sigmaZ2 += (stub->sigmaZ() * stub->sigmaZ()); - - alpha_ += stub->alpha(); - } - - r_ /= nstubs_; - z_ /= nstubs_; - eta_ /= nstubs_; - phi_ /= nstubs_; - deltal_ /= nstubs_; - deltai_ /= nstubs_; - - dphi_dr_ = sqrt(sum_dphi2_dr) / nstubs_; - dphi_dl_ = sqrt(sum_dphi2_dl) / nstubs_; - if (lsign < 0) { //if this sign is opposite, 1% eff. reduction is observed. - dphi_dr_ = -1. * dphi_dr_; - } - - double vZ(0); - if (nstubs_ == 1) { - sigmaX_ = stubs.front()->sigmaX(); - sigmaZ_ = stubs.front()->sigmaZ(); - dphi_ = sqrt(dphi_dr_ * dphi_dr_ + dphi_dl_ * dphi_dl_); - } else { - double vphi = (sum_phi2 - nstubs_ * phi_ * phi_) / (nstubs_ - 1); - dphi_ = sqrt(dphi_dr_ * dphi_dr_ + dphi_dl_ * dphi_dl_ + vphi); - - sigmaX_ = r_ * dphi_; - - if (stubs.front()->barrel()) { - vZ = (sum_z2 - nstubs_ * z_ * z_) / (nstubs_ - 1); - - } else { - vZ = (sum_r2 - nstubs_ * r_ * r_) / (nstubs_ - 1); - } - sigmaZ_ = sqrt(vZ * vZ + sum_sigmaZ2 / nstubs_); - } - - phi_ = reco::deltaPhi(phi_ + SectorPhi, 0.); - - alpha_ /= nstubs_; - } - -} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/StubKiller.cc b/L1Trigger/TrackFindingTMTT/src/StubKiller.cc index 886918e5b77c9..0845c47251000 100644 --- a/L1Trigger/TrackFindingTMTT/src/StubKiller.cc +++ b/L1Trigger/TrackFindingTMTT/src/StubKiller.cc @@ -1,19 +1,18 @@ -// Copied from https://raw.githubusercontent.com/EmyrClement/StubKiller/master/StubKiller.cc -// on 9th May 2018. - -// Changed to point to location we put it. -//#include "StubKiller.h" #include "L1Trigger/TrackFindingTMTT/interface/StubKiller.h" +#include "DataFormats/Math/interface/deltaPhi.h" +#include "FWCore/Utilities/interface/Exception.h" using namespace std; namespace tmtt { - StubKiller::StubKiller() - : killScenario_(0), - trackerTopology_(0), - trackerGeometry_(0), - layersToKill_(vector()), + StubKiller::StubKiller(StubKiller::KillOptions killScenario, + const TrackerTopology* trackerTopology, + const TrackerGeometry* trackerGeometry, + const edm::Event& event) + : killScenario_(killScenario), + trackerTopology_(trackerTopology), + trackerGeometry_(trackerGeometry), minPhiToKill_(0), maxPhiToKill_(0), minZToKill_(0), @@ -22,22 +21,24 @@ namespace tmtt { maxRToKill_(0), fractionOfStubsToKillInLayers_(0), fractionOfStubsToKillEverywhere_(0), - fractionOfModulesToKillEverywhere_(0) {} + fractionOfModulesToKillEverywhere_(0) { + if (rndmService_.isAvailable()) { + rndmEngine_ = &(rndmService_->getEngine(event.streamID())); + } else { + throw cms::Exception("BadConfig") + << "StubKiller: requires RandomNumberGeneratorService, not present in cfg file, namely:" << endl + << "process.RandomNumberGeneratorService=cms.Service('RandomNumberGeneratorService',TMTrackProducer=cms.PSet(" + "initialSeed=cms.untracked.uint32(12345)))"; + } - void StubKiller::initialise(unsigned int killScenario, - const TrackerTopology* trackerTopology, - const TrackerGeometry* trackerGeometry) { - killScenario_ = killScenario; - trackerTopology_ = trackerTopology; - trackerGeometry_ = trackerGeometry; + // These scenarios correspond to slide 12 of https://indico.cern.ch/event/719985/contributions/2970687/attachments/1634587/2607365/StressTestTF-Acosta-Apr18.pdf + // Scenario 1 - // These sceanrios correspond to slide 12 of https://indico.cern.ch/event/719985/contributions/2970687/attachments/1634587/2607365/StressTestTF-Acosta-Apr18.pdf - // Sceanrio 1 // kill layer 5 in one quadrant +5 % random module loss to connect to what was done before - if (killScenario_ == 1) { + if (killScenario_ == KillOptions::layer5) { layersToKill_ = {5}; minPhiToKill_ = 0; - maxPhiToKill_ = TMath::PiOver2(); + maxPhiToKill_ = 0.5 * M_PI; minZToKill_ = -1000; maxZToKill_ = 0; minRToKill_ = 0; @@ -46,12 +47,12 @@ namespace tmtt { fractionOfStubsToKillEverywhere_ = 0; fractionOfModulesToKillEverywhere_ = 0.05; } - // Sceanrio 2 + // Scenario 2 // kill layer 1 in one quadrant +5 % random module loss - else if (killScenario_ == 2) { + else if (killScenario_ == KillOptions::layer1) { layersToKill_ = {1}; minPhiToKill_ = 0; - maxPhiToKill_ = TMath::PiOver2(); + maxPhiToKill_ = 0.5 * M_PI; minZToKill_ = -1000; maxZToKill_ = 0; minRToKill_ = 0; @@ -62,10 +63,10 @@ namespace tmtt { } // Scenario 3 // kill layer 1 + layer 2, both in same quadrant - else if (killScenario_ == 3) { + else if (killScenario_ == KillOptions::layer1layer2) { layersToKill_ = {1, 2}; minPhiToKill_ = 0; - maxPhiToKill_ = TMath::PiOver2(); + maxPhiToKill_ = 0.5 * M_PI; minZToKill_ = -1000; maxZToKill_ = 0; minRToKill_ = 0; @@ -76,10 +77,10 @@ namespace tmtt { } // Scenario 4 // kill layer 1 and disk 1, both in same quadrant - else if (killScenario_ == 4) { + else if (killScenario_ == KillOptions::layer1disk1) { layersToKill_ = {1, 11}; minPhiToKill_ = 0; - maxPhiToKill_ = TMath::PiOver2(); + maxPhiToKill_ = 0.5 * M_PI; minZToKill_ = -1000; maxZToKill_ = 0; minRToKill_ = 0; @@ -90,7 +91,7 @@ namespace tmtt { } // An extra scenario not listed in the slides // 5% random module loss throughout tracker - else if (killScenario_ == 5) { + else if (killScenario_ == KillOptions::random) { layersToKill_ = {}; fractionOfStubsToKillInLayers_ = 0; fractionOfStubsToKillEverywhere_ = 0.; @@ -104,49 +105,10 @@ namespace tmtt { this->addDeadLayerModulesToDeadModuleList(); } - void StubKiller::chooseModulesToKill() { - TRandom randomGenerator; - for (const GeomDetUnit* gd : trackerGeometry_->detUnits()) { - if (!trackerTopology_->isLower(gd->geographicalId())) - continue; - if (randomGenerator.Rndm() < fractionOfModulesToKillEverywhere_) { - deadModules_[gd->geographicalId()] = 1; - } - } - } - - void StubKiller::addDeadLayerModulesToDeadModuleList() { - for (const GeomDetUnit* gd : trackerGeometry_->detUnits()) { - float moduleR = gd->position().perp(); - float moduleZ = gd->position().z(); - float modulePhi = gd->position().phi(); - DetId geoDetId = gd->geographicalId(); - bool isInBarrel = geoDetId.subdetId() == StripSubdetector::TOB || geoDetId.subdetId() == StripSubdetector::TIB; - - int layerID = 0; - if (isInBarrel) { - layerID = trackerTopology_->layer(geoDetId); - } else { - layerID = 10 * trackerTopology_->side(geoDetId) + trackerTopology_->tidWheel(geoDetId); - } - if (find(layersToKill_.begin(), layersToKill_.end(), layerID) != layersToKill_.end()) { - if (modulePhi < -1.0 * TMath::Pi()) - modulePhi += 2.0 * TMath::Pi(); - else if (modulePhi > TMath::Pi()) - modulePhi -= 2.0 * TMath::Pi(); - - if (modulePhi > minPhiToKill_ && modulePhi < maxPhiToKill_ && moduleZ > minZToKill_ && moduleZ < maxZToKill_ && - moduleR > minRToKill_ && moduleR < maxRToKill_) { - if (deadModules_.find(gd->geographicalId()) == deadModules_.end()) { - deadModules_[gd->geographicalId()] = fractionOfStubsToKillInLayers_; - } - } - } - } - } + // Indicate if given stub was killed by dead tracker module, based on dead module scenario. - bool StubKiller::killStub(const TTStub* stub) { - if (killScenario_ == 0) + bool StubKiller::killStub(const TTStub* stub) const { + if (killScenario_ == KillOptions::none) return false; else { bool killStubRandomly = killStub(stub, @@ -164,6 +126,8 @@ namespace tmtt { } } + // Indicate if given stub was killed by dead tracker module, based on dead regions specified here, + // and ignoring dead module scenario. // layersToKill - a vector stating the layers we are killing stubs in. Can be an empty vector. // Barrel layers are encoded as 1-6. The endcap layers are encoded as 11-15 (-z) and 21-25 (+z) // min/max Phi/Z/R - stubs within the region specified by these boundaries and layersToKill are flagged for killing @@ -171,7 +135,7 @@ namespace tmtt { // fractionOfStubsToKillEverywhere - The fraction of stubs to kill throughout the tracker bool StubKiller::killStub(const TTStub* stub, - const vector layersToKill, + const vector& layersToKill, const double minPhiToKill, const double maxPhiToKill, const double minZToKill, @@ -179,7 +143,7 @@ namespace tmtt { const double minRToKill, const double maxRToKill, const double fractionOfStubsToKillInLayers, - const double fractionOfStubsToKillEverywhere) { + const double fractionOfStubsToKillEverywhere) const { // Only kill stubs in specified layers if (layersToKill.size() > 0) { // Get the layer the stub is in, and check if it's in the layer you want to kill @@ -204,12 +168,7 @@ namespace tmtt { LocalPoint clustlp = topol->localPosition(measurementPoint); GlobalPoint pos = theGeomDet->surface().toGlobal(clustlp); - // Just in case phi is outside of -pi -> pi - double stubPhi = pos.phi(); - if (stubPhi < -1.0 * TMath::Pi()) - stubPhi += 2.0 * TMath::Pi(); - else if (stubPhi > TMath::Pi()) - stubPhi -= 2.0 * TMath::Pi(); + double stubPhi = reco::deltaPhi(pos.phi(), 0.); if (stubPhi > minPhiToKill && stubPhi < maxPhiToKill && pos.z() > minZToKill && pos.z() < maxZToKill && pos.perp() > minRToKill && pos.perp() < maxRToKill) { @@ -217,8 +176,7 @@ namespace tmtt { if (fractionOfStubsToKillInLayers == 1) { return true; } else { - static thread_local TRandom randomGenerator; - if (randomGenerator.Rndm() < fractionOfStubsToKillInLayers) { + if (rndmEngine_->flat() < fractionOfStubsToKillInLayers) { return true; } } @@ -228,8 +186,7 @@ namespace tmtt { // Kill fraction of stubs throughout tracker if (fractionOfStubsToKillEverywhere > 0) { - static thread_local TRandom randomGenerator; - if (randomGenerator.Rndm() < fractionOfStubsToKillEverywhere) { + if (rndmEngine_->flat() < fractionOfStubsToKillEverywhere) { return true; } } @@ -237,7 +194,9 @@ namespace tmtt { return false; } - bool StubKiller::killStubInDeadModule(const TTStub* stub) { + // Indicate if given stub was in (partially) dead tracker module, based on dead module scenario. + + bool StubKiller::killStubInDeadModule(const TTStub* stub) const { if (deadModules_.size() > 0) { DetId stackDetid = stub->getDetId(); DetId geoDetId(stackDetid.rawId() + 1); @@ -248,4 +207,42 @@ namespace tmtt { return false; } + // Identify modules to be killed, chosen randomly from those in the whole tracker. + + void StubKiller::chooseModulesToKill() { + for (const GeomDetUnit* gd : trackerGeometry_->detUnits()) { + if (!trackerTopology_->isLower(gd->geographicalId())) + continue; + if (rndmEngine_->flat() < fractionOfModulesToKillEverywhere_) { + deadModules_[gd->geographicalId()] = 1; + } + } + } + + // Identify modules to be killed, chosen based on location in tracker. + + void StubKiller::addDeadLayerModulesToDeadModuleList() { + for (const GeomDetUnit* gd : trackerGeometry_->detUnits()) { + float moduleR = gd->position().perp(); + float moduleZ = gd->position().z(); + float modulePhi = reco::deltaPhi(gd->position().phi(), 0.); + DetId geoDetId = gd->geographicalId(); + bool isInBarrel = geoDetId.subdetId() == StripSubdetector::TOB || geoDetId.subdetId() == StripSubdetector::TIB; + + int layerID = 0; + if (isInBarrel) { + layerID = trackerTopology_->layer(geoDetId); + } else { + layerID = 10 * trackerTopology_->side(geoDetId) + trackerTopology_->tidWheel(geoDetId); + } + if (find(layersToKill_.begin(), layersToKill_.end(), layerID) != layersToKill_.end()) { + if (modulePhi > minPhiToKill_ && modulePhi < maxPhiToKill_ && moduleZ > minZToKill_ && moduleZ < maxZToKill_ && + moduleR > minRToKill_ && moduleR < maxRToKill_) { + if (deadModules_.find(gd->geographicalId()) == deadModules_.end()) { + deadModules_[gd->geographicalId()] = fractionOfStubsToKillInLayers_; + } + } + } + } + } }; // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc b/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc index 77ef662884dc9..feb536692f9a9 100644 --- a/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc +++ b/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc @@ -1,62 +1,62 @@ #include "L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h" #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/TrackerModule.h" +#include "L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h" #include "DataFormats/DetId/interface/DetId.h" #include "FWCore/Utilities/interface/Exception.h" -namespace tmtt { +#include +#include + +using namespace std; - thread_local std::vector StubWindowSuggest::barrelCut_; - thread_local std::vector > StubWindowSuggest::ringCut_; - thread_local std::vector > StubWindowSuggest::tiltedCut_; - thread_local std::vector StubWindowSuggest::barrelNTilt_; +namespace { + std::mutex myMutex; +} + +namespace tmtt { //=== Analyse stub window required for this stub. - void StubWindowSuggest::process(const Stub* stub) { + void StubWindowSuggest::process(const TrackerTopology* trackerTopo, const Stub* stub) { + std::lock_guard myGuard(myMutex); // Allow only one thread. + // Half-size of FE chip bend window corresponding to Pt range in which tracks are to be found. const double invPtMax = 1 / ptMin_; - double bendHalfWind = invPtMax / fabs(stub->qOverPtOverBend()); + double bendHalfWind = invPtMax / std::abs(stub->qOverPtOverBend()); // Increase half-indow size to allow for resolution in bend. - bendHalfWind += stub->bendResInFrontend(); + bendHalfWind += stub->bendCutInFrontend(); // Stub bend is measured here in half-integer values. bendHalfWind = int(2 * bendHalfWind) / 2.; // Compare with half-size of FE bend window stored in arrays. - this->updateStoredWindow(stub, bendHalfWind); + this->updateStoredWindow(trackerTopo, stub, bendHalfWind); } //=== Update stored stub window size with this stub. - void StubWindowSuggest::updateStoredWindow(const Stub* stub, double bendHalfWind) { + void StubWindowSuggest::updateStoredWindow(const TrackerTopology* trackerTopo, + const Stub* stub, + double bendHalfWind) { // Values set according to L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py // parameter NTiltedRings for whichever tracker geometry (T3, T4, T5 ...) is used.. const vector barrelNTilt_init = {0., 12., 12., 12., 0., 0., 0.}; - if (stub->trackerGeometryVersion() >= 5) { // Tilted barrel - barrelNTilt_ = barrelNTilt_init; - } else { - throw cms::Exception( - "StubWindowSuggest: the tracker geometry you are using is not yet known to StubWindowSuggest. Please update " - "constant barrelNTilt_T*_init inside it.") - << " Geometry=" << stub->trackerGeometryVersion() << endl; - } + barrelNTilt_ = barrelNTilt_init; // This code should be kept almost identical to that in // L1Trigger/TrackTrigger/src/TTStubAlgorithm_official.cc // The only exceptions are lines marked "Modified by TMTT group" - DetId stDetId(stub->idDet()); - - // Modified by TMTT group, so we can update the numbers in the window size arrays. - //int window = 0; + DetId stDetId(stub->trackerModule()->detId()); if (stDetId.subdetId() == StripSubdetector::TOB) { - unsigned int layer = theTrackerTopo_->layer(stDetId); - unsigned int ladder = theTrackerTopo_->tobRod(stDetId); - int type = 2 * theTrackerTopo_->tobSide(stDetId) - 3; // -1 for tilted-, 1 for tilted+, 3 for flat + unsigned int layer = trackerTopo->layer(stDetId); + unsigned int ladder = trackerTopo->tobRod(stDetId); + int type = 2 * trackerTopo->tobSide(stDetId) - 3; // -1 for tilted-, 1 for tilted+, 3 for flat double corr = 0; - if (type < 3) // Only for tilted modules + if (type != TrackerModule::BarrelModuleType::flat) // Only for tilted modules { corr = (barrelNTilt_.at(layer) + 1) / 2.; ladder = @@ -71,7 +71,7 @@ namespace tmtt { storedHalfWindow = bendHalfWind; } else // Classic barrel window otherwise { - // Modified by TMTT group, to expland arrays if necessary, divide by 2, & update the stored window sizes. + // Modified by TMTT group, to expand arrays if necessary, divide by 2, & update the stored window sizes. if (barrelCut_.size() < (layer + 1)) barrelCut_.resize(layer + 1, 0.); double& storedHalfWindow = barrelCut_.at(layer); @@ -81,8 +81,8 @@ namespace tmtt { } else if (stDetId.subdetId() == StripSubdetector::TID) { // Modified by TMTT group, to expland arrays if necessary, divide by 2, & update the stored window sizes - unsigned int wheel = theTrackerTopo_->tidWheel(stDetId); - unsigned int ring = theTrackerTopo_->tidRing(stDetId); + unsigned int wheel = trackerTopo->tidWheel(stDetId); + unsigned int ring = trackerTopo->tidRing(stDetId); if (ringCut_.size() < (wheel + 1)) ringCut_.resize(wheel + 1); if (ringCut_.at(wheel).size() < (ring + 1)) @@ -95,53 +95,59 @@ namespace tmtt { //=== Print results (should be done in endJob(); - void StubWindowSuggest::printResults() { - cout << "==============================================================================" << endl; - cout << " Stub window sizes that TMTT suggests putting inside " << endl; - cout << " /L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py" << endl; - cout << " (These should give good efficiency, but tighter windows may be needed to" << endl; - cout << " limit the data rate from the FE tracker electronics)." << endl; - cout << "==============================================================================" << endl; + void StubWindowSuggest::printResults() const { + PrintL1trk(1) << "=============================================================================="; + PrintL1trk(1) << " Stub window sizes that TMTT suggests putting inside "; + PrintL1trk(1) << " /L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py"; + PrintL1trk(1) << " (These should give good efficiency, but tighter windows may be needed to"; + PrintL1trk(1) << " limit the data rate from the FE tracker electronics)."; + PrintL1trk(1) << "=============================================================================="; - int old_precision = cout.precision(); - cout.precision(1); // Set significant digits for print. + std::stringstream text; + string div; - string str; - - str = "BarrelCut = cms.vdouble( "; + text << "BarrelCut = cms.vdouble( "; + div = ""; for (const auto& cut : barrelCut_) { - cout << str << cut; - str = ", "; + text << div << cut; + div = ", "; } - cout << ")," << endl; + text << "),"; + PrintL1trk(1) << text.str(); - cout << "TiltedBarrelCutSet = cms.VPSET(" << endl; - cout << " cms.PSet( TiltedCut = cms.vdouble( 0 "; + PrintL1trk(1) << "TiltedBarrelCutSet = cms.VPSET( "; for (const auto& cutVec : tiltedCut_) { - str = " cms.PSet( TiltedCut = cms.vdouble( "; + text.str(""); + text << " cms.PSet( TiltedCut = cms.vdouble("; + if (cutVec.empty()) + text << "0"; + div = ""; for (const auto& cut : cutVec) { - cout << str << cut; - str = ", "; + text << div << cut; + div = ", "; } - cout << ") )," << endl; + text << "), ),"; + PrintL1trk(1) << text.str(); } - cout << ")," << endl; + PrintL1trk(1) << "),"; - cout << "EndcapCutSet = cms.VPSET(" << endl; - cout << " cms.PSet( EndcapCut = cms.vdouble( 0 "; + PrintL1trk(1) << "EndcapCutSet = cms.VPSET( "; for (const auto& cutVec : ringCut_) { - str = " cms.PSet( EndcapCut = cms.vdouble( "; + text.str(""); + text << " cms.PSet( EndcapCut = cms.vdouble("; + if (cutVec.empty()) + text << "0"; + div = ""; for (const auto& cut : cutVec) { - cout << str << cut; - str = ", "; + text << div << cut; + div = ", "; } - cout << ") )," << endl; + text << "), ),"; + PrintL1trk(1) << text.str(); } - cout << ")," << endl; - - cout.precision(old_precision); + PrintL1trk(1) << ")"; - cout << "==============================================================================" << endl; + PrintL1trk(1) << "=============================================================================="; } } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/TP.cc b/L1Trigger/TrackFindingTMTT/src/TP.cc index e9dab538ac8b0..580044a68f665 100644 --- a/L1Trigger/TrackFindingTMTT/src/TP.cc +++ b/L1Trigger/TrackFindingTMTT/src/TP.cc @@ -12,7 +12,7 @@ namespace tmtt { //=== Store useful info about this tracking particle TP::TP(const TrackingParticlePtr& tpPtr, unsigned int index_in_vTPs, const Settings* settings) - : TrackingParticlePtr(tpPtr), + : trackingParticlePtr_(tpPtr), index_in_vTPs_(index_in_vTPs), settings_(settings), pdgId_(tpPtr->pdgId()), @@ -40,7 +40,7 @@ namespace tmtt { //=== Fill truth info with association from tracking particle to stubs. - void TP::fillTruth(const vector& vStubs) { + void TP::fillTruth(const list& vStubs) { for (const Stub& s : vStubs) { for (const TP* tp_i : s.assocTPs()) { if (tp_i->index() == this->index()) @@ -57,17 +57,13 @@ namespace tmtt { //=== (i.e. If there is the slightest chance of reconstructing it, so as to measure fake rate). void TP::fillUse() { - const bool useOnlyInTimeParticles = false; - const bool useOnlyTPfromPhysicsCollisionFalse = false; + constexpr bool useOnlyInTimeParticles = false; + constexpr bool useOnlyTPfromPhysicsCollisionFalse = false; // Use looser cuts here those those used for tracking efficiency measurement. // Keep only those TP that have a chance (allowing for finite track resolution) of being reconstructed as L1 tracks. L1 tracks not matching these TP will be defined as fake. - const vector genPdgIdsAllUnsigned = { - 11, - 13, - 211, - 321, - 2212}; // Include all possible particle types here, as if some are left out, L1 tracks matching one of missing types will be declared fake. + // Include all possible particle types here, as if some are left out, L1 tracks matching one of missing types will be declared fake. + static const vector genPdgIdsAllUnsigned = {11, 13, 211, 321, 2212}; vector genPdgIdsAll; for (unsigned int i = 0; i < genPdgIdsAllUnsigned.size(); i++) { genPdgIdsAll.push_back(genPdgIdsAllUnsigned[i]); @@ -76,24 +72,28 @@ namespace tmtt { // Range big enough to include all TP needed to measure tracking efficiency // and big enough to include any TP that might be reconstructed for fake rate measurement. - const float ptMin = min(settings_->genMinPt(), 0.7 * settings_->houghMinPt()); - const float etaMax = max(settings_->genMaxAbsEta(), 0.2 + fabs(settings_->etaRegions()[0])); - - static thread_local TrackingParticleSelector trackingParticleSelector(ptMin, - 9999999999, - -etaMax, - etaMax, - max(10.0, settings_->genMaxVertR()), - max(35.0, settings_->genMaxVertZ()), - 0, - useOnlyTPfromPhysicsCollisionFalse, - useOnlyInTimeParticles, - true, - false, - genPdgIdsAll); - - const TrackingParticlePtr tp_ptr(*this); // cast to base class. - use_ = trackingParticleSelector(*tp_ptr); + constexpr float ptMinScale = 0.7; + const float ptMin = min(settings_->genMinPt(), ptMinScale * settings_->houghMinPt()); + constexpr double ptMax = 9.9e9; + const float etaExtra = 0.2; + const float etaMax = max(settings_->genMaxAbsEta(), etaExtra + std::abs(settings_->etaRegions()[0])); + constexpr double fixedVertRcut = 10.; + constexpr double fixedVertZcut = 35.; + + static const TrackingParticleSelector trackingParticleSelector(ptMin, + ptMax, + -etaMax, + etaMax, + max(fixedVertRcut, settings_->genMaxVertR()), + max(fixedVertZcut, settings_->genMaxVertZ()), + 0, + useOnlyTPfromPhysicsCollisionFalse, + useOnlyInTimeParticles, + true, + false, + genPdgIdsAll); + + use_ = trackingParticleSelector(*trackingParticlePtr_); } //=== Check if this tracking particle can be used to measure the L1 tracking efficiency. @@ -101,28 +101,28 @@ namespace tmtt { void TP::fillUseForEff() { useForEff_ = false; if (use_) { - const bool useOnlyInTimeParticles = true; - const bool useOnlyTPfromPhysicsCollision = true; - static thread_local TrackingParticleSelector trackingParticleSelector(settings_->genMinPt(), - 9999999999, - -settings_->genMaxAbsEta(), - settings_->genMaxAbsEta(), - settings_->genMaxVertR(), - settings_->genMaxVertZ(), - 0, - useOnlyTPfromPhysicsCollision, - useOnlyInTimeParticles, - true, - false, - settings_->genPdgIds()); - - const TrackingParticlePtr tp_ptr(*this); // cast to base class. - useForEff_ = trackingParticleSelector(*tp_ptr); + constexpr bool useOnlyInTimeParticles = true; + constexpr bool useOnlyTPfromPhysicsCollision = true; + constexpr double ptMax = 9.9e9; + static const TrackingParticleSelector trackingParticleSelector(settings_->genMinPt(), + ptMax, + -settings_->genMaxAbsEta(), + settings_->genMaxAbsEta(), + settings_->genMaxVertR(), + settings_->genMaxVertZ(), + 0, + useOnlyTPfromPhysicsCollision, + useOnlyInTimeParticles, + true, + false, + settings_->genPdgIds()); + + useForEff_ = trackingParticleSelector(*trackingParticlePtr_); // Add additional cut on particle transverse impact parameter. - if (fabs(d0_) > settings_->genMaxD0()) + if (std::abs(d0_) > settings_->genMaxD0()) useForEff_ = false; - if (fabs(z0_) > settings_->genMaxZ0()) + if (std::abs(z0_) > settings_->genMaxZ0()) useForEff_ = false; } } @@ -162,28 +162,31 @@ namespace tmtt { } void TP::fillNearestJetInfo(const reco::GenJetCollection* genJets) { - double minDR = 999; + double minDR = 999.; double ptOfNearestJet = -1; reco::GenJetCollection::const_iterator iterGenJet; for (iterGenJet = genJets->begin(); iterGenJet != genJets->end(); ++iterGenJet) { reco::GenJet myJet = reco::GenJet(*iterGenJet); - if (myJet.pt() < 30.0) - continue; - if (fabs(myJet.eta()) > 2.5) - continue; + // Don't consider GenJets failing these cuts. + constexpr float minPt = 30.0; + constexpr float maxEta = 2.5; - double deltaR = reco::deltaR(this->eta(), this->phi0(), myJet.eta(), myJet.phi()); + if (myJet.pt() > minPt && std::abs(myJet.eta()) > maxEta) { + double deltaR = reco::deltaR(this->eta(), this->phi0(), myJet.eta(), myJet.phi()); - if (deltaR < 0.4 && deltaR < minDR) { - minDR = deltaR; - ptOfNearestJet = myJet.pt(); + if (deltaR < minDR) { + minDR = deltaR; + ptOfNearestJet = myJet.pt(); + } } } - tpInJet_ = (minDR < 0.4) ? true : false; - nearestJetPt_ = ptOfNearestJet; + // Only consider GenJets within this distance of TP. + constexpr float cutDR = 0.4; + tpInJet_ = (minDR < cutDR); + nearestJetPt_ = tpInJet_ ? ptOfNearestJet : -1.; } } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/TrackFitFactory.cc b/L1Trigger/TrackFindingTMTT/src/TrackFitFactory.cc new file mode 100644 index 0000000000000..1a399ac030c89 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/TrackFitFactory.cc @@ -0,0 +1,42 @@ +///=== Create requested track fitter + +#include "L1Trigger/TrackFindingTMTT/interface/TrackFitFactory.h" +#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/ChiSquaredFit4.h" +#include "L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h" +#include "L1Trigger/TrackFindingTMTT/interface/SimpleLR4.h" +#ifdef USE_HLS +#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFParamsCombCallHLS.h" +#endif +#include "FWCore/Utilities/interface/Exception.h" + +using namespace std; + +namespace tmtt { + + namespace trackFitFactory { + + std::unique_ptr create(const std::string& fitterName, const Settings* settings) { + if (fitterName == "ChiSquaredFit4") { + return std::make_unique(settings, 4); + } else if (fitterName == "KF4ParamsComb") { + return std::make_unique(settings, 4, fitterName); + } else if (fitterName == "KF5ParamsComb") { + return std::make_unique(settings, 5, fitterName); + } else if (fitterName == "SimpleLR4") { + return std::make_unique(settings); +#ifdef USE_HLS + } else if (fitterName == "KF4ParamsCombHLS") { + return std::make_unique(settings, 4, fitterName); + } else if (fitterName == "KF5ParamsCombHLS") { + return std::make_unique(settings, 5, fitterName); +#endif + } else { + throw cms::Exception("BadConfig") + << "TrackFitFactory: ERROR you requested unknown track fitterName: " << fitterName; + } + } + + } // namespace trackFitFactory + +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/TrackFitGeneric.cc b/L1Trigger/TrackFindingTMTT/src/TrackFitGeneric.cc deleted file mode 100644 index dab75d2f36c97..0000000000000 --- a/L1Trigger/TrackFindingTMTT/src/TrackFitGeneric.cc +++ /dev/null @@ -1,52 +0,0 @@ -///=== This is the base class for all the track fit algorithms - -///=== Written by: Alexander D. Morton and Sioni Summers - -#include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h" -#include "L1Trigger/TrackFindingTMTT/interface/Settings.h" -#include "L1Trigger/TrackFindingTMTT/interface/Utility.h" -#include "L1Trigger/TrackFindingTMTT/interface/ChiSquared4ParamsApprox.h" -#include "L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h" -#include "L1Trigger/TrackFindingTMTT/interface/SimpleLR.h" -#ifdef USE_HLS -#include "L1Trigger/TrackFindingTMTT/interface/HLS/KFParamsCombCallHLS.h" -#endif -#include "FWCore/Utilities/interface/Exception.h" -#include -#include - -namespace tmtt { - - //=== Set configuration parameters. - - TrackFitGeneric::TrackFitGeneric(const Settings* settings, const string& fitterName) - : settings_(settings), fitterName_(fitterName), nDupStubs_(0) {} - - //=== Fit a track candidate obtained from the Hough Transform. - //=== Specify which phi sector and eta region it is in. - - L1fittedTrack TrackFitGeneric::fit(const L1track3D& l1track3D) { - return L1fittedTrack(settings_, l1track3D, l1track3D.getStubs(), 0, 0, 0, 0, 0, 0, 0, 999999., 0); - } - - TrackFitGeneric* TrackFitGeneric::create(std::string fitter, const Settings* settings) { - if (fitter.compare("ChiSquared4ParamsApprox") == 0) { - return new ChiSquared4ParamsApprox(settings, 4); - } else if (fitter.compare("KF4ParamsComb") == 0) { - return new KFParamsComb(settings, 4, fitter); - } else if (fitter.compare("KF5ParamsComb") == 0) { - return new KFParamsComb(settings, 5, fitter); - } else if (fitter.compare("SimpleLR") == 0) { - return new SimpleLR(settings); -#ifdef USE_HLS - } else if (fitter.compare("KF4ParamsCombHLS") == 0) { - return new KFParamsCombCallHLS(settings, 4, fitter); - } else if (fitter.compare("KF5ParamsCombHLS") == 0) { - return new KFParamsCombCallHLS(settings, 5, fitter); -#endif - } else { - throw cms::Exception("TrackFitGeneric: ERROR you requested unknown track fitter") << fitter << endl; - } - } - -} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/TrackerGeometryInfo.cc b/L1Trigger/TrackFindingTMTT/src/TrackerGeometryInfo.cc deleted file mode 100644 index 8f2ec4f2d6756..0000000000000 --- a/L1Trigger/TrackFindingTMTT/src/TrackerGeometryInfo.cc +++ /dev/null @@ -1,56 +0,0 @@ -#include "L1Trigger/TrackFindingTMTT/interface/TrackerGeometryInfo.h" -#include "DataFormats/SiStripDetId/interface/StripSubdetector.h" -#include -#include - -namespace tmtt { - - TrackerGeometryInfo::TrackerGeometryInfo() - : barrelNTiltedModules_(12), barrelNLayersWithTiltedModules_(3), moduleZoR_(), moduleB_() {} - - void TrackerGeometryInfo::getTiltedModuleInfo(const Settings* settings, - const TrackerTopology* theTrackerTopo, - const TrackerGeometry* theTrackerGeom) { - for (const GeomDetUnit* gd : theTrackerGeom->detUnits()) { - float R0 = gd->position().perp(); - float Z0 = fabs(gd->position().z()); - DetId detId = gd->geographicalId(); - - bool barrel = detId.subdetId() == StripSubdetector::TOB || detId.subdetId() == StripSubdetector::TIB; - bool tiltedBarrel = barrel && (theTrackerTopo->tobSide(detId) != 3); - bool isLower = theTrackerTopo->isLower(detId); - - // Calculate and store r, z, B at centre of titled modules - // Only do this for the "lower" sensor - if (tiltedBarrel && isLower) { - // int type = 2*theTrackerTopo->tobSide(detId)-3; // -1 for tilted-, 1 for tilted+, 3 for flat - // double corr = (barrelNTiltedModules_+1)/2.; - - double minZOfThisModule = fabs(gd->surface().zSpan().first); - double maxZOfThisModule = fabs(gd->surface().zSpan().second); - double minROfThisModule = gd->surface().rSpan().first; - double maxROfThisModule = gd->surface().rSpan().second; - - // Calculate module tilt and B at centre of module - double moduleTilt = atan(fabs(maxZOfThisModule - minZOfThisModule) / (maxROfThisModule - minROfThisModule)); - double moduleTheta = atan(R0 / Z0); - double BCorrection = fabs(cos(fabs(moduleTheta) - moduleTilt) / sin(moduleTheta)); - - // Only store if this value of B has not been stored already - bool storeThisBCorrection = true; - for (unsigned int iCorr = 0; iCorr < moduleB_.size(); ++iCorr) { - if (fabs(BCorrection - moduleB_[iCorr]) < 0.0001) { - storeThisBCorrection = false; - break; - } - } - - if (storeThisBCorrection) { - moduleZoR_.push_back(Z0 / R0); - moduleB_.push_back(BCorrection); - } - } - } - } - -} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/TrackerModule.cc b/L1Trigger/TrackFindingTMTT/src/TrackerModule.cc new file mode 100644 index 0000000000000..767b2aa701c2e --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/TrackerModule.cc @@ -0,0 +1,156 @@ +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "Geometry/CommonTopologies/interface/PixelGeomDetUnit.h" +#include "Geometry/CommonTopologies/interface/PixelTopology.h" +#include "DataFormats/SiStripDetId/interface/StripSubdetector.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +#include "L1Trigger/TrackFindingTMTT/interface/TrackerModule.h" + +#include +#include +#include + +using namespace std; + +namespace tmtt { + + namespace { + std::once_flag printOnce; + } + + //=== Get info about tracker module (where detId is ID of lower sensor in stacked module). + + TrackerModule::TrackerModule(const TrackerGeometry* trackerGeometry, + const TrackerTopology* trackerTopology, + const ModuleTypeCfg& moduleTypeCfg, + const DetId& detId) + : moduleTypeCfg_(moduleTypeCfg) { + detId_ = detId; // Det ID of lower sensor in stacked module. + stackedDetId_ = trackerTopology->stack(detId); // Det ID of stacked module. + + // Get min & max (r,phi,z) coordinates of the centre of the two sensors containing this stub. + const GeomDetUnit* det0 = trackerGeometry->idToDetUnit(detId); + const GeomDetUnit* det1 = trackerGeometry->idToDetUnit(trackerTopology->partnerDetId(detId)); + specDet_ = dynamic_cast(det0); + specTopol_ = dynamic_cast(&(specDet_->specificTopology())); + + float R0 = det0->position().perp(); + float R1 = det1->position().perp(); + float PHI0 = det0->position().phi(); + float PHI1 = det1->position().phi(); + float Z0 = det0->position().z(); + float Z1 = det1->position().z(); + moduleMinR_ = std::min(R0, R1); + moduleMaxR_ = std::max(R0, R1); + moduleMinPhi_ = std::min(PHI0, PHI1); + moduleMaxPhi_ = std::max(PHI0, PHI1); + moduleMinZ_ = std::min(Z0, Z1); + moduleMaxZ_ = std::max(Z0, Z1); + + // Note if modules are flipped back-to-front. + outerModuleAtSmallerR_ = (det0->position().mag() > det1->position().mag()); + + // Note if module is PS or 2S, and whether in barrel or endcap. + // From Geometry/TrackerGeometryBuilder/README.md + psModule_ = (trackerGeometry->getDetectorType(detId) == TrackerGeometry::ModuleType::Ph2PSP); + barrel_ = detId.subdetId() == StripSubdetector::TOB || detId.subdetId() == StripSubdetector::TIB; + + // Encode layer ID (barrel layers: 1-6, endcap disks: 11-15 + 21-25) + if (barrel_) { + layerId_ = trackerTopology->layer(detId); // barrel layer 1-6 encoded as 1-6 + } else { + layerId_ = 10 * trackerTopology->side(detId) + trackerTopology->tidWheel(detId); + } + // Get reduced layer ID (in range 1-7), requiring only 3 bits for firmware. + layerIdReduced_ = TrackerModule::calcLayerIdReduced(layerId_); + + // Note module ring in endcap + endcapRing_ = barrel_ ? 0 : trackerTopology->tidRing(detId); + if (not barrel_) { + // Apply bodge, since Topology class annoyingly starts ring count at 1, even in endcap wheels where + // inner rings are absent. + unsigned int iWheel = trackerTopology->tidWheel(detId); + if (iWheel >= 3 && iWheel <= 5) + endcapRing_ += 3; + } + + // Note if tilted barrel module & get tilt angle (in range 0 to PI). + tiltedBarrel_ = barrel_ && (trackerTopology->tobSide(detId) != BarrelModuleType::flat); + float deltaR = std::abs(R1 - R0); + float deltaZ = (R1 - R0 > 0) ? (Z1 - Z0) : -(Z1 - Z0); + tiltAngle_ = atan2(deltaR, deltaZ); + // Put in range -PI/2 to +PI/2. + if (tiltAngle_ > M_PI / 2.) + tiltAngle_ -= M_PI; + if (tiltAngle_ < -M_PI / 2.) + tiltAngle_ += M_PI; + + // Get sensor strip or pixel pitch using innermost sensor of pair. + + const Bounds& bounds = det0->surface().bounds(); + sensorWidth_ = bounds.width(); // Width of sensitive region of sensor (= stripPitch * nStrips). + sensorSpacing_ = sqrt((moduleMaxR_ - moduleMinR_) * (moduleMaxR_ - moduleMinR_) + + (moduleMaxZ_ - moduleMinZ_) * (moduleMaxZ_ - moduleMinZ_)); + nStrips_ = specTopol_->nrows(); // No. of strips in sensor + std::pair pitch = specTopol_->pitch(); + stripPitch_ = pitch.first; // Strip pitch (or pixel pitch along shortest axis) + stripLength_ = pitch.second; // Strip length (or pixel pitch along longest axis) + + // Get module type ID defined by firmware. + + moduleTypeID_ = TrackerModule::calcModuleType(stripPitch_, sensorSpacing_, barrel_, tiltedBarrel_, psModule_); + } + + //=== Calculate reduced layer ID (in range 1-7), for packing into 3 bits to simplify the firmware. + + unsigned int TrackerModule::calcLayerIdReduced(unsigned int layerId) { + // Don't bother distinguishing two endcaps, as no track can have stubs in both. + unsigned int lay = (layerId < 20) ? layerId : layerId - 10; + + // No genuine track can have stubs in both barrel layer 6 and endcap disk 11 etc., so merge their layer IDs. + if (lay == 6) + lay = 11; + if (lay == 5) + lay = 12; + if (lay == 4) + lay = 13; + if (lay == 3) + lay = 15; + // At this point, the reduced layer ID can have values of 1, 2, 11, 12, 13, 14, 15. So correct to put in range 1-7. + if (lay > 10) + lay -= 8; + + if (lay < 1 || lay > 7) + throw cms::Exception("LogicError") << "TrackerModule: Reduced layer ID out of expected range"; + + return lay; + } + + //=== Get module type ID defined by firmware. + + unsigned int TrackerModule::calcModuleType( + float pitch, float space, bool barrel, bool tiltedBarrel, bool psModule) const { + // Calculate unique module type ID, allowing sensor pitch/seperation of module to be determined in FW. + + unsigned int moduleType = 999; + constexpr float tol = 0.001; // Tolerance + + for (unsigned int i = 0; i < moduleTypeCfg_.pitchVsType.size(); i++) { + if (std::abs(pitch - moduleTypeCfg_.pitchVsType[i]) < tol && + std::abs(space - moduleTypeCfg_.spaceVsType[i]) < tol && barrel == moduleTypeCfg_.barrelVsType[i] && + tiltedBarrel == moduleTypeCfg_.tiltedVsType[i] && psModule == moduleTypeCfg_.psVsType[i]) { + moduleType = i; + } + } + + if (moduleType == 999) { + std::stringstream text; + text << "WARNING: TrackerModule found tracker module type unknown to firmware: pitch=" << pitch + << " separation=" << space << " barrel=" << barrel << " tilted=" << tiltedBarrel << " PS=" << psModule; + std::call_once( + printOnce, [](string t) { edm::LogWarning("L1track") << t; }, text.str()); + } + return moduleType; + } +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc b/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc index d300924eb7c1d..6d37a6432f26b 100644 --- a/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc +++ b/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc @@ -3,24 +3,25 @@ #include "L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h" #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" +#include "L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h" + +using namespace std; namespace tmtt { //=== Initialize configuration parameters, and note eta range covered by sector and phi coordinate of its centre. - void TrkRZfilter::init(const Settings* settings, - unsigned int iPhiSec, - unsigned int iEtaReg, - float etaMinSector, - float etaMaxSector, - float phiCentreSector) { - // Configuration parameters. - settings_ = settings; - - // Sector number. - iPhiSec_ = iPhiSec; - iEtaReg_ = iEtaReg; - + TrkRZfilter::TrkRZfilter(const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float etaMinSector, + float etaMaxSector, + float phiCentreSector) + : // Configuration parameters. + settings_(settings), + // Sector number. + iPhiSec_(iPhiSec), + iEtaReg_(iEtaReg) { // Eta range of sector & phi coord of its centre. etaMinSector_ = etaMinSector; etaMaxSector_ = etaMaxSector; @@ -54,7 +55,7 @@ namespace tmtt { // --- Options for Seed filter. //Added resolution for a tracklet-like filter algorithm, beyond that estimated from hit resolution. - seedResolution_ = settings->seedResolution(); + seedResCut_ = settings->seedResCut(); // Keep stubs compatible with all possible good seed. keepAllSeed_ = settings->keepAllSeed(); // Maximum number of seed combinations to bother checking per track candidate. @@ -68,21 +69,17 @@ namespace tmtt { // For debugging minNumMatchLayers_ = settings->minNumMatchLayers(); - - //--- Option for duplicate track removal on collection of L1track3D produced after running all r-z filter. - unsigned int dupTrkAlg3D = settings->dupTrkAlg3D(); - killDupTrks_.init(settings, dupTrkAlg3D); } //=== Filters track candidates (found by the r-phi Hough transform), removing inconsistent stubs from the tracks, //=== also killing some of the tracks altogether if they are left with too few stubs. //=== Also adds an estimate of r-z helix parameters to the selected track objects, if the filters used provide this. - vector TrkRZfilter::filterTracks(const vector& tracks) { - vector filteredTracks; + list TrkRZfilter::filterTracks(const list& tracks) { + list filteredTracks; for (const L1track2D& trkIN : tracks) { - const vector& stubs = trkIN.getStubs(); // stubs assigned to track + const vector& stubs = trkIN.stubs(); // stubs assigned to track // Declare this to be worth keeping (for now). bool trackAccepted = true; @@ -92,8 +89,8 @@ namespace tmtt { // Digitize stubs for r-z filter if required. if (settings_->enableDigitize()) { - for (const Stub* s : stubs) { - (const_cast(s))->digitizeForSFinput(); + for (Stub* s : stubs) { + s->digitize(iPhiSec_, Stub::DigiStage::SF); } } @@ -101,16 +98,12 @@ namespace tmtt { // Get debug printout for specific regions. bool print = false; - // unsigned int mbin = trkIN.getCellLocationHT().first; - // unsigned int cbin = trkIN.getCellLocationHT().second; - // if(mbin == 0 && cbin == 45 && trkIN.iEtaReg() == 14 && trkIN.iPhiSec() == 6) print = true; - // cout << "track in region "< filteredStubs = stubs; + vector filteredStubs = stubs; if (rzFilterName_ == "SeedFilter") { filteredStubs = this->seedFilter(filteredStubs, trkIN.qOverPt(), print); } else { - throw cms::Exception("TrkRzFilter: ERROR unknown r-z track filter requested") << rzFilterName_ << endl; + throw cms::Exception("BadConfig") << "TrkRzFilter: ERROR unknown r-z track filter requested: " << rzFilterName_; } // Check if track still has stubs in enough layers after filter. @@ -118,7 +111,7 @@ namespace tmtt { unsigned int numLayersAfterFilters = Utility::countLayers(settings_, filteredStubs); if (numLayersAfterFilters < settings_->minFilterLayers()) trackAccepted = false; - //if (numLayersAfterFilters < Utility::numLayerCut("SEED", settings_, iPhiSec_, iEtaReg_, fabs(trkIN.qOverPt()))) trackAccepted = false; + //if (numLayersAfterFilters < Utility::numLayerCut(Utility::AlgoStep::SEED, settings_, iPhiSec_, iEtaReg_, std::abs(trkIN.qOverPt()))) trackAccepted = false; if (trackAccepted) { // Estimate r-z helix parameters from centre of eta-sector if no estimate provided by r-z filter. @@ -128,54 +121,49 @@ namespace tmtt { pair helixRZ(rzHelix_z0_, rzHelix_tanL_); // Create copy of original track, except now using its filtered stubs, to be added to filteredTrack collection. - L1track3D trkOUT(settings_, - filteredStubs, - trkIN.getCellLocationHT(), - trkIN.getHelix2D(), - helixRZ, - trkIN.iPhiSec(), - trkIN.iEtaReg(), - trkIN.optoLinkID(), - trkIN.mergedHTcell()); - - filteredTracks.push_back(trkOUT); + filteredTracks.emplace_back(settings_, + filteredStubs, + trkIN.cellLocationHT(), + trkIN.helix2D(), + helixRZ, + trkIN.iPhiSec(), + trkIN.iEtaReg(), + trkIN.optoLinkID(), + trkIN.mergedHTcell()); } } - // Optionally run duplicate track removal on all the 3D tracks found in this sector & store final 3D track collection. - filteredTracks = killDupTrks_.filter(filteredTracks); - return filteredTracks; } //=== Use Seed Filter to produce a filtered collection of stubs on this track candidate that are consistent with a straight line //=== in r-z using tracklet algo. - vector TrkRZfilter::seedFilter(const std::vector& stubs, float trkQoverPt, bool print) { - unsigned int numLayers; //Num of Layers in the cell after that filter has been applied - std::vector filtStubs = stubs; // Copy stubs vector in filtStubs + vector TrkRZfilter::seedFilter(const std::vector& stubs, float trkQoverPt, bool print) { + unsigned int numLayers; //Num of Layers in the cell after that filter has been applied + std::vector filtStubs = stubs; // Copy stubs vector in filtStubs bool FirstSeed = true; - const int FirstSeedLayers[] = {1, 2, 11, 21, 3, 12, 22, 4}; //Allowed layers for the first seeding stubs - const int SecondSeedLayers[] = {1, 2, 11, 3, 21, 22, 12, 23, 13, 4}; //Allowed layers for the second seeding stubs - set uniqueFilteredStubs; + //Allowed layers for the first & second seeding stubs + static const std::vector FirstSeedLayers = {1, 2, 11, 21, 3, 12, 22, 4}; + static const std::vector SecondSeedLayers = {1, 2, 11, 3, 21, 22, 12, 23, 13, 4}; + set uniqueFilteredStubs; - unsigned int numSeedCombinations = 0; // Counter for number of seed combinations considered. - unsigned int numGoodSeedCombinations = - 0; // Counter for number of seed combinations considered with z0 within beam spot length. - vector filteredStubs; // Filter Stubs vector to be returned + unsigned int numSeedCombinations = 0; // Counter for number of seed combinations considered. + unsigned int numGoodSeedCombinations = 0; // Counter for seed combinations with z0 within beam spot length. + vector filteredStubs; // Filter Stubs vector to be returned unsigned int oldNumLay = 0; //Number of Layers counter, used to keep the seed with more layers - std::sort(filtStubs.begin(), filtStubs.end(), SortStubsInLayer()); + std::sort(filtStubs.begin(), filtStubs.end(), SortStubsByLayer()); // Loop over stubs in the HT Cell - for (const Stub* s0 : filtStubs) { + for (Stub* s0 : filtStubs) { // Select the first available seeding stub (r<70) if (s0->psModule() && std::find(std::begin(FirstSeedLayers), std::end(FirstSeedLayers), s0->layerId()) != std::end(FirstSeedLayers)) { unsigned int numSeedsPerStub = 0; - for (const Stub* s1 : filtStubs) { + for (Stub* s1 : filtStubs) { if (numGoodSeedCombinations < maxGoodSeedCombinations_ && numSeedCombinations < maxSeedCombinations_ && numSeedsPerStub < maxSeedsPerStub_) { // Select the second seeding stub (r<90) @@ -185,32 +173,28 @@ namespace tmtt { numSeedsPerStub++; numSeedCombinations++; //Increase filter cycles counter if (print) - cout << "s0: " - << "z: " << s0->z() << ", r: " << s0->r() << ", id:" << s0->layerId() << " ****** s1: " - << "z: " << s1->z() << ", r: " << s1->r() << ", id:" << s1->layerId() << endl; - double sumSeedDist = 0., - oldSumSeedDist = 1000000.; //Define variable used to estimate the quality of seeds - vector tempStubs; //Create a temporary container for stubs - tempStubs.push_back(s0); //Store the first seeding stub in the temporary container - tempStubs.push_back(s1); //Store the second seeding stub in the temporary container - - double z0 = - s1->z() + - (-s1->z() + s0->z()) * s1->r() / - (s1->r() - s0->r()); // Estimate a value of z at the beam spot using the two seeding stubs - //double z0err = s1->zErr() + ( s1->zErr() + s0->zErr() )*s1->r()/fabs(s1->r()-s0->r()) + fabs(-s1->z()+s0->z())*(s1->rErr()*fabs(s1->r()-s0->r()) + s1->r()*(s1->rErr() + s0->rErr()) )/((s1->r()-s0->r())*(s1->r()-s0->r())); - float zTrk = - s1->z() + - (-s1->z() + s0->z()) * (s1->r() - chosenRofZ_) / - (s1->r() - s0->r()); // Estimate a value of z at a chosen Radius using the two seeding stubs - // float zTrkErr = s1->zErr() + ( s1->zErr() + s0->zErr() )*fabs(s1->r()-chosenRofZ_)/fabs(s1->r()-s0->r()) + fabs(-s1->z()+s0->z())*(s1->rErr()*fabs(s1->r()-s0->r()) + fabs(s1->r()-chosenRofZ_)*(s1->rErr() + s0->rErr()) )/((s1->r()-s0->r())*(s1->r()-s0->r())); - float leftZtrk = zTrk * fabs(s1->r() - s0->r()); - float rightZmin = zTrkMinSector_ * fabs(s1->r() - s0->r()); - float rightZmax = zTrkMaxSector_ * fabs(s1->r() - s0->r()); + PrintL1trk() << "s0: " + << "z: " << s0->z() << ", r: " << s0->r() << ", id:" << s0->layerId() << " ****** s1: " + << "z: " << s1->z() << ", r: " << s1->r() << ", id:" << s1->layerId(); + //double sumSeedDist = 0.; + //double oldSumSeedDist = 1000000.; //Define variable used to estimate the quality of seeds + vector tempStubs; //Create a temporary container for stubs + tempStubs.push_back(s0); //Store the first seeding stub in the temporary container + tempStubs.push_back(s1); //Store the second seeding stub in the temporary container + + // Estimate a value of z at the beam spot using the two seeding stubs + double z0 = s1->z() + (-s1->z() + s0->z()) * s1->r() / (s1->r() - s0->r()); + //double z0err = s1->sigmaZ() + ( s1->sigmaZ() + s0->sigmaZ() )*s1->r()/std::abs(s1->r()-s0->r()) + std::abs(-s1->z()+s0->z())*(s1->sigmaR()*std::abs(s1->r()-s0->r()) + s1->r()*(s1->sigmaR() + s0->sigmaR()) )/((s1->r()-s0->r())*(s1->r()-s0->r())); + // Estimate a value of z at a chosen Radius using the two seeding stubs + float zTrk = s1->z() + (-s1->z() + s0->z()) * (s1->r() - chosenRofZ_) / (s1->r() - s0->r()); + // float zTrkErr = s1->sigmaZ() + ( s1->sigmaZ() + s0->sigmaZ() )*std::abs(s1->r()-chosenRofZ_)/std::abs(s1->r()-s0->r()) + std::abs(-s1->z()+s0->z())*(s1->sigmaR()*std::abs(s1->r()-s0->r()) + std::abs(s1->r()-chosenRofZ_)*(s1->sigmaR() + s0->sigmaR()) )/((s1->r()-s0->r())*(s1->r()-s0->r())); + float leftZtrk = zTrk * std::abs(s1->r() - s0->r()); + float rightZmin = zTrkMinSector_ * std::abs(s1->r() - s0->r()); + float rightZmax = zTrkMaxSector_ * std::abs(s1->r() - s0->r()); // If z0 is within the beamspot range loop over the other stubs in the cell - //if (fabs(z0)<=beamWindowZ_+z0err) { - if (fabs(z0) <= beamWindowZ_) { + //if (std::abs(z0)<=beamWindowZ_+z0err) { + if (std::abs(z0) <= beamWindowZ_) { // Check track r-z helix parameters are consistent with it being assigned to current rapidity sector (kills duplicates due to overlapping sectors). // if ( (! zTrkSectorCheck_) || (zTrk > zTrkMinSector_ - zTrkErr && zTrk < zTrkMaxSector_ + zTrkErr) ) { if ((!zTrkSectorCheck_) || (leftZtrk > rightZmin && leftZtrk < rightZmax)) { @@ -219,48 +203,29 @@ namespace tmtt { // double oldseed = 1000.; //Store the seed value of the current stub (KEEP JUST ONE STUB PER LAYER) // Loop over stubs in vector different from the seeding stubs - for (const Stub* s : filtStubs) { + for (Stub* s : filtStubs) { // if(s!= s0 && s!= s1){ // Calculate the seed and its tolerance double seedDist = (s->z() - s1->z()) * (s1->r() - s0->r()) - (s->r() - s1->r()) * (s1->z() - s0->z()); - double seedDistRes = (s->zErr() + s1->zErr()) * fabs(s1->r() - s0->r()) + - (s->rErr() + s1->rErr()) * fabs(s1->z() - s0->z()) + - (s0->zErr() + s1->zErr()) * fabs(s->r() - s1->r()) + - (s0->rErr() + s1->rErr()) * fabs(s->z() - s1->z()); - seedDistRes += seedResolution_; // Add extra configurable contribution to assumed resolution. + double seedDistRes = (s->sigmaZ() + s1->sigmaZ()) * std::abs(s1->r() - s0->r()) + + (s->sigmaR() + s1->sigmaR()) * std::abs(s1->z() - s0->z()) + + (s0->sigmaZ() + s1->sigmaZ()) * std::abs(s->r() - s1->r()) + + (s0->sigmaR() + s1->sigmaR()) * std::abs(s->z() - s1->z()); + seedDistRes *= seedResCut_; // Scale cut by this amount. //If seed is lower than the tolerance push back the stub (KEEP JUST ONE STUB PER LAYER, NOT ENABLED BY DEFAULT) - if (fabs(seedDist) <= seedDistRes) { - // if(s->layerId()==LiD){ - //if(fabs(seedDist)layerId(); - // sumSeedDist = sumSeedDist + fabs(seedDist) - fabs(oldseed); - // oldseed = seedDist; - //} - // } else { + if (std::abs(seedDist) <= seedDistRes) { if (s->layerId() != LiD and s->layerId() != s0->layerId() and s->layerId() != s1->layerId()) { tempStubs.push_back(s); LiD = s->layerId(); - // oldseed = seedDist; - //sumSeedDist = sumSeedDist + fabs(seedDist); } } - - //If stub lies on the seeding line, store it in the tempstubs vector - // if(fabs(seedDist) <= seedDistRes){ - // tempStubs.push_back(s); - // sumSeedDist = sumSeedDist + fabs(seedDist); //Increase the seed quality variable - // } - // } } } } numLayers = Utility::countLayers( settings_, tempStubs); // Count the number of layers in the temporary stubs container - //sumSeedDist = sumSeedDist/(tempStubs.size()); //Measure the average seed quality per stub for the current seed // Check if the current seed has more layers then the previous one (Keep the best seed) if (keepAllSeed_ == false) { @@ -278,7 +243,8 @@ namespace tmtt { //} } else { // Check if the current seed satisfies the minimum layers requirement (Keep all seed algorithm) - if (numLayers >= Utility::numLayerCut("SEED", settings_, iPhiSec_, iEtaReg_, fabs(trkQoverPt))) { + if (numLayers >= Utility::numLayerCut( + Utility::AlgoStep::SEED, settings_, iPhiSec_, iEtaReg_, std::abs(trkQoverPt))) { uniqueFilteredStubs.insert(tempStubs.begin(), tempStubs.end()); //Insert the uniqueStub set // If these are the first seeding stubs store the values of z0 and tanLambda @@ -298,55 +264,11 @@ namespace tmtt { // Copy stubs from the uniqueFilteredStubs set to the filteredStubs vector (Keep all seed algorithm) if (keepAllSeed_ == true) { - for (const Stub* stub : uniqueFilteredStubs) { + for (Stub* stub : uniqueFilteredStubs) { filteredStubs.push_back(stub); } } - // EJC Commented out, as nMatchedLayersBest is never set, so CLANG complains - // EJC Leave code in case it is useful for whoever is reading this in the future - // Print Missing Track information if debug variable is set to 4 - // if((settings_->debug()==4 or print) and settings_->enableDigitize()){ - // std::vector matchedStubs; - // unsigned int nMatchedLayersBest; - - // std::vector matchedFiltStubs; - // unsigned int nMatchedFiltLayersBest; - - // if(nMatchedLayersBest >= minNumMatchLayers_ && Utility::countLayers(settings_, filteredStubs) < Utility::numLayerCut("SEED", settings_, iPhiSec_, iEtaReg_, fabs(trkQoverPt))) { - // cout << " ******* NOT ENOUGH LAYERS *******" << endl; - // cout << " ====== TP stubs ====== " << endl; - // for(const Stub* st: matchedStubs){ - // cout << "z: "<< st->z() << ", r: "<< st->r() << ", id:" << st->layerId() << endl; - // } - // cout << "num layers "<< oldNumLay << endl; - // cout << " ====== Matched TP stubs ====== " << endl; - // for(const Stub* st: filteredStubs){ - // cout << "z: "<< st->z() << ", r: "<< st->r() << ", id:" << st->layerId() << endl; - // } - // } else if(nMatchedLayersBest >= minNumMatchLayers_ && nMatchedFiltLayersBest < minNumMatchLayers_){ - // cout << " ******* NOT ENOUGH MATCHED LAYERS *******" << endl; - // cout << " ====== TP stubs ====== " << endl; - // for(const Stub* st: matchedStubs){ - // cout << "z: "<< st->z() << ", r: "<< st->r() << ", id:" << st->layerId() << endl; - // } - // cout << " ====== Matched TP stubs ====== " << endl; - // for(const Stub* st: filteredStubs){ - // cout << "z: "<< st->z() << ", r: "<< st->r() << ", id:" << st->layerId() << endl; - // } - // } else if(nMatchedLayersBest >= minNumMatchLayers_ && nMatchedFiltLayersBest >= minNumMatchLayers_ ){ - // cout << " ******* Track Found *******" << endl; - // cout << " ====== Cell Stubs ====== " << endl; - // for(const Stub* st: stubs){ - // cout << "z: "<< st->digitalStub().iDigi_Z() << ", rT: "<< st->digitalStub().iDigi_Rt() << ", id:" << st->layerId() << endl; - // } - // cout << " ====== Matched TP stubs ====== " << endl; - // for(const Stub* st: filteredStubs){ - // cout << "z: "<< st->digitalStub().iDigi_Z() << ", rT: "<< st->digitalStub().iDigi_Rt() << ", id:" << st->layerId() << endl; - // } - // } - // } - // Note number of seed combinations used for this track. numSeedCombsPerTrk_.push_back(numSeedCombinations); numGoodSeedCombsPerTrk_.push_back(numGoodSeedCombinations); @@ -358,9 +280,6 @@ namespace tmtt { void TrkRZfilter::estRZhelix() { rzHelix_z0_ = 0.; - // float etaCentreSector = 0.5*(etaMinSector_ + etaMaxSector_); - // float theta = 2. * atan(exp(-etaCentreSector)); - // rzHelix_tanL_ = 1./tan(theta); rzHelix_tanL_ = 0.5 * (1 / tan(2 * atan(exp(-etaMinSector_))) + 1 / tan(2 * atan(exp(-etaMaxSector_)))); rzHelix_set_ = true; } diff --git a/L1Trigger/TrackFindingTMTT/src/Utility.cc b/L1Trigger/TrackFindingTMTT/src/Utility.cc index 85a6bd2175c27..511074c1bdc0f 100644 --- a/L1Trigger/TrackFindingTMTT/src/Utility.cc +++ b/L1Trigger/TrackFindingTMTT/src/Utility.cc @@ -2,15 +2,24 @@ #include "L1Trigger/TrackFindingTMTT/interface/TP.h" #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" -#include "L1Trigger/TrackFindingTMTT/interface/DeadModuleDB.h" #include "FWCore/Utilities/interface/Exception.h" +using namespace std; + namespace tmtt { //=== Count number of tracker layers a given list of stubs are in. //=== By default, consider both PS+2S modules, but optionally consider only the PS ones. + unsigned int Utility::countLayers(const Settings* settings, + const std::vector& stubs, + bool disableReducedLayerID, + bool onlyPS) { + std::vector stubsConst(stubs.begin(), stubs.end()); + return countLayers(settings, stubsConst, disableReducedLayerID, onlyPS); + } + unsigned int Utility::countLayers(const Settings* settings, const vector& vstubs, bool disableReducedLayerID, @@ -41,7 +50,7 @@ namespace tmtt { if (layerID >= 0 && layerID < maxLayerID) { foundLayers[layerID] = true; } else { - throw cms::Exception("Utility::invalid layer ID"); + throw cms::Exception("LogicError") << "Utility::invalid layer ID"; } } } @@ -55,7 +64,7 @@ namespace tmtt { if (layerID >= 0 && layerID < maxLayerID) { foundLayers[layerID] = true; } else { - throw cms::Exception("Utility::invalid layer ID"); + throw cms::Exception("LogicError") << "Utility::invalid layer ID"; } } } @@ -75,6 +84,14 @@ namespace tmtt { //=== the number of tracker layers in which one of the stubs matched one from this tracking particle, //=== and the list of the subset of the stubs which match those on the tracking particle. + const TP* Utility::matchingTP(const Settings* settings, + const std::vector& vstubs, + unsigned int& nMatchedLayersBest, + std::vector& matchedStubsBest) { + std::vector stubsConst(vstubs.begin(), vstubs.end()); + return matchingTP(settings, stubsConst, nMatchedLayersBest, matchedStubsBest); + } + const TP* Utility::matchingTP(const Settings* settings, const vector& vstubs, unsigned int& nMatchedLayersBest, @@ -105,10 +122,10 @@ namespace tmtt { // Loop over all the TP that matched the given stubs, looking for the best matching TP. - nMatchedLayersBest = 0; // initialize - unsigned int nMatchedLayersStrictBest = 0; // initialize - matchedStubsBest.clear(); // initialize - const TP* tpBest = nullptr; // initialize + nMatchedLayersBest = 0; + unsigned int nMatchedLayersStrictBest = 0; + matchedStubsBest.clear(); + const TP* tpBest = nullptr; for (const auto& iter : tpsToStubs) { const TP* tp = iter.first; @@ -150,49 +167,49 @@ namespace tmtt { return tpBest; } - //=== Determine the minimum number of layers a track candidate must have stubs in to be defined as a track. - //=== The first argument indicates from what type of algorithm this function is called: "HT", "SEED", "DUP" or "FIT". + //=== Determine min number of layers a track candidate must have stubs in to be defined as a track. + //=== 1st argument indicates from which step in chain this function is called: HT, SEED, DUP or FIT. - unsigned int Utility::numLayerCut( - string algo, const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, float invPt, float eta) { - if (algo == "HT" || algo == "SEED" || algo == "DUP" || algo == "FIT") { + unsigned int Utility::numLayerCut(Utility::AlgoStep algo, + const Settings* settings, + unsigned int iPhiSec, + unsigned int iEtaReg, + float invPt, + float eta) { + if (algo == HT || algo == SEED || algo == DUP || algo == FIT) { unsigned int nLayCut = settings->minStubLayers(); //--- Check if should reduce cut on number of layers by 1 for any reason. bool reduce = false; - // e.g. To increase efficiency for high Pt tracks. - bool applyMinPt = (settings->minPtToReduceLayers() < 10000.); - if (applyMinPt && fabs(invPt) < 1 / settings->minPtToReduceLayers()) + // to increase efficiency for high Pt tracks. + bool applyMinPt = (settings->minPtToReduceLayers() > 0); + if (applyMinPt && std::abs(invPt) < 1 / settings->minPtToReduceLayers()) reduce = true; - // e.g. Or to increase efficiency in the barrel-endcap transition or very forward regions. + // or to increase efficiency in the barrel-endcap transition or very forward regions. const vector etaSecsRed = settings->etaSecsReduceLayers(); if (std::count(etaSecsRed.begin(), etaSecsRed.end(), iEtaReg) != 0) reduce = true; - // e.g. Or to increase efficiency in sectors containing dead modules. - if (settings->deadReduceLayers()) { - const DeadModuleDB dead; - if (dead.reduceLayerCut(iPhiSec, iEtaReg)) - reduce = true; - } + // or to increase efficiency in sectors containing dead modules (hard-wired in KF only) + // Not implemented here. if (reduce) nLayCut--; - // Avoid minimum number of layers going below 4. - if (nLayCut < 4) - nLayCut = 4; + constexpr unsigned int minLayCut = 4; // Minimum viable layer cut. + nLayCut = std::max(nLayCut, minLayCut); // Seed Filter & Track Fitters require only 4 layers. - if (algo == "SEED" || algo == "FIT") - nLayCut = 4; + constexpr unsigned int nFitLayCut = 4; + if (algo == SEED || algo == FIT) + nLayCut = nFitLayCut; return nLayCut; } else { - throw cms::Exception("Utility::numLayerCut() called with invalid algo argument!") << algo << endl; + throw cms::Exception("LogicError") << "Utility::numLayerCut() called with invalid algo argument! " << algo; } } diff --git a/L1Trigger/TrackFindingTMTT/test/L1TrackNtupleMaker_cfg.py b/L1Trigger/TrackFindingTMTT/test/L1TrackNtupleMaker_cfg.py new file mode 100644 index 0000000000000..a708074993e14 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/test/L1TrackNtupleMaker_cfg.py @@ -0,0 +1,208 @@ +############################################################ +# define basic process +############################################################ + +import FWCore.ParameterSet.Config as cms +import FWCore.Utilities.FileUtils as FileUtils +import os +process = cms.Process("L1TrackNtuple") + + +############################################################ +# edit options here +############################################################ + +GEOMETRY = "D49" + +# Specify L1 tracking algo ('HYBRID', 'HYBRID_DISPLACED', 'TMTT','HYBRID_FLOAT', 'TRACKLET_FLOAT'), +L1TRKALGO = 'TMTT' + +# Write output dataset? +WRITE_DATA = False + +if (L1TRKALGO == 'HYBRID_FLOAT'): + if ( not os.path.exists( os.environ['CMSSW_BASE']+'/src/L1Trigger/HybridFloat' ) ): + print "=== ERROR: Please checkout HybridFloat code from git before using this option ==="; exit + + +############################################################ +# import standard configurations +############################################################ + +process.load('Configuration.StandardSequences.Services_cff') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') + +if GEOMETRY == "D49": + print "using geometry " + GEOMETRY + " (tilted)" + process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff') + process.load('Configuration.Geometry.GeometryExtended2026D49_cff') +else: + print "this is not a valid geometry!!!" + exit + +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '') + + +############################################################ +# input and output +############################################################ + +process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(50)) + +# Get list of MC datasets from repo, or specify yourself. + +def getTxtFile(txtFileName): + return FileUtils.loadListFromFile(os.environ['CMSSW_BASE']+'/src/L1Trigger/TrackFindingTMTT/data/MCsamples/'+txtFileName) + +# MC txt files are in https://github.com/cms-data/L1Trigger-TrackFindingTMTT. +if GEOMETRY == "D49": + inputMC = getTxtFile('1110/RelVal/TTbar/PU200.txt') + +else: + print "this is not a valid geometry!!!" + +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring(*inputMC), + inputCommands = cms.untracked.vstring( + 'keep *_*_*_*', + 'drop l1tEMTFHit2016*_*_*_*', + 'drop l1tEMTFTrack2016*_*_*_*' + ) + ) + +process.TFileService = cms.Service("TFileService", fileName = cms.string('TTbar_PU200_'+L1TRKALGO+'.root'), closeFileFast = cms.untracked.bool(True)) + +process.Timing = cms.Service("Timing", summaryOnly = cms.untracked.bool(True)) + + +############################################################ +# L1 tracking +############################################################ + +# remake stubs ? +process.load('L1Trigger.TrackTrigger.TrackTrigger_cff') +from L1Trigger.TrackTrigger.TTStubAlgorithmRegister_cfi import * +process.load("SimTracker.TrackTriggerAssociation.TrackTriggerAssociator_cff") + +if GEOMETRY != "TkOnly": + from SimTracker.TrackTriggerAssociation.TTClusterAssociation_cfi import * + TTClusterAssociatorFromPixelDigis.digiSimLinks = cms.InputTag("simSiPixelDigis","Tracker") + +process.TTClusterStub = cms.Path(process.TrackTriggerClustersStubs) +process.TTClusterStubTruth = cms.Path(process.TrackTriggerAssociatorClustersStubs) + +NHELIXPAR = 4 +if (L1TRKALGO == 'HYBRID'): + process.load("L1Trigger.TrackFindingTracklet.Tracklet_cfi") + L1TRK_PROC = process.TTTracksFromTrackletEmulation + L1TRK_NAME = "TTTracksFromTrackletEmulation" + L1TRK_LABEL = "Level1TTTracks" +elif (L1TRKALGO == 'HYBRID_DISPLACED'): + process.load("L1Trigger.TrackFindingTracklet.Tracklet_cfi") + L1TRK_PROC = process.TTTracksFromExtendedTrackletEmulation + L1TRK_NAME = "TTTracksFromExtendedTrackletEmulation" + L1TRK_LABEL = "Level1TTTracks" + NHELIXPAR = 5 +elif (L1TRKALGO == 'TMTT'): + process.load("L1Trigger.TrackFindingTMTT.TMTrackProducer_Ultimate_cff") + L1TRK_PROC = process.TMTrackProducer + L1TRK_NAME = "TMTrackProducer" + L1TRK_LABEL = "TML1TracksKF4ParamsComb" + L1TRK_PROC.EnableMCtruth = cms.bool(False) # Reduce CPU use by disabling internal histos. + L1TRK_PROC.EnableHistos = cms.bool(False) +elif (L1TRKALGO == 'HYBRID_FLOAT'): + process.load("L1Trigger.HybridFloat.HybridTrackProducer_cff") + L1TRK_PROC = process.HybridTrackProducer + L1TRK_NAME = "HybridTrackProducer" + L1TRK_LABEL = "HybridL1TracksKF4ParamsComb" + L1TRK_PROC.EnableMCtruth = cms.bool(False) # Reduce CPU use by disabling internal histos. + L1TRK_PROC.EnableHistos = cms.bool(False) +elif (L1TRKALGO == 'TRACKLET_FLOAT'): + process.load("L1Trigger.TrackFindingTracklet.L1TrackletTracks_cff") + L1TRK_PROC = process.TTTracksFromTracklet + L1TRK_NAME = "TTTracksFromTracklet" + L1TRK_LABEL = "Level1TTTracks" +else: + print "ERROR: Unknown L1TRKALGO option" + exit(1) + +process.load("RecoVertex.BeamSpotProducer.BeamSpot_cfi") +process.load("SimTracker.TrackTriggerAssociation.TrackTriggerAssociator_cff") +process.TTTrackAssociatorFromPixelDigis.TTTracks = cms.VInputTag( cms.InputTag(L1TRK_NAME, L1TRK_LABEL) ) + +## emulation +process.TTTracksEmulation = cms.Path(process.offlineBeamSpot*L1TRK_PROC) +process.TTTracksEmulationWithTruth = cms.Path(process.offlineBeamSpot*L1TRK_PROC*process.TrackTriggerAssociatorTracks) + + +############################################################ +# Define the track ntuple process, MyProcess is the (unsigned) PDGID corresponding to the process which is run +# e.g. single electron/positron = 11 +# single pion+/pion- = 211 +# single muon+/muon- = 13 +# pions in jets = 6 +# taus = 15 +# all TPs = 1 +############################################################ + +process.L1TrackNtuple = cms.EDAnalyzer('L1TrackNtupleMaker', + MyProcess = cms.int32(1), + DebugMode = cms.bool(False), # printout lots of debug statements + SaveAllTracks = cms.bool(True), # save *all* L1 tracks, not just truth matched to primary particle + SaveStubs = cms.bool(False), # save some info for *all* stubs + L1Tk_nPar = cms.int32(NHELIXPAR), # use 4 or 5-parameter L1 tracking? + L1Tk_minNStub = cms.int32(4), # L1 tracks with >= 4 stubs + TP_minNStub = cms.int32(4), # require TP to have >= X number of stubs associated with it + TP_minNStubLayer = cms.int32(4), # require TP to have stubs in >= X layers/disks + TP_minPt = cms.double(2.0), # only save TPs with pt > X GeV + TP_maxEta = cms.double(2.5), # only save TPs with |eta| < X + TP_maxZ0 = cms.double(30.0), # only save TPs with |z0| < X cm + L1TrackInputTag = cms.InputTag(L1TRK_NAME, L1TRK_LABEL), # TTTrack input + MCTruthTrackInputTag = cms.InputTag("TTTrackAssociatorFromPixelDigis", L1TRK_LABEL), ## MCTruth input + # other input collections + L1StubInputTag = cms.InputTag("TTStubsFromPhase2TrackerDigis","StubAccepted"), + MCTruthClusterInputTag = cms.InputTag("TTClusterAssociatorFromPixelDigis", "ClusterAccepted"), + MCTruthStubInputTag = cms.InputTag("TTStubAssociatorFromPixelDigis", "StubAccepted"), + TrackingParticleInputTag = cms.InputTag("mix", "MergedTrackTruth"), + TrackingVertexInputTag = cms.InputTag("mix", "MergedTrackTruth"), + ## tracking in jets stuff (--> requires AK4 genjet collection present!) + TrackingInJets = cms.bool(True), + GenJetInputTag = cms.InputTag("ak4GenJets", ""), + ) + +process.ana = cms.Path(process.L1TrackNtuple) + +# use this if you want to re-run the stub making +# process.schedule = cms.Schedule(process.TTClusterStub,process.TTClusterStubTruth,process.TTTracksEmulationWithTruth,process.ana) + +# use this if cluster/stub associators not available +# process.schedule = cms.Schedule(process.TTClusterStubTruth,process.TTTracksEmulationWithTruth,process.ana) + +# use this to only run tracking + track associator +process.schedule = cms.Schedule(process.TTTracksEmulationWithTruth,process.ana) + +if (WRITE_DATA): + + process.writeDataset = cms.OutputModule("PoolOutputModule", + splitLevel = cms.untracked.int32(0), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + outputCommands = process.RAWSIMEventContent.outputCommands, + fileName = cms.untracked.string('output_dataset.root'), ## ADAPT IT ## + dataset = cms.untracked.PSet( + filterName = cms.untracked.string(''), + dataTier = cms.untracked.string('GEN-SIM') + ) + ) + # Include TMTT L1 tracks & associators + stubs. + process.writeDataset.outputCommands.append('keep *TTTrack*_*_*_*') + process.writeDataset.outputCommands.append('keep *TTStub*_*_*_*') + + process.pd = cms.EndPath(process.writeDataset) + process.schedule.append(process.pd) + diff --git a/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py b/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py index f72ce0ac5941b..e24fb509e4280 100644 --- a/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py +++ b/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py @@ -13,12 +13,12 @@ GEOMETRY = "D49" -if GEOMETRY == "D41": - process.load('Configuration.Geometry.GeometryExtended2026D41Reco_cff') - process.load('Configuration.Geometry.GeometryExtended2026D41_cff') -elif GEOMETRY == "D49": +if GEOMETRY == "D49": process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff') process.load('Configuration.Geometry.GeometryExtended2026D49_cff') +else: + print "this is not a valid geometry!!!" + exit process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') @@ -26,6 +26,8 @@ process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '') process.load("FWCore.MessageLogger.MessageLogger_cfi") +process.MessageLogger.categories.append('L1track') +process.MessageLogger.L1track = cms.untracked.PSet(limit = cms.untracked.int32(-1)) options = VarParsing.VarParsing ('analysis') @@ -33,9 +35,8 @@ def getTxtFile(txtFileName): return os.environ['CMSSW_BASE']+'/src/L1Trigger/TrackFindingTMTT/data/'+txtFileName #--- Specify input MC -if GEOMETRY == "D41": - inputMCtxt = getTxtFile('MCsamples/1060/RelVal/TTbar/PU200.txt') -elif GEOMETRY == "D49": +# MC txt files are in https://github.com/cms-data/L1Trigger-TrackFindingTMTT. +if GEOMETRY == "D49": inputMCtxt = getTxtFile('MCsamples/1110/RelVal/TTbar/PU200.txt') # Fastest to use a local copy ... @@ -90,19 +91,32 @@ def getTxtFile(txtFileName): process.Timing = cms.Service("Timing", summaryOnly = cms.untracked.bool(True)) +# Random number generator for Stub Killer (dead module emulation) +process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService", + TMTrackProducer = cms.PSet( + initialSeed = cms.untracked.uint32(12345) + ) +) + #--- Load code that produces our L1 tracks and makes corresponding histograms. #process.load('L1Trigger.TrackFindingTMTT.TMTrackProducer_cff') #--- Alternative cfg including improvements not yet in the firmware. Aimed at L1 trigger studies. process.load('L1Trigger.TrackFindingTMTT.TMTrackProducer_Ultimate_cff') # +# Enable histogramming & use of MC truth (considerably increases CPU) +process.TMTrackProducer.EnableMCtruth = True +process.TMTrackProducer.EnableHistos = True +# #--- Optionally override default configuration parameters here (example given of how). -#process.TMTrackProducer.TrackFitSettings.TrackFitters = cms.vstring( +#process.TMTrackProducer.TrackFitSettings.TrackFitters = [ # "KF5ParamsComb", -# "KF4ParamsComb", -# "KF4ParamsCombHLS" -# ) +# "KF4ParamsComb" +# "KF4ParamsCombHLS", +# "ChiSquaredFit4", +# "SimpleLR4" +# ] # If the input samples contain stubs and the truth association, then you can just use the following path process.p = cms.Path(process.TMTrackProducer) From de9b0a8d8582aba8fa9c9f221c0e233879735d8e Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Wed, 13 May 2020 18:00:23 +0100 Subject: [PATCH 17/22] Fix clang errors (#14) * fixed clang error * directory for MC txt files --- L1Trigger/TrackFindingTMTT/data/README | 1 + L1Trigger/TrackFindingTMTT/interface/Stub.h | 4 +-- .../interface/TrackerModule.h | 4 +-- .../TrackFindingTMTT/src/KFParamsComb.cc | 31 +++++++------------ 4 files changed, 17 insertions(+), 23 deletions(-) create mode 100644 L1Trigger/TrackFindingTMTT/data/README diff --git a/L1Trigger/TrackFindingTMTT/data/README b/L1Trigger/TrackFindingTMTT/data/README new file mode 100644 index 0000000000000..35172a02d553a --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/data/README @@ -0,0 +1 @@ +Add a symbolic link from here to the MCsamples/ directory that can be found in https://github.com/cms-data/L1Trigger-TrackFindingTMTT , where .txt files listing available MC samples can be found. \ No newline at end of file diff --git a/L1Trigger/TrackFindingTMTT/interface/Stub.h b/L1Trigger/TrackFindingTMTT/interface/Stub.h index 2d8372adfe06a..e1c0832010a4a 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Stub.h +++ b/L1Trigger/TrackFindingTMTT/interface/Stub.h @@ -183,12 +183,12 @@ namespace tmtt { float sigmaZ() const { return (barrel() ? sigmaPar() : 0.); } // Hit resolution perpendicular to strip. Measures phi. float sigmaPerp() const { - constexpr float f = sqrt(1. / 12); + static const float f = sqrt(1. / 12); return f * stripPitch_; } // Hit resolution parallel to strip. Measures r or z. float sigmaPar() const { - constexpr float f = sqrt(1. / 12.); + static const float f = sqrt(1. / 12.); return f * stripLength_; } diff --git a/L1Trigger/TrackFindingTMTT/interface/TrackerModule.h b/L1Trigger/TrackFindingTMTT/interface/TrackerModule.h index c3149ce1ce03e..f047cd3049e3a 100644 --- a/L1Trigger/TrackFindingTMTT/interface/TrackerModule.h +++ b/L1Trigger/TrackFindingTMTT/interface/TrackerModule.h @@ -84,12 +84,12 @@ namespace tmtt { float stripLength() const { return stripLength_; } // Hit resolution perpendicular to strip (or to longest pixel axis). Measures phi. float sigmaPerp() const { - constexpr float f = sqrt(1. / 12.); + static const float f = sqrt(1. / 12.); return f * stripPitch_; } // Hit resolution parallel to strip (or to longest pixel axis). Measures r or z. float sigmaPar() const { - constexpr float f = sqrt(1. / 12.); + static const float f = sqrt(1. / 12.); return f * stripLength_; } // Sensor pitch over separation. diff --git a/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc b/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc index 2021ef597164c..35762f558ccbb 100644 --- a/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc +++ b/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc @@ -36,27 +36,20 @@ namespace tmtt { // Assumed track seed (from HT) uncertainty in transverse impact parameter. // Constants optimised by hand for TMTT algo. - const float inv2Rsigma2 = pow(0.0314 * invPtToInv2R, 2); - constexpr float phi0sigma2 = pow(0.0102, 2); - constexpr float z0sigma2 = pow(5.0, 2); - constexpr float tanLsigma2 = pow(0.5, 2); - constexpr float d0Sigma2 = pow(1.0, 2); - matC[INV2R][INV2R] = inv2Rsigma2; - matC[PHI0][PHI0] = phi0sigma2; - matC[Z0][Z0] = z0sigma2; - matC[T][T] = tanLsigma2; + const float inv2Rsigma = 0.0314 * invPtToInv2R; + constexpr float phi0sigma = 0.0102; + constexpr float z0sigma = 5.0; + constexpr float tanLsigma = 0.5; + constexpr float d0Sigma = 1.0; + // (z0, tanL, d0) uncertainties could be smaller for Hybrid, if seeded in PS? -- To check! + // if (L1track3D.seedPS() > 0) z0sigma /= 4; ??? + matC[INV2R][INV2R] = pow(inv2Rsigma, 2); + matC[PHI0][PHI0] = pow(phi0sigma, 2); + matC[Z0][Z0] = pow(z0sigma, 2); + matC[T][T] = pow(tanLsigma, 2); if (nPar_ == 5) { - matC[D0][D0] = d0Sigma2; + matC[D0][D0] = pow(d0Sigma, 2); } - - //if (settings_->hybrid()) { - // N.B. (z0, tanL, d0) seed uncertainties could be smaller for hybrid, if seeded in PS? -- not tried - //if (l1track3D.seedPS() > 0) { // Tracklet seed used PS layers - // matC[Z0][Z0] /= (4.*4.).; - // matC[T][T] /= (4.*4.); - // } - //} - return matC; } From 167d60a96d74058593c410205cf6fe8e03e0c23c Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Fri, 15 May 2020 11:59:49 +0100 Subject: [PATCH 18/22] Fixed clang warnings + minor simplifications (#15) * tweak * tweak * Fixed clang warnings and small simplifications * Fixed clang warnings and small simplifications --- L1Trigger/TrackFindingTMTT/README.md | 4 +- .../interface/GlobalCacheTMTT.h | 15 +- .../TrackFindingTMTT/interface/Settings.h | 38 +---- L1Trigger/TrackFindingTMTT/interface/Stub.h | 42 +++--- .../interface/TrackerModule.h | 12 +- .../plugins/TMTrackProducer.cc | 1 - .../python/TMTrackProducer_Defaults_cfi.py | 2 - .../src/ConverterToTTTrack.cc | 1 - L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc | 1 - L1Trigger/TrackFindingTMTT/src/Settings.cc | 137 ++++++------------ L1Trigger/TrackFindingTMTT/src/Stub.cc | 45 +++--- L1Trigger/TrackFindingTMTT/src/Utility.cc | 52 ++----- .../test/L1TrackNtupleMaker_cfg.py | 3 + 13 files changed, 122 insertions(+), 231 deletions(-) diff --git a/L1Trigger/TrackFindingTMTT/README.md b/L1Trigger/TrackFindingTMTT/README.md index bc2738a4b3bc5..f7c403dfdee44 100644 --- a/L1Trigger/TrackFindingTMTT/README.md +++ b/L1Trigger/TrackFindingTMTT/README.md @@ -13,7 +13,9 @@ editing if necessary variables: GEOMETRY (CMS geometry version), inputMCtxt (MC - Look at the performance histograms Hist.root (explained in class "Histos" below) 2) cmsRun -n 4 L1TrackNtupleMaker_cfg.py -after editing it to change L1TRACKALGO = 'TMTT'. This writes a TTree with the fitfitted L1 tracks to file in a TTTrack collection, from which tracking performance can be studied with ROOT macro. L1TrackNtuplePlot.C. +after editing it to change L1TRACKALGO = 'TMTT'. This writes a TTree of the fitted L1 tracks to .root file, from which tracking performance can be studied with ROOT macro L1Trigger/TrackFindingTracklet/test/L1TrackNtuplePlot.C. Other values of L1TRACKALGO permit to run the Hybrid or Tracklet emulation, or floating point emulation. + +Both (1) & (2) are able to write a dataset containing the TTTrack collection of the fitted tracks. N.B. .txt files listing available MC samples can be found in https://github.com/cms-data/L1Trigger-TrackFindingTMTT . diff --git a/L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h b/L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h index e6dab023018aa..f16b73492f4b3 100644 --- a/L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h +++ b/L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h @@ -18,11 +18,15 @@ namespace tmtt { + namespace { + std::mutex myMutex; + } + class GlobalCacheTMTT { public: GlobalCacheTMTT(const edm::ParameterSet& iConfig) : settings_(iConfig), // Python configuration params - htRphiErrMon_({0., 0, 0, 0}), // rphi HT error monitoring + htRphiErrMon_(), // rphi HT error monitoring stubWindowSuggest_(&settings_), // Recommend FE stub window sizes. hists_(&settings_) // Histograms { @@ -30,7 +34,7 @@ namespace tmtt { } // Get functions - Settings& settings() const { return settings_; } + const Settings& settings() const { return settings_; } HTrphi::ErrorMonitor& htRphiErrMon() const { return htRphiErrMon_; } StubWindowSuggest& stubWindowSuggest() const { return stubWindowSuggest_; } const std::list& listTrackerModule() const { return listTrackerModule_; } @@ -38,13 +42,16 @@ namespace tmtt { // Set functions void setListTrackerModule(const std::list& list) const { - // Only need one copy of tracker geoemtry for histogramming. + // Allow only one thread to run this function at a time + std::lock_guard myGuard(myMutex); + + // Only need one copy of tracker geometry for histogramming. if (listTrackerModule_.size() == 0) listTrackerModule_ = list; } private: - mutable Settings settings_; + Settings settings_; mutable HTrphi::ErrorMonitor htRphiErrMon_; mutable StubWindowSuggest stubWindowSuggest_; mutable std::list listTrackerModule_; diff --git a/L1Trigger/TrackFindingTMTT/interface/Settings.h b/L1Trigger/TrackFindingTMTT/interface/Settings.h index 82b0bfad56ec4..0d7921809957f 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Settings.h +++ b/L1Trigger/TrackFindingTMTT/interface/Settings.h @@ -218,8 +218,6 @@ namespace tmtt { double minPtToReduceLayers() const { return minPtToReduceLayers_; } // Change min. number of layers cut to (MinStubLayers - 1) for tracks in these rapidity sectors. const std::vector& etaSecsReduceLayers() const { return etaSecsReduceLayers_; } - // Define layers using layer ID (true) or by bins in radius of 5 cm width (false)? - bool useLayerID() const { return useLayerID_; } //Reduce this layer ID, so that it takes no more than 8 different values in any eta region (simplifies firmware)? bool reduceLayerID() const { return reduceLayerID_; } @@ -391,16 +389,10 @@ namespace tmtt { double trackerOuterRadius() const { return 112.7; } // max. occuring stub radius. double trackerInnerRadius() const { return 21.8; } // min. occuring stub radius. double trackerHalfLength() const { return 270.; } // half-length of tracker. - double layerIDfromRadiusBin() const { - return 6.; - } // When counting stubs in layers, actually histogram stubs in distance from beam-line with this bin size. - double crazyStubCut() const { - return 0.01; - } // Stubs differing from TP trajectory by more than this in phi are assumed to come from delta rays etc. - - //=== Set and get B-field value in Tesla. - // N.B. This must bet std::set for each event, and can't be initialized at the beginning of the job. - void setMagneticField(float magneticField) { magneticField_ = magneticField; } + + //=== Set and get B-field value (mutable) in Tesla. + // N.B. This must bet std::set for each run, and can't be initialized at the beginning of the job. + void setMagneticField(float magneticField) const { magneticField_ = magneticField; } float magneticField() const { if (magneticField_ == 0.) throw cms::Exception("LogicError") << "Settings: You attempted to access the B field before it was initialized"; @@ -410,15 +402,6 @@ namespace tmtt { //=== Settings used for HYBRID TRACKING code only. // Is hybrid tracking in use? bool hybrid() const { return hybrid_; } - // Info about geometry, needed for use of hybrid outside CMSSW. - double ssStripPitch() const { return ssStripPitch_; } - double ssNStrips() const { return ssNStrips_; } - double ssStripLength() const { return ssStripLength_; } - double psPixelPitch() const { return psPixelPitch_; } - double psNStrips() const { return psNStrips_; } - double psPixelLength() const { return psPixelLength_; } - // max z at which non-tilted modules are found in 3 barrel PS layers. (Element 0 not used). - const std::vector& zMaxNonTilted() const { return zMaxNonTilted_; } private: // Input tags for ES & ED data. @@ -560,7 +543,6 @@ namespace tmtt { unsigned int minStubLayers_; double minPtToReduceLayers_; std::vector etaSecsReduceLayers_; - bool useLayerID_; bool reduceLayerID_; // Specification of algorithm to eliminate duplicate tracks @@ -599,7 +581,6 @@ namespace tmtt { double residualCut_; // unsigned kalmanDebugLevel_; - bool kalmanFillInternalHists_; unsigned int kalmanMinNumStubs_; unsigned int kalmanMaxNumStubs_; bool kalmanAddBeamConstr_; @@ -661,19 +642,10 @@ namespace tmtt { bool writeOutEdmFile_; // B-field in Tesla - std::atomic magneticField_; + mutable std::atomic magneticField_; // Hybrid tracking bool hybrid_; - - double psPixelPitch_; - double psNStrips_; - double psPixelLength_; - double ssStripPitch_; - double ssNStrips_; - double ssStripLength_; - - std::vector zMaxNonTilted_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/Stub.h b/L1Trigger/TrackFindingTMTT/interface/Stub.h index e1c0832010a4a..4e73299917589 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Stub.h +++ b/L1Trigger/TrackFindingTMTT/interface/Stub.h @@ -42,19 +42,23 @@ namespace tmtt { class Stub { public: // Hybrid L1 tracking: stub constructor. - Stub(double phi, - double r, - double z, - double bend, - unsigned int layerId, - bool psModule, - bool barrel, - unsigned int iphi, - double alpha, - const Settings* settings, - unsigned int ID, - unsigned int iPhiSec); - + Stub(const Settings* settings, + unsigned int idStub, + double phi, + double r, + double z, + double bend, + unsigned int iphi, + double alpha, + unsigned int layerId, + unsigned int iPhiSec, + bool psModule, + bool barrel, + bool tiltedBarrel, + float stripPitch, + float stripLength, + unsigned int nStrips); + // TMTT L1 tracking: stub constructor. Stub(const TTStubRef& ttStubRef, unsigned int index_in_vStubs, @@ -182,15 +186,9 @@ namespace tmtt { float sigmaR() const { return (barrel() ? 0. : sigmaPar()); } float sigmaZ() const { return (barrel() ? sigmaPar() : 0.); } // Hit resolution perpendicular to strip. Measures phi. - float sigmaPerp() const { - static const float f = sqrt(1. / 12); - return f * stripPitch_; - } + float sigmaPerp() const {return invRoot12 * stripPitch_;} // Hit resolution parallel to strip. Measures r or z. - float sigmaPar() const { - static const float f = sqrt(1. / 12.); - return f * stripLength_; - } + float sigmaPar() const {return invRoot12 * stripLength_;} //--- These module variables could be taken directly from trackerModule_, were it not for need //--- to support Hybrid. @@ -291,6 +289,8 @@ namespace tmtt { unsigned int nStrips_; const float rejectedStubBend_ = 99999.; // Bend set to this if stub rejected. + + const float invRoot12 = sqrt(1./12.); }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/TrackerModule.h b/L1Trigger/TrackFindingTMTT/interface/TrackerModule.h index f047cd3049e3a..e676315d2fa27 100644 --- a/L1Trigger/TrackFindingTMTT/interface/TrackerModule.h +++ b/L1Trigger/TrackFindingTMTT/interface/TrackerModule.h @@ -83,15 +83,9 @@ namespace tmtt { // Strip length (or pixel pitch along longest axis). float stripLength() const { return stripLength_; } // Hit resolution perpendicular to strip (or to longest pixel axis). Measures phi. - float sigmaPerp() const { - static const float f = sqrt(1. / 12.); - return f * stripPitch_; - } + float sigmaPerp() const {return invRoot12 * stripPitch_;} // Hit resolution parallel to strip (or to longest pixel axis). Measures r or z. - float sigmaPar() const { - static const float f = sqrt(1. / 12.); - return f * stripLength_; - } + float sigmaPar() const {return invRoot12 * stripLength_;} // Sensor pitch over separation. float pitchOverSep() const { return stripPitch_ / sensorSpacing_; } // "B" parameter correction for module tilt. @@ -134,6 +128,8 @@ namespace tmtt { unsigned int moduleTypeID_; ModuleTypeCfg moduleTypeCfg_; + + float invRoot12 = sqrt(1./12.); }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc index 0a3ea22eaa171..99844bf539b82 100644 --- a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc +++ b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc @@ -172,7 +172,6 @@ namespace tmtt { // Pointers to TTTrack collections for ED output. auto htTTTracksForOutput = std::make_unique(); auto rzTTTracksForOutput = std::make_unique(); - const unsigned int nFitAlgs = trackFitters_.size(); map> allFitTTTracksForOutput; for (const string& fitterName : trackFitters_) { auto fitTTTracksForOutput = std::make_unique(); diff --git a/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py index e1dce6df2721a..bb64e14ef0ddc 100644 --- a/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py +++ b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py @@ -236,8 +236,6 @@ # (Histogram "AlgEffVsEtaSec" will help you identify which sectors to declare). #EtaSecsReduceLayers = cms.vuint32(), EtaSecsReduceLayers = cms.vuint32(5,12), - # Define layers using layer ID (true) or by bins in radius of 5 cm width (false). - UseLayerID = cms.bool(True), # Reduce this layer ID, so that it takes no more than 8 different values in any eta region (simplifies firmware). ReducedLayerID = cms.bool(True) ), diff --git a/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc b/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc index cae57cb0ba943..17c2dd1f01a2f 100644 --- a/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc +++ b/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc @@ -23,7 +23,6 @@ namespace tmtt { hitPattern = 0; d0 = 0.; z0 = 0; - ; tanL = 0; chi2rphi = 0.; chi2rz = 0; diff --git a/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc b/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc index 64cbcef54f054..460c88715ddb2 100644 --- a/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc +++ b/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc @@ -239,7 +239,6 @@ namespace tmtt { numStubsPerLinkStage2[encodedLinkYZ] += numStubs; } else { - newerLink = newLink; newererLink = newLink; } unsigned int trueLinkID = diff --git a/L1Trigger/TrackFindingTMTT/src/Settings.cc b/L1Trigger/TrackFindingTMTT/src/Settings.cc index 514f3476bd527..46cc178090bd0 100644 --- a/L1Trigger/TrackFindingTMTT/src/Settings.cc +++ b/L1Trigger/TrackFindingTMTT/src/Settings.cc @@ -10,91 +10,54 @@ namespace tmtt { ///=== Hybrid Tracking ///=== Set config params for HYBRID TRACKING via hard-wired consts to allow use outside CMSSW. - Settings::Settings() { - // +Settings::Settings(): + //-------------------------------------------------------------------------------------------------- // TMTT related configuration parameters, including Kalman Filter. // Meaning of these parameters explained in TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py - // - reduceLayerID_ = true; - useLayerID_ = true; - minFracMatchStubsOnReco_ = -99; - minFracMatchStubsOnTP_ = -99; - minNumMatchLayers_ = 4; - minNumMatchPSLayers_ = 0; - stubMatchStrict_ = false; - minStubLayers_ = 4; - minPtToReduceLayers_ = 99999.; - kalmanMinNumStubs_ = 4; - kalmanMaxNumStubs_ = 6; - numPhiNonants_ = 9; - numPhiSectors_ = 9; - 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}; // Used by KF - kalmanRemove2PScut_ = true; - killScenario_ = 0; - kalmanMaxSkipLayersHard_ = 1; // On "hard" input tracks - kalmanMaxSkipLayersEasy_ = 2; // On "easy" input tracks - kalmanMaxStubsEasy_ = 10; // Max. #stubs an input track can have to be defined "easy" - kalmanMaxStubsPerLayer_ = 4; // To save resources, consider at most this many stubs per layer per track. - kalmanDebugLevel_ = 0; - //kalmanDebugLevel_=2; // Good for debugging - enableDigitize_ = false; - houghMinPt_ = 2.0; - chosenRofPhi_ = 67.240; - chosenRofZ_ = 50.0; - houghNbinsPt_ = 48; // Mini HT bins in 2 GeV HT array - useApproxB_ = true; - kalmanHOtilted_ = true; - kalmanHOhelixExp_ = true; - kalmanHOalpha_ = 1; - kalmanHOfw_ = false; - kalmanHOprojZcorr_ = 1; - bApprox_gradient_ = 0.886454; - bApprox_intercept_ = 0.504148; - kalmanMultiScattTerm_ = 0.00075; - kalmanChi2RphiScale_ = 8; - // - // Cfg params & constants required only for HYBRID tracking (as taken from DB for TMTT). - // + //-------------------------------------------------------------------------------------------------- + + // General cfg params + enableDigitize_(false), + useApproxB_(true), + bApprox_gradient_(0.886454), + bApprox_intercept_(0.504148), + numPhiNonants_(9), + numPhiSectors_(9), + chosenRofPhi_(55.), // Hourglass radius in r-phi (tracklet) +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}), + chosenRofZ_(50.0), // Hourglass radius in r-z (this must be tmtt) + houghMinPt_(2.0), // L1 track pt cut + minStubLayers_(4), + minPtToReduceLayers_(99999.), + reduceLayerID_(true), + minFracMatchStubsOnReco_(-99), + minFracMatchStubsOnTP_(-99), + minNumMatchLayers_(4), + minNumMatchPSLayers_(0), + stubMatchStrict_(false), + + // Kalman filter track fit cfg + kalmanDebugLevel_(0), + //kalmanDebugLevel_(2), // Good for debugging + kalmanMinNumStubs_(4), + kalmanMaxNumStubs_(6), + kalmanRemove2PScut_(true), + kalmanMaxSkipLayersHard_(1), // On "hard" input tracks + kalmanMaxSkipLayersEasy_(2), // On "easy" input tracks + kalmanMaxStubsEasy_(10), // Max. #stubs an input track can have to be defined "easy" + kalmanMaxStubsPerLayer_(4), // To save resources, consider at most this many stubs per layer per track. + kalmanMultiScattTerm_(0.00075), + kalmanChi2RphiScale_(8), + kalmanHOtilted_(true), + kalmanHOhelixExp_(true), + kalmanHOalpha_(1), + kalmanHOprojZcorr_(1), + kalmanHOfw_(false) + { + hybrid_ = true; - psPixelPitch_ = 0.01; - psNStrips_ = 960; - psPixelLength_ = 0.1467; - ssStripPitch_ = 0.009; - ssNStrips_ = 1016; - ssStripLength_ = 5.0250; - // max z at which non-tilted modules are found in 3 barrel PS layers. (Element 0 not used). - zMaxNonTilted_ = {0, 15.3, 24.6, 33.9}; - - magneticField_ = 3.81120228767395; - - // Stub digitization params for hybrid (copied from TrackFindingTMTT/interface/HLS/KFconstants.h - constexpr double rMult_hybrid = 1. / 0.02929688; - constexpr double phiSMult_hybrid = 1. / (7.828293e-6 * 8); - constexpr double zMult_hybrid = - rMult_hybrid / 2; // In KF VHDL, z/r mult = 1/2, whereas in HLS, they are identical. - // Number of bits copied from TrackFindingTMTT/interface/HLS/KFstub.h (BR1, BPHI, BZ) - rtBits_ = 12; - phiSBits_ = 14; - zBits_ = 14; - rtRange_ = pow(2, rtBits_) / rMult_hybrid; - phiSRange_ = pow(2, phiSBits_) / phiSMult_hybrid; - zRange_ = pow(2, zBits_) / zMult_hybrid; + magneticField_ = 0.; // Value set later + killScenario_ = 0; // Emulation of dead modules if (hybrid_) { if (not useApproxB_) { @@ -256,7 +219,6 @@ namespace tmtt { minStubLayers_(l1TrackDef_.getParameter("MinStubLayers")), minPtToReduceLayers_(l1TrackDef_.getParameter("MinPtToReduceLayers")), etaSecsReduceLayers_(l1TrackDef_.getParameter>("EtaSecsReduceLayers")), - useLayerID_(l1TrackDef_.getParameter("UseLayerID")), reduceLayerID_(l1TrackDef_.getParameter("ReducedLayerID")), //=== Specification of algorithm to eliminate duplicate tracks. @@ -363,13 +325,8 @@ namespace tmtt { magneticField_(0.), // Hybrid tracking - hybrid_(iConfig.getParameter("Hybrid")), - psPixelPitch_(0.), - psNStrips_(0.), - psPixelLength_(0.), - ssStripPitch_(0.), - ssNStrips_(0.), - ssStripLength_(0.) { + hybrid_(iConfig.getParameter("Hybrid")) + { // If user didn't specify any PDG codes, use e,mu,pi,K,p, to avoid picking up unstable particles like Xi-. vector genPdgIdsUnsigned(genCuts_.getParameter>("GenPdgIds")); if (genPdgIdsUnsigned.empty()) { diff --git a/L1Trigger/TrackFindingTMTT/src/Stub.cc b/L1Trigger/TrackFindingTMTT/src/Stub.cc index 71678b3b0d65d..86364219165af 100644 --- a/L1Trigger/TrackFindingTMTT/src/Stub.cc +++ b/L1Trigger/TrackFindingTMTT/src/Stub.cc @@ -17,19 +17,24 @@ namespace tmtt { //=== Hybrid L1 tracking: stub constructor. - Stub::Stub(double phi, + Stub::Stub(const Settings* settings, + unsigned int idStub, + double phi, double r, double z, double bend, + unsigned int iphi, + double alpha, unsigned int layerId, + unsigned int iPhiSec, bool psModule, bool barrel, - unsigned int iphi, - double alpha, - const Settings* settings, - unsigned int ID, - unsigned int iPhiSec) - : phi_(phi), + bool tiltedBarrel, + float stripPitch, + float stripLength, + unsigned int nStrips) + : index_in_vStubs_(idStub), // A unique ID to label the stub. + phi_(phi), r_(r), z_(z), bend_(bend), @@ -39,26 +44,12 @@ namespace tmtt { psModule_(psModule), layerId_(layerId), layerIdReduced_(TrackerModule::calcLayerIdReduced(layerId)), - barrel_(barrel) { //work in progress on better constructor for new hybrid - if (psModule && barrel) { - // max z at which non-tilted modules are found in 3 barrel PS layers. (Element 0 not used). - const vector& zMax = settings->zMaxNonTilted(); - tiltedBarrel_ = (std::abs(z) > zMax[layerId]); - } else { - tiltedBarrel_ = false; - } - tiltAngle_ = 0.; // Not used if cfg uses "ApproxB". - if (psModule) { - stripPitch_ = settings->psPixelPitch(); - stripLength_ = settings->psPixelLength(); - nStrips_ = settings->psNStrips(); - } else { - stripPitch_ = settings->ssStripPitch(); - stripLength_ = settings->ssStripLength(); - nStrips_ = settings->ssNStrips(); - } - index_in_vStubs_ = ID; // A unique ID to label the stub. - } + barrel_(barrel), + tiltedBarrel_(tiltedBarrel), + stripPitch_(stripPitch), + stripLength_(stripLength), + nStrips_(nStrips) +{} //=== TMTT L1 tracking: stub constructor. diff --git a/L1Trigger/TrackFindingTMTT/src/Utility.cc b/L1Trigger/TrackFindingTMTT/src/Utility.cc index 511074c1bdc0f..ee6fca615aa0a 100644 --- a/L1Trigger/TrackFindingTMTT/src/Utility.cc +++ b/L1Trigger/TrackFindingTMTT/src/Utility.cc @@ -5,6 +5,8 @@ #include "FWCore/Utilities/interface/Exception.h" +#include + using namespace std; namespace tmtt { @@ -28,55 +30,21 @@ namespace tmtt { // Note if using reduced layer ID, so tracker layer can be encoded in 3 bits. const bool reduceLayerID = settings->reduceLayerID(); - // Define layers using layer ID (true) or by bins in radius of 5 cm width (false). - const bool useLayerID = settings->useLayerID(); - // When counting stubs in layers, actually histogram stubs in distance from beam-line with this bin size. - const float layerIDfromRadiusBin = settings->layerIDfromRadiusBin(); - // Inner radius of tracker. - const float trackerInnerRadius = settings->trackerInnerRadius(); // Disable use of reduced layer ID if requested, otherwise take from cfg. bool reduce = (disableReducedLayerID) ? false : reduceLayerID; - const int maxLayerID(30); - vector foundLayers(maxLayerID, false); - - if (useLayerID) { - // Count layers using CMSSW layer ID. - for (const Stub* stub : vstubs) { - if ((!onlyPS) || stub->psModule()) { // Consider only stubs in PS modules if that option specified. - // Use either normal or reduced layer ID depending on request. - int layerID = reduce ? stub->layerIdReduced() : stub->layerId(); - if (layerID >= 0 && layerID < maxLayerID) { - foundLayers[layerID] = true; - } else { - throw cms::Exception("LogicError") << "Utility::invalid layer ID"; - } - } - } - - } else { - // Count layers by binning stub distance from beam line. - for (const Stub* stub : vstubs) { - if ((!onlyPS) || stub->psModule()) { // Consider only stubs in PS modules if that option specified. - // N.B. In this case, no concept of "reduced" layer ID has been defined yet, so don't depend on "reduce"; - int layerID = (int)((stub->r() - trackerInnerRadius) / layerIDfromRadiusBin); - if (layerID >= 0 && layerID < maxLayerID) { - foundLayers[layerID] = true; - } else { - throw cms::Exception("LogicError") << "Utility::invalid layer ID"; - } - } + // Count layers using CMSSW layer ID. + set foundLayers; + for (const Stub* stub : vstubs) { + if ((!onlyPS) || stub->psModule()) { // Consider only stubs in PS modules if that option specified. + // Use either normal or reduced layer ID depending on request. + int layerID = reduce ? stub->layerIdReduced() : stub->layerId(); + foundLayers.insert(layerID); } } - unsigned int ncount = 0; - for (const bool& found : foundLayers) { - if (found) - ncount++; - } - - return ncount; + return foundLayers.size(); } //=== Given a set of stubs (presumably on a reconstructed track candidate) diff --git a/L1Trigger/TrackFindingTMTT/test/L1TrackNtupleMaker_cfg.py b/L1Trigger/TrackFindingTMTT/test/L1TrackNtupleMaker_cfg.py index a708074993e14..733453e741bbc 100644 --- a/L1Trigger/TrackFindingTMTT/test/L1TrackNtupleMaker_cfg.py +++ b/L1Trigger/TrackFindingTMTT/test/L1TrackNtupleMaker_cfg.py @@ -15,6 +15,7 @@ GEOMETRY = "D49" # Specify L1 tracking algo ('HYBRID', 'HYBRID_DISPLACED', 'TMTT','HYBRID_FLOAT', 'TRACKLET_FLOAT'), +# (To run Tracklet, set L1TRKALGO='HYBRID', and set USEHYBRID in TrackFindingTracklet/interface/Settings.h) L1TRKALGO = 'TMTT' # Write output dataset? @@ -31,6 +32,8 @@ process.load('Configuration.StandardSequences.Services_cff') process.load('FWCore.MessageService.MessageLogger_cfi') +process.MessageLogger.categories.append('L1track') +process.MessageLogger.categories.append('Tracklet') process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.StandardSequences.MagneticField_cff') From c35b41048d02275f93f6ce0757a0958bf0821306 Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Mon, 18 May 2020 14:53:53 +0100 Subject: [PATCH 19/22] All remaining review comments addressed (#16) * Replaced vector size with empty function * Simplified DegradeBend and StubWindowSuggest * Fixed more review comments * More review comments * code reformat * Ran exhaustive clang tidy --- .../interface/ChiSquaredFit4.h | 8 +- .../interface/ChiSquaredFitBase.h | 2 +- .../TrackFindingTMTT/interface/DegradeBend.h | 25 ++-- .../interface/DupFitTrkKiller.h | 4 +- .../interface/GlobalCacheTMTT.h | 6 +- L1Trigger/TrackFindingTMTT/interface/HTrphi.h | 18 +-- .../TrackFindingTMTT/interface/InputData.h | 4 + .../TrackFindingTMTT/interface/KFParamsComb.h | 33 +++-- L1Trigger/TrackFindingTMTT/interface/KFbase.h | 10 +- .../TrackFindingTMTT/interface/KalmanState.h | 9 -- .../interface/L1fittedTrack.h | 34 ++--- .../TrackFindingTMTT/interface/L1track2D.h | 30 ++-- .../TrackFindingTMTT/interface/L1track3D.h | 30 ++-- .../TrackFindingTMTT/interface/MiniHTstage.h | 3 +- .../TrackFindingTMTT/interface/MuxHToutputs.h | 4 +- .../TrackFindingTMTT/interface/Settings.h | 37 +++-- .../TrackFindingTMTT/interface/SimpleLR4.h | 4 +- L1Trigger/TrackFindingTMTT/interface/Stub.h | 46 +++--- .../interface/StubFEWindows.h | 53 +++++++ .../interface/StubWindowSuggest.h | 14 +- .../interface/TrackerModule.h | 6 +- .../plugins/TMTrackProducer.cc | 29 +++- .../plugins/TMTrackProducer.h | 21 ++- .../python/TMTrackProducer_Defaults_cfi.py | 11 ++ .../python/TMTrackProducer_Ultimate_cff.py | 10 ++ .../python/TMTrackProducer_cff.py | 11 ++ .../src/ConverterToTTTrack.cc | 2 +- L1Trigger/TrackFindingTMTT/src/DegradeBend.cc | 115 ++------------- .../TrackFindingTMTT/src/DigitalTrack.cc | 4 +- .../TrackFindingTMTT/src/DupFitTrkKiller.cc | 14 +- L1Trigger/TrackFindingTMTT/src/HTbase.cc | 2 +- L1Trigger/TrackFindingTMTT/src/HTrphi.cc | 30 ++-- L1Trigger/TrackFindingTMTT/src/Histos.cc | 6 +- L1Trigger/TrackFindingTMTT/src/InputData.cc | 5 +- .../TrackFindingTMTT/src/KFParamsComb.cc | 88 ++++++------ L1Trigger/TrackFindingTMTT/src/KFbase.cc | 131 ++++++++---------- L1Trigger/TrackFindingTMTT/src/KalmanState.cc | 2 +- .../TrackFindingTMTT/src/Make3Dtracks.cc | 2 +- L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc | 17 ++- .../TrackFindingTMTT/src/MuxHToutputs.cc | 8 +- L1Trigger/TrackFindingTMTT/src/Settings.cc | 114 ++++++++------- L1Trigger/TrackFindingTMTT/src/Stub.cc | 36 ++--- .../TrackFindingTMTT/src/StubFEWindows.cc | 78 +++++++++++ L1Trigger/TrackFindingTMTT/src/StubKiller.cc | 77 +++++----- .../TrackFindingTMTT/src/StubWindowSuggest.cc | 45 ++---- L1Trigger/TrackFindingTMTT/src/TP.cc | 10 +- .../TrackFindingTMTT/src/TrackerModule.cc | 2 + L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc | 1 + L1Trigger/TrackFindingTMTT/src/Utility.cc | 6 +- .../test/tmtt_tf_analysis_cfg.py | 9 +- 50 files changed, 687 insertions(+), 579 deletions(-) create mode 100644 L1Trigger/TrackFindingTMTT/interface/StubFEWindows.h create mode 100644 L1Trigger/TrackFindingTMTT/src/StubFEWindows.cc diff --git a/L1Trigger/TrackFindingTMTT/interface/ChiSquaredFit4.h b/L1Trigger/TrackFindingTMTT/interface/ChiSquaredFit4.h index 00af64301b6be..a0b866b4a2ff4 100644 --- a/L1Trigger/TrackFindingTMTT/interface/ChiSquaredFit4.h +++ b/L1Trigger/TrackFindingTMTT/interface/ChiSquaredFit4.h @@ -10,10 +10,10 @@ namespace tmtt { ChiSquaredFit4(const Settings* settings, const uint nPar); protected: - TVectorD seed(const L1track3D& l1track3D); - TVectorD residuals(const TVectorD& x); - TMatrixD D(const TVectorD& x); - TMatrixD Vinv(); + TVectorD seed(const L1track3D& l1track3D) override; + TVectorD residuals(const TVectorD& x) override; + TMatrixD D(const TVectorD& x) override; + TMatrixD Vinv() override; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/ChiSquaredFitBase.h b/L1Trigger/TrackFindingTMTT/interface/ChiSquaredFitBase.h index 90c9b825f141e..58be28e604664 100644 --- a/L1Trigger/TrackFindingTMTT/interface/ChiSquaredFitBase.h +++ b/L1Trigger/TrackFindingTMTT/interface/ChiSquaredFitBase.h @@ -25,7 +25,7 @@ namespace tmtt { public: ChiSquaredFitBase(const Settings* settings, const uint nPar); - L1fittedTrack fit(const L1track3D& l1track3D); + L1fittedTrack fit(const L1track3D& l1track3D) override; protected: /* Methods */ diff --git a/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h b/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h index c43788e878372..66c308061e978 100644 --- a/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h +++ b/L1Trigger/TrackFindingTMTT/interface/DegradeBend.h @@ -1,6 +1,9 @@ #ifndef L1Trigger_TrackFindingTMTT_DegradeBend_h #define L1Trigger_TrackFindingTMTT_DegradeBend_h +#include "L1Trigger/TrackFindingTMTT/interface/StubFEWindows.h" + +#include "L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h" #include "DataFormats/DetId/interface/DetId.h" #include @@ -15,9 +18,8 @@ namespace tmtt { * Implements reduced bits to encode stub bend information: 3 bits for PS, 4 bits for 2S, since the Tracker * doesn't have the bandwidth to output the unreduced data from the FE electronics. * - * This obtains the stub window sizes from a hard-wired copy of L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py . - * Whenever these window sizes are so large that not all bend values allowed within them with the available bits, - * then it automatically encodes the bend values within these windows. + * This obtains the stub window sizes from L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py , + * which must be loaded into the cfg file (with the same params used originally to make the stubs). * * The TMTT L1 tracking code can optionally tighten these windows further (cfg option "KillLowPtStubs"). * This gives slightly more granular encoding with Pt > 3 GeV. @@ -27,9 +29,10 @@ namespace tmtt { */ public: - DegradeBend(const TrackerTopology* trackerTopo) : theTrackerTopo_(trackerTopo) {} + typedef TTStubAlgorithm_official StubAlgorithmOfficial; - DegradeBend() {} + DegradeBend(const TrackerTopology* trackerTopo, const StubFEWindows* sw, const StubAlgorithmOfficial* stubAlgo) + : theTrackerTopo_(trackerTopo), sw_(sw), stubAlgo_(stubAlgo) {} // Given the original bend, flag indicating if this is a PS or 2S module, & detector identifier, // this return the degraded stub bend, a boolean indicatng if stub bend was outside the assumed window @@ -60,15 +63,11 @@ namespace tmtt { private: const TrackerTopology* theTrackerTopo_; - // Number of bits used to encoded bend output by FE electronics. - const unsigned int bitsPS_ = 3; - const unsigned int bits2S_ = 4; - // Stub window sizes as encoded in L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h - static const std::vector barrelCut_; - static const std::vector > ringCut_; - static const std::vector > tiltedCut_; - static const std::vector barrelNTilt_; + const StubFEWindows* sw_; + + // TTStub produce algo used to make stubs. + const StubAlgorithmOfficial* stubAlgo_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/DupFitTrkKiller.h b/L1Trigger/TrackFindingTMTT/interface/DupFitTrkKiller.h index 5d003b712271c..6440753c8ef4a 100644 --- a/L1Trigger/TrackFindingTMTT/interface/DupFitTrkKiller.h +++ b/L1Trigger/TrackFindingTMTT/interface/DupFitTrkKiller.h @@ -18,6 +18,8 @@ namespace tmtt { class DupFitTrkKiller { public: + enum class DupAlgoName { None = 0, Algo1 = 1, Algo2 = 2 }; + /** * Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. */ @@ -50,7 +52,7 @@ namespace tmtt { private: const Settings* settings_; // Configuration parameters. - unsigned int dupTrkAlg_; // Specifies choice of algorithm for duplicate track removal. + DupAlgoName dupTrkAlg_; // Specifies choice of algorithm for duplicate track removal. }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h b/L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h index f16b73492f4b3..65b394810c0bd 100644 --- a/L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h +++ b/L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h @@ -20,13 +20,13 @@ namespace tmtt { namespace { std::mutex myMutex; - } + } class GlobalCacheTMTT { public: GlobalCacheTMTT(const edm::ParameterSet& iConfig) : settings_(iConfig), // Python configuration params - htRphiErrMon_(), // rphi HT error monitoring + htRphiErrMon_(), // rphi HT error monitoring stubWindowSuggest_(&settings_), // Recommend FE stub window sizes. hists_(&settings_) // Histograms { @@ -46,7 +46,7 @@ namespace tmtt { std::lock_guard myGuard(myMutex); // Only need one copy of tracker geometry for histogramming. - if (listTrackerModule_.size() == 0) + if (listTrackerModule_.empty()) listTrackerModule_ = list; } diff --git a/L1Trigger/TrackFindingTMTT/interface/HTrphi.h b/L1Trigger/TrackFindingTMTT/interface/HTrphi.h index ee7bd894017ad..d5071afe680a6 100644 --- a/L1Trigger/TrackFindingTMTT/interface/HTrphi.h +++ b/L1Trigger/TrackFindingTMTT/interface/HTrphi.h @@ -46,7 +46,7 @@ namespace tmtt { float phiCentreSector, ErrorMonitor* errMon = nullptr); - ~HTrphi() {} + ~HTrphi() override {} // Add stub to HT array. // If eta subsectors are being used within each sector, specify which ones the stub is compatible with. @@ -64,21 +64,21 @@ namespace tmtt { // Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). // The helix parameters returned will be those corresponding to the two axes of the HT array. // So they might be (q/pt, phi0) or (q/pt, phi65) etc. depending on the configuration. - std::pair helix2Dhough(unsigned int i, unsigned int j) const; + std::pair helix2Dhough(unsigned int i, unsigned int j) const override; // Get the values of the track helix params corresponding to middle of a specified HT cell (i,j). // The helix parameters returned will be always be (q/pt, phi0), irrespective of how the axes // of the HT array are defined. - std::pair helix2Dconventional(unsigned int i, unsigned int j) const; + std::pair helix2Dconventional(unsigned int i, unsigned int j) const override; // Which cell in HT array should this TP be in, based on its true trajectory? // (If TP is outside HT array, it it put in the closest bin inside it). - std::pair trueCell(const TP* tp) const; + std::pair trueCell(const TP* tp) const override; // Which cell in HT array should this fitted track be in, based on its fitted trajectory? // Always uses beam-spot constrained trajectory if available. // (If fitted track is outside HT array, it it put in the closest bin inside it). - std::pair cell(const L1fittedTrack* fitTrk) const; + std::pair cell(const L1fittedTrack* fitTrk) const override; // Check if specified cell has been merged with its 2x2 neighbours into a single cell, // as it is in low Pt region. @@ -104,17 +104,17 @@ namespace tmtt { unsigned int jPhiTrkBinMinLast, unsigned int jPhiTrkBinMaxLast); - // Calculate maximum |gradient| that any stub's line across this HT array could have, so can check it doesn't exceed 1. - float calcMaxLineGradArray() const; + // Calculate line |gradient| of stubs in HT array, so can check it doesn't exceed 1. + float calcLineGradArray(float r) const; // If requested, kill those tracks in this sector that can't be read out during the time-multiplexed period, because // the HT has associated too many stubs to tracks. - std::list killTracksBusySec(const std::list& tracks) const; + std::list killTracksBusySec(const std::list& tracks) const override; // Define the order in which the hardware processes rows of the HT array when it outputs track candidates. // Currently corresponds to highest Pt tracks first. // If two tracks have the same Pt, the -ve charge one is output before the +ve charge one. - std::vector rowOrder(unsigned int numRows) const; + std::vector rowOrder(unsigned int numRows) const override; private: float invPtToDphi_; // conversion constant. diff --git a/L1Trigger/TrackFindingTMTT/interface/InputData.h b/L1Trigger/TrackFindingTMTT/interface/InputData.h index fbe7355fa0bea..789c059796171 100644 --- a/L1Trigger/TrackFindingTMTT/interface/InputData.h +++ b/L1Trigger/TrackFindingTMTT/interface/InputData.h @@ -13,6 +13,7 @@ namespace tmtt { class Settings; class StubWindowSuggest; + class DegradeBend; //=== Unpacks stub & tracking particle (truth) data into user-friendlier format in Stub & TP classes. //=== Also makes B-field available to Settings class. @@ -23,6 +24,7 @@ namespace tmtt { const edm::EventSetup& iSetup, const Settings* settings, StubWindowSuggest* stubWindowSuggest, + const DegradeBend* degradeBend, const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology, const std::list& listTrackerModule, @@ -63,6 +65,8 @@ namespace tmtt { // Recommends optimal FE stub window sizes. StubWindowSuggest* stubWindowSuggest_; + // Degrades bend to allow for FE stub bend encoding. + const DegradeBend* degradeBend_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h b/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h index e7544f205f770..28bfdadda6aa1 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h +++ b/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h @@ -5,6 +5,8 @@ #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" #include "TMatrixD.h" +#include + ///=== This is the Kalman Combinatorial Filter for 4 & 5 helix parameters track fit algorithm. ///=== All variable names & equations come from Fruhwirth KF paper ///=== http://dx.doi.org/10.1016/0168-9002%2887%2990887-4 @@ -13,35 +15,42 @@ namespace tmtt { class KFParamsComb : public KFbase { public: - KFParamsComb(const Settings* settings, const uint nPar, const std::string& fitterName) - : KFbase(settings, nPar, fitterName) {} + KFParamsComb(const Settings* settings, const uint nHelixPar, const std::string& fitterName); - virtual ~KFParamsComb() {} + ~KFParamsComb() override {} protected: //--- Input data // Seed track helix params & covariance matrix - virtual TVectorD seedX(const L1track3D& l1track3D) const; - virtual TMatrixD seedC(const L1track3D& l1track3D) const; + TVectorD seedX(const L1track3D& l1track3D) const override; + TMatrixD seedC(const L1track3D& l1track3D) const override; // Stub coordinate measurements & resolution - virtual TVectorD vectorM(const Stub* stub) const; - virtual TMatrixD matrixV(const Stub* stub, const KalmanState* state) const; + TVectorD vectorM(const Stub* stub) const override; + TMatrixD matrixV(const Stub* stub, const KalmanState* state) const override; //--- KF maths matrix multiplications // Derivate of helix intercept point w.r.t. helix params. - virtual TMatrixD matrixH(const Stub* stub) const; + TMatrixD matrixH(const Stub* stub) const override; // Kalman helix ref point extrapolation matrix - virtual TMatrixD matrixF(const Stub* stub, const KalmanState* state) const; + TMatrixD matrixF(const Stub* stub, const KalmanState* state) const override; // Convert to physical helix params instead of local ones used by KF - virtual TVectorD trackParams(const KalmanState* state) const; - virtual TVectorD trackParams_BeamConstr(const KalmanState* state, double& chi2rphi) const; + TVectorD trackParams(const KalmanState* state) const override; + TVectorD trackParams_BeamConstr(const KalmanState* state, double& chi2rphi) const override; // Does helix state pass cuts? - virtual bool isGoodState(const KalmanState& state) const; + bool isGoodState(const KalmanState& state) const override; + + protected: + std::vector kfLayerVsPtToler_; + std::vector kfLayerVsD0Cut5_; + std::vector kfLayerVsZ0Cut5_; + std::vector kfLayerVsZ0Cut4_; + std::vector kfLayerVsChiSq5_; + std::vector kfLayerVsChiSq4_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/KFbase.h b/L1Trigger/TrackFindingTMTT/interface/KFbase.h index 57302237c8eec..8947a04149f9c 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KFbase.h +++ b/L1Trigger/TrackFindingTMTT/interface/KFbase.h @@ -36,9 +36,9 @@ namespace tmtt { public: // Initialize configuration - KFbase(const Settings *settings, const uint nPar, const std::string &fitterName = "", const uint nMeas = 2); + KFbase(const Settings *settings, const uint nHelixPar, const std::string &fitterName = "", const uint nMeas = 2); - virtual ~KFbase() { this->resetStates(); } + ~KFbase() override { this->resetStates(); } KFbase(const KFbase &kf) = delete; // Disable copy & move of this class. KFbase(KFbase &&kf) = delete; @@ -46,7 +46,7 @@ namespace tmtt { KFbase &operator=(KFbase &&kf) = delete; // Do KF fit - L1fittedTrack fit(const L1track3D &l1track3D); + L1fittedTrack fit(const L1track3D &l1track3D) override; protected: // Do KF fit (internal) @@ -84,7 +84,7 @@ namespace tmtt { // Derivate of helix intercept point w.r.t. helix params. virtual TMatrixD matrixH(const Stub *stub) const = 0; // Kalman helix ref point extrapolation matrix - virtual TMatrixD matrixF(const Stub *stub = 0, const KalmanState *state = 0) const = 0; + virtual TMatrixD matrixF(const Stub *stub = nullptr, const KalmanState *state = nullptr) const = 0; // Product of H*C*H(transpose) (where C = helix covariance matrix) TMatrixD matrixHCHt(const TMatrixD &h, const TMatrixD &c) const; // Get inverted Kalman R matrix: inverse(V + HCHt) @@ -150,7 +150,7 @@ namespace tmtt { void printStubs(const std::vector &stubs) const; protected: - unsigned nPar_; + unsigned nHelixPar_; unsigned nMeas_; unsigned numEtaRegions_; diff --git a/L1Trigger/TrackFindingTMTT/interface/KalmanState.h b/L1Trigger/TrackFindingTMTT/interface/KalmanState.h index ced792b5a0702..7e1674c485b2c 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KalmanState.h +++ b/L1Trigger/TrackFindingTMTT/interface/KalmanState.h @@ -81,10 +81,6 @@ namespace tmtt { chi2rz_ = chi2rz; } - // If using HLS, note/get additional output produced by HLS core. - //void setHLSselect(unsigned int mBinHelix, unsigned int cBinHelix, bool consistent) { mBinHelixHLS_ = mBinHelix; cBinHelixHLS_ = cBinHelix; consistentHLS_ = consistent;} - //void getHLSselect(unsigned int& mBinHelix, unsigned int& cBinHelix, bool& consistent) const { mBinHelix = mBinHelixHLS_; cBinHelix = cBinHelixHLS_; consistent = consistentHLS_;} - private: const Settings *settings_; int kLayer_; @@ -104,11 +100,6 @@ namespace tmtt { unsigned nSkipped_; L1track3D l1track3D_; unsigned int hitPattern_; - - // Additional output from HLS if using it. - unsigned int mBinHelixHLS_; - unsigned int cBinHelixHLS_; - bool consistentHLS_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h b/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h index c10253f993d92..53edc8a36b0bf 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h @@ -108,7 +108,7 @@ namespace tmtt { // Creates track rejected by fitter. L1fittedTrack() : L1fittedTrack(nullptr, nullptr, noStubs_, 0, 0., 0., 0., 0., 0., 0., 0., 0, false) {} - ~L1fittedTrack() {} + ~L1fittedTrack() override {} //--- Optionally std::set track helix params & chi2 if beam-spot constraint is used (for 5-parameter fit). void setBeamConstr(float qOverPt_bcon, float phi0_bcon, float chi2rphi_bcon) { @@ -125,10 +125,6 @@ namespace tmtt { nSkippedLayers_ = nSkippedLayers; numUpdateCalls_ = numUpdateCalls; } - void setInfoKF(unsigned int nSkippedLayers, unsigned int numUpdateCalls, bool consistentHLS) { - this->setInfoKF(nSkippedLayers_, numUpdateCalls_); - // consistentCell_ = consistentHLS; // KF HLS code no longer calculates HT cell consistency. - } void setInfoLR(int numIterations, std::string lostMatchingState, std::unordered_map stateCalls) { numIterations_ = numIterations; lostMatchingState_ = lostMatchingState; @@ -176,12 +172,12 @@ namespace tmtt { const L1track3D* l1track3D() const { return l1track3D_; } // Get stubs on fitted track (can differ from those on HT track if track fit kicked out stubs with bad residuals) - const std::vector& stubsConst() const { return stubsConst_; } - const std::vector& stubs() const { return stubs_; } + const std::vector& stubsConst() const override { return stubsConst_; } + const std::vector& stubs() const override { return stubs_; } // Get number of stubs on fitted track. - unsigned int numStubs() const { return stubs_.size(); } + unsigned int numStubs() const override { return stubs_.size(); } // Get number of tracker layers these stubs are in. - unsigned int numLayers() const { return nLayers_; } + unsigned int numLayers() const override { return nLayers_; } // Get number of stubs deleted from track candidate by fitter (because they had large residuals) unsigned int numKilledStubs() const { return l1track3D_->numStubs() - this->numStubs(); } // Get bit-encoded hit pattern (where layer number assigned by increasing distance from origin, according to layers track expected to cross). @@ -192,19 +188,19 @@ namespace tmtt { // (If fitted track is outside HT array, it it put in the closest bin inside it). std::pair cellLocationFit() const { return htRphiTmp_->cell(this); } // Also get HT cell determined by Hough transform. - std::pair cellLocationHT() const { return l1track3D_->cellLocationHT(); } + std::pair cellLocationHT() const override { return l1track3D_->cellLocationHT(); } //--- Get information about its association (if any) to a truth Tracking Particle. //--- Can differ from that of corresponding HT track, if track fit kicked out stubs with bad residuals. // Get best matching tracking particle (=nullptr if none). - const TP* matchedTP() const { return matchedTP_; } + const TP* matchedTP() const override { return matchedTP_; } // Get the matched stubs with this Tracking Particle - const std::vector& matchedStubs() const { return matchedStubs_; } + const std::vector& matchedStubs() const override { return matchedStubs_; } // Get number of matched stubs with this Tracking Particle - unsigned int numMatchedStubs() const { return matchedStubs_.size(); } + unsigned int numMatchedStubs() const override { return matchedStubs_.size(); } // Get number of tracker layers with matched stubs with this Tracking Particle - unsigned int numMatchedLayers() const { return nMatchedLayers_; } + unsigned int numMatchedLayers() const override { return nMatchedLayers_; } // Get purity of stubs on track (i.e. fraction matching best Tracking Particle) float purity() const { return numMatchedStubs() / float(numStubs()); } // Get number of stubs matched to correct TP that were deleted from track candidate by fitter. @@ -223,7 +219,7 @@ namespace tmtt { //--- Get the fitted track helix parameters. - float qOverPt() const { return qOverPt_; } + float qOverPt() const override { return qOverPt_; } float charge() const { return (qOverPt_ > 0 ? 1 : -1); } float invPt() const { return std::abs(qOverPt_); } // Protect pt against 1/pt = 0. @@ -232,7 +228,7 @@ namespace tmtt { return 1. / (small + this->invPt()); } float d0() const { return d0_; } - float phi0() const { return phi0_; } + float phi0() const override { return phi0_; } float z0() const { return z0_; } float tanLambda() const { return tanLambda_; } float theta() const { return atan2(1., tanLambda_); } // Use atan2 to ensure 0 < theta < pi. @@ -290,11 +286,11 @@ namespace tmtt { float chi2dof_bcon() const { return (this->chi2_bcon()) / this->numDOF_bcon(); } //--- Get phi sector and eta region used by track finding code that this track is in. - unsigned int iPhiSec() const { return iPhiSec_; } - unsigned int iEtaReg() const { return iEtaReg_; } + unsigned int iPhiSec() const override { return iPhiSec_; } + unsigned int iEtaReg() const override { return iEtaReg_; } //--- Opto-link ID used to send this track from HT to Track Fitter - unsigned int optoLinkID() const { return optoLinkID_; } + unsigned int optoLinkID() const override { return optoLinkID_; } //--- Get whether the track has been rejected or accepted by the fit diff --git a/L1Trigger/TrackFindingTMTT/interface/L1track2D.h b/L1Trigger/TrackFindingTMTT/interface/L1track2D.h index 273e6ee671c6d..8e9cd1c26f2dd 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1track2D.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1track2D.h @@ -50,27 +50,27 @@ namespace tmtt { L1track2D() : L1trackBase(){}; // Creates track object, but doesn't std::set any variables. - ~L1track2D() {} + ~L1track2D() override {} //--- Get information about the reconstructed track. // Get stubs on track candidate. - const std::vector& stubsConst() const { return stubsConst_; } - const std::vector& stubs() const { return stubs_; } + const std::vector& stubsConst() const override { return stubsConst_; } + const std::vector& stubs() const override { return stubs_; } // Get number of stubs on track candidate. - unsigned int numStubs() const { return stubs_.size(); } + unsigned int numStubs() const override { return stubs_.size(); } // Get number of tracker layers these stubs are in. - unsigned int numLayers() const { return nLayers_; } + unsigned int numLayers() const override { return nLayers_; } // Get cell location of track candidate in Hough Transform array in units of bin number. - std::pair cellLocationHT() const { return cellLocationHT_; } + std::pair cellLocationHT() const override { return cellLocationHT_; } // The two conventionally agreed track helix parameters relevant in this 2D plane. // i.e. (q/Pt, phi0). std::pair helix2D() const { return helix2D_; } //--- User-friendlier access to the helix parameters obtained from track location inside HT array. - float qOverPt() const { return helix2D_.first; } - float phi0() const { return helix2D_.second; } + float qOverPt() const override { return helix2D_.first; } + float phi0() const override { return helix2D_.second; } //--- In the case of tracks found by the r-phi HT, a rough estimate of the (z0, tan_lambda) may be provided by any r-z //--- track filter run after the r-phi HT. These two functions give std::set/get access to these. @@ -89,11 +89,11 @@ namespace tmtt { } //--- Get phi sector and eta region used by track finding code that this track is in. - unsigned int iPhiSec() const { return iPhiSec_; } - unsigned int iEtaReg() const { return iEtaReg_; } + unsigned int iPhiSec() const override { return iPhiSec_; } + unsigned int iEtaReg() const override { return iEtaReg_; } //--- Opto-link ID used to send this track from HT to Track Fitter. Both read & write functions. - unsigned int optoLinkID() const { return optoLinkID_; } + unsigned int optoLinkID() const override { return optoLinkID_; } void setOptoLinkID(unsigned int linkID) { optoLinkID_ = linkID; } //--- Was this track produced from a marged HT cell (e.g. 2x2)? @@ -102,13 +102,13 @@ namespace tmtt { //--- Get information about its association (if any) to a truth Tracking Particle. // Get matching tracking particle (=nullptr if none). - const TP* matchedTP() const { return matchedTP_; } + const TP* matchedTP() const override { return matchedTP_; } // Get the matched stubs. - const std::vector& matchedStubs() const { return matchedStubs_; } + const std::vector& matchedStubs() const override { return matchedStubs_; } // Get number of matched stubs. - unsigned int numMatchedStubs() const { return matchedStubs_.size(); } + unsigned int numMatchedStubs() const override { return matchedStubs_.size(); } // Get number of tracker layers with matched stubs. - unsigned int numMatchedLayers() const { return nMatchedLayers_; } + unsigned int numMatchedLayers() const override { return nMatchedLayers_; } private: //--- Configuration parameters diff --git a/L1Trigger/TrackFindingTMTT/interface/L1track3D.h b/L1Trigger/TrackFindingTMTT/interface/L1track3D.h index 25cfa52a64aea..e4e192d258063 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1track3D.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1track3D.h @@ -74,7 +74,7 @@ namespace tmtt { L1track3D() : L1trackBase(){}; // Creates track object, but doesn't std::set any variables. - ~L1track3D() {} + ~L1track3D() override {} //--- Set/get optional info for tracklet tracks. @@ -93,14 +93,14 @@ namespace tmtt { //--- Get information about the reconstructed track. // Get stubs on track candidate. - const std::vector& stubsConst() const { return stubsConst_; } - const std::vector& stubs() const { return stubs_; } + const std::vector& stubsConst() const override { return stubsConst_; } + const std::vector& stubs() const override { return stubs_; } // Get number of stubs on track candidate. - unsigned int numStubs() const { return stubs_.size(); } + unsigned int numStubs() const override { return stubs_.size(); } // Get number of tracker layers these stubs are in. - unsigned int numLayers() const { return nLayers_; } + unsigned int numLayers() const override { return nLayers_; } // Get cell location of track candidate in r-phi Hough Transform array in units of bin number. - std::pair cellLocationHT() const { return cellLocationHT_; } + std::pair cellLocationHT() const override { return cellLocationHT_; } // The two conventionally agreed track helix parameters relevant in r-phi plane. i.e. (q/Pt, phi0) std::pair helixRphi() const { return helixRphi_; } // The two conventionally agreed track helix parameters relevant in r-z plane. i.e. (z0, tan_lambda) @@ -148,7 +148,7 @@ namespace tmtt { //--- User-friendlier access to the helix parameters. - float qOverPt() const { return helixRphi_.first; } + float qOverPt() const override { return helixRphi_.first; } float charge() const { return (this->qOverPt() > 0 ? 1 : -1); } float invPt() const { return std::abs(this->qOverPt()); } // Protect pt against 1/pt = 0. @@ -157,7 +157,7 @@ namespace tmtt { return 1. / (small + this->invPt()); } float d0() const { return helixD0_; } // Hough transform assumes d0 = 0. - float phi0() const { return helixRphi_.second; } + float phi0() const override { return helixRphi_.second; } float z0() const { return helixRz_.first; } float tanLambda() const { return helixRz_.second; } float theta() const { return atan2(1., this->tanLambda()); } // Use atan2 to ensure 0 < theta < pi. @@ -173,11 +173,11 @@ namespace tmtt { } // neglects transverse impact parameter & track curvature. //--- Get phi sector and eta region used by track finding code that this track is in. - unsigned int iPhiSec() const { return iPhiSec_; } - unsigned int iEtaReg() const { return iEtaReg_; } + unsigned int iPhiSec() const override { return iPhiSec_; } + unsigned int iEtaReg() const override { return iEtaReg_; } //--- Opto-link ID used to send this track from HT to Track Fitter - unsigned int optoLinkID() const { return optoLinkID_; } + unsigned int optoLinkID() const override { return optoLinkID_; } //--- Was this track produced from a marged HT cell (e.g. 2x2)? bool mergedHTcell() const { return mergedHTcell_; } @@ -185,13 +185,13 @@ namespace tmtt { //--- Get information about its association (if any) to a truth Tracking Particle. // Get best matching tracking particle (=nullptr if none). - const TP* matchedTP() const { return matchedTP_; } + const TP* matchedTP() const override { return matchedTP_; } // Get the matched stubs with this Tracking Particle - const std::vector& matchedStubs() const { return matchedStubs_; } + const std::vector& matchedStubs() const override { return matchedStubs_; } // Get number of matched stubs with this Tracking Particle - unsigned int numMatchedStubs() const { return matchedStubs_.size(); } + unsigned int numMatchedStubs() const override { return matchedStubs_.size(); } // Get number of tracker layers with matched stubs with this Tracking Particle - unsigned int numMatchedLayers() const { return nMatchedLayers_; } + unsigned int numMatchedLayers() const override { return nMatchedLayers_; } // Get purity of stubs on track candidate (i.e. fraction matching best Tracking Particle) float purity() const { return numMatchedStubs() / float(numStubs()); } diff --git a/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h b/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h index f6396fe7da8f6..fce848dd28812 100644 --- a/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h +++ b/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h @@ -2,6 +2,7 @@ #define L1Trigger_TrackFindingTMTT_MiniHTstage_h #include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h" +#include "L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h" using boost::numeric::ublas::matrix; #include @@ -32,7 +33,7 @@ namespace tmtt { private: const Settings* settings_; // Configuration parameters bool miniHTstage_; - unsigned int muxOutputsHT_; + MuxHToutputs::MuxAlgoName muxOutputsHT_; unsigned int houghNbinsPt_; unsigned int houghNbinsPhi_; unsigned int miniHoughLoadBalance_; diff --git a/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h b/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h index 707d0b124521d..db1444f97d4aa 100644 --- a/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h +++ b/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h @@ -28,6 +28,8 @@ namespace tmtt { class MuxHToutputs { public: + enum class MuxAlgoName { None = 0, mBinPerLink = 1 }; + // Initialize constants from configuration parameters. MuxHToutputs(const Settings* settings); @@ -61,7 +63,7 @@ namespace tmtt { const Settings* settings_; // Configuration parameters // Configuration parameters - unsigned int muxOutputsHT_; + MuxAlgoName muxOutputsHT_; unsigned int numPhiNonants_; unsigned int numPhiSectors_; unsigned int numPhiSecPerNon_; diff --git a/L1Trigger/TrackFindingTMTT/interface/Settings.h b/L1Trigger/TrackFindingTMTT/interface/Settings.h index 0d7921809957f..73613e481374c 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Settings.h +++ b/L1Trigger/TrackFindingTMTT/interface/Settings.h @@ -5,6 +5,7 @@ #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Utilities/interface/ESInputTag.h" #include "FWCore/Utilities/interface/Exception.h" +#include "CLHEP/Units/PhysicalConstants.h" #include #include #include @@ -27,6 +28,8 @@ namespace tmtt { edm::ESInputTag magneticFieldInputTag() const { return magneticFieldInputTag_; } edm::ESInputTag trackerGeometryInputTag() const { return trackerGeometryInputTag_; } edm::ESInputTag trackerTopologyInputTag() const { return trackerTopologyInputTag_; } + edm::ESInputTag ttStubAlgoInputTag() const { return ttStubAlgoInputTag_; } + edm::InputTag stubInputTag() const { return stubInputTag_; } edm::InputTag tpInputTag() const { return tpInputTag_; } edm::InputTag stubTruthInputTag() const { return stubTruthInputTag_; } @@ -307,6 +310,14 @@ namespace tmtt { unsigned int kalmanMaxSkipLayersEasy() const { return kalmanMaxSkipLayersEasy_; } // Max #stubs an input track can have to be defined "easy". unsigned int kalmanMaxStubsEasy() const { return kalmanMaxStubsEasy_; } + // Cuts applied to KF states as a function of the last KF tracker layer they had a stub in. + // (If "4" or "5" in name, cut only applies to 4 or 5 param helix fit). + const std::vector& kfLayerVsPtToler() const { return kfLayerVsPtToler_; } + const std::vector& kfLayerVsD0Cut5() const { return kfLayerVsD0Cut5_; } + const std::vector& kfLayerVsZ0Cut5() const { return kfLayerVsZ0Cut5_; } + const std::vector& kfLayerVsZ0Cut4() const { return kfLayerVsZ0Cut4_; } + const std::vector& kfLayerVsChiSq5() const { return kfLayerVsChiSq5_; } + const std::vector& kfLayerVsChiSq4() const { return kfLayerVsChiSq4_; } // KF will consider only this no. of stubs per layer. unsigned int kalmanMaxStubsPerLayer() const { return kalmanMaxStubsPerLayer_; } // Multiple scattering term - inflate hit phi errors by this divided by Pt @@ -379,17 +390,11 @@ namespace tmtt { //=== Hard-wired constants - double cSpeed() const { return 2.99792458e10; } // Speed of light (cm/s) - double invPtToInvR() const { - return (this->magneticField()) * (this->cSpeed()) / 1.0E13; - } // B*c/1E11 - converts q/Pt to 1/radius_of_curvature - double invPtToDphi() const { - return (this->magneticField()) * (this->cSpeed()) / 2.0E13; - } // B*c/2E11 - converts q/Pt to track angle at some radius from beamline. - double trackerOuterRadius() const { return 112.7; } // max. occuring stub radius. - double trackerInnerRadius() const { return 21.8; } // min. occuring stub radius. - double trackerHalfLength() const { return 270.; } // half-length of tracker. - + double cSpeed() const { return 1.0e8 * CLHEP::c_light; } // Speed of light, with (mm/ns) to (cm/s) + // B*c/1E11 - converts q/Pt to 1/radius_of_curvature + double invPtToInvR() const { return (this->magneticField()) * (this->cSpeed()) / 1.0E13; } + // B*c/2E11 - converts q/Pt to track angle at some radius from beamline. + double invPtToDphi() const { return (this->magneticField()) * (this->cSpeed()) / 2.0E13; } //=== Set and get B-field value (mutable) in Tesla. // N.B. This must bet std::set for each run, and can't be initialized at the beginning of the job. void setMagneticField(float magneticField) const { magneticField_ = magneticField; } @@ -408,6 +413,8 @@ namespace tmtt { const edm::ESInputTag magneticFieldInputTag_; const edm::ESInputTag trackerGeometryInputTag_; const edm::ESInputTag trackerTopologyInputTag_; + const edm::ESInputTag ttStubAlgoInputTag_; + const edm::InputTag stubInputTag_; const edm::InputTag tpInputTag_; const edm::InputTag stubTruthInputTag_; @@ -588,6 +595,14 @@ namespace tmtt { unsigned int kalmanMaxSkipLayersHard_; unsigned int kalmanMaxSkipLayersEasy_; unsigned int kalmanMaxStubsEasy_; + + std::vector kfLayerVsPtToler_; + std::vector kfLayerVsD0Cut5_; + std::vector kfLayerVsZ0Cut5_; + std::vector kfLayerVsZ0Cut4_; + std::vector kfLayerVsChiSq5_; + std::vector kfLayerVsChiSq4_; + unsigned int kalmanMaxStubsPerLayer_; double kalmanMultiScattTerm_; unsigned int kalmanChi2RphiScale_; diff --git a/L1Trigger/TrackFindingTMTT/interface/SimpleLR4.h b/L1Trigger/TrackFindingTMTT/interface/SimpleLR4.h index 90bf7ef9f766e..fa77536aa8e59 100644 --- a/L1Trigger/TrackFindingTMTT/interface/SimpleLR4.h +++ b/L1Trigger/TrackFindingTMTT/interface/SimpleLR4.h @@ -21,9 +21,9 @@ namespace tmtt { public: SimpleLR4(const Settings* settings); - virtual ~SimpleLR4(){}; + ~SimpleLR4() override{}; - L1fittedTrack fit(const L1track3D& l1track3D); + L1fittedTrack fit(const L1track3D& l1track3D) override; protected: bool debug_; diff --git a/L1Trigger/TrackFindingTMTT/interface/Stub.h b/L1Trigger/TrackFindingTMTT/interface/Stub.h index 4e73299917589..a78b3ff564091 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Stub.h +++ b/L1Trigger/TrackFindingTMTT/interface/Stub.h @@ -14,7 +14,6 @@ #include "L1Trigger/TrackFindingTMTT/interface/DigitalStub.h" #include "L1Trigger/TrackFindingTMTT/interface/DegradeBend.h" #include "L1Trigger/TrackFindingTMTT/interface/TrackerModule.h" -#include "L1Trigger/TrackFindingTMTT/interface/StubKiller.h" #include #include @@ -28,6 +27,8 @@ class TrackerTopology; namespace tmtt { class TP; + class DegradeBend; + class StubKiller; typedef edmNew::DetSetVector > TTStubDetSetVec; typedef edmNew::DetSet > TTStubDetSet; @@ -43,28 +44,29 @@ namespace tmtt { public: // Hybrid L1 tracking: stub constructor. Stub(const Settings* settings, - unsigned int idStub, - double phi, - double r, - double z, - double bend, - unsigned int iphi, - double alpha, - unsigned int layerId, - unsigned int iPhiSec, - bool psModule, - bool barrel, - bool tiltedBarrel, - float stripPitch, - float stripLength, - unsigned int nStrips); - + unsigned int idStub, + double phi, + double r, + double z, + double bend, + unsigned int iphi, + double alpha, + unsigned int layerId, + unsigned int iPhiSec, + bool psModule, + bool barrel, + bool tiltedBarrel, + float stripPitch, + float stripLength, + unsigned int nStrips); + // TMTT L1 tracking: stub constructor. Stub(const TTStubRef& ttStubRef, unsigned int index_in_vStubs, const Settings* settings, const TrackerTopology* trackerTopology, const TrackerModule* trackerModule, + const DegradeBend* degradeBend, const StubKiller* stubKiller); ~Stub() {} @@ -164,7 +166,7 @@ namespace tmtt { const std::set& assocTPs() const { return assocTPs_; } // Return TPs associated to this stub. (Whether only TPs contributing to both clusters are returned is determined by "StubMatchStrict" config param.) - bool genuine() const { return (assocTPs_.size() > 0); } // Did stub match at least one TP? + bool genuine() const { return (not assocTPs_.empty()); } // Did stub match at least one TP? const TP* assocTP() const { return assocTP_; } // If only one TP contributed to both clusters, this tells you which TP it is. Returns nullptr if none. @@ -186,9 +188,9 @@ namespace tmtt { float sigmaR() const { return (barrel() ? 0. : sigmaPar()); } float sigmaZ() const { return (barrel() ? sigmaPar() : 0.); } // Hit resolution perpendicular to strip. Measures phi. - float sigmaPerp() const {return invRoot12 * stripPitch_;} + float sigmaPerp() const { return invRoot12 * stripPitch_; } // Hit resolution parallel to strip. Measures r or z. - float sigmaPar() const {return invRoot12 * stripLength_;} + float sigmaPar() const { return invRoot12 * stripLength_; } //--- These module variables could be taken directly from trackerModule_, were it not for need //--- to support Hybrid. @@ -274,7 +276,7 @@ namespace tmtt { const TrackerModule* trackerModule_; // Used to degrade stub bend information. - DegradeBend degradeBend_; + const DegradeBend* degradeBend_; // These module variables are needed only to support the Hybrid stub constructor. // (Otherwise, they could be taken from trackerModule_). @@ -290,7 +292,7 @@ namespace tmtt { const float rejectedStubBend_ = 99999.; // Bend set to this if stub rejected. - const float invRoot12 = sqrt(1./12.); + const float invRoot12 = sqrt(1. / 12.); }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/StubFEWindows.h b/L1Trigger/TrackFindingTMTT/interface/StubFEWindows.h new file mode 100644 index 0000000000000..e07170e35c17b --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/interface/StubFEWindows.h @@ -0,0 +1,53 @@ +#ifndef L1Trigger_TrackFindingTMTT_StubFEWindows_h +#define L1Trigger_TrackFindingTMTT_StubFEWindows_h + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "DataFormats/DetId/interface/DetId.h" + +#include + +// Window sizes used by FE electronics to select stubs. + +class TrackerTopology; + +namespace tmtt { + + class StubFEWindows { + public: + StubFEWindows(){}; + // Initialize stub window sizes from TTStubProducer cfg. + StubFEWindows(const edm::ParameterSet& pSetStubAlgo); + + // Set all FE stub bend windows to zero. + void setZero(); + + // Access window size arrays (const functions). + const std::vector& windowSizeBarrelLayers() const { return windowSizeBarrelLayers_; } + const std::vector >& windowSizeEndcapDisksRings() const { return windowSizeEndcapDisksRings_; } + const std::vector >& windowSizeTiltedLayersRings() const { + return windowSizeTiltedLayersRings_; + } + + // Access window size arrays (non-const functions). + std::vector& windowSizeBarrelLayers() { return windowSizeBarrelLayers_; } + std::vector >& windowSizeEndcapDisksRings() { return windowSizeEndcapDisksRings_; } + std::vector >& windowSizeTiltedLayersRings() { return windowSizeTiltedLayersRings_; } + + // Number of tilted barrel modules each half of each PS barrel layer. + const std::vector& numTiltedLayerRings() const { return numTiltedLayerRings_; } + + // Const/non-const access to element of array giving window size for specific module. + const double* storedWindowSize(const TrackerTopology* trackerTopo, const DetId& detId) const; + double* storedWindowSize(const TrackerTopology* trackerTopo, const DetId& detId); + + private: + // Stub window sizes as encoded in L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h + std::vector windowSizeBarrelLayers_; + std::vector > windowSizeEndcapDisksRings_; + std::vector > windowSizeTiltedLayersRings_; + std::vector numTiltedLayerRings_; + }; + +} // namespace tmtt + +#endif diff --git a/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h b/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h index 1558c8bba1052..4fc9e7272cb04 100644 --- a/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h +++ b/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h @@ -2,6 +2,7 @@ #define L1Trigger_TrackFindingTMTT_StubWindowsSuggest_h #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" +#include "L1Trigger/TrackFindingTMTT/interface/StubFEWindows.h" #include @@ -25,11 +26,17 @@ namespace tmtt { class StubWindowSuggest { public: - // Initialize (for use with TMTT). + // Configure StubWindowSuggest(const Settings* settings) : settings_(settings), ptMin_(settings->houghMinPt()) {} ~StubWindowSuggest() {} + // Get FE window size arrays (via copy) used with stub producer, but set to zero. + void setFEWindows(const StubFEWindows* sw) { + sw_ = *sw; + sw_.setZero(); + } + // Analyse stub window required for this stub. void process(const TrackerTopology* trackerTopo, const Stub* stub); @@ -46,10 +53,7 @@ namespace tmtt { const float ptMin_; // Stub window sizes as encoded in L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h - std::vector barrelCut_; - std::vector > ringCut_; - std::vector > tiltedCut_; - std::vector barrelNTilt_; + StubFEWindows sw_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/TrackerModule.h b/L1Trigger/TrackFindingTMTT/interface/TrackerModule.h index e676315d2fa27..c386e8d2998dc 100644 --- a/L1Trigger/TrackFindingTMTT/interface/TrackerModule.h +++ b/L1Trigger/TrackFindingTMTT/interface/TrackerModule.h @@ -83,9 +83,9 @@ namespace tmtt { // Strip length (or pixel pitch along longest axis). float stripLength() const { return stripLength_; } // Hit resolution perpendicular to strip (or to longest pixel axis). Measures phi. - float sigmaPerp() const {return invRoot12 * stripPitch_;} + float sigmaPerp() const { return invRoot12 * stripPitch_; } // Hit resolution parallel to strip (or to longest pixel axis). Measures r or z. - float sigmaPar() const {return invRoot12 * stripLength_;} + float sigmaPar() const { return invRoot12 * stripLength_; } // Sensor pitch over separation. float pitchOverSep() const { return stripPitch_ / sensorSpacing_; } // "B" parameter correction for module tilt. @@ -129,7 +129,7 @@ namespace tmtt { ModuleTypeCfg moduleTypeCfg_; - float invRoot12 = sqrt(1./12.); + static const float invRoot12; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc index 99844bf539b82..76b30f009196c 100644 --- a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc +++ b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc @@ -38,11 +38,11 @@ namespace tmtt { } TMTrackProducer::TMTrackProducer(const edm::ParameterSet& iConfig, GlobalCacheTMTT const* globalCacheTMTT) - : debug_(true), // Debug printout - settings_(iConfig), // Set configuration parameters - hists_(globalCacheTMTT->hists()), // Initialize histograms - htRphiErrMon_(globalCacheTMTT->htRphiErrMon()), // rphi HT error monitoring - stubWindowSuggest_(globalCacheTMTT->stubWindowSuggest()) // For tuning FE stub window sizes + : debug_(true), // Debug printout + settings_(iConfig), // Set configuration parameters + stubWindowSuggest_(globalCacheTMTT->stubWindowSuggest()), // For tuning FE stub window sizes + hists_(globalCacheTMTT->hists()), // Initialize histograms + htRphiErrMon_(globalCacheTMTT->htRphiErrMon()) // rphi HT error monitoring { using namespace edm; @@ -53,6 +53,8 @@ namespace tmtt { settings_.trackerGeometryInputTag()); trackerTopologyToken_ = esConsumes(settings_.trackerTopologyInputTag()); + ttStubAlgoToken_ = + esConsumes(settings_.ttStubAlgoInputTag()); // Get tokens for ED data access. stubToken_ = consumes(settings_.stubInputTag()); @@ -92,6 +94,8 @@ namespace tmtt { } } + //=== Run every run + void TMTrackProducer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) { // Get the B-field and store its value in the Settings class. const MagneticField* theMagneticField = &(iSetup.getData(magneticFieldToken_)); @@ -110,7 +114,7 @@ namespace tmtt { trackerGeometry_ = &(iSetup.getData(trackerGeometryToken_)); trackerTopology_ = &(iSetup.getData(trackerTopologyToken_)); - // Loop over tracker modules to get module info & stubs. + // Loop over tracker modules to get module info. // Identifies tracker module type for firmware. TrackerModule::ModuleTypeCfg moduleTypeCfg; @@ -134,14 +138,27 @@ namespace tmtt { // Takes one copy of this to GlobalCacheTMTT for later histogramming. globalCache()->setListTrackerModule(listTrackerModule_); + + // Get TTStubProducerAlgorithm algorithm, to adjust stub bend FE encoding. + stubAlgo_ = dynamic_cast(&iSetup.getData(ttStubAlgoToken_)); + // Get FE stub window size from TTStub producer configuration + const edm::ESHandle stubAlgoHandle = iSetup.getHandle(ttStubAlgoToken_); + const edm::ParameterSet& pSetStubAlgo = getParameterSet(stubAlgoHandle.description()->pid_); + stubFEWindows_ = std::make_unique(pSetStubAlgo); + // Initialize utilities needing FE window size. + stubWindowSuggest_.setFEWindows(stubFEWindows_.get()); + degradeBend_ = std::make_unique(trackerTopology_, stubFEWindows_.get(), stubAlgo_); } + //=== Run every event + void TMTrackProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { // Note useful info about MC truth particles and about reconstructed stubs . InputData inputData(iEvent, iSetup, &settings_, &stubWindowSuggest_, + degradeBend_.get(), trackerGeometry_, trackerTopology_, listTrackerModule_, diff --git a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h index 9e3aa6bc3f9d8..ce2101176a221 100644 --- a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h +++ b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h @@ -6,6 +6,7 @@ #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" #include "L1Trigger/TrackFindingTMTT/interface/TrackerModule.h" +#include "L1Trigger/TrackFindingTMTT/interface/StubFEWindows.h" #include "L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h" #include "L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h" @@ -22,6 +23,9 @@ #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "MagneticField/Engine/interface/MagneticField.h" #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" +#include "L1Trigger/TrackTrigger/interface/TTStubAlgorithmRecord.h" +#include "L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h" +//#include "L1Trigger/TrackTrigger/interface/TTStubAlgorithm.h" #include #include @@ -32,10 +36,13 @@ namespace tmtt { class TrackFitGeneric; + typedef TTStubAlgorithm StubAlgorithm; + typedef TTStubAlgorithm_official StubAlgorithmOfficial; + class TMTrackProducer : public edm::stream::EDProducer> { public: explicit TMTrackProducer(const edm::ParameterSet &, GlobalCacheTMTT const *globalCacheTMTT); - ~TMTrackProducer() {} + ~TMTrackProducer() override {} static std::unique_ptr initializeGlobalCache(edm::ParameterSet const &iConfig); @@ -44,9 +51,9 @@ namespace tmtt { private: typedef std::vector> TTTrackCollection; - virtual void beginRun(const edm::Run &, const edm::EventSetup &); + void beginRun(const edm::Run &, const edm::EventSetup &) override; - virtual void produce(edm::Event &, const edm::EventSetup &); + void produce(edm::Event &, const edm::EventSetup &) override; private: bool debug_; @@ -55,6 +62,7 @@ namespace tmtt { edm::ESGetToken magneticFieldToken_; edm::ESGetToken trackerGeometryToken_; edm::ESGetToken trackerTopologyToken_; + edm::ESGetToken ttStubAlgoToken_; // ED tokens edm::EDGetTokenT stubToken_; edm::EDGetTokenT tpToken_; @@ -73,9 +81,14 @@ namespace tmtt { std::vector useRZfilter_; bool runRZfilter_; + // Stub window sizes used by FE electronics. + const StubAlgorithmOfficial *stubAlgo_; + std::unique_ptr stubFEWindows_; + StubWindowSuggest &stubWindowSuggest_; + std::unique_ptr degradeBend_; + Histos &hists_; HTrphi::ErrorMonitor &htRphiErrMon_; - StubWindowSuggest &stubWindowSuggest_; std::map> fitterWorkerMap_; }; diff --git a/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py index bb64e14ef0ddc..9e52fe7f1fdba 100644 --- a/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py +++ b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py @@ -13,6 +13,7 @@ magneticFieldInputTag = cms.ESInputTag( "VolumeBasedMagneticFieldESProducer", "" ), trackerGeometryInputTag = cms.ESInputTag( "trackerGeometry", "" ), trackerTopologyInputTag = cms.ESInputTag( "trackerTopology", "" ), + ttStubAlgoInputTag = cms.ESInputTag( "TTStubAlgorithm_official_Phase2TrackerDigi_", "" ), # Tags for ED products tpInputTag = cms.InputTag("mix", "MergedTrackTruth"), @@ -370,6 +371,16 @@ KalmanMaxSkipLayersHard = cms.uint32(1), # For HT tracks with many stubs KalmanMaxSkipLayersEasy = cms.uint32(2), # For HT tracks with few stubs KalmanMaxStubsEasy = cms.uint32(10), # Max stubs an HT track can have to be "easy". + #--- Cuts applied to KF states as a function of the last KF tracker layer they had a stub in. + # (If "4" or "5" in name, cut only applies to 4 or 5 param helix fit). + KFLayerVsPtToler = cms.vdouble(999., 999., 0.1 , 0.1 , 0.05, 0.05, 0.05), + # d0 cut only applied to 5 param helix fit. + KFLayerVsD0Cut5 = cms.vdouble(999., 999., 999., 10. , 10. , 10. ,10. ), + KFLayerVsZ0Cut5 = cms.vdouble(999., 999., 25.5, 25.5, 25.5, 25.5,25.5 ), + KFLayerVsZ0Cut4 = cms.vdouble(999., 999. ,15. , 15. , 15. , 15. ,15. ), + # Chi2 cuts should be retuned if KalmanMultiScattTerm value changed. + KFLayerVsChiSq5 = cms.vdouble(999., 999., 10. , 30. , 80. , 120., 160.), + KFLayerVsChiSq4 = cms.vdouble(999., 999., 10. , 30. , 80. , 120., 160.), # KF will consider at most this #stubs per layer to save time. KalmanMaxStubsPerLayer = cms.uint32(4), # Multiple scattering term - inflate hit phi errors by this divided by Pt diff --git a/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Ultimate_cff.py b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Ultimate_cff.py index 03638a3fc59fb..626399a8f8915 100644 --- a/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Ultimate_cff.py +++ b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_Ultimate_cff.py @@ -9,6 +9,16 @@ # It represents the tracking as planned for 2026. It is a good basis for L1 trigger studies etc. #--------------------------------------------------------------------------------------------------------- +#=== TMTT tracking needs to get FE stub window sizes from this. + +from L1Trigger.TrackTrigger.TTStubAlgorithmRegister_cfi import * + +#=== Random number generator for Stub Killer (dead module emulation) + +RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService", + TMTrackProducer = cms.PSet(initialSeed = cms.untracked.uint32(12345)) +) + #=== Import default values for all parameters & define EDProducer. from L1Trigger.TrackFindingTMTT.TMTrackProducer_Defaults_cfi import TMTrackProducer_params diff --git a/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_cff.py b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_cff.py index 1580c422b662b..498c7e25b3b5a 100644 --- a/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_cff.py +++ b/L1Trigger/TrackFindingTMTT/python/TMTrackProducer_cff.py @@ -9,6 +9,17 @@ # This usually corresponds to the current firmware. #--------------------------------------------------------------------------------------------------------- + +#=== TMTT tracking needs to get FE stub window sizes from this. + +from L1Trigger.TrackTrigger.TTStubAlgorithmRegister_cfi import * + +#=== Random number generator for Stub Killer (dead module emulation) + +RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService", + TMTrackProducer = cms.PSet(initialSeed = cms.untracked.uint32(12345)) +) + #=== Import default values for all parameters & define EDProducer. from L1Trigger.TrackFindingTMTT.TMTrackProducer_Defaults_cfi import TMTrackProducer_params diff --git a/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc b/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc index 17c2dd1f01a2f..d142946cf0b99 100644 --- a/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc +++ b/L1Trigger/TrackFindingTMTT/src/ConverterToTTTrack.cc @@ -64,7 +64,7 @@ namespace tmtt { std::vector ConverterToTTTrack::stubRefs(const L1trackBase* trk) const { std::vector ttstubrefs; - const std::vector stubs = trk->stubs(); + const std::vector& stubs = trk->stubs(); for (Stub* s : stubs) { const TTStubRef& ref = s->ttStubRef(); ttstubrefs.push_back(ref); diff --git a/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc b/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc index a2c7c8e74a81b..2f0b0aea42fa0 100644 --- a/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc +++ b/L1Trigger/TrackFindingTMTT/src/DegradeBend.cc @@ -9,31 +9,15 @@ #include #include #include +#include #include using namespace std; namespace tmtt { - //--- Stub window sizes copied from L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py - - const std::vector DegradeBend::barrelCut_ = {0, 2, 2.5, 3.5, 4.5, 5.5, 7}; - const std::vector > DegradeBend::ringCut_ = { // EndcapCutSet - {0}, - {0, 1, 2.5, 2.5, 3, 2.5, 3, 3.5, 4, 4, 4.5, 3.5, 4, 4.5, 5, 5.5}, - {0, 0.5, 2.5, 2.5, 3, 2.5, 3, 3, 3.5, 3.5, 4, 3.5, 3.5, 4, 4.5, 5}, - {0, 1, 3, 3, 2.5, 3.5, 3.5, 3.5, 4, 3.5, 3.5, 4, 4.5}, - {0, 1, 2.5, 3, 2.5, 3.5, 3, 3, 3.5, 3.5, 3.5, 4, 4}, - {0, 0.5, 1.5, 3, 2.5, 3.5, 3, 3, 3.5, 4, 3.5, 4, 3.5}}; - const std::vector > DegradeBend::tiltedCut_ = { // TiltedBarrelCutSet - {0}, - {0, 3, 3., 2.5, 3., 3., 2.5, 2.5, 2., 1.5, 1.5, 1, 1}, - {0, 4., 4, 4, 4, 4., 4., 4.5, 5, 4., 3.5, 3.5, 3}, - {0, 5, 5, 5, 5, 5, 5, 5.5, 5, 5, 5.5, 5.5, 5.5}}; - const std::vector DegradeBend::barrelNTilt_ = {0., 12., 12., 12., 0., 0., 0.}; - //--- Given the original bend, flag indicating if this is a PS or 2S module, & detector identifier, - //--- this return the degraded stub bend, a boolean indicatng if stub bend was outside the assumed window + //--- this returns the degraded stub bend, a boolean indicatng if stub bend was outside the assumed window //--- size programmed below, and an integer indicating how many values of the original bend //--- were grouped together into this single value of the degraded bend. @@ -58,102 +42,21 @@ namespace tmtt { unsigned int& numInGroup, unsigned int& windowHalfStrips) const { // Calculate stub window size in half-strip units used to produce stubs. - // This code should be kept identical to that in - // L1Trigger/TrackTrigger/src/TTStubAlgorithm_official.cc - - unsigned int window = 0; + // Code accessing geometry inspired by L1Trigger/TrackTrigger/src/TTStubAlgorithm_official.cc - if (stDetId.subdetId() == StripSubdetector::TOB) { - int layer = theTrackerTopo_->layer(stDetId); - int ladder = theTrackerTopo_->tobRod(stDetId); - int type = 2 * theTrackerTopo_->tobSide(stDetId) - 3; // -1 for tilted-, 1 for tilted+, 3 for flat - double corr = 0; - - if (type != TrackerModule::BarrelModuleType::flat) // Only for tilted modules - { - corr = (barrelNTilt_.at(layer) + 1) / 2.; - ladder = - corr - (corr - ladder) * type; // Corrected ring number, bet 0 and barrelNTilt.at(layer), in ascending |z| - window = 2 * (tiltedCut_.at(layer)).at(ladder); - } else // Classic barrel window otherwise - { - window = 2 * barrelCut_.at(layer); - } - } else if (stDetId.subdetId() == StripSubdetector::TID) { - window = 2 * (ringCut_.at(theTrackerTopo_->tidWheel(stDetId))).at(theTrackerTopo_->tidRing(stDetId)); - } + const double* storedHalfWindow = sw_->storedWindowSize(theTrackerTopo_, stDetId); // Compare this with the possibly tighter window provided by the user, converting to half-strip units. - unsigned int newWindow = (unsigned int)(2 * windowFEnew); - if (window > newWindow) - window = newWindow; - - // This is the window size measured in half-strips. - windowHalfStrips = window; - - // Number of degraded bend values should correspond to 3 bits (PS modules) or 4 bits (2S modules), - // so measuring everything in half-strip units, max integer "window" size that can be encoded without - // compression given by 2*window+1 <= pow(2,B), where B is number of bits. - // Hence no compression required if window cut is abs(b) < 3 (PS) or 7 (2S). Must introduce one merge for - // each 1 unit increase in "window" beyond this. + const double window = std::min(*storedHalfWindow, double(windowFEnew)); + windowHalfStrips = (unsigned int)(2 * window); // Bend is measured with granularity of 0.5 strips. // Convert it to integer measured in half-strip units for this calculation! - int b = std::round(2 * bend); - if ((unsigned int)(abs(b)) <= window) { - float degradedB; - unsigned int numBends = 2 * window + 1; - unsigned int numAllowed = (psModule) ? pow(2, bitsPS_) : pow(2, bits2S_); - // Existance of bend = 0 means can only use an odd number of groups. - numAllowed -= 1; - if (numBends <= numAllowed) { - // Can output uncompressed bend info. - numInGroup = 1; - degradedB = float(b); - } else { - unsigned int inSmallGroup = numBends / numAllowed; - unsigned int numLargeGroups = numBends % numAllowed; - unsigned int inLargeGroup = inSmallGroup + 1; - unsigned int numSmallGroups = numAllowed - numLargeGroups; - // Bend encoding in groups (some large, some small, one large/small, some small, some large). - vector groups; - for (unsigned int i = 0; i < numLargeGroups / 2; i++) - groups.push_back(inLargeGroup); - for (unsigned int i = 0; i < numSmallGroups / 2; i++) - groups.push_back(inSmallGroup); - // Only one of numLargeGroups & numSmallGroups can be odd, since numAllowed is odd. - // And whichever is odd is associated to a group with an odd number of elements since numBends is odd, - if (numLargeGroups % 2 == 1 && inLargeGroup % 2 == 1) { - groups.push_back(inLargeGroup); - } else if (numSmallGroups % 2 == 1 && inSmallGroup % 2 == 1) { - groups.push_back(inSmallGroup); - } else { - throw cms::Exception("LogicError") << "DegradeBend: logic error with odd numbers"; - } - for (unsigned int i = 0; i < numSmallGroups / 2; i++) - groups.push_back(inSmallGroup); - for (unsigned int i = 0; i < numLargeGroups / 2; i++) - groups.push_back(inLargeGroup); - - degradedB = 999; - int iUp = -int(window) - 1; - for (unsigned int& inGroup : groups) { - iUp += inGroup; - int iDown = iUp - inGroup + 1; - if (b <= iUp && b >= iDown) { - numInGroup = inGroup; - degradedB = 0.5 * (iUp + iDown); - } - } - if (degradedB == 999) - throw cms::Exception("LogicError") << "DegradeResolution: Logic error in loop over groups"; - } - - // This is degraded bend in full strip units (neglecting bend sign). - degradedBend = float(degradedB) / 2.; - + if ((unsigned int)(std::abs(b)) <= windowHalfStrips) { + // Call the official CMS bend encoding algorithm. + degradedBend = stubAlgo_->degradeBend(psModule, windowHalfStrips, b); } else { // This should only happen for stubs subsequently rejected by the FE. numInGroup = 0; diff --git a/L1Trigger/TrackFindingTMTT/src/DigitalTrack.cc b/L1Trigger/TrackFindingTMTT/src/DigitalTrack.cc index f99fa085ca5c6..9586e01c3c55d 100644 --- a/L1Trigger/TrackFindingTMTT/src/DigitalTrack.cc +++ b/L1Trigger/TrackFindingTMTT/src/DigitalTrack.cc @@ -86,8 +86,8 @@ namespace tmtt { tp_phi0_ = tpOK ? tp->phi0() : 0; tp_z0_ = tpOK ? tp->z0() : 0; tp_index_ = tpOK ? tp->index() : -1; - tp_useForAlgEff_ = tpOK ? tp->useForAlgEff() : 0; - tp_useForEff_ = tpOK ? tp->useForEff() : 0; + tp_useForAlgEff_ = tpOK ? tp->useForAlgEff() : false; + tp_useForEff_ = tpOK ? tp->useForEff() : false; tp_pdgId_ = tpOK ? tp->pdgId() : 0; // Digitize track. diff --git a/L1Trigger/TrackFindingTMTT/src/DupFitTrkKiller.cc b/L1Trigger/TrackFindingTMTT/src/DupFitTrkKiller.cc index 4e810cbc745f6..d52f22c321ace 100644 --- a/L1Trigger/TrackFindingTMTT/src/DupFitTrkKiller.cc +++ b/L1Trigger/TrackFindingTMTT/src/DupFitTrkKiller.cc @@ -11,12 +11,12 @@ namespace tmtt { //=== Make available cfg parameters & specify which algorithm is to be used for duplicate track removal. DupFitTrkKiller::DupFitTrkKiller(const Settings* settings) - : settings_(settings), dupTrkAlg_(settings->dupTrkAlgFit()) {} + : settings_(settings), dupTrkAlg_(static_cast(settings->dupTrkAlgFit())) {} //=== Eliminate duplicate tracks from the input collection, and so return a reduced list of tracks. list DupFitTrkKiller::filter(const list& vecTracks) const { - if (dupTrkAlg_ == 0) { + if (dupTrkAlg_ == DupAlgoName::None) { // We are not running duplicate removal, so return original fitted track collection. list copyTracks; for (const L1fittedTrack& trk : vecTracks) { @@ -28,10 +28,10 @@ namespace tmtt { // Choose which algorithm to run, based on parameter dupTrkAlg_. switch (dupTrkAlg_) { // Run filters that only work on fitted tracks. - case 1: + case DupAlgoName::Algo1: return filterAlg1(vecTracks); break; - case 2: + case DupAlgoName::Algo2: return filterAlg2(vecTracks); break; default: @@ -58,7 +58,7 @@ namespace tmtt { constexpr bool goOutsideArray = true; // Also store in memory stubs outside the HT array during 2nd pass. constexpr bool limitDiff = true; // Limit allowed diff. between HT & Fit cell to <= 1. - if (debug && tracks.size() > 0) + if (debug && not tracks.empty()) PrintL1trk() << "Start DupFitTrkKiller" << tracks.size(); list tracksFiltered; @@ -211,7 +211,7 @@ namespace tmtt { // Hard-wired options to play with. const bool debug = false; - if (debug && tracks.size() > 0) + if (debug && not tracks.empty()) PrintL1trk() << "START " << tracks.size(); list tracksFiltered; @@ -268,7 +268,7 @@ namespace tmtt { } } } - if (tracks.size() > 0) + if (not tracks.empty()) PrintL1trk() << "FOUND " << tracks.size(); } diff --git a/L1Trigger/TrackFindingTMTT/src/HTbase.cc b/L1Trigger/TrackFindingTMTT/src/HTbase.cc index d5560e92fbbc3..5629fd6a51087 100644 --- a/L1Trigger/TrackFindingTMTT/src/HTbase.cc +++ b/L1Trigger/TrackFindingTMTT/src/HTbase.cc @@ -189,7 +189,7 @@ namespace tmtt { // Check if the hardware processes rows of the HT array in a specific order when outputting track candidates. // Currently this is by decreasing Pt for r-phi HT and unordered for r-z HT. const vector iOrder = this->rowOrder(nBinsX_); - bool wantOrdering = (iOrder.size() > 0); + bool wantOrdering = (not iOrder.empty()); // Loop over cells in HT array. for (unsigned int i = 0; i < nBinsX_; i++) { diff --git a/L1Trigger/TrackFindingTMTT/src/HTrphi.cc b/L1Trigger/TrackFindingTMTT/src/HTrphi.cc index f49d88d866376..192403be46b8f 100644 --- a/L1Trigger/TrackFindingTMTT/src/HTrphi.cc +++ b/L1Trigger/TrackFindingTMTT/src/HTrphi.cc @@ -62,12 +62,6 @@ namespace tmtt { else if (shape_ == HTshape::diamond) binSizePhiTrkAxis_ = 2. * maxAbsPhiTrkAxis_ / (nBinsPhiTrkAxis_ - 1. / 2.); - // Note max. |gradient| that the line corresponding to any stub in any of the r-phi HT arrays could have. - // Firmware assumes this should not exceed 1.0; - if (errMon_ != nullptr) { - errMon_->maxLineGradient = max(errMon_->maxLineGradient.load(), this->calcMaxLineGradArray()); - } - // Optionally merge 2x2 neighbouring cells into a single cell at low Pt, to reduce efficiency loss due to // scattering. (Do this if either of options EnableMerge2x2 or MiniHTstage are enabled. // N.B These two options are never both enabled). @@ -311,6 +305,11 @@ namespace tmtt { } } } + // Note max. |gradient| that the line corresponding to any stub in any of the r-phi HT arrays could have. + // Firmware assumes this should not exceed 1.0; + if (errMon_ != nullptr) { + errMon_->maxLineGradient = max(errMon_->maxLineGradient.load(), this->calcLineGradArray(stub->r())); + } } } @@ -602,22 +601,19 @@ namespace tmtt { return merge; } - //=== Calculate maximum |gradient| that any stub's line across this HT array could have, so can check it doesn't exceed 1. + //=== Calculate line |gradient| of stubs in HT array, so can check it doesn't exceed 1. - float HTrphi::calcMaxLineGradArray() const { - // Get max. |gradient| possible in this HT array. - float gradOuter = std::abs(invPtToDphi_ * (settings_->trackerOuterRadius() - chosenRofPhi_)); - float gradInner = std::abs(invPtToDphi_ * (settings_->trackerInnerRadius() - chosenRofPhi_)); - float maxGrad = max(gradOuter, gradInner); + float HTrphi::calcLineGradArray(float r) const { + float grad = std::abs(invPtToDphi_ * (r - chosenRofPhi_)); // Convert it to units of bin width. - maxGrad *= binSizeQoverPtAxis_ / binSizePhiTrkAxis_; + grad *= binSizeQoverPtAxis_ / binSizePhiTrkAxis_; if (shape_ == HTshape::hexagon) - maxGrad *= 3.; + grad *= 3.; else if (shape_ == HTshape::diamond) - maxGrad *= 2.; + grad *= 2.; else if (shape_ == HTshape::brick) - maxGrad *= 4.; - return maxGrad; + grad *= 4.; + return grad; } //=== If requested, kill those tracks in this sector that can't be read out during the time-multiplexed period, because diff --git a/L1Trigger/TrackFindingTMTT/src/Histos.cc b/L1Trigger/TrackFindingTMTT/src/Histos.cc index eb4c0163be66c..ef0070f29a58b 100644 --- a/L1Trigger/TrackFindingTMTT/src/Histos.cc +++ b/L1Trigger/TrackFindingTMTT/src/Histos.cc @@ -51,8 +51,8 @@ namespace tmtt { chosenRofZ_ = settings->chosenRofZ(); trackFitters_ = settings->trackFitters(); useRZfilter_ = settings->useRZfilter(); - ranRZfilter_ = (useRZfilter_.size() > 0); // Was any r-z track filter run? - resPlotOpt_ = settings->resPlotOpt(); // Only use signal events for helix resolution plots? + ranRZfilter_ = (not useRZfilter_.empty()); // Was any r-z track filter run? + resPlotOpt_ = settings->resPlotOpt(); // Only use signal events for helix resolution plots? } //=== Book all histograms @@ -197,7 +197,7 @@ namespace tmtt { // Study efficiency for good stubs of tightened front end-electronics cuts. for (const TP& tp : vTPs) { if (tp.useForAlgEff()) { // Only bother for stubs that are on TP that we have a chance of reconstructing. - const vector stubs = tp.assocStubs(); + const vector& stubs = tp.assocStubs(); for (const Stub* s : stubs) { hisStubIneffiVsInvPt_->Fill(1. / tp.pt(), (!s->frontendPass())); hisStubIneffiVsEta_->Fill(std::abs(tp.eta()), (!s->frontendPass())); diff --git a/L1Trigger/TrackFindingTMTT/src/InputData.cc b/L1Trigger/TrackFindingTMTT/src/InputData.cc index 173cee073bfbb..4d16a2651cfe5 100644 --- a/L1Trigger/TrackFindingTMTT/src/InputData.cc +++ b/L1Trigger/TrackFindingTMTT/src/InputData.cc @@ -16,6 +16,7 @@ #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" #include "L1Trigger/TrackFindingTMTT/interface/StubKiller.h" #include "L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h" +#include "L1Trigger/TrackFindingTMTT/interface/DegradeBend.h" #include #include @@ -28,6 +29,7 @@ namespace tmtt { const edm::EventSetup& iSetup, const Settings* settings, StubWindowSuggest* stubWindowSuggest, + const DegradeBend* degradeBend, const TrackerGeometry* trackerGeometry, const TrackerTopology* trackerTopology, const list& listTrackerModule, @@ -106,7 +108,8 @@ namespace tmtt { const unsigned int stubIndex = vAllStubs_.size(); // Store the Stub info, using class Stub to provide easy access to the most useful info. - vAllStubs_.emplace_back(ttStubRef, stubIndex, settings, trackerTopology, &trackerModule, stubKiller.get()); + vAllStubs_.emplace_back( + ttStubRef, stubIndex, settings, trackerTopology, &trackerModule, degradeBend, stubKiller.get()); // Also fill truth associating stubs to tracking particles. if (enableMCtruth_) { diff --git a/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc b/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc index 35762f558ccbb..119f6969c8eb8 100644 --- a/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc +++ b/L1Trigger/TrackFindingTMTT/src/KFParamsComb.cc @@ -5,21 +5,34 @@ #include "L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h" #include "DataFormats/Math/interface/deltaPhi.h" +#include #include using namespace std; namespace tmtt { + /* Initialize */ + + KFParamsComb::KFParamsComb(const Settings* settings, const uint nHelixPar, const std::string& fitterName) + : KFbase(settings, nHelixPar, fitterName), + // Initialize cuts applied to helix states vs KF layer number of last added stub. + kfLayerVsPtToler_(settings->kfLayerVsPtToler()), + kfLayerVsD0Cut5_(settings->kfLayerVsD0Cut5()), + kfLayerVsZ0Cut5_(settings->kfLayerVsZ0Cut5()), + kfLayerVsZ0Cut4_(settings->kfLayerVsZ0Cut4()), + kfLayerVsChiSq5_(settings->kfLayerVsChiSq5()), + kfLayerVsChiSq4_(settings->kfLayerVsChiSq4()) {} + /* Helix state seed */ TVectorD KFParamsComb::seedX(const L1track3D& l1track3D) const { - TVectorD vecX(nPar_); + TVectorD vecX(nHelixPar_); vecX[INV2R] = settings_->invPtToInvR() * l1track3D.qOverPt() / 2; vecX[PHI0] = reco::deltaPhi(l1track3D.phi0() - sectorPhi(), 0.); vecX[Z0] = l1track3D.z0(); vecX[T] = l1track3D.tanLambda(); - if (nPar_ == 5) { + if (nHelixPar_ == 5) { // fit without d0 constraint vecX[D0] = l1track3D.d0(); } @@ -29,26 +42,26 @@ namespace tmtt { /* Helix state seed covariance matrix */ TMatrixD KFParamsComb::seedC(const L1track3D& l1track3D) const { - TMatrixD matC(nPar_, nPar_); + TMatrixD matC(nHelixPar_, nHelixPar_); double invPtToInv2R = settings_->invPtToInvR() / 2; // Assumed track seed (from HT) uncertainty in transverse impact parameter. // Constants optimised by hand for TMTT algo. - const float inv2Rsigma = 0.0314 * invPtToInv2R; + const float inv2Rsigma = 0.0314 * invPtToInv2R; constexpr float phi0sigma = 0.0102; - constexpr float z0sigma = 5.0; + constexpr float z0sigma = 5.0; constexpr float tanLsigma = 0.5; - constexpr float d0Sigma = 1.0; + constexpr float d0Sigma = 1.0; // (z0, tanL, d0) uncertainties could be smaller for Hybrid, if seeded in PS? -- To check! // if (L1track3D.seedPS() > 0) z0sigma /= 4; ??? matC[INV2R][INV2R] = pow(inv2Rsigma, 2); - matC[PHI0][PHI0] = pow(phi0sigma, 2); - matC[Z0][Z0] = pow(z0sigma, 2); - matC[T][T] = pow(tanLsigma, 2); - if (nPar_ == 5) { - matC[D0][D0] = pow(d0Sigma, 2); + matC[PHI0][PHI0] = pow(phi0sigma, 2); + matC[Z0][Z0] = pow(z0sigma, 2); + matC[T][T] = pow(tanLsigma, 2); + if (nHelixPar_ == 5) { // fit without d0 constraint + matC[D0][D0] = pow(d0Sigma, 2); } return matC; } @@ -76,13 +89,8 @@ namespace tmtt { double vz(0); double vcorr(0); - // consider error due to integerisation only for z (r in encap) coord when enabled - double err_digi2(0); - if (settings_->enableDigitize()) - err_digi2 = 0.15625 * 0.15625 / 12.0; - double a = stub->sigmaPerp() * stub->sigmaPerp(); - double b = stub->sigmaPar() * stub->sigmaPar() + err_digi2; + double b = stub->sigmaPar() * stub->sigmaPar(); double r2 = stub->r() * stub->r(); double invr2 = 1. / r2; @@ -155,11 +163,11 @@ namespace tmtt { /* Here I always measure phi(r), and z(r) */ TMatrixD KFParamsComb::matrixH(const Stub* stub) const { - TMatrixD matH(2, nPar_); + TMatrixD matH(2, nHelixPar_); double r = stub->r(); matH(PHI, INV2R) = -r; matH(PHI, PHI0) = 1; - if (nPar_ == 5) { + if (nHelixPar_ == 5) { // fit without d0 constraint matH(PHI, D0) = -1. / r; } matH(Z, Z0) = 1; @@ -170,7 +178,7 @@ namespace tmtt { /* Kalman helix ref point extrapolation matrix */ TMatrixD KFParamsComb::matrixF(const Stub* stub, const KalmanState* state) const { - const TMatrixD unitMatrix(TMatrixD::kUnit, TMatrixD(nPar_, nPar_)); + const TMatrixD unitMatrix(TMatrixD::kUnit, TMatrixD(nHelixPar_, nHelixPar_)); return unitMatrix; } @@ -178,12 +186,12 @@ namespace tmtt { TVectorD KFParamsComb::trackParams(const KalmanState* state) const { TVectorD vecX = state->vectorX(); - TVectorD vecY(nPar_); + TVectorD vecY(nHelixPar_); vecY[QOVERPT] = 2. * vecX[INV2R] / settings_->invPtToInvR(); vecY[PHI0] = reco::deltaPhi(vecX[PHI0] + sectorPhi(), 0.); vecY[Z0] = vecX[Z0]; vecY[T] = vecX[T]; - if (nPar_ == 5) { + if (nHelixPar_ == 5) { // fit without d0 constraint vecY[D0] = vecX[D0]; } return vecY; @@ -193,10 +201,10 @@ namespace tmtt { /* (N.B. chi2rz unchanged by constraint) */ TVectorD KFParamsComb::trackParams_BeamConstr(const KalmanState* state, double& chi2rphi) const { - if (nPar_ == 5) { + if (nHelixPar_ == 5) { // fit without d0 constraint TVectorD vecX = state->vectorX(); TMatrixD matC = state->matrixC(); - TVectorD vecY(nPar_); + TVectorD vecY(nHelixPar_); double delChi2rphi = (vecX[D0] * vecX[D0]) / matC[D0][D0]; chi2rphi = state->chi2rphi() + delChi2rphi; // Apply beam-spot constraint to helix params in transverse plane only, as most sensitive to it. @@ -217,23 +225,9 @@ namespace tmtt { /* Check if helix state passes cuts */ bool KFParamsComb::isGoodState(const KalmanState& state) const { - // Cut values. (Layer 0 entry here is dummy). -- todo : make configurable - - vector z0Cut, ptTolerance, d0Cut, chi2Cut; - // Layer = 0 1 2 3 4 5 6 - ptTolerance = {999., 999., 0.1, 0.1, 0.05, 0.05, 0.05}; - d0Cut = {999., 999., 999., 10., 10., 10., 10.}; // Only used for 5 param fit. - // Chi2 cuts should be retuned if cfg param KalmanMultiScattTerm is changed! - if (nPar_ == 5) { // specific cuts for displaced tracking case. - // Layer = 0 1 2 3 4 5 6 - z0Cut = { - 999., 999., 1.7 * 15., 1.7 * 15., 1.7 * 15., 1.7 * 15., 1.7 * 15.}; // Larger values require digisation change. - chi2Cut = {999., 999., 10., 30., 80., 120., 160.}; // Maybe loosen for high d0 ? - } else { // specific cuts for prompt tracking case. - // Layer = 0 1 2 3 4 5 6 - z0Cut = {999., 999., 15., 15., 15., 15., 15.}; - chi2Cut = {999., 999., 10., 30., 80., 120., 160.}; - } + // Set cut values that are different for 4 & 5 param helix fits. + vector kfLayerVsZ0Cut = (nHelixPar_ == 5) ? kfLayerVsZ0Cut5_ : kfLayerVsZ0Cut4_; + vector kfLayerVsChiSqCut = (nHelixPar_ == 5) ? kfLayerVsChiSq5_ : kfLayerVsChiSq4_; unsigned nStubLayers = state.nStubLayers(); bool goodState(true); @@ -245,13 +239,13 @@ namespace tmtt { // state parameter selections - if (z0 > z0Cut[nStubLayers]) + if (z0 > kfLayerVsZ0Cut[nStubLayers]) goodState = false; - if (pt < settings_->houghMinPt() - ptTolerance[nStubLayers]) + if (pt < settings_->houghMinPt() - kfLayerVsPtToler_[nStubLayers]) goodState = false; - if (nPar_ == 5) { + if (nHelixPar_ == 5) { // fit without d0 constraint double d0 = std::abs(state.vectorX()[D0]); - if (d0 > d0Cut[nStubLayers]) + if (d0 > kfLayerVsD0Cut5_[nStubLayers]) goodState = false; } @@ -259,7 +253,7 @@ namespace tmtt { double chi2scaled = state.chi2scaled(); // chi2(r-phi) scaled down to improve electron performance. - if (chi2scaled > chi2Cut[nStubLayers]) + if (chi2scaled > kfLayerVsChiSqCut[nStubLayers]) goodState = false; // No separate pT selection needed const bool countUpdateCalls = false; // Print statement to count calls to Updator. @@ -277,7 +271,7 @@ namespace tmtt { text << " pt(mc)=" << tpa_->pt(); text << " pt=" << pt << " q/pt=" << qOverPt << " tanL=" << vecY[T] << " z0=" << vecY[Z0] << " phi0=" << vecY[PHI0]; - if (nPar_ == 5) + if (nHelixPar_ == 5) // fit without d0 constraint text << " d0=" << vecY[D0]; text << " fake" << (tpa_ == nullptr); if (tpa_ != nullptr) diff --git a/L1Trigger/TrackFindingTMTT/src/KFbase.cc b/L1Trigger/TrackFindingTMTT/src/KFbase.cc index 88ac5fb54c5e0..f0f20e2c0ada1 100644 --- a/L1Trigger/TrackFindingTMTT/src/KFbase.cc +++ b/L1Trigger/TrackFindingTMTT/src/KFbase.cc @@ -26,9 +26,9 @@ namespace tmtt { /* Initialize cfg parameters */ - KFbase::KFbase(const Settings *settings, const uint nPar, const string &fitterName, const uint nMeas) + KFbase::KFbase(const Settings *settings, const uint nHelixPar, const string &fitterName, const uint nMeas) : TrackFitGeneric(settings, fitterName) { - nPar_ = nPar; + nHelixPar_ = nHelixPar; nMeas_ = nMeas; numEtaRegions_ = settings->numEtaRegions(); } @@ -47,7 +47,7 @@ namespace tmtt { sort(stubs.begin(), stubs.end(), orderByLayer); // Makes debug printout pretty. //TP - const TP *tpa(0); + const TP *tpa(nullptr); if (l1track3D.matchedTP()) { tpa = l1track3D.matchedTP(); } @@ -78,7 +78,7 @@ namespace tmtt { if (cand != nullptr) { // Get track helix params. TVectorD trackPars = trackParams(cand); - double d0 = (nPar_ == 5) ? trackPars[D0] : 0.; + double d0 = (nHelixPar_ == 5) ? trackPars[D0] : 0.; L1fittedTrack fitTrk(settings_, &l1track3D, @@ -91,32 +91,15 @@ namespace tmtt { trackPars[T], cand->chi2rphi(), cand->chi2rz(), - nPar_); - - bool consistentHLS = false; // No longer used - // if (this->isHLS()) { - // unsigned int mBinHelixHLS, cBinHelixHLS; - // cand->getHLSselect(mBinHelixHLS, cBinHelixHLS, consistentHLS); - // if( settings_->kalmanDebugLevel() >= 3 ){ - // // Check if (m,c) corresponding to helix params are correctly calculated by HLS code. - // bool HLS_OK = ((mBinHelixHLS == fitTrk.cellLocationFit().first) && (cBinHelixHLS == fitTrk.cellLocationFit().second)); - // if (not HLS_OK) PrintL1trk()<<"WARNING HLS mBinHelix disagrees with C++:" - // <<" (HLS,C++) m=("<isHLS() && nPar_ == 4) { - fitTrk.setInfoKF(cand->nSkippedLayers(), numUpdateCalls_, consistentHLS); - } else { - fitTrk.setInfoKF(cand->nSkippedLayers(), numUpdateCalls_); - } + fitTrk.setInfoKF(cand->nSkippedLayers(), numUpdateCalls_); // If doing 5 parameter fit, optionally also calculate helix params & chi2 with beam-spot constraint applied, // and store inside L1fittedTrack object. if (settings_->kalmanAddBeamConstr()) { - if (nPar_ == 5) { + if (nHelixPar_ == 5) { double chi2rphi_bcon = 0.; TVectorD trackPars_bcon = trackParams_BeamConstr(cand, chi2rphi_bcon); fitTrk.setBeamConstr(trackPars_bcon[QOVERPT], trackPars_bcon[PHI0], chi2rphi_bcon); @@ -158,7 +141,7 @@ namespace tmtt { for (const TP *tp_i : stub->assocTPs()) text << " " << tp_i->index(); PrintL1trk() << text.str(); - if (stub->assocTPs().size() == 0) + if (stub->assocTPs().empty()) PrintL1trk() << " none"; } PrintL1trk() << "====================="; @@ -189,7 +172,7 @@ namespace tmtt { // seed helix params & their covariance. TVectorD x0 = seedX(l1track3D); TMatrixD pxx0 = seedC(l1track3D); - TMatrixD K(nPar_, 2); + TMatrixD K(nHelixPar_, 2); TMatrixD dcov(2, 2); const KalmanState *state0 = mkState(l1track3D, 0, -1, nullptr, x0, pxx0, K, dcov, nullptr, 0, 0); @@ -211,7 +194,8 @@ namespace tmtt { // Get Kalman encoded layer ID for this stub. int kalmanLay = this->kalmanLayer(etaReg, stub->layerIdReduced(), stub->barrel(), stub->r(), stub->z()); - if (kalmanLay != 7) { + constexpr unsigned int invalidKFlayer = 7; + if (kalmanLay != invalidKFlayer) { if (layerStubs[kalmanLay].size() < settings_->kalmanMaxStubsPerLayer()) { layerStubs[kalmanLay].push_back(stub); } else { @@ -222,7 +206,9 @@ namespace tmtt { } // iterate using state->nextLayer() to determine next Kalman layer(s) to add stubs from - const unsigned int maxIterations = 6; // Increase if you want to allow 7 stubs per fitted track. + constexpr unsigned int nTypicalLayers = 6; // Number of tracker layers a typical track can pass through. + // If user asked to add up to 7 layers to track, increase number of iterations by 1. + const unsigned int maxIterations = std::max(nTypicalLayers, settings_->kalmanMaxNumStubs()); for (unsigned iteration = 0; iteration < maxIterations; iteration++) { int combinations_per_iteration = 0; @@ -244,11 +230,11 @@ namespace tmtt { // Continue to skip until you reach a functioning layer (or a layer with stubs) unsigned nSkippedDeadLayers = 0; unsigned nSkippedAmbiguousLayers = 0; - while (kfDeadLayers.find(layer) != kfDeadLayers.end() && layerStubs[layer].size() == 0) { + while (kfDeadLayers.find(layer) != kfDeadLayers.end() && layerStubs[layer].empty()) { layer += 1; ++nSkippedDeadLayers; } - while (this->kalmanAmbiguousLayer(etaReg, layer) && layerStubs[layer].size() == 0) { + while (this->kalmanAmbiguousLayer(etaReg, layer) && layerStubs[layer].empty()) { layer += 1; ++nSkippedAmbiguousLayers; } @@ -270,10 +256,10 @@ namespace tmtt { unsigned nSkippedDeadLayers_nextStubs = 0; unsigned nSkippedAmbiguousLayers_nextStubs = 0; if (nSkipped < kalmanMaxSkipLayers) { - if (kfDeadLayers.find(layer + 1) != kfDeadLayers.end() && layerStubs[layer + 1].size() == 0) { + if (kfDeadLayers.find(layer + 1) != kfDeadLayers.end() && layerStubs[layer + 1].empty()) { nextlay_stubs = layerStubs[layer + 2]; nSkippedDeadLayers_nextStubs++; - } else if (this->kalmanAmbiguousLayer(etaReg, layer) && layerStubs[layer + 1].size() == 0) { + } else if (this->kalmanAmbiguousLayer(etaReg, layer) && layerStubs[layer + 1].empty()) { nextlay_stubs = layerStubs[layer + 2]; nSkippedAmbiguousLayers_nextStubs++; } else { @@ -283,8 +269,8 @@ namespace tmtt { // If track was not rejected by isGoodState() is previous iteration, failure here usually means the tracker ran out of layers to explore. // (Due to "kalmanLay" not having unique ID for each layer within a given eta sector). - if (settings_->kalmanDebugLevel() >= 2 && best_state_by_nstubs.size() == 0 && thislay_stubs.size() == 0 && - nextlay_stubs.size() == 0) + if (settings_->kalmanDebugLevel() >= 2 && best_state_by_nstubs.empty() && thislay_stubs.empty() && + nextlay_stubs.empty()) PrintL1trk() << "State is lost by start of iteration " << iteration << " : #thislay_stubs=" << thislay_stubs.size() << " #nextlay_stubs=" << nextlay_stubs.size() << " layer=" << layer << " eta=" << l1track3D.iEtaReg(); @@ -374,7 +360,7 @@ namespace tmtt { unsigned int nStubs = iteration + 1; // Success. We have at least one state that passes all cuts. Save best state found with this number of stubs. - if (nStubs >= settings_->kalmanMinNumStubs() && new_states.size() > 0) + if (nStubs >= settings_->kalmanMinNumStubs() && not new_states.empty()) best_state_by_nstubs[nStubs] = new_states[0]; if (nStubs == settings_->kalmanMaxNumStubs()) { @@ -389,7 +375,7 @@ namespace tmtt { } } - if (best_state_by_nstubs.size()) { + if (not best_state_by_nstubs.empty()) { // Select state with largest number of stubs. finished_state = best_state_by_nstubs.begin()->second; // First element has largest number of stubs. if (settings_->kalmanDebugLevel() >= 1) { @@ -401,7 +387,7 @@ namespace tmtt { << l1track3D.cellLocationHT().first << "," << l1track3D.cellLocationHT().second << ")"; TVectorD y = trackParams(finished_state); text << " q/pt=" << y[QOVERPT] << " tanL=" << y[T] << " z0=" << y[Z0] << " phi0=" << y[PHI0]; - if (nPar_ == 5) + if (nHelixPar_ == 5) text << " d0=" << y[D0]; text << " chosen from states:"; for (const auto &p : best_state_by_nstubs) @@ -459,7 +445,7 @@ namespace tmtt { TVectorD vecXref = matF * vecX; if (settings_->kalmanDebugLevel() >= 4) { PrintL1trk() << "vecFref = ["; - for (unsigned i = 0; i < nPar_; i++) + for (unsigned i = 0; i < nHelixPar_; i++) PrintL1trk() << vecXref[i] << ", "; PrintL1trk() << "]"; } @@ -482,7 +468,7 @@ namespace tmtt { matC.Print(); } // Get scattering contribution to helix parameter covariance (currently zero). - TMatrixD matScat(nPar_, nPar_); + TMatrixD matScat(nHelixPar_, nHelixPar_); // Get covariance on helix parameters at new reference point including scattering.. TMatrixD matCref = matF * matC * matFtrans + matScat; @@ -511,8 +497,8 @@ namespace tmtt { } // Update helix state & its covariance matrix with new stub. - TVectorD new_vecX(nPar_); - TMatrixD new_matC(nPar_, nPar_); + TVectorD new_vecX(nHelixPar_); + TMatrixD new_matC(nHelixPar_, nHelixPar_); adjustState(matK, matCref, vecXref, matH, delta, new_vecX, new_matC); // Update track fit chi2 with new stub. @@ -520,10 +506,10 @@ namespace tmtt { this->adjustChi2(state, matRinv, delta, new_chi2rphi, new_chi2rz); if (settings_->kalmanDebugLevel() >= 4) { - if (nPar_ == 4) + if (nHelixPar_ == 4) PrintL1trk() << "adjusted x = " << new_vecX[0] << ", " << new_vecX[1] << ", " << new_vecX[2] << ", " << new_vecX[3]; - else if (nPar_ == 5) + else if (nHelixPar_ == 5) PrintL1trk() << "adjusted x = " << new_vecX[0] << ", " << new_vecX[1] << ", " << new_vecX[2] << ", " << new_vecX[3] << ", " << new_vecX[4]; PrintL1trk() << "adjusted C "; @@ -575,7 +561,7 @@ namespace tmtt { matRinv = TMatrixD(TMatrixD::kInverted, matR); } else { // Protection against rare maths instability. - const TMatrixD unitMatrix(TMatrixD::kUnit, TMatrixD(nPar_, nPar_)); + const TMatrixD unitMatrix(TMatrixD::kUnit, TMatrixD(nHelixPar_, nHelixPar_)); const double big = 9.9e9; matRinv = big * unitMatrix; } @@ -663,7 +649,7 @@ namespace tmtt { TVectorD &new_vecX, TMatrixD &new_matC) const { new_vecX = vecXref + matK * delta; - const TMatrixD unitMatrix(TMatrixD::kUnit, TMatrixD(nPar_, nPar_)); + const TMatrixD unitMatrix(TMatrixD::kUnit, TMatrixD(nHelixPar_, nHelixPar_)); TMatrixD tmp = unitMatrix - matK * matH; new_matC = tmp * matCref; } @@ -742,19 +728,21 @@ namespace tmtt { if (not barrel) { switch (kfEtaReg) { case 4: // B1 B2 B3 B4 B5/D1 B6/D2 D3 - if (layerIDreduced == 3) + if (layerIDreduced == 3) { kalmanLay = 4; - if (layerIDreduced == 4) + } else if (layerIDreduced == 4) { kalmanLay = 5; - if (layerIDreduced == 5) + } else if (layerIDreduced == 5) { kalmanLay = 6; + } break; //case 5: // B1 B2 B3+B4 D1 D2 D3 D4/D5 case 5: // B1 B2 B3 D1+B4 D2 D3 D4/D5 - if (layerIDreduced == 5) + if (layerIDreduced == 5) { kalmanLay = 5; - if (layerIDreduced == 7) + } else if (layerIDreduced == 7) { kalmanLay = 6; + } break; default: break; @@ -763,7 +751,7 @@ namespace tmtt { /* // Fix cases where a barrel layer only partially crosses the eta sector. - // (Logically should work, but actually reduces efficiency). + // (Logically should work, but actually reduces efficiency -- INVESTIGATE). const float barrelHalfLength = 120.; const float barrel4Radius = 68.8; @@ -801,6 +789,7 @@ namespace tmtt { bool KFbase::kalmanAmbiguousLayer(unsigned int iEtaReg, unsigned int kfLayer) { // Only helps in extreme forward sector, and there not significantly. + // UNDERSTAND IF CAN BE USED ELSEWHERE. /* const unsigned int nEta = 16; @@ -841,44 +830,40 @@ namespace tmtt { // Should TMTT tracking be modified to reduce efficiency loss due to dead modules? const bool killRecover = settings_->killRecover(); - set> deadLayers; // GP layer ID & boolean indicating if in barrel. + set> deadGPlayers; // GP layer ID & boolean indicating if in barrel. + // Range of sectors chosen to cover dead regions from StubKiller. if (killRecover) { if (killScenario == StubKiller::KillOptions::layer5) { // barrel layer 5 - deadLayers.insert(pair(4, true)); - if (iEtaReg_ < 5 || iEtaReg_ > 8 || iPhiSec_ < 8 || iPhiSec_ > 11) { - deadLayers.clear(); + if (iEtaReg_ >= 3 && iEtaReg_ <= 7 && iPhiSec_ >= 1 && iPhiSec_ <= 5) { + deadGPlayers.insert(pair(4, true)); } - } else if (killScenario == StubKiller::KillOptions::layer1) { // barrel layer 1 - deadLayers.insert(pair(1, true)); - if (iEtaReg_ > 8 || iPhiSec_ < 8 || iPhiSec_ > 11) { - deadLayers.clear(); + if (iEtaReg_ <= 7 && iPhiSec_ >= 1 && iPhiSec_ <= 5) { + deadGPlayers.insert(pair(1, true)); } remove2PSCut = true; } else if (killScenario == StubKiller::KillOptions::layer1layer2) { // barrel layers 1 & 2 - deadLayers.insert(pair(1, true)); - deadLayers.insert(pair(2, true)); - if (iEtaReg_ > 8 || iPhiSec_ < 8 || iPhiSec_ > 11) { - deadLayers.clear(); - } else if (iEtaReg_ < 1) { - deadLayers.insert(pair(0, true)); // What is this doing? + if (iEtaReg_ <= 7 && iPhiSec_ >= 1 && iPhiSec_ <= 5) { + deadGPlayers.insert(pair(1, true)); + } + if (iEtaReg_ >= 1 && iEtaReg_ <= 7 && iPhiSec_ >= 1 && iPhiSec_ <= 5) { + deadGPlayers.insert(pair(2, true)); } remove2PSCut = true; } else if (killScenario == StubKiller::KillOptions::layer1disk1) { // barrel layer 1 & disk 1 - deadLayers.insert(pair(1, true)); - deadLayers.insert(pair(3, false)); - if (iEtaReg_ > 8 || iPhiSec_ < 8 || iPhiSec_ > 11) { - deadLayers.clear(); - } else if (iEtaReg_ > 3) { - deadLayers.insert(pair(0, true)); + if (iEtaReg_ <= 7 && iPhiSec_ >= 1 && iPhiSec_ <= 5) { + deadGPlayers.insert(pair(1, true)); + } + if (iEtaReg_ <= 3 && iPhiSec_ >= 1 && iPhiSec_ <= 5) { + deadGPlayers.insert(pair(3, false)); } remove2PSCut = true; } } set kfDeadLayers; - for (const auto &p : deadLayers) { + for (const auto &p : deadGPlayers) { unsigned int layer = p.first; bool barrel = p.second; float r = 0.; // This fails for r-dependent parts of kalmanLayer(). FIX @@ -929,7 +914,7 @@ namespace tmtt { void KFbase::printStubLayers(const vector &stubs, unsigned int iEtaReg) const { std::stringstream text; text << std::fixed << std::setprecision(4); - if (stubs.size() == 0) + if (stubs.empty()) text << "stub layers = []\n"; else { text << "stub layers = [ "; diff --git a/L1Trigger/TrackFindingTMTT/src/KalmanState.cc b/L1Trigger/TrackFindingTMTT/src/KalmanState.cc index a73140feb59bb..7aa9d42af6cc0 100644 --- a/L1Trigger/TrackFindingTMTT/src/KalmanState.cc +++ b/L1Trigger/TrackFindingTMTT/src/KalmanState.cc @@ -135,7 +135,7 @@ namespace tmtt { return state; state = state->last_state(); } - return 0; + return nullptr; } std::vector KalmanState::stubs() const { diff --git a/L1Trigger/TrackFindingTMTT/src/Make3Dtracks.cc b/L1Trigger/TrackFindingTMTT/src/Make3Dtracks.cc index 3bf0eae7191c5..4e401ec8c8cdf 100644 --- a/L1Trigger/TrackFindingTMTT/src/Make3Dtracks.cc +++ b/L1Trigger/TrackFindingTMTT/src/Make3Dtracks.cc @@ -28,7 +28,7 @@ namespace tmtt { phiCentreSector_(phiCentreSector), // Centre of phi sector // Note if any fitters require an r-z track filter to be run. - runRZfilter_(settings->useRZfilter().size() > 0) { + runRZfilter_(not settings->useRZfilter().empty()) { // Initialize any track filters (e.g. r-z) run after the r-phi Hough transform. if (runRZfilter_) rzFilter_ = diff --git a/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc b/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc index 460c88715ddb2..625b1305841e5 100644 --- a/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc +++ b/L1Trigger/TrackFindingTMTT/src/MiniHTstage.cc @@ -9,7 +9,7 @@ namespace tmtt { MiniHTstage::MiniHTstage(const Settings* settings) : settings_(settings), miniHTstage_(settings_->miniHTstage()), - muxOutputsHT_(settings_->muxOutputsHT()), + muxOutputsHT_(static_cast(settings_->muxOutputsHT())), houghNbinsPt_(settings_->houghNbinsPt()), houghNbinsPhi_(settings_->houghNbinsPhi()), miniHoughLoadBalance_(settings_->miniHoughLoadBalance()), @@ -34,7 +34,7 @@ namespace tmtt { nMiniHTcells_ = miniHoughNbinsPt_ * miniHoughNbinsPhi_; if (miniHoughLoadBalance_ != 0) { - if (muxOutputsHT_ == 1) { // Multiplexer at output of HT enabled. + if (muxOutputsHT_ == MuxHToutputs::MuxAlgoName::mBinPerLink) { // Multiplexer at output of HT enabled. nHTlinksPerNonant_ = busySectorMbinRanges_.size() - 1; } else { throw cms::Exception("BadConfig") << "MiniHTstage: Unknown MuxOutputsHT configuration option!"; @@ -44,11 +44,12 @@ namespace tmtt { void MiniHTstage::exec(matrix>& mHtRphis) { for (unsigned int iPhiNon = 0; iPhiNon < numPhiNonants_; iPhiNon++) { - map, unsigned int> - numStubsPerLinkStage1; // Indices are ([link ID, MHT cell], #stubs). - map, unsigned int> - numStubsPerLinkStage2; // Indices are ([link ID, MHT cell], #stubs). - map numStubsPerLink; // Indices are ([link ID, MHT cell], #stubs). + // Indices are ([link ID, MHT cell], #stubs). + map, unsigned int> numStubsPerLinkStage1; + // Indices are ([link ID, MHT cell], #stubs). + map, unsigned int> numStubsPerLinkStage2; + // Indices are (link ID, #stubs). + map numStubsPerLink; for (unsigned int iSecInNon = 0; iSecInNon < numPhiSecPerNon_; iSecInNon++) { unsigned int iPhiSec = iPhiNon * numPhiSecPerNon_ + iSecInNon; for (unsigned int iEtaReg = 0; iEtaReg < numEtaRegions_; iEtaReg++) { @@ -184,7 +185,9 @@ namespace tmtt { unsigned int mBin, unsigned int cBin, unsigned int numStubs, + // Indices are ([link ID, MHT cell], #stubs). map, unsigned int>& numStubsPerLinkStage1, + // Indices are ([link ID, MHT cell], #stubs). map, unsigned int>& numStubsPerLinkStage2, bool test) const { unsigned int mhtCell = miniHoughNbinsPhi_ * mBin + cBin; // Send each mini-cell to a different output link diff --git a/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc b/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc index 650f1e14617fc..77dc7146eb7b0 100644 --- a/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc +++ b/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc @@ -22,7 +22,7 @@ namespace tmtt { MuxHToutputs::MuxHToutputs(const Settings* settings) : settings_(settings), - muxOutputsHT_(settings_->muxOutputsHT()), + muxOutputsHT_(static_cast(settings_->muxOutputsHT())), numPhiNonants_(settings_->numPhiNonants()), numPhiSectors_(settings_->numPhiSectors()), numPhiSecPerNon_(numPhiSectors_ / numPhiNonants_), @@ -31,7 +31,7 @@ namespace tmtt { busySectorNumStubs_(settings_->busySectorNumStubs()), // Max. num. of stubs that can be sent within TM period busySectorMbinRanges_( settings_->busySectorMbinRanges()), // Individual m bin (=q/Pt) ranges to be output to opto-links. - busySectorUseMbinRanges_(busySectorMbinRanges_.size() > 0) // m bin ranges option disabled if vector empty. + busySectorUseMbinRanges_(not busySectorMbinRanges_.empty()) // m bin ranges option disabled if vector empty. { // Implemented MUX algorithm relies on same number of sectors per nonant. if (numPhiSectors_ % numPhiNonants_ != 0) @@ -104,7 +104,7 @@ namespace tmtt { //=== Define the number of (eta,phi) sectors that each output opto-link takes tracks from. (Depends on MUX scheme). unsigned int MuxHToutputs::muxFactor() const { - if (muxOutputsHT_ == 1) { + if (muxOutputsHT_ == MuxAlgoName::mBinPerLink) { return numEtaRegions_ * numPhiSecPerNon_; } else { throw cms::Exception("BadConfig") << "MuxHToutputs: Unknown MuxOutputsHT configuration option!"; @@ -117,7 +117,7 @@ namespace tmtt { unsigned int MuxHToutputs::linkID(unsigned int iSecInNon, unsigned int iEtaReg, unsigned int mBinRange) const { unsigned int link; - if (muxOutputsHT_ == 1) { + if (muxOutputsHT_ == MuxAlgoName::mBinPerLink) { //--- This is the Sept. 2019 Mux for the transverse HT readout organised by m-bin. (Each m bin in entire nonant goes to a different link). link = 0; diff --git a/L1Trigger/TrackFindingTMTT/src/Settings.cc b/L1Trigger/TrackFindingTMTT/src/Settings.cc index 46cc178090bd0..0146ea6df187f 100644 --- a/L1Trigger/TrackFindingTMTT/src/Settings.cc +++ b/L1Trigger/TrackFindingTMTT/src/Settings.cc @@ -10,54 +10,59 @@ namespace tmtt { ///=== Hybrid Tracking ///=== Set config params for HYBRID TRACKING via hard-wired consts to allow use outside CMSSW. -Settings::Settings(): - //-------------------------------------------------------------------------------------------------- - // TMTT related configuration parameters, including Kalman Filter. - // Meaning of these parameters explained in TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py - //-------------------------------------------------------------------------------------------------- - - // General cfg params - enableDigitize_(false), - useApproxB_(true), - bApprox_gradient_(0.886454), - bApprox_intercept_(0.504148), - numPhiNonants_(9), - numPhiSectors_(9), - chosenRofPhi_(55.), // Hourglass radius in r-phi (tracklet) -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}), - chosenRofZ_(50.0), // Hourglass radius in r-z (this must be tmtt) - houghMinPt_(2.0), // L1 track pt cut - minStubLayers_(4), - minPtToReduceLayers_(99999.), - reduceLayerID_(true), - minFracMatchStubsOnReco_(-99), - minFracMatchStubsOnTP_(-99), - minNumMatchLayers_(4), - minNumMatchPSLayers_(0), - stubMatchStrict_(false), - - // Kalman filter track fit cfg - kalmanDebugLevel_(0), - //kalmanDebugLevel_(2), // Good for debugging - kalmanMinNumStubs_(4), - kalmanMaxNumStubs_(6), - kalmanRemove2PScut_(true), - kalmanMaxSkipLayersHard_(1), // On "hard" input tracks - kalmanMaxSkipLayersEasy_(2), // On "easy" input tracks - kalmanMaxStubsEasy_(10), // Max. #stubs an input track can have to be defined "easy" - kalmanMaxStubsPerLayer_(4), // To save resources, consider at most this many stubs per layer per track. - kalmanMultiScattTerm_(0.00075), - kalmanChi2RphiScale_(8), - kalmanHOtilted_(true), - kalmanHOhelixExp_(true), - kalmanHOalpha_(1), - kalmanHOprojZcorr_(1), - kalmanHOfw_(false) - { - + Settings::Settings() + : //-------------------------------------------------------------------------------------------------- + // TMTT related configuration parameters, including Kalman Filter. + // Meaning of these parameters explained in TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py + //-------------------------------------------------------------------------------------------------- + + // General cfg params + enableDigitize_(false), + useApproxB_(true), + bApprox_gradient_(0.886454), + bApprox_intercept_(0.504148), + numPhiNonants_(9), + numPhiSectors_(9), + chosenRofPhi_(55.), // Hourglass radius in r-phi (tracklet) + 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}), + chosenRofZ_(50.0), // Hourglass radius in r-z (this must be tmtt) + houghMinPt_(2.0), // L1 track pt cut + minStubLayers_(4), + minPtToReduceLayers_(99999.), + reduceLayerID_(true), + minFracMatchStubsOnReco_(-99), + minFracMatchStubsOnTP_(-99), + minNumMatchLayers_(4), + minNumMatchPSLayers_(0), + stubMatchStrict_(false), + + // Kalman filter track fit cfg + kalmanDebugLevel_(0), + //kalmanDebugLevel_(2), // Good for debugging + kalmanMinNumStubs_(4), + kalmanMaxNumStubs_(6), + kalmanRemove2PScut_(true), + kalmanMaxSkipLayersHard_(1), // On "hard" input tracks + kalmanMaxSkipLayersEasy_(2), // On "easy" input tracks + kalmanMaxStubsEasy_(10), // Max. #stubs an input track can have to be defined "easy" + kfLayerVsPtToler_({999., 999., 0.1, 0.1, 0.05, 0.05, 0.05}), + kfLayerVsD0Cut5_({999., 999., 999., 10., 10., 10., 10.}), + kfLayerVsZ0Cut5_({999., 999., 25.5, 25.5, 25.5, 25.5, 25.5}), + kfLayerVsZ0Cut4_({999., 999., 15., 15., 15., 15., 15.}), + kfLayerVsChiSq5_({999., 999., 10., 30., 80., 120., 160.}), + kfLayerVsChiSq4_({999., 999., 10., 30., 80., 120., 160.}), + kalmanMaxStubsPerLayer_(4), // To save resources, consider at most this many stubs per layer per track. + kalmanMultiScattTerm_(0.00075), + kalmanChi2RphiScale_(8), + kalmanHOtilted_(true), + kalmanHOhelixExp_(true), + kalmanHOalpha_(1), + kalmanHOprojZcorr_(1), + kalmanHOfw_(false) { hybrid_ = true; - magneticField_ = 0.; // Value set later - killScenario_ = 0; // Emulation of dead modules + magneticField_ = 0.; // Value set later + killScenario_ = 0; // Emulation of dead modules if (hybrid_) { if (not useApproxB_) { @@ -79,6 +84,8 @@ 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 magneticFieldInputTag_(iConfig.getParameter("magneticFieldInputTag")), trackerGeometryInputTag_(iConfig.getParameter("trackerGeometryInputTag")), trackerTopologyInputTag_(iConfig.getParameter("trackerTopologyInputTag")), + ttStubAlgoInputTag_(iConfig.getParameter("ttStubAlgoInputTag")), + stubInputTag_(iConfig.getParameter("stubInputTag")), tpInputTag_(iConfig.getParameter("tpInputTag")), stubTruthInputTag_(iConfig.getParameter("stubTruthInputTag")), @@ -266,6 +273,14 @@ 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 kalmanMaxSkipLayersHard_(trackFitSettings_.getParameter("KalmanMaxSkipLayersHard")), kalmanMaxSkipLayersEasy_(trackFitSettings_.getParameter("KalmanMaxSkipLayersEasy")), kalmanMaxStubsEasy_(trackFitSettings_.getParameter("KalmanMaxStubsEasy")), + + kfLayerVsPtToler_(trackFitSettings_.getParameter>("KFLayerVsPtToler")), + kfLayerVsD0Cut5_(trackFitSettings_.getParameter>("KFLayerVsD0Cut5")), + kfLayerVsZ0Cut5_(trackFitSettings_.getParameter>("KFLayerVsZ0Cut5")), + kfLayerVsZ0Cut4_(trackFitSettings_.getParameter>("KFLayerVsZ0Cut4")), + kfLayerVsChiSq5_(trackFitSettings_.getParameter>("KFLayerVsChiSq5")), + kfLayerVsChiSq4_(trackFitSettings_.getParameter>("KFLayerVsChiSq4")), + kalmanMaxStubsPerLayer_(trackFitSettings_.getParameter("KalmanMaxStubsPerLayer")), kalmanMultiScattTerm_(trackFitSettings_.getParameter("KalmanMultiScattTerm")), kalmanChi2RphiScale_(trackFitSettings_.getParameter("KalmanChi2RphiScale")), @@ -325,8 +340,7 @@ 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 magneticField_(0.), // Hybrid tracking - hybrid_(iConfig.getParameter("Hybrid")) - { + hybrid_(iConfig.getParameter("Hybrid")) { // If user didn't specify any PDG codes, use e,mu,pi,K,p, to avoid picking up unstable particles like Xi-. vector genPdgIdsUnsigned(genCuts_.getParameter>("GenPdgIds")); if (genPdgIdsUnsigned.empty()) { @@ -373,7 +387,7 @@ 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 << "Settings: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type C."; // If reducing number of required layers for high Pt tracks, then above checks must be redone. - bool doReduceLayers = (minPtToReduceLayers_ < 10000. || etaSecsReduceLayers_.size() > 0); + bool doReduceLayers = (minPtToReduceLayers_ < 10000. || not etaSecsReduceLayers_.empty()); if (doReduceLayers && minStubLayers_ > 4) { if (minNumMatchLayers_ > minStubLayers_ - 1) throw cms::Exception("BadConfig") diff --git a/L1Trigger/TrackFindingTMTT/src/Stub.cc b/L1Trigger/TrackFindingTMTT/src/Stub.cc index 86364219165af..81263a78085e7 100644 --- a/L1Trigger/TrackFindingTMTT/src/Stub.cc +++ b/L1Trigger/TrackFindingTMTT/src/Stub.cc @@ -7,6 +7,7 @@ #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" #include "L1Trigger/TrackFindingTMTT/interface/TP.h" +#include "L1Trigger/TrackFindingTMTT/interface/StubKiller.h" #include "L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h" #include @@ -18,8 +19,8 @@ namespace tmtt { //=== Hybrid L1 tracking: stub constructor. Stub::Stub(const Settings* settings, - unsigned int idStub, - double phi, + unsigned int idStub, + double phi, double r, double z, double bend, @@ -29,11 +30,11 @@ namespace tmtt { unsigned int iPhiSec, bool psModule, bool barrel, - bool tiltedBarrel, - float stripPitch, - float stripLength, - unsigned int nStrips) - : index_in_vStubs_(idStub), // A unique ID to label the stub. + bool tiltedBarrel, + float stripPitch, + float stripLength, + unsigned int nStrips) + : index_in_vStubs_(idStub), // A unique ID to label the stub. phi_(phi), r_(r), z_(z), @@ -48,8 +49,7 @@ namespace tmtt { tiltedBarrel_(tiltedBarrel), stripPitch_(stripPitch), stripLength_(stripLength), - nStrips_(nStrips) -{} + nStrips_(nStrips) {} //=== TMTT L1 tracking: stub constructor. @@ -58,6 +58,7 @@ namespace tmtt { const Settings* settings, const TrackerTopology* trackerTopology, const TrackerModule* trackerModule, + const DegradeBend* degradeBend, const StubKiller* stubKiller) : ttStubRef_(ttStubRef), settings_(settings), @@ -66,8 +67,8 @@ namespace tmtt { digitizeWarningsOn_(true), lastDigiStep_(Stub::DigiStage::NONE), trackerModule_(trackerModule), // Info about tracker module containing stub - degradeBend_(trackerTopology), // Used to degrade stub bend information. - // Module related variables (need to be stored for Hybrid) + degradeBend_(degradeBend), // Used to degrade stub bend information. + // Module related variables (need to be stored for Hybrid) psModule_(trackerModule->psModule()), layerId_(trackerModule->layerId()), layerIdReduced_(trackerModule->layerIdReduced()), @@ -90,13 +91,6 @@ namespace tmtt { r_ = pos.perp(); z_ = pos.z(); - if (r_ < settings_->trackerInnerRadius() || r_ > settings_->trackerOuterRadius() || - std::abs(z_) > settings_->trackerHalfLength()) { - throw cms::Exception("BadConfig") << "Stub: Stub found outside assumed tracker volume. Please update tracker " - "dimensions specified in Settings.h!" - << " r=" << r_ << " z=" << z_ << " id=" << trackerModule_->detId().subdetId(); - } - // Get the coordinates of the two clusters that make up this stub, measured in units of strip pitch, and measured // in the local frame of the sensor. They have a granularity of 0.5*pitch. for (unsigned int iClus = 0; iClus <= 1; iClus++) { // Loop over two clusters in stub. @@ -264,7 +258,7 @@ namespace tmtt { windowFE = rejectedStubBend_; // TMTT is not tightening windows. } - degradeBend_.degrade(bend, psModule(), trackerModule_->detId(), windowFE, degradedBend, num); + degradeBend_->degrade(bend, psModule(), trackerModule_->detId(), windowFE, degradedBend, num); } //=== Set flag indicating if stub will be output by front-end readout electronics @@ -286,8 +280,8 @@ namespace tmtt { if (frontendPass_ && this->bend() == rejectedStubBend_) { throw cms::Exception( - "LogicError: Window sizes assumed in DegradeBend are tighter than those used for TTStub production. Please " - "fix them"); + "BadConfig: FE stub bend window sizes provided in cfg ES source are tighter than those to make the stubs. " + "Please fix them"); } if (settings_->killLowPtStubs()) { diff --git a/L1Trigger/TrackFindingTMTT/src/StubFEWindows.cc b/L1Trigger/TrackFindingTMTT/src/StubFEWindows.cc new file mode 100644 index 0000000000000..29301fe732d79 --- /dev/null +++ b/L1Trigger/TrackFindingTMTT/src/StubFEWindows.cc @@ -0,0 +1,78 @@ +#include "L1Trigger/TrackFindingTMTT/interface/StubFEWindows.h" +#include "L1Trigger/TrackFindingTMTT/interface/TrackerModule.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "DataFormats/SiStripDetId/interface/StripSubdetector.h" + +#include + +using namespace std; + +namespace tmtt { + + //=== Initialize stub window sizes from TTStubProducer cfg. + + StubFEWindows::StubFEWindows(const edm::ParameterSet& pSetStubAlgo) { + numTiltedLayerRings_ = pSetStubAlgo.getParameter>("NTiltedRings"); + windowSizeBarrelLayers_ = pSetStubAlgo.getParameter>("BarrelCut"); + const auto& pSetTiltedLayer = pSetStubAlgo.getParameter>("TiltedBarrelCutSet"); + const auto& pSetEncapDisks = pSetStubAlgo.getParameter>("EndcapCutSet"); + windowSizeTiltedLayersRings_.reserve(pSetTiltedLayer.size()); + for (const auto& pSet : pSetTiltedLayer) { + windowSizeTiltedLayersRings_.emplace_back(pSet.getParameter>("TiltedCut")); + } + windowSizeEndcapDisksRings_.reserve(pSetEncapDisks.size()); + for (const auto& pSet : pSetEncapDisks) { + windowSizeEndcapDisksRings_.emplace_back(pSet.getParameter>("EndcapCut")); + } + } + + //=== Set all FE stub bend windows to zero. + + void StubFEWindows::setZero() { + std::fill(windowSizeBarrelLayers_.begin(), windowSizeBarrelLayers_.end(), 0.); + for (auto& x : windowSizeEndcapDisksRings_) + std::fill(x.begin(), x.end(), 0.); + for (auto& y : windowSizeTiltedLayersRings_) + std::fill(y.begin(), y.end(), 0.); + } + + //=== Const/non-const access to element of array giving window size for specific module. + + const double* StubFEWindows::storedWindowSize(const TrackerTopology* trackerTopo, const DetId& detId) const { + // Code accessing geometry inspired by L1Trigger/TrackTrigger/src/TTStubAlgorithm_official.cc + + const double* storedHalfWindow = nullptr; + if (detId.subdetId() == StripSubdetector::TOB) { + unsigned int layer = trackerTopo->layer(detId); + unsigned int ladder = trackerTopo->tobRod(detId); + int type = 2 * trackerTopo->tobSide(detId) - 3; // -1 for tilted-, 1 for tilted+, 3 for flat + double corr = 0; + + if (type != TrackerModule::BarrelModuleType::flat) { + // Tilted barrel + corr = (numTiltedLayerRings_.at(layer) + 1) / 2.; + // Corrected ring number, between 0 and barrelNTilt.at(layer), in ascending |z| + ladder = corr - (corr - ladder) * type; + storedHalfWindow = &(windowSizeTiltedLayersRings_.at(layer).at(ladder)); + } else { + // Flat barrel + storedHalfWindow = &(windowSizeBarrelLayers_.at(layer)); + } + + } else if (detId.subdetId() == StripSubdetector::TID) { + // Endcap + unsigned int wheel = trackerTopo->tidWheel(detId); + unsigned int ring = trackerTopo->tidRing(detId); + storedHalfWindow = &(windowSizeEndcapDisksRings_.at(wheel).at(ring)); + } + return storedHalfWindow; + } + + double* StubFEWindows::storedWindowSize(const TrackerTopology* trackerTopo, const DetId& detId) { + // Code accessing geometry inspired by L1Trigger/TrackTrigger/src/TTStubAlgorithm_official.cc + + // Scott Meyers's solution to give const & non-const versions of same function, without + // code duplication. + return const_cast((static_cast(this))->storedWindowSize(trackerTopo, detId)); + } +} // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/StubKiller.cc b/L1Trigger/TrackFindingTMTT/src/StubKiller.cc index 0845c47251000..df9351eacac80 100644 --- a/L1Trigger/TrackFindingTMTT/src/StubKiller.cc +++ b/L1Trigger/TrackFindingTMTT/src/StubKiller.cc @@ -111,6 +111,8 @@ namespace tmtt { if (killScenario_ == KillOptions::none) return false; else { + // Check if stub is in dead region specified by *ToKill_ + // And randomly kill stubs throughout tracker (not just thos in specific regions/modules) bool killStubRandomly = killStub(stub, layersToKill_, minPhiToKill_, @@ -121,13 +123,15 @@ namespace tmtt { maxRToKill_, fractionOfStubsToKillInLayers_, fractionOfStubsToKillEverywhere_); + // Kill modules in specifid modules + // Random modules throughout the tracker, and those modules in specific regions (so may already have been killed by killStub above) bool killStubInDeadModules = killStubInDeadModule(stub); return killStubRandomly || killStubInDeadModules; } } - // Indicate if given stub was killed by dead tracker module, based on dead regions specified here, - // and ignoring dead module scenario. + // Indicate if given stub was killed by dead tracker module, based on specified dead regions + // rather than based on the dead module scenario. // layersToKill - a vector stating the layers we are killing stubs in. Can be an empty vector. // Barrel layers are encoded as 1-6. The endcap layers are encoded as 11-15 (-z) and 21-25 (+z) // min/max Phi/Z/R - stubs within the region specified by these boundaries and layersToKill are flagged for killing @@ -145,39 +149,42 @@ namespace tmtt { const double fractionOfStubsToKillInLayers, const double fractionOfStubsToKillEverywhere) const { // Only kill stubs in specified layers - if (layersToKill.size() > 0) { + if (not layersToKill.empty()) { // Get the layer the stub is in, and check if it's in the layer you want to kill DetId stackDetid = stub->getDetId(); DetId geoDetId(stackDetid.rawId() + 1); - bool isInBarrel = geoDetId.subdetId() == StripSubdetector::TOB || geoDetId.subdetId() == StripSubdetector::TIB; + // If this module is in the deadModule list, don't also try to kill the stub here + if (deadModules_.empty() || deadModules_.find(geoDetId) == deadModules_.end()) { + bool isInBarrel = geoDetId.subdetId() == StripSubdetector::TOB || geoDetId.subdetId() == StripSubdetector::TIB; - int layerID = 0; - if (isInBarrel) { - layerID = trackerTopology_->layer(geoDetId); - } else { - layerID = 10 * trackerTopology_->side(geoDetId) + trackerTopology_->tidWheel(geoDetId); - } + int layerID = 0; + if (isInBarrel) { + layerID = trackerTopology_->layer(geoDetId); + } else { + layerID = 10 * trackerTopology_->side(geoDetId) + trackerTopology_->tidWheel(geoDetId); + } - if (find(layersToKill.begin(), layersToKill.end(), layerID) != layersToKill.end()) { - // Get the phi and z of stub, and check if it's in the region you want to kill - const GeomDetUnit* det0 = trackerGeometry_->idToDetUnit(geoDetId); - const PixelGeomDetUnit* theGeomDet = dynamic_cast(det0); - const PixelTopology* topol = dynamic_cast(&(theGeomDet->specificTopology())); - MeasurementPoint measurementPoint = stub->clusterRef(0)->findAverageLocalCoordinatesCentered(); - LocalPoint clustlp = topol->localPosition(measurementPoint); - GlobalPoint pos = theGeomDet->surface().toGlobal(clustlp); - - double stubPhi = reco::deltaPhi(pos.phi(), 0.); - - if (stubPhi > minPhiToKill && stubPhi < maxPhiToKill && pos.z() > minZToKill && pos.z() < maxZToKill && - pos.perp() > minRToKill && pos.perp() < maxRToKill) { - // Kill fraction of stubs - if (fractionOfStubsToKillInLayers == 1) { - return true; - } else { - if (rndmEngine_->flat() < fractionOfStubsToKillInLayers) { + if (find(layersToKill.begin(), layersToKill.end(), layerID) != layersToKill.end()) { + // Get the phi and z of stub, and check if it's in the region you want to kill + const GeomDetUnit* det0 = trackerGeometry_->idToDetUnit(geoDetId); + const PixelGeomDetUnit* theGeomDet = dynamic_cast(det0); + const PixelTopology* topol = dynamic_cast(&(theGeomDet->specificTopology())); + MeasurementPoint measurementPoint = stub->clusterRef(0)->findAverageLocalCoordinatesCentered(); + LocalPoint clustlp = topol->localPosition(measurementPoint); + GlobalPoint pos = theGeomDet->surface().toGlobal(clustlp); + + double stubPhi = reco::deltaPhi(pos.phi(), 0.); + + if (stubPhi > minPhiToKill && stubPhi < maxPhiToKill && pos.z() > minZToKill && pos.z() < maxZToKill && + pos.perp() > minRToKill && pos.perp() < maxRToKill) { + // Kill fraction of stubs + if (fractionOfStubsToKillInLayers == 1) { return true; + } else { + if (rndmEngine_->flat() < fractionOfStubsToKillInLayers) { + return true; + } } } } @@ -197,11 +204,19 @@ namespace tmtt { // Indicate if given stub was in (partially) dead tracker module, based on dead module scenario. bool StubKiller::killStubInDeadModule(const TTStub* stub) const { - if (deadModules_.size() > 0) { + if (not deadModules_.empty()) { DetId stackDetid = stub->getDetId(); DetId geoDetId(stackDetid.rawId() + 1); - if (deadModules_.find(geoDetId) != deadModules_.end()) - return true; + auto deadModule = deadModules_.find(geoDetId); + if (deadModule != deadModules_.end()) { + if (deadModule->second == 1) { + return true; + } else { + if (rndmEngine_->flat() < deadModule->second) { + return true; + } + } + } } return false; diff --git a/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc b/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc index feb536692f9a9..dc2d3326480cb 100644 --- a/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc +++ b/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc @@ -39,17 +39,12 @@ namespace tmtt { void StubWindowSuggest::updateStoredWindow(const TrackerTopology* trackerTopo, const Stub* stub, double bendHalfWind) { - // Values set according to L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py - // parameter NTiltedRings for whichever tracker geometry (T3, T4, T5 ...) is used.. - const vector barrelNTilt_init = {0., 12., 12., 12., 0., 0., 0.}; - barrelNTilt_ = barrelNTilt_init; - - // This code should be kept almost identical to that in - // L1Trigger/TrackTrigger/src/TTStubAlgorithm_official.cc - // The only exceptions are lines marked "Modified by TMTT group" + // Code accessing geometry inspired by L1Trigger/TrackTrigger/src/TTStubAlgorithm_official.cc DetId stDetId(stub->trackerModule()->detId()); + double* storedHalfWindow = sw_.storedWindowSize(trackerTopo, stDetId); + /* if (stDetId.subdetId() == StripSubdetector::TOB) { unsigned int layer = trackerTopo->layer(stDetId); unsigned int ladder = trackerTopo->tobRod(stDetId); @@ -58,39 +53,29 @@ namespace tmtt { if (type != TrackerModule::BarrelModuleType::flat) // Only for tilted modules { - corr = (barrelNTilt_.at(layer) + 1) / 2.; - ladder = - corr - (corr - ladder) * type; // Corrected ring number, bet 0 and barrelNTilt.at(layer), in ascending |z| - // Modified by TMTT group, to expland arrays if necessary, divide by 2, & update the stored window sizes. - if (tiltedCut_.size() < (layer + 1)) - tiltedCut_.resize(layer + 1); - if (tiltedCut_.at(layer).size() < (ladder + 1)) - tiltedCut_.at(layer).resize(ladder + 1, 0.); - double& storedHalfWindow = (tiltedCut_.at(layer)).at(ladder); + corr = (sw_.numTiltedLayerRings().at(layer) + 1) / 2.; + // Corrected ring number, between 0 and barrelNTilt.at(layer), in ascending |z| + ladder = corr - (corr - ladder) * type; + double& storedHalfWindow = (sw_.windowSizeTiltedLayersRings().at(layer)).at(ladder); if (storedHalfWindow < bendHalfWind) storedHalfWindow = bendHalfWind; } else // Classic barrel window otherwise { - // Modified by TMTT group, to expand arrays if necessary, divide by 2, & update the stored window sizes. - if (barrelCut_.size() < (layer + 1)) - barrelCut_.resize(layer + 1, 0.); - double& storedHalfWindow = barrelCut_.at(layer); + double& storedHalfWindow = sw_.windowSizeBarrelLayers().at(layer); if (storedHalfWindow < bendHalfWind) storedHalfWindow = bendHalfWind; } } else if (stDetId.subdetId() == StripSubdetector::TID) { - // Modified by TMTT group, to expland arrays if necessary, divide by 2, & update the stored window sizes unsigned int wheel = trackerTopo->tidWheel(stDetId); unsigned int ring = trackerTopo->tidRing(stDetId); - if (ringCut_.size() < (wheel + 1)) - ringCut_.resize(wheel + 1); - if (ringCut_.at(wheel).size() < (ring + 1)) - ringCut_.at(wheel).resize(ring + 1, 0.); - double& storedHalfWindow = ringCut_.at(wheel).at(ring); + double& storedHalfWindow = sw_.windowSizeEndcapDisksRings().at(wheel).at(ring); if (storedHalfWindow < bendHalfWind) storedHalfWindow = bendHalfWind; } +*/ + if (*storedHalfWindow < bendHalfWind) + *storedHalfWindow = bendHalfWind; } //=== Print results (should be done in endJob(); @@ -108,7 +93,7 @@ namespace tmtt { text << "BarrelCut = cms.vdouble( "; div = ""; - for (const auto& cut : barrelCut_) { + for (const auto& cut : sw_.windowSizeBarrelLayers()) { text << div << cut; div = ", "; } @@ -116,7 +101,7 @@ namespace tmtt { PrintL1trk(1) << text.str(); PrintL1trk(1) << "TiltedBarrelCutSet = cms.VPSET( "; - for (const auto& cutVec : tiltedCut_) { + for (const auto& cutVec : sw_.windowSizeTiltedLayersRings()) { text.str(""); text << " cms.PSet( TiltedCut = cms.vdouble("; if (cutVec.empty()) @@ -132,7 +117,7 @@ namespace tmtt { PrintL1trk(1) << "),"; PrintL1trk(1) << "EndcapCutSet = cms.VPSET( "; - for (const auto& cutVec : ringCut_) { + for (const auto& cutVec : sw_.windowSizeEndcapDisksRings()) { text.str(""); text << " cms.PSet( EndcapCut = cms.vdouble("; if (cutVec.empty()) diff --git a/L1Trigger/TrackFindingTMTT/src/TP.cc b/L1Trigger/TrackFindingTMTT/src/TP.cc index 580044a68f665..832ae09949768 100644 --- a/L1Trigger/TrackFindingTMTT/src/TP.cc +++ b/L1Trigger/TrackFindingTMTT/src/TP.cc @@ -5,6 +5,8 @@ #include "L1Trigger/TrackFindingTMTT/interface/Utility.h" #include "DataFormats/Math/interface/deltaR.h" +#include + using namespace std; namespace tmtt { @@ -63,11 +65,11 @@ namespace tmtt { // Keep only those TP that have a chance (allowing for finite track resolution) of being reconstructed as L1 tracks. L1 tracks not matching these TP will be defined as fake. // Include all possible particle types here, as if some are left out, L1 tracks matching one of missing types will be declared fake. - static const vector genPdgIdsAllUnsigned = {11, 13, 211, 321, 2212}; + constexpr std::array genPdgIdsAllUnsigned = {{11, 13, 211, 321, 2212}}; vector genPdgIdsAll; - for (unsigned int i = 0; i < genPdgIdsAllUnsigned.size(); i++) { - genPdgIdsAll.push_back(genPdgIdsAllUnsigned[i]); - genPdgIdsAll.push_back(-genPdgIdsAllUnsigned[i]); + for (const int& iPdg : genPdgIdsAllUnsigned) { + genPdgIdsAll.push_back(iPdg); + genPdgIdsAll.push_back(-iPdg); } // Range big enough to include all TP needed to measure tracking efficiency diff --git a/L1Trigger/TrackFindingTMTT/src/TrackerModule.cc b/L1Trigger/TrackFindingTMTT/src/TrackerModule.cc index 767b2aa701c2e..e79389e097e35 100644 --- a/L1Trigger/TrackFindingTMTT/src/TrackerModule.cc +++ b/L1Trigger/TrackFindingTMTT/src/TrackerModule.cc @@ -19,6 +19,8 @@ namespace tmtt { std::once_flag printOnce; } + const float TrackerModule::invRoot12 = sqrt(1. / 12.); + //=== Get info about tracker module (where detId is ID of lower sensor in stacked module). TrackerModule::TrackerModule(const TrackerGeometry* trackerGeometry, diff --git a/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc b/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc index 6d37a6432f26b..26832f16e8bfd 100644 --- a/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc +++ b/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc @@ -184,6 +184,7 @@ namespace tmtt { // Estimate a value of z at the beam spot using the two seeding stubs double z0 = s1->z() + (-s1->z() + s0->z()) * s1->r() / (s1->r() - s0->r()); + // COMMENTED OUT CODE GIVES OPTION OF ALLOWING FOR UNCERTAINTY. NOT WORTH IT? //double z0err = s1->sigmaZ() + ( s1->sigmaZ() + s0->sigmaZ() )*s1->r()/std::abs(s1->r()-s0->r()) + std::abs(-s1->z()+s0->z())*(s1->sigmaR()*std::abs(s1->r()-s0->r()) + s1->r()*(s1->sigmaR() + s0->sigmaR()) )/((s1->r()-s0->r())*(s1->r()-s0->r())); // Estimate a value of z at a chosen Radius using the two seeding stubs float zTrk = s1->z() + (-s1->z() + s0->z()) * (s1->r() - chosenRofZ_) / (s1->r() - s0->r()); diff --git a/L1Trigger/TrackFindingTMTT/src/Utility.cc b/L1Trigger/TrackFindingTMTT/src/Utility.cc index ee6fca615aa0a..32f285571f150 100644 --- a/L1Trigger/TrackFindingTMTT/src/Utility.cc +++ b/L1Trigger/TrackFindingTMTT/src/Utility.cc @@ -5,7 +5,7 @@ #include "FWCore/Utilities/interface/Exception.h" -#include +#include using namespace std; @@ -35,7 +35,7 @@ namespace tmtt { bool reduce = (disableReducedLayerID) ? false : reduceLayerID; // Count layers using CMSSW layer ID. - set foundLayers; + unordered_set foundLayers; for (const Stub* stub : vstubs) { if ((!onlyPS) || stub->psModule()) { // Consider only stubs in PS modules if that option specified. // Use either normal or reduced layer ID depending on request. @@ -157,7 +157,7 @@ namespace tmtt { reduce = true; // or to increase efficiency in the barrel-endcap transition or very forward regions. - const vector etaSecsRed = settings->etaSecsReduceLayers(); + const vector& etaSecsRed = settings->etaSecsReduceLayers(); if (std::count(etaSecsRed.begin(), etaSecsRed.end(), iEtaReg) != 0) reduce = true; diff --git a/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py b/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py index e24fb509e4280..60807b026a2f4 100644 --- a/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py +++ b/L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py @@ -91,13 +91,6 @@ def getTxtFile(txtFileName): process.Timing = cms.Service("Timing", summaryOnly = cms.untracked.bool(True)) -# Random number generator for Stub Killer (dead module emulation) -process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService", - TMTrackProducer = cms.PSet( - initialSeed = cms.untracked.uint32(12345) - ) -) - #--- Load code that produces our L1 tracks and makes corresponding histograms. #process.load('L1Trigger.TrackFindingTMTT.TMTrackProducer_cff') @@ -158,7 +151,7 @@ def getTxtFile(txtFileName): else: # S.Viret's July 2017 stub windows (tight) from commented out part of - # L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py in CMSSW 9.3.2 + # L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py in CMSSW 9.3.2 process.TTStubAlgorithm_official_Phase2TrackerDigi_ = cms.ESProducer("TTStubAlgorithm_official_Phase2TrackerDigi_", zMatchingPS = cms.bool(True), From b8ac74ea4dc402328344a62e9a00e9197c41fb9e Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Mon, 18 May 2020 17:33:28 +0100 Subject: [PATCH 20/22] Added library to BuildFile.xml (#17) --- L1Trigger/TrackFindingTMTT/BuildFile.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/L1Trigger/TrackFindingTMTT/BuildFile.xml b/L1Trigger/TrackFindingTMTT/BuildFile.xml index 7566f8b6f35aa..74090f8a441c5 100644 --- a/L1Trigger/TrackFindingTMTT/BuildFile.xml +++ b/L1Trigger/TrackFindingTMTT/BuildFile.xml @@ -17,6 +17,7 @@ + From 90f6c4197951d7679dd1fcf7bb7ce95df6bef1a7 Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Tue, 19 May 2020 16:51:58 +0100 Subject: [PATCH 21/22] Deleted TrackFindingTMT/data/README (#18) * Added library to BuildFile.xml (This was already done yesterday. Not sure why it appears again) * README file in data directory deleted --- L1Trigger/TrackFindingTMTT/data/README | 1 - 1 file changed, 1 deletion(-) delete mode 100644 L1Trigger/TrackFindingTMTT/data/README diff --git a/L1Trigger/TrackFindingTMTT/data/README b/L1Trigger/TrackFindingTMTT/data/README deleted file mode 100644 index 35172a02d553a..0000000000000 --- a/L1Trigger/TrackFindingTMTT/data/README +++ /dev/null @@ -1 +0,0 @@ -Add a symbolic link from here to the MCsamples/ directory that can be found in https://github.com/cms-data/L1Trigger-TrackFindingTMTT , where .txt files listing available MC samples can be found. \ No newline at end of file From 9b8d2c406087b2bdf08cb134a78de195f4714476 Mon Sep 17 00:00:00 2001 From: Ian Tomalin Date: Fri, 22 May 2020 00:46:18 +0100 Subject: [PATCH 22/22] Fix review comments (#20) --- .../interface/ChiSquaredFitBase.h | 4 +- .../interface/ConverterToTTTrack.h | 2 +- .../TrackFindingTMTT/interface/DigitalStub.h | 2 - .../TrackFindingTMTT/interface/DigitalTrack.h | 2 - .../interface/DupFitTrkKiller.h | 2 - .../interface/GlobalCacheTMTT.h | 5 +- L1Trigger/TrackFindingTMTT/interface/HTbase.h | 5 +- L1Trigger/TrackFindingTMTT/interface/HTrphi.h | 6 +- L1Trigger/TrackFindingTMTT/interface/Histos.h | 15 +- .../TrackFindingTMTT/interface/KFParamsComb.h | 5 +- .../interface/KFTrackletTrack.h | 14 +- L1Trigger/TrackFindingTMTT/interface/KFbase.h | 4 +- .../TrackFindingTMTT/interface/KalmanState.h | 10 +- .../interface/L1fittedTrack.h | 14 +- .../TrackFindingTMTT/interface/L1track2D.h | 4 +- .../TrackFindingTMTT/interface/L1track3D.h | 4 +- .../TrackFindingTMTT/interface/L1trackBase.h | 2 +- .../TrackFindingTMTT/interface/Make3Dtracks.h | 2 - .../TrackFindingTMTT/interface/MiniHTstage.h | 2 - .../TrackFindingTMTT/interface/MuxHToutputs.h | 2 - L1Trigger/TrackFindingTMTT/interface/Sector.h | 12 +- .../TrackFindingTMTT/interface/Settings.h | 2 - .../TrackFindingTMTT/interface/SimpleLR4.h | 8 +- L1Trigger/TrackFindingTMTT/interface/Stub.h | 10 +- .../interface/StubFEWindows.h | 1 - .../TrackFindingTMTT/interface/StubKiller.h | 2 - .../interface/StubWindowSuggest.h | 10 +- L1Trigger/TrackFindingTMTT/interface/TP.h | 7 +- .../interface/TrackFitGeneric.h | 2 +- .../TrackFindingTMTT/interface/TrkRZfilter.h | 6 +- .../plugins/TMTrackProducer.cc | 27 +- .../plugins/TMTrackProducer.h | 4 +- L1Trigger/TrackFindingTMTT/src/HTcell.cc | 2 +- L1Trigger/TrackFindingTMTT/src/HTrphi.cc | 31 +- L1Trigger/TrackFindingTMTT/src/Histos.cc | 300 +++++++++--------- L1Trigger/TrackFindingTMTT/src/KalmanState.cc | 52 --- .../TrackFindingTMTT/src/MuxHToutputs.cc | 5 +- L1Trigger/TrackFindingTMTT/src/Sector.cc | 4 +- L1Trigger/TrackFindingTMTT/src/Settings.cc | 5 + L1Trigger/TrackFindingTMTT/src/SimpleLR4.cc | 7 +- L1Trigger/TrackFindingTMTT/src/Stub.cc | 18 +- .../TrackFindingTMTT/src/StubWindowSuggest.cc | 54 +--- .../TrackFindingTMTT/src/TrackerModule.cc | 7 +- L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc | 13 +- 44 files changed, 278 insertions(+), 417 deletions(-) diff --git a/L1Trigger/TrackFindingTMTT/interface/ChiSquaredFitBase.h b/L1Trigger/TrackFindingTMTT/interface/ChiSquaredFitBase.h index 58be28e604664..86aea89b3e387 100644 --- a/L1Trigger/TrackFindingTMTT/interface/ChiSquaredFitBase.h +++ b/L1Trigger/TrackFindingTMTT/interface/ChiSquaredFitBase.h @@ -9,8 +9,8 @@ #include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h" #include "L1Trigger/TrackFindingTMTT/interface/Settings.h" #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" -#include "TMatrixD.h" -#include "TVectorD.h" +#include +#include #include #include diff --git a/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h b/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h index c7ff08509f61d..5c77d9c6833b7 100644 --- a/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h +++ b/L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h @@ -18,7 +18,7 @@ namespace tmtt { class ConverterToTTTrack { public: // Initialize constants. - ConverterToTTTrack(const Settings* settings) : settings_(settings) { invPtToInvR_ = settings->invPtToInvR(); } + ConverterToTTTrack(const Settings* settings) : settings_(settings), invPtToInvR_(settings->invPtToInvR()) {} // Convert L1fittedTrack or L1track3D (track candidates after/before fit) to TTTrack format. TTTrack makeTTTrack(const L1trackBase* trk, diff --git a/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h b/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h index 751f7e4373306..71a5b1cf94659 100644 --- a/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h +++ b/L1Trigger/TrackFindingTMTT/interface/DigitalStub.h @@ -29,8 +29,6 @@ namespace tmtt { double bend_orig, unsigned int iPhiSec); - ~DigitalStub() {} - // Redo phi digitisation assigning stub to a different phi sector; // (Return arg indicates if any work done). bool changePhiSec(unsigned int iPhiSec); diff --git a/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h b/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h index bfe4200278d69..c3e7e7022733c 100644 --- a/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h +++ b/L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h @@ -24,8 +24,6 @@ namespace tmtt { // Digitize track DigitalTrack(const Settings* settings, const std::string& fitterName, const L1fittedTrack* fitTrk); - ~DigitalTrack() {} - //--- The functions below return variables post-digitization. // half inverse curvature of track. diff --git a/L1Trigger/TrackFindingTMTT/interface/DupFitTrkKiller.h b/L1Trigger/TrackFindingTMTT/interface/DupFitTrkKiller.h index 6440753c8ef4a..94ac4593f1f27 100644 --- a/L1Trigger/TrackFindingTMTT/interface/DupFitTrkKiller.h +++ b/L1Trigger/TrackFindingTMTT/interface/DupFitTrkKiller.h @@ -25,8 +25,6 @@ namespace tmtt { */ DupFitTrkKiller(const Settings* settings); - ~DupFitTrkKiller() {} - /** * Eliminate duplicate tracks from the input collection, and so return a reduced list of tracks. */ diff --git a/L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h b/L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h index 65b394810c0bd..4698c5f4c3daa 100644 --- a/L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h +++ b/L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h @@ -18,10 +18,6 @@ namespace tmtt { - namespace { - std::mutex myMutex; - } - class GlobalCacheTMTT { public: GlobalCacheTMTT(const edm::ParameterSet& iConfig) @@ -43,6 +39,7 @@ namespace tmtt { // Set functions void setListTrackerModule(const std::list& list) const { // Allow only one thread to run this function at a time + static std::mutex myMutex; std::lock_guard myGuard(myMutex); // Only need one copy of tracker geometry for histogramming. diff --git a/L1Trigger/TrackFindingTMTT/interface/HTbase.h b/L1Trigger/TrackFindingTMTT/interface/HTbase.h index 97975a1961a5a..eb048b10cd687 100644 --- a/L1Trigger/TrackFindingTMTT/interface/HTbase.h +++ b/L1Trigger/TrackFindingTMTT/interface/HTbase.h @@ -4,7 +4,8 @@ #include "L1Trigger/TrackFindingTMTT/interface/HTcell.h" #include "L1Trigger/TrackFindingTMTT/interface/L1track2D.h" -#include "boost/numeric/ublas/matrix.hpp" +#include + #include #include #include @@ -27,7 +28,7 @@ namespace tmtt { HTbase( const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, unsigned int nBinsX, unsigned int nBinsY); - virtual ~HTbase() {} + virtual ~HTbase() = default; // Termination. Causes HT array to search for tracks etc. virtual void end(); diff --git a/L1Trigger/TrackFindingTMTT/interface/HTrphi.h b/L1Trigger/TrackFindingTMTT/interface/HTrphi.h index d5071afe680a6..72ff72df7511c 100644 --- a/L1Trigger/TrackFindingTMTT/interface/HTrphi.h +++ b/L1Trigger/TrackFindingTMTT/interface/HTrphi.h @@ -46,7 +46,7 @@ namespace tmtt { float phiCentreSector, ErrorMonitor* errMon = nullptr); - ~HTrphi() override {} + ~HTrphi() override = default; // Add stub to HT array. // If eta subsectors are being used within each sector, specify which ones the stub is compatible with. @@ -143,12 +143,12 @@ namespace tmtt { unsigned int killSomeHTCellsRphi_; // Options for killing stubs/tracks that cant be sent within time-multiplexed period. bool busyInputSectorKill_; - unsigned int busyInputSectorNumStubs_; bool busySectorKill_; + unsigned int busyInputSectorNumStubs_; unsigned int busySectorNumStubs_; std::vector busySectorMbinRanges_; - bool busySectorUseMbinRanges_; std::vector busySectorMbinOrder_; + bool busySectorUseMbinRanges_; bool busySectorUseMbinOrder_; std::vector busySectorMbinLow_; std::vector busySectorMbinHigh_; diff --git a/L1Trigger/TrackFindingTMTT/interface/Histos.h b/L1Trigger/TrackFindingTMTT/interface/Histos.h index 54253a5390bcb..74f4a13acaf44 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Histos.h +++ b/L1Trigger/TrackFindingTMTT/interface/Histos.h @@ -7,7 +7,7 @@ #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" #include "L1Trigger/TrackFindingTMTT/interface/TrackerModule.h" -#include "boost/numeric/ublas/matrix.hpp" +#include using boost::numeric::ublas::matrix; #include @@ -39,7 +39,7 @@ namespace tmtt { // Store cfg parameters. Histos(const Settings* settings); - virtual ~Histos() {} + virtual ~Histos() = default; // Book & fill all histograms. virtual void book(); @@ -112,6 +112,8 @@ namespace tmtt { virtual void printHybridDupRemovalPerformance(){}; protected: + edm::Service fs_; + // Configuration parameters. const Settings* settings_; unsigned int genMinStubLayers_; @@ -126,8 +128,6 @@ namespace tmtt { bool ranRZfilter_; bool resPlotOpt_; - edm::Service fs_; - bool oldSumW2opt_; // Histograms of input data. @@ -217,7 +217,6 @@ namespace tmtt { std::map hisNumFitTrks_; std::map hisNumFitTrksPerNon_; std::map hisNumFitTrksPerSect_; - std::map hisStubsPerFitTrack_; std::map profStubsOnFitTracks_; @@ -241,15 +240,13 @@ namespace tmtt { std::map hisKalmanChi2DofSkipLay1Unmatched_; std::map hisKalmanChi2DofSkipLay2Unmatched_; - std::map hisFitChi2DofMatched_; std::map hisFitChi2DofRphiMatched_; std::map hisFitChi2DofRzMatched_; - std::map profFitChi2DofVsInvPtMatched_; + std::map profFitChi2DofRphiVsInvPtMatched_; - std::map hisFitChi2DofUnmatched_; std::map hisFitChi2DofRphiUnmatched_; std::map hisFitChi2DofRzUnmatched_; - std::map profFitChi2DofVsInvPtUnmatched_; + std::map profFitChi2DofRphiVsInvPtUnmatched_; std::map hisQoverPtResVsTrueEta_; std::map hisPhi0ResVsTrueEta_; diff --git a/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h b/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h index 28bfdadda6aa1..a87d9c2548e6d 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h +++ b/L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h @@ -3,9 +3,6 @@ #include "L1Trigger/TrackFindingTMTT/interface/KFbase.h" #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h" -#include "TMatrixD.h" - -#include ///=== This is the Kalman Combinatorial Filter for 4 & 5 helix parameters track fit algorithm. ///=== All variable names & equations come from Fruhwirth KF paper @@ -17,7 +14,7 @@ namespace tmtt { public: KFParamsComb(const Settings* settings, const uint nHelixPar, const std::string& fitterName); - ~KFParamsComb() override {} + ~KFParamsComb() override = default; protected: //--- Input data diff --git a/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h b/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h index 3524d96c60f23..ae86d424d2df9 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h +++ b/L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h @@ -65,14 +65,10 @@ namespace tmtt { iPhiSec_(iPhiSec), iEtaReg_(iEtaReg), optoLinkID_(l1track3D->optoLinkID()), - accepted_(accepted), nSkippedLayers_(0), numUpdateCalls_(0), - numIterations_(0) {} - - KFTrackletTrack(){}; // Creates track object, but doesn't std::set any variables. - - ~KFTrackletTrack() {} + numIterations_(0), + accepted_(accepted) {} //--- Optionally std::set track helix params & chi2 if beam-spot constraint is used (for 5-parameter fit). void setBeamConstr(float qOverPt_bcon, float phi0_bcon, float chi2rphi_bcon) { @@ -235,9 +231,6 @@ namespace tmtt { std::vector matchedStubs_; unsigned int nMatchedLayers_; - //--- Has the track fit declared this to be a valid track? - bool accepted_; - //--- Info specific to KF fitter. unsigned int nSkippedLayers_; unsigned int numUpdateCalls_; @@ -247,6 +240,9 @@ namespace tmtt { std::unordered_map stateCalls_; std::shared_ptr digitalTrack_; // Class used to digitize track if required. + + //--- Has the track fit declared this to be a valid track? + bool accepted_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/KFbase.h b/L1Trigger/TrackFindingTMTT/interface/KFbase.h index 8947a04149f9c..36ff3642d6764 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KFbase.h +++ b/L1Trigger/TrackFindingTMTT/interface/KFbase.h @@ -159,10 +159,10 @@ namespace tmtt { unsigned int numUpdateCalls_; - const TP *tpa_; - // All helix states KF produces for current track. std::vector> listAllStates_; + + const TP *tpa_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/KalmanState.h b/L1Trigger/TrackFindingTMTT/interface/KalmanState.h index 7e1674c485b2c..21fa4881d8287 100644 --- a/L1Trigger/TrackFindingTMTT/interface/KalmanState.h +++ b/L1Trigger/TrackFindingTMTT/interface/KalmanState.h @@ -3,8 +3,8 @@ #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" #include "L1Trigger/TrackFindingTMTT/interface/KFbase.h" -#include "TMatrixD.h" -#include "TVectorD.h" +#include +#include #include @@ -21,7 +21,6 @@ namespace tmtt { class KalmanState { public: - KalmanState(); KalmanState(const Settings *settings, const L1track3D &candidate, unsigned nSkipped, @@ -35,11 +34,6 @@ namespace tmtt { double chi2rphi, double chi2rz); - KalmanState(const KalmanState &p); - ~KalmanState() {} - - KalmanState &operator=(const KalmanState &other); - const Settings *settings() const { return settings_; } // KF layer where next stub to extend this state should be sought. unsigned nextLayer() const { return (1 + kLayer_); } diff --git a/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h b/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h index 53edc8a36b0bf..f0373166609d3 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h @@ -66,10 +66,10 @@ namespace tmtt { phi0_bcon_(phi0), chi2rphi_bcon_(chi2rphi), nHelixParam_(nHelixParam), - accepted_(accepted), nSkippedLayers_(0), numUpdateCalls_(0), - numIterations_(0) { + numIterations_(0), + accepted_(accepted) { if (l1track3D != nullptr) { iPhiSec_ = l1track3D->iPhiSec(); iEtaReg_ = l1track3D->iEtaReg(); @@ -108,7 +108,7 @@ namespace tmtt { // Creates track rejected by fitter. L1fittedTrack() : L1fittedTrack(nullptr, nullptr, noStubs_, 0, 0., 0., 0., 0., 0., 0., 0., 0, false) {} - ~L1fittedTrack() override {} + ~L1fittedTrack() override = default; //--- Optionally std::set track helix params & chi2 if beam-spot constraint is used (for 5-parameter fit). void setBeamConstr(float qOverPt_bcon, float phi0_bcon, float chi2rphi_bcon) { @@ -384,9 +384,6 @@ namespace tmtt { std::vector matchedStubs_; unsigned int nMatchedLayers_; - //--- Has the track fit declared this to be a valid track? - bool accepted_; - //--- Sector class used to check if fitted track trajectory is in same sector as HT used to find it. std::shared_ptr secTmp_; // shared so as to allow copy of L1fittedTrack. //--- r-phi HT class used to determine HT cell location that corresponds to fitted track helix parameters. @@ -402,9 +399,12 @@ namespace tmtt { std::shared_ptr digitalTrack_; // Class used to digitize track if required. + static const std::vector noStubs_; // Empty vector used to initialize rejected tracks. + bool consistentCell_; - static const std::vector noStubs_; // Empty vector used to initialize rejected tracks. + //--- Has the track fit declared this to be a valid track? + bool accepted_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/L1track2D.h b/L1Trigger/TrackFindingTMTT/interface/L1track2D.h index 8e9cd1c26f2dd..45353709284fb 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1track2D.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1track2D.h @@ -48,9 +48,7 @@ namespace tmtt { matchedStubs_); // Find associated truth particle & calculate info about match. } - L1track2D() : L1trackBase(){}; // Creates track object, but doesn't std::set any variables. - - ~L1track2D() override {} + ~L1track2D() override = default; //--- Get information about the reconstructed track. diff --git a/L1Trigger/TrackFindingTMTT/interface/L1track3D.h b/L1Trigger/TrackFindingTMTT/interface/L1track3D.h index e4e192d258063..3b3b7dc77e3a2 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1track3D.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1track3D.h @@ -72,9 +72,7 @@ namespace tmtt { : L1track3D( settings, stubs, cellLocationHT, helixRphi, helixRz, 0.0, iPhiSec, iEtaReg, optoLinkID, mergedHTcell) {} - L1track3D() : L1trackBase(){}; // Creates track object, but doesn't std::set any variables. - - ~L1track3D() override {} + ~L1track3D() override = default; //--- Set/get optional info for tracklet tracks. diff --git a/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h b/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h index 7d1717502850e..8bd7fcbfc7551 100644 --- a/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h +++ b/L1Trigger/TrackFindingTMTT/interface/L1trackBase.h @@ -18,7 +18,7 @@ namespace tmtt { public: L1trackBase() {} - virtual ~L1trackBase() {} + virtual ~L1trackBase() = default; //--- Get information about the reconstructed track. diff --git a/L1Trigger/TrackFindingTMTT/interface/Make3Dtracks.h b/L1Trigger/TrackFindingTMTT/interface/Make3Dtracks.h index 4268d16da0831..369802e8ca448 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Make3Dtracks.h +++ b/L1Trigger/TrackFindingTMTT/interface/Make3Dtracks.h @@ -32,8 +32,6 @@ namespace tmtt { float etaMaxSector, float phiCentreSector); - ~Make3Dtracks() {} - //=== Main routines to make 3D tracks. // Make 3D track collections. diff --git a/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h b/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h index fce848dd28812..f38fe47e10f86 100644 --- a/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h +++ b/L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h @@ -15,8 +15,6 @@ namespace tmtt { public: MiniHTstage(const Settings* settings); - ~MiniHTstage(){}; - void exec(matrix>& mHtRphis); private: diff --git a/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h b/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h index db1444f97d4aa..7bb90fa3cbcec 100644 --- a/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h +++ b/L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h @@ -33,8 +33,6 @@ namespace tmtt { // Initialize constants from configuration parameters. MuxHToutputs(const Settings* settings); - ~MuxHToutputs() {} - // Determine which tracks are transmitted on each HT output optical link, taking into account the multiplexing // of multiple (eta,phi) sectors onto single links and the truncation of the tracks caused by the requirement // to output all the tracks within the time-multiplexed period. diff --git a/L1Trigger/TrackFindingTMTT/interface/Sector.h b/L1Trigger/TrackFindingTMTT/interface/Sector.h index 38832b3054997..cc51fd96a07ad 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Sector.h +++ b/L1Trigger/TrackFindingTMTT/interface/Sector.h @@ -16,8 +16,6 @@ namespace tmtt { // Initialization. Sector(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaSec); - ~Sector() {} - // Check if stub within the eta and/or phi boundaries of this sector. bool inside(const Stub* stub) const { return (this->insideEta(stub) && this->insidePhi(stub)); } bool insideEta(const Stub* stub) const; @@ -83,13 +81,13 @@ namespace tmtt { float zOuterMax_; // Define phi sector. - float phiCentre_; // phi of centre of sector. - float sectorHalfWidth_; // sector half-width excluding overlaps. - float chosenRofPhi_; // Use phi of track at radius="chosenRofPhi" to define phi sectors. + float phiCentre_; // phi of centre of sector. + float sectorHalfWidth_; // sector half-width excluding overlaps. + float chosenRofPhi_; // Use phi of track at radius="chosenRofPhi" to define phi sectors. + float minPt_; // Min Pt covered by HT array. + float assumedPhiTrkRes_; // Tolerance in stub phi0 (or phi65) assumed to be this fraction of phi sector width. (N.B. If > 0.5, then stubs can be shared by more than 2 phi sectors). bool useStubPhi_; // Require stub phi to be consistent with track of Pt > HTArraySpec.HoughMinPt that crosses HT phi axis? - float minPt_; // Min Pt covered by HT array. bool useStubPhiTrk_; // Require stub phi0 (or phi65 etc.) as estimated from stub bend, to lie within HT phi axis, allowing tolerance specified below? - float assumedPhiTrkRes_; // Tolerance in stub phi0 (or phi65) assumed to be this fraction of phi sector width. (N.B. If > 0.5, then stubs can be shared by more than 2 phi sectors). bool calcPhiTrkRes_; // If true, tolerance in stub phi0 (or phi65 etc.) will be reduced below AssumedPhiTrkRes if stub bend resolution specified in HTFilling.BendResolution suggests it is safe to do so. // Possible subsectors in eta within each sector. diff --git a/L1Trigger/TrackFindingTMTT/interface/Settings.h b/L1Trigger/TrackFindingTMTT/interface/Settings.h index 73613e481374c..123e3e6aa0f4b 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Settings.h +++ b/L1Trigger/TrackFindingTMTT/interface/Settings.h @@ -22,8 +22,6 @@ namespace tmtt { // Constructor for TMTT (reads config from python cfg) Settings(const edm::ParameterSet& iConfig); - ~Settings() {} - // Input tags for ES & ED data. edm::ESInputTag magneticFieldInputTag() const { return magneticFieldInputTag_; } edm::ESInputTag trackerGeometryInputTag() const { return trackerGeometryInputTag_; } diff --git a/L1Trigger/TrackFindingTMTT/interface/SimpleLR4.h b/L1Trigger/TrackFindingTMTT/interface/SimpleLR4.h index fa77536aa8e59..50c611923a911 100644 --- a/L1Trigger/TrackFindingTMTT/interface/SimpleLR4.h +++ b/L1Trigger/TrackFindingTMTT/interface/SimpleLR4.h @@ -21,13 +21,11 @@ namespace tmtt { public: SimpleLR4(const Settings* settings); - ~SimpleLR4() override{}; + ~SimpleLR4() override = default; L1fittedTrack fit(const L1track3D& l1track3D) override; protected: - bool debug_; - float phiSectorWidth_; float phiSectorCentre_; float phiNonantWidth_; @@ -51,7 +49,6 @@ namespace tmtt { float chosenRofPhi_; unsigned int minStubLayersRed_; - bool digitize_; unsigned int dividerBitsHelix_; unsigned int dividerBitsHelixZ_; unsigned int dividerBitsChi2_; @@ -61,6 +58,9 @@ namespace tmtt { unsigned int shiftingBitsPt_; unsigned int shiftingBitsz0_; unsigned int shiftingBitsLambda_; + bool digitize_; + + bool debug_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/Stub.h b/L1Trigger/TrackFindingTMTT/interface/Stub.h index a78b3ff564091..a20dfd1110bd2 100644 --- a/L1Trigger/TrackFindingTMTT/interface/Stub.h +++ b/L1Trigger/TrackFindingTMTT/interface/Stub.h @@ -69,8 +69,6 @@ namespace tmtt { const DegradeBend* degradeBend, const StubKiller* stubKiller); - ~Stub() {} - bool operator==(const Stub& stubOther) { return (this->index() == stubOther.index()); } // Return reference to original TTStub. @@ -269,8 +267,8 @@ namespace tmtt { std::array assocTPofCluster_; std::unique_ptr digitalStub_; // Class used to digitize stub if required. - bool digitizeWarningsOn_; // Enable warnings about accessing non-digitized quantities. DigiStage lastDigiStep_; + bool digitizeWarningsOn_; // Enable warnings about accessing non-digitized quantities. // Info about tracker module containing stub. const TrackerModule* trackerModule_; @@ -280,15 +278,15 @@ namespace tmtt { // These module variables are needed only to support the Hybrid stub constructor. // (Otherwise, they could be taken from trackerModule_). - bool psModule_; unsigned int layerId_; unsigned int layerIdReduced_; - bool barrel_; - bool tiltedBarrel_; float tiltAngle_; float stripPitch_; float stripLength_; unsigned int nStrips_; + bool psModule_; + bool barrel_; + bool tiltedBarrel_; const float rejectedStubBend_ = 99999.; // Bend set to this if stub rejected. diff --git a/L1Trigger/TrackFindingTMTT/interface/StubFEWindows.h b/L1Trigger/TrackFindingTMTT/interface/StubFEWindows.h index e07170e35c17b..0d586ca9a1812 100644 --- a/L1Trigger/TrackFindingTMTT/interface/StubFEWindows.h +++ b/L1Trigger/TrackFindingTMTT/interface/StubFEWindows.h @@ -14,7 +14,6 @@ namespace tmtt { class StubFEWindows { public: - StubFEWindows(){}; // Initialize stub window sizes from TTStubProducer cfg. StubFEWindows(const edm::ParameterSet& pSetStubAlgo); diff --git a/L1Trigger/TrackFindingTMTT/interface/StubKiller.h b/L1Trigger/TrackFindingTMTT/interface/StubKiller.h index 88f476df2f172..e8a95268b2252 100644 --- a/L1Trigger/TrackFindingTMTT/interface/StubKiller.h +++ b/L1Trigger/TrackFindingTMTT/interface/StubKiller.h @@ -26,8 +26,6 @@ namespace tmtt { const TrackerGeometry* trackerGeometry, const edm::Event& iEvent); - ~StubKiller() {} - // Indicate if given stub was killed by dead tracker module, based on dead module scenario. bool killStub(const TTStub* stub) const; diff --git a/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h b/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h index 4fc9e7272cb04..8a5ac807a380d 100644 --- a/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h +++ b/L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h @@ -5,6 +5,7 @@ #include "L1Trigger/TrackFindingTMTT/interface/StubFEWindows.h" #include +#include class TrackerTopology; @@ -29,13 +30,8 @@ namespace tmtt { // Configure StubWindowSuggest(const Settings* settings) : settings_(settings), ptMin_(settings->houghMinPt()) {} - ~StubWindowSuggest() {} - // Get FE window size arrays (via copy) used with stub producer, but set to zero. - void setFEWindows(const StubFEWindows* sw) { - sw_ = *sw; - sw_.setZero(); - } + void setFEWindows(const StubFEWindows* sw); // Analyse stub window required for this stub. void process(const TrackerTopology* trackerTopo, const Stub* stub); @@ -53,7 +49,7 @@ namespace tmtt { const float ptMin_; // Stub window sizes as encoded in L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h - StubFEWindows sw_; + std::unique_ptr sw_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/interface/TP.h b/L1Trigger/TrackFindingTMTT/interface/TP.h index 6820fb10f2f9f..158806f538e04 100644 --- a/L1Trigger/TrackFindingTMTT/interface/TP.h +++ b/L1Trigger/TrackFindingTMTT/interface/TP.h @@ -24,7 +24,6 @@ namespace tmtt { public: // Fill useful info about tracking particle. TP(const TrackingParticlePtr& tpPtr, unsigned int index_in_vTPs, const Settings* settings); - ~TP() {} // Return pointer to original tracking particle. const TrackingParticlePtr& trackingParticlePtr() const { return trackingParticlePtr_; } @@ -126,13 +125,13 @@ namespace tmtt { float d0_; // d0 impact parameter with respect to (x,y) = (0,0) float z0_; // z0 impact parameter with respect to (x,y) = (0,0) + std::vector assocStubs_; + unsigned int nLayersWithStubs_; // Number of tracker layers with stubs from this TP. + bool use_; // TP is worth keeping (e.g. for fake rate measurement) bool useForEff_; // TP can be used for tracking efficiency measurement. bool useForAlgEff_; // TP can be used for tracking algorithmic efficiency measurement. - std::vector assocStubs_; - unsigned int nLayersWithStubs_; // Number of tracker layers with stubs from this TP. - bool tpInJet_; float nearestJetPt_; }; diff --git a/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h b/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h index 158b1291e10ff..3ba19090af2c3 100644 --- a/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h +++ b/L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h @@ -21,7 +21,7 @@ namespace tmtt { TrackFitGeneric(const Settings* settings, const std::string& fitterName = "") : settings_(settings), fitterName_(fitterName) {} - virtual ~TrackFitGeneric() {} + virtual ~TrackFitGeneric() = default; // Fit a track candidate obtained from the Hough Transform. virtual L1fittedTrack fit(const L1track3D& l1track3D) { return L1fittedTrack(); } diff --git a/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h b/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h index 4d96f7602f3e3..682f5eeb6334a 100644 --- a/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h +++ b/L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h @@ -38,10 +38,6 @@ namespace tmtt { float etaMaxSector, float phiCentreSector); - struct SortStubsByLayer { - inline bool operator()(const Stub* stub1, const Stub* stub2) { return (stub1->layerId() < stub2->layerId()); } - }; - // Filters track candidates (found by the r-phi Hough transform), removing inconsistent stubs from the tracks, // also killing some of the tracks altogether if they are left with too few stubs. // Also adds an estimate of r-z helix parameters to the selected track objects, returning the tracks as L1track3D type. @@ -95,8 +91,8 @@ namespace tmtt { bool useSeedFilter_; // Options for Seed filter. - float seedResCut_; bool keepAllSeed_; + float seedResCut_; // Number of seed combinations considered by the Seed Filter, for each input track. std::vector numSeedCombsPerTrk_; diff --git a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc index 76b30f009196c..fa917b72eea94 100644 --- a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc +++ b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc @@ -1,12 +1,12 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h" +#include "L1Trigger/TrackFindingTMTT/interface/InputData.h" +#include "L1Trigger/TrackFindingTMTT/interface/Sector.h" +#include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h" +#include "L1Trigger/TrackFindingTMTT/interface/Make3Dtracks.h" +#include "L1Trigger/TrackFindingTMTT/interface/DupFitTrkKiller.h" +#include "L1Trigger/TrackFindingTMTT/interface/TrackFitFactory.h" +#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h" +#include "L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h" #include "L1Trigger/TrackFindingTMTT/interface/HTcell.h" #include "L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h" #include "L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h" @@ -15,7 +15,8 @@ #include "FWCore/MessageService/interface/MessageLogger.h" #include "FWCore/Framework/interface/ESHandle.h" -#include "boost/numeric/ublas/matrix.hpp" +#include + #include #include #include @@ -38,11 +39,11 @@ namespace tmtt { } TMTrackProducer::TMTrackProducer(const edm::ParameterSet& iConfig, GlobalCacheTMTT const* globalCacheTMTT) - : debug_(true), // Debug printout - settings_(iConfig), // Set configuration parameters + : settings_(iConfig), // Set configuration parameters stubWindowSuggest_(globalCacheTMTT->stubWindowSuggest()), // For tuning FE stub window sizes hists_(globalCacheTMTT->hists()), // Initialize histograms - htRphiErrMon_(globalCacheTMTT->htRphiErrMon()) // rphi HT error monitoring + htRphiErrMon_(globalCacheTMTT->htRphiErrMon()), // rphi HT error monitoring + debug_(true) // Debug printout { using namespace edm; diff --git a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h index ce2101176a221..70f9bf6df3e91 100644 --- a/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h +++ b/L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h @@ -56,8 +56,6 @@ namespace tmtt { void produce(edm::Event &, const edm::EventSetup &) override; private: - bool debug_; - // ES tokens edm::ESGetToken magneticFieldToken_; edm::ESGetToken trackerGeometryToken_; @@ -91,6 +89,8 @@ namespace tmtt { HTrphi::ErrorMonitor &htRphiErrMon_; std::map> fitterWorkerMap_; + + bool debug_; }; } // namespace tmtt diff --git a/L1Trigger/TrackFindingTMTT/src/HTcell.cc b/L1Trigger/TrackFindingTMTT/src/HTcell.cc index 6893f4597745d..fa7661ae9b2cc 100644 --- a/L1Trigger/TrackFindingTMTT/src/HTcell.cc +++ b/L1Trigger/TrackFindingTMTT/src/HTcell.cc @@ -1,4 +1,4 @@ -#include +#include "L1Trigger/TrackFindingTMTT/interface/HTcell.h" #include "L1Trigger/TrackFindingTMTT/interface/TP.h" #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" diff --git a/L1Trigger/TrackFindingTMTT/src/HTrphi.cc b/L1Trigger/TrackFindingTMTT/src/HTrphi.cc index 192403be46b8f..e341c8ae55c7f 100644 --- a/L1Trigger/TrackFindingTMTT/src/HTrphi.cc +++ b/L1Trigger/TrackFindingTMTT/src/HTrphi.cc @@ -24,10 +24,6 @@ namespace tmtt { //=== Its axes are (q/Pt, phiTrk), where phiTrk is the phi at which the track crosses a //=== user-configurable radius from the beam-line. - namespace { - std::once_flag printOnce; - } - //=== Initialise HTrphi::HTrphi(const Settings* settings, @@ -94,18 +90,18 @@ namespace tmtt { // Used to kill excess stubs or tracks that can't be transmitted within time-multiplexed period. nReceivedStubs_ = 0; busyInputSectorKill_ = settings_->busyInputSectorKill(); // Kill excess stubs going fron GP to HT? - busyInputSectorNumStubs_ = - settings_->busyInputSectorNumStubs(); // Max. num. of stubs that can be sent from GP to HT within TM period - busySectorKill_ = settings_->busySectorKill(); // Kill excess tracks flowing out of HT? - busySectorNumStubs_ = - settings_->busySectorNumStubs(); // Max. num. of stubs that can be sent out of HT within TM period - busySectorMbinRanges_ = - settings_->busySectorMbinRanges(); // or individual m bin (=q/Pt) ranges to be output to optical links. - busySectorUseMbinRanges_ = (!busySectorMbinRanges_.empty()); // m bin ranges option disabled if vector empty. - busySectorMbinOrder_ = - settings_ - ->busySectorMbinOrder(); // Specifies which m bins should be grouped together by BusySectorMbinRanges. If empty, then they are grouped in order 0,1,2,3,4,5 ... - busySectorUseMbinOrder_ = (!busySectorMbinOrder_.empty()); + busySectorKill_ = settings_->busySectorKill(); // Kill excess tracks flowing out of HT? + // Max. num. of stubs that can be sent from GP to HT within TM period + busyInputSectorNumStubs_ = settings_->busyInputSectorNumStubs(); + // Max. num. of stubs that can be sent out of HT within TM period + busySectorNumStubs_ = settings_->busySectorNumStubs(); + // or individual m bin (=q/Pt) ranges to be output to optical links. + busySectorMbinRanges_ = settings_->busySectorMbinRanges(); + // Specifies which m bins should be grouped together by BusySectorMbinRanges. If empty, then they are grouped in order 0,1,2,3,4,5 ... + busySectorMbinOrder_ = settings_->busySectorMbinOrder(); + // m bin ranges option disabled if vector empty + busySectorUseMbinRanges_ = (not busySectorMbinRanges_.empty()); + busySectorUseMbinOrder_ = (not busySectorMbinOrder_.empty()); bool rescaleMbins = false; if (busySectorUseMbinRanges_) { @@ -147,6 +143,7 @@ namespace tmtt { } std::stringstream text; + text << "\n"; text << "=== R-PHI HOUGH TRANSFORM AXES RANGES: abs(q/Pt) < " << maxAbsQoverPtAxis_ << " & abs(track-phi) < " << maxAbsPhiTrkAxis_ << " ===\n"; text << "=== R-PHI HOUGH TRANSFORM ARRAY SIZE: q/Pt bins = " << nBinsQoverPtAxis_ @@ -161,6 +158,8 @@ namespace tmtt { text << " " << (busySectorMbinHigh_[i] - busySectorMbinLow_[i] + 1); } } + text << "\n"; + static std::once_flag printOnce; std::call_once( printOnce, [](string t) { PrintL1trk() << t; }, text.str()); diff --git a/L1Trigger/TrackFindingTMTT/src/Histos.cc b/L1Trigger/TrackFindingTMTT/src/Histos.cc index ef0070f29a58b..012e79ac805e8 100644 --- a/L1Trigger/TrackFindingTMTT/src/Histos.cc +++ b/L1Trigger/TrackFindingTMTT/src/Histos.cc @@ -12,15 +12,15 @@ #include "DataFormats/Math/interface/deltaR.h" #include "FWCore/Utilities/interface/Exception.h" -#include "TH1F.h" -#include "TH2F.h" -#include "TH2Poly.h" -#include "TF1.h" -#include "TPad.h" -#include "TProfile.h" -#include "TGraphAsymmErrors.h" -#include "TGraph.h" -#include "TEfficiency.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -34,11 +34,6 @@ using namespace std; namespace tmtt { - namespace { - std::once_flag printOnce; - std::mutex myMutex[6]; - } // namespace - //=== Store cfg parameters. Histos::Histos(const Settings* settings) : settings_(settings), oldSumW2opt_(false), bApproxMistake_(false) { @@ -130,43 +125,36 @@ namespace tmtt { hisStubsVsR_ = inputDir.make("StubsVsR", "; radius (cm); No. stubs in tracker", 1200, 0., 120.); hisNumLayersPerTP_ = - inputDir.make("NumLayersPerTP", "; Number of layers per TP for alg. eff.", 50, -0.5, 49.5); + inputDir.make("NumLayersPerTP", "; Number of layers per TP for alg. eff.", 20, -0.5, 19.5); hisNumPSLayersPerTP_ = - inputDir.make("NumPSLayersPerTP", "; Number of PS layers per TP for alg. eff.", 50, -0.5, 49.5); + inputDir.make("NumPSLayersPerTP", "; Number of PS layers per TP for alg. eff.", 20, -0.5, 19.5); // Study efficiency of tightened front end-electronics cuts. hisStubKillFE_ = inputDir.make( - "StubKillFE", "; barrelLayer or 10+endcapRing; Stub fraction rejected by readout chip", 30, -0.5, 29.5); + "StubKillFE", "; barrelLayer or 10+endcapRing; Stub fraction rejected by FE chip", 30, -0.5, 29.5); hisStubIneffiVsInvPt_ = - inputDir.make("StubIneffiVsPt", "; 1/Pt; Inefficiency of readout chip for good stubs", 30, 0.0, 1.0); - hisStubIneffiVsEta_ = inputDir.make( - "StubIneffiVsEta", "; |#eta|; Inefficiency of readout chip for good stubs", 30, 0.0, 3.0); + inputDir.make("StubIneffiVsPt", "; 1/Pt; Inefficiency of FE chip for good stubs", 25, 0.0, 0.5); + hisStubIneffiVsEta_ = + inputDir.make("StubIneffiVsEta", "; |#eta|; Inefficiency of FE chip for good stubs", 15, 0.0, 3.0); // Study stub resolution. - hisBendStub_ = inputDir.make("BendStub", "; Stub bend in units of strips", 57, -7.125, 7.125); + hisBendStub_ = inputDir.make("BendStub", "; Stub bend in units of strips", 59, -7.375, 7.375); hisBendResStub_ = inputDir.make("BendResStub", "; Stub bend minus TP bend in units of strips", 100, -5., 5.); // Histos for denominator of tracking efficiency - float maxAbsQoverPt = 1. / houghMinPt_; // Max. |q/Pt| covered by HT array. - hisTPinvptForEff_ = - inputDir.make("TPinvptForEff", "; 1/Pt of TP (used for effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); - hisTPetaForEff_ = inputDir.make("TPetaForEff", "; #eta of TP (used for effi. measurement);", 20, -3., 3.); - hisTPphiForEff_ = inputDir.make("TPphiForEff", "; #phi of TP (used for effi. measurement);", 20, -M_PI, M_PI); - hisTPd0ForEff_ = inputDir.make("TPd0ForEff", "; d0 of TP (used for effi. measurement);", 40, 0., 4.); - hisTPz0ForEff_ = inputDir.make("TPz0ForEff", "; z0 of TP (used for effi. measurement);", 50, 0., 25.); + hisTPinvptForEff_ = inputDir.make("TPinvptForEff", "; TP 1/Pt (for effi.);", 50, 0., 0.5); + hisTPetaForEff_ = inputDir.make("TPetaForEff", "; TP #eta (for effi.);", 20, -3., 3.); + hisTPphiForEff_ = inputDir.make("TPphiForEff", "; TP #phi (for effi.);", 20, -M_PI, M_PI); + hisTPd0ForEff_ = inputDir.make("TPd0ForEff", "; TP d0 (for effi.);", 40, 0., 4.); + hisTPz0ForEff_ = inputDir.make("TPz0ForEff", "; TP z0 (for effi.);", 50, 0., 25.); // - hisTPinvptForAlgEff_ = inputDir.make( - "TPinvptForAlgEff", "; 1/Pt of TP (used for alg. effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); - hisTPetaForAlgEff_ = - inputDir.make("TPetaForAlgEff", "; #eta of TP (used for alg. effi. measurement);", 20, -3., 3.); - hisTPphiForAlgEff_ = - inputDir.make("TPphiForAlgEff", "; #phi of TP (used for alg. effi. measurement);", 20, -M_PI, M_PI); - hisTPd0ForAlgEff_ = - inputDir.make("TPd0ForAlgEff", "; d0 of TP (used for alg. effi. measurement);", 40, 0., 4.); - hisTPz0ForAlgEff_ = - inputDir.make("TPz0ForAlgEff", "; z0 of TP (used for alg. effi. measurement);", 50, 0., 25.); + hisTPinvptForAlgEff_ = inputDir.make("TPinvptForAlgEff", "; TP 1/Pt (for alg. effi.);", 50, 0., 0.5); + hisTPetaForAlgEff_ = inputDir.make("TPetaForAlgEff", "; TP #eta (for alg. effi.);", 20, -3., 3.); + hisTPphiForAlgEff_ = inputDir.make("TPphiForAlgEff", "; TP #phi (for alg. effi.);", 20, -M_PI, M_PI); + hisTPd0ForAlgEff_ = inputDir.make("TPd0ForAlgEff", "; TP d0 (for alg. effi.);", 40, 0., 4.); + hisTPz0ForAlgEff_ = inputDir.make("TPz0ForAlgEff", "; TP z0 (for alg. effi.);", 50, 0., 25.); return inputDir; } @@ -175,7 +163,8 @@ namespace tmtt { void Histos::fillInputData(const InputData& inputData) { // Allow only one thread to run this function at a time - std::lock_guard myGuard(myMutex[0]); + static std::mutex myMutex; + std::lock_guard myGuard(myMutex); const list& vStubs = inputData.stubsConst(); const list& vTPs = inputData.getTPs(); @@ -382,12 +371,12 @@ namespace tmtt { // Check if stubs excessively duplicated between overlapping sectors. hisNumEtaSecsPerStub_ = - inputDir.make("NumEtaSecPerStub", "; Number of #eta sectors each stub appears in", 20, -0.5, 19.5); + inputDir.make("NumEtaSecPerStub", "; No. of #eta sectors each stub in", 20, -0.5, 19.5); hisNumPhiSecsPerStub_ = - inputDir.make("NumPhiSecPerStub", "; Number of #phi sectors each stub appears in", 20, -0.5, 19.5); + inputDir.make("NumPhiSecPerStub", "; No. of #phi sectors each stub in", 20, -0.5, 19.5); // Count stubs per (eta,phi) sector. - hisNumStubsPerSec_ = inputDir.make("NumStubsPerSec", "; Number of stubs per sector", 250, -0.5, 249.5); + hisNumStubsPerSec_ = inputDir.make("NumStubsPerSec", "; No. of stubs per sector", 150, -0.5, 299.5); return inputDir; } @@ -396,7 +385,8 @@ namespace tmtt { void Histos::fillEtaPhiSectors(const InputData& inputData, const matrix>& mSectors) { // Allow only one thread to run this function at a time - std::lock_guard myGuard(myMutex[1]); + static std::mutex myMutex; + std::lock_guard myGuard(myMutex); const list& vStubs = inputData.stubsConst(); //const list& vTPs = inputData.getTPs(); @@ -455,8 +445,9 @@ namespace tmtt { void Histos::fillRphiHT(const matrix>& mHtRphis) { //--- Loop over (eta,phi) sectors, counting the number of stubs in the HT array of each. - // Allow only one thread to run this function at a time - std::lock_guard myGuard(myMutex[2]); + // Allow only one thread to run this function at a time (UNCOMMENT IF YOU ADD HISTOS HERE) + //static std::mutex myMutex; + //std::lock_guard myGuard(myMutex); } //=== Book histograms about r-z track filters (or other filters applied after r-phi HT array). @@ -470,8 +461,9 @@ namespace tmtt { //=== Fill histograms about r-z track filters. void Histos::fillRZfilters(const matrix>& mMake3Dtrks) { - // Allow only one thread to run this function at a time - std::lock_guard myGuard(myMutex[3]); + // Allow only one thread to run this function at a time (UNCOMMENT IF YOU ADD HISTOS HERE) + //static std::mutex myMutex; + //std::lock_guard myGuard(myMutex); } //=== Book histograms studying track candidates found by Hough Transform. @@ -496,11 +488,11 @@ namespace tmtt { profNumTrackCands_[tName]->GetXaxis()->SetBinLabel(1, "reco tracks including fakes"); profNumTrackCands_[tName]->LabelsOption("d"); + hisNumTrksPerNon_[tName] = inputDir.make(addn("NumTrksPerNon"), "; No. tracks per nonant;", 100, -0.5, 399.5); + unsigned int nEta = numEtaRegions_; - float maxAbsQoverPt = 1. / houghMinPt_; // Max. |q/Pt| covered by HT array. - hisNumTracksVsQoverPt_[tName] = inputDir.make( - addn("NumTracksVsQoverPt"), "; Q/Pt; No. of tracks in tracker", 100, -maxAbsQoverPt, maxAbsQoverPt); - hisNumTrksPerNon_[tName] = inputDir.make(addn("NumTrksPerNon"), "; No. tracks per nonant;", 200, -0.5, 199.5); + hisNumTracksVsQoverPt_[tName] = + inputDir.make(addn("NumTracksVsQoverPt"), "; Q/Pt; No. of tracks in tracker", 100, -0.5, 0.5); if (TMTT) { profNumTracksVsEta_[tName] = inputDir.make( addn("NumTracksVsEta"), "; #eta region; No. of tracks in tracker", nEta, -0.5, nEta - 0.5); @@ -511,7 +503,7 @@ namespace tmtt { profStubsOnTracks_[tName] = inputDir.make(addn("StubsOnTracks"), "; ; No. of stubs on tracks per event", 1, 0.5, 1.5); hisStubsOnTracksPerNon_[tName] = - inputDir.make(addn("StubsOnTracksPerNon"), "; No. of stubs on tracks per nonant", 1000, -0.5, 999.5); + inputDir.make(addn("StubsOnTracksPerNon"), "; No. of stubs on tracks per nonant", 100, -0.5, 4999.5); hisStubsPerTrack_[tName] = inputDir.make(addn("StubsPerTrack"), ";No. of stubs per track;", 50, -0.5, 49.5); hisLayersPerTrack_[tName] = @@ -519,26 +511,26 @@ namespace tmtt { if (TMTT) { hisNumStubsPerLink_[tName] = - inputDir.make(addn("NumStubsPerLink"), "; Mean #stubs per MHT output opto-link;", 50, -0.5, 199.5); + inputDir.make(addn("NumStubsPerLink"), "; Mean #stubs per MHT output opto-link;", 50, -0.5, 249.5); profMeanStubsPerLink_[tName] = inputDir.make(addn("MeanStubsPerLink"), "; Mean #stubs per MHT output opto-link;", 36, -0.5, 35.5); } hisFracMatchStubsOnTracks_[tName] = inputDir.make( - addn("FracMatchStubsOnTracks"), "; Fraction of stubs on tracks matching best TP;", 101, -0.005, 1.005); + addn("FracMatchStubsOnTracks"), "; Frac. of stubs per trk matching best TP;", 101, -0.005, 1.005); if (TMTT) { - // Study duplication of tracks within HT. - profDupTracksVsEta_[tName] = inputDir.make( - addn("DupTracksVsTPeta"), "; #eta; No. of duplicate tracks per TP in individual HT array;", 15, 0.0, 3.0); - profDupTracksVsInvPt_[tName] = inputDir.make( - addn("DupTracksVsInvPt"), "; 1/Pt; No. of duplicate tracks per TP", 16, 0., maxAbsQoverPt); + // Study duplication of tracks within an individual HT array. + profDupTracksVsEta_[tName] = + inputDir.make(addn("DupTracksVsTPeta"), "; #eta; No. of dup. trks per TP;", 15, 0.0, 3.0); + profDupTracksVsInvPt_[tName] = + inputDir.make(addn("DupTracksVsInvPt"), "; 1/Pt; No. of dup. trks per TP", 25, 0., 0.5); } // Histos of track params. hisQoverPt_[tName] = inputDir.make(addn("QoverPt"), "; track q/Pt", 100, -0.5, 0.5); hisPhi0_[tName] = inputDir.make(addn("Phi0"), "; track #phi0", 70, -3.5, 3.5); - hisEta_[tName] = inputDir.make(addn("Eta"), "; track #eta", 70, -3.5, 3.5); + hisEta_[tName] = inputDir.make(addn("Eta"), "; track #eta", 60, -3.0, 3.0); hisZ0_[tName] = inputDir.make(addn("Z0"), "; track z0", 100, -25.0, 25.0); // Histos of track parameter resolution @@ -548,47 +540,44 @@ namespace tmtt { hisZ0Res_[tName] = inputDir.make(addn("Z0Res"), "; track resolution in z0", 100, -10.0, 10.0); // Histos for tracking efficiency vs. TP kinematics - hisRecoTPinvptForEff_[tName] = inputDir.make( - addn("RecoTPinvptForEff"), "; 1/Pt of TP (used for effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); + hisRecoTPinvptForEff_[tName] = + inputDir.make(addn("RecoTPinvptForEff"), "; TP 1/Pt of recoed tracks (for effi.);", 50, 0., 0.5); hisRecoTPetaForEff_[tName] = - inputDir.make(addn("RecoTPetaForEff"), "; #eta of TP (used for effi. measurement);", 20, -3., 3.); + inputDir.make(addn("RecoTPetaForEff"), "; TP #eta of recoed tracks (for effi.);", 20, -3., 3.); hisRecoTPphiForEff_[tName] = - inputDir.make(addn("RecoTPphiForEff"), "; #phi of TP (used for effi. measurement);", 20, -M_PI, M_PI); + inputDir.make(addn("RecoTPphiForEff"), "; TP #phi of recoed tracks (for effi.);", 20, -M_PI, M_PI); // Histo for efficiency to reconstruct track perfectly (no incorrect hits). hisPerfRecoTPinvptForEff_[tName] = inputDir.make( - addn("PerfRecoTPinvptForEff"), "; 1/Pt of TP (used for perf. effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); - hisPerfRecoTPetaForEff_[tName] = inputDir.make( - addn("PerfRecoTPetaForEff"), "; #eta of TP (used for perf. effi. measurement);", 20, -3., 3.); + addn("PerfRecoTPinvptForEff"), "; TP 1/Pt of recoed tracks (for perf. effi.);", 50, 0., 0.5); + hisPerfRecoTPetaForEff_[tName] = + inputDir.make(addn("PerfRecoTPetaForEff"), "; TP #eta of recoed tracks (for perf. effi.);", 20, -3., 3.); // Histos for tracking efficiency vs. TP production point hisRecoTPd0ForEff_[tName] = - inputDir.make(addn("RecoTPd0ForEff"), "; d0 of TP (used for effi. measurement);", 40, 0., 4.); + inputDir.make(addn("RecoTPd0ForEff"), "; TP d0 of recoed tracks (for effi.);", 40, 0., 4.); hisRecoTPz0ForEff_[tName] = - inputDir.make(addn("RecoTPz0ForEff"), "; z0 of TP (used for effi. measurement);", 50, 0., 25.); + inputDir.make(addn("RecoTPz0ForEff"), "; TP z0 of recoed tracks (for effi.);", 50, 0., 25.); // Histos for algorithmic tracking efficiency vs. TP kinematics - hisRecoTPinvptForAlgEff_[tName] = inputDir.make( - addn("RecoTPinvptForAlgEff"), "; 1/Pt of TP (used for alg. effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); + hisRecoTPinvptForAlgEff_[tName] = + inputDir.make(addn("RecoTPinvptForAlgEff"), "; TP 1/Pt of recoed tracks (for alg. effi.);", 50, 0., 0.5); hisRecoTPetaForAlgEff_[tName] = - inputDir.make(addn("RecoTPetaForAlgEff"), "; #eta of TP (used for alg. effi. measurement);", 20, -3., 3.); + inputDir.make(addn("RecoTPetaForAlgEff"), "; TP #eta of recoed tracks (for alg. effi.);", 20, -3., 3.); hisRecoTPphiForAlgEff_[tName] = inputDir.make( - addn("RecoTPphiForAlgEff"), "; #phi of TP (used for alg. effi. measurement);", 20, -M_PI, M_PI); + addn("RecoTPphiForAlgEff"), "; TP #phi of recoed tracks (for alg. effi.);", 20, -M_PI, M_PI); // Histo for efficiency to reconstruct track perfectly (no incorrect hits). - hisPerfRecoTPinvptForAlgEff_[tName] = inputDir.make(addn("PerfRecoTPinvptForAlgEff"), - "; 1/Pt of TP (used for perf. alg. effi. measurement);", - 24, - 0., - 1.5 * maxAbsQoverPt); - hisPerfRecoTPetaForAlgEff_[tName] = inputDir.make( - addn("PerfRecoTPetaForAlgEff"), "; #eta of TP (used for perf. alg. effi. measurement);", 20, -3., 3.); + hisPerfRecoTPinvptForAlgEff_[tName] = inputDir.make( + addn("PerfRecoTPinvptForAlgEff"), "; TP 1/Pt of recoed tracks (for perf. alg. effi.);", 50, 0., 0.5); + hisPerfRecoTPetaForAlgEff_[tName] = + inputDir.make(addn("PerfRecoTPetaForAlgEff"), "; TP #eta (for perf. alg. effi.);", 20, -3., 3.); // Histos for algorithmic tracking efficiency vs. TP production point hisRecoTPd0ForAlgEff_[tName] = - inputDir.make(addn("RecoTPd0ForAlgEff"), "; d0 of TP (used for alg. effi. measurement);", 40, 0., 4.); + inputDir.make(addn("RecoTPd0ForAlgEff"), "; TP d0 of recoed tracks (for alg. effi.);", 40, 0., 4.); hisRecoTPz0ForAlgEff_[tName] = - inputDir.make(addn("RecoTPz0ForAlgEff"), "; z0 of TP (used for alg. effi. measurement);", 50, 0., 25.); + inputDir.make(addn("RecoTPz0ForAlgEff"), "; TP z0 of recoed tracks (for alg. effi.);", 50, 0., 25.); return inputDir; } @@ -599,7 +588,8 @@ namespace tmtt { const matrix>& mMake3Dtrks, const string& tName) { // Allow only one thread to run this function at a time - std::lock_guard myGuard(myMutex[4]); + static std::mutex myMutex; + std::lock_guard myGuard(myMutex); vector tracks; bool withRZfilter = (tName == "RZ") ? true : false; @@ -683,6 +673,7 @@ namespace tmtt { } else { std::stringstream text; text << "\n ===== HISTOS MESS UP: Increase size of nLinks ===== " << link << "\n"; + static std::once_flag printOnce; std::call_once( printOnce, [](string t) { edm::LogWarning("L1track") << t; }, text.str()); } @@ -701,12 +692,13 @@ namespace tmtt { for (const L1track3D& trk : tracks) { hisNumTracksVsQoverPt_[tName]->Fill(trk.qOverPt()); // Plot reconstructed q/Pt of track cands. hisStubsPerTrack_[tName]->Fill(trk.numStubs()); // Stubs per track. + hisLayersPerTrack_[tName]->Fill(trk.numLayers()); } // Count fraction of stubs on each track matched to a TP that are from same TP. for (const L1track3D& trk : tracks) { - // Only consider tracks that match a tracking particle used for the alg. efficiency measurement. + // Only consider tracks that match a tracking particle for the alg. efficiency measurement. const TP* tp = trk.matchedTP(); if (tp != nullptr) { if (tp->useForAlgEff()) { @@ -718,9 +710,8 @@ namespace tmtt { // Count total number of tracking particles in the event that were reconstructed, // counting also how many of them were reconstructed multiple times (duplicate tracks). - unsigned int nRecoedTPsForEff = - 0; // Total no. of TPs used for the efficiency measurement that were reconstructed as at least one track. - unsigned int nRecoedTPs = 0; // Total no. of TPs that were reconstructed as at least one track. + unsigned int nRecoedTPsForEff = 0; // Total no. of TPs for effi measurement recoed as >= 1 track. + unsigned int nRecoedTPs = 0; // Total no. of TPs recoed as >= 1 one track. unsigned int nEtaSecsMatchingTPs = 0; // Total no. of eta sectors that all TPs were reconstructed in unsigned int nSecsMatchingTPs = 0; // Total no. of eta x phi sectors that all TPs were reconstructed in unsigned int nTrksMatchingTPs = 0; // Total no. of tracks that all TPs were reconstructed as @@ -779,7 +770,7 @@ namespace tmtt { //--- Plot mean number of tracks/event, counting number due to different kinds of duplicates - // Plot number of TPs used for the efficiency measurement that are reconstructed. + // Plot number of TPs for the efficiency measurement that are reconstructed. profNumTrackCands_[tName]->Fill(7.0, nRecoedTPsForEff); // Plot number of TPs that are reconstructed. profNumTrackCands_[tName]->Fill(6.0, nRecoedTPs); @@ -873,9 +864,6 @@ namespace tmtt { //=== Book histograms for studying track fitting. map Histos::bookTrackFitting() { - const float maxEta = settings_->maxStubEta(); - const float maxAbsQoverPt = 1. / houghMinPt_; // Max. |q/Pt| covered by HT array. - map inputDirMap; for (const string& fitName : trackFitters_) { @@ -925,28 +913,25 @@ namespace tmtt { hisFitEtaUnmatched_[fitName] = inputDir.make(addn("FitEtaUnmatched"), "Fitted #eta for unmatched tracks", 70, -3.5, 3.5); - const unsigned int nBinsChi2 = 29; - const float chi2dofBins[nBinsChi2 + 1] = {0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, - 2.0, 2.4, 2.8, 3.2, 3.6, 4.0, 4.5, 5.0, 6.0, 7.0, - 8.0, 9.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 25.0, 30.0}; + const unsigned int nBinsChi2 = 39; + const float chi2dofBins[nBinsChi2 + 1] = {0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, + 2.0, 2.4, 2.8, 3.2, 3.6, 4.0, 4.5, 5.0, 6.0, 7.0, + 8.0, 9.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 25.0, 30.0, + 40.0, 50.0, 75.0, 100.0, 150.0, 200.0, 250.0, 350.0, 500.0, 1000.0}; - hisFitChi2DofMatched_[fitName] = - inputDir.make(addn("FitChi2DofMatched"), ";#chi^{2}/DOF;", nBinsChi2, chi2dofBins); hisFitChi2DofRphiMatched_[fitName] = inputDir.make(addn("FitChi2DofRphiMatched"), ";#chi^{2}rphi;", nBinsChi2, chi2dofBins); hisFitChi2DofRzMatched_[fitName] = inputDir.make(addn("FitChi2DofRzMatched"), ";#chi^{2}rz/DOF;", nBinsChi2, chi2dofBins); - profFitChi2DofVsInvPtMatched_[fitName] = inputDir.make( - addn("FitChi2DofVsInvPtMatched"), "; 1/p_{T}; Fit #chi^{2}/dof", 25, 0., maxAbsQoverPt); + profFitChi2DofRphiVsInvPtMatched_[fitName] = + inputDir.make(addn("FitChi2DofRphiVsInvPtMatched"), "; 1/p_{T}; Fit #chi^{2}rphi/dof", 25, 0., 0.5); - hisFitChi2DofUnmatched_[fitName] = - inputDir.make(addn("FitChi2DofUnmatched"), ";#chi^{2}/DOF;", nBinsChi2, chi2dofBins); hisFitChi2DofRphiUnmatched_[fitName] = inputDir.make(addn("FitChi2DofRphiUnmatched"), ";#chi^{2}rphi/DOF;", nBinsChi2, chi2dofBins); hisFitChi2DofRzUnmatched_[fitName] = inputDir.make(addn("FitChi2DofRzUnmatched"), ";#chi^{2}rz/DOF;", nBinsChi2, chi2dofBins); - profFitChi2DofVsInvPtUnmatched_[fitName] = inputDir.make( - addn("FitChi2DofVsInvPtUnmatched"), "; 1/p_{T}; Fit #chi2/dof", 25, 0., maxAbsQoverPt); + profFitChi2DofRphiVsInvPtUnmatched_[fitName] = inputDir.make( + addn("FitChi2DofRphiVsInvPtUnmatched"), "; 1/p_{T}; Fit #chi^{2}rphi/dof", 25, 0., 0.5); // Monitoring specific track fit algorithms. if (fitName.find("KF") != string::npos) { @@ -970,76 +955,72 @@ namespace tmtt { // Plots of helix param resolution. hisQoverPtResVsTrueEta_[fitName] = inputDir.make( - addn("QoverPtResVsTrueEta"), "q/p_{T} resolution; |#eta|; q/p_{T} resolution", 24, 0.0, maxEta); + addn("QoverPtResVsTrueEta"), "q/p_{T} resolution; |#eta|; q/p_{T} resolution", 30, 0.0, 3.0); hisPhi0ResVsTrueEta_[fitName] = inputDir.make( - addn("PhiResVsTrueEta"), "#phi_{0} resolution; |#eta|; #phi_{0} resolution", 24, 0.0, maxEta); + addn("PhiResVsTrueEta"), "#phi_{0} resolution; |#eta|; #phi_{0} resolution", 30, 0.0, 3.0); hisEtaResVsTrueEta_[fitName] = - inputDir.make(addn("EtaResVsTrueEta"), "#eta resolution; |#eta|; #eta resolution", 24, 0.0, maxEta); - hisZ0ResVsTrueEta_[fitName] = inputDir.make( - addn("Z0ResVsTrueEta"), "z_{0} resolution; |#eta|; z_{0} resolution", 24, 0.0, maxEta); - hisD0ResVsTrueEta_[fitName] = inputDir.make( - addn("D0ResVsTrueEta"), "d_{0} resolution; |#eta|; d_{0} resolution", 24, 0.0, maxEta); + inputDir.make(addn("EtaResVsTrueEta"), "#eta resolution; |#eta|; #eta resolution", 30, 0.0, 3.0); + hisZ0ResVsTrueEta_[fitName] = + inputDir.make(addn("Z0ResVsTrueEta"), "z_{0} resolution; |#eta|; z_{0} resolution", 30, 0.0, 3.0); + hisD0ResVsTrueEta_[fitName] = + inputDir.make(addn("D0ResVsTrueEta"), "d_{0} resolution; |#eta|; d_{0} resolution", 30, 0.0, 3.0); hisQoverPtResVsTrueInvPt_[fitName] = inputDir.make( - addn("QoverPtResVsTrueInvPt"), "q/p_{T} resolution; 1/p_{T}; q/p_{T} resolution", 25, 0.0, maxAbsQoverPt); + addn("QoverPtResVsTrueInvPt"), "q/p_{T} resolution; 1/p_{T}; q/p_{T} resolution", 25, 0.0, 0.5); hisPhi0ResVsTrueInvPt_[fitName] = inputDir.make( - addn("PhiResVsTrueInvPt"), "#phi_{0} resolution; 1/p_{T}; #phi_{0} resolution", 25, 0.0, maxAbsQoverPt); - hisEtaResVsTrueInvPt_[fitName] = inputDir.make( - addn("EtaResVsTrueInvPt"), "#eta resolution; 1/p_{T}; #eta resolution", 25, 0.0, maxAbsQoverPt); + addn("PhiResVsTrueInvPt"), "#phi_{0} resolution; 1/p_{T}; #phi_{0} resolution", 25, 0.0, 0.5); + hisEtaResVsTrueInvPt_[fitName] = + inputDir.make(addn("EtaResVsTrueInvPt"), "#eta resolution; 1/p_{T}; #eta resolution", 25, 0.0, 0.5); hisZ0ResVsTrueInvPt_[fitName] = inputDir.make( - addn("Z0ResVsTrueInvPt"), "z_{0} resolution; 1/p_{T}; z_{0} resolution", 25, 0.0, maxAbsQoverPt); + addn("Z0ResVsTrueInvPt"), "z_{0} resolution; 1/p_{T}; z_{0} resolution", 25, 0.0, 0.5); hisD0ResVsTrueInvPt_[fitName] = inputDir.make( - addn("D0ResVsTrueInvPt"), "d_{0} resolution; 1/p_{T}; d_{0} resolution", 25, 0.0, maxAbsQoverPt); + addn("D0ResVsTrueInvPt"), "d_{0} resolution; 1/p_{T}; d_{0} resolution", 25, 0.0, 0.5); // Duplicate track histos. profDupFitTrksVsEta_[fitName] = inputDir.make(addn("DupFitTrksVsEta"), "; #eta; No. of duplicate tracks per TP", 12, 0., 3.); - profDupFitTrksVsInvPt_[fitName] = inputDir.make( - addn("DupFitTrksVsInvPt"), "; 1/Pt; No. of duplicate tracks per TP", houghNbinsPt_, 0., maxAbsQoverPt); + profDupFitTrksVsInvPt_[fitName] = + inputDir.make(addn("DupFitTrksVsInvPt"), "; 1/Pt; No. of duplicate tracks per TP", 25, 0., 0.5); // Histos for tracking efficiency vs. TP kinematics. (Binning must match similar histos in bookTrackCands()). - hisFitTPinvptForEff_[fitName] = inputDir.make( - addn("FitTPinvptForEff"), "; 1/Pt of TP (used for effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); + hisFitTPinvptForEff_[fitName] = + inputDir.make(addn("FitTPinvptForEff"), "; TP 1/Pt of fitted tracks (for effi.);", 50, 0., 0.5); hisFitTPetaForEff_[fitName] = - inputDir.make(addn("FitTPetaForEff"), "; #eta of TP (used for effi. measurement);", 20, -3., 3.); + inputDir.make(addn("FitTPetaForEff"), "; TP #eta of fitted tracks (for effi.);", 20, -3., 3.); hisFitTPphiForEff_[fitName] = - inputDir.make(addn("FitTPphiForEff"), "; #phi of TP (used for effi. measurement);", 20, -M_PI, M_PI); + inputDir.make(addn("FitTPphiForEff"), "; TP #phi of fitted tracks (for effi.);", 20, -M_PI, M_PI); // Histo for efficiency to reconstruct track perfectly (no incorrect hits). (Binning must match similar histos in bookTrackCands()). hisPerfFitTPinvptForEff_[fitName] = inputDir.make( - addn("PerfFitTPinvptForEff"), "; 1/Pt of TP (used for perf. effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); + addn("PerfFitTPinvptForEff"), "; TP 1/Pt of fitted tracks (for perf. effi.);", 50, 0., 0.5); hisPerfFitTPetaForEff_[fitName] = inputDir.make( - addn("PerfFitTPetaForEff"), "; #eta of TP (used for perfect effi. measurement);", 20, -3., 3.); + addn("PerfFitTPetaForEff"), "; TP #eta of fitted tracks (for perfect effi.);", 20, -3., 3.); // Histos for tracking efficiency vs. TP production point. (Binning must match similar histos in bookTrackCands()). hisFitTPd0ForEff_[fitName] = - inputDir.make(addn("FitTPd0ForEff"), "; d0 of TP (used for effi. measurement);", 40, 0., 4.); + inputDir.make(addn("FitTPd0ForEff"), "; TP d0 of fitted tracks (for effi.);", 40, 0., 4.); hisFitTPz0ForEff_[fitName] = - inputDir.make(addn("FitTPz0ForEff"), "; z0 of TP (used for effi. measurement);", 50, 0., 25.); + inputDir.make(addn("FitTPz0ForEff"), "; TP z0 of fitted tracks (for effi.);", 50, 0., 25.); // Histos for algorithmic tracking efficiency vs. TP kinematics. (Binning must match similar histos in bookTrackCands()). - hisFitTPinvptForAlgEff_[fitName] = inputDir.make( - addn("FitTPinvptForAlgEff"), "; 1/Pt of TP (used for alg. effi. measurement);", 24, 0., 1.5 * maxAbsQoverPt); - hisFitTPetaForAlgEff_[fitName] = inputDir.make( - addn("FitTPetaForAlgEff"), "; #eta of TP (used for alg. effi. measurement);", 20, -3., 3.); + hisFitTPinvptForAlgEff_[fitName] = + inputDir.make(addn("FitTPinvptForAlgEff"), "; TP 1/Pt of fitted tracks (for alg. effi.);", 50, 0., 0.5); + hisFitTPetaForAlgEff_[fitName] = + inputDir.make(addn("FitTPetaForAlgEff"), "; TP #eta of fitted tracks (for alg. effi.);", 20, -3., 3.); hisFitTPphiForAlgEff_[fitName] = inputDir.make( - addn("FitTPphiForAlgEff"), "; #phi of TP (used for alg. effi. measurement);", 20, -M_PI, M_PI); + addn("FitTPphiForAlgEff"), "; TP #phi of fitted tracks (for alg. effi.);", 20, -M_PI, M_PI); // Histo for efficiency to reconstruct track perfectly (no incorrect hits). (Binning must match similar histos in bookTrackCands()). - hisPerfFitTPinvptForAlgEff_[fitName] = - inputDir.make(addn("PerfFitTPinvptForAlgEff"), - "; 1/Pt of TP (used for perf. alg. effi. measurement);", - 24, - 0., - 1.5 * maxAbsQoverPt); - hisPerfFitTPetaForAlgEff_[fitName] = inputDir.make( - addn("PerfFitTPetaForAlgEff"), "; #eta of TP (used for perf. alg. effi. measurement);", 20, -3., 3.); + hisPerfFitTPinvptForAlgEff_[fitName] = inputDir.make( + addn("PerfFitTPinvptForAlgEff"), "; TP 1/Pt of fitted tracks (for perf. alg. effi.);", 50, 0., 0.5); + hisPerfFitTPetaForAlgEff_[fitName] = + inputDir.make(addn("PerfFitTPetaForAlgEff"), "; TP #eta (for perf. alg. effi.);", 20, -3., 3.); // Histos for algorithmic tracking efficiency vs. TP production point. (Binning must match similar histos in bookTrackCands()). hisFitTPd0ForAlgEff_[fitName] = - inputDir.make(addn("FitTPd0ForAlgEff"), "; d0 of TP (used for alg. effi. measurement);", 40, 0., 4.); + inputDir.make(addn("FitTPd0ForAlgEff"), "; TP d0 of fitted tracks (for alg. effi.);", 40, 0., 4.); hisFitTPz0ForAlgEff_[fitName] = - inputDir.make(addn("FitTPz0ForAlgEff"), "; z0 of TP (used for alg. effi. measurement);", 50, 0., 25.); + inputDir.make(addn("FitTPz0ForAlgEff"), "; TP z0 of fitted tracks (for alg. effi.);", 50, 0., 25.); } return inputDirMap; } @@ -1049,7 +1030,8 @@ namespace tmtt { void Histos::fillTrackFitting(const InputData& inputData, const map>& mapFinalTracks) { // Allow only one thread to run this function at a time - std::lock_guard myGuard(myMutex[5]); + static std::mutex myMutex; + std::lock_guard myGuard(myMutex); const list& vTPs = inputData.getTPs(); @@ -1066,6 +1048,7 @@ namespace tmtt { for (const L1fittedTrack* fitTrk : fittedTracks) { nFitTracks++; + // Get matched truth particle, if any. const TP* tp = fitTrk->matchedTP(); if (tp != nullptr) @@ -1153,19 +1136,22 @@ namespace tmtt { hisFitZ0Matched_[fitName]->Fill(fitTrk->z0()); hisFitEtaMatched_[fitName]->Fill(fitTrk->eta()); - hisFitChi2DofMatched_[fitName]->Fill(fitTrk->chi2dof()); - hisFitChi2DofRphiMatched_[fitName]->Fill(fitTrk->chi2rphi() / fitTrk->numDOFrphi()); - hisFitChi2DofRzMatched_[fitName]->Fill(fitTrk->chi2rz() / fitTrk->numDOFrz()); - profFitChi2DofVsInvPtMatched_[fitName]->Fill(std::abs(fitTrk->qOverPt()), fitTrk->chi2dof()); - - if (fitName.find("KF") != string::npos) { - // No. of skipped layers on track during Kalman track fit. - if (nSkippedLayers == 0) { - hisKalmanChi2DofSkipLay0Matched_[fitName]->Fill(fitTrk->chi2dof()); - } else if (nSkippedLayers == 1) { - hisKalmanChi2DofSkipLay1Matched_[fitName]->Fill(fitTrk->chi2dof()); - } else if (nSkippedLayers >= 2) { - hisKalmanChi2DofSkipLay2Matched_[fitName]->Fill(fitTrk->chi2dof()); + // Only plot matched chi2 for tracks with no incorrect stubs. + if (fitTrk->purity() == 1.) { + hisFitChi2DofRphiMatched_[fitName]->Fill(fitTrk->chi2rphi() / fitTrk->numDOFrphi()); + hisFitChi2DofRzMatched_[fitName]->Fill(fitTrk->chi2rz() / fitTrk->numDOFrz()); + profFitChi2DofRphiVsInvPtMatched_[fitName]->Fill(std::abs(fitTrk->qOverPt()), + (fitTrk->chi2rphi() / fitTrk->numDOFrphi())); + + if (fitName.find("KF") != string::npos) { + // No. of skipped layers on track during Kalman track fit. + if (nSkippedLayers == 0) { + hisKalmanChi2DofSkipLay0Matched_[fitName]->Fill(fitTrk->chi2dof()); + } else if (nSkippedLayers == 1) { + hisKalmanChi2DofSkipLay1Matched_[fitName]->Fill(fitTrk->chi2dof()); + } else if (nSkippedLayers >= 2) { + hisKalmanChi2DofSkipLay2Matched_[fitName]->Fill(fitTrk->chi2dof()); + } } } @@ -1176,10 +1162,10 @@ namespace tmtt { hisFitZ0Unmatched_[fitName]->Fill(fitTrk->z0()); hisFitEtaUnmatched_[fitName]->Fill(fitTrk->eta()); - hisFitChi2DofUnmatched_[fitName]->Fill(fitTrk->chi2dof()); hisFitChi2DofRphiUnmatched_[fitName]->Fill(fitTrk->chi2rphi() / fitTrk->numDOFrphi()); hisFitChi2DofRzUnmatched_[fitName]->Fill(fitTrk->chi2rz() / fitTrk->numDOFrz()); - profFitChi2DofVsInvPtUnmatched_[fitName]->Fill(std::abs(fitTrk->qOverPt()), fitTrk->chi2dof()); + profFitChi2DofRphiVsInvPtUnmatched_[fitName]->Fill(std::abs(fitTrk->qOverPt()), + (fitTrk->chi2rphi() / fitTrk->numDOFrphi())); if (fitName.find("KF") != string::npos) { // No. of skipped layers on track during Kalman track fit. diff --git a/L1Trigger/TrackFindingTMTT/src/KalmanState.cc b/L1Trigger/TrackFindingTMTT/src/KalmanState.cc index 7aa9d42af6cc0..b44fe190b5d42 100644 --- a/L1Trigger/TrackFindingTMTT/src/KalmanState.cc +++ b/L1Trigger/TrackFindingTMTT/src/KalmanState.cc @@ -6,17 +6,6 @@ using namespace std; namespace tmtt { - KalmanState::KalmanState() - : settings_(nullptr), - kLayer_(0), - last_state_(nullptr), - stub_(nullptr), - chi2rphi_(0), - chi2rz_(0), - barrel_(true), - nSkipped_(0), - hitPattern_(0) {} - KalmanState::KalmanState(const Settings *settings, const L1track3D &candidate, unsigned nSkipped, @@ -66,47 +55,6 @@ namespace tmtt { n_stubs_ = 1 + kLayer_ - nSkipped_; } - KalmanState::KalmanState(const KalmanState &p) - : settings_(p.settings()), - kLayer_(p.layer()), - r_(p.r()), - z_(p.z()), - last_state_(p.last_state()), - vecX_(p.vectorX()), - matC_(p.matrixC()), - matK_(p.matrixK()), - matV_(p.matrixV()), - stub_(p.stub()), - chi2rphi_(p.chi2rphi()), - chi2rz_(p.chi2rz()), - n_stubs_(p.nStubLayers()), - barrel_(p.barrel()), - nSkipped_(p.nSkippedLayers()), - l1track3D_(p.candidate()) {} - - KalmanState &KalmanState::operator=(const KalmanState &other) { - if (&other == this) - return *this; - - settings_ = other.settings(); - kLayer_ = other.layer(); - r_ = other.r(); - z_ = other.z(); - last_state_ = other.last_state(); - vecX_ = other.vectorX(); - matC_ = other.matrixC(); - matK_ = other.matrixK(); - matV_ = other.matrixV(); - stub_ = other.stub(); - chi2rphi_ = other.chi2rphi(); - chi2rz_ = other.chi2rz(); - n_stubs_ = other.nStubLayers(); - barrel_ = other.barrel(); - nSkipped_ = other.nSkippedLayers(); - l1track3D_ = other.candidate(); - return *this; - } - bool KalmanState::good(const TP *tp) const { const KalmanState *state = this; while (state) { diff --git a/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc b/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc index 77dc7146eb7b0..4e627d3ab9468 100644 --- a/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc +++ b/L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc @@ -14,10 +14,6 @@ using namespace std; namespace tmtt { - namespace { - std::once_flag printOnce; - } - //=== Initialize constants from configuration parameters. MuxHToutputs::MuxHToutputs(const Settings* settings) @@ -48,6 +44,7 @@ namespace tmtt { std::stringstream text; text << "=== The R-PHI HT output is multiplexed onto " << this->numLinksPerNonant() << " pairs of opto-links per nonant."; + static std::once_flag printOnce; std::call_once( printOnce, [](string t) { PrintL1trk() << t; }, text.str()); } diff --git a/L1Trigger/TrackFindingTMTT/src/Sector.cc b/L1Trigger/TrackFindingTMTT/src/Sector.cc index 01b3e3c6e2cbc..1f933379fbacc 100644 --- a/L1Trigger/TrackFindingTMTT/src/Sector.cc +++ b/L1Trigger/TrackFindingTMTT/src/Sector.cc @@ -30,10 +30,10 @@ namespace tmtt { //=== Characteristics of this phi region. chosenRofPhi_(settings->chosenRofPhi()), - useStubPhi_(settings->useStubPhi()), minPt_(settings->houghMinPt()), // Min Pt covered by HT array. - useStubPhiTrk_(settings->useStubPhiTrk()), assumedPhiTrkRes_(settings->assumedPhiTrkRes()), + useStubPhi_(settings->useStubPhi()), + useStubPhiTrk_(settings->useStubPhiTrk()), calcPhiTrkRes_(settings->calcPhiTrkRes()), //=== Check if subsectors in eta are being used within each sector. numSubSecsEta_(settings->numSubSecsEta()) { diff --git a/L1Trigger/TrackFindingTMTT/src/Settings.cc b/L1Trigger/TrackFindingTMTT/src/Settings.cc index 0146ea6df187f..bc95f65268a1c 100644 --- a/L1Trigger/TrackFindingTMTT/src/Settings.cc +++ b/L1Trigger/TrackFindingTMTT/src/Settings.cc @@ -397,6 +397,11 @@ namespace tmtt { << "Settings: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type E."; } + constexpr float verySmall = 0.1; + if (houghMinPt_ < verySmall) + throw cms::Exception("BadConfig") << "Settings: Invalid cfg parameters -- HoughMinPt must be positive."; + miniHoughMinPt_ = std::max(miniHoughMinPt_, houghMinPt_); + for (const unsigned int& iEtaReg : etaSecsReduceLayers_) { if (iEtaReg >= etaRegions_.size()) throw cms::Exception("BadConfig") << "Settings: You specified an eta sector number in EtaSecsReduceLayers " diff --git a/L1Trigger/TrackFindingTMTT/src/SimpleLR4.cc b/L1Trigger/TrackFindingTMTT/src/SimpleLR4.cc index a88268975ceee..6ea41e6077a3b 100644 --- a/L1Trigger/TrackFindingTMTT/src/SimpleLR4.cc +++ b/L1Trigger/TrackFindingTMTT/src/SimpleLR4.cc @@ -19,8 +19,6 @@ using namespace std; namespace tmtt { SimpleLR4::SimpleLR4(const Settings* settings) : TrackFitGeneric(settings) { - debug_ = false; // Enable debug printout. - // Initialize digitization parameters phiMult_ = pow(2., settings_->phiSBits()) / settings_->phiSRange(); rTMult_ = pow(2., settings_->rtBits()) / settings_->rtRange(); @@ -39,16 +37,15 @@ namespace tmtt { denominatorMult_ = rTMult_ * rTMult_; resMult_ = rTMult_ * qOverPtMult_; - digitize_ = settings_->digitizeSLR() and settings_->enableDigitize(); dividerBitsHelix_ = settings_->dividerBitsHelix(); dividerBitsHelixZ_ = settings_->dividerBitsHelixZ(); shiftingBitsDenRPhi_ = settings_->ShiftingBitsDenRPhi(); shiftingBitsDenRZ_ = settings_->ShiftingBitsDenRZ(); - shiftingBitsPhi_ = settings_->ShiftingBitsPhi(); shiftingBitsz0_ = settings_->ShiftingBitsZ0(); shiftingBitsPt_ = settings_->ShiftingBitsPt(); shiftingBitsLambda_ = settings_->ShiftingBitsLambda(); + digitize_ = settings_->digitizeSLR() and settings_->enableDigitize(); phiSectorWidth_ = 2. * M_PI / float(settings_->numPhiSectors()); phiNonantWidth_ = 2. * M_PI / float(settings_->numPhiNonants()); @@ -57,6 +54,8 @@ namespace tmtt { chosenRofPhi_ = settings_->chosenRofPhi(); if (digitize_) chosenRofPhi_ = floor(chosenRofPhi_ * rTMult_) / rTMult_; + + debug_ = false; // Enable debug printout. }; static bool pair_compare(std::pair a, std::pair b) { diff --git a/L1Trigger/TrackFindingTMTT/src/Stub.cc b/L1Trigger/TrackFindingTMTT/src/Stub.cc index 81263a78085e7..988096d9f31d2 100644 --- a/L1Trigger/TrackFindingTMTT/src/Stub.cc +++ b/L1Trigger/TrackFindingTMTT/src/Stub.cc @@ -42,14 +42,14 @@ namespace tmtt { iphi_(iphi), alpha_(alpha), digitalStub_(std::make_unique(settings, r, phi, z, iPhiSec)), - psModule_(psModule), layerId_(layerId), layerIdReduced_(TrackerModule::calcLayerIdReduced(layerId)), - barrel_(barrel), - tiltedBarrel_(tiltedBarrel), stripPitch_(stripPitch), stripLength_(stripLength), - nStrips_(nStrips) {} + nStrips_(nStrips), + psModule_(psModule), + barrel_(barrel), + tiltedBarrel_(tiltedBarrel) {} //=== TMTT L1 tracking: stub constructor. @@ -64,20 +64,20 @@ namespace tmtt { settings_(settings), index_in_vStubs_(index_in_vStubs), assocTP_(nullptr), // Initialize in case job is using no MC truth info. - digitizeWarningsOn_(true), lastDigiStep_(Stub::DigiStage::NONE), + digitizeWarningsOn_(true), trackerModule_(trackerModule), // Info about tracker module containing stub degradeBend_(degradeBend), // Used to degrade stub bend information. // Module related variables (need to be stored for Hybrid) - psModule_(trackerModule->psModule()), layerId_(trackerModule->layerId()), layerIdReduced_(trackerModule->layerIdReduced()), - barrel_(trackerModule->barrel()), - tiltedBarrel_(trackerModule->tiltedBarrel()), tiltAngle_(trackerModule->tiltAngle()), stripPitch_(trackerModule->stripPitch()), stripLength_(trackerModule->stripLength()), - nStrips_(trackerModule->nStrips()) { + nStrips_(trackerModule->nStrips()), + psModule_(trackerModule->psModule()), + barrel_(trackerModule->barrel()), + tiltedBarrel_(trackerModule->tiltedBarrel()) { // Get coordinates of stub. const TTStub* ttStubP = ttStubRef_.get(); diff --git a/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc b/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc index dc2d3326480cb..c890e97d74d1f 100644 --- a/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc +++ b/L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc @@ -11,15 +11,24 @@ using namespace std; -namespace { - std::mutex myMutex; -} - namespace tmtt { + //=== Get FE window size arrays (via copy) used with stub producer, but set to zero. + + void StubWindowSuggest::setFEWindows(const StubFEWindows* sw) { + static std::mutex myMutex; + std::lock_guard myGuard(myMutex); // Allow only one thread. + // Only need to create FE windows once. + if (not sw_) { + sw_ = std::make_unique(*sw); // Copy + sw_->setZero(); + } + } + //=== Analyse stub window required for this stub. void StubWindowSuggest::process(const TrackerTopology* trackerTopo, const Stub* stub) { + static std::mutex myMutex; std::lock_guard myGuard(myMutex); // Allow only one thread. // Half-size of FE chip bend window corresponding to Pt range in which tracks are to be found. @@ -43,37 +52,8 @@ namespace tmtt { DetId stDetId(stub->trackerModule()->detId()); - double* storedHalfWindow = sw_.storedWindowSize(trackerTopo, stDetId); - /* - if (stDetId.subdetId() == StripSubdetector::TOB) { - unsigned int layer = trackerTopo->layer(stDetId); - unsigned int ladder = trackerTopo->tobRod(stDetId); - int type = 2 * trackerTopo->tobSide(stDetId) - 3; // -1 for tilted-, 1 for tilted+, 3 for flat - double corr = 0; - - if (type != TrackerModule::BarrelModuleType::flat) // Only for tilted modules - { - corr = (sw_.numTiltedLayerRings().at(layer) + 1) / 2.; - // Corrected ring number, between 0 and barrelNTilt.at(layer), in ascending |z| - ladder = corr - (corr - ladder) * type; - double& storedHalfWindow = (sw_.windowSizeTiltedLayersRings().at(layer)).at(ladder); - if (storedHalfWindow < bendHalfWind) - storedHalfWindow = bendHalfWind; - } else // Classic barrel window otherwise - { - double& storedHalfWindow = sw_.windowSizeBarrelLayers().at(layer); - if (storedHalfWindow < bendHalfWind) - storedHalfWindow = bendHalfWind; - } + double* storedHalfWindow = sw_->storedWindowSize(trackerTopo, stDetId); - } else if (stDetId.subdetId() == StripSubdetector::TID) { - unsigned int wheel = trackerTopo->tidWheel(stDetId); - unsigned int ring = trackerTopo->tidRing(stDetId); - double& storedHalfWindow = sw_.windowSizeEndcapDisksRings().at(wheel).at(ring); - if (storedHalfWindow < bendHalfWind) - storedHalfWindow = bendHalfWind; - } -*/ if (*storedHalfWindow < bendHalfWind) *storedHalfWindow = bendHalfWind; } @@ -93,7 +73,7 @@ namespace tmtt { text << "BarrelCut = cms.vdouble( "; div = ""; - for (const auto& cut : sw_.windowSizeBarrelLayers()) { + for (const auto& cut : sw_->windowSizeBarrelLayers()) { text << div << cut; div = ", "; } @@ -101,7 +81,7 @@ namespace tmtt { PrintL1trk(1) << text.str(); PrintL1trk(1) << "TiltedBarrelCutSet = cms.VPSET( "; - for (const auto& cutVec : sw_.windowSizeTiltedLayersRings()) { + for (const auto& cutVec : sw_->windowSizeTiltedLayersRings()) { text.str(""); text << " cms.PSet( TiltedCut = cms.vdouble("; if (cutVec.empty()) @@ -117,7 +97,7 @@ namespace tmtt { PrintL1trk(1) << "),"; PrintL1trk(1) << "EndcapCutSet = cms.VPSET( "; - for (const auto& cutVec : sw_.windowSizeEndcapDisksRings()) { + for (const auto& cutVec : sw_->windowSizeEndcapDisksRings()) { text.str(""); text << " cms.PSet( EndcapCut = cms.vdouble("; if (cutVec.empty()) diff --git a/L1Trigger/TrackFindingTMTT/src/TrackerModule.cc b/L1Trigger/TrackFindingTMTT/src/TrackerModule.cc index e79389e097e35..0c3650d8fc8b2 100644 --- a/L1Trigger/TrackFindingTMTT/src/TrackerModule.cc +++ b/L1Trigger/TrackFindingTMTT/src/TrackerModule.cc @@ -81,12 +81,7 @@ namespace tmtt { tiltedBarrel_ = barrel_ && (trackerTopology->tobSide(detId) != BarrelModuleType::flat); float deltaR = std::abs(R1 - R0); float deltaZ = (R1 - R0 > 0) ? (Z1 - Z0) : -(Z1 - Z0); - tiltAngle_ = atan2(deltaR, deltaZ); - // Put in range -PI/2 to +PI/2. - if (tiltAngle_ > M_PI / 2.) - tiltAngle_ -= M_PI; - if (tiltAngle_ < -M_PI / 2.) - tiltAngle_ += M_PI; + tiltAngle_ = atan(deltaR / deltaZ); // Get sensor strip or pixel pitch using innermost sensor of pair. diff --git a/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc b/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc index 26832f16e8bfd..f5794d769e4d1 100644 --- a/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc +++ b/L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc @@ -5,6 +5,8 @@ #include "L1Trigger/TrackFindingTMTT/interface/Stub.h" #include "L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h" +#include + using namespace std; namespace tmtt { @@ -54,10 +56,10 @@ namespace tmtt { rzFilterName_ = settings->rzFilterName(); // --- Options for Seed filter. - //Added resolution for a tracklet-like filter algorithm, beyond that estimated from hit resolution. - seedResCut_ = settings->seedResCut(); // Keep stubs compatible with all possible good seed. keepAllSeed_ = settings->keepAllSeed(); + //Added resolution for a tracklet-like filter algorithm, beyond that estimated from hit resolution. + seedResCut_ = settings->seedResCut(); // Maximum number of seed combinations to bother checking per track candidate. maxSeedCombinations_ = settings->maxSeedCombinations(); // Maximum number of seed combinations consistent with sector (z0,eta) constraints to bother checking per track candidate. @@ -144,8 +146,8 @@ namespace tmtt { std::vector filtStubs = stubs; // Copy stubs vector in filtStubs bool FirstSeed = true; //Allowed layers for the first & second seeding stubs - static const std::vector FirstSeedLayers = {1, 2, 11, 21, 3, 12, 22, 4}; - static const std::vector SecondSeedLayers = {1, 2, 11, 3, 21, 22, 12, 23, 13, 4}; + constexpr std::array FirstSeedLayers = {{1, 2, 11, 21, 3, 12, 22, 4}}; + constexpr std::array SecondSeedLayers = {{1, 2, 11, 3, 21, 22, 12, 23, 13, 4}}; set uniqueFilteredStubs; unsigned int numSeedCombinations = 0; // Counter for number of seed combinations considered. @@ -154,7 +156,8 @@ namespace tmtt { unsigned int oldNumLay = 0; //Number of Layers counter, used to keep the seed with more layers - std::sort(filtStubs.begin(), filtStubs.end(), SortStubsByLayer()); + auto orderByLayer = [](const Stub* a, const Stub* b) { return bool(a->layerId() < b->layerId()); }; + std::sort(filtStubs.begin(), filtStubs.end(), orderByLayer); // Loop over stubs in the HT Cell for (Stub* s0 : filtStubs) {