Belle II Software development
CDCSegment2D.h
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
9#pragma once
10
11#include <tracking/trackFindingCDC/eventdata/segments/CDCSegment.h>
12#include <tracking/trackFindingCDC/eventdata/hits/CDCRecoHit2D.h>
13
14#include <tracking/trackFindingCDC/ca/AutomatonCell.h>
15
16#include <vector>
17
18namespace Belle2 {
23 namespace TrackFindingCDC {
24
25 class CDCFacetSegment;
26 class CDCTangentSegment;
27 class CDCRLWireHitSegment;
28 class CDCWireHitSegment;
29
30 class CDCFacet;
31 class CDCTangent;
32
33 class CDCWire;
34
35 template<class T, class S> class WeightedRelation;
36 template<class T, class S> class Relation;
37
39 class CDCSegment2D : public CDCSegment<CDCRecoHit2D> {
40 public:
45 static CDCSegment2D condense(const CDCTangentSegment& tangentSegment);
46
51 static CDCSegment2D condense(const std::vector<const CDCTangent*>& tangentPath);
52
57 static CDCSegment2D condense(const CDCFacetSegment& facetSegment);
58
63 static CDCSegment2D condense(const std::vector<const CDCFacet*>& facetPath);
64
69 static CDCSegment2D condense(const std::vector<const CDCSegment2D*>& segmentPath);
70
75 static CDCSegment2D reconstructUsingTangents(const CDCRLWireHitSegment& rlWireHitSegment);
76
81 static CDCSegment2D reconstructUsingFacets(const CDCRLWireHitSegment& rlWireHitSegment);
82
84 bool operator<(const CDCSegment2D& segment2D) const;
85
88 makeRelation(const CDCSegment2D* segment) const;
89
92 makeWeightedRelation(double weight, const CDCSegment2D* segment) const;
93
95 std::vector<const CDCWire*> getWireSegment() const;
96
99
102
104 CDCSegment2D getAlias() const;
105
107 int getNRLSwitches() const;
108
110 double getRLAsymmetry() const;
111
113 CDCSegment2D reversed() const;
114
116 void reverse();
117
120 {
121 return m_automatonCell;
122 }
123
126 {
127 return &m_automatonCell;
128 }
129
134 void unsetAndForwardMaskedFlag(bool toHits = false) const;
135
140 void setAndForwardMaskedFlag(bool toHits = false) const;
141
147 void receiveMaskedFlag(bool fromHits = false) const;
148
151 {
152 return m_iSuperCluster;
153 }
154
156 void setISuperCluster(int iSuperCluster) const
157 {
158 m_iSuperCluster = iSuperCluster;
159 }
160
162 void receiveISuperCluster() const;
163
165 bool isFullyTaken(unsigned int maxNotTaken = 0) const;
166
167 private:
174
176 mutable int m_iSuperCluster = -1;
177 };
178 }
180}
Cell used by the cellular automata.
Definition: AutomatonCell.h:29
A segment consisting of adjacent facets.
A segment consisting of two dimensional reconsturcted hits.
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:39
std::vector< const CDCWire * > getWireSegment() const
Getter for the vector of wires the hits of this segment are based on in the same order.
Relation< const CDCSegment2D, const CDCSegment2D > makeRelation(const CDCSegment2D *segment) const
Helper constructor to create a relation in python.
bool isFullyTaken(unsigned int maxNotTaken=0) const
Returns false, if there are more than N hits in the range which does not have a taken flag.
void unsetAndForwardMaskedFlag(bool toHits=false) const
Unset the masked flag of the automaton cell of this segment and of all contained wire hits.
void reverse()
Reverses the order of hits and their right left passage hypotheses inplace.
double getRLAsymmetry() const
Getter for the sum of right left information relative to the size.
void receiveMaskedFlag(bool fromHits=false) const
Check all contained wire hits if one has the masked flag.
CDCSegment2D getAlias() const
Getter for the alias version of the segment - fit not copied.
int m_iSuperCluster
Memory for the global super cluster id.
Definition: CDCSegment2D.h:176
AutomatonCell * operator->() const
Indirection to the automaton cell for easier access to the flags.
Definition: CDCSegment2D.h:125
bool operator<(const CDCSegment2D &segment2D) const
Comparision of segments up to the super cluster id keeping them close together on sort.
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
Definition: CDCSegment2D.h:119
void receiveISuperCluster() const
Setter for the super cluster id based on the hit content.
static CDCSegment2D reconstructUsingTangents(const CDCRLWireHitSegment &rlWireHitSegment)
Reconstruct from wire hits with attached right left passage hypotheses by constructing tangents betwe...
void setAndForwardMaskedFlag(bool toHits=false) const
Set the masked flag of the automaton cell of this segment and forward the masked flag to all containe...
static CDCSegment2D reconstructUsingFacets(const CDCRLWireHitSegment &rlWireHitSegment)
Reconstruct from wire hits with attached right left passage hypotheses by constructing facets between...
WeightedRelation< const CDCSegment2D, const CDCSegment2D > makeWeightedRelation(double weight, const CDCSegment2D *segment) const
Helper constructor to create a relation in python.
AutomatonCell m_automatonCell
Memory for the automaton cell.
Definition: CDCSegment2D.h:173
CDCSegment2D reversed() const
Makes a copy of the segment with the reversed hits in the opposite order.
static CDCSegment2D condense(const CDCTangentSegment &tangentSegment)
Averages the reconstructed positions from hits that overlap in adjacent tangents in the given tangent...
CDCWireHitSegment getWireHitSegment() const
Getter for the vector of the wire hits of this segment are based on in the same order.
int getISuperCluster() const
Getter for the global super cluster id.
Definition: CDCSegment2D.h:150
void setISuperCluster(int iSuperCluster) const
Setter for the globale super cluster id.
Definition: CDCSegment2D.h:156
int getNRLSwitches() const
Getter for the number of changes in the right left passage in the segment.
CDCRLWireHitSegment getRLWireHitSegment() const
Getter for the vector of right left oriented the hits of this segment.
A sequence of hits limited to one superlayer.
Definition: CDCSegment.h:26
A segment consisting of adjacent tangents.
A segment consisting of two dimensional reconsturcted hits.
Type for two related objects.
Definition: Relation.h:21
Type for two related objects with a weight.
Abstract base class for different kinds of events.