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