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