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