Belle II Software development
Bundle Class Reference

class to contain particles identified to come from the same actual/mc particle More...

#include <Bundle.h>

Public Member Functions

 Bundle (bool isTruthBundle)
 Constructor.
 
 ~Bundle ()
 Destructor.
 
void addParticle (Particle *particle)
 adds Particle to Bundle
 
ParticlegetParticle (unsigned int i)
 gets Particle from Bundle
 
unsigned int size ()
 gets Bundle size
 
void tagCurlInfo ()
 sets curl extra info for particles in Bundle
 
void tagSizeInfo ()
 sets extraInfo with size of Bundle for particles in Bundle
 

Private Member Functions

float scaledImpactParam (Particle *particle)
 scaled impact parameter for selecting best track
 
bool compareParticles (Particle *iPart, Particle *jPart)
 used to rank particles by scaledImpactParam - currently unused
 

Private Attributes

double m_Gamma
 dr scale factor
 
bool m_IsTruthBundle
 flag for if the bundle is based on truth info, changes which labels are used
 
std::string m_CurlLabel
 label used to tag particles with curl info
 
std::string m_SizeLabel
 label used to tag particles with Bundle size
 
std::vector< Particle * > m_Particles
 particles in bundle
 

Detailed Description

class to contain particles identified to come from the same actual/mc particle

Definition at line 23 of file Bundle.h.

Constructor & Destructor Documentation

◆ Bundle()

Bundle ( bool isTruthBundle)
explicit

Constructor.

Definition at line 18 of file Bundle.cc.

19{
20 m_IsTruthBundle = isTruthBundle;
21 m_Gamma = 5; //From BN1079 - TODO check this gives best selection (what defines best?)
22
23 if (m_IsTruthBundle) {
24 m_CurlLabel = "isTruthCurl";
25 m_SizeLabel = "truthBundleSize";
26 } else {
27 m_CurlLabel = "isCurl";
28 m_SizeLabel = "bundleSize";
29 }
30}
std::string m_CurlLabel
label used to tag particles with curl info
Definition Bundle.h:62
bool m_IsTruthBundle
flag for if the bundle is based on truth info, changes which labels are used
Definition Bundle.h:59
std::string m_SizeLabel
label used to tag particles with Bundle size
Definition Bundle.h:65
double m_Gamma
dr scale factor
Definition Bundle.h:53

Member Function Documentation

◆ addParticle()

void addParticle ( Particle * particle)

adds Particle to Bundle

Definition at line 34 of file Bundle.cc.

35{
36 m_Particles.push_back(particle);
37}
std::vector< Particle * > m_Particles
particles in bundle
Definition Bundle.h:68

◆ compareParticles()

bool compareParticles ( Particle * iPart,
Particle * jPart )
private

used to rank particles by scaledImpactParam - currently unused

Definition at line 54 of file Bundle.cc.

55{
56 return scaledImpactParam(iPart) < scaledImpactParam(jPart);
57}
float scaledImpactParam(Particle *particle)
scaled impact parameter for selecting best track
Definition Bundle.cc:49

◆ getParticle()

Particle * getParticle ( unsigned int i)

gets Particle from Bundle

Definition at line 39 of file Bundle.cc.

40{
41 return m_Particles[i];
42}

◆ scaledImpactParam()

float scaledImpactParam ( Particle * particle)
private

scaled impact parameter for selecting best track

Definition at line 49 of file Bundle.cc.

50{
51 return TMath::Power(m_Gamma * Variable::particleDRho(particle), 2) + TMath::Power(Variable::particleDZ(particle), 2);
52}

◆ size()

unsigned int size ( )

gets Bundle size

Definition at line 44 of file Bundle.cc.

45{
46 return m_Particles.size();
47}

◆ tagCurlInfo()

void tagCurlInfo ( )

sets curl extra info for particles in Bundle

Definition at line 59 of file Bundle.cc.

60{
61 //somewhat slow but should only be comparing 2-3 particles so shouldn't be a problem.
62 //std::sort (m_Particles.begin(), m_Particles.end(), compareParticles);
63 unsigned int bundleSize = size();
64 float lowestVal = 1e10;
65 unsigned int posLowestVal = 0;
66 for (unsigned int i = 0; i < bundleSize; i++) {
67 if (scaledImpactParam(m_Particles[i]) < lowestVal) {
68 lowestVal = scaledImpactParam(m_Particles[i]);
69 posLowestVal = i;
70 }
71 }
72
73 for (unsigned int i = 0; i < bundleSize; i++) {
74 Particle* particle = m_Particles[i];
75 //std::cout << trackDist(particle) << std::endl;
76 if (i == posLowestVal) {continue;}
77 particle ->setExtraInfo(m_CurlLabel, 1);
78 }
79}
unsigned int size()
gets Bundle size
Definition Bundle.cc:44

◆ tagSizeInfo()

void tagSizeInfo ( )

sets extraInfo with size of Bundle for particles in Bundle

Definition at line 81 of file Bundle.cc.

82{
83 unsigned int bundleSize = size();
84 for (Particle* particle : m_Particles) {
85 particle -> setExtraInfo(m_SizeLabel, bundleSize);
86 }
87}

Member Data Documentation

◆ m_CurlLabel

std::string m_CurlLabel
private

label used to tag particles with curl info

Definition at line 62 of file Bundle.h.

◆ m_Gamma

double m_Gamma
private

dr scale factor

Definition at line 53 of file Bundle.h.

◆ m_IsTruthBundle

bool m_IsTruthBundle
private

flag for if the bundle is based on truth info, changes which labels are used

Definition at line 59 of file Bundle.h.

◆ m_Particles

std::vector<Particle*> m_Particles
private

particles in bundle

Definition at line 68 of file Bundle.h.

◆ m_SizeLabel

std::string m_SizeLabel
private

label used to tag particles with Bundle size

Definition at line 65 of file Bundle.h.


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