diff --git a/lib/database/adapters/RunAdapter.js b/lib/database/adapters/RunAdapter.js index 3a0fdfce84..1e3cef7074 100644 --- a/lib/database/adapters/RunAdapter.js +++ b/lib/database/adapters/RunAdapter.js @@ -273,9 +273,9 @@ class RunAdapter { entityObject.inelasticInteractionRateAtMid = inelasticInteractionRateAtMid; entityObject.inelasticInteractionRateAtEnd = inelasticInteractionRateAtEnd; if (lhcFill && inelasticInteractionRateAvg !== null) { - const numberOfCollidingLhcBunchCrossings = extractNumberOfCollidingLhcBunchCrossings(lhcFill.fillingSchemeName); - entityObject.muInelasticInteractionRate = numberOfCollidingLhcBunchCrossings - ? inelasticInteractionRateAvg / (numberOfCollidingLhcBunchCrossings * PhysicalConstant.LHC_REVOLUTION_FREQUENCY_HZ) + const collidingBunchesCount = lhcFill.collidingBunchesCount ?? extractNumberOfCollidingLhcBunchCrossings(lhcFill.fillingSchemeName); + entityObject.muInelasticInteractionRate = collidingBunchesCount + ? inelasticInteractionRateAvg / (collidingBunchesCount * PhysicalConstant.LHC_REVOLUTION_FREQUENCY_HZ) : null; } else { entityObject.muInelasticInteractionRate = null; diff --git a/lib/database/seeders/20220503120937-lhc-fills.js b/lib/database/seeders/20220503120937-lhc-fills.js index 78aa21a460..071abae47b 100644 --- a/lib/database/seeders/20220503120937-lhc-fills.js +++ b/lib/database/seeders/20220503120937-lhc-fills.js @@ -68,7 +68,7 @@ module.exports = { stable_beams_end: '2019-08-08 23:00:00', stable_beams_duration: 60 * 60 * 12, filling_scheme_name: 'Single_12b_8_1024_8_2018', - colliding_bunches_count: 2345, + colliding_bunches_count: 1024, delivered_luminosity: 420, created_at: new Date('2019-08-09 21:00:00'), updated_at: new Date('2019-08-09 21:00:00'), diff --git a/test/public/lhcFills/detail.test.js b/test/public/lhcFills/detail.test.js index 4c7d8f1a59..f5eafacdda 100644 --- a/test/public/lhcFills/detail.test.js +++ b/test/public/lhcFills/detail.test.js @@ -45,7 +45,7 @@ module.exports = () => { await expectInnerText(page, '#lhc-fill-beamType', 'Beam type:\nPROTON-PROTON'); await expectInnerText(page, '#lhc-fill-fillingSchemeName', 'Scheme name:\nSingle_12b_8_1024_8_2018'); - await expectInnerText(page, '#lhc-fill-collidingBunchesCount', 'Colliding bunches:\n2,345'); + await expectInnerText(page, '#lhc-fill-collidingBunchesCount', 'Colliding bunches:\n1,024'); await expectInnerText(page, '#lhc-fill-deliveredLuminosity', 'Delivered lumi:\n420 nb-1'); }); diff --git a/test/public/runs/detail.test.js b/test/public/runs/detail.test.js index bf20ec6d4a..28e7560ad7 100644 --- a/test/public/runs/detail.test.js +++ b/test/public/runs/detail.test.js @@ -282,8 +282,8 @@ module.exports = () => { it('should successfully show luminosity information of PbPb run', async () => { await goToRunDetails(page, 54); - await expectInnerText(page, '#luminosity div:nth-child(2) div:nth-child(1) div:nth-child(2)', '98,110.716\nµb\n-1'); - await expectInnerText(page, '#luminosity div:nth-child(2) div:nth-child(2) div:nth-child(2)', '0.031'); + await expectInnerText(page, '#luminosity div:nth-child(2) div:nth-child(1) div:nth-child(2)', '100,130.863\nµb\n-1'); + await expectInnerText(page, '#luminosity div:nth-child(2) div:nth-child(2) div:nth-child(2)', '0.072'); await expectInnerText(page, '#luminosity div:nth-child(2) div:nth-child(3) div:nth-child(2)', '78,600 µb'); await expectInnerText(page, '#luminosity div:nth-child(2) div:nth-child(4) div:nth-child(2)', '1'); await expectInnerText(page, '#luminosity div:nth-child(2) div:nth-child(5) div:nth-child(2)', '0.757');