Belle II Software development
SimpleFacetFilter.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/trackFindingCDC/filters/facet/SimpleFacetFilter.h>
9
10#include <tracking/trackingUtilities/eventdata/hits/CDCFacet.h>
11
12#include <tracking/trackingUtilities/utilities/StringManipulation.h>
13
14#include <framework/core/ModuleParamList.templateDetails.h>
15
16#include <cmath>
17
18using namespace Belle2;
19using namespace TrackFindingCDC;
20using namespace TrackingUtilities;
21
26
28 : m_param_deviationCosCut(deviationCosCut)
29{
30}
31
33 const std::string& prefix)
34{
35 Super::exposeParameters(moduleParamList, prefix);
36 moduleParamList->addParameter(prefixed(prefix, "deviationCosCut"),
38 "Acceptable deviation cosine in the angle of adjacent tangents "
39 "to the drift circles.",
41}
42
44{
45 facet.adjustFitLine();
46
47 const ParameterLine2D& startToMiddle = facet.getStartToMiddleLine();
48 const ParameterLine2D& startToEnd = facet.getStartToEndLine();
49 const ParameterLine2D& middleToEnd = facet.getMiddleToEndLine();
50
51 const double startCos = startToMiddle.tangential().cosWith(startToEnd.tangential());
52 // const double middleCos = startToMiddle.tangential().cosWith(middleToEnd.tangential());
53 const double endCos = startToEnd.tangential().cosWith(middleToEnd.tangential());
54
55 // cut on the angle of
56 if (startCos > m_param_deviationCosCut and endCos > m_param_deviationCosCut) {
57 // Good facet contains three points of the track
58 // the amount carried by this facet can the adjusted more realistically
59 return 3;
60 } else {
61 return NAN;
62 }
63}
The Module parameter list class.
SimpleFacetFilter()
Constructor using default direction of flight deviation cut off.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the set of parameters of the filter to the module parameter list.
TrackingUtilities::Weight operator()(const TrackingUtilities::CDCFacet &facet) final
Main filter method returning the weight of the facet.
double m_param_deviationCosCut
Memory for the used direction of flight deviation.
Class representing a triple of neighboring oriented wire with additional trajectory information.
Definition CDCFacet.h:32
void adjustFitLine() const
Adjusts the contained fit line to touch such that it touches the first and third hit.
Definition CDCFacet.cc:62
ParameterLine2D getStartToEndLine() const
Getter for the tangential line from the first to the third hit.
Definition CDCFacet.cc:95
ParameterLine2D getStartToMiddleLine() const
Getter for the tangential line from the first to the second hit.
Definition CDCFacet.cc:87
ParameterLine2D getMiddleToEndLine() const
Getter for the tangential line from the second to the third hit.
Definition CDCFacet.cc:103
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
A line with a support point and tangential vector.
const Vector2D & tangential() const
Gives the tangential vector of the line.
double cosWith(const Vector2D &rhs) const
Definition Vector2D.h:218
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.
STL namespace.