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