Belle II Software  release-08-01-10
HitPatternVXD Class Reference

Hit pattern of the VXD within a track. More...

#include <HitPatternVXD.h>

Collaboration diagram for HitPatternVXD:

Public Types

enum class  PXDMode : unsigned short {
  normal = static_cast<unsigned short>(0) ,
  gated = 1
}
 PXD modes.
 

Public Member Functions

 HitPatternVXD ()
 Create empty pattern.
 
 HitPatternVXD (const unsigned int initValue)
 Initialize the pattern with an integer.
 
unsigned int getInteger () const
 Getter for the underlying integer. More...
 
unsigned short getNdf () const
 Get degrees of freedom in PXD and SVD. More...
 
unsigned short getNVXDLayers (const PXDMode &pxdmode=PXDMode::normal) const
 Return the total number of activated layers in the VXD depending on the mode of the PXD. More...
 
void setSVDLayer (const unsigned short layerId, unsigned short uHits, unsigned short vHits)
 Set the number of hits in a specific layer of the SVD. More...
 
std::pair< const unsigned short, const unsigned short > getSVDLayer (const unsigned short layerId) const
 Get the number of hits in a specific layer of the SVD. More...
 
void resetSVDLayer (const unsigned short layerId)
 Reset the number of hits in a specific layer of the SVD. More...
 
unsigned short getNSVDHits () const
 Get total number of hits in the SVD. More...
 
unsigned short getNSVDLayers () const
 Returns the total number of activated layers of the SVD. More...
 
short getFirstSVDLayer () const
 Get the first activated SVD layer index. More...
 
short getLastSVDLayer () const
 Get the last activated SVD layer index. More...
 
void setPXDLayer (const unsigned short layerId, unsigned short nHits, const PXDMode &mode=PXDMode::normal)
 Set the number of hits in a specific layer of the PXD. More...
 
unsigned short getPXDLayer (const unsigned short layerId, const PXDMode &mode=PXDMode::normal) const
 Get the number of hits in a specific layer of the PXD. More...
 
void resetPXDLayer (const unsigned short layerId, const PXDMode &mode=PXDMode::normal)
 Reset the number of hits in a specific layer of the PXD. More...
 
unsigned short getNPXDHits () const
 Get total number of hits in the PXD. More...
 
unsigned short getNPXDLayers (const PXDMode &mode=PXDMode::normal) const
 Returns the total number of activated layers of the PXD. More...
 
short getFirstPXDLayer (const PXDMode &mode=PXDMode::normal) const
 Returns the first activated layer of the PXD depending on the mode. More...
 
short getLastPXDLayer (const PXDMode &mode=PXDMode::normal) const
 Returns the last activated layer of the PXD depending on the mode. More...
 
void setInnermostHitShareStatus (const unsigned short innermostHitShareStatus)
 Set the innermost hit share flags for V0 daughters. More...
 
unsigned short getInnermostHitShareStatus () const
 Get the innermost hit share flags for V0 daughters. More...
 
void resetInnermostHitShareStatus ()
 Reset the innermost hit share flags for V0 daughters.
 
std::string __str__ () const
 String for printing in python.
 

Private Member Functions

std::bitset< 32 > getBitset () const
 Getter for underlying bitset.
 
std::bitset< 32 > getLayerMask (const unsigned short layerId) const
 Getter for the proper layer masks. More...
 

Private Attributes

std::bitset< 32 > m_pattern
 Storing of actual hit pattern. More...
 

Static Private Attributes

static const std::bitset< 32 > s_LayerMasks [6]
 Masks to zero out all bits from other layers. More...
 
static const std::bitset< 32 > s_PXDModeMasks [2]
 Mask to zero out all bits from other layers. More...
 
static const std::bitset< 32 > s_SVDuvMasks [2]
 Mask to zero out all bits from other layers. More...
 
static const std::bitset< 32 > s_V0DaughterMask
 Mask to zero out all bits from other layers.
 
static const std::bitset< 32 > s_infoLayerMask
 Mask to zero out all bits from other layers.
 
static const std::list< unsigned short > s_PXDLayerNumbers = {1, 2}
 For iterating through layers.
 
static const std::list< unsigned short > s_SVDLayerNumbers = {3, 4, 5, 6}
 For iterating through layers.
 
static const unsigned int s_svdUshift = 8
 for internal shifting to the SVD bits.
 
static const unsigned int s_svdVshift = 10
 for internal shifting to the SVD bits.
 

Friends

class HitPatternVXDTest_General_Test
 
class HitPatternVXDTest_NumberingScheme_Test
 
class HitPatternVXDTest_SVDSetterAndGetter_Test
 
class HitPatternVXDTest_PXDSetterAndGetter_Test
 

Detailed Description

