Belle II Software development
ROIGeometry.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
9
10#include <tracking/roiFinding/ROIGeometry.h>
11#include <tracking/roiFinding/ROIDetPlane.h>
12#include <framework/logging/Logger.h>
13#include <vxd/geometry/GeoCache.h>
14#include <vxd/geometry/SensorInfoBase.h>
15
16#include <set>
17
18using namespace Belle2;
19
21{
22
23}
24
26{
27
28}
29
30
31void
32ROIGeometry::fillPlaneList(double toleranceZ, double tolerancePhi, const VXD::SensorInfoBase::SensorType det)
33{
34
36
37 std::set<Belle2::VxdID> vxdLayers = geoCache.getLayers(det);
38 std::set<Belle2::VxdID>::iterator itVXDLayers = vxdLayers.begin();
39
40 while (itVXDLayers != vxdLayers.end()) {
41
42 std::set<Belle2::VxdID> vxdLadders = geoCache.getLadders(*itVXDLayers);
43 std::set<Belle2::VxdID>::iterator itVXDLadders = vxdLadders.begin();
44
45 while (itVXDLadders != vxdLadders.end()) {
46
47 std::set<Belle2::VxdID> vxdSensors = geoCache.getSensors(*itVXDLadders);
48 std::set<Belle2::VxdID>::iterator itVXDSensors = vxdSensors.begin();
49 B2DEBUG(20, " vxd sensor info " << * (vxdSensors.begin()));
50
51 while (itVXDSensors != vxdSensors.end()) {
52 B2DEBUG(20, " vxd sensor info " << *itVXDSensors);
53
54 ROIDetPlane plane(*itVXDSensors, toleranceZ, tolerancePhi);
55 genfit::SharedPlanePtr sharedPlane(new ROIDetPlane(plane));
56 plane.setSharedPlanePtr(sharedPlane);
57
58 m_planeList.push_back(plane);
59
60 ++itVXDSensors;
61 }
62 ++itVXDLadders;
63 }
64 ++itVXDLayers;
65 }
66
67 B2DEBUG(20, "just filled the plane list with " << m_planeList.size() << "planes");
68};
69
70
71void
72ROIGeometry::appendSelectedPlanes(std::list<ROIDetPlane>* selectedPlanes, ROOT::Math::XYZVector recoTrackPosition, int layer)
73{
74
75
76 std::list<ROIDetPlane>::iterator itPlanes = m_planeList.begin();
77
78 B2DEBUG(20, "append Planes, checking " << m_planeList.size() << " planes");
79
80 while (itPlanes != m_planeList.end()) {
81
82 if (itPlanes->isSensorInRange(recoTrackPosition, layer))
83 selectedPlanes->push_back(*itPlanes);
84
85 ++itPlanes;
86
87 }
88
89 B2DEBUG(20, " list of sensor IDs of the selected planes for this track:");
90 itPlanes = selectedPlanes->begin();
91 while (itPlanes != selectedPlanes->end()) {
92 B2DEBUG(20, " " << (itPlanes->getVxdID()));
93 ++itPlanes;
94 }
95
96}
ROIDetPlane describes the plane containing a sensor.
Definition: ROIDetPlane.h:26
void fillPlaneList(double toleranceZ, double tolerancePhi, const VXD::SensorInfoBase::SensorType det)
fill the list of planes
Definition: ROIGeometry.cc:32
void appendSelectedPlanes(std::list< ROIDetPlane > *selectedPlanes, ROOT::Math::XYZVector recoTrackPosition, int layer)
Append to selectedPlanes those in the internal list for which a sensor is near the RecoTrack position...
Definition: ROIGeometry.cc:72
ROIGeometry()
Constructor.
Definition: ROIGeometry.cc:20
~ROIGeometry()
Destructor.
Definition: ROIGeometry.cc:25
std::list< ROIDetPlane > m_planeList
list of planes
Definition: ROIGeometry.h:35
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
Definition: GeoCache.h:39
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
SensorType
Enum specifing the type of sensor the SensorInfo represents.
Abstract base class for different kinds of events.