 |
Belle II Software
release-05-01-25
|
14 #define TRGCDC_SHORT_NAMES
16 #include "trg/cdc/HoughPlaneBase.h"
25 const TCHTransformation& trans,
38 _xSize((xMax - xMin) / float(nX)),
42 _ySize((yMax - yMin) / float(nY)),
56 unsigned& X0,
unsigned& Y0,
57 unsigned& X1,
unsigned& Y1)
const
124 const std::string stage =
"THghPlnBase::maxEntryInRegion";
127 #ifdef TRASAN_DEBUG_DETAIL
128 std::cout << Tab() <<
"target id=" << targetId <<
",#regions="
132 for (
unsigned i = 0; i < (unsigned)
_regions.size(); i++) {
133 const std::vector<unsigned>& region = *
_regions[i];
135 bool idFound =
false;
137 for (
unsigned j = 0; j < (unsigned) region.size(); j++) {
139 const unsigned id = region[j];
140 if (
id == targetId) idFound =
true;
168 for (
unsigned i = 0; i <
_nX; i++) {
169 const float x0 =
xSize() * float(i);
171 float charge = r.cross(phi).z();
172 if (targetCharge != 0)
173 if (targetCharge *
charge > 0)
176 const float y0 =
_trans.
y(rx, ry, x0);
177 const float x1 =
xSize() * float(i + 1);
178 const float y1 =
_trans.
y(rx, ry, x1);
187 if (iY0 >= (
int)
_nY)
continue;
190 if (iY1 >= (
int)
_nY)
continue;
204 if (iY1 < 0)
continue;
205 if (iY0 >= (
int)
_nY)
continue;
208 if (iY0 < 0) iY0 = 0;
209 if (iY0 >= (
int)
_nY) iY0 =
_nY - 1;
210 if (iY1 < 0) iY1 = 0;
211 if (iY1 >= (
int)
_nY) iY1 =
_nY - 1;
214 for (
unsigned j = (
unsigned) iY0; j < (unsigned)(iY1 + 1); j++) {
225 const std::string& prefix)
const
227 std::cout << prefix <<
"dump of " <<
name() <<
":" << message;
228 if (message !=
"region") {
230 const unsigned n =
_nX *
_nY;
232 for (
unsigned i = 0; i < n; i++) {
238 if (!(nDump % 10)) std::cout << std::endl;
239 std::cout << i <<
"-" <<
entry(i);
244 std::cout <<
"no active cell";
246 std::cout << std::endl;
248 for (
unsigned i = 0; i <
_regions.size(); i++) {
249 std::cout << prefix <<
" region " << i <<
":";
251 for (
unsigned j = 0; j <
_regions[i]->size(); j++) {
253 const unsigned id = (*
_regions[i])[j];
254 std::cout <<
id <<
"(" <<
entry(
id) <<
"),";
256 std::cout << std::endl;
260 std::cout << std::endl;
virtual void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
A class to represent a point in 2D.
std::string name(void) const
returns name.
float charge(void) const
returns charge for this plane.
virtual int maxEntry(void) const =0
returns max. count in a plane.
void clearRegions(void)
Clears regions.
const unsigned _nX
# of x bins.
virtual void add(unsigned cellId, int weight)=0
Add to a cell.
TRGCDCHoughPlaneBase(const std::string &name, const TRGCDCHoughTransformation &transformation, unsigned nX, float xMin, float xMax, unsigned nY, float yMin, float yMax)
Contructor.
virtual unsigned entry(unsigned id) const =0
returns count of a cell.
std::vector< std::vector< unsigned > * > _regions
Regions.
float _xSize
Size of x bin.
Abstract base class for different kinds of events.
int maxEntryInRegion(unsigned id) const
returns max. count in region.
const unsigned _nY
# of y bins.
float ySize(void) const
returns size of y bin.
virtual void vote(float rx, float ry, int weight=1)
Voring.
const TRGArea2D _area
Area.
bool inArea(const TRGPoint2D &x) const
returns true if give point is in the area.
void locationInPlane(float x0, float y0, float x1, float y1, unsigned &nFound, unsigned &iX0, unsigned &iY0, unsigned &iX1, unsigned &iY1) const
returns cell positions in the region.
float _ySize
Size of y bin.
const TRGCDCHoughTransformation & _trans
Hough transformation.
float yMin(void) const
returns min. of y.
float xSize(void) const
returns size of x bin.
void cross(const TRGPoint2D &x0, const TRGPoint2D &x1, unsigned &nFound, TRGPoint2D crossPoint[2]) const
returns cross-points.
virtual ~TRGCDCHoughPlaneBase()
Destructor.