157 bool okay =
event.getByLabel(
m_inputTag, sedvh);
161 THROW(WireCell::RuntimeError() << WireCell::errmsg{msg});
165 const size_t ndepos = sedvh->size();
167 std::cerr <<
"SimDepoSource got " << ndepos
169 <<
"\" returns: " << (okay ?
"okay" :
"fail") << std::endl;
172 std::cerr <<
"SimDepoSource dropping " <<
m_depos.size()
173 <<
" unused, prior depos\n";
178 std::vector<sim::SimEnergyDeposit> assn_sedv;
181 okay =
event.getByLabel(
m_assnTag, assn_sedvh);
185 THROW(WireCell::RuntimeError() << WireCell::errmsg{msg});
188 std::cout <<
"Larwirecell::SimDepoSource got " << assn_sedvh->size()
190 assn_sedv.insert(assn_sedv.end(), assn_sedvh->begin(), assn_sedvh->end() );
193 if (ndepos != assn_sedv.size()) {
194 std::string msg =
"Larwirecell::SimDepoSource Inconsistent size of SimDepoSources";
196 THROW(WireCell::RuntimeError() << WireCell::errmsg{msg});
200 for (
size_t ind=0; ind<ndepos; ++ind) {
201 auto const& sed = sedvh->at(ind);
202 auto pt = sed.MidPoint();
205 double wq = (*m_adapter)(sed);
206 int wid = sed.TrackID();
207 int pdg = sed.PdgCode();
210 if (assn_sedv.size() == 0) {
211 WireCell::IDepo::pointer depo
212 = std::make_shared<WireCell::SimpleDepo>(wt, wpt, wq,
nullptr, 0.0, 0.0, wid,
pdg, we);
220 auto const& sed1 = assn_sedv.at(ind);
221 auto pt1 = sed1.MidPoint();
224 double wq1 = (*m_adapter)(sed1);
225 int wid1 = sed1.TrackID();
226 int pdg1 = sed1.PdgCode();
229 WireCell::IDepo::pointer assn_depo
230 = std::make_shared<WireCell::SimpleDepo>(wt1, wpt1, wq1,
nullptr, 0.0, 0.0, wid1, pdg1, we1);
232 WireCell::IDepo::pointer depo
233 = std::make_shared<WireCell::SimpleDepo>(wt, wpt, wq, assn_depo, 0.0, 0.0, wid,
pdg, we);
245 WireCell::IDepo::pointer depo
246 = std::make_shared<WireCell::SimpleDepo>(0, wpt, 0,
nullptr, 0.0, 0.0);
251 std::sort(
m_depos.begin(),
m_depos.end(), WireCell::ascending_time);
252 std::cerr <<
"SimDepoSource: ready with " <<
m_depos.size() <<
" depos spanning: [" static constexpr double cm
static constexpr double us
void msg(const char *fmt,...)
std::deque< WireCell::IDepo::pointer > m_depos
static constexpr double MeV
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
QTextStream & endl(QTextStream &s)