Belle II Software  release-08-01-10
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 using namespace Belle2;
14 using namespace TrackFindingCDC;
15 using namespace vxdHoughTracking;
16 
17 void AngleAndTimeRelationFilter::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
18 {
19  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "AngleAndTimeThetaCutDeltaL0"), m_ThetaCutDeltaL0,
20  "Simple cut in theta for the overlay region of different ladders in the same layer.",
21  m_ThetaCutDeltaL0);
22  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "AngleAndTimeThetaCutDeltaL1"), m_ThetaCutDeltaL1,
23  "Simple cut in theta for relations between hits with Delta_Layer = +-1.", m_ThetaCutDeltaL1);
24  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "AngleAndTimeThetaCutDeltaL2"), m_ThetaCutDeltaL2,
25  "Simple cut in theta for relations between hits with Delta_Layer = +-2.", m_ThetaCutDeltaL2);
26 
27  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "AngleAndTimeDeltaUTime"), m_DeltaTU,
28  "Cut on the difference in u-side cluster time between two hits during relation creation.", m_DeltaTU);
29  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "AngleAndTimeDeltaVTime"), m_DeltaTV,
30  "Cut on the difference in v-side cluster time between two hits during relation creation.", m_DeltaTV);
31  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "useDeltaTCuts"), m_useDeltaTCuts,
32  "Use the cut on the time difference between two hits during relation creation?", m_useDeltaTCuts);
33 }
34 
35 TrackFindingCDC::Weight
36 AngleAndTimeRelationFilter::operator()(const std::pair<const VXDHoughState*, const VXDHoughState*>& relation)
37 {
38  const VXDHoughState::DataCache& currentHitData = relation.first->getDataCache();
39  const VXDHoughState::DataCache& nextHitData = relation.second->getDataCache();
40 
41  const double absThetaDiff = abs(currentHitData.theta - nextHitData.theta);
42 
43  // 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
44  // 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
45  if (currentHitData.layer == nextHitData.layer) {
46  if (absThetaDiff > m_ThetaCutDeltaL0) {
47  return NAN;
48  }
49  // The hits are on the same layer but neighbouring ladders and in the overlap region they are in close proximity in phi.
50  // And since they passed the condition above, they are also in close proximity in theta.
51  // Thus they are close in phi and should be accepted.
52  return 1.0;
53  }
54 
55  const ushort absLayerDiff = abs(currentHitData.layer - nextHitData.layer);
56  if ((absLayerDiff == 1 and absThetaDiff < m_ThetaCutDeltaL1) or
57  (absLayerDiff == 2 and absThetaDiff < m_ThetaCutDeltaL2)) {
58 
59  if (not m_useDeltaTCuts or
60  (m_useDeltaTCuts and
61  abs(currentHitData.uTime - nextHitData.uTime) < m_DeltaTU and
62  abs(currentHitData.vTime - nextHitData.vTime) < m_DeltaTV)) {
63  return 1.0;
64  }
65 
66  }
67 
68  return NAN;
69 
70 }
The Module parameter list class.
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.
Definition: VXDHoughState.h:70
unsigned short layer
Geometrical Layer this state is based on.
Definition: VXDHoughState.h:96
float uTime
Time of the u-side cluster.
Definition: VXDHoughState.h:92
float vTime
Time of the v-side cluster.
Definition: VXDHoughState.h:94