Hit pattern of the VXD within a track.

The pattern is stored using a std::bitset. This allows to use the STL, which is very efficiently programmed.

Only hits from the outgoing arm are stored. For each layer there are two bits. The layer counting is:

  • PXD: layers 1 and 2;
  • SVD: layers 3, 4, 5 and 6.

The numbering scheme in this class is equivalent to the one defined in the note BELLE2-NOTE-TE-2015-010: https://docs.belle2.org/record/243

See also
HitPatternCDC

32 Bits are reserved. 4 Bits for each layer: 2 Bits for each PXD normal/gated-mode, 2 Bits for each SVD U/V-side. In total 24 Bits are used to represent hit patterns. Remaining upper 8 Bits are resevered for information. Lowest 2 Bits for V0 daughters (innermost hit share status), assigned in V0Finder. 0x1(0x2) bit represents V/z(U/r-phi)-hit share.

Definition at line 37 of file HitPatternVXD.h.

Member Function Documentation

◆ getFirstPXDLayer()

short getFirstPXDLayer ( const PXDMode mode = PXDMode::normal) const

Returns the first activated layer of the PXD depending on the mode.

If there is no hit in the PXD pattern, -1 is returned.

Parameters
modenormal or gated
See also
HitPatternVXD::PXDMode
Returns
Index of first layer.

Definition at line 166 of file HitPatternVXD.cc.

167 {
168  for (const auto layerId : s_PXDLayerNumbers) {
169  if (getPXDLayer(layerId, mode) > 0) return layerId;
170  }
171  return -1;
172 }
static const std::list< unsigned short > s_PXDLayerNumbers
For iterating through layers.
unsigned short getPXDLayer(const unsigned short layerId, const PXDMode &mode=PXDMode::normal) const
Get the number of hits in a specific layer of the PXD.

◆ getFirstSVDLayer()

short getFirstSVDLayer ( ) const

Get the first activated SVD layer index.

If there is no hit in the SVD pattern, -1 is returned.

Returns
Index of first layer.

Definition at line 103 of file HitPatternVXD.cc.

◆ getInnermostHitShareStatus()

unsigned short getInnermostHitShareStatus ( ) const

Get the innermost hit share flags for V0 daughters.

Returns
Innermost hit share status flags.

Definition at line 194 of file HitPatternVXD.cc.

◆ getInteger()

unsigned int getInteger ( ) const
inline

Getter for the underlying integer.

Returns
Hit pattern encoded as integer.

Definition at line 58 of file HitPatternVXD.h.

58 { return m_pattern.to_ulong(); }
std::bitset< 32 > m_pattern
Storing of actual hit pattern.

◆ getLastPXDLayer()

short getLastPXDLayer ( const PXDMode mode = PXDMode::normal) const

Returns the last activated layer of the PXD depending on the mode.

If there is no hit in the PXD pattern, -1 is returned.

Parameters
modenormal or gated
See also
HitPatternVXD::PXDMode
Returns
Index of last layer.

Definition at line 174 of file HitPatternVXD.cc.

◆ getLastSVDLayer()

short getLastSVDLayer ( ) const

Get the last activated SVD layer index.

If there is no hit in the SVD pattern, -1 is returned.

Returns
Index of last layer.

Definition at line 112 of file HitPatternVXD.cc.

◆ getLayerMask()

std::bitset<32> getLayerMask ( const unsigned short  layerId) const
inlineprivate

Getter for the proper layer masks.

Makes index handling more easy.

Definition at line 236 of file HitPatternVXD.h.

◆ getNdf()

unsigned short getNdf ( ) const

Get degrees of freedom in PXD and SVD.

Nota Bene: Only for the outgoing arm.

Returns
Degrees of freedom.

Definition at line 41 of file HitPatternVXD.cc.

◆ getNPXDHits()

unsigned short getNPXDHits ( ) const

Get total number of hits in the PXD.

Returns
Total number of hits in the PXD.

Definition at line 147 of file HitPatternVXD.cc.

◆ getNPXDLayers()

unsigned short getNPXDLayers ( const PXDMode mode = PXDMode::normal) const

Returns the total number of activated layers of the PXD.

Parameters
modenormal or gated
See also
HitPatternVXD::PXDMode
Returns
Total number of activated PXD layers.

Definition at line 157 of file HitPatternVXD.cc.

◆ getNSVDHits()

unsigned short getNSVDHits ( ) const

Get total number of hits in the SVD.

Returns
Total number of hits in the SVD.

Definition at line 83 of file HitPatternVXD.cc.

◆ getNSVDLayers()

unsigned short getNSVDLayers ( ) const

Returns the total number of activated layers of the SVD.

Returns
Number of activated SVD layers.

Definition at line 93 of file HitPatternVXD.cc.

