Belle II Software  release-06-01-15
SVDROIGeometry.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/svdROIFinder/SVDROIGeometry.h>
11 #include <framework/logging/Logger.h>
12 #include <vxd/geometry/GeoCache.h>
13 #include <vxd/geometry/SensorInfoBase.h>
14 
15 #include <set>
16 
17 using namespace std;
18 using namespace Belle2;
19 
20 
21 SVDROIGeometry::SVDROIGeometry()
22 {
23 
24 }
25 
26 SVDROIGeometry::~SVDROIGeometry()
27 {
28 
29 }
30 
31 void
32 SVDROIGeometry::fillPlaneList(double toleranceZ,
33  double tolerancePhi)
34 {
35 
36  VXD::GeoCache& geoCache = VXD::GeoCache::getInstance();
37 
38  std::set<Belle2::VxdID> svdLayers = geoCache.getLayers(VXD::SensorInfoBase::SVD);
39  std::set<Belle2::VxdID>::iterator itSvdLayers = svdLayers.begin();
40 
41  // while (itSvdLayers != svdLayers.end()) {
42  //in DESY TB the EUDET telescope planes have been associated to SVD layer 7, we do not want ROIs there, therefore:
43  while ((itSvdLayers != svdLayers.end()) && (itSvdLayers->getLayerNumber() != 7)) {
44 
45  std::set<Belle2::VxdID> svdLadders = geoCache.getLadders(*itSvdLayers);
46  std::set<Belle2::VxdID>::iterator itSvdLadders = svdLadders.begin();
47 
48  while (itSvdLadders != svdLadders.end()) {
49 
50  std::set<Belle2::VxdID> svdSensors = geoCache.getSensors(*itSvdLadders);
51  std::set<Belle2::VxdID>::iterator itSvdSensors = svdSensors.begin();
52 
53  while (itSvdSensors != svdSensors.end()) {
54  B2DEBUG(20, " svd sensor info " << *itSvdSensors);
55 
56  ROIDetPlane plane(*itSvdSensors, toleranceZ, tolerancePhi);
57  genfit::SharedPlanePtr sharedPlane(new ROIDetPlane(plane));
58  plane.setSharedPlanePtr(sharedPlane);
59 
60  m_planeList.push_back(plane);
61 
62  ++itSvdSensors;
63  }
64  ++itSvdLadders;
65  }
66  ++itSvdLayers;
67  }
68 
69  B2DEBUG(20, "just filled the plane list with " << m_planeList.size() << "planes");
70 };
71 
72 
73 void
74 SVDROIGeometry::appendSelectedPlanes(std::list<ROIDetPlane>* selectedPlanes, TVector3 recoTrackPosition, int layer)
75 {
76 
77 
78  std::list<ROIDetPlane>::iterator itPlanes = m_planeList.begin();
79 
80  B2DEBUG(20, " ..-append Planes, checking " << m_planeList.size() << " planes");
81 
82  while (itPlanes != m_planeList.end()) {
83 
84  if (itPlanes->isSensorInRange(recoTrackPosition, layer))
85  selectedPlanes->push_back(*itPlanes);
86 
87  ++itPlanes;
88 
89  }
90 
91  B2DEBUG(20, " ..--list of sensor IDs of the selected planes for this track:");
92  itPlanes = selectedPlanes->begin();
93  while (itPlanes != selectedPlanes->end()) {
94  B2DEBUG(20, " " << (itPlanes->getVxdID()));
95  ++itPlanes;
96  }
97 
98 }
99 
ROIDetPlane describes the plane containing a sensor.
Definition: ROIDetPlane.h:26
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
Definition: GeoCache.h:39
Abstract base class for different kinds of events.
std::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.