Belle II Software  release-05-01-25
DistancePXDPairFilter.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun, Christian Wessel *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/ckf/pxd/filters/relations/DistancePXDPairFilter.h>
11 #include <tracking/trackFindingCDC/filters/base/Filter.icc.h>
12 
13 #include <tracking/spacePointCreation/SpacePoint.h>
14 
15 using namespace Belle2;
16 using namespace TrackFindingCDC;
17 
18 TrackFindingCDC::Weight
19 DistancePXDPairFilter::operator()(const std::pair<const CKFToPXDState*, const CKFToPXDState*>& relation)
20 {
21  const CKFToPXDState& fromState = *(relation.first);
22  const CKFToPXDState& toState = *(relation.second);
23 
24  const CKFToPXDState::stateCache& fromStateCache = fromState.getStateCache();
25  const CKFToPXDState::stateCache& toStateCache = toState.getStateCache();
26 
27  B2ASSERT("You have filled the wrong states into this!", toStateCache.isHitState);
28 
29  double phiDiff = fromStateCache.phi - toStateCache.phi;
30  while (phiDiff > M_PI) phiDiff -= 2. * M_PI;
31  while (phiDiff < -M_PI) phiDiff += 2. * M_PI;
32 
33  if (not fromStateCache.isHitState) {
34  // We are coming from an SVD track, so we can use its position to only look for matching ladders
35  if (abs(phiDiff) < 0.2) {
36  return 1.0;
37  }
38 
39  return NAN;
40  }
41 
42  if (fromStateCache.geoLayer == toStateCache.geoLayer and
43  fromStateCache.sensorID.getSensorNumber() == toStateCache.sensorID.getSensorNumber()) {
44  // TODO: Checking for equality of sensor numbers seems not to harm the hit efficiency,
45  // but maybe it's safer to allow for a sensor number difference of 1?
46  return 1.0;
47  }
48 
49  if (abs(phiDiff) < 0.05) {
50  return 1.0;
51  }
52 
53  return NAN;
54 }
Belle2::CKFToPXDState
Specialized CKF State for extrapolating into the PXD.
Definition: CKFToPXDState.h:29
Belle2::DistancePXDPairFilter::operator()
TrackFindingCDC::Weight operator()(const std::pair< const CKFToPXDState *, const CKFToPXDState * > &relation) override
Return the weight based on azimuthal-angle separation.
Definition: DistancePXDPairFilter.cc:19
Belle2::CKFToPXDState::getStateCache
const struct stateCache & getStateCache() const
Get the cached data of this state.
Definition: CKFToPXDState.h:50
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19