 |
Belle II Software
release-05-01-25
|
15 #ifndef TRGCDCHoughPlaneBoolean_FLAG_
16 #define TRGCDCHoughPlaneBoolean_FLAG_
19 #include "trg/cdc/HoughPlaneBase.h"
21 #ifdef TRGCDC_SHORT_NAMES
22 #define TCHPlaneBoolean TRGCDCHoughPlaneBoolean
31 class TRGCDCHoughPlaneBoolean :
public TRGCDCHoughPlaneBase {
51 unsigned entry(
unsigned id)
const override;
53 unsigned entry(
unsigned x,
unsigned y)
const override;
57 const std::vector<unsigned>&
patternId(
unsigned cellId)
const;
65 void clear(
void)
override;
70 int weight = 1)
override;
98 void add(
unsigned cellId,
int weight)
override;
129 std::cout <<
"TRGCDCHoughPlaneBoolean !!! given serialId is too large : "
130 <<
"max=" <<
_n * 32 <<
",serialId=" <<
serialId << std::endl;
134 _cell[b0] |= (1 << b1);
136 _cell[b0] &= (~(1 << b1));
138 return (
_cell[b0] >> b1) & 1;
145 memset(
_cell, 0,
_n *
sizeof(
unsigned));
155 vote(rx, ry, 0, weight);
167 std::cout <<
"TRGCDCHoughPlaneBoolean::entry !!! given serialId is too large"
169 <<
"max=" <<
_n * 32 <<
",serialId=" <<
serialId << std::endl;
172 return (
_cell[b0] >> b1) & 1;
187 std::cout <<
"TRGCDCHoughPlaneBoolean::maxEntry !!! "
188 <<
" this function has no meaning for TRGCDCHoughPlaneBooolean object"
205 const std::vector<unsigned>&
void clear(void) override
clear all entries.
unsigned _n
nX * nY / 32 + 1
int maxEntry(void) const override
returns max. count in a plane.
float yMax(void) const
returns max. of y.
void vote(float rx, float ry, int weight=1) override
Votes.
unsigned serialId(unsigned x, unsigned y) const
returns serial ID for position (x, y).
std::string name(void) const
returns name.
float charge(void) const
returns charge for this plane.
unsigned setEntry(unsigned serialId, unsigned n) override
Sets entry.
unsigned *const _cell
cell
void add(unsigned cellId, int weight) override
Add to a cell.
A class to represent a Hough parameter plane.
unsigned ** _patterns
patterns
unsigned nY(void) const
return # of y bins.
virtual void clear(void)=0
Clears all entries.
unsigned entry(unsigned id) const override
returns entry in a cell.
Abstract base class for different kinds of events.
unsigned * _nActive
number of active cells
void registerPattern(unsigned id) override
registers a pattern..
const TRGCDCHoughTransformation & transformation(void) const
returns Hough transformation object.
virtual ~TRGCDCHoughPlaneBoolean()
Destructor.
unsigned _nPatterns
number of patterns
float xMin(void) const
returns min. of x.
void preparePatterns(unsigned nPatterns)
allocate memory for patterns.
void voteUsedInTrasan(float rx, float ry, float charge, int weight=1)
Votes with charge decision.
float xMax(void) const
returns max. of x.
const std::vector< unsigned > & patternId(unsigned cellId) const
returns pattern ID which activates specified cell.
std::vector< unsigned > * _reverse
Pattern ID's for each cell.
unsigned nX(void) const
returns # of x bins.
float yMin(void) const
returns min. of y.
TRGCDCHoughPlaneBoolean(const std::string &name, const TRGCDCHoughTransformation &transformation, unsigned nX, float xMin, float xMax, unsigned nY, float yMin, float yMax)
Contructor.