10 #include <tr1/functional>
22 using std::tr1::placeholders::_1;
32 if (_instances.find(detector) == _instances.end())
35 " instance of the Pixel Detector Helper for detector '" + detector +
"'");
44 for (instancesmap_t::iterator it(_instances.begin()); it != _instances.end(); ++it)
45 it->second->release(
id);
52 _lastEntry = _detectorList.begin();
54 "we are responsible for pixel det '" + detname +
"'");
59 return (find_if(_detectorList.begin(), _detectorList.end(),
60 std::tr1::bind(equal_to<id_type>(),
id,
61 std::tr1::bind<id_type>(&KeyDetPair_t::first,_1))));
68 if (it != _detectorList.end())
76 if(_detectorList.end() == it)
78 while(_lastEntry->first)
81 if (_lastEntry == _detectorList.end())
82 _lastEntry = _detectorList.begin();
86 it->second->associate(evt);
95 detectorList_t::iterator it(_detectorList.begin());
96 detectorList_t::const_iterator end(_detectorList.end());
97 for (; it != end; ++it)
98 it->second->loadSettings(s);
Event to store all LCLS Data.
static QMutex _mutex
Singleton Mutex to lock write operations.
std::map< std::string, shared_pointer > instancesmap_t
typedef describing the instances of the helper
AdvDet_sptr detector(const CASSEvent &evt)
retrieve detector for event
Helper for Advanced Pixel Detector related Postprocessors.
void release(const id_type &id)
release the detector element in the list by settings its key (eventid) back to 0
iter_type findId(const id_type &id)
find an element with a given id in the list
static void add(Level level, const std::string &line)
add a string to the log
contains classes that extract and add information of pixel detectors.
std::tr1::shared_ptr< AdvancedDetector > AdvDet_sptr
define a shared pointer of the item to manage
void loadSettings(size_t i=0)
load the settings of the detectors in the detector list
DetectorHelper()
prevent people from constructin other than using instance().
std::tr1::shared_ptr< DetectorHelper > shared_pointer
typedef a shared pointer of this
detectorList_t::iterator iter_type
define an iterator for the list
An Advanced Pixel Detector.
CASSEvent::id_t id_type
define the type of the id used
file contains specialized class that do the settings for cass
static void releaseDetector(const id_type &id)
release the detector of all helpers that is blocked for the event
static shared_pointer instance(const instancesmap_t::key_type &detector)
static function creating instance of this.
const size_t NbrOfWorkers
global variable to set the number of worker threads
contains a logger for cass
beginGroup(const QString &prefix)
static instancesmap_t _instances
the helperclass instances.