93 auto const& vertices = proxy::getCollection<std::vector<recob::Vertex> >(
e,
vtxTag,proxy::withAssociatedMeta<recob::Track, recob::VertexAssnMeta>());
97 auto const&
tracks = proxy::getCollection<proxy::Tracks>(
e,
trkTag,proxy::withParallelData<recob::MCSFitResult>(
mcsTag));
100 for (
const auto& v : vertices) {
101 mf::LogVerbatim(
"ProxyExample") <<
"vertex pos=" << v->position() <<
" chi2=" << v->chi2();
105 for (
const auto& trackAssn : assocTracks) {
108 mf::LogVerbatim(
"ProxyExample") <<
"track with key=" << trackAssn.key() <<
" and length=" << trackAssn->
Length() <<
" has propDist from vertex=" << trackAssn.data().propDist();
116 mf::LogVerbatim(
"ProxyExample") <<
"\tCountValidPoints=" <<
track->CountValidPoints() <<
" and nHits=" <<
track.nHits() <<
" and MCSMom=" << assocMCS.
bestMomentum();
119 if (
track.nHits()<50) {
120 for (
const art::Ptr<recob::Hit>&
h :
track.hits()) {
121 mf::LogVerbatim(
"ProxyExample") <<
"\t\thit wire=" <<
h->WireID() <<
" peak time=" <<
h->PeakTime();
133 auto const& vertexHandle =
e.getValidHandle<std::vector<recob::Vertex> >(
vtxTag);
134 auto const& vertexColl = *vertexHandle;
135 art::FindManyP<recob::Track, recob::VertexAssnMeta> assocTracksWithMeta(vertexHandle,
e,
vtxTag);
138 auto const& trackHandle =
e.getValidHandle<std::vector<recob::Track> >(
trkTag);
139 art::FindMany<recob::Hit> assocHits(trackHandle,
e,
trkTag);
140 auto const& mcsColl = *(
e.getValidHandle<std::vector<recob::MCSFitResult> >(
mcsTag));
143 for (
size_t iv=0; iv<vertexColl.size(); ++iv) {
145 mf::LogVerbatim(
"ProxyExample") <<
"vertex pos=" << v.
position() <<
" chi2=" << v.
chi2();
148 auto const& assocTks = assocTracksWithMeta.at(iv);
149 auto const& assocTksMeta = assocTracksWithMeta.data(iv);
150 for (
size_t itk=0;itk<assocTks.size();++itk) {
153 const art::Ptr<recob::Track>& trackAssn = assocTks[itk];
155 mf::LogVerbatim(
"ProxyExample") <<
"track with key=" << trackAssn.key() <<
" and length=" << trackAssn->Length() <<
" has propDist from vertex=" << trackMeta->
propDist();
159 const std::vector<recob::Hit const*>& hits = assocHits.at(trackAssn.key());
162 mf::LogVerbatim(
"ProxyExample") <<
"\tCountValidPoints=" << trackAssn->CountValidPoints() <<
" and nHits=" << hits.size() <<
" and MCSMom=" << assocMCS.
bestMomentum();
165 if (hits.size()<50) {
167 mf::LogVerbatim(
"ProxyExample") <<
"\t\thit wire=" <<
h->WireID() <<
" peak time=" <<
h->PeakTime();
ClusterModuleLabel join with tracks
process_name use argoneut_mc_hitfinder track
Definition of vertex object for LArSoft.
float bestMomentum() const
momentum for best direction fit
double Length(size_t p=0) const
Access to various track properties.
Class storing the result of the Maximum Likelihood fit of Multiple Coulomb Scattering angles between ...
2D representation of charge deposited in the TDC/wire plane
const Point_t & position() const
Return vertex 3D position.
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track: