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

Fix memory leak in StFstClusterMaker #593

Merged
merged 43 commits into from
Oct 6, 2023
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
7edea64
Add FST raw hits in StMuDst
techuan-huang Jul 18, 2022
0f449a9
Add chain option for FST raw hits in MuDst
techuan-huang Aug 3, 2022
ec86462
Remove not used headers
techuan-huang Aug 9, 2022
e8f264e
Reduce LOG_INFO
techuan-huang Aug 9, 2022
85c7d8f
Fixed a possible null pointer issue in StMuDstMaker
techuan-huang Aug 10, 2022
fdddc9b
fstMuRawHit no need to be included in fstChain
techuan-huang Aug 10, 2022
4774a31
Merge branch 'star-bnl:main' into main
techuan-huang Aug 30, 2022
77f0375
Add FST raw hits in StEvent and the relevant chain option
techuan-huang Aug 30, 2022
18811d1
Remove StFstRawHit.cxx and StFstRawHit.h from StFstUtil
techuan-huang Aug 30, 2022
7b1302c
Fixed include path for StFstRawHit.h in StMuFstRawHit.cxx
techuan-huang Aug 30, 2022
139cea7
Merge branch 'main' into main
techuan-huang Aug 31, 2022
7a09c3b
Merge branch 'main' into main
techuan-huang Sep 2, 2022
ea99262
Merge branch 'main' into main
techuan-huang Sep 7, 2022
e4bdc34
Merge branch 'main' into main
techuan-huang Sep 8, 2022
509e4d4
Merge branch 'main' into main
techuan-huang Sep 16, 2022
4cd7a65
Merge branch 'main' into main
techuan-huang Sep 23, 2022
991fdc2
Merge branch 'main' into main
techuan-huang Sep 27, 2022
cc663cb
Merge branch 'main' into main
techuan-huang Oct 20, 2022
f5f4c27
Fill FST raw hits from StEvent to StMuDst
techuan-huang Oct 22, 2022
a6aff66
Merge branch 'main' into main
techuan-huang Oct 22, 2022
a67757b
Merge branch 'main' into main
techuan-huang Oct 27, 2022
022a2a6
Implement Dmitri's comments
techuan-huang Oct 27, 2022
caa4852
Merge branch 'main' into main
techuan-huang Oct 31, 2022
2114308
Implement Dmitri's comments
techuan-huang Oct 31, 2022
f969296
Fixed wrong include path
techuan-huang Nov 1, 2022
d05c891
Merge branch 'main' into main
techuan-huang Nov 3, 2022
aae5c57
Merge branch 'main' into main
techuan-huang Nov 4, 2022
1954b0e
Implement Dmitri's comments
techuan-huang Nov 4, 2022
3c6c2fd
Implement Dmitri's comments
techuan-huang Nov 5, 2022
88d9879
StFstEvtCollection: Define an empty virtual destructor
plexoos Nov 5, 2022
6cccf09
StArray: Expose object type observed by the container
plexoos Nov 5, 2022
2b99165
Copy StFstRawHit's from StFstRawHitCollection to StFstEvtCollection
plexoos Nov 5, 2022
bb6b4aa
Revert "Copy StFstRawHit's from StFstRawHitCollection to StFstEvtColl…
plexoos Nov 5, 2022
2aae86e
Revert "StArray: Expose object type observed by the container"
plexoos Nov 5, 2022
a6a6b72
Merge branch 'main' into main
techuan-huang Nov 8, 2022
a7020e3
Merge branch 'main' into main
techuan-huang Nov 9, 2022
b0ce45e
Merge branch 'main' into main
techuan-huang Nov 12, 2022
d7f8619
Merge branch 'star-bnl:main' into main
techuan-huang Nov 17, 2022
0ec3530
Merge branch 'star-bnl:main' into main
techuan-huang May 26, 2023
8e83e9d
Merge branch 'star-bnl:main' into main
techuan-huang Sep 23, 2023
ab0cc18
Fix memory leak in StFstClusterMaker
Oct 1, 2023
4ff3956
Merge branch 'main' into FstMemLeak
techuan-huang Oct 1, 2023
4b20f88
Merge branch 'main' into FstMemLeak
plexoos Oct 2, 2023
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
17 changes: 10 additions & 7 deletions StRoot/StFstClusterMaker/StFstScanRadiusClusterAlgo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Int_t StFstScanRadiusClusterAlgo::doClustering(const StFstCollection &fstCollect
while ( !rawHitsVec[sensorIdx][phiIdx].empty() )
{
rawHitTemp = rawHitsVec[sensorIdx][phiIdx].back();
delete rawHitsVec[sensorIdx][phiIdx].back();
rawHitsVec[sensorIdx][phiIdx].pop_back();
rawHitsToMerge.push_back(rawHitTemp);
//count number to merge
Expand All @@ -77,6 +78,7 @@ Int_t StFstScanRadiusClusterAlgo::doClustering(const StFstCollection &fstCollect
// put all raw hits in one phi strip to rawHitsToMerge
while (rawHitsToMergePtr != rawHitsToMerge.end() && !rawHitsVec[sensorIdx][phiIdx].empty()) {
rawHitTemp = rawHitsVec[sensorIdx][phiIdx].back();
delete rawHitsVec[sensorIdx][phiIdx].back();
rawHitsVec[sensorIdx][phiIdx].pop_back();

++nToMerge;
Expand Down Expand Up @@ -137,14 +139,14 @@ Int_t StFstScanRadiusClusterAlgo::doClustering(const StFstCollection &fstCollect
totCharge = tempSumCharge;
totChargeErr = sqrt(tempSumChargeErrSquare / nToMerge);

newCluster = new StFstCluster((int)wedge * 10000 + clusterLabel, disk, wedge, sensor, apv, meanRStrip, meanPhiStrip, totCharge, totChargeErr, clusterType);
newCluster->setNRawHits(clusterSize);
newCluster->setNRawHitsR(clusterSizeR);
newCluster->setNRawHitsPhi(clusterSizePhi);
newCluster->setMaxTimeBin(maxTb);
newCluster->setIdTruth(idTruth);

if(nToSeedhit>0) {
newCluster = new StFstCluster((int)wedge * 10000 + clusterLabel, disk, wedge, sensor, apv, meanRStrip, meanPhiStrip, totCharge, totChargeErr, clusterType);
newCluster->setNRawHits(clusterSize);
newCluster->setNRawHitsR(clusterSizeR);
newCluster->setNRawHitsPhi(clusterSizePhi);
newCluster->setMaxTimeBin(maxTb);
newCluster->setIdTruth(idTruth);

clustersVec[sensorIdx][phiIdx].push_back(newCluster);
clusterLabel++;
}
Expand Down Expand Up @@ -200,6 +202,7 @@ Int_t StFstScanRadiusClusterAlgo::doClustering(const StFstCollection &fstCollect
(*clusterIt2)->setApv(apv);

int distance1 = std::distance(clustersVec[sensorIdx][phiIdx1].begin(), clusterIt1);
delete *clusterIt1;
clustersVec[sensorIdx][phiIdx1].erase(clusterIt1);

if (distance1 == 0)
Expand Down