15 #include <phparameter/PHParameterInterface.h>
23 #include <gsl/gsl_randist.h>
24 #include <gsl/gsl_rng.h>
36 constexpr
const T&
clamp(
const T&
v,
const T& lo,
const T& hi )
37 {
return (v < lo) ? lo : (hi <
v) ? hi : v; }
47 m_rng.reset( gsl_rng_alloc(gsl_rng_mt19937) );
67 <<
"PHG4MicromegasDigitizer::InitRun\n"
69 <<
" m_enc: " <<
m_enc <<
" electrons\n"
70 <<
" m_pedestal: " <<
m_pedestal <<
" electrons\n"
94 auto trkrhitsetcontainer = findNode::getClass<TrkrHitSetContainer>(topNode,
"TRKR_HITSET");
95 assert( trkrhitsetcontainer );
98 auto hittruthassoc = findNode::getClass<TrkrHitTruthAssoc>(topNode,
"TRKR_HITTRUTHASSOC");
102 for(
auto hitset_it = hitset_range.first; hitset_it != hitset_range.second; ++hitset_it )
113 std::set<TrkrDefs::hitkey> removed_keys;
116 for(
auto hit_it = hit_range.first; hit_it != hit_range.second; ++hit_it )
136 removed_keys.insert( key );
142 for(
const auto& key:removed_keys )
145 if( hittruthassoc ) hittruthassoc->removeAssoc(hitsetkey, key);
164 {
return gsl_ran_gaussian(
m_rng.get(),
m_enc); }