Belle II Software development
SegmentInZ0TanLambdaBox.h
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#pragma once
9#include <tracking/trackFindingCDC/eventdata/segments/CDCSegment3D.h>
10#include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectorySZ.h>
11#include <tracking/trackFindingCDC/hough/boxes/Z0TanLambdaBox.h>
12#include <tracking/trackFindingCDC/hough/baseelements/SameSignChecker.h>
13
14namespace Belle2 {
19 namespace TrackFindingCDC {
20
27 public:
28
31
36 Weight operator()(const std::pair<CDCSegment3D, CDCTrajectorySZ>& segmentWithTrajectorySZ,
37 const HoughBox* z0TanLambdaBox)
38 {
39 float lowerZ0 = z0TanLambdaBox->getLowerZ0();
40 float upperZ0 = z0TanLambdaBox->getUpperZ0();
41
42 float lowerTanLambda = z0TanLambdaBox->getLowerTanLambda();
43 float upperTanLambda = z0TanLambdaBox->getUpperTanLambda();
44
45 const CDCTrajectorySZ& szTrajectory = segmentWithTrajectorySZ.second;
46 const CDCSegment3D& segment = segmentWithTrajectorySZ.first;
47
48 float trajectoryZ0 = szTrajectory.getZ0();
49 float trajectoryTanLambda = szTrajectory.getTanLambda();
50
51 if (std::isnan(trajectoryZ0) or std::isnan(trajectoryTanLambda)) {
52 return NAN;
53 }
54
55 if (SameSignChecker::isIn(trajectoryZ0, trajectoryTanLambda, lowerZ0, upperZ0, lowerTanLambda, upperTanLambda)) {
56 return 0.6 * segment.size();
57 }
58
59 return NAN;
60 }
61 };
62 }
64}
A segment consisting of three dimensional reconstructed hits.
Definition: CDCSegment3D.h:26
Linear trajectory in sz space.
double getTanLambda() const
Getter for the slope over the travel distance coordinate.
double getZ0() const
Getter for the z coordinate at zero travel distance.
static bool isIn(double x, double y, double x1, double x2, double y1, double y2)
Check if two values are in the rectangle spanned by the other four values.
Predicate class to check for the containment of hits in a z0 tan lambda hough space part.
Weight operator()(const std::pair< CDCSegment3D, CDCTrajectorySZ > &segmentWithTrajectorySZ, const HoughBox *z0TanLambdaBox)
Checks if the wire hit is contained in a z0 tan lambda hough space.
A rectangular domain for the hough space over phi0 and two dimensional curvature.
float getLowerTanLambda() const
Concise getter for the lower tan lambda bound.
float getUpperZ0() const
Concise getter for the upper z0 bound.
float getLowerZ0() const
Concise getter for the lower z0 bound.
float getUpperTanLambda() const
Concise getter for the upper tan lambda bound.
Abstract base class for different kinds of events.