Belle II Software  release-05-02-19
BasicTrackRelationVarSet.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - 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/trackRelation/BasicTrackRelationVarSet.h>
11 
12 #include <tracking/trackFindingCDC/eventdata/tracks/CDCTrack.h>
13 
14 using namespace Belle2;
15 using namespace TrackFindingCDC;
16 
18 {
19  if (not ptrTrackRelation) return false;
20 
21  const Relation<const CDCTrack>& trackPair = *ptrTrackRelation;
22 
23  const CDCTrack* ptrFromTrack = trackPair.getFrom();
24  const CDCTrack* ptrToTrack = trackPair.getTo();
25 
26  const CDCTrack& fromTrack = *ptrFromTrack;
27  const CDCTrack& toTrack = *ptrToTrack;
28 
29  ISuperLayer fromISuperLayer = fromTrack.back().getISuperLayer();
30  ISuperLayer toISuperLayer = toTrack.front().getISuperLayer();
31  std::pair<int, int> superLayerIdPair = std::minmax(fromISuperLayer, toISuperLayer);
32  var<named("sl_id_pair")>() = superLayerIdPair.second * 10 + superLayerIdPair.first;
33  var<named("delta_sl_id")>() = toISuperLayer - fromISuperLayer;
34  var<named("from_size")>() = fromTrack.size();
35  var<named("to_size")>() = toTrack.size();
36  return true;
37 }
Belle2::TrackFindingCDC::Relation::getFrom
From * getFrom() const
Getter for the pointer to the from side object.
Definition: Relation.h:69
Belle2::TrackFindingCDC::CDCTrack
Class representing a sequence of three dimensional reconstructed hits.
Definition: CDCTrack.h:51
Belle2::TrackFindingCDC::Relation
Type for two related objects.
Definition: CDCSegment2D.h:37
Belle2::TrackFindingCDC::BasicTrackRelationVarSet::extract
bool extract(const Relation< const CDCTrack > *ptrTrackRelation) final
Generate and assign the contained variables.
Definition: BasicTrackRelationVarSet.cc:17
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::VarSet< BasicTrackRelationVarNames >::named
constexpr static int named(const char *name)
Getter for the index from the name.
Definition: VarSet.h:88
Belle2::TrackFindingCDC::Relation::getTo
To * getTo() const
Getter for the pointer to the to side object.
Definition: Relation.h:75
Belle2::TrackFindingCDC::VarSet< BasicTrackRelationVarNames >::var
Float_t & var()
Reference getter for the value of the ith variable. Static version.
Definition: VarSet.h:103