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
16using namespace Belle2;
17using namespace CurlTagger;
18
20{
21 if (belleFlag) {
22 //BN1079 cuts
23 m_magDiffPCut = 0.1;
26 } else {
27 // TODO - update these with actual values. Is this even worth if switching to MVA anyway?
28 m_magDiffPCut = 0.1;
31 }
32
33}
34
36
37std::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
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}
virtual std::vector< float > getVariables(Particle *iPart, Particle *jPart) override
returns vector of variables used by this selector.
double m_sameChargePhiCut
cut for angle between momenta of the two particles when they have the same charge
Definition SelectorCut.h:44
SelectorCut(bool belleFlag)
Constructor.
double m_oppositeChargePhiCut
cut for angle between momenta of the two particles when they have the opposite charge
Definition SelectorCut.h:47
double m_magDiffPCut
cut for momentum magnitude difference
Definition SelectorCut.h:41
virtual float getResponse(Particle *iPart, Particle *jPart) override
Selector response that this pair of particles come from the same mc/actual particle.
Class to store reconstructed particles.
Definition Particle.h:76
ROOT::Math::XYZVector getMomentum() const
Returns momentum vector.
Definition Particle.h:580
Abstract base class for different kinds of events.