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

Deprecation of T**DetId in CalibTracker #19393

Merged

Conversation

alesaggio
Copy link
Contributor

In the modified files we don't have a way to access the edm::EventSetup, hence the TrackerTopology cannot be retrieved. The only solution is to get specific pieces of code from T**DetId.h (in such a way that it's not easy to use from elsewhere).

cc @pieterdavid @OlivierBondu @vidalm

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @alesaggio for master.

It involves the following packages:

CalibTracker/SiStripChannelGain
CalibTracker/SiStripLorentzAngle

@ghellwig, @arunhep, @cerminar, @cmsbuild, @franzoni, @davidlange6 can you please review it and eventually sign? Thanks.
@ghellwig, @gbenelli, @tocheng, @jlagram, @OlivierBondu, @mmusich this is something you requested to watch as well.
@davidlange6 you are the release manager for this.

cms-bot commands are listed here

uint32_t getTIDwheel ( DetId detId ) { return ((detId.rawId()>>11) & 0x3); };
uint32_t getTECside ( DetId detId ) { return ((detId.rawId()>>18) & 0x3); };
uint32_t getTECring ( DetId detId ) { return ((detId.rawId()>> 5) & 0x7); };
uint32_t getTECwheel ( DetId detId ) { return ((detId.rawId()>>14) & 0xF); };
Copy link
Contributor

Choose a reason for hiding this comment

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

@mdelcourt I think you are the main user for this code.
Can you just have a cross-check look? Thanks.

@mmusich
Copy link
Contributor

mmusich commented Jun 21, 2017

tracked at #19398

@delaere
Copy link
Contributor

delaere commented Jun 22, 2017

I would suggest to take a different approach for these macros: instead of recoding the detid methods (or TrackerTopology methods), you could instantiate your own TrackerTopology. The only thing you have to do is to hardcode one instance of the TOBValues struct (and others). I think that it makes the code more readable and easy to change since all hardcoded values are there and not in the various methods.

It makes the code more similar to the rest of CMSSW, and moves the burden/risk to the definition of these structs, in sync with the geometry.

Maybe (later?) this could even be read from trackerParameters.xml

@davidlange6
Copy link
Contributor

eg a new constructor to TrackerTopology

TrackerTopology::TrackerTopology(enum LegacyTrackerNumbering)

it could have a rather big impact on any code called from a tight loop.

@davidlange6
Copy link
Contributor

but at least centralizes all the hardwired numbers that will eventually be wrong

@cmsbuild
Copy link
Contributor

Pull request #19393 was updated. @perrotta, @ghellwig, @arunhep, @cerminar, @cmsbuild, @franzoni, @slava77, @davidlange6, @lpernie can you please check and sign again.

@alesaggio
Copy link
Contributor Author

I added a header file (LegacyTrackerTopology.h) that hardcodes TrackerTopology instances as discussed above. Please let me know what you think

#include <boost/lexical_cast.hpp>
#include <TChain.h>
#include <TFile.h>

