Belle II Software  release-05-02-19
DATCONTrackingHoughtrafo.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2013 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Michael Schnell, Christian Wessel *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <tracking/modules/DATCON/DATCONTrackingModule.h>
12 
13 using namespace std;
14 using namespace Belle2;
15 
16 /*
17 * Transform to Hough space
18 */
19 void
20 DATCONTrackingModule::houghTrafo2d(svdHitMap& mapClusters, bool u_side)
21 {
22  TVector2 center;
23 
24  center.Set(m_trackCenterX, m_trackCenterY);
25 
26  for (auto& iter : mapClusters) {
27  double rStrip = 0;
28  int hitID = iter.first;
29  VxdID sensorID = iter.second.first;
30  TVector3 pos = iter.second.second;
31  TVector2 hough;
32 
33  if (!u_side) {
34  if (m_usePhase2Simulation) {
35  hough.Set(pos.X(), pos.Z());
36  } else {
37  rStrip = sqrt(pos.X() * pos.X() + pos.Y() * pos.Y());
38  hough.Set(rStrip, pos.Z());
39  }
40  vHough.insert(make_pair(hitID, make_pair(sensorID, hough)));
41  } else {
42  if (m_usePhase2Simulation) {
43  rStrip = sqrt((pow(pos.X() - center.X(), 2.0) + pow(pos.Y() - center.Y(), 2.0)));
44  } else {
45  rStrip = sqrt(pos.X() * pos.X() + pos.Y() * pos.Y());
46  }
47  hough.Set(pos.X() / (rStrip * rStrip), pos.Y() / (rStrip * rStrip));
48  uHough.insert(make_pair(hitID, make_pair(sensorID, hough)));
49  }
50  }
51 }
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::svdHitMap
std::map< int, svdHitPair > svdHitMap
Map containing integer ID and svdHitPair.
Definition: DATCONTrackingModule.h:68