Belle II Software
development
Bundle.cc
1
/**************************************************************************
2
* basf2 (Belle II Analysis Software Framework) *
3
* Author: The Belle II Collaboration *
4
* *
5
* See git log for contributors and copyright holders. *
6
* This file is licensed under LGPL-3.0, see LICENSE.md. *
7
**************************************************************************/
8
#include <analysis/modules/CurlTagger/Bundle.h>
9
10
#include <analysis/dataobjects/Particle.h>
11
#include <analysis/variables/VertexVariables.h>
12
13
#include <TMath.h>
14
15
using namespace
Belle2
;
16
using namespace
CurlTagger;
17
18
Bundle::Bundle
(
bool
isTruthBundle)
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
}
31
32
Bundle::~Bundle
() =
default
;
33
34
void
Bundle::addParticle
(
Particle
* particle)
35
{
36
m_Particles
.push_back(particle);
37
}
38
39
Particle
*
Bundle::getParticle
(
unsigned
int
i)
40
{
41
return
m_Particles
[i];
42
}
43
44
unsigned
int
Bundle::size
()
45
{
46
return
m_Particles
.size();
47
}
48
49
float
Bundle::scaledImpactParam
(
Particle
* particle)
50
{
51
return
TMath::Power(
m_Gamma
* Variable::particleDRho(particle), 2) + TMath::Power(Variable::particleDZ(particle), 2);
52
}
53
54
bool
Bundle::compareParticles
(
Particle
* iPart,
Particle
* jPart)
55
{
56
return
scaledImpactParam
(iPart) <
scaledImpactParam
(jPart);
57
}
58
59
void
Bundle::tagCurlInfo
()
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
}
80
81
void
Bundle::tagSizeInfo
()
82
{
83
unsigned
int
bundleSize =
size
();
84
for
(
Particle
* particle :
m_Particles
) {
85
particle -> setExtraInfo(
m_SizeLabel
, bundleSize);
86
}
87
}
88
Belle2::CurlTagger::Bundle::Bundle
Bundle(bool isTruthBundle)
Constructor.
Definition
Bundle.cc:18
Belle2::CurlTagger::Bundle::scaledImpactParam
float scaledImpactParam(Particle *particle)
scaled impact parameter for selecting best track
Definition
Bundle.cc:49
Belle2::CurlTagger::Bundle::tagSizeInfo
void tagSizeInfo()
sets extraInfo with size of Bundle for particles in Bundle
Definition
Bundle.cc:81
Belle2::CurlTagger::Bundle::~Bundle
~Bundle()
Destructor.
Belle2::CurlTagger::Bundle::m_CurlLabel
std::string m_CurlLabel
label used to tag particles with curl info
Definition
Bundle.h:62
Belle2::CurlTagger::Bundle::size
unsigned int size()
gets Bundle size
Definition
Bundle.cc:44
Belle2::CurlTagger::Bundle::m_IsTruthBundle
bool m_IsTruthBundle
flag for if the bundle is based on truth info, changes which labels are used
Definition
Bundle.h:59
Belle2::CurlTagger::Bundle::compareParticles
bool compareParticles(Particle *iPart, Particle *jPart)
used to rank particles by scaledImpactParam - currently unused
Definition
Bundle.cc:54
Belle2::CurlTagger::Bundle::getParticle
Particle * getParticle(unsigned int i)
gets Particle from Bundle
Definition
Bundle.cc:39
Belle2::CurlTagger::Bundle::m_Particles
std::vector< Particle * > m_Particles
particles in bundle
Definition
Bundle.h:68
Belle2::CurlTagger::Bundle::m_SizeLabel
std::string m_SizeLabel
label used to tag particles with Bundle size
Definition
Bundle.h:65
Belle2::CurlTagger::Bundle::addParticle
void addParticle(Particle *particle)
adds Particle to Bundle
Definition
Bundle.cc:34
Belle2::CurlTagger::Bundle::m_Gamma
double m_Gamma
dr scale factor
Definition
Bundle.h:53
Belle2::CurlTagger::Bundle::tagCurlInfo
void tagCurlInfo()
sets curl extra info for particles in Bundle
Definition
Bundle.cc:59
Belle2::Particle
Class to store reconstructed particles.
Definition
Particle.h:76
Belle2
Abstract base class for different kinds of events.
Definition
MillepedeAlgorithm.h:17
analysis
modules
CurlTagger
src
Bundle.cc
Generated on Mon Sep 1 2025 02:45:25 for Belle II Software by
1.13.2