Belle II Software  release-05-01-25
SimpleFacetRelationFilter.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/facetRelation/SimpleFacetRelationFilter.h>
11 
12 #include <tracking/trackFindingCDC/eventdata/hits/CDCFacet.h>
13 #include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
14 
15 #include <tracking/trackFindingCDC/utilities/StringManipulation.h>
16 
17 #include <framework/core/ModuleParamList.templateDetails.h>
18 
19 using namespace Belle2;
20 using namespace TrackFindingCDC;
21 
23  : m_param_deviationCosCut(cos(0.4))
24 {
25 }
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  const CDCFacet& toFacet)
45 {
46  if (fromFacet.getStartWireHit().isOnWire(toFacet.getEndWire())) return NAN;
47 
48  // the compatibility of the short legs or all?
49  // start end to continuation middle end
50  // start middle to continuation start end
51 
52  const ParameterLine2D& fromStartToMiddle = fromFacet.getStartToMiddleLine();
53  const ParameterLine2D& fromStartToEnd = fromFacet.getStartToEndLine();
54 
55  const ParameterLine2D& toStartToEnd = toFacet.getStartToEndLine();
56  const ParameterLine2D& toMiddleToEnd = toFacet.getMiddleToEndLine();
57 
58  const double fromMiddleCos = fromStartToMiddle.tangential().cosWith(toStartToEnd.tangential());
59  const double toMiddleCos = fromStartToEnd.tangential().cosWith(toMiddleToEnd.tangential());
60 
61  // check both
62  if (fromMiddleCos > m_param_deviationCosCut and toMiddleCos > m_param_deviationCosCut) {
63  // the weight must be -2 because the overlap of the facets is two points
64  // so the amount of two facets is 4 points hence the cellular automat
65  // must calculate 3 + (-2) + 3 = 4 as cellstate
66  // this can of course be adjusted for a more realistic information measure
67  // ( together with the facet creator filter)
68  return -2;
69  } else {
70  return NAN;
71  }
72 }
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::SimpleFacetRelationFilter::m_param_deviationCosCut
double m_param_deviationCosCut
Memory for the used direction of flight deviation.
Definition: SimpleFacetRelationFilter.h:58
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getStartWireHit
const CDCWireHit & getStartWireHit() const
Getter for the hit wire of the first oriented wire hit.
Definition: CDCRLWireHitTriple.h:212
Belle2::TrackFindingCDC::ParameterLine2D
A line with a support point and tangential vector.
Definition: ParameterLine2D.h:48
Belle2::TrackFindingCDC::SimpleFacetRelationFilter::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the set of parameters of the filter to the module parameter list.
Definition: SimpleFacetRelationFilter.cc:32
Belle2::TrackFindingCDC::SimpleFacetRelationFilter::SimpleFacetRelationFilter
SimpleFacetRelationFilter()
Constructor using default direction of flight deviation cut off.
Definition: SimpleFacetRelationFilter.cc:22
Belle2::TrackFindingCDC::SimpleFacetRelationFilter::operator()
Weight operator()(const CDCFacet &fromFacet, const CDCFacet &toFacet) final
Main filter method returning the weight of the neighborhood relation.
Definition: SimpleFacetRelationFilter.cc:43
Belle2::TrackFindingCDC::CDCWireHit::isOnWire
bool isOnWire(const CDCWire &wire) const
Checks if the wire hit is based on the given wire.
Definition: CDCWireHit.h:250
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getEndWire
const CDCWire & getEndWire() const
Getter for the wire the third oriented wire hit is based on.
Definition: CDCRLWireHitTriple.h:182
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< Relation< const CDCFacet > >::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::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