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

A set of fixes for Ph2 OT cluster/rechit validation histos #20682

Merged
merged 5 commits into from Nov 3, 2017

Conversation

lowette
Copy link
Contributor

@lowette lowette commented Sep 27, 2017

This PR contains an update of the Ph2 OT cluster and rechit validation code that fixes several outstanding issues in the histograms: fix the number of rechits and clusters (separate issues), and fix the issue of saturation in TH1F's with large bin contents. Also the cluster validation code was streamlined to be much closer to the rechit validation.
@boudoul @delaere

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/PR-20682/1020

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @lowette (Steven Lowette) for master.

It involves the following packages:

RecoLocalTracker/Phase2TrackerRecHits
RecoLocalTracker/SiPhase2Clusterizer

@perrotta, @cmsbuild, @kpedro88, @slava77 can you please review it and eventually sign? Thanks.
@makortel, @felicepantaleo, @GiacomoSguazzoni, @rovere, @VinInn, @gpetruc, @ebrondol, @threus this is something you requested to watch as well.
@davidlange6, @slava77 you are the release manager for this.

cms-bot commands are listed here

Copy link
Contributor

@kpedro88 kpedro88 left a comment

Choose a reason for hiding this comment

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

General question: when does this code migrate to an appropriate subsystem/package (i.e. somewhere in Validation)?

// Create histograms for the layer if they do not yet exist

// initialize the nhit counters if they don't exist for this layer
std::map< unsigned int, unsigned int >::iterator nhitit(nRecHits[det].find(layer));
Copy link
Contributor

Choose a reason for hiding this comment

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

easier to use auto here

