Belle II Software  release-06-02-00
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/pxdDataReductionClasses/ROIGeometry.h"
11 #include <framework/logging/Logger.h>
12 #include <vxd/geometry/GeoCache.h>
13 #include <vxd/geometry/SensorInfoBase.h>
14 #include <tracking/pxdDataReductionClasses/ROIDetPlane.h>
15 
16 #include <set>
17 
18 using namespace std;
19 using namespace Belle2;
20 
21 ROIGeometry::ROIGeometry()
22 {
23 
24 }
25 
26 ROIGeometry::~ROIGeometry()
27 {
28 
29 }
30 
31 
32 void
33 ROIGeometry::fillPlaneList(double toleranceZ, double tolerancePhi)
34 {
35 
36 
37  VXD::GeoCache& aGeometry = VXD::GeoCache::getInstance();
38 
39  std::set<Belle2::VxdID> pxdLayers = aGeometry.getLayers(VXD::SensorInfoBase::PXD);
40  std::set<Belle2::VxdID>::iterator itPxdLayers = pxdLayers.begin();
41 
42  // while (itPxdLayers != pxdLayers.end()) {
43  //in DESY TB the EUDET telescope planes have been associated to PXD layer 7, we do not want ROIs there, therefore:
44  while ((itPxdLayers != pxdLayers.end()) && (itPxdLayers->getLayerNumber() != 7)) {
45 
46  std::set<Belle2::VxdID> pxdLadders = aGeometry.getLadders(*itPxdLayers);
47  std::set<Belle2::VxdID>::iterator itPxdLadders = pxdLadders.begin();
48 
49  while (itPxdLadders != pxdLadders.end()) {
50 
51  std::set<Belle2::VxdID> pxdSensors = aGeometry.getSensors(*itPxdLadders);
52  std::set<Belle2::VxdID>::iterator itPxdSensors = pxdSensors.begin();
53  B2DEBUG(20, " pxd sensor info " << * (pxdSensors.begin()));
54 
55  while (itPxdSensors != pxdSensors.end()) {
56  B2DEBUG(20, " pxd sensor info " << *itPxdSensors);
57 
58  ROIDetPlane plane(*itPxdSensors, toleranceZ, tolerancePhi);
59  genfit::SharedPlanePtr sharedPlane(new ROIDetPlane(plane));
60  plane.setSharedPlanePtr(sharedPlane);
61 
62  m_planeList.push_back(plane);
63 
64  ++itPxdSensors;
65  }
66  ++itPxdLadders;
67  }
68  ++itPxdLayers;
69  }
70 
71  B2DEBUG(20, "just filled the plane list with " << m_planeList.size() << "planes");
72 };
73 
74 
75 void
76 ROIGeometry::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 }
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
const std::set< Belle2::VxdID > getLayers(SensorInfoBase::SensorType sensortype=SensorInfoBase::VXD)
Return a set of all known Layers.
Definition: GeoCache.cc:175
const std::set< Belle2::VxdID > & getSensors(Belle2::VxdID ladder) const
Return a set of all sensor IDs belonging to a given ladder.
Definition: GeoCache.cc:203
const std::set< Belle2::VxdID > & getLadders(Belle2::VxdID layer) const
Return a set of all ladder IDs belonging to a given layer.
Definition: GeoCache.cc:192
Abstract base class for different kinds of events.
std::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.