Belle II Software  release-05-02-19
DATCONTrackingConversionFunctions.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 void DATCONTrackingModule::prepareDATCONSVDSpacePoints()
17 {
18  int indexCounter = 0;
19 
20  if (storeDATCONSVDSpacePoints.getEntries() == 0) {
21  return;
22  }
23 
24  uClusters.clear();
25  vClusters.clear();
26 
27  /* First convert to absolute hits and save into a map */
28  for (auto& datconspacepoint : storeDATCONSVDSpacePoints) {
29  VxdID sensorID = datconspacepoint.getVxdID();
30  TVector3 pos = datconspacepoint.getPosition();
31 
32  unsigned int uvID = 10000000 * sensorID.getLayerNumber() + 100000 * sensorID.getLadderNumber() + 10000 * sensorID.getSensorNumber()
33  +
34  indexCounter;
35  vClusters.insert(std::make_pair(uvID, std::make_pair(sensorID, pos)));
36  uClusters.insert(std::make_pair(uvID, std::make_pair(sensorID, pos)));
37  ++indexCounter;
38 
39  }
40 }
41 
42 void DATCONTrackingModule::prepareSVDSpacePoints()
43 {
44  int indexCounter = 0;
45 
46  if (storeSVDSpacePoints.getEntries() == 0) {
47  return;
48  }
49 
50  uClusters.clear();
51  vClusters.clear();
52 
53  /* First convert to absolute hits and save into a map */
54  for (auto& svdspacepoint : storeSVDSpacePoints) {
55  VxdID sensorID = svdspacepoint.getVxdID();
56  TVector3 pos = svdspacepoint.getPosition();
57 
58  unsigned int uvID = 10000000 * sensorID.getLayerNumber() + 100000 * sensorID.getLadderNumber() + 10000 * sensorID.getSensorNumber()
59  +
60  indexCounter;
61  vClusters.insert(std::make_pair(uvID, std::make_pair(sensorID, pos)));
62  uClusters.insert(std::make_pair(uvID, std::make_pair(sensorID, pos)));
63  ++indexCounter;
64 
65  }
66 }
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::VxdID::getLadderNumber
baseType getLadderNumber() const
Get the ladder id.
Definition: VxdID.h:108
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::VxdID::getSensorNumber
baseType getSensorNumber() const
Get the sensor id.
Definition: VxdID.h:110
Belle2::VxdID::getLayerNumber
baseType getLayerNumber() const
Get the layer id.
Definition: VxdID.h:106