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

Generalize DetId parsing in TrackingNtuple #18403

Closed
wants to merge 3 commits into from

Conversation

makortel
Copy link
Contributor

This PR generalizes the (tracker) DetId parsing in the TrackingNtuple python library to be agnostic on the detector geometry. The chosen approach is to dump the TrackerTopology constants to the output root file, and use them in the python library. While it leads to some code duplication, it allows flexible debugging (including the TrackerTopology constants) without increasing the ntuple size (and if all the pieces of DetIds were stored on separate branches, one would have to deal with the fact that BPix/FPix and TIB/TID/TOB/TEC DetIds have different structure).

Tested in 9_1_0_pre2, no changes expected.

@rovere @VinInn @ebrondol

@cmsbuild cmsbuild added this to the Next CMSSW_9_1_X milestone Apr 19, 2017
@makortel
Copy link
Contributor Author

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 19, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/19248/console Started: 2017/04/19 14:27

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @makortel (Matti Kortelainen) for master.

It involves the following packages:

DataFormats/TrackerCommon
Validation/RecoTrack

@perrotta, @dmitrijus, @cmsbuild, @slava77, @vanbesien, @davidlange6 can you please review it and eventually sign? Thanks.
@felicepantaleo, @GiacomoSguazzoni, @rovere, @VinInn, @wmtford, @gpetruc, @ebrondol, @mtosi, @dgulhan this is something you requested to watch as well.
@Muzaffar, @davidlange6, @smuzaffar you are the release manager for this.

cms-bot commands are listed here #13028

@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-18403/19248/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 3311 differences found in the comparisons
  • DQMHistoTests: Total files compared: 23
  • DQMHistoTests: Total histograms compared: 1826239
  • DQMHistoTests: Total failures: 59522
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 1766544
  • DQMHistoTests: Total skipped: 173
  • DQMHistoTests: Total Missing objects: 0
  • Checked 94 log files, 14 edm output root files, 23 DQM output files

const TOBValues& tobVals() const { return tobVals_; }
const TIBValues& tibVals() const { return tibVals_; }
const TIDValues& tidVals() const { return tidVals_; }
const TECValues& tecVals() const { return tecVals_; }
Copy link
Contributor

Choose a reason for hiding this comment

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

This exposure was attempted earlier in #14230 , but it was eventually reverted in #14586 following comments from @davidlange6

@makortel
please check the discussion in #14230 and see if exposure of the internals can be avoided

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@slava77 The difference wrt. #14586/#14230 is that here I'd like to not do the DetId parsing in CMSSW, but dump the constants and do the parsing afterwards (in PyROOT, in principle independently of CMSSW).

If this exposure of TrackerTopology internals is to be avoided at all cost, I can implement the detector generalization to the ntuple in another way (essentially adding a branch for each element the union of possible DetId elements per pixel and strip subdetectors (*), which doesn't look too nice but is the simplest alternative).

(*) e.g. for pixels: layer, ladder, module, side, disk, blade, panel

Copy link
Contributor

Choose a reason for hiding this comment

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

it all sounds like a work-around the inability to persist the TrackerTopology or recreate it from an fwlite/root environment.
So, if there was a dictionary for TrackerTopology, it would be enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Kind of, yes. A complication is that the TrackerTopology constants are read from GT (not sure how that would work with fwlite; pardon my ignorance).

Copy link
Contributor

Choose a reason for hiding this comment

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

GT is needed to create a TrackerTopology object from scratch.
If it's available in the ntupling cmsRun job and can be persisted, then it should be possible to get all functionality needed from fwlite.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I was able to put TrackerTopology in the resulting root file after

  • adding default constructor to TrackerTopology
  • removing const from all TrackerTopology members
  • adding dictionaries for TrackerTopology and all the inner structs (PixelBarrelValues etc)
  • storing the TrackerTopology to another TTree (as the only branch and entry)
    • TFileService::make<TrackerTopology> complained that TrackerTopology does not inherit from TObject

From the usage point of view it is a bit unpleasant to have to convert the detid number to DetId object, e.g. ttopo.pxbLayer(ROOT.DetId(303087632)), but it's not that big of a deal.

Would persisting TrackerTopology be the preferred solution then?

Copy link
Contributor

Choose a reason for hiding this comment

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

@davidlange6
please comment on the alternative to make TrackerTopology persistable so that the functionality desired in this PR is available outside of cmsRun application

Copy link
Contributor

Choose a reason for hiding this comment

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

did you consider just storing the "fields" that get packed into the detid individually? That would be the usual "tuple"-ing approach

Copy link
Contributor

Choose a reason for hiding this comment

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

i gather from the comment that you did - seems like the size penalty would be small and avoids duplicating all the parsing of detid code and internals. (squashing the various fields into one set of fields based on subdetid seems not hard)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. I'll prototype that approach as well (it's probably not a big deal).

@slava77
Copy link
Contributor

slava77 commented Apr 21, 2017 via email

@makortel
Copy link
Contributor Author

removing const from all TrackerTopology members

I'm curious why this is needed

Because of the added default constructor, which itself appears to be needed to read the object from a file.

@dmitrijus
Copy link
Contributor

+1

@makortel
Copy link
Contributor Author

I bit the bullet and the alternative implementation is here #18491.

Closing this one.

@makortel makortel closed this Apr 27, 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

5 participants