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#include <framework/geometry/VectorUtil.h>
16
17#include <cmath>
18
19using namespace Belle2;
20using namespace TrackFindingCDC;
21using namespace TrackingUtilities;
22
27
29 : m_param_deviationCosCut(deviationCosCut)
30{
31}
32
34 const std::string& prefix)
35{
36 Super::exposeParameters(moduleParamList, prefix);
37 moduleParamList->addParameter(prefixed(prefix, "deviationCosCut"),
39 "Acceptable deviation cosine in the angle of adjacent tangents "
40 "to the drift circles.",
42}
43
45{
46 facet.adjustFitLine();
47
48 const ParameterLine2D& startToMiddle = facet.getStartToMiddleLine();
49 const ParameterLine2D& startToEnd = facet.getStartToEndLine();
50 const ParameterLine2D& middleToEnd = facet.getMiddleToEndLine();
51
52 const double startCos = VectorUtil::CosPhi(startToMiddle.tangential(), startToEnd.tangential());
53 // const double middleCos = VectorUtil::CosPhi(startToMiddle.tangential(), middleToEnd.tangential());
54 const double endCos = VectorUtil::CosPhi(startToEnd.tangential(), middleToEnd.tangential());
55
56 // cut on the angle of
57 if (startCos > m_param_deviationCosCut and endCos > m_param_deviationCosCut) {
58 // Good facet contains three points of the track
59 // the amount carried by this facet can the adjusted more realistically
60 return 3;
61 } else {
62 return NAN;
63 }
64}
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:33
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)
A line with a support point and tangential vector.
const ROOT::Math::XYVector & tangential() const
Gives the tangential vector of the line.
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.