EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ActsFatras::Barcode Class Reference

#include <acts/blob/sPHENIX/Fatras/include/ActsFatras/EventData/Barcode.hpp>

+ Inheritance diagram for ActsFatras::Barcode:
+ Collaboration diagram for ActsFatras::Barcode:

Public Types

using Value = T
 The type of ther underlying storage value.
 
- Public Types inherited from Acts::MultiIndex< uint64_t, 12, 12, 16, 8, 16 >
enum  
 
using Value = uint64_t
 The type of ther underlying storage value.
 

Public Member Functions

constexpr Value vertexPrimary () const
 Return the primary vertex identifier.
 
constexpr Value vertexSecondary () const
 Return the secondary vertex identifier.
 
constexpr Value particle () const
 Return the particle identifier.
 
constexpr Value generation () const
 Return the generation identifier.
 
constexpr Value subParticle () const
 Return the sub-particle identifier.
 
constexpr BarcodesetVertexPrimary (Value id)
 Set the primary vertex identifier.
 
constexpr BarcodesetVertexSecondary (Value id)
 Set the secondary vertex identifier.
 
constexpr BarcodesetParticle (Value id)
 Set the parent particle identifier.
 
constexpr BarcodesetGeneration (Value id)
 Set the particle identifier.
 
constexpr BarcodesetSubParticle (Value id)
 Set the process identifier.
 
Barcode makeDescendant (Value sub=0u) const
 
- Public Member Functions inherited from Acts::MultiIndex< uint64_t, 12, 12, 16, 8, 16 >
constexpr MultiIndex (Value encoded)
 Construct a MultiIndex from an already encoded value.
 
 MultiIndex ()=default
 Construct a default MultiIndex with undefined values for each level.
 
 MultiIndex (const MultiIndex &)=default
 
 MultiIndex (MultiIndex &)=default
 
MultiIndexoperator= (const MultiIndex &)=default
 
MultiIndexoperator= (MultiIndex &&)=default
 
constexpr MultiIndexoperator= (Value encoded)
 Allow setting the MultiIndex from an already encoded value.
 
constexpr Value value () const
 Get the encoded value of all index levels.
 
constexpr Value level (std::size_t lvl) const
 Get the value for the index level.
 
constexpr MultiIndexset (std::size_t lvl, Value val)
 Set the value of the index level.
 
constexpr MultiIndex makeNextSibling (std::size_t lvl) const
 Create index with the selected level increased and levels below zeroed.
 
constexpr MultiIndex makeLastDescendant (std::size_t lvl) const
 Create index with every level below the selected level maximized.
 

Private Types

using Base = Acts::MultiIndex< uint64_t, 12, 12, 16, 8, 16 >
 

Additional Inherited Members

- Static Public Member Functions inherited from Acts::MultiIndex< uint64_t, 12, 12, 16, 8, 16 >
static constexpr MultiIndex Zeros ()
 Construct a MultiIndex with all levels set to zero.
 
static constexpr MultiIndex Encode (Us &&...us)
 

Detailed Description

Particle identifier that encodes additional event information.

The barcode has to fulfill two separate requirements: be able to act as unique identifier for particles within an event and to encode details on the event structure for fast lookup. Since we only care about tracking here, we need to support two scenarios:

  • Identify which primary/secondary vertex particles belong to. No information on intermediate/unstable/invisible particles needs to be retained. This information is already available in the underlying generator event and should not be duplicated.
  • If (visible) particles convert, decay, or interact with the detector, we need to be able to identify the initial (primary) particle. Typical examples are pion nuclear interactions or electron/gamma conversions.

The vertex information is encoded as two numbers that define the primary and secondary vertex. The primary vertex must be non-zero. Particles with a zero secondary vertex originate directly from the primary vertex.

Within one vertex (primary+secondary) each particle is identified by a particle, generation, and sub-particle number. Particles originating from the vertex must have zero generation and zero sub-particle number; a consequence is that only non-zero generation can have non-zero sub-particle numbers. A non-zero generation indicates that the particle is a descendant of the original particle, e.g. from interactions or decay, while the sub-particle number identifies the descendant particle.

With this encoding, non-primary particles and their primary parent can be easily identified at the expense of not storing the exact decay history.

A barcode with all elements set to zero (the default value) is an invalid value that can be used e.g. to mark missing or unknown particles.

Example

A particle generated in a primary interaction might have the barcode

2|0|14|0|0 -> vertex=2 (primary), particle=14, generation=0, sub=0

A simulation module might generate an interaction and create two new particles. These are descendants of the initial particle and the simulation module can generate the new barcodes directly by increasing the generation number and chosing sub-particle identifiers:

2|0|14|1|0 -> vertex=2 (primary), particle=14, generation=1, sub=0
2|0|14|1|1 -> vertex=2 (primary), particle=14, generation=1, sub=1

If these secondary particles generate further tertiary particles the barcode would be e.g.

2|0|14|2|0 -> vertex=2 (primary), particle=14, generation=2, sub=0

Possible issues

The hierachical nature of the barcode allows barcode creation without a central service. Since the full history is not stored, generated barcodes for higher-generation particles can overlap when generated by independent interactions. Assuming an initial primary particle with barcode

3|4|5|0|0 -> particle=5

a first interaction might create a secondary particle by increasing the generation number (without destroying the initial particle)

3|4|5|1|0 -> particle=5, generation+=1, first sub-particle

