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

add TrackSelectorBy Region and CandidateRegion #29359

Closed
wants to merge 3 commits into from

Conversation

mtosi
Copy link
Contributor

@mtosi mtosi commented Mar 31, 2020

PR description:

instead of reconstruct tracks in different regions, while having already tracks reconstructed globally,
one can select the subset of tracks based on the ROI a-posteriori

these 2 plugins are meant to be used mainly at HLT,
where for instance pixel tracks are reconstructed globally
and then they can be selected around muons, electrons, taus, jets
for the different needs, like seeding tracks for the first iteration in the isolation and b-tagging or reconstructing PV, etc

@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/cms-sw-PR-29359/14451

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@slava77
Copy link
Contributor

slava77 commented Apr 2, 2020

@mtosi
please address #29359 (comment)

Code check has found code style and quality issues which could be resolved by applying following patch(s)

tests can not start without this check passing

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2020

The code-checks are being triggered in jenkins.

@mtosi
Copy link
Contributor Author

mtosi commented Apr 2, 2020

thanks @slava77 ! I overlooked it :(
it should be fixed, now

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2020

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-29359/14490

  • This PR adds an extra 24KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2020

A new Pull Request was created by @mtosi (mia tosi) for master.

It involves the following packages:

RecoTracker/FinalTrackSelectors

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

cms-bot commands are listed here

@slava77
Copy link
Contributor

slava77 commented Apr 2, 2020

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2020

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/5503/console Started: 2020/04/02 17:35

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2020

+1
Tested at: 6ae30ad
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-48ce52/5503/summary.html
CMSSW: CMSSW_11_1_X_2020-04-02-1100
SCRAM_ARCH: slc7_amd64_gcc820

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2020

Comparison job queued.

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2020

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

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 34
  • DQMHistoTests: Total histograms compared: 2692110
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2691790
  • DQMHistoTests: Total skipped: 319
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 33 files compared)
  • Checked 147 log files, 16 edm output root files, 34 DQM output files

