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