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 tau3mu HLT producer #19696

Merged
merged 7 commits into from Jul 18, 2017
Merged

Add tau3mu HLT producer #19696

merged 7 commits into from Jul 18, 2017

Conversation

rmanzoni
Copy link
Contributor

Add new HLT producer that builds a reco::CompositeCandidate tau out of 3 muons.
Then it applies further selection, most notably tracker based isolation around the tau candidate.

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @rmanzoni (Riccardo Manzoni) for master.

It involves the following packages:

HLTrigger/Muon

@Martin-Grunewald, @silviodonato, @cmsbuild, @fwyzard, @davidlange6 can you please review it and eventually sign? Thanks.
@battibass, @abbiendi, @jhgoh, @Martin-Grunewald, @calderona, @HuguesBrun, @trocino this is something you requested to watch as well.
@davidlange6 you are the release manager for this.

cms-bot commands are listed here

// Create the 3-muon candidates
// loop over L3/Trk muons and create all combinations
for (unsigned int i = 0; i != AllMuCands->size(); ++i){
const reco::TrackRef &tk_i = (*AllMuCands)[i].track();
Copy link
Contributor

Choose a reason for hiding this comment

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

Use some modern-style loop constructs such as for (auto const & muon : AllMuCands) {...
for these three loops.

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 think I prefer this style, as it is more legible.
auto obfuscates things, IMO, and I'm not sure that nested range-based loops would improve the legibility.

But let me try anyways and see if it ends up nicely enough.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you can use a range-based for loop here, since you use the index of the outer loop as the starting point of the inner loop, and so on.

It might be slightly more efficient using iterators, but the difference is probably negligible:

auto AllMuCands_end = AllMuCands->end();
for (auto i = AllMuCands->begin(); i != AllMuCands_end; ++i) {
    const reco::TrackRef &tk_i = i->track();
    for (auto j = i+1; j != AllMuCands_end; ++j) {
        const reco::TrackRef &tk_j = j->track();
        ...

and so on

Copy link
Contributor

Choose a reason for hiding this comment

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

ah yes, of course!

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, understood.
So I give up my attempts at playing magic with ranges and move to iterators

Copy link
Contributor

Choose a reason for hiding this comment

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

Or just leave the indices here, if you find it more readable. The difference is just a multiplication and a sum.

if ( itau->pt() < TriMuonPtCut_ ) continue;
if ( itau->mass() < MinTriMuonMass_) continue;
if ( itau->mass() > MaxTriMuonMass_) continue;
if (abs(itau->eta()) > TriMuonEtaCut_ ) continue;
Copy link
Contributor

Choose a reason for hiding this comment

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

Use std::abs instead of just abs everywhere

Copy link
Contributor

Choose a reason for hiding this comment

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

indeed, abs will truncate to an integer !

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, pretty lame of me

for (unsigned int k = j+1; k != AllMuCands->size(); ++k){
const reco::TrackRef &tk_k = (*AllMuCands)[k].track();

int passingPreviousFilter_1 = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be calculated in the first loop

const reco::TrackRef &tk_k = (*AllMuCands)[k].track();

int passingPreviousFilter_1 = 0;
int passingPreviousFilter_2 = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be calculated and kept in the 2nd loop


int passingPreviousFilter_1 = 0;
int passingPreviousFilter_2 = 0;
int passingPreviousFilter_3 = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Only this would need to be calculated within the 3rd loop

if (((passingPreviousFilter_1 < 1) & (passingPreviousFilter_2 < 1)) ||
((passingPreviousFilter_1 < 1) & (passingPreviousFilter_3 < 1)) ||
((passingPreviousFilter_2 < 1) & (passingPreviousFilter_3 < 1))) continue;

Copy link
Contributor

Choose a reason for hiding this comment

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

IOW, the above should be caluclated less often in the corresponding loop for i/1, j/2 and k/3.

if (!( (passingPreviousFilter_1 & passingPreviousFilter_2 ) ||
(passingPreviousFilter_1 & passingPreviousFilter_3 ) ||
(passingPreviousFilter_2 & passingPreviousFilter_3 ) )) continue;

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, if the passingPreviousFilter_1/2/3 were all unsigned ints - either 0 or 1,
then the condition would be simply passingPreviousFilter_1+passingPreviousFilter_2+passingPreviousFilter_3<3

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 tried it, but I found out that you can have the same muon appearing twice in the output of the previous filter, just because there is more than one combination that picks it up.

For example if the two good pairs are (1,2) and (1,3), you end up having 1 appearing twice and that would bump the sum up artificially

Copy link
Contributor Author

@rmanzoni rmanzoni Jul 14, 2017

Choose a reason for hiding this comment

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

In light of the comment you made below, here the condition reduces to checking that
passingPreviousFilter_3 is true, correct?

wrong...

Copy link
Contributor

Choose a reason for hiding this comment

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

You mean the same muons appears twice in the collection?
Otherwise, the nested loops start at +1 index off the outer loop index, so the same
muon is not used twice.

Copy link
Contributor

Choose a reason for hiding this comment

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

IOW, even with (1,2) and (1,3), passingPreviousFilter_1 would be at most 1.

Copy link
Contributor Author

@rmanzoni rmanzoni Jul 14, 2017

Choose a reason for hiding this comment

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

the same muon can appear more than once in PassedL3Muons, so if I loop on the entire PassedL3Muons collection for each muon of AllMuCands, even in the nested loop, that muon of AllMuCands can bump the counter several times

reco::TrackRef candTrkRef = (*imu)->get<reco::TrackRef>();
if (reco::deltaR2(tk_j->momentum(), candTrkRef->momentum()) < (0.03*0.03)) passingPreviousFilter_2 = true;
}
for (auto k = j+1; k != AllMuCands_end; ++k){
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to execute 3rd loop if passingPreviousFilter_1 and passingPreviousFilter_2 are both FALSE (or 0).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point

const reco::TrackRef &tk_i = i->track();
for (std::vector<reco::RecoChargedCandidateRef>::const_iterator imu = PassedL3Muons.begin(); imu != PassedL3Muons.end(); ++imu){
reco::TrackRef candTrkRef = (*imu)->get<reco::TrackRef>();
if (reco::deltaR2(tk_i->momentum(), candTrkRef->momentum()) < (0.03*0.03)) passingPreviousFilter_1 = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

0.03 is a magic number - better make it a configurable plugin parameter and of course add it to fillDescriptions()

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

@Martin-Grunewald
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 15, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/21503/console Started: 2017/07/15 15:37

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Pull request #19696 was updated. @Martin-Grunewald, @silviodonato, @cmsbuild, @fwyzard, @davidlange6 can you please check and sign again.

@Martin-Grunewald
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 18, 2017

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

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@Martin-Grunewald
Copy link
Contributor

+1

@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

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-19696/21548/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: 2025409
  • DQMHistoTests: Total failures: 108
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2025135
  • DQMHistoTests: Total skipped: 166
  • DQMHistoTests: Total Missing objects: 0
  • Checked 93 log files, 14 edm output root files, 23 DQM output files

@davidlange6
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 6d67a00 into cms-sw:master Jul 18, 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