Belle II Software
light-2406-ragdoll
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
//Root includes
12
#include "TMath.h"
13
14
using namespace
Belle2
;
15
using namespace
CurlTagger;
16
17
SelectorCut::SelectorCut
(
bool
belleFlag)
18
{
19
if
(belleFlag) {
20
//BN1079 cuts
21
m_magDiffPCut
= 0.1;
22
m_sameChargePhiCut
= 15;
23
m_oppositeChargePhiCut
= 165;
24
}
else
{
25
// TODO - update these with actual values. Is this even worth if switching to MVA anyway?
26
m_magDiffPCut
= 0.1;
27
m_sameChargePhiCut
= 15;
28
m_oppositeChargePhiCut
= 165;
29
}
30
31
}
32
33
SelectorCut::~SelectorCut
() =
default
;
34
35
std::vector<float>
SelectorCut::getVariables
(
Particle
* iPart,
Particle
* jPart)
36
{
37
float
chargeProduct = iPart -> getCharge() * jPart -> getCharge();
38
float
magDiffP = (iPart->
getMomentum
() - jPart->
getMomentum
()).R();
39
float
phi = acos(iPart->
getMomentum
().Unit().Dot(jPart->
getMomentum
().Unit()));
40
return
{chargeProduct, magDiffP, phi};
41
}
42
43
float
SelectorCut::getResponse
(
Particle
* iPart,
Particle
* jPart)
44
{
45
//Selection from BN1079
46
std::vector<float> variables =
getVariables
(iPart, jPart);
47
float
chargeProduct = variables[0];
48
float
magDiffP = variables[1];
49
float
phi = variables[2];
50
51
if
(magDiffP >
m_magDiffPCut
) {
return
0.;}
52
if
(chargeProduct > 0) {
53
if
(phi <
m_sameChargePhiCut
* TMath::Pi() / 180) {
return
1.;}
54
}
55
if
(chargeProduct < 0) {
56
if
(phi >
m_oppositeChargePhiCut
* TMath::Pi() / 180) {
return
1.;}
57
}
58
59
return
0.;
60
}
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:35
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:17
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:43
Belle2::Particle
Class to store reconstructed particles.
Definition:
Particle.h:75
Belle2::Particle::getMomentum
ROOT::Math::XYZVector getMomentum() const
Returns momentum vector.
Definition:
Particle.h:560
Belle2
Abstract base class for different kinds of events.
Definition:
ClusterUtils.h:24
analysis
modules
CurlTagger
src
SelectorCut.cc
Generated on Tue Jul 9 2024 23:26:35 for Belle II Software by
1.9.6