Belle II Software  release-08-01-10
BasicSegmentPairVarSet.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/filters/segmentPair/BasicSegmentPairVarSet.h>
9 
10 #include <tracking/trackFindingCDC/eventdata/tracks/CDCSegmentPair.h>
11 #include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
12 
13 using namespace Belle2;
14 using namespace TrackFindingCDC;
15 
17 {
18  if (not ptrSegmentPair) return false;
19 
20  CDCSegmentPair segmentPair = *ptrSegmentPair;
21 
22  const CDCSegment2D* fromSegment = segmentPair.getFromSegment();
23  const CDCSegment2D* toSegment = segmentPair.getToSegment();
24 
25  const CDCSegment2D* axialSegment = segmentPair.getAxialSegment();
26  const CDCSegment2D* stereoSegment = segmentPair.getStereoSegment();
27 
28  if (fromSegment->empty()) return false;
29  if (toSegment->empty()) return false;
30 
31  var<named("axial_first")>() = fromSegment->back().isAxial();
32  var<named("axial_size")>() = axialSegment->size();
33  var<named("stereo_size")>() = stereoSegment->size();
34 
35  ISuperLayer fromISuperLayer = fromSegment->back().getISuperLayer();
36  ISuperLayer toISuperLayer = toSegment->front().getISuperLayer();
37 
38  std::pair<int, int> superLayerIdPair = std::minmax(fromISuperLayer, toISuperLayer);
39  var<named("sl_id_pair")>() = superLayerIdPair.second * 10 + superLayerIdPair.first;
40 
41  return true;
42 }
bool extract(const CDCSegmentPair *ptrSegmentPair) final
Generate and assign the contained variables.
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:39
Class representing a pair of one reconstructed axial segement and one stereo segment in adjacent supe...
const CDCSegment2D * getAxialSegment() const
Getter for the axial segment.
const CDCSegment2D * getFromSegment() const
Getter for the from segment.
const CDCSegment2D * getStereoSegment() const
Getter for the stereo segment.
const CDCSegment2D * getToSegment() const
Getter for the to segment.
constexpr static int named(const char *name)
Getter for the index from the name.
Definition: VarSet.h:78
Float_t & var()
Reference getter for the value of the ith variable. Static version.
Definition: VarSet.h:93
Abstract base class for different kinds of events.