156 art::Handle< std::vector<sim::SimEnergyDeposit> > sedvh;
158 bool okay =
event.getByLabel(
m_inputTag, sedvh);
160 std::string
msg =
"SimDepoSource failed to get sim::SimEnergyDeposit from art tag: " +
m_inputTag.encode();
162 THROW(WireCell::RuntimeError() << WireCell::errmsg{msg});
166 const size_t ndepos = sedvh->size();
168 std::cerr <<
"SimDepoSource got " << ndepos
170 <<
"\" returns: " << (okay ?
"okay" :
"fail") << std::endl;
174 <<
" unused, prior depos\n";
179 std::vector<sim::SimEnergyDeposit> assn_sedv;
181 art::Handle< std::vector<sim::SimEnergyDeposit> > assn_sedvh;
182 okay =
event.getByLabel(
m_assnTag, assn_sedvh);
184 std::string msg =
"SimDepoSource failed to get sim::SimEnergyDeposit from art tag: " +
m_assnTag.encode();
186 THROW(WireCell::RuntimeError() << WireCell::errmsg{msg});
189 std::cout <<
"Larwirecell::SimDepoSource got " << assn_sedvh->size()
190 <<
" associated depos from " <<
m_assnTag << std::endl;
191 assn_sedv.insert(assn_sedv.end(), assn_sedvh->begin(), assn_sedvh->end() );
194 if (ndepos != assn_sedv.size()) {
195 std::string msg =
"Larwirecell::SimDepoSource Inconsistent size of SimDepoSources";
197 THROW(WireCell::RuntimeError() << WireCell::errmsg{msg});
201 for (
size_t ind=0; ind<ndepos; ++ind) {
202 auto const& sed = sedvh->at(ind);
203 auto pt = sed.MidPoint();
204 const WireCell::Point wpt(pt.x()*units::cm, pt.y()*units::cm, pt.z()*units::cm);
205 double wt = sed.Time()*units::ns;
206 double wq = (*m_adapter)(sed);
207 int wid = sed.TrackID();
208 int pdg = sed.PdgCode();
211 if (assn_sedv.size() == 0) {
212 WireCell::IDepo::pointer depo
213 = std::make_shared<SimpleDepo>(wt, wpt, wq,
nullptr, 0.0, 0.0, wid,
pdg, we);
221 auto const& sed1 = assn_sedv.at(ind);
222 auto pt1 = sed1.MidPoint();
223 const WireCell::Point wpt1(pt1.x()*units::cm, pt1.y()*units::cm, pt1.z()*units::cm);
224 double wt1 = sed1.Time()*units::ns;
225 double wq1 = (*m_adapter)(sed1);
226 int wid1 = sed1.TrackID();
227 int pdg1 = sed1.PdgCode();
230 WireCell::IDepo::pointer assn_depo
231 = std::make_shared<SimpleDepo>(wt1, wpt1, wq1,
nullptr, 0.0, 0.0, wid1, pdg1, we1);
233 WireCell::IDepo::pointer depo
234 = std::make_shared<SimpleDepo>(wt, wpt, wq, assn_depo, 0.0, 0.0, wid,
pdg, we);
246 WireCell::IDepo::pointer depo
247 = std::make_shared<SimpleDepo>(0, wpt, 0,
nullptr, 0.0, 0.0);
252 std::sort(
m_depos.begin(),
m_depos.end(), WireCell::ascending_time);
253 std::cerr <<
"SimDepoSource: ready with " <<
m_depos.size() <<
" depos spanning: ["
254 <<
m_depos.front()->time()/units::us <<
", "
255 <<
m_depos.back()->time()/units::us <<
"]us\n";
BEGIN_PROLOG could also be cerr
std::deque< WireCell::IDepo::pointer > m_depos
util::quantities::megaelectronvolt MeV
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
BEGIN_PROLOG could also be cout