Skip to content

FCS pi0 finder for Ecal by Xilin#250

Merged
genevb merged 3 commits intostar-bnl:mainfrom
akioogawa:PR20211214
Dec 22, 2021
Merged

FCS pi0 finder for Ecal by Xilin#250
genevb merged 3 commits intostar-bnl:mainfrom
akioogawa:PR20211214

Conversation

@akioogawa
Copy link
Copy Markdown
Contributor

This will be needed for FCS pi0 peaks to be part of FastOffline.

Comment thread StRoot/StSpinPool/StFcsPi0FinderForEcal/StFcsPi0FinderForEcal.cxx Outdated
@genevb genevb mentioned this pull request Dec 17, 2021
Copy link
Copy Markdown
Member

@veprbl veprbl left a comment

Choose a reason for hiding this comment

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

I took a liberty to reformat the source (feel free to revert). Don't see any logical issues, left some comments about technical ones.

Comment on lines +49 to +53
mFcsDb->setDbAccess(0);
if (!mFcsDb) {
LOG_ERROR << "StFcsEventDisplay::InitRun Failed to get StFcsDbMaker" << endm;
return kStFatal;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes no sense to first dereference a pointer and then check it for NULL.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed

Int_t StFcsPi0FinderForEcal::Finish() {
if (filename.length() == 0) return kStOk;
const char* fn = filename.c_str();
TFile* MyFile = new TFile(fn, "RECREATE");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This leaks memory. Consider switching to

Suggested change
TFile* MyFile = new TFile(fn, "RECREATE");
TFile MyFile(fn, "RECREATE");

or using std::unique_ptr<TFile>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. But it is in Finish() not in Make(). Still good idea.

float E_min = 1;

#ifndef SKIPDefImp
ClassDef(StFcsPi0FinderForEcal, 0)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure why this is behind an ifdef, our https://github.com/star-bnl/star-sw/blob/main/mgr/RootCint.pl will still see this and try to include it in a generated LinkDef.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is what Gene did as a trick to include this maker fastoffline run off from STARDEV while this Maker is not in DEV (StSpinPool). He said this trick works.

@genevb genevb merged commit 82c118d into star-bnl:main Dec 22, 2021
@plexoos
Copy link
Copy Markdown
Member

plexoos commented Dec 22, 2021

@veprbl raised very reasonable concerns about the code. Too bad they were ignored...

@genevb
Copy link
Copy Markdown
Contributor

genevb commented Dec 22, 2021

I merged this PR to get QA moving. I don't disagree that @veprbl 's points are reasonable and the authors can & should address them promptly (soon), but I don't perceive those points as more critical than QA'ing data we are taking at the experiment right_now (this PR already took a week). Given @veprbl 's approval of this PR, perhaps he felt the same.

@akioogawa
Copy link
Copy Markdown
Contributor Author

@plexoos @veprbl @genevb Sorry for not attending on those comments. Crazy days. Now this is merged and closed, what do I do? Should/CanI re-open, or create whole new PR?

@veprbl
Copy link
Copy Markdown
Member

veprbl commented Dec 22, 2021

@akioogawa New PR is the way to make further changes. Thanks!

@akioogawa
Copy link
Copy Markdown
Contributor Author

See PR #271

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants