52 :_neighbourCoordinate(coordinate)
62 return (!pixel.
used &&
63 pixel.
x == _neighbourCoordinate.first &&
64 pixel.
y == _neighbourCoordinate.second);
96 const uint16_t maxDepth,
103 typedef pair<uint16_t,uint16_t> position_t;
105 if (depth > maxDepth)
108 splitpixelslist.push_back(pixel);
115 position_t left(make_pair(pixel.
x-1,pixel.
y));
116 CoalescingBase::pixels_t::iterator neighbourPixelIt
117 (find_if(pixels.begin(), pixels.end(),
isNeighbour(left)));
118 if (neighbourPixelIt != pixels.end())
127 position_t right(make_pair(pixel.
x+1,pixel.
y));
128 CoalescingBase::pixels_t::iterator neighbourPixelIt
129 (find_if(pixels.begin(), pixels.end(),
isNeighbour(right)));
130 if (neighbourPixelIt != pixels.end())
137 if (pixel.
y < frame.
rows-1)
139 position_t top(make_pair(pixel.
x,pixel.
y+1));
140 CoalescingBase::pixels_t::iterator neighbourPixelIt
141 (find_if(pixels.begin(), pixels.end(),
isNeighbour(top)));
142 if (neighbourPixelIt != pixels.end())
151 position_t bottom(make_pair(pixel.
x,pixel.
y-1));
152 CoalescingBase::pixels_t::iterator neighbourPixelIt
153 (find_if(pixels.begin(), pixels.end(),
isNeighbour(bottom)));
154 if (neighbourPixelIt != pixels.end())
176 if (!splitpixelslist.empty())
178 hit.
x = splitpixelslist.front().x;
179 hit.
y = splitpixelslist.front().y;
180 hit.
z = splitpixelslist.front().z;
181 float weightX(hit.
x*hit.
z);
182 float weightY(hit.
y*hit.
z);
183 CoalescingBase::pixels_t::const_iterator
pixel(splitpixelslist.begin()+1);
184 for (;
pixel != splitpixelslist.end(); ++
pixel)
190 hit.
x = weightX / hit.
z;
191 hit.
y = weightY / hit.
z;
216 const float mipThreshold,
219 CoalescingBase::pixels_t::const_iterator
pixel(splitpixelslist.begin());
220 const size_t framewidth(frame.
columns);
221 const size_t frameheight(frame.
rows);
223 for (;
pixel != splitpixelslist.end(); ++
pixel)
225 if (
pixel->z > mipThreshold)
230 const size_t idx(
pixel->y*framewidth +
pixel->x);
234 if (qFuzzyIsNull(data[idx-framewidth]))
239 if (
pixel->x != 0 && qFuzzyIsNull(data[idx-framewidth-1]))
244 if (
pixel->x < framewidth-1 && qFuzzyIsNull(data[idx-framewidth+1]))
252 if (
pixel->x != 0 && qFuzzyIsNull(data[idx-1]))
257 if (
pixel->x < framewidth-1 && qFuzzyIsNull(data[idx+1]))
264 if (
pixel->y < frameheight-1)
266 if (qFuzzyIsNull(data[idx+framewidth]))
271 if (
pixel->x != 0 && qFuzzyIsNull(data[idx+framewidth-1]))
276 if (
pixel->x < framewidth-1 && qFuzzyIsNull(data[idx+framewidth+1]))
295 _maxPixelListSize = s.
value(
"MaxPixelListSize",10000).toUInt();
296 _maxRecursionDepth = s.
value(
"MaxRecursionDepth",7).toUInt();
297 _mipThreshold = s.
value(
"MipThreshold",1e6).toFloat();
298 _notCheckCoalesce = s.
value(
"ShouldNotCheckCoalsescing",
false).toBool();
306 if (pixels.size() > _maxPixelListSize)
309 pixels_t::iterator
pixel(pixels.begin());
float x
the x coordinate of hit
std::vector< Hit > hits_t
define the list of coalesced pixels
direction
enum for easier code
check if pixel is neighbour
SimpleCoalesce()
constructor
uint16_t y
y coordinate of the pixel
define which of the hitfinders defined above will be used as hit
Average out the iShit status to get the avererage hits
contains class that does the pixel coalescing in a simple way.
std::vector< pixel_t > frame_t
a frame is a vector of pixels
uint16_t rows
how many rows
uint16_t columns
how many columns
std::vector< Pixel > pixels_t
hits_t & operator()(const Frame &frame, pixels_t &pixels, hits_t &hits)
coalesce the pixels
bool operator()(const Pixel &pixel)
the operator
void loadSettings(CASSSettings &s)
load the settings of this
A Hit on a pixel detector.
auxiliary data[Processor]
bool shouldCoalescePixel(const CoalescingBase::pixels_t &splitpixelslist, const float mipThreshold, const Frame &frame)
check whether list of pixel should be coalesced
value(const QString &key, const QVariant &defaultValue=QVariant()
float y
the x coordinate of hit
uint32_t used
value to mark pixel any analysis of the pixels
A Frame of an advance Pixel Detector.
size_t nbrPixels
number of pixels that this hit consists of
uint16_t x
x coordinate of the pixel
Detector::frame_t data
the frame data
file contains specialized class that do the settings for cass
uint64_t z
the value of the hit
void findNeighbours(uint16_t depth, const uint16_t maxDepth, Pixel &pixel, Direction::direction direction, const Frame &frame, CoalescingBase::pixels_t &pixels, CoalescingBase::pixels_t &splitpixelslist)
find all neighbours of a pixel
Hit coalesce(const CoalescingBase::pixels_t &splitpixelslist)
coalesce the pixels
int16_t pixel
define a pixel
isNeighbour(const pair< uint16_t, uint16_t > &coordinate)
constructor
pair< uint16_t, uint16_t > _neighbourCoordinate
the coordinate of the neighbour to check
beginGroup(const QString &prefix)