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

E/gamma HLT L1 Track Isolation Producer & TTTrack typedef: 11_3_X #32594

Merged
merged 5 commits into from Jan 14, 2021

Conversation

Sam-Harper
Copy link
Contributor

PR description:

This is allows track isolation with L1 tracks to be produced for electrons for the E/g HLT. Part of this PR also introduces a typedef for a TTTrack<Ref_Phase2TrackerDigi_> to L1Track. This in my opinion should have been done a long time ago and such a typedef needs to exist centrally as people are already making their own. I dont care too much about the name.

Additionally in validation a "bug" was found with the track ambiguity solving for electrons in the HLT which will be fixed at a later date. Ie we seem to be picking the wrong track in a few cases and we should solve it.

Note, an example test config will not be provided for 11_3_X because of the difficulties of porting the HLT phase II between releases. A test config can be provided for 11_1_X on request but it'll be 50K lines of python

PR validation:

Tested in phase-II HLT setup and gives expected results.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-32594/20622

  • This PR adds an extra 24KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @Sam-Harper (Sam Harper) for master.

It involves the following packages:

DataFormats/L1TrackTrigger
RecoEgamma/EgammaHLTProducers
RecoEgamma/EgammaIsolationAlgos

@perrotta, @cmsbuild, @fwyzard, @kpedro88, @jmduarte, @Martin-Grunewald, @rekovic, @slava77, @jpata can you please review it and eventually sign? Thanks.
@sobhatta, @jainshilpi, @Fedespring, @lgray, @calderona, @HuguesBrun, @rovere, @sviret, @afiqaize, @varuns23, @cericeci, @ram1123 this is something you requested to watch as well.
@silviodonato, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

class EgammaHLTEleL1TrackIsolProducer : public edm::global::EDProducer<> {
public:
explicit EgammaHLTEleL1TrackIsolProducer(const edm::ParameterSet&);
~EgammaHLTEleL1TrackIsolProducer() override;
Copy link
Contributor

@fwyzard fwyzard Dec 31, 2020

Choose a reason for hiding this comment

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

just a suggestion:

Suggested change
~EgammaHLTEleL1TrackIsolProducer() override;
~EgammaHLTEleL1TrackIsolProducer() override = default;

and drop the out-of-line implementation below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, done, of course this is better :)

@fwyzard
Copy link
Contributor

fwyzard commented Dec 31, 2020

allow @Sam-Harper test rights

@fwyzard
Copy link
Contributor

fwyzard commented Dec 31, 2020

please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-863d8c/11910/summary.html
CMSSW: CMSSW_11_3_X_2020-12-31-1100/slc7_amd64_gcc900

Comparison Summary

@slava77 comparisons for the following workflows were not done due to missing matrix map:

  • /build/cmsbld/jenkins/workspace/compare-root-files-short-matrix/data/PR-863d8c/1325.81_TTbar_13_106Xv1NanoAODINPUT+TTbar_13_106Xv1NanoAODINPUT+NANOEDMMC2017_106XMiniAODv1+HARVESTNANOAODMC2017_106XMiniAODv1
  • /build/cmsbld/jenkins/workspace/compare-root-files-short-matrix/data/PR-863d8c/136.8523_RunJetHT2018C_nanoULremini+RunJetHT2018C_nanoULremini+NANOEDM2018_106Xv2+HARVESTNANOAOD2018_106Xv2

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 37
  • DQMHistoTests: Total histograms compared: 2716967
  • DQMHistoTests: Total failures: 4
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2716941
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 36 files compared)
  • Checked 156 log files, 37 edm output root files, 37 DQM output files

//based on the work of Swagata Mukherjee and Giulia Sorrentino

