Belle II Software development
FourHitFilter.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/vxdHoughTracking/filters/pathFilters/FourHitFilter.h>
9#include <tracking/trackFindingCDC/filters/base/Filter.icc.h>
10#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
11#include <framework/core/ModuleParamList.templateDetails.h>
12#include <framework/geometry/BFieldManager.h>
13
14using namespace Belle2;
15using namespace TrackFindingCDC;
16using namespace vxdHoughTracking;
17
18void FourHitFilter::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
19{
20 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "circleRadiusDifferenceCut"), m_CircleRadiusDifferenceCut,
21 "Cut on the difference of the radii of the two circles that can be defined by two hit triplets.",
23
24 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "circleCenterPositionDifferenceCut"),
26 "Cut on the difference between the center positions of the two circles that can be defined by two hit triplets.",
28}
29
31{
32 const double bFieldZ = BFieldManager::getField(0, 0, 0).Z() / Unit::T;
34}
35
36TrackFindingCDC::Weight
38{
39 const std::vector<TrackFindingCDC::WithWeight<const VXDHoughState*>>& previousHits = pair.first;
40
41 // Do nothing if path is too short or too long
42 if (previousHits.size() != 3) {
43 return NAN;
44 }
45
46 const B2Vector3D& firstHitPos = previousHits.at(0)->getHit()->getPosition();
47 const B2Vector3D& secondHitPos = previousHits.at(1)->getHit()->getPosition();
48 const B2Vector3D& thirdHitPos = previousHits.at(2)->getHit()->getPosition();
49 const B2Vector3D& currentHitPos = pair.second->getHit()->getPosition();
50
51 m_fourHitVariables.setHits(firstHitPos, secondHitPos, thirdHitPos, currentHitPos);
52
54 return NAN;
55 }
57 return NAN;
58 }
59
61}
The Module parameter list class.
AObject Object
Type of the object to be analysed.
Definition: Filter.dcl.h:35
static const double T
[tesla]
Definition: Unit.h:120
double m_CircleRadiusDifferenceCut
Cut on difference of the two circle radii estimated from two triplets.
Definition: FourHitFilter.h:40
double m_CircleCenterPositionDifferenceCut
Cut on difference of the two circle center estimated from two triplets.
Definition: FourHitFilter.h:42
TrackFindingCDC::Weight operator()(const BasePathFilter::Object &pair) override
Return the weight based on the ThreeHitVariables.
void beginRun() override
set BField value for estimator
FourHitVariables m_fourHitVariables
Construct empty ThreeHitVariables instance.
Definition: FourHitFilter.h:45
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters.
void setBFieldZ(const double bfieldZ=1.5)
Set the B-Field value used for pT calculations.
double getCircleCenterPositionDifference()
calculates the distance between the estimated circle centers (using 2 subsets of given hits) in the x...
void setHits(const B2Vector3D &oHit, const B2Vector3D &ocHit, const B2Vector3D &icHit, const B2Vector3D &iHit)
Set hits if not given in constructor of if they need to be changed.
double getCircleRadiusDifference()
calculates dpt-value (dpt= difference in transverse momentum of 2 subsets of the hits),...
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
DataType at(unsigned i) const
safe member access (with boundary check!)
Definition: B2Vector3.h:751
static void getField(const double *pos, double *field)
return the magnetic field at a given position.
Definition: BFieldManager.h:91
Abstract base class for different kinds of events.