Belle II Software  release-05-01-25
TrailSegmentPairVarSet.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/segmentPair/TrailSegmentPairVarSet.h>
11 
12 #include <tracking/trackFindingCDC/eventdata/tracks/CDCSegmentPair.h>
13 #include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
14 
15 using namespace Belle2;
16 using namespace TrackFindingCDC;
17 
19 {
20  if (not ptrSegmentPair) return false;
21 
22  const CDCSegmentPair& segmentPair = *ptrSegmentPair;
23 
24  const CDCSegment2D* ptrFromSegment = segmentPair.getFromSegment();
25  const CDCSegment2D* ptrToSegment = segmentPair.getToSegment();
26 
27  const CDCSegment2D& fromSegment = *ptrFromSegment;
28  const CDCSegment2D& toSegment = *ptrToSegment;
29  /*
30  const CDCSegment2D* ptrAxialSegment = segmentPair.getAxialSegment();
31  const CDCSegment2D& axialSegment = *ptrAxialSegment;
32 
33  const CDCSegment2D* ptrStereoSegment = segmentPair.getStereoSegment();
34  const CDCSegment2D& stereoSegment = *ptrStereoSegment;
35 
36  bool fromIsAxial = ptrFromSegment == ptrAxialSegment;
37 
38  // Segment fit should have been done at this point
39  const CDCTrajectory2D& fromFit = fromSegment.getTrajectory2D();
40  const CDCTrajectory2D& toFit = toSegment.getTrajectory2D();
41  const CDCTrajectory2D& axialFit = axialSegment.getTrajectory2D();
42  const CDCTrajectory2D& stereoFit = stereoSegment.getTrajectory2D();
43 
44  // Hits
45  const CDCRecoHit2D& fromFirstHit = fromSegment.front();
46  const CDCRecoHit2D& fromLastHit = fromSegment.back();
47  const CDCRecoHit2D& toFirstHit = toSegment.front();
48  const CDCRecoHit2D& toLastHit = toSegment.back();
49 
50  const CDCRecoHit2D& nearAxialHit = fromIsAxial ? fromLastHit : toFirstHit;
51  const CDCRecoHit2D& nearStereoHit = not fromIsAxial ? fromLastHit : toFirstHit;
52  const CDCRecoHit2D& farAxialHit = fromIsAxial ? fromFirstHit : toLastHit;
53  const CDCRecoHit2D& farStereoHit = not fromIsAxial ? fromFirstHit : toLastHit;
54  */
55 
56  int fromNRLSwitches = fromSegment.getNRLSwitches();
57  int toNRLSwitches = toSegment.getNRLSwitches();
58  double fromRLAsymmetry = fromSegment.getRLAsymmetry();
59  double toRLAsymmetry = toSegment.getRLAsymmetry();
60 
61  var<named("from_rl_asym")>() = fromRLAsymmetry * fromSegment.size();
62  var<named("to_rl_asym")>() = toRLAsymmetry * toSegment.size();
63 
64  var<named("from_rl_switches")>() = fromNRLSwitches < 12 ? fromNRLSwitches : 12;
65  var<named("to_rl_switches")>() = toNRLSwitches < 12 ? toNRLSwitches : 12;
66 
67  return true;
68 }
Belle2::TrackFindingCDC::CDCSegment2D::getRLAsymmetry
double getRLAsymmetry() const
Getter for the sum of right left information relative to the size.
Definition: CDCSegment2D.cc:376
Belle2::TrackFindingCDC::CDCSegmentPair
Class representing a pair of one reconstructed axial segement and one stereo segment in adjacent supe...
Definition: CDCSegmentPair.h:44
Belle2::TrackFindingCDC::CDCSegmentPair::getToSegment
const CDCSegment2D * getToSegment() const
Getter for the to segment.
Definition: CDCSegmentPair.h:132
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::CDCSegment2D::getNRLSwitches
int getNRLSwitches() const
Getter for the number of changes in the right left passage in the segment.
Definition: CDCSegment2D.cc:363
Belle2::TrackFindingCDC::CDCSegment2D
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:40
Belle2::TrackFindingCDC::VarSet< TrailSegmentPairVarNames >::named
constexpr static int named(const char *name)
Getter for the index from the name.
Definition: VarSet.h:88
Belle2::TrackFindingCDC::VarSet< TrailSegmentPairVarNames >::var
Float_t & var()
Reference getter for the value of the ith variable. Static version.
Definition: VarSet.h:103
Belle2::TrackFindingCDC::CDCSegmentPair::getFromSegment
const CDCSegment2D * getFromSegment() const
Getter for the from segment.
Definition: CDCSegmentPair.h:120
Belle2::TrackFindingCDC::TrailSegmentPairVarSet::extract
bool extract(const CDCSegmentPair *ptrSegmentPair) final
Generate and assign the contained variables.
Definition: TrailSegmentPairVarSet.cc:18