Belle II Software  release-05-01-25
RoughCDCStateFilter.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/ckf/cdc/filters/states/RoughCDCStateFilter.h>
11 
12 #include <tracking/ckf/cdc/entities/CDCCKFState.h>
13 #include <tracking/ckf/cdc/entities/CDCCKFPath.h>
14 
15 #include <tracking/trackFindingCDC/utilities/StringManipulation.h>
16 #include <framework/core/ModuleParamList.h>
17 
18 using namespace Belle2;
19 
20 TrackFindingCDC::Weight RoughCDCStateFilter::operator()(const BaseCDCStateFilter::Object& pair)
21 {
22  const CDCCKFPath* path = pair.first;
23  const CDCCKFState& state = *(pair.second);
24  const CDCCKFState& lastState = path->back();
25 
26  const double& arcLength = state.getArcLength() - lastState.getArcLength();
27  // TODO: magic number
28  if (arcLength <= 0 or arcLength > 20) {
29  return NAN;
30  }
31 
32  const double& hitDistance = state.getHitDistance();
33  if (std::abs(hitDistance) > m_maximalHitDistance) {
34  return NAN;
35  }
36 
37  return 1;
38 }
39 
40 
41 void RoughCDCStateFilter::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
42 {
43  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "maximalHitDistance"),
45  "Maximal allowed hit distance",
47 }
Belle2::CDCCKFState::getArcLength
double getArcLength() const
Return the arc-length along the tracjectory to the hit.
Definition: CDCCKFState.h:106
Belle2::RoughCDCStateFilter::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
Definition: RoughCDCStateFilter.cc:41
Belle2::ModuleParamList::addParameter
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
Definition: ModuleParamList.templateDetails.h:38
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::CDCCKFPath
std::vector< CDCCKFState > CDCCKFPath
Shortcut for the collection of CDC CKF-algorithm states.
Definition: CDCCKFPath.h:29
Belle2::RoughCDCStateFilter::m_maximalHitDistance
double m_maximalHitDistance
maximal distance from track to trajectory (in XY)
Definition: RoughCDCStateFilter.h:43
Belle2::CDCCKFState::getHitDistance
double getHitDistance() const
Return hit distance to the trajectory.
Definition: CDCCKFState.h:118
Belle2::RoughCDCStateFilter::operator()
TrackFindingCDC::Weight operator()(const BaseCDCStateFilter::Object &pair) final
return 1 if distance < m_maximalHitDistance, NAN otherwise
Definition: RoughCDCStateFilter.cc:20
Belle2::CDCCKFState
Define states for CKF algorithm, which can be seed track or CDC wire hit.
Definition: CDCCKFState.h:37
Belle2::ModuleParamList
The Module parameter list class.
Definition: ModuleParamList.h:46
Belle2::TrackFindingCDC::Filter::Object
AObject Object
Type of the object to be analysed.
Definition: Filter.dcl.h:43