Belle II Software development
FeasibleRLFacetFilter.test.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 <gtest/gtest.h>
9
10#include <tracking/trackFindingCDC/testFixtures/TrackFindingCDCTestWithTopology.h>
11
12#include <tracking/trackFindingCDC/filters/facet/FeasibleRLFacetFilter.h>
13
14#include <tracking/trackFindingCDC/eventdata/hits/CDCFacet.h>
15#include <tracking/trackFindingCDC/eventdata/hits/CDCRLWireHit.h>
16#include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
17
18#include <tracking/trackFindingCDC/topology/CDCWireTopology.h>
19
20#include <framework/utilities/TestHelpers.h>
21
22using namespace Belle2;
23using namespace TrackFindingCDC;
24
25TEST_F(TrackFindingCDCTestWithTopology, filter_facet_FeasibleRLFacetFilter_accepts_long_para)
26{
28
29 filter.initialize();
30 filter.beginRun();
31
32 const CDCWireTopology& wireTopology = CDCWireTopology::getInstance();
33
34 const CDCWire& aWire = wireTopology.getWire(0, 0, 0);
35 const CDCWire& bWire = wireTopology.getWire(0, 0, 1);
36 const CDCWire& cWire = wireTopology.getWire(0, 0, 3);
37
38 const CDCWireHit aWireHit(aWire.getWireID(), 0.1);
39 const CDCWireHit bWireHit(bWire.getWireID(), 0.1);
40 const CDCWireHit cWireHit(cWire.getWireID(), 0.1);
41
42 filter.beginEvent();
43
44 std::vector<std::array<ERightLeft, 3> > acceptableRLs = {
45 { ERightLeft::c_Right, ERightLeft::c_Right, ERightLeft::c_Right,},
46 { ERightLeft::c_Right, ERightLeft::c_Right, ERightLeft::c_Left,},
47 { ERightLeft::c_Left, ERightLeft::c_Right, ERightLeft::c_Right,},
48 { ERightLeft::c_Left, ERightLeft::c_Left, ERightLeft::c_Left,},
49 { ERightLeft::c_Left, ERightLeft::c_Left, ERightLeft::c_Right,},
50 { ERightLeft::c_Right, ERightLeft::c_Left, ERightLeft::c_Left,},
51 };
52
53 for (const std::array<ERightLeft, 3>& acceptableRL : acceptableRLs) {
54
55 TEST_CONTEXT("For rl combination " << static_cast<int>(acceptableRL[0]) << ", "
56 << static_cast<int>(acceptableRL[1]) << ", "
57 << static_cast<int>(acceptableRL[2]));
58 CDCRLWireHit aRLWireHit(&aWireHit, acceptableRL[0]);
59 CDCRLWireHit bRLWireHit(&bWireHit, acceptableRL[1]);
60 CDCRLWireHit cRLWireHit(&cWireHit, acceptableRL[2]);
61 CDCFacet facet(aRLWireHit, bRLWireHit, cRLWireHit);
62 Weight weight = filter(facet);
63 EXPECT_TRUE(not std::isnan(weight));
64 }
65
66 filter.endRun();
67 filter.terminate();
68}
Class representing a triple of neighboring oriented wire with additional trajectory information.
Definition: CDCFacet.h:32
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
Definition: CDCRLWireHit.h:41
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:55
Class representing the sense wire arrangement in the whole of the central drift chamber.
const CDCWire & getWire(const WireID &wireId) const
Getter for wire getter by wireID object.
static CDCWireTopology & getInstance()
Getter for the singleton instance of the wire topology.
Class representing a sense wire in the central drift chamber.
Definition: CDCWire.h:58
const WireID & getWireID() const
Getter for the wire id.
Definition: CDCWire.h:122
Filter for the construction of good facets investigating the feasibility of the right left passage hy...
This class provides the declaration of the common test fixture to all test of the track finding in th...
std::map< ExpRun, std::pair< double, double > > filter(const std::map< ExpRun, std::pair< double, double > > &runs, double cut, std::map< ExpRun, std::pair< double, double > > &runsRemoved)
filter events to remove runs shorter than cut, it stores removed runs in runsRemoved
Definition: Splitter.cc:38
Abstract base class for different kinds of events.