Belle II Software  release-08-01-10
BasicTrackRelationVarSet.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/trackRelation/BasicTrackRelationVarSet.h>
9 
10 #include <tracking/trackFindingCDC/eventdata/tracks/CDCTrack.h>
11 
12 using namespace Belle2;
13 using namespace TrackFindingCDC;
14 
16 {
17  if (not ptrTrackRelation) return false;
18 
19  const Relation<const CDCTrack>& trackPair = *ptrTrackRelation;
20 
21  const CDCTrack* ptrFromTrack = trackPair.getFrom();
22  const CDCTrack* ptrToTrack = trackPair.getTo();
23 
24  const CDCTrack& fromTrack = *ptrFromTrack;
25  const CDCTrack& toTrack = *ptrToTrack;
26 
27  ISuperLayer fromISuperLayer = fromTrack.back().getISuperLayer();
28  ISuperLayer toISuperLayer = toTrack.front().getISuperLayer();
29  std::pair<int, int> superLayerIdPair = std::minmax(fromISuperLayer, toISuperLayer);
30  var<named("sl_id_pair")>() = superLayerIdPair.second * 10 + superLayerIdPair.first;
31  var<named("delta_sl_id")>() = toISuperLayer - fromISuperLayer;
32  var<named("from_size")>() = fromTrack.size();
33  var<named("to_size")>() = toTrack.size();
34  return true;
35 }
bool extract(const Relation< const CDCTrack > *ptrTrackRelation) final
Generate and assign the contained variables.
Class representing a sequence of three dimensional reconstructed hits.
Definition: CDCTrack.h:41
Type for two related objects.
Definition: Relation.h:21
To * getTo() const
Getter for the pointer to the to side object.
Definition: Relation.h:65
From * getFrom() const
Getter for the pointer to the from side object.
Definition: Relation.h:59
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.