explicit TrackSelectorByCandidateRegion(const edm::ParameterSet& conf)
: tracksToken_(consumes<reco::TrackCollection>(conf.getParameter<edm::InputTag>("tracks"))),
beamspotToken_(consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamspot"))) {
edm::ParameterSet trackPSet = conf.getParameter<edm::ParameterSet>("TrackPSet");
Copy link
Contributor

Choose a reason for hiding this comment

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

auto const& trackPSet = getParameterSet("TrackPSet"); should be a bit more effective (no copy)

throw cms::Exception("Configuration")
<< "TrackSelectorByCandidateRegion::chi2vsPt: pt2 needs to be > 0; is " << pt2_;

// for (auto const & ir : conf.getParameter<edm::VParameterSet>("regions")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is this commented out code needed?
Please remove or add comments inline in the code why the commented out block is relevant

<< "TrackSelectorByCandidateRegion::chi2vsPt: pt2 needs to be > 0; is " << pt2_;

// for (auto const & ir : conf.getParameter<edm::VParameterSet>("regions")) {
edm::ParameterSet regionPSet = conf.getParameter<edm::ParameterSet>("RegionPSet");
Copy link
Contributor

Choose a reason for hiding this comment

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

auto const& regionPSet = conf.getParameterSet("RegionPSet");

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this part here and the implementation should be simply calling CandidateSeededTrackingRegionsProducer (via ES or directly).
This will eliminate the reimplementation of already existing code.

mode_ = VERTICES_FIXED;
else if (mode == "VerticesSigma")
mode_ = VERTICES_SIGMA;
// else edm::LogError ("TrackSelectorByCandidateRegion") << "Unknown mode string: " << mode;
Copy link
Contributor

Choose a reason for hiding this comment

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

is this commented out code needed?
Please remove or add comments inline in the code why the commented out block is relevant

* either BeamSpotSigma or BeamSpotFixed mode, depending on the positiveness of nSigmaZBeamSpot.
**/

inputCandidateToken_ = mayConsume<reco::CandidateView>(regionPSet.getParameter<edm::InputTag>("input"));
Copy link
Contributor

Choose a reason for hiding this comment

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

it looks like there are no conditions in the ::produce methods limiting access to this product ==> change to consumes

iEvent.getByToken(tracksToken_, tracksHandle);

// std::cout << "[TrackSelectorByRegion::produce] tracksHandle.isValid ? " << (tracksHandle.isValid() ? "YEAP" : "NOPE") << std::endl;
if (tracksHandle.isValid()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

as in TrackSelectorByCandidateRegion: is there some intrinsic limitation in the HLT to miss writing a track collection in the event? If not, to avoid configuration problems it would be more appropriate to not check for validity and let the job fail if it's incorrectly configured

Comment on lines +110 to +114
// std::cout << "tracks: " << tracks.size() << std::endl;
for (auto trk : tracks) {
const auto pt = trk.pt();
if (pt < minPt_) {
// std::cout << " KO !!! for pt" << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

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

is this commented out code needed?
Please remove or add comments inline in the code why the commented out block is relevant


size_t it = 0;
// std::cout << "tracks: " << tracks.size() << std::endl;
for (auto trk : tracks) {
Copy link
Contributor

Choose a reason for hiding this comment

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

auto const& trk

Comment on lines +122 to +140
// if ( std::abs(trk.vz() - origin[k].z()) > zBound[k] ) {
// std::cout << "std::abs(trk.vz() - origin[k].z()): " << std::abs(trk.vz() - origin[k].z()) << " zBound: " << zBound[k] << std::endl;
// std::cout << "std::abs(trk.dz(origin[k])): " << std::abs(trk.dz(origin[k])) << " zBound: " << zBound[k] << std::endl;
if (std::abs(trk.dz(origin[k])) > zBound[k]) {
// std::cout << " KO !! for z" << std::endl;
continue;
}
// std::cout << "eta : " << eta << " etaMin[k]: " << etaMin[k] << " etaMax[k]: " << etaMax[k] << std::endl;
if (eta < etaMin[k]) {
// std::cout << " KO !!! for eta" << std::endl;
continue;
}
if (eta > etaMax[k]) {
// std::cout << " KO !!! for eta" << std::endl;
continue;
}
// std::cout << "phi: " << phi << " phi0[k]: " << phi0[k] << " std::abs(reco::deltaPhi(phi,phi0[k])): " << std::abs(reco::deltaPhi(phi,phi0[k])) << " phi0margin: " << phi0margin[k] << std::endl;
if (std::abs(reco::deltaPhi(phi, phi0[k])) > phi0margin[k] * 1.1) {
// std::cout << " KO !!! for phi" << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

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

is this commented out code needed?
If debugging is still expected, please add it with LogTrace or LogDebug or similar so that necessary parts can be checked without rewriting the code

continue;
}
// std::cout << "phi: " << phi << " phi0[k]: " << phi0[k] << " std::abs(reco::deltaPhi(phi,phi0[k])): " << std::abs(reco::deltaPhi(phi,phi0[k])) << " phi0margin: " << phi0margin[k] << std::endl;
if (std::abs(reco::deltaPhi(phi, phi0[k])) > phi0margin[k] * 1.1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why 1.1? Is this an external additional scaling? If so, perhaps it should be made configurable.

@slava77
Copy link
Contributor

slava77 commented Apr 22, 2020

@mtosi
please clarify on the status of addressing the PR review.
Thank you.

@mtosi
Copy link
Contributor Author

mtosi commented Apr 23, 2020

ciao, thanks for this reminder, I slowly progress :(
I'll follow the suggestion and make use of the already available TrackingRegions produced via the standard EDProducer ..

@silviodonato
Copy link
Contributor

Kind reminder @mtosi

@silviodonato
Copy link
Contributor

Kind reminder @mtosi . We will close CMSSW_11_1_0_pre7 tomorrow.

@mtosi
Copy link
Contributor Author

mtosi commented May 4, 2020

thanks @silviodonato, I'm afraid I need some extra time :(

@slava77
Copy link
Contributor

slava77 commented May 7, 2020

there is a merge conflict here now

@mtosi
Copy link
Contributor Author

mtosi commented May 7, 2020

thanks @slava77

@slava77
Copy link
Contributor

slava77 commented May 14, 2020

@mtosi
please clarify on the status of addressing the PR review.
Thank you.

@slava77
Copy link
Contributor

slava77 commented May 21, 2020

-1

just taking this off our list for now, since updates are needed anyways

@silviodonato
Copy link
Contributor

Please let me know as soon as you want to open back this PR.

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.

5 participants