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/trackFindingCDC/eventdata/hits/CDCFacet.h>
11
12#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
13
14#include <framework/core/ModuleParamList.templateDetails.h>
15
16#include <cmath>
17
18using namespace Belle2;
19using namespace TrackFindingCDC;
20
22 : m_param_deviationCosCut(std::cos(M_PI / 180.0 * 9))
23{
24}
25
27 : m_param_deviationCosCut(deviationCosCut)
28{
29}
30
32 const std::string& prefix)
33{
34 Super::exposeParameters(moduleParamList, prefix);
35 moduleParamList->addParameter(prefixed(prefix, "deviationCosCut"),
37 "Acceptable deviation cosine in the angle of adjacent tangents "
38 "to the drift circles.",
40}
41
43{
44 facet.adjustFitLine();
45
46 const ParameterLine2D& startToMiddle = facet.getStartToMiddleLine();
47 const ParameterLine2D& startToEnd = facet.getStartToEndLine();
48 const ParameterLine2D& middleToEnd = facet.getMiddleToEndLine();
49
50 const double startCos = startToMiddle.tangential().cosWith(startToEnd.tangential());
51 // const double middleCos = startToMiddle.tangential().cosWith(middleToEnd.tangential());
52 const double endCos = startToEnd.tangential().cosWith(middleToEnd.tangential());
53
54 // cut on the angle of
55 if (startCos > m_param_deviationCosCut and endCos > m_param_deviationCosCut) {
56 // Good facet contains three points of the track
57 // the amount carried by this facet can the adjusted more realistically
58 return 3;
59 } else {
60 return NAN;
61 }
62}
The Module parameter list class.
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:61
ParameterLine2D getStartToEndLine() const
Getter for the tangential line from the first to the third hit.
Definition: CDCFacet.cc:94
ParameterLine2D getStartToMiddleLine() const
Getter for the tangential line from the first to the second hit.
Definition: CDCFacet.cc:86
ParameterLine2D getMiddleToEndLine() const
Getter for the tangential line from the second to the third hit.
Definition: CDCFacet.cc:102
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
Expose the set of parameters of the filter to the module parameter list.
Definition: Filter.icc.h:40
A line with a support point and tangential vector.
const Vector2D & tangential() const
Gives the tangential vector of the line.
Weight operator()(const CDCFacet &facet) final
Main filter method returning the weight of the facet.
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.
double m_param_deviationCosCut
Memory for the used direction of flight deviation.
double cosWith(const Vector2D &rhs) const
Definition: Vector2D.h:187
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.