Skip to content
Snippets Groups Projects

DerivationFrameworkTau: fix duplicate tau removal

Merged Bertrand Martin Dit Latour requested to merge martindl/athena:main_duplicatetau into main
1 unresolved thread

Hello,

We have a weakness in the RAWtoALL tau reconstruction that can produce taus with same (eta,phi) although they are built from different seed jets. A protection was implemented in AOD->DAOD, but there was an issue with vector element removal while iterating over the vector: the vector size changes while iterating. If we have 3 duplicate taus consecutive in the vector (should be extremely rare), the existing protection would retain 2 taus. To fix this, the loop index is incremented only when no duplicate is found.

Tagging @ademaria .

Cheers, Bertrand

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
83 83 }
84 84
85
86 if(tausToKeep.size() >0) {
87 for(size_t i=0; i < tausToKeep.size()-1; i++){
88 for (size_t j=i+1; j < tausToKeep.size(); j++){
89 if( (tausToKeep.at(i)->p4().DeltaR(tausToKeep.at(j)->p4())) < 0.01){
90 ATH_MSG_WARNING("Found duplicated tau with eta " << tausToKeep.at(j)->eta() << " phi " << tausToKeep.at(j)->phi() << " pt " << tausToKeep.at(j)->pt() << ". Removing it ...");
91 tausToKeep.erase( tausToKeep.begin()+j);
92 }
85 // protection against duplicate taus -- built from different seed jets, but end up having same (eta,phi)
86 for (auto it=tausToKeep.begin(); it!=tausToKeep.end(); ++it) {
87 for (auto it2=std::next(it); it2!=tausToKeep.end(); ) {
88 if ((*it)->p4().DeltaR((*it2)->p4()) < 0.01) {
89 ATH_MSG_WARNING("Found duplicate tau with eta=" << (*it2)->eta() << " phi=" << (*it2)->phi() << " pt=" << (*it2)->pt() << ". Removing it, keep tau with pt=" << (*it)->pt());
90 it2 = tausToKeep.erase(it2);
  • Antonio De Maria mentioned in merge request !77162 (merged)

    mentioned in merge request !77162 (merged)

  • Please register or sign in to reply
    Loading