8 #include <tracking/vxdHoughTracking/filters/pathFilters/TwoHitVirtualIPFilter.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 #include <framework/database/DBObjPtr.h>
14 #include <mdst/dbobjects/BeamSpot.h>
17 using namespace TrackFindingCDC;
18 using namespace vxdHoughTracking;
20 void TwoHitVirtualIPFilter::exposeParameters(
ModuleParamList* moduleParamList,
const std::string& prefix)
22 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"cosRZCut"), m_cosRZCut,
23 "Cut on the absolute value of cosine between the vectors (oHit - cHit) and (cHit - iHit).",
25 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"circleIPDistanceCut"), m_circleIPDistanceCut,
26 "Cut on the difference between circle radius and circle center to check whether the circle is compatible with passing through the IP.",
27 m_circleIPDistanceCut);
30 void TwoHitVirtualIPFilter::beginRun()
33 m_threeHitVariables.setBFieldZ(bFieldZ);
38 const B2Vector3D& BeamSpotPosition = (*beamSpotDB).getIPPosition();
39 m_virtualIPPosition.
SetXYZ(BeamSpotPosition.
X(), BeamSpotPosition.
Y(), BeamSpotPosition.
Z());
41 m_virtualIPPosition.SetXYZ(0., 0., 0.);
46 TrackFindingCDC::Weight
49 const std::vector<TrackFindingCDC::WithWeight<const VXDHoughState*>>& previousHits = pair.first;
52 if (previousHits.size() != 1) {
56 const B2Vector3D& lastHitPos = previousHits.
at(0)->getHit()->getPosition();
57 const B2Vector3D& currentHitPos = pair.second->getHit()->getPosition();
60 m_threeHitVariables.setHits(lastHitPos, currentHitPos, m_virtualIPPosition);
62 if (m_threeHitVariables.getCosAngleRZSimple() < m_cosRZCut) {
66 const double circleDistanceIP = m_threeHitVariables.getCircleDistanceIP();
68 if (circleDistanceIP > m_circleIPDistanceCut) {
72 return fabs(1.0 / circleDistanceIP);
DataType Z() const
access variable Z (= .at(2) without boundary check)
DataType X() const
access variable X (= .at(0) without boundary check)
DataType Y() const
access variable Y (= .at(1) without boundary check)
void SetXYZ(DataType x, DataType y, DataType z)
set all coordinates using data type
bool isValid() const
Check whether a valid object was obtained from the database.
Class for accessing objects in the database.
The Module parameter list class.
AObject Object
Type of the object to be analysed.
static const double T
[tesla]
void addParameter(const std::string &name, T ¶mVariable, 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!)
static void getField(const double *pos, double *field)
return the magnetic field at a given position.
Abstract base class for different kinds of events.