Belle II Software development
AngleAndTimeRelationFilter.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/relations/AngleAndTimeRelationFilter.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
13#include <cmath>
14
15using namespace Belle2;
16using namespace TrackFindingCDC;
17using namespace vxdHoughTracking;
18
19void AngleAndTimeRelationFilter::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
20{
21 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "AngleAndTimeThetaCutDeltaL0"), m_ThetaCutDeltaL0,
22 "Simple cut in theta for the overlay region of different ladders in the same layer.",
24 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "AngleAndTimeThetaCutDeltaL1"), m_ThetaCutDeltaL1,
25 "Simple cut in theta for relations between hits with Delta_Layer = +-1.", m_ThetaCutDeltaL1);
26 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "AngleAndTimeThetaCutDeltaL2"), m_ThetaCutDeltaL2,
27 "Simple cut in theta for relations between hits with Delta_Layer = +-2.", m_ThetaCutDeltaL2);
28
29 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "AngleAndTimeDeltaUTime"), m_DeltaTU,
30 "Cut on the difference in u-side cluster time between two hits during relation creation.", m_DeltaTU);
31 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "AngleAndTimeDeltaVTime"), m_DeltaTV,
32 "Cut on the difference in v-side cluster time between two hits during relation creation.", m_DeltaTV);
33 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "useDeltaTCuts"), m_useDeltaTCuts,
34 "Use the cut on the time difference between two hits during relation creation?", m_useDeltaTCuts);
35}
36
37TrackFindingCDC::Weight
38AngleAndTimeRelationFilter::operator()(const std::pair<const VXDHoughState*, const VXDHoughState*>& relation)
39{
40 const VXDHoughState::DataCache& currentHitData = relation.first->getDataCache();
41 const VXDHoughState::DataCache& nextHitData = relation.second->getDataCache();
42
43 const double absThetaDiff = std::abs(currentHitData.theta - nextHitData.theta);
44
45 // if the connection is possible in u, it should also be possible in v, but as there could in principle be a chance that the hits
46 // are on different sensors (X.X.1 -> X.(X+-1).2 or X.X.2 -> X.(X+-1).1) check for a similar theta value instead of v
47 if (currentHitData.layer == nextHitData.layer) {
48 if (absThetaDiff > m_ThetaCutDeltaL0) {
49 return NAN;
50 }
51 // The hits are on the same layer but neighbouring ladders and in the overlap region they are in close proximity in phi.
52 // And since they passed the condition above, they are also in close proximity in theta.
53 // Thus they are close in phi and should be accepted.
54 return 1.0;
55 }
56
57 const ushort absLayerDiff = std::abs(currentHitData.layer - nextHitData.layer);
58 if ((absLayerDiff == 1 and absThetaDiff < m_ThetaCutDeltaL1) or
59 (absLayerDiff == 2 and absThetaDiff < m_ThetaCutDeltaL2)) {
60
61 if (not m_useDeltaTCuts or
63 and std::abs(currentHitData.uTime - nextHitData.uTime) < m_DeltaTU
64 and std::abs(currentHitData.vTime - nextHitData.vTime) < m_DeltaTV)) {
65 return 1.0;
66 }
67
68 }
69
70 return NAN;
71
72}
The Module parameter list class.
double m_ThetaCutDeltaL2
Filter relations in theta between hit states where the layer difference is +-2.
double m_ThetaCutDeltaL1
Filter relations in theta between hit states where the layer difference is +-1.
double m_DeltaTU
Cut on difference in u-side cluster time of the two hits.
TrackFindingCDC::Weight operator()(const std::pair< const VXDHoughState *, const VXDHoughState * > &relation) override
Return the weight based on azimuthal-angle separation and the time difference of the hits on both sid...
double m_ThetaCutDeltaL0
Cut on relations in theta for overlay region on same layer but different ladder.
double m_DeltaTV
Cut on difference in v-side cluster time of the two hits.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters.
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
Abstract base class for different kinds of events.
Cache containing the most important information of this state which will often be needed.
unsigned short layer
Geometrical Layer this state is based on.