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