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/trackingUtilities/eventdata/hits/CDCFacet.h>
13#include <tracking/trackingUtilities/eventdata/hits/CDCWireHit.h>
14
15using namespace Belle2;
16using namespace TrackFindingCDC;
17using namespace TrackingUtilities;
18
20
22 : Super(allowReverse)
23 , m_mcFacetFilter(allowReverse)
24{
26}
27
29 const std::string& prefix)
30{
31 m_mcFacetFilter.exposeParameters(moduleParamList, prefix);
32}
33
39
41 const CDCFacet& toFacet)
42{
43 // the last wire of the neighbor should not be the same as the start wire of the facet
44 if (fromFacet.getStartWireHit().isOnWire(toFacet.getEndWire())) return NAN;
45
46 // Despite of that two facets are neighbors if both are true facets
47 // That also implies the correct tof alignment of the hits not common to both facets
48 Weight fromFacetWeight = m_mcFacetFilter(fromFacet);
49 Weight toFacetWeight = m_mcFacetFilter(toFacet);
50
51 if ((fromFacetWeight > 0) and (toFacetWeight > 0)) {
52 return 2;
53 }
54
55 if (getAllowReverse() and (fromFacetWeight < 0) and (toFacetWeight < 0)) {
56 return -2;
57 }
58
59 return NAN;
60}
The Module parameter list class.
MCFacetFilter m_mcFacetFilter
Monte Carlo cell filter to reject neighborhoods have false cells.
void initialize() final
Initialize the before event processing.
MCSymmetric< BaseFacetRelationFilter > Super
Type of the super class.
TrackingUtilities::Weight operator()(const TrackingUtilities::CDCFacet &fromFacet, const TrackingUtilities::CDCFacet &toFacet) final
Main filter method returning the weight of the neighborhood relation.
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.
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.
Class representing a triple of neighboring oriented wire with additional trajectory information.
Definition CDCFacet.h:32
const CDC::CDCWire & getEndWire() const
Getter for the wire the third oriented wire hit is based on.
const CDCWireHit & getStartWireHit() const
Getter for the hit wire of the first oriented wire hit.
bool isOnWire(const CDC::CDCWire &wire) const
Checks if the wire hit is based on the given wire.
Definition CDCWireHit.h:245
Abstract base class for different kinds of events.