ATLAS Offline Software
Typedefs | Enumerations | Functions
FPGATrackSimInputUtils Namespace Reference

Typedefs

typedef std::bitset< NBITSParentBitmask
 

Enumerations

enum  Bits {
  TAU_PARENT_BIT, B_PARENT_BIT, PION_PARENT_BIT, PION_IMMEDIATE_PARENT_BIT,
  NBITS
}
 

Functions

const ParentBitmask construct_truth_bitmap (HepMC::ConstGenParticlePtr p)
 

Typedef Documentation

◆ ParentBitmask

Definition at line 16 of file FPGATrackSimInputUtils.h.

Enumeration Type Documentation

◆ Bits

Enumerator
TAU_PARENT_BIT 
B_PARENT_BIT 
PION_PARENT_BIT 
PION_IMMEDIATE_PARENT_BIT 
NBITS 

Definition at line 15 of file FPGATrackSimInputUtils.h.

Function Documentation

◆ construct_truth_bitmap()

const ParentBitmask FPGATrackSimInputUtils::construct_truth_bitmap ( HepMC::ConstGenParticlePtr  p)

Definition at line 10 of file FPGATrackSimInputUtils.cxx.

11  {
13  result.reset();
14  typedef std::pair<HepMC::ConstGenParticlePtr, unsigned int> Parent;
15  std::vector<Parent> parents;
16  parents.push_back(Parent(particle, 0));
17  while (!parents.empty()) {
18  HepMC::ConstGenParticlePtr p = parents.back().first;
19  const unsigned int level = parents.back().second;
20  if (std::abs(p->pdg_id()) == 15) { result.set(TAU_PARENT_BIT, 1); }
21  if (std::abs(p->pdg_id()) == 5) { result.set(B_PARENT_BIT, 1); }
22  if (std::abs(p->pdg_id()) == 211) { result.set(PION_PARENT_BIT, 1); }
23  if (std::abs(p->pdg_id()) == 211 && level <= 1) { result.set(PION_IMMEDIATE_PARENT_BIT, 1); }
24  if (result.count() == NBITS) { break; }
25  parents.pop_back();
26  if (!(p->production_vertex())) { continue; }
27 #ifdef HEPMC3
28  for (HepMC::ConstGenParticlePtr i: p->production_vertex()->particles_in() ) {
29  parents.push_back(Parent(i, level + 1));
30  }
31 #else
32  for (HepMC::GenVertex::particle_iterator i = p->production_vertex()->particles_begin(HepMC::parents), f = p->production_vertex()->particles_end(HepMC::parents); i != f; ++i) {
33  parents.push_back(Parent(*i, level + 1));
34  }
35 
36 #endif
37  }
38  return result;
39  }
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
FPGATrackSimInputUtils::ParentBitmask
std::bitset< NBITS > ParentBitmask
Definition: FPGATrackSimInputUtils.h:16
get_generator_info.result
result
Definition: get_generator_info.py:21
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
FPGATrackSimInputUtils::PION_PARENT_BIT
@ PION_PARENT_BIT
Definition: FPGATrackSimInputUtils.h:15
python.DecayParser.parents
parents
print ("==> buf:",buf)
Definition: DecayParser.py:31
NBITS
#define NBITS
Definition: TileCisDefaultCalibTool.h:32
FPGATrackSimInputUtils::B_PARENT_BIT
@ B_PARENT_BIT
Definition: FPGATrackSimInputUtils.h:15
FPGATrackSimInputUtils::Bits
Bits
Definition: FPGATrackSimInputUtils.h:15
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
lumiFormat.i
int i
Definition: lumiFormat.py:92
FPGATrackSimInputUtils::PION_IMMEDIATE_PARENT_BIT
@ PION_IMMEDIATE_PARENT_BIT
Definition: FPGATrackSimInputUtils.h:15
FPGATrackSimInputUtils::TAU_PARENT_BIT
@ TAU_PARENT_BIT
Definition: FPGATrackSimInputUtils.h:15
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38