Belle II Software development
LooseSVDPairFilter.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 <tracking/ckf/svd/filters/relations/LooseSVDPairFilter.h>
9#include <tracking/trackFindingCDC/filters/base/Filter.icc.h>
10
11#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
12#include <framework/core/ModuleParamList.templateDetails.h>
13
14using namespace Belle2;
15using namespace TrackFindingCDC;
16
17TrackFindingCDC::Weight
18LooseSVDPairFilter::operator()(const std::pair<const CKFToSVDState*, const CKFToSVDState*>& relation)
19{
20 const CKFToSVDState::stateCache& currentStateCache = relation.first->getStateCache();
21 const CKFToSVDState::stateCache& nextStateCache = relation.second->getStateCache();
22
23 // if the connection is possible in u, it should also be possible in v
24 // but as there could in principle be a chance between sensors (X.X.1 -> X.(X+-1).2 or X.X.2 -> X.(X+-1).1)
25 // check for a similar theta value instead of v
26 if (currentStateCache.geoLayer == nextStateCache.geoLayer) {
27 if (fabs(currentStateCache.theta - nextStateCache.theta) > static_cast<float>(m_param_ThetaOverlayRegionPrecut)) {
28 return NAN;
29 }
30 }
31
32 float phiDiff = currentStateCache.phi - nextStateCache.phi;
33 while (phiDiff > M_PI) phiDiff -= 2. * M_PI;
34 while (phiDiff < -M_PI) phiDiff += 2. * M_PI;
35
36 if (not currentStateCache.isHitState) {
37 if (fabs(phiDiff) > static_cast<float>(m_param_PhiSeedHitPrecut)) {
38 return NAN;
39 }
40 } else if (!(fabs(phiDiff) < static_cast<float>(m_param_PhiHitHitPrecut) and
41 fabs(currentStateCache.theta - nextStateCache.theta) < static_cast<float>(m_param_ThetaHitHitPrecut))) {
42 return NAN;
43 }
44
45 return 1.0;
46}
47
48void LooseSVDPairFilter::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
49{
50 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "thetaOverlayRegionCut"), m_param_ThetaOverlayRegionPrecut,
51 "Pre-cut in theta for the overlay region.", m_param_ThetaOverlayRegionPrecut);
52 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "phiSeedHitCut"), m_param_PhiSeedHitPrecut,
53 "Pre-cut in phi for relations between seed states and hit states.", m_param_PhiSeedHitPrecut);
54 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "phiHitHitCut"), m_param_PhiHitHitPrecut,
55 "Pre-cut in phi for relations between hit states.", m_param_PhiHitHitPrecut);
56 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "thetaHitHitCut"), m_param_ThetaHitHitPrecut,
57 "Pre-cut in theta for relations between hit states.", m_param_ThetaHitHitPrecut);
58}
double m_param_PhiHitHitPrecut
Pre-filter relations in phi between hit states.
double m_param_ThetaOverlayRegionPrecut
Pre-filter relations in theta for overlay.
TrackFindingCDC::Weight operator()(const std::pair< const CKFToSVDState *, const CKFToSVDState * > &relation) override
Return the weight based on azimuthal-angle separation.
double m_param_PhiSeedHitPrecut
Pre-filter relations in phi between seed states and hit states.
double m_param_ThetaHitHitPrecut
Pre-filter relations in theta between hit states.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters.
The Module parameter list class.
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
Abstract base class for different kinds of events.