Belle II Software development
SimpleRelationFilter.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/SimpleRelationFilter.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
13using namespace Belle2;
14using namespace TrackFindingCDC;
15using namespace vxdHoughTracking;
16
17void SimpleRelationFilter::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
18{
19 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "simpleThetaCutDeltaL0"), m_SimpleThetaCutDeltaL0,
20 "Simple cut in theta for the overlay region of different ladders in the same layer.",
22 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "simpleThetaCutDeltaL1"), m_SimpleThetaCutDeltaL1,
23 "Simple cut in theta for relations between hits with Delta_Layer = +-1.", m_SimpleThetaCutDeltaL1);
24 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "simpleThetaCutDeltaL2"), m_SimpleThetaCutDeltaL2,
25 "Simple cut in theta for relations between hits with Delta_Layer = +-2.", m_SimpleThetaCutDeltaL2);
26}
27
28TrackFindingCDC::Weight
29SimpleRelationFilter::operator()(const std::pair<const VXDHoughState*, const VXDHoughState*>& relation)
30{
31 const VXDHoughState::DataCache& currentVXDHoughState = relation.first->getDataCache();
32 const VXDHoughState::DataCache& nextVXDHoughState = relation.second->getDataCache();
33
34 const double absThetaDiff = abs(currentVXDHoughState.theta - nextVXDHoughState.theta);
35
36 // 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
37 // 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
38 if (currentVXDHoughState.layer == nextVXDHoughState.layer) {
39 if (absThetaDiff > m_SimpleThetaCutDeltaL0) {
40 return NAN;
41 }
42 // The hits are on the same layer but neighbouring ladders and in the overlap region they are in close proximity in phi.
43 // And since they passed the condition above, they are also in close proximity in theta.
44 // Thus they are close in phi and should be accepted.
45 return 1.0;
46 }
47
48 const ushort absLayerDiff = abs(currentVXDHoughState.layer - nextVXDHoughState.layer);
49 if ((absLayerDiff == 1 and absThetaDiff < m_SimpleThetaCutDeltaL1) or
50 (absLayerDiff == 2 and absThetaDiff < m_SimpleThetaCutDeltaL2)) {
51 return 1.0;
52 }
53
54 return NAN;
55
56}
The Module parameter list class.
double m_SimpleThetaCutDeltaL1
Filter relations in theta between hit states where the layer difference is +-1.
double m_SimpleThetaCutDeltaL2
Filter relations in theta between hit states where the layer difference is +-2.
TrackFindingCDC::Weight operator()(const std::pair< const VXDHoughState *, const VXDHoughState * > &relation) override
Return the weight based on azimuthal-angle separation.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters.
double m_SimpleThetaCutDeltaL0
Cut on relations in theta for overlay region on same layer but different ladder.
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