CFEL - ASG Software Suite  2.5.0
CASS
above_noise_finder.cpp
Go to the documentation of this file.
1 // Copyright (C) 2011 Lutz Foucar
2 
3 /**
4  * @file above_noise_finder.cpp contains hll like pixel finder using noise maps
5  *
6  * @author Lutz Foucar
7  */
8 
9 #include "above_noise_finder.h"
10 
11 #include "cass_settings.h"
12 #include "advanced_pixeldetector.h"
13 
14 using namespace cass;
15 using namespace pixeldetector;
16 using namespace std;
17 
19 {}
20 
22 {
23  QReadLocker lock(&_commondata->lock);
24  Detector::frame_t::const_iterator pixel(frame.data.begin());
25  Detector::frame_t::const_iterator noise(_commondata->noiseMap.begin());
26  size_t idx(0);
27  for (; pixel != frame.data.end(); ++pixel, ++noise, ++idx)
28  {
29  if(*noise * _multiplier < *pixel)
30  {
31  const uint16_t x(idx % frame.columns);
32  const uint16_t y(idx / frame.columns);
33  pixels.push_back(Pixel(x,y,*pixel));
34  }
35  }
36  return pixels;
37 }
38 
40 {
41  string detectorname(DetectorName::fromSettings(s));
42  _commondata = CommonData::instance(detectorname);
43  s.beginGroup("AboveNoiseFinder");
44  _multiplier = s.value("Multiplier",4.).toFloat();
45  s.endGroup();
46 }
Settings for CASS.
Definition: cass_settings.h:30
void loadSettings(CASSSettings &s)
load the settings of this
STL namespace.
contains hll like finder for pixels
std::vector< Pixel > pixels_t
the list of pixels
uint16_t columns
how many columns
static std::string fromSettings(const CASSSettings &s)
retrieve it from the casssettings
Definition: common_data.h:47
value(const QString &key, const QVariant &defaultValue=QVariant()
A Frame of an advance Pixel Detector.
Detector::frame_t data
the frame data
file contains specialized class that do the settings for cass
pixels_t & operator()(const Frame &frame, pixels_t &pixels)
find the pixels
static shared_pointer instance(const instancesmap_t::key_type &detector)
static function creating instance of this.
advanced pixeldetectors
int16_t pixel
define a pixel
Definition: hlltypes.hpp:27
beginGroup(const QString &prefix)
set up how to create the noise