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

work impactkit #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions contrib-05-PersistReco/PersistReco.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
The PersistReco flag available in Turbo stream HLT2 lines allows all the reconstructed objects in an event to be saved to disk, rather than the usual behaviour of saving only the selected candidate. The objects can then be used in DaVinci just like in the stripping. This is useful when one wants to do things like spectroscopy studies, where there may be many final states of interesting that re-use the same ground state particle. Today, there is a bug that can cause the same underlying particle object to be used multiple times when building a decay. For example, if one takes a D0 → K-π+ candidate that fired an HLT2 line, and adds a pion from PersistReco, it is possible to end up with D0 π candidates where the pion from the D0 is also used as the bachelor. This behaviour should not occur, as it is not physical and is not useful for analysis, and can even give spurious physics results.

We had a look at the CombineParticles() function to see where the overlap could be caused. There we found out that
the function CombineParticles()::checkOverlap() normally ensures this does not happen. However, objects were cloned and
saved at a new memory address, so that the same particles could be used again leading to unphysical situations. As each object has its own lhcbID, based on this a more thorough check can prevent any duplicates. The else statement below was added to the code "Phys/DaVinciOverlapsAndClones/src/CheckOverlap.cpp", in which the lhcbID check is done.

```C++
//===========================================================================
// Check duplicate entries
//===========================================================================
bool CheckOverlap::searchOverlap( std::vector<const LHCb::ProtoParticle* > & proto )
{
if (msgLevel(MSG::VERBOSE)) verbose() << "searchOverlap(protos)" << endmsg ;
// It its a simple particle made from protoparticle. Check.

for (std::vector<const LHCb::ProtoParticle* >::const_iterator i = proto.begin();
i != proto.end() ; ++i)
{
for (std::vector<const LHCb::ProtoParticle* >::const_iterator j = i ;
j != proto.end(); ++j)
{
if (j==i) continue ;
if ( *i==*j )
{
if (msgLevel(MSG::VERBOSE)) verbose() << "Found overlap " << *i << endmsg ;
return true ;
}
else {
const std::vector<LHCb::LHCbID> i_ids = (*i)->track()->lhcbIDs();
const std::vector<LHCb::LHCbID> j_ids = (*j)->track()->lhcbIDs();
std::vector<LHCb::LHCbID> diff;
std::set_symmetric_difference(i_ids.begin(), i_ids.end(), j_ids.begin(), j_ids.end(), std::back_inserter(diff));

if (std::all_of(diff.begin(), diff.end(), [] (LHCb::LHCbID id) { return id.isCalo(); } ))
Copy link
Member

Choose a reason for hiding this comment

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

This is different to what's reported in LHCBPS-1537. We should make sure to update this.

{
if (msgLevel(MSG::VERBOSE)) verbose() << "Found overlap using LHCb IDs, ignoring isCalo IDs" << *i << endmsg ;
return true;
}
}
}
}
if (msgLevel(MSG::VERBOSE)) verbose() << "Found no overlap" << endmsg ;
return false;
}
```
4 changes: 4 additions & 0 deletions contrib-05-PersistReco/PersistReco.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: PersistReco
author: Andreas Weiden, Jennifer Zonneveld, Wojciech Krupa
...