17 #include <phparameter/PHParameterInterface.h>
34 #include <gsl/gsl_randist.h>
35 #include <gsl/gsl_rng.h>
42 #include <type_traits>
52 , mEnergyPerPair(3.62
e-9)
58 cout <<
Name() <<
" random seed: " << seed << endl;
70 cout <<
"PHG4InttDigitizer::InitRun: detector = " <<
detector << endl;
82 cout <<
PHWHERE <<
"DST Node missing, doing nothing." << endl;
92 string paramnodename =
"G4CELLPARAM_" +
detector;
93 string geonodename =
"G4CELLGEO_" +
detector;
124 cout <<
"====================== PHG4InttDigitizer::InitRun() =====================" << endl;
125 for (std::map<int, unsigned int>::iterator iter1 =
_max_adc.begin();
129 cout <<
" Max ADC in Layer #" << iter1->first <<
" = " << iter1->second << endl;
131 for (std::map<int, float>::iterator iter2 =
_energy_scale.begin();
135 cout <<
" Energy per ADC in Layer #" << iter2->first <<
" = " << 1.0e6 * iter2->second <<
" keV" << endl;
137 cout <<
"===========================================================================" << endl;
158 if (!geom_container)
return;
162 layeriter != layerrange.second;
165 int layer = layeriter->second->get_layer();
168 cout <<
"Error: _max_fphx_adc is not available." << endl;
184 const InttDeadMap *deadmap = findNode::getClass<InttDeadMap>(topNode,
"DEADMAP_INTT");
189 cout <<
"PHG4InttDigitizer::DigitizeLadderCells - Use deadmap ";
194 cout <<
"PHG4InttDigitizer::DigitizeLadderCells - Can not find deadmap, all channels enabled " << endl;
199 TrkrHitSetContainer *trkrhitsetcontainer = findNode::getClass<TrkrHitSetContainer>(topNode,
"TRKR_HITSET");
200 if(!trkrhitsetcontainer)
202 cout <<
"Could not locate TRKR_HITSET node, quit! " << endl;
207 auto hittruthassoc = findNode::getClass<TrkrHitTruthAssoc>(topNode,
"TRKR_HITTRUTHASSOC");
216 hitset_iter != hitset_range.second;
227 cout <<
"PHG4InttDigitizer: found hitset with key: " << hitsetkey <<
" in layer " << layer << endl;
232 std::set<TrkrDefs::hitkey> dead_hits;
234 hit_iter != hit_range.second;
239 TrkrHit *hit = hit_iter->second;
259 cout <<
"PHG4InttDigitizer::DigitizeLadderCells - dead strip at layer " << layer <<
": ";
263 dead_hits.insert(hit_iter->first);
269 assert(!
"Error: _energy_scale has two or more keys.");
276 for (
unsigned int irange = 0; irange < vadcrange.size(); ++irange)
277 if (hit->
getEnergy() / TrkrDefs::InttEnergyScaleup >= vadcrange[irange].first * (double) mip_e && hit->
getEnergy() / TrkrDefs::InttEnergyScaleup < vadcrange[irange].second * (double) mip_e)
278 adc = (
unsigned short) irange;
283 cout <<
"PHG4InttDigitizer: found hit with layer " << layer <<
" ladder_z " << ladder_z <<
" ladder_phi " << ladder_phi
284 <<
" strip_col " << strip_col <<
" strip_row " << strip_row <<
" adc " << hit->
getAdc() << endl;
289 for(
const auto& key:dead_hits) {
291 cout<<
" PHG4InttDigitizer: remove hit with key: " << key << endl;
295 if( hittruthassoc ) hittruthassoc->removeAssoc(hitsetkey, key);
307 cout <<
"PHG4InttDigitizer::End - processed "
341 cout <<
"Error: vector in set_fphx_adc_scale(vector) must have eight elements." << endl;
346 std::vector<std::pair<double, double> > vadcrange;
347 for (
unsigned int irange = 0; irange < userrange.size(); ++irange)
349 if (irange == userrange.size() - 1)
351 vadcrange.push_back(std::make_pair(userrange[irange],
FLT_MAX));
355 vadcrange.push_back(std::make_pair(userrange[irange], userrange[irange + 1]));