Belle II Software
development
SelectorCut.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
9
#include <analysis/modules/CurlTagger/SelectorCut.h>
10
11
#include <analysis/dataobjects/Particle.h>
12
13
//Root includes
14
#include "TMath.h"
15
16
using namespace
Belle2
;
17
using namespace
CurlTagger;
18
19
SelectorCut::SelectorCut
(
bool
belleFlag)
20
{
21
if
(belleFlag) {
22
//BN1079 cuts
23
m_magDiffPCut
= 0.1;
24
m_sameChargePhiCut
= 15;
25
m_oppositeChargePhiCut
= 165;
26
}
else
{
27
// TODO - update these with actual values. Is this even worth if switching to MVA anyway?
28
m_magDiffPCut
= 0.1;
29
m_sameChargePhiCut
= 15;
30
m_oppositeChargePhiCut
= 165;
31
}
32
33
}
34
35
SelectorCut::~SelectorCut
() =
default
;
36
37
std::vector<float>
SelectorCut::getVariables
(
Particle
* iPart,
Particle
* jPart)
38
{
39
float
chargeProduct = iPart -> getCharge() * jPart -> getCharge();
40
float
magDiffP = (iPart->
getMomentum
() - jPart->
getMomentum
()).R();
41
float
phi = acos(iPart->
getMomentum
().Unit().Dot(jPart->
getMomentum
().Unit()));
42
return
{chargeProduct, magDiffP, phi};
43
}
44
45
float
SelectorCut::getResponse
(
Particle
* iPart,
Particle
* jPart)
46
{
47
//Selection from BN1079
48
std::vector<float> variables =
getVariables
(iPart, jPart);
49
float
chargeProduct = variables[0];
50
float
magDiffP = variables[1];
51
float
phi = variables[2];
52
53
if
(magDiffP >
m_magDiffPCut
) {
return
0.;}
54
if
(chargeProduct > 0) {
55
if
(phi <
m_sameChargePhiCut
* TMath::Pi() / 180) {
return
1.;}
56
}
57
if
(chargeProduct < 0) {
58
if
(phi >
m_oppositeChargePhiCut
* TMath::Pi() / 180) {
return
1.;}
59
}
60
61
return
0.;
62
}
Belle2::CurlTagger::SelectorCut::~SelectorCut
~SelectorCut()
Destructor.
Belle2::CurlTagger::SelectorCut::getVariables
virtual std::vector< float > getVariables(Particle *iPart, Particle *jPart) override
returns vector of variables used by this selector.
Definition
SelectorCut.cc:37
Belle2::CurlTagger::SelectorCut::m_sameChargePhiCut
double m_sameChargePhiCut
cut for angle between momenta of the two particles when they have the same charge
Definition
SelectorCut.h:44
Belle2::CurlTagger::SelectorCut::SelectorCut
SelectorCut(bool belleFlag)
Constructor.
Definition
SelectorCut.cc:19
Belle2::CurlTagger::SelectorCut::m_oppositeChargePhiCut
double m_oppositeChargePhiCut
cut for angle between momenta of the two particles when they have the opposite charge
Definition
SelectorCut.h:47
Belle2::CurlTagger::SelectorCut::m_magDiffPCut
double m_magDiffPCut
cut for momentum magnitude difference
Definition
SelectorCut.h:41
Belle2::CurlTagger::SelectorCut::getResponse
virtual float getResponse(Particle *iPart, Particle *jPart) override
Selector response that this pair of particles come from the same mc/actual particle.
Definition
SelectorCut.cc:45
Belle2::Particle
Class to store reconstructed particles.
Definition
Particle.h:76
Belle2::Particle::getMomentum
ROOT::Math::XYZVector getMomentum() const
Returns momentum vector.
Definition
Particle.h:580
Belle2
Abstract base class for different kinds of events.
Definition
MillepedeAlgorithm.h:17
analysis
modules
CurlTagger
src
SelectorCut.cc
Generated on Mon Sep 1 2025 02:45:25 for Belle II Software by
1.13.2