Belle II Software development
ROIid.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#include <tracking/dataobjects/ROIid.h>
10
11
12using namespace Belle2;
13
16{
17}
18
20{
21}
22
23
24bool
25ROIid::Contains(const PXDRawHit& thePXDRawHit) const
26{
27 return (m_minUid <= thePXDRawHit.getUCellID() &&
28 m_maxUid >= thePXDRawHit.getUCellID() &&
29 m_minVid <= thePXDRawHit.getVCellID() &&
30 m_maxVid >= thePXDRawHit.getVCellID() &&
31 m_sensorID == thePXDRawHit.getSensorID().getID()
32 );
33}
34
35
36bool
37ROIid::Contains(const PXDDigit& thePXDDigit) const
38{
39 return (m_minUid <= thePXDDigit.getUCellID() &&
40 m_maxUid >= thePXDDigit.getUCellID() &&
41 m_minVid <= thePXDDigit.getVCellID() &&
42 m_maxVid >= thePXDDigit.getVCellID() &&
43 m_sensorID == thePXDDigit.getSensorID().getID()
44 );
45}
46
47bool ROIid::Contains(const Belle2::SVDShaperDigit& theSVDDigit) const
48{
49
50 bool inside = false;
51
52 if (theSVDDigit.isUStrip())
53 inside = (m_minUid <= theSVDDigit.getCellID() && m_maxUid >= theSVDDigit.getCellID());
54 else
55 inside = (m_minVid <= theSVDDigit.getCellID() && m_maxVid >= theSVDDigit.getCellID());
56
57 return (inside && m_sensorID == theSVDDigit.getSensorID().getID());
58
59}
The PXD digit class.
Definition PXDDigit.h:27
unsigned short getVCellID() const
Get cell ID in v.
Definition PXDDigit.h:88
unsigned short getUCellID() const
Get cell ID in u.
Definition PXDDigit.h:83
VxdID getSensorID() const
Get the sensor ID.
Definition PXDDigit.h:78
The PXD Raw Hit class This class stores information about PXD Pixel hits and makes them available in ...
Definition PXDRawHit.h:24
short getUCellID() const
Get u cell id of hit position.
Definition PXDRawHit.h:84
VxdID getSensorID() const
Get the sensor ID.
Definition PXDRawHit.h:52
short getVCellID() const
Get v cell id of hit position.
Definition PXDRawHit.h:68
VxdID::baseType m_sensorID
sensor ID
Definition ROIid.h:67
bool Contains(const PXDRawHit &thePXDRawHit) const
true if the ROI contains the thePXDRawHit
Definition ROIid.cc:25
int m_minVid
v ID of the bottom left pixel of the ROI
Definition ROIid.h:65
virtual ~ROIid()
Destructor.
Definition ROIid.cc:19
int m_minUid
u ID of the bottom left pixel of the ROI
Definition ROIid.h:63
ROIid()
Default constructor.
Definition ROIid.cc:14
int m_maxUid
u ID of the top right pixel of the ROI
Definition ROIid.h:64
int m_maxVid
v ID of the top right pixel of the ROI
Definition ROIid.h:66
The SVD ShaperDigit class.
VxdID getSensorID() const
Get the sensor ID.
short int getCellID() const
Get strip ID.
bool isUStrip() const
Get strip direction.
baseType getID() const
Get the unique id.
Definition VxdID.h:94
Abstract base class for different kinds of events.