Belle II Software  release-05-01-25
SimpleFacetFilter.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/trackFindingCDC/filters/facet/SimpleFacetFilter.h>
11 
12 #include <tracking/trackFindingCDC/eventdata/hits/CDCFacet.h>
13 
14 #include <tracking/trackFindingCDC/utilities/StringManipulation.h>
15 
16 #include <framework/core/ModuleParamList.templateDetails.h>
17 
18 #include <cmath>
19 
20 using namespace Belle2;
21 using namespace TrackFindingCDC;
22 
24  : m_param_deviationCosCut(std::cos(M_PI / 180.0 * 9))
25 {
26 }
27 
28 SimpleFacetFilter::SimpleFacetFilter(double deviationCosCut)
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 = startToMiddle.tangential().cosWith(startToEnd.tangential());
53  // const double middleCos = startToMiddle.tangential().cosWith(middleToEnd.tangential());
54  const double endCos = startToEnd.tangential().cosWith(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 }
Belle2::TrackFindingCDC::CDCFacet::getStartToEndLine
ParameterLine2D getStartToEndLine() const
Getter for the tangential line from the first to the third hit.
Definition: CDCFacet.cc:96
Belle2::TrackFindingCDC::SimpleFacetFilter::SimpleFacetFilter
SimpleFacetFilter()
Constructor using default direction of flight deviation cut off.
Definition: SimpleFacetFilter.cc:23
Belle2::TrackFindingCDC::SimpleFacetFilter::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the set of parameters of the filter to the module parameter list.
Definition: SimpleFacetFilter.cc:33
Belle2::TrackFindingCDC::ParameterLine2D
A line with a support point and tangential vector.
Definition: ParameterLine2D.h:48
Belle2::TrackFindingCDC::CDCFacet::adjustFitLine
void adjustFitLine() const
Adjusts the contained fit line to touch such that it touches the first and third hit.
Definition: CDCFacet.cc:63
Belle2::TrackFindingCDC::SimpleFacetFilter::m_param_deviationCosCut
double m_param_deviationCosCut
Memory for the used direction of flight deviation.
Definition: SimpleFacetFilter.h:61
Belle2::ModuleParamList::addParameter
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
Definition: ModuleParamList.templateDetails.h:38
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::CDCFacet::getStartToMiddleLine
ParameterLine2D getStartToMiddleLine() const
Getter for the tangential line from the first to the second hit.
Definition: CDCFacet.cc:88
Belle2::TrackFindingCDC::Filter::exposeParameters
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:42
Belle2::TrackFindingCDC::SimpleFacetFilter::operator()
Weight operator()(const CDCFacet &facet) final
Main filter method returning the weight of the facet.
Definition: SimpleFacetFilter.cc:44
Belle2::TrackFindingCDC::CDCFacet
Class representing a triple of neighboring oriented wire with additional trajectory information.
Definition: CDCFacet.h:42
Belle2::TrackFindingCDC::Vector2D::cosWith
double cosWith(const Vector2D &rhs) const
Definition: Vector2D.h:201
Belle2::TrackFindingCDC::ParameterLine2D::tangential
const Vector2D & tangential() const
Gives the tangential vector of the line.
Definition: ParameterLine2D.h:135
Belle2::TrackFindingCDC::CDCFacet::getMiddleToEndLine
ParameterLine2D getMiddleToEndLine() const
Getter for the tangential line from the second to the third hit.
Definition: CDCFacet.cc:104
Belle2::ModuleParamList
The Module parameter list class.
Definition: ModuleParamList.h:46