Belle II Software development
CDCSegment3D.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/eventdata/segments/CDCSegment3D.h>
9
10#include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
11#include <tracking/trackFindingCDC/eventdata/hits/CDCRecoHit3D.h>
12#include <tracking/trackFindingCDC/eventdata/hits/CDCRecoHit2D.h>
13#include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
14
15#include <tracking/trackFindingCDC/ca/AutomatonCell.h>
16
17using namespace Belle2;
18using namespace TrackFindingCDC;
19
21 const CDCTrajectory2D& trajectory2D)
22{
23 CDCSegment3D segment3D;
24 for (const CDCRecoHit2D& recoHit2D : segment2D) {
25 CDCRecoHit3D recoHit3D = CDCRecoHit3D::reconstruct(recoHit2D, trajectory2D);
26 segment3D.push_back(recoHit3D);
27 }
28 segment3D.setAliasScore(segment2D.getAliasScore());
29 return segment3D;
30}
31
33{
34 CDCSegment2D result;
35 for (const CDCRecoHit3D& recoHit3D : *this) {
36 result.push_back(recoHit3D.stereoProjectToRef());
37 }
38 result.setAliasScore(getAliasScore());
39 return result;
40}
41
43{
45 if (not toHits) return;
46 for (const CDCRecoHit3D& recoHit3D : *this) {
47 const CDCWireHit& wireHit = recoHit3D.getWireHit();
49 }
50}
51
53{
55 if (not toHits) return;
56 for (const CDCRecoHit3D& recoHit3D : *this) {
57 const CDCWireHit& wireHit = recoHit3D.getWireHit();
59 }
60}
61
62void CDCSegment3D::receiveMaskedFlag(bool fromHits) const
63{
64 if (not fromHits) return;
65 int nMasked = 0 ;
66 int nNotMasked = 0;
67 for (const CDCRecoHit3D& recoHit3D : *this) {
68 const CDCWireHit& wireHit = recoHit3D.getWireHit();
69 if (wireHit.getAutomatonCell().hasMaskedFlag()) {
70 ++nMasked;
71 } else {
72 ++nNotMasked;
73 }
74 }
75
76 const int nTolerance = 2;
77 if (nMasked > nNotMasked or nMasked >= nTolerance) {
79 }
80}
void setMaskedFlag(bool setTo=true)
Sets the masked flag to the given value. Default value true.
void unsetMaskedFlag()
Resets the masked flag to false.
bool hasMaskedFlag() const
Gets the current state of the masked marker flag.
Class representing a two dimensional reconstructed hit in the central drift chamber.
Definition: CDCRecoHit2D.h:47
Class representing a three dimensional reconstructed hit.
Definition: CDCRecoHit3D.h:52
const CDCWireHit & getWireHit() const
Getter for the wire hit.
Definition: CDCRecoHit3D.h:238
static CDCRecoHit3D reconstruct(const CDCRecoHit2D &recoHit2D, const CDCTrajectory2D &trajectory2D)
Reconstructs the three dimensional hit from the two dimensional and the two dimensional trajectory.
Definition: CDCRecoHit3D.cc:56
CDCRecoHit2D stereoProjectToRef() const
Constructs a two dimensional reconstructed hit by carrying out the stereo ! projection to the wire re...
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:39
A segment consisting of three dimensional reconstructed hits.
Definition: CDCSegment3D.h:26
static CDCSegment3D reconstruct(const CDCSegment2D &segment2D, const CDCTrajectory2D &trajectory2D)
Reconstructs a two dimensional stereo segment by shifting each hit onto the given two dimensional tra...
Definition: CDCSegment3D.cc:20
CDCSegment2D stereoProjectToRef() const
Constructs a two dimensional segment by carrying out the stereo ! projection to the wire reference po...
Definition: CDCSegment3D.cc:32
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
Definition: CDCSegment3D.h:40
void receiveMaskedFlag(bool fromHits=true) const
Check all contained wire hits if one has the masked flag.
Definition: CDCSegment3D.cc:62
void setAndForwardMaskedFlag(bool toHits=true) const
Set the masked flag of the automaton cell of this segment and forward the masked flag to all containe...
Definition: CDCSegment3D.cc:52
void unsetAndForwardMaskedFlag(bool toHits=true) const
Unset the masked flag of the automaton cell of this segment and of all contained wire hits.
Definition: CDCSegment3D.cc:42
void setAliasScore(double aliasScore)
Setter for the flag that this segment may have an aliased version.
Definition: CDCSegment.h:96
double getAliasScore() const
Getter for the flag that this segment may have an aliased version.
Definition: CDCSegment.h:90
Particle trajectory as it is seen in xy projection represented as a circle.
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:55
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
Definition: CDCWireHit.h:286
Abstract base class for different kinds of events.