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
Run3-alca222X Utilize MessageLogger rather than cout in Calibration/IsolatedParticles #37516
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37516/29231
|
A new Pull Request was created by @bsunanda (Sunanda Banerjee) for master. It involves the following packages:
@cmsbuild, @malbouis, @tvami, @yuanchao, @francescobrivio can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@cmsbuild Please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c3f0ce/23801/summary.html Comparison SummarySummary:
|
std::ostringstream st1; | ||
st1 << "default "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need this change? Is it that LogVerbatim
didnt print out? You could use LogPrint
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We like to print the whole sequence through some messagelogger - we chose Verbatim - we are putting the header as well as the messages from printHitPattern from all tracks of the same category and put in the output stream
for (int i = 0; i < p.numberOfAllHits(reco::HitPattern::MISSING_INNER_HITS); i++) { | ||
p.printHitPattern(reco::HitPattern::MISSING_INNER_HITS, i, std::cout); | ||
p.printHitPattern(reco::HitPattern::MISSING_INNER_HITS, i, st2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldnt this be better just to rewrite the function printHitPattern
so it can take the LogPrint
as an input?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a tracker specific method and there are calls to this method from other places in CMSSW.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let me tag @mmusich to see what he thinks about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess my question is whether the std::ostream
is thread-safe or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the way is done here is correct, also I don't see benefits in changing printHitPattern
(which is not Tracker-specific code, by the way, but a method of any track), as doing it the way you propose would loose some generality.
+alca |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
PR description:
Utilize MessageLogger rather than cout in Calibration/IsolatedParticles
PR validation:
Use cfg's in test area
if this PR is a backport please specify the original PR and why you need to backport that PR:
Nothing special