13 #ifndef TRGCDCHoughPlaneMulti2_FLAG_
14 #define TRGCDCHoughPlaneMulti2_FLAG_
16 #include "trg/cdc/HoughPlane.h"
17 #include "trg/cdc/HoughPlaneBoolean.h"
19 #ifdef TRGCDC_SHORT_NAMES
20 #define TCHPlaneMulti2 TRGCDCHoughPlaneMulti2
57 const std::vector<unsigned>&
patternId(
unsigned cellId)
const;
60 const std::vector<unsigned>&
patternId(
unsigned layer,
61 unsigned cellId)
const;
63 void dump(
unsigned layerId)
const;
66 void dump(
const std::string& message = std::string(
""),
67 const std::string& prefix = std::string(
""))
const override;
72 void clear(
void)
override;
75 void clear(
unsigned layerId);
92 void vote(
unsigned layerId,
unsigned localId,
int weight = 1);
145 for (
unsigned i = 0; i <
N_LAYERS; i++)
157 for (
unsigned i = 0; i <
N_LAYERS; i++)
217 }
else if (a ==
"region") {
220 for (
unsigned i = 0; i <
_nLayers; i++) {
221 std::cout << b <<
name() <<
" : layer " << i << std::endl;
224 std::cout << b <<
name() <<
" : merged plane " << std::endl;
237 const std::vector<unsigned>&
239 unsigned cellId)
const
A class to represent a Hough parameter plane.
A class to represent a Hough parameter plane.
void registerPattern(unsigned id) override
registers a pattern..
virtual void vote(float rx, float ry, int weight=1)
Voting.
unsigned _nLayers
# of layers.
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.
TRGCDCHoughPlaneBoolean * _layers[N_LAYERS]
Hough plane for each layer.
void finalizePatterns(void)
finalize patterns.
bool _usage[N_LAYERS]
Used or not.
unsigned setEntry(unsigned serialId, unsigned n) override
Sets entry.
A class to represent a Hough parameter plane.
void registerPattern(unsigned id) override
Registers a pattern on a Hough plane with (r, phi=0).
virtual void vote(float rx, float ry, int weight=1)
Voring.
void preparePatterns(unsigned layerId, unsigned nPatterns)
allocate memory for patterns.
float xMin(void) const
returns min. of x.
virtual ~TRGCDCHoughPlaneMulti2()
Destructor.
virtual void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
unsigned nY(void) const
return # of y bins.
void mergeOuters(void)
Merge outer layers into one.
TRGCDCHoughPlaneMulti2(const std::string &name, const TRGCDCHoughTransformation &transformation, unsigned nX, float xMin, float xMax, unsigned nY, float yMin, float yMax, unsigned nLayers)
Contructor.
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.
void dump(unsigned layerId) const
Dumps debug information.
unsigned serialId(unsigned x, unsigned y) const
returns serial ID for position (x, y).
#define N_LAYERS
number of layers
void merge(void)
Merge layers into one.
float yMax(void) const
returns max. of y.
unsigned nLayers(void) const
returns # of Hough Boolean layers.
const std::vector< unsigned > & patternId(unsigned cellId) const
returns pattern ID which activates specified cell.
void clear(void) override
Clears all entries and regions.
const TRGCDCHoughTransformation & transformation(void) const
returns Hough transformation object.
std::string name(void) const
returns name.
unsigned nX(void) const
returns # of x bins.
void clearCells(void)
Clears entires only.
float yMin(void) const
returns min. of y.
unsigned setEntry(unsigned serialId, unsigned n) override
Sets entry.
Abstract base class for different kinds of events.