Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed memory leak in RegionalMuonGMTUnpacker [14_0] #46950

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,14 @@ namespace l1t {
unsigned int linkId = blockId / 2;
int processor;
RegionalMuonCandBxCollection* regionalMuonCollection;
RegionalMuonShowerBxCollection* regionalMuonShowerCollection;
RegionalMuonShowerBxCollection* regionalMuonShowerCollection = nullptr;
tftype trackFinder;
if (linkId > 47 && linkId < 60) {
regionalMuonCollection = static_cast<GMTCollections*>(coll)->getRegionalMuonCandsBMTF();
regionalMuonShowerCollection =
new RegionalMuonShowerBxCollection(); // To avoid warning re uninitialised collection
trackFinder = tftype::bmtf;
processor = linkId - 48;
} else if (linkId > 41 && linkId < 66) {
regionalMuonCollection = static_cast<GMTCollections*>(coll)->getRegionalMuonCandsOMTF();
regionalMuonShowerCollection =
new RegionalMuonShowerBxCollection(); // To avoid warning re uninitialised collection
if (linkId < 48) {
trackFinder = tftype::omtf_pos;
processor = linkId - 42;
Expand All @@ -68,8 +64,9 @@ namespace l1t {
return false;
}
regionalMuonCollection->setBXRange(firstBX, lastBX);
regionalMuonShowerCollection->setBXRange(firstBX, lastBX);

if (regionalMuonShowerCollection) {
regionalMuonShowerCollection->setBXRange(firstBX, lastBX);
}
LogDebug("L1T") << "nBX = " << nBX << " first BX = " << firstBX << " lastBX = " << lastBX;

// Get the BX blocks and unpack them
Expand Down Expand Up @@ -127,7 +124,8 @@ namespace l1t {
// Fill RegionalMuonShower objects. For this we need to look at all six words together.
RegionalMuonShower muShower;
if (RegionalMuonRawDigiTranslator::fillRegionalMuonShower(
muShower, bxPayload, processor, trackFinder, useEmtfNominalTightShowers_, useEmtfLooseShowers_)) {
muShower, bxPayload, processor, trackFinder, useEmtfNominalTightShowers_, useEmtfLooseShowers_) and
regionalMuonShowerCollection) {
regionalMuonShowerCollection->push_back(bx, muShower);
}
} else {
Expand Down