Belle II Software development
RoughCDCfromEclStateFilter.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/RoughCDCfromEclStateFilter.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 (!lastState.isSeed() and (arcLength >= 0 or arcLength < -20)) {
27 return NAN;
28 }
29 if (lastState.isSeed() and (arcLength >= 0 or arcLength < -75)) {
30 return NAN;
31 }
32
33
34 const double& hitDistance = state.getHitDistance();
35 if (!lastState.isSeed() and std::abs(hitDistance) > m_maximalHitDistance) {
36 return NAN;
37 }
38 if (lastState.isSeed() and std::abs(hitDistance) > m_maximalHitDistanceSeed) {
39 return NAN;
40 }
41
42
43 return 1;
44}
45
46
47void RoughCDCfromEclStateFilter::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
48{
49 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "maximalHitDistance"),
51 "Maximal allowed hit distance",
53 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "maximalHitDistanceEclSeed"),
55 "Maximal allowed hit distance",
57}
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
bool isSeed() const
Returns true if the state corresponds to the seed track.
Definition: CDCCKFState.h:56
The Module parameter list class.
double m_maximalHitDistance
maximal distance from track to trajectory (in XY)
double m_maximalHitDistanceSeed
maximal distance from track to trajectory (in XY) for first hit (ECL -> CDC)
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.