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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
#include <cmath> | ||
#include <map> | ||
#include <memory> | ||
#include <sstream> | ||
#include <string> | ||
#include <vector> | ||
|
||
|
@@ -2760,18 +2761,24 @@ void IsolatedTracksNxN::printTrack(const reco::Track *pTrack) { | |
if (printTrkHitPattern_) { | ||
const reco::HitPattern &p = pTrack->hitPattern(); | ||
|
||
edm::LogVerbatim("IsoTrack") << "default "; | ||
std::ostringstream st1; | ||
st1 << "default "; | ||
for (int i = 0; i < p.numberOfAllHits(reco::HitPattern::TRACK_HITS); i++) { | ||
p.printHitPattern(reco::HitPattern::TRACK_HITS, i, std::cout); | ||
} | ||
edm::LogVerbatim("IsoTrack") << "trackerMissingInnerHits() "; | ||
edm::LogVerbatim("IsoTrack") << st1.str(); | ||
std::ostringstream st2; | ||
st2 << "trackerMissingInnerHits() "; | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. wouldnt this be better just to rewrite the function There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. I guess my question is whether the There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
} | ||
edm::LogVerbatim("IsoTrack") << "trackerMissingOuterHits() "; | ||
edm::LogVerbatim("IsoTrack") << st2.str(); | ||
std::ostringstream st3; | ||
st3 << "trackerMissingOuterHits() "; | ||
for (int i = 0; i < p.numberOfAllHits(reco::HitPattern::MISSING_OUTER_HITS); i++) { | ||
p.printHitPattern(reco::HitPattern::MISSING_OUTER_HITS, i, std::cout); | ||
p.printHitPattern(reco::HitPattern::MISSING_OUTER_HITS, i, st3); | ||
} | ||
edm::LogVerbatim("IsoTrack") << st3.str(); | ||
|
||
edm::LogVerbatim("IsoTrack") << "\n \t trackerLayersWithMeasurement() " << p.trackerLayersWithMeasurement() | ||
<< "\n \t pixelLayersWithMeasurement() " << p.pixelLayersWithMeasurement() | ||
|
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 useLogPrint
insteadThere 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