◆ getNVXDLayers()

unsigned short getNVXDLayers ( const PXDMode pxdmode = PXDMode::normal) const

Return the total number of activated layers in the VXD depending on the mode of the PXD.

Parameters
pxdmodenormal or gated
See also
HitPatternVXD::PXDMode
Returns
Number of activated layers.

Definition at line 46 of file HitPatternVXD.cc.

◆ getPXDLayer()

unsigned short getPXDLayer ( const unsigned short  layerId,
const PXDMode mode = PXDMode::normal 
) const

Get the number of hits in a specific layer of the PXD.

Parameters
layerIdPXD layer index.
modenormal or gated
See also
HitPatternVXD::PXDMode
Returns
Number of hits in the PXD layer.

Definition at line 133 of file HitPatternVXD.cc.

◆ getSVDLayer()

std::pair< const unsigned short, const unsigned short > getSVDLayer ( const unsigned short  layerId) const

Get the number of hits in a specific layer of the SVD.

Parameters
layerIdSVD layer index.
Returns
Pair of (u, v) hits in the SVD layer.

Definition at line 65 of file HitPatternVXD.cc.

◆ resetPXDLayer()

void resetPXDLayer ( const unsigned short  layerId,
const PXDMode mode = PXDMode::normal 
)

Reset the number of hits in a specific layer of the PXD.

Parameters
layerIdPXD layer index.
modenormal or gated
See also
HitPatternVXD::PXDMode

Definition at line 141 of file HitPatternVXD.cc.

◆ resetSVDLayer()

void resetSVDLayer ( const unsigned short  layerId)

Reset the number of hits in a specific layer of the SVD.

Parameters
layerIdSVD layer index.

Definition at line 76 of file HitPatternVXD.cc.

◆ setInnermostHitShareStatus()

void setInnermostHitShareStatus ( const unsigned short  innermostHitShareStatus)

Set the innermost hit share flags for V0 daughters.

Parameters
innermostHitShareStatusInnermost hit share status flags.

Definition at line 183 of file HitPatternVXD.cc.

◆ setPXDLayer()

void setPXDLayer ( const unsigned short  layerId,
unsigned short  nHits,
const PXDMode mode = PXDMode::normal 
)

Set the number of hits in a specific layer of the PXD.

Parameters
layerIdPXD layer index.
nHits0-3 hits possible
modenormal or gated
See also
HitPatternVXD::PXDMode

Definition at line 122 of file HitPatternVXD.cc.

◆ setSVDLayer()

void setSVDLayer ( const unsigned short  layerId,
unsigned short  uHits,
unsigned short  vHits 
)

Set the number of hits in a specific layer of the SVD.

Parameters
layerIdSVD layer index.
uHits
vHits

Definition at line 51 of file HitPatternVXD.cc.

Member Data Documentation

◆ m_pattern

std::bitset<32> m_pattern
private

Storing of actual hit pattern.

PXD and SVD layer get 4 bits each. PXD has in each layer 4 bits where respectively two bits are used to store normal and gated mode hits separately. SVD has in each layer 4 bits where respectively two bits are used to store hits in u and v layer separately.

Definition at line 218 of file HitPatternVXD.h.

◆ s_LayerMasks

const std::bitset< 32 > s_LayerMasks
staticprivate
Initial value:
= {
std::bitset<32>(static_cast<std::string>("00000000000000000000000000001111")),
std::bitset<32>(static_cast<std::string>("00000000000000000000000011110000")),
std::bitset<32>(static_cast<std::string>("00000000000000000000111100000000")),
std::bitset<32>(static_cast<std::string>("00000000000000001111000000000000")),
std::bitset<32>(static_cast<std::string>("00000000000011110000000000000000")),
std::bitset<32>(static_cast<std::string>("00000000111100000000000000000000"))
}

Masks to zero out all bits from other layers.

Definition at line 220 of file HitPatternVXD.h.

◆ s_PXDModeMasks

const std::bitset< 32 > s_PXDModeMasks
staticprivate
Initial value:
= {
std::bitset<32>(static_cast<std::string>("00000000000000000000000000110011")),
std::bitset<32>(static_cast<std::string>("00000000000000000000000011001100"))
}

Mask to zero out all bits from other layers.

Definition at line 221 of file HitPatternVXD.h.

◆ s_SVDuvMasks

const std::bitset< 32 > s_SVDuvMasks
staticprivate
Initial value:
= {
std::bitset<32>(static_cast<std::string>("00000000001100110011001100000000")),
std::bitset<32>(static_cast<std::string>("00000000110011001100110000000000"))
}

Mask to zero out all bits from other layers.

Definition at line 222 of file HitPatternVXD.h.


The documentation for this class was generated from the following files: