Belle II Software  release-05-02-19
SegmentInZ0TanLambdaBox.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun, Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 #include <tracking/trackFindingCDC/eventdata/segments/CDCSegment3D.h>
12 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectorySZ.h>
13 #include <tracking/trackFindingCDC/hough/boxes/Z0TanLambdaBox.h>
14 #include <tracking/trackFindingCDC/hough/baseelements/SameSignChecker.h>
15 
16 namespace Belle2 {
21  namespace TrackFindingCDC {
22 
28  class SegmentInZ0TanLambdaBox {
29  public:
30 
32  using HoughBox = Z0TanLambdaBox;
33 
38  Weight operator()(const std::pair<CDCSegment3D, CDCTrajectorySZ>& segmentWithTrajectorySZ,
39  const HoughBox* z0TanLambdaBox)
40  {
41  float lowerZ0 = z0TanLambdaBox->getLowerZ0();
42  float upperZ0 = z0TanLambdaBox->getUpperZ0();
43 
44  float lowerTanLambda = z0TanLambdaBox->getLowerTanLambda();
45  float upperTanLambda = z0TanLambdaBox->getUpperTanLambda();
46 
47  const CDCTrajectorySZ& szTrajectory = segmentWithTrajectorySZ.second;
48  const CDCSegment3D& segment = segmentWithTrajectorySZ.first;
49 
50  float trajectoryZ0 = szTrajectory.getZ0();
51  float trajectoryTanLambda = szTrajectory.getTanLambda();
52 
53  if (std::isnan(trajectoryZ0) or std::isnan(trajectoryTanLambda)) {
54  return NAN;
55  }
56 
57  if (SameSignChecker::isIn(trajectoryZ0, trajectoryTanLambda, lowerZ0, upperZ0, lowerTanLambda, upperTanLambda)) {
58  return 0.6 * segment.size();
59  }
60 
61  return NAN;
62  }
63  };
64  }
66 }
Belle2::TrackFindingCDC::SameSignChecker::isIn
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.
Definition: SameSignChecker.h:58
Belle2::TrackFindingCDC::SegmentInZ0TanLambdaBox::HoughBox
Z0TanLambdaBox HoughBox
Use a Z0TanLambdaBox.
Definition: SegmentInZ0TanLambdaBox.h:40
Belle2::TrackFindingCDC::CDCTrajectorySZ
Linear trajectory in sz space.
Definition: CDCTrajectorySZ.h:41
Belle2::TrackFindingCDC::CDCSegment3D
A segment consisting of three dimensional reconstructed hits.
Definition: CDCSegment3D.h:36
Belle2::TrackFindingCDC::CDCTrajectorySZ::getZ0
double getZ0() const
Getter for the z coordinate at zero travel distance.
Definition: CDCTrajectorySZ.h:118
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::SegmentInZ0TanLambdaBox::operator()
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.
Definition: SegmentInZ0TanLambdaBox.h:46
Belle2::TrackFindingCDC::CDCTrajectorySZ::getTanLambda
double getTanLambda() const
Getter for the slope over the travel distance coordinate.
Definition: CDCTrajectorySZ.h:114