Belle II Software  release-05-01-25
ROIGeometry.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, Eugenio Paoloni *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 
12 #include "tracking/pxdDataReductionClasses/ROIGeometry.h"
13 #include <framework/logging/Logger.h>
14 #include <vxd/geometry/GeoCache.h>
15 #include <vxd/geometry/SensorInfoBase.h>
16 #include <tracking/pxdDataReductionClasses/ROIDetPlane.h>
17 
18 #include <set>
19 
20 using namespace std;
21 using namespace Belle2;
22 
23 ROIGeometry::ROIGeometry()
24 {
25 
26 }
27 
28 ROIGeometry::~ROIGeometry()
29 {
30 
31 }
32 
33 
34 void
35 ROIGeometry::fillPlaneList(double toleranceZ, double tolerancePhi)
36 {
37 
38 
39  VXD::GeoCache& aGeometry = VXD::GeoCache::getInstance();
40 
41  std::set<Belle2::VxdID> pxdLayers = aGeometry.getLayers(VXD::SensorInfoBase::PXD);
42  std::set<Belle2::VxdID>::iterator itPxdLayers = pxdLayers.begin();
43 
44  // while (itPxdLayers != pxdLayers.end()) {
45  //in DESY TB the EUDET telescope planes have been associated to PXD layer 7, we do not want ROIs there, therefore:
46  while ((itPxdLayers != pxdLayers.end()) && (itPxdLayers->getLayerNumber() != 7)) {
47 
48  std::set<Belle2::VxdID> pxdLadders = aGeometry.getLadders(*itPxdLayers);
49  std::set<Belle2::VxdID>::iterator itPxdLadders = pxdLadders.begin();
50 
51  while (itPxdLadders != pxdLadders.end()) {
52 
53  std::set<Belle2::VxdID> pxdSensors = aGeometry.getSensors(*itPxdLadders);
54  std::set<Belle2::VxdID>::iterator itPxdSensors = pxdSensors.begin();
55  B2DEBUG(20, " pxd sensor info " << * (pxdSensors.begin()));
56 
57  while (itPxdSensors != pxdSensors.end()) {
58  B2DEBUG(20, " pxd sensor info " << *itPxdSensors);
59 
60  ROIDetPlane plane(*itPxdSensors, toleranceZ, tolerancePhi);
61  genfit::SharedPlanePtr sharedPlane(new ROIDetPlane(plane));
62  plane.setSharedPlanePtr(sharedPlane);
63 
64  m_planeList.push_back(plane);
65 
66  ++itPxdSensors;
67  }
68  ++itPxdLadders;
69  }
70  ++itPxdLayers;
71  }
72 
73  B2DEBUG(20, "just filled the plane list with " << m_planeList.size() << "planes");
74 };
75 
76 
77 void
78 ROIGeometry::appendSelectedPlanes(std::list<ROIDetPlane>* selectedPlanes, TVector3 recoTrackPosition, int layer)
79 {
80 
81 
82  std::list<ROIDetPlane>::iterator itPlanes = m_planeList.begin();
83 
84  B2DEBUG(20, "append Planes, checking " << m_planeList.size() << " planes");
85 
86  while (itPlanes != m_planeList.end()) {
87 
88  if (itPlanes->isSensorInRange(recoTrackPosition, layer))
89  selectedPlanes->push_back(*itPlanes);
90 
91  ++itPlanes;
92 
93  }
94 
95  B2DEBUG(20, " list of sensor IDs of the selected planes for this track:");
96  itPlanes = selectedPlanes->begin();
97  while (itPlanes != selectedPlanes->end()) {
98  B2DEBUG(20, " " << (itPlanes->getVxdID()));
99  ++itPlanes;
100  }
101 
102 }
genfit::SharedPlanePtr
std::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
Definition: SharedPlanePtr.h:40
Belle2::VXD::GeoCache::getLayers
const std::set< Belle2::VxdID > getLayers(SensorInfoBase::SensorType sensortype=SensorInfoBase::VXD)
Return a set of all known Layers.
Definition: GeoCache.cc:177
Belle2::VXD::GeoCache::getSensors
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:205
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
Belle2::VXD::GeoCache::getLadders
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:194