Belle II Software  release-08-01-10
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 Belle2;
19 
21 {
22 
23 }
24 
26 {
27 
28 }
29 
30 
31 void
32 ROIGeometry::fillPlaneList(double toleranceZ, double tolerancePhi)
33 {
34 
35 
37 
38  std::set<Belle2::VxdID> pxdLayers = aGeometry.getLayers(VXD::SensorInfoBase::PXD);
39  std::set<Belle2::VxdID>::iterator itPxdLayers = pxdLayers.begin();
40 
41  // while (itPxdLayers != pxdLayers.end()) {
42  //in DESY TB the EUDET telescope planes have been associated to PXD layer 7, we do not want ROIs there, therefore:
43  while ((itPxdLayers != pxdLayers.end()) && (itPxdLayers->getLayerNumber() != 7)) {
44 
45  std::set<Belle2::VxdID> pxdLadders = aGeometry.getLadders(*itPxdLayers);
46  std::set<Belle2::VxdID>::iterator itPxdLadders = pxdLadders.begin();
47 
48  while (itPxdLadders != pxdLadders.end()) {
49 
50  std::set<Belle2::VxdID> pxdSensors = aGeometry.getSensors(*itPxdLadders);
51  std::set<Belle2::VxdID>::iterator itPxdSensors = pxdSensors.begin();
52  B2DEBUG(20, " pxd sensor info " << * (pxdSensors.begin()));
53 
54  while (itPxdSensors != pxdSensors.end()) {
55  B2DEBUG(20, " pxd sensor info " << *itPxdSensors);
56 
57  ROIDetPlane plane(*itPxdSensors, toleranceZ, tolerancePhi);
58  genfit::SharedPlanePtr sharedPlane(new ROIDetPlane(plane));
59  plane.setSharedPlanePtr(sharedPlane);
60 
61  m_planeList.push_back(plane);
62 
63  ++itPxdSensors;
64  }
65  ++itPxdLadders;
66  }
67  ++itPxdLayers;
68  }
69 
70  B2DEBUG(20, "just filled the plane list with " << m_planeList.size() << "planes");
71 };
72 
73 
74 void
75 ROIGeometry::appendSelectedPlanes(std::list<ROIDetPlane>* selectedPlanes, ROOT::Math::XYZVector recoTrackPosition, int layer)
76 {
77 
78 
79  std::list<ROIDetPlane>::iterator itPlanes = m_planeList.begin();
80 
81  B2DEBUG(20, "append Planes, checking " << m_planeList.size() << " planes");
82 
83  while (itPlanes != m_planeList.end()) {
84 
85  if (itPlanes->isSensorInRange(recoTrackPosition, layer))
86  selectedPlanes->push_back(*itPlanes);
87 
88  ++itPlanes;
89 
90  }
91 
92  B2DEBUG(20, " list of sensor IDs of the selected planes for this track:");
93  itPlanes = selectedPlanes->begin();
94  while (itPlanes != selectedPlanes->end()) {
95  B2DEBUG(20, " " << (itPlanes->getVxdID()));
96  ++itPlanes;
97  }
98 
99 }
ROIDetPlane describes the plane containing a sensor.
Definition: ROIDetPlane.h:26
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:75
void fillPlaneList(double toleranceZ, double tolerancePhi)
fill the list of planes
Definition: ROIGeometry.cc:32
ROIGeometry()
Constructor.
Definition: ROIGeometry.cc:20
~ROIGeometry()
Destructor.
Definition: ROIGeometry.cc:25
std::list< ROIDetPlane > m_planeList
Append the PXDIntercept infos related to the track theTrack to the listToBeFilled.
Definition: ROIGeometry.h:39
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:176
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:204
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
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:193
Abstract base class for different kinds of events.
std::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.