namespace {
Copy link
Contributor

Choose a reason for hiding this comment

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

@alesaggio is this still needed after having introduced the LegacyTopology stuff?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, indeed! I'll fix it


namespace LegacyTrackerTopology {

inline static std::unique_ptr<TrackerTopology> getTrackerTopology()
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @alesaggio,
I think there might be a bit of ambiguity on what "Legacy" actually means in this context for what concern the Pixel part. Your implementation here is for Phase-0 Pixel Tracker only - I think it should be written somewhere as a disclaimer or allow the possibility to construct the Topology in this way also for Phase-I detector (since Phase0 Strips overlap in time with Phase-I Pixel, i.e. the current detector)

unsigned layer = isTIB ? tTopo_->tibLayer(detid) : tTopo_->tobLayer(detid);
bool stereo = isTIB ? tTopo_->tibStereo(detid) : tTopo_->tobStereo(detid);

return subdetLabel(detid)+"_layer"+boost::lexical_cast<std::string>(layer)+(stereo?"s":"a");
Copy link
Contributor

Choose a reason for hiding this comment

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

in light of #19645 I guess you can get rid of the ugly boost::lexical_cast in favor of std::to_string

@cmsbuild
Copy link
Contributor

Pull request #19393 was updated. @perrotta, @ghellwig, @arunhep, @cerminar, @cmsbuild, @franzoni, @slava77, @davidlange6, @lpernie can you please check and sign again.

2 similar comments
@cmsbuild
Copy link
Contributor

Pull request #19393 was updated. @perrotta, @ghellwig, @arunhep, @cerminar, @cmsbuild, @franzoni, @slava77, @davidlange6, @lpernie can you please check and sign again.

@cmsbuild
Copy link
Contributor

Pull request #19393 was updated. @perrotta, @ghellwig, @arunhep, @cerminar, @cmsbuild, @franzoni, @slava77, @davidlange6, @lpernie can you please check and sign again.

#include <memory>

// WARNING: this header has been introduced to call a TrackerTopology
// object whenever it is not possible to access it through an EventSetup.
Copy link
Contributor

Choose a reason for hiding this comment

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

what are the cases where the EventSetup can not deliver this?
TrackerTopologyEP and relevant upstream can be set up to provide the phase-0 topology just as it is done in normal running.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @slava77, a couple of use cases are:

The proposed implementation is actually inspired by David's #19393 (comment), though I am not sure this is exactly what he had in mind at the time.

@slava77
Copy link
Contributor

slava77 commented Jul 20, 2017

-1

merge conflicts

also, the hardcoded pieces in LegacyTrackerTopology.h do not seem appropriate, given that there are ways to get the details from ES as it's done for all other tracker configurations.

@pieterdavid
Copy link
Contributor

I'm sorry, I did not think about that, I will move it somewhere else.
Would CalibTracker/SiStripCommon be a good place to put this?

@cmsbuild
Copy link
Contributor

Pull request #19393 was updated. @ghellwig, @arunhep, @cerminar, @cmsbuild, @franzoni, @davidlange6, @lpernie can you please check and sign again.

}
}
}
} catch (...) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@alesaggio @pieterdavid I think that the catch(...) construct is disallowed in CMSSW, at least it is flagged as violation of a code rule by the static analyzer.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for reviewing. I added an explicit catch for the remaining ones that xerces may throw

@cmsbuild
Copy link
Contributor

Pull request #19393 was updated. @ghellwig, @arunhep, @cerminar, @cmsbuild, @franzoni, @davidlange6, @lpernie can you please check and sign again.

@mmusich
Copy link
Contributor

mmusich commented Jul 28, 2017

@arunhep @franzoni @lpernie can this PR be tested? Thanks

@arunhep
Copy link
Contributor

arunhep commented Jul 30, 2017

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 30, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/21895/console Started: 2017/07/30 21:53

@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-19393/21895/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 23
  • DQMHistoTests: Total histograms compared: 2446803
  • DQMHistoTests: Total failures: 71143
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2375494
  • DQMHistoTests: Total skipped: 166
  • DQMHistoTests: Total Missing objects: 0
  • Checked 93 log files, 14 edm output root files, 23 DQM output files

@cmsbuild
Copy link
Contributor

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 requires discussion in the ORP meeting before it's merged. @davidlange6, @smuzaffar

@@ -7,6 +7,8 @@

from CalibTracker.SiStripLorentzAngle.MeasureLA_cff import METHOD_WIDTH, METHOD_PROB1, METHOD_AVGV2, METHOD_AVGV3, METHOD_RMSV2, METHOD_RMSV3

process.load('Configuration.Geometry.GeometryIdeal_cff')
Copy link
Contributor

Choose a reason for hiding this comment

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

hi @alesaggio - you may want to confirm this is the geometry CFF that you want. It is usually the wrong one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @davidlange6, how can I know which one is correct? I have no clue. Maybe @mmusich or @dimattia know?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @alesaggio, I think that Configuration.Geometry.GeometryRecoDB_cff shall suffice for this use-case. We can follow to this one in another PR, the CalibTracker/SiStripLorentzAngle needs anyway heavy maintenance.

@davidlange6
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 62dd533 into cms-sw:master Aug 7, 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