Belle II Software  release-05-02-19
BasicSegmentVarSet.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/filters/segment/BasicSegmentVarSet.h>
11 
12 #include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
13 
14 using namespace Belle2;
15 using namespace TrackFindingCDC;
16 
17 bool BasicSegmentVarSet::extract(const CDCSegment2D* ptrSegment2D)
18 {
19  if (not ptrSegment2D) return false;
20 
21  var<named("size")>() = ptrSegment2D->size();
22  var<named("superlayer_id")>() = ptrSegment2D->getISuperLayer();
23 
24  return true;
25 }
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::CDCSegment2D
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:40
Belle2::TrackFindingCDC::VarSet< BasicSegmentVarNames >::named
constexpr static int named(const char *name)
Getter for the index from the name.
Definition: VarSet.h:88
Belle2::TrackFindingCDC::BasicSegmentVarSet::extract
bool extract(const CDCSegment2D *ptrSegment2D) final
Generate and assign the contained variables.
Definition: BasicSegmentVarSet.cc:17
Belle2::TrackFindingCDC::VarSet< BasicSegmentVarNames >::var
Float_t & var()
Reference getter for the value of the ith variable. Static version.
Definition: VarSet.h:103