Belle II Software  release-05-01-25
PXDRawROIs.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2013 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors:Bjoern Spruck *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef PXDRAWROIS_H
12 #define PXDRAWROIS_H
13 
14 #include <framework/datastore/RelationsObject.h>
15 
16 namespace Belle2 {
28  class PXDRawROIs : public RelationsObject {
29  public:
30 
32  PXDRawROIs():
33  m_2timesNrROIs(0), m_rois(NULL) {};
34 
35 
40  PXDRawROIs(unsigned int nrroi, unsigned int* data);
41 
44  ~PXDRawROIs();
45 
50  unsigned int getNrROIs() const
51  {
52  return m_2timesNrROIs / 2;
53  }
54 
59  int getDHHID(int j) const
60  {
61  if (j < 0 || j >= (int)m_2timesNrROIs / 2) return -1;
62  return (m_rois[2 * j] >> 4) & 0x3F; // & 0x3F0
63  }
64 
69  int getMinVid(int j) const
70  {
71  if (j < 0 || j >= (int)m_2timesNrROIs / 2) return -1;
72  return ((m_rois[2 * j] << 6) & 0x3C0) | ((m_rois[2 * j + 1] >> 26) & 0x3F) ;// & 0x00F , & 0xFC000000
73  }
74 
79  int getMaxVid(int j) const
80  {
81  if (j < 0 || j >= (int)m_2timesNrROIs / 2) return -1;
82  return (m_rois[2 * j + 1] >> 8) & 0x3FF; // & 0x0003FF00
83  }
84 
89  int getMinUid(int j) const
90  {
91  if (j < 0 || j >= (int)m_2timesNrROIs / 2) return -1;
92  return (m_rois[2 * j + 1] >> 18) & 0xFF; // & 0x03FC0000
93  }
94 
99  int getMaxUid(int j) const
100  {
101  if (j < 0 || j >= (int)m_2timesNrROIs / 2) return -1;
102  return (m_rois[2 * j + 1]) & 0xFF;
103  }
104 
109  int getType(int j) const
110  {
111  if (j < 0 || j >= (int)m_2timesNrROIs / 2) return -1;
112  return (m_rois[2 * j] >> 10) & 0x1; // & 0x400
113  }
114 
115  private:
116  unsigned int m_2timesNrROIs;
118  int* m_rois; //[m_2timesNrROIs] // DONT MODIFY THIS COMMENT AS NECESSARY FOR ROOT STREAMER
119 
121  ClassDef(PXDRawROIs, 3)
122  };
123 
124 
126 } //Belle2 namespace
127 #endif
Belle2::PXDRawROIs::getMaxVid
int getMaxVid(int j) const
Return MaxVid (Row 2) of ROI j.
Definition: PXDRawROIs.h:87
Belle2::PXDRawROIs::PXDRawROIs
PXDRawROIs()
Default constructor for the ROOT IO.
Definition: PXDRawROIs.h:40
Belle2::RelationsInterface::ClassDef
ClassDef(RelationsInterface, 0)
defines interface for accessing relations of objects in StoreArray.
Belle2::PXDRawROIs::getMaxUid
int getMaxUid(int j) const
Return MaxUid (Col 2) of ROI j.
Definition: PXDRawROIs.h:107
Belle2::PXDRawROIs::getMinVid
int getMinVid(int j) const
Return MinVid (Row 1) of ROI j.
Definition: PXDRawROIs.h:77
Belle2::PXDRawROIs::m_rois
int * m_rois
Buffer of size 2*m_NrROIs ints.
Definition: PXDRawROIs.h:126
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::PXDRawROIs::getType
int getType(int j) const
Return Type (Datcon or HLT) of ROI j.
Definition: PXDRawROIs.h:117
Belle2::PXDRawROIs::~PXDRawROIs
~PXDRawROIs()
Destructor.
Definition: PXDRawROIs.cc:27
Belle2::PXDRawROIs::m_2timesNrROIs
unsigned int m_2timesNrROIs
Number of ROIs times two (size of one ROI is 2*32bit)
Definition: PXDRawROIs.h:124
Belle2::PXDRawROIs::getMinUid
int getMinUid(int j) const
Return MinUid (Col 1) of ROI j.
Definition: PXDRawROIs.h:97
Belle2::RelationsObject
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
Definition: RelationsObject.h:443
Belle2::PXDRawROIs::getDHHID
int getDHHID(int j) const
Return DHH ID of ROI j.
Definition: PXDRawROIs.h:67
Belle2::PXDRawROIs::getNrROIs
unsigned int getNrROIs() const
Get the nr of ROIs.
Definition: PXDRawROIs.h:58