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

HBHE M2 = fix Memory Leak #17821

Merged
merged 3 commits into from Mar 10, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -117,6 +117,7 @@ class PulseShapeFitOOTPileupCorrection
double iTMin, double iTMax,
const std::vector<double> & its4Chi2, HcalTimeSlew::BiasSetting slewFlavor, int iFitTimes);

const HcalPulseShapes::Shape* currentPulseShape_;
void setChi2Term( bool isHPD );

void setPulseShapeTemplate (const HcalPulseShapes::Shape& ps, bool isHPD);
Expand Down Expand Up @@ -164,6 +165,7 @@ class PulseShapeFitOOTPileupCorrection
double noiseSiPM_;
HcalTimeSlew::BiasSetting slewFlavor_;

bool isCurrentChannelHPD_;
};

#endif // PulseShapeFitOOTPileupCorrection_h
Expand Up @@ -278,15 +278,15 @@ void PulseShapeFitOOTPileupCorrection::setPUParams(bool iPedestalConstraint, b
}

void PulseShapeFitOOTPileupCorrection::setPulseShapeTemplate(const HcalPulseShapes::Shape& ps, bool isHPD) {
// initialize for every hit now to avoid incorrect settings for different channel types (HPD vs SiPM)
// FIXME: keep this as a reminder to improve and reduce CPU use
// if( cntsetPulseShape ) return;

// set the M2 parameters before defining the shape
setChi2Term(isHPD);

resetPulseShapeTemplate(ps);

// initialize for every different channel types (HPD vs SiPM)

if (!(&ps == currentPulseShape_ && isHPD == isCurrentChannelHPD_))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both "currentPulseShape_" and "isCurrentChannelHPD_" are used uninitialized here

{
setChi2Term(isHPD);
resetPulseShapeTemplate(ps);
currentPulseShape_ = &ps;
isCurrentChannelHPD_ = isHPD;
}
}

void PulseShapeFitOOTPileupCorrection::resetPulseShapeTemplate(const HcalPulseShapes::Shape& ps) {
Expand Down