Belle II Software  release-05-02-19
CDCSegment2D.h
1 /*!************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 - 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 #pragma once
11 
12 #include <tracking/trackFindingCDC/eventdata/segments/CDCSegment.h>
13 #include <tracking/trackFindingCDC/eventdata/hits/CDCRecoHit2D.h>
14 
15 #include <tracking/trackFindingCDC/ca/AutomatonCell.h>
16 
17 #include <vector>
18 
19 namespace Belle2 {
24  namespace TrackFindingCDC {
25 
26  class CDCFacetSegment;
27  class CDCTangentSegment;
28  class CDCRLWireHitSegment;
29  class CDCWireHitSegment;
30 
31  class CDCFacet;
32  class CDCTangent;
33 
34  class CDCWire;
35 
36  template<class T, class S> class WeightedRelation;
37  template<class T, class S> class Relation;
38 
40  class CDCSegment2D : public CDCSegment<CDCRecoHit2D> {
41  public:
46  static CDCSegment2D condense(const CDCTangentSegment& tangentSegment);
47 
52  static CDCSegment2D condense(const std::vector<const CDCTangent*>& tangentPath);
53 
58  static CDCSegment2D condense(const CDCFacetSegment& facetSegment);
59 
64  static CDCSegment2D condense(const std::vector<const CDCFacet*>& facetPath);
65 
70  static CDCSegment2D condense(const std::vector<const CDCSegment2D*>& segmentPath);
71 
76  static CDCSegment2D reconstructUsingTangents(const CDCRLWireHitSegment& rlWireHitSegment);
77 
82  static CDCSegment2D reconstructUsingFacets(const CDCRLWireHitSegment& rlWireHitSegment);
83 
85  bool operator<(const CDCSegment2D& segment2D) const;
86 
89  makeRelation(const CDCSegment2D* segment) const;
90 
93  makeWeightedRelation(double weight, const CDCSegment2D* segment) const;
94 
96  std::vector<const CDCWire*> getWireSegment() const;
97 
100 
103 
105  CDCSegment2D getAlias() const;
106 
108  int getNRLSwitches() const;
109 
111  double getRLAsymmetry() const;
112 
114  CDCSegment2D reversed() const;
115 
117  void reverse();
118 
121  {
122  return m_automatonCell;
123  }
124 
127  {
128  return &m_automatonCell;
129  }
130 
135  void unsetAndForwardMaskedFlag(bool toHits = false) const;
136 
141  void setAndForwardMaskedFlag(bool toHits = false) const;
142 
148  void receiveMaskedFlag(bool fromHits = false) const;
149 
151  int getISuperCluster() const
152  {
153  return m_iSuperCluster;
154  }
155 
157  void setISuperCluster(int iSuperCluster) const
158  {
159  m_iSuperCluster = iSuperCluster;
160  }
161 
163  void receiveISuperCluster() const;
164 
166  bool isFullyTaken(unsigned int maxNotTaken = 0) const;
167 
168  private:
175 
177  mutable int m_iSuperCluster = -1;
178  };
179  }
181 }
Belle2::TrackFindingCDC::CDCSegment2D::makeWeightedRelation
WeightedRelation< const CDCSegment2D, const CDCSegment2D > makeWeightedRelation(double weight, const CDCSegment2D *segment) const
Helper constructor to create a relation in python.
Definition: CDCSegment2D.cc:317
Belle2::TrackFindingCDC::CDCSegment2D::getRLAsymmetry
double getRLAsymmetry() const
Getter for the sum of right left information relative to the size.
Definition: CDCSegment2D.cc:376
Belle2::TrackFindingCDC::Relation
Type for two related objects.
Definition: CDCSegment2D.h:37
Belle2::TrackFindingCDC::CDCSegment2D::getAlias
CDCSegment2D getAlias() const
Getter for the alias version of the segment - fit not copied.
Definition: CDCSegment2D.cc:351
Belle2::TrackFindingCDC::CDCSegment
A sequence of hits limited to one superlayer.
Definition: CDCSegment.h:36
Belle2::TrackFindingCDC::CDCSegment2D::receiveISuperCluster
void receiveISuperCluster() const
Setter for the super cluster id based on the hit content.
Definition: CDCSegment2D.cc:475
Belle2::TrackFindingCDC::CDCSegment2D::operator->
AutomatonCell * operator->() const
Indirection to the automaton cell for easier access to the flags.
Definition: CDCSegment2D.h:126
Belle2::TrackFindingCDC::CDCSegment2D::getISuperCluster
int getISuperCluster() const
Getter for the global super cluster id.
Definition: CDCSegment2D.h:151
Belle2::TrackFindingCDC::CDCSegment2D::makeRelation
Relation< const CDCSegment2D, const CDCSegment2D > makeRelation(const CDCSegment2D *segment) const
Helper constructor to create a relation in python.
Definition: CDCSegment2D.cc:312
Belle2::TrackFindingCDC::CDCSegment2D::getWireSegment
std::vector< const CDCWire * > getWireSegment() const
Getter for the vector of wires the hits of this segment are based on in the same order.
Definition: CDCSegment2D.cc:329
Belle2::TrackFindingCDC::CDCSegment2D::condense
static CDCSegment2D condense(const CDCTangentSegment &tangentSegment)
Averages the reconstructed positions from hits that overlap in adjacent tangents in the given tangent...
Definition: CDCSegment2D.cc:217
Belle2::TrackFindingCDC::CDCSegment2D::operator<
bool operator<(const CDCSegment2D &segment2D) const
Comparision of segments up to the super cluster id keeping them close together on sort.
Definition: CDCSegment2D.cc:322
Belle2::TrackFindingCDC::CDCSegment2D::reconstructUsingFacets
static CDCSegment2D reconstructUsingFacets(const CDCRLWireHitSegment &rlWireHitSegment)
Reconstruct from wire hits with attached right left passage hypotheses by constructing facets between...
Definition: CDCSegment2D.cc:302
Belle2::TrackFindingCDC::CDCSegment2D::setISuperCluster
void setISuperCluster(int iSuperCluster) const
Setter for the globale super cluster id.
Definition: CDCSegment2D.h:157
Belle2::TrackFindingCDC::CDCSegment2D::isFullyTaken
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.
Definition: CDCSegment2D.cc:460
Belle2::TrackFindingCDC::CDCWireHitSegment
A segment consisting of two dimensional reconsturcted hits.
Definition: CDCWireHitSegment.h:34
Belle2::TrackFindingCDC::CDCRLWireHitSegment
A segment consisting of two dimensional reconsturcted hits.
Definition: CDCRLWireHitSegment.h:34
Belle2::TrackFindingCDC::CDCFacetSegment
A segment consisting of adjacent facets.
Definition: CDCFacetSegment.h:32
Belle2::TrackFindingCDC::CDCSegment2D::reversed
CDCSegment2D reversed() const
Makes a copy of the segment with the reversed hits in the opposite order.
Definition: CDCSegment2D.cc:399
Belle2::TrackFindingCDC::CDCSegment2D::receiveMaskedFlag
void receiveMaskedFlag(bool fromHits=false) const
Check all contained wire hits if one has the masked flag.
Definition: CDCSegment2D.cc:448
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::CDCSegment2D::unsetAndForwardMaskedFlag
void unsetAndForwardMaskedFlag(bool toHits=false) const
Unset the masked flag of the automaton cell of this segment and of all contained wire hits.
Definition: CDCSegment2D.cc:428
Belle2::TrackFindingCDC::AutomatonCell
Cell used by the cellular automata.
Definition: AutomatonCell.h:39
Belle2::TrackFindingCDC::CDCSegment2D::getNRLSwitches
int getNRLSwitches() const
Getter for the number of changes in the right left passage in the segment.
Definition: CDCSegment2D.cc:363
Belle2::TrackFindingCDC::CDCSegment2D::getWireHitSegment
CDCWireHitSegment getWireHitSegment() const
Getter for the vector of the wire hits of this segment are based on in the same order.
Definition: CDCSegment2D.cc:339
Belle2::TrackFindingCDC::CDCSegment2D::setAndForwardMaskedFlag
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...
Definition: CDCSegment2D.cc:438
Belle2::TrackFindingCDC::CDCSegment2D::reverse
void reverse()
Reverses the order of hits and their right left passage hypotheses inplace.
Definition: CDCSegment2D.cc:415
Belle2::TrackFindingCDC::CDCSegment2D::reconstructUsingTangents
static CDCSegment2D reconstructUsingTangents(const CDCRLWireHitSegment &rlWireHitSegment)
Reconstruct from wire hits with attached right left passage hypotheses by constructing tangents betwe...
Definition: CDCSegment2D.cc:283
Belle2::TrackFindingCDC::CDCSegment2D::getAutomatonCell
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
Definition: CDCSegment2D.h:120
Belle2::TrackFindingCDC::CDCSegment2D
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:40
Belle2::TrackFindingCDC::WeightedRelation
Type for two related objects with a weight.
Definition: CDCSegment2D.h:36
Belle2::TrackFindingCDC::CDCSegment2D::getRLWireHitSegment
CDCRLWireHitSegment getRLWireHitSegment() const
Getter for the vector of right left oriented the hits of this segment.
Definition: CDCSegment2D.cc:387
Belle2::TrackFindingCDC::CDCTangentSegment
A segment consisting of adjacent tangents.
Definition: CDCTangentSegment.h:34
Belle2::TrackFindingCDC::CDCSegment2D::m_iSuperCluster
int m_iSuperCluster
Memory for the global super cluster id.
Definition: CDCSegment2D.h:177
Belle2::TrackFindingCDC::CDCSegment2D::m_automatonCell
AutomatonCell m_automatonCell
Memory for the automaton cell.
Definition: CDCSegment2D.h:174