Belle II Software
release-05-01-25
SelectorCut.cc
1
/**************************************************************************
2
* BASF2 (Belle Analysis Framework 2) *
3
* Copyright(C) 2018 - Belle II Collaboration *
4
* *
5
* Author: The Belle II Collaboration *
6
* Contributors: Marcel Hohmann *
7
* *
8
* This software is provided "as is" without any warranty. *
9
**************************************************************************/
10
11
#include <analysis/modules/CurlTagger/SelectorCut.h>
12
13
//Root includes
14
#include "TVector3.h"
15
#include "TMath.h"
16
17
using namespace
Belle2
;
18
using namespace
CurlTagger;
19
20
SelectorCut::SelectorCut
(
bool
belleFlag)
21
{
22
if
(belleFlag) {
23
//BN1079 cuts
24
m_magDiffPCut
= 0.1;
25
m_sameChargePhiCut
= 15;
26
m_oppositeChargePhiCut
= 165;
27
}
else
{
28
// TODO - update these with actual values. Is this even worth if switching to MVA anyway?
29
m_magDiffPCut
= 0.1;
30
m_sameChargePhiCut
= 15;
31
m_oppositeChargePhiCut
= 165;
32
}
33
34
}
35
36
SelectorCut::~SelectorCut
() =
default
;
37
38
std::vector<float>
SelectorCut::getVariables
(
Particle
* iPart,
Particle
* jPart)
39
{
40
float
chargeProduct = iPart -> getCharge() * jPart -> getCharge();
41
float
magDiffP = (iPart->
getMomentum
() - jPart->
getMomentum
()).Mag();
42
float
phi = iPart->
getMomentum
().Angle(jPart->
getMomentum
());
43
return
{chargeProduct, magDiffP, phi};
44
}
45
46
float
SelectorCut::getResponse
(
Particle
* iPart,
Particle
* jPart)
47
{
48
//Selection from BN1079
49
std::vector<float> variables =
getVariables
(iPart, jPart);
50
float
chargeProduct = variables[0];
51
float
magDiffP = variables[1];
52
float
phi = variables[2];
53
54
if
(magDiffP >
m_magDiffPCut
) {
return
0.;}
55
if
(chargeProduct > 0) {
56
if
(phi <
m_sameChargePhiCut
* TMath::Pi() / 180) {
return
1.;}
57
}
58
if
(chargeProduct < 0) {
59
if
(phi >
m_oppositeChargePhiCut
* TMath::Pi() / 180) {
return
1.;}
60
}
61
62
return
0.;
63
}
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:54
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:57
Belle2::CurlTagger::SelectorCut::~SelectorCut
~SelectorCut()
Destructor.
Belle2::CurlTagger::SelectorCut::m_magDiffPCut
double m_magDiffPCut
cut for momentum magnitude difference
Definition:
SelectorCut.h:51
Belle2
Abstract base class for different kinds of events.
Definition:
MillepedeAlgorithm.h:19
Belle2::Particle::getMomentum
TVector3 getMomentum() const
Returns momentum vector.
Definition:
Particle.h:475
Belle2::CurlTagger::SelectorCut::SelectorCut
SelectorCut(bool belleFlag)
Constructor.
Definition:
SelectorCut.cc:20
Belle2::Particle
Class to store reconstructed particles.
Definition:
Particle.h:77
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:46
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:38
analysis
modules
CurlTagger
src
SelectorCut.cc
Generated on Fri Nov 5 2021 03:45:33 for Belle II Software by
1.8.17