Belle II Software  release-08-01-10
BasicSegmentPairRelationVarSet.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/segmentPairRelation/BasicSegmentPairRelationVarSet.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 ptrSegmentPairRelation) return false;
19 
20  const CDCSegmentPair* fromSegmentPair = ptrSegmentPairRelation->first;
21  const CDCSegmentPair* toSegmentPair = ptrSegmentPairRelation->second;
22  const CDCSegment2D* middleSegment = fromSegmentPair->getToSegment();
23 
24  var<named("middle_sl_id")>() = middleSegment->getISuperLayer();
25  var<named("middle_is_axial")>() = middleSegment->isAxial();
26  var<named("from_size")>() = fromSegmentPair->size();
27  var<named("to_size")>() = toSegmentPair->size();
28  var<named("middle_size")>() = middleSegment->size();
29 
30  return true;
31 }
bool extract(const Relation< const CDCSegmentPair > *ptrSegmentPairRelation) 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 * getToSegment() const
Getter for the to segment.
std::size_t size() const
Getter for the total number of hits in this segment pair.
Type for two related objects.
Definition: Relation.h:21
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.