Belle II Software  release-05-01-25
MCFacetRelationFilter.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/MCFacetRelationFilter.h>
11 
12 #include <tracking/trackFindingCDC/filters/base/MCSymmetricFilter.icc.h>
13 
14 #include <tracking/trackFindingCDC/eventdata/hits/CDCFacet.h>
15 #include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
16 
17 using namespace Belle2;
18 using namespace TrackFindingCDC;
19 
21 
23  : Super(allowReverse)
24  , m_mcFacetFilter(allowReverse)
25 {
27 }
28 
30  const std::string& prefix)
31 {
32  m_mcFacetFilter.exposeParameters(moduleParamList, prefix);
33 }
34 
36 {
39 }
40 
42  const CDCFacet& toFacet)
43 {
44  // the last wire of the neighbor should not be the same as the start wire of the facet
45  if (fromFacet.getStartWireHit().isOnWire(toFacet.getEndWire())) return NAN;
46 
47  // Despite of that two facets are neighbors if both are true facets
48  // That also implies the correct tof alignment of the hits not common to both facets
49  Weight fromFacetWeight = m_mcFacetFilter(fromFacet);
50  Weight toFacetWeight = m_mcFacetFilter(toFacet);
51 
52  if ((fromFacetWeight > 0) and (toFacetWeight > 0)) {
53  return 2;
54  }
55 
56  if (getAllowReverse() and (fromFacetWeight < 0) and (toFacetWeight < 0)) {
57  return -2;
58  }
59 
60  return NAN;
61 }
Belle2::TrackFindingCDC::MCSymmetric::getAllowReverse
bool getAllowReverse() const
Getter for the allow reverse parameter.
Definition: MCSymmetricFilter.icc.h:85
Belle2::TrackFindingCDC::MCSymmetric< BaseFacetRelationFilter >::initialize
void initialize() override
Initialize the before event processing.
Definition: MCSymmetricFilter.icc.h:59
Belle2::TrackFindingCDC::MCFacetRelationFilter::initialize
void initialize() final
Initialize the before event processing.
Definition: MCFacetRelationFilter.cc:35
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::MCFacetRelationFilter::m_mcFacetFilter
MCFacetFilter m_mcFacetFilter
Monte Carlo cell filter to reject neighborhoods have false cells.
Definition: MCFacetRelationFilter.h:71
Belle2::TrackFindingCDC::MCSymmetric< BaseFacetRelationFilter >
Belle2::TrackFindingCDC::CompositeProcessingSignalListener::addProcessingSignalListener
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
Definition: CompositeProcessingSignalListener.cc:57
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::MCFacetRelationFilter::operator()
Weight operator()(const CDCFacet &fromFacet, const CDCFacet &toFacet) final
Main filter method returning the weight of the neighborhood relation.
Definition: MCFacetRelationFilter.cc:41
Belle2::TrackFindingCDC::MCFacetRelationFilter::MCFacetRelationFilter
MCFacetRelationFilter(bool allowReverse=false)
Constructor also setting the switch if the reversed version of a facet (in comparision to MC truth) s...
Definition: MCFacetRelationFilter.cc:22
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
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::MCFacetRelationFilter::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
Definition: MCFacetRelationFilter.cc:29
Belle2::TrackFindingCDC::CDCFacet
Class representing a triple of neighboring oriented wire with additional trajectory information.
Definition: CDCFacet.h:42
Belle2::TrackFindingCDC::MCFacetRelationFilter::setAllowReverse
void setAllowReverse(bool allowReverse) override
Setter for the allow reverse parameter.
Definition: MCFacetRelationFilter.h:63
Belle2::ModuleParamList
The Module parameter list class.
Definition: ModuleParamList.h:46
Belle2::TrackFindingCDC::MCSymmetric::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the set of parameters of the filter to the module parameter list.
Definition: MCSymmetricFilter.icc.h:48