The initial particle gets simulated further and at another step a second interaction also creates a new particle. Since it knows nothing about the previously created particle (no central service), it will generate

3|4|5|1|0 -> particle=5, generation+=1, first sub-particle

which is identical to the previously create barcode. These cases can be easily solved by renumbering the sub-particle identifier within each generation to contain unique values. However, this can only be done when all particles are known.

Definition at line 94 of file Barcode.hpp.

View newest version in sPHENIX GitHub at line 94 of file Barcode.hpp

Member Typedef Documentation

using ActsFatras::Barcode::Base = Acts::MultiIndex<uint64_t, 12, 12, 16, 8, 16>
private

Definition at line 95 of file Barcode.hpp.

View newest version in sPHENIX GitHub at line 95 of file Barcode.hpp

using Acts::MultiIndex< T, BitsPerLevel >::Value = T

The type of ther underlying storage value.

Definition at line 39 of file MultiIndex.hpp.

View newest version in sPHENIX GitHub at line 39 of file MultiIndex.hpp

Member Function Documentation

constexpr Value ActsFatras::Barcode::generation ( ) const
inline

Return the generation identifier.

Definition at line 108 of file Barcode.hpp.

View newest version in sPHENIX GitHub at line 108 of file Barcode.hpp

References Acts::MultiIndex< uint64_t, 12, 12, 16, 8, 16 >::level().

Referenced by makeDescendant(), and pepsimainerhic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Barcode ActsFatras::Barcode::makeDescendant ( Value  sub = 0u) const
inline

Construct a new barcode representing a descendant particle.

Parameters
subsub-particle index of the new barcode.

Definition at line 126 of file Barcode.hpp.

View newest version in sPHENIX GitHub at line 126 of file Barcode.hpp

References generation(), setGeneration(), and setSubParticle().

Referenced by BOOST_AUTO_TEST_CASE().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

constexpr Value ActsFatras::Barcode::particle ( ) const
inline

Return the particle identifier.

Definition at line 106 of file Barcode.hpp.

View newest version in sPHENIX GitHub at line 106 of file Barcode.hpp

References Acts::MultiIndex< uint64_t, 12, 12, 16, 8, 16 >::level().

+ Here is the call graph for this function:

constexpr Barcode& ActsFatras::Barcode::setGeneration ( Value  id)
inline

Set the particle identifier.

Definition at line 119 of file Barcode.hpp.

View newest version in sPHENIX GitHub at line 119 of file Barcode.hpp

Referenced by makeDescendant().

+ Here is the caller graph for this function:

constexpr Barcode& ActsFatras::Barcode::setParticle ( Value  id)
inline

Set the parent particle identifier.

Definition at line 117 of file Barcode.hpp.

View newest version in sPHENIX GitHub at line 117 of file Barcode.hpp

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_DATA_TEST_CASE(), Dataset::makeParticle(), ActsExamples::ParametricParticleGenerator::operator()(), and ActsExamples::HepMC3Particle::particle().

+ Here is the caller graph for this function:

constexpr Barcode& ActsFatras::Barcode::setSubParticle ( Value  id)
inline

Set the process identifier.

Definition at line 121 of file Barcode.hpp.

View newest version in sPHENIX GitHub at line 121 of file Barcode.hpp

Referenced by makeDescendant().

+ Here is the caller graph for this function:

constexpr Barcode& ActsFatras::Barcode::setVertexPrimary ( Value  id)
inline

Set the primary vertex identifier.

Definition at line 113 of file Barcode.hpp.

View newest version in sPHENIX GitHub at line 113 of file Barcode.hpp

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_DATA_TEST_CASE(), Dataset::makeParticle(), ActsExamples::detail::PrimaryVertexIdGetter::operator()(), and ActsExamples::detail::SecondaryVertexIdGetter::operator()().

+ Here is the caller graph for this function:

constexpr Barcode& ActsFatras::Barcode::setVertexSecondary ( Value  id)
inline

Set the secondary vertex identifier.

Definition at line 115 of file Barcode.hpp.

View newest version in sPHENIX GitHub at line 115 of file Barcode.hpp

Referenced by BOOST_AUTO_TEST_CASE().

+ Here is the caller graph for this function:

constexpr Value ActsFatras::Barcode::subParticle ( ) const
inline

Return the sub-particle identifier.

Definition at line 110 of file Barcode.hpp.

View newest version in sPHENIX GitHub at line 110 of file Barcode.hpp

References Acts::MultiIndex< uint64_t, 12, 12, 16, 8, 16 >::level().

+ Here is the call graph for this function:

constexpr Value ActsFatras::Barcode::vertexPrimary ( ) const
inline

Return the primary vertex identifier.

Definition at line 102 of file Barcode.hpp.

View newest version in sPHENIX GitHub at line 102 of file Barcode.hpp

References Acts::MultiIndex< uint64_t, 12, 12, 16, 8, 16 >::level().

Referenced by ActsExamples::detail::PrimaryVertexIdGetter::operator()(), and ActsExamples::detail::SecondaryVertexIdGetter::operator()().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

constexpr Value ActsFatras::Barcode::vertexSecondary ( ) const
inline

Return the secondary vertex identifier.

Definition at line 104 of file Barcode.hpp.

View newest version in sPHENIX GitHub at line 104 of file Barcode.hpp

References Acts::MultiIndex< uint64_t, 12, 12, 16, 8, 16 >::level().

Referenced by ActsExamples::detail::SecondaryVertexIdGetter::operator()().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


The documentation for this class was generated from the following file: