14#ifndef TRGCDCHoughPlaneBoolean_FLAG_
15#define TRGCDCHoughPlaneBoolean_FLAG_
18#include "trg/cdc/HoughPlaneBase.h"
20#ifdef TRGCDC_SHORT_NAMES
21#define TCHPlaneBoolean TRGCDCHoughPlaneBoolean
56 unsigned entry(
unsigned id)
const override;
58 unsigned entry(
unsigned x,
unsigned y)
const override;
62 const std::vector<unsigned>&
patternId(
unsigned cellId)
const;
71 void clear(
void)
override;
76 int weight = 1)
override;
79#pragma clang diagnostic push
80#pragma clang diagnostic ignored "-Woverloaded-virtual"
95#pragma clang diagnostic pop
113 void add(
unsigned cellId,
int weight)
override;
130 friend class TRGCDCHoughPlaneMulti2;
144 std::cout <<
"TRGCDCHoughPlaneBoolean !!! given serialId is too large : "
145 <<
"max=" <<
_n * 32 <<
",serialId=" <<
serialId << std::endl;
149 _cell[b0] |= (1 << b1);
151 _cell[b0] &= (~(1 << b1));
153 return (
_cell[b0] >> b1) & 1;
160 memset(
_cell, 0,
_n *
sizeof(
unsigned));
170 vote(rx, ry, 0, weight);
182 std::cout <<
"TRGCDCHoughPlaneBoolean::entry !!! given serialId is too large"
184 <<
"max=" <<
_n * 32 <<
",serialId=" <<
serialId << std::endl;
187 return (
_cell[b0] >> b1) & 1;
202 std::cout <<
"TRGCDCHoughPlaneBoolean::maxEntry !!! "
203 <<
" this function has no meaning for TRGCDCHoughPlaneBooolean object"
220 const std::vector<unsigned>&
unsigned _n
nX * nY / 32 + 1
unsigned ** _patterns
patterns
unsigned _nPatterns
number of patterns
unsigned *const _cell
cell
std::vector< unsigned > * _reverse
Pattern ID's for each cell.
unsigned * _nActive
number of active cells
TRGCDCHoughPlaneBoolean(TRGCDCHoughPlaneBoolean &)=delete
Copy constructor, deleted.
TRGCDCHoughPlaneBoolean & operator=(TRGCDCHoughPlaneBoolean &)=delete
Assignment operator, delete.
void registerPattern(unsigned id) override
registers a pattern..
virtual void clear(void)=0
Clears all entries.
float xMin(void) const
returns min. of x.
void voteUsedInTrasan(float rx, float ry, float charge, int weight=1)
Votes with charge decision.
unsigned nY(void) const
return # of y bins.
void add(unsigned cellId, int weight) override
Add to a cell.
float xMax(void) const
returns max. of x.
void preparePatterns(unsigned nPatterns)
allocate memory for patterns.
void vote(float rx, float ry, int weight=1) override
Votes.
float charge(void) const
returns charge for this plane.
unsigned serialId(unsigned x, unsigned y) const
returns serial ID for position (x, y).
TRGCDCHoughPlaneBase(const std::string &name, const TRGCDCHoughTransformation &transformation, unsigned nX, float xMin, float xMax, unsigned nY, float yMin, float yMax)
Constructor.
int maxEntry(void) const override
returns max. count in a plane.
float yMax(void) const
returns max. of y.
TRGCDCHoughPlaneBoolean(const std::string &name, const TRGCDCHoughTransformation &transformation, unsigned nX, float xMin, float xMax, unsigned nY, float yMin, float yMax)
Constructor.
const std::vector< unsigned > & patternId(unsigned cellId) const
returns pattern ID which activates specified cell.
void clear(void) override
clear all entries.
const TRGCDCHoughTransformation & transformation(void) const
returns Hough transformation object.
std::string name(void) const
returns name.
unsigned entry(unsigned id) const override
returns entry in a cell.
unsigned nX(void) const
returns # of x bins.
float yMin(void) const
returns min. of y.
virtual ~TRGCDCHoughPlaneBoolean()
Destructor.
unsigned setEntry(unsigned serialId, unsigned n) override
Sets entry.
Abstract base class for different kinds of events.