class EgammaL1TkIsolation {
public:
Copy link
Contributor

Choose a reason for hiding this comment

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

CMS code rule 4.25 (http://cms-sw.github.io/cms_coding_rules.html): "Each class may have only one each of public, protected, and private sections, which must be declared in that order."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

to be pedantic, per 4.26, the order of functions in the .h and .cc should also be the same

float minDEta;
float maxDZ;
explicit TrkCuts(const edm::ParameterSet& para);
static edm::ParameterSetDescription pSetDescript();
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be nicer to call this fillPSetDescription(), following the naming scheme from https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideConfigurationValidationAndHelp#A_Plugin_Module_Using_Another_He (also for the instance below). Even better if it follows the pattern with edm::ParameterSetDescription& iDesc provided as an argument rather than a return value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so this makes it cumbersome to use later on, eg here:

desc.add("isolCfg", EgammaL1TkIsolation::pSetDescript());

However hypothetically (though unlikely) somebody may wish to have this functionality and so I have provided both interfaces.

Copy link
Contributor

Choose a reason for hiding this comment

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

That line would just need to change to:

EgammaL1TkIsolation::fillPSetDescription(desc);

(and then fillPSetDescription() would call desc.add(...))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

still two lines and less clear than before? I dont see the problem with makePSetDescription() given I also supply a fillPSetDescription()

Copy link
Contributor

Choose a reason for hiding this comment

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

@makortel please clarify how strongly the recommended pattern should be enforced

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the makePSetDescription() that returns a edm::ParameterSetDescription works fine here.

(for non-helper-plugin use cases I think the naming convention of ...PSetDescription is more important than whether the ParameterSetDescription is passed as an out-argument or returned)

double ptSum = 0.;
int nrTrks = 0;

const TrkCuts& cuts = std::abs(objEta) < 1.5 ? barrelCuts_ : endcapCuts_;
Copy link
Contributor

Choose a reason for hiding this comment

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

magic number 1.5 should be named constant (or obtained from geometry...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

made it configurable as its more a parameter than a strict geometry based variable


const TrkCuts& cuts = std::abs(objEta) < 1.5 ? barrelCuts_ : endcapCuts_;

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.

const auto&

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ta missed that.

@swagata87
Copy link
Contributor

Hi,
just wanted to point out a couple of minor things about the typedef

typedef of TTTrack<Ref_Phase2TrackerDigi_> is also available under namespace l1t in DataFormats/L1TCorrelator/interface/, inside L1CaloTkTau.h, TkEGTau.h etc. The typedef name is different though. They use this:
typedef TTTrack<Ref_Phase2TrackerDigi_> L1TTTrackType;
typedef std::vector L1TTTrackCollection;
is it an option to just use this typedef?

but I understand that having the typedef in DataFormats/L1TrackTrigger/interface/L1Track.h is much better, as it is more central/generic place.

but another L1Track.h exists under DataFormats/L1CSCTrackFinder/interface/
there, inside namespace csc, they have a class called L1Track,
while this PR introduces the following typedef:
using L1Track = TTTrack<Ref_Phase2TrackerDigi_>;
so to avoid any situation of ambiguity in future, may be it is safer to use a different name of the typedef?

I had a quick chat with @guitargeek , and he suggested some things. I request him to write his suggestions here. Thanks!

@guitargeek
Copy link
Contributor

Okay, sure! My suggestion would be to adapt the names of the previously existing aliases in DataFormats/L1TrackTrigger/interface/L1Track.h, which would mean to rename the file to L1TTTrack.h (or even L1TrackTriggerTrack.h for more clarity).

The content of the file would then be:

using L1TTTrack = TTTrack<Ref_Phase2TrackerDigi_>;
using L1TTTrackCollection = std::vector<L1Track>;

The file can then also be included in the https://github.com/cms-sw/cmssw/blob/master/DataFormats/L1TCorrelator/interface files to ensure consistency.

@fwyzard
Copy link
Contributor

fwyzard commented Jan 3, 2021

typedef of TTTrack<Ref_Phase2TrackerDigi_> is also available under namespace l1t in DataFormats/L1TCorrelator/interface/, inside L1CaloTkTau.h, TkEGTau.h etc. The typedef name is different though. They use this:
typedef TTTrack<Ref_Phase2TrackerDigi_> L1TTTrackType;

In general, the class or type names used in CMS software do not have Type appended to them (unless they are used to handle types, e.g. BranchType)

Also, L1TTTrack (short for L1 Track Trigger Track ?) is more cumbersome than just L1Track.

typedef std::vector L1TTTrackCollection;
is it an option to just use this typedef?

Just add L1Track as proposed here, and adapt he existing code to use it.

but another L1Track.h exists under DataFormats/L1CSCTrackFinder/interface/
there, inside namespace csc, they have a class called L1Track

Well, yes, that is what namespaces are for: to distinguish csc::L1Track from L1Track.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 5, 2021

Pull request #32594 was updated. @perrotta, @cmsbuild, @fwyzard, @kpedro88, @jmduarte, @Martin-Grunewald, @rekovic, @srimanob, @slava77, @jpata can you please check and sign again.

@jpata jpata mentioned this pull request Jan 6, 2021
@jpata
Copy link
Contributor

jpata commented Jan 6, 2021

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 6, 2021

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-863d8c/11987/summary.html
COMMIT: 58356aa
CMSSW: CMSSW_11_3_X_2021-01-05-2300/slc7_amd64_gcc900

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 37
  • DQMHistoTests: Total histograms compared: 2716967
  • DQMHistoTests: Total failures: 6
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 2716938
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: -0.004 KiB( 36 files compared)
  • DQMHistoSizes: changed ( 312.0 ): -0.004 KiB MessageLogger/Warnings
  • Checked 156 log files, 37 edm output root files, 37 DQM output files

#include "DataFormats/L1TrackTrigger/interface/TTTypes.h"
#include <vector>

using L1Track = TTTrack<Ref_Phase2TrackerDigi_>;
Copy link
Contributor

Choose a reason for hiding this comment

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

it was pointed out by Slava that this name is generic enough and might be more safer in a namespace, to avoid potential future symbol conficts. This is not strictly a reco file, so I let someone else give their suggestion as to what this could be.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure on this, I honestly have no preference, perhaps @rekovic could comment on what the L1 prefers here?

For what its worth on this point, I agree. I would have stuck it in whatever namespace TTrack is in but its in none.

Copy link
Contributor

@slava77 slava77 Jan 7, 2021

Choose a reason for hiding this comment

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

IIRC there is an l1t namespace.
Perhaps we can place it there?
The full name l1t::L1Track is a bit redundant though.

BTW, are there any other cases of TTTrack instances? How would those be named with a typedef in a similar pattern?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I dont believe there are any other such instances after having a brief but not exhaustive look. I'm fine with l1t::L1Track, we could also have l1t::TTTrack but given most code using a TTTrack is likely in the l1t namespace, its probably a bad idea. Last option would be l1t::Phase2Track which is a bit longer but also acceptable to me. I really have little preference here so if people have strong feelings I'm happy to change it to whatever.

I'll give it a little while to see if Vladimir comments.

Copy link
Contributor

@slava77 slava77 Jan 7, 2021

Choose a reason for hiding this comment

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

I should clarify one point: my main concern in the earlier discussion with @jpata was a possible conflict in compiled symbols. With a bit more thought, a typedef is just a synonym (it does not define a new type or compiled symbol) and a conflict if any will be at compile time and will be easily manageable.
So, perhaps there is no problem after all.

@jpata
Copy link
Contributor

jpata commented Jan 11, 2021

+reconstruction

  • adds EgammaHLTEleL1TrackIsolProducer and a related EgammaL1TkIsolation helper class
  • tests pass with no difference, none is expected, as per previous discussions, this code does not run in the tests
  • the validation was done by the authors and reported in the description to be successful

@Martin-Grunewald
Copy link
Contributor

+1

@rekovic
Copy link
Contributor

rekovic commented Jan 13, 2021

+1

@srimanob
Copy link
Contributor

+Upgrade

@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 will now be reviewed by the release team before it's merged. @silviodonato, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@qliphy
Copy link
Contributor

qliphy commented Jan 14, 2021

+1

@cmsbuild cmsbuild merged commit 82f177e into cms-sw:master Jan 14, 2021
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