// initialize the nhit counters if they don't exist for this layer
std::map< unsigned int, unsigned int >::iterator nhitit(nRecHits[det].find(layer));
if (nhitit == nRecHits[det].end()) {
nRecHits [det].insert(std::pair<unsigned int, unsigned int>(layer, 0));
Copy link
Contributor

Choose a reason for hiding this comment

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

use emplace for all of these

histogramLayer->second.deltaX_eta_P[det][nch]->Fill(eta, localPosClu.x() - localPosHit.x());
histogramLayer->second.deltaY_eta_P[det][0] ->Fill(eta, localPosClu.y() - localPosHit.y());
histogramLayer->second.deltaY_eta_P[det][nch]->Fill(eta, localPosClu.y() - localPosHit.y());
histogramLayer->second.pullX_eta_P [det][0] ->Fill(eta, (localPosClu.x() - localPosHit.x())/sqrt(rechitIt->localPositionError().xx()));
Copy link
Contributor

Choose a reason for hiding this comment

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

try to avoid divide by 0 here


// fill the counter histos per layer
for (unsigned int det = 1; det < 3; ++det) {
for (std::map<unsigned int, unsigned int>::const_iterator it = nRecHits[det].begin(); it != nRecHits[det].end(); ++it) {
Copy link
Contributor

Choose a reason for hiding this comment

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

use range-based loops

// fill the counter histos per layer
for (unsigned int det = 1; det < 3; ++det) {
for (std::map<unsigned int, unsigned int>::const_iterator it = nRecHits[det].begin(); it != nRecHits[det].end(); ++it) {
std::map< unsigned int, RecHitHistos >::iterator histogramLayer(histograms_.find(it->first));
Copy link
Contributor

Choose a reason for hiding this comment

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

just use auto

unsigned int simTrackId(getSimTrackId(pixelSimLinks, detId, channel));
clusterSimTrackIds.push_back(simTrackId);
std::vector<unsigned int> simTrackIds(getSimTrackId(pixelSimLinks, detId, channel));
for (unsigned int i=0; i<simTrackIds.size(); ++i) {
Copy link
Contributor

Choose a reason for hiding this comment

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

range-based loops

for (edm::PSimHitContainer::const_iterator simhitIt(simHitsRaw[simhitidx]->begin()); simhitIt != simHitsRaw[simhitidx]->end(); ++simhitIt) {
if (rawid == simhitIt->detUnitId()) {
//std::cout << "=== " << rawid << " " << &*simhitIt << " " << simhitIt->trackId() << " " << simhitIt->localPosition().x() << " " << simhitIt->localPosition().y() << std::endl;
if (std::find(clusterSimTrackIds.begin(), clusterSimTrackIds.end(), simhitIt->trackId()) != clusterSimTrackIds.end()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

using std::find() in a double-nested loop seems like a bad idea. Could the clusterSimTrackIds be kept sorted?

if (!simhit) continue;

// only look at simhits from highpT tracks
std::map< unsigned int, SimTrack >::const_iterator simTrackIt(simTracks.find(simhit->trackId()));
Copy link
Contributor

Choose a reason for hiding this comment

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

auto


// fill the counter histos per layer
for (unsigned int det = 1; det < 3; ++det) {
for (std::map<unsigned int, unsigned int>::const_iterator it = nClusters[det].begin(); it != nClusters[det].end(); ++it) {
Copy link
Contributor

Choose a reason for hiding this comment

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

range-based loops and auto for iterators

if (DSViter == pixelSimLinks->end()) return retvec;
for (edm::DetSet< PixelDigiSimLink >::const_iterator it = DSViter->data.begin(); it != DSViter->data.end(); ++it) {
retvec.push_back(it->SimTrackId());
if (channel == it->channel()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why push_back twice if it's the requested channel?

@kpedro88
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 27, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/23280/console Started: 2017/09/28 00:25

@slava77
Copy link
Contributor

slava77 commented Sep 27, 2017

perhaps it's more practical to move necessary functionality to the Validation subsystem.
histogram-based analyzers do not belong in the Reco* subsystem.
Also, if this code is useful for more than just private test archiving purpose, a regular DQMAnalyzer may be better.

@slava77
Copy link
Contributor

slava77 commented Sep 27, 2017

assign dqm

@dmitrijus please take a look if we have something similar in the Validation subsystem to pick it up with standard tools.

@cmsbuild
Copy link
Contributor

New categories assigned: dqm

@kmaeshima,@vanbesien,@vazzolini,@dmitrijus you have been requested to review this Pull request/Issue and eventually sign? Thanks

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-20682/23280/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 26
  • DQMHistoTests: Total histograms compared: 2698383
  • DQMHistoTests: Total failures: 225
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2697969
  • DQMHistoTests: Total skipped: 189
  • DQMHistoTests: Total Missing objects: 0
  • Checked 107 log files, 15 edm output root files, 26 DQM output files

@slava77
Copy link
Contributor

slava77 commented Oct 2, 2017

@lowette
please clarify on the status of follow up to the code review comments for this PR.
Thank you.

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-20682/23985/summary.html

There are some workflows for which there are errors in the baseline:
10042.0 step 5
10024.0 step 5
The results for the comparisons for these workflows could be incomplete
This means most likely that the IB is having errors in the relvals.The error does NOT come from this pull request

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 112 differences found in the comparisons
  • DQMHistoTests: Total files compared: 26
  • DQMHistoTests: Total histograms compared: 2689186
  • DQMHistoTests: Total failures: 264
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2688752
  • DQMHistoTests: Total skipped: 170
  • DQMHistoTests: Total Missing objects: 0
  • Checked 107 log files, 10 edm output root files, 26 DQM output files

@slava77
Copy link
Contributor

slava77 commented Oct 26, 2017

+1

for #20682 af02695

  • updates in private test analysis files in RecoLocalTracker/Phase2TrackerRecHits/test, not a part of the standard workflows. Migration to regular DQM validation modules is expected at some point in the future, at which point these files will likely be removed (or moved to a Validation or DQM package).
  • jenkins tests pass
    • changes in 20434.0 are apparently random (appear in other unrelated PRs as well), the origin is apparently in RPC [non-reproducible noise sim?]. Curiously, the changes are apparently present only in CMSSW_9_4_X_2017-10-25-1100 (and not seen so far in the IB after, and were not noticed before)

@kpedro88
Copy link
Contributor

+1

@boudoul
Copy link
Contributor

boudoul commented Nov 2, 2017

hi @dmitrijus , please look at this PR , thanks

@dmitrijus
Copy link
Contributor

+1

This validation currently does not use anything from, and is not a part of DQM.
My signature should not be needed, at least not until 'the future' comes.

Migration to regular DQM validation modules is expected at some point in the future, at which point these files will likely be removed (or moved to a Validation or DQM package).

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 2, 2017

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. @davidlange6, @slava77, @smuzaffar (and backports should be raised in the release meeting by the corresponding L2)

@davidlange6
Copy link
Contributor

+1
all of this code should really soon now move out of the test directory and into a proper Validation area....

@cmsbuild cmsbuild merged commit 011cac1 into cms-sw:master Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet