Open GNiendorf opened 2 months ago
Constants repeated in Segment.h
Duplicate functions in Quintuplet.h and PixelQuintuplet.h https://github.com/SegmentLinking/cmssw/blob/ff8446c8a375a0a535e627ad007d330950f49abb/RecoTracker/LSTCore/src/alpaka/Quintuplet.h#L1015-L1099
Triple duplication of chi-squared function. @YonsiG do you know if there is supposed to be any difference between these three, or can they be merged?
runDeltaBetaIterations duplication.
See PR #97
PR #98 addresses some of the above, with a 60% speedup on GPU for MD creation.
Triple duplication of chi-squared function. @YonsiG do you know if there is supposed to be any difference between these three, or can they be merged?
Hi Gavin, for these chi-square function, they are doing chi2 based on x-y plane and radius calculations. I think those can be merged, just the input number of MDs need to be changed.
PR #124 fixes an issue caused by code duplication.
To simplify the code, we should remove the extensive use of code duplication (copy-paste).
Here is a gist showing some of the current duplication, automatically generated with PMD. Not all of these are meaningful duplications, but it catches many obvious repeats:
https://gist.github.com/GNiendorf/fd4fe952f38149b5bfd1269a7039370e
This was generated with the following:
1. Download PMD
wget https://github.com/pmd/pmd/releases/download/pmd_releases%2F7.5.0/pmd-dist-7.5.0-bin.zip
2. Extract the PMD archive
unzip pmd-dist-7.5.0-bin.zip -d pmd-dist
3. Navigate to the PMD bin directory
cd pmd-dist/pmd-bin-7.5.0/bin
4. Create a list of .cc and .h files in specific directories
find \ CMSSW_14_1_0_pre3/src/RecoTracker/LSTCore/interface/alpaka \ CMSSW_14_1_0_pre3/src/RecoTracker/LSTCore/interface \ CMSSW_14_1_0_pre3/src/RecoTracker/LSTCore/src/alpaka \ CMSSW_14_1_0_pre3/src/RecoTracker/LSTCore/src \ CMSSW_14_1_0_pre3/src/RecoTracker/LSTCore/standalone/bin \ CMSSW_14_1_0_pre3/src/RecoTracker/LSTCore/standalone/code/core \ CMSSW_14_1_0_pre3/src/RecoTracker/LSTCore/standalone/efficiency/src \ -type f ( -name ".cc" -o -name ".h" ) > file_list.txt
5. Run CPD to generate the duplication report
./pmd cpd --minimum-tokens 100 --file-list file_list.txt --language cpp --format text > duplication_report.txt