45 fhicl::Comment(
"data product tag for track momentum reconstruction")};
84 auto const& vertices = proxy::getCollection<std::vector<recob::Vertex>>(
85 e,
vtxTag, proxy::withAssociatedMeta<recob::Track, recob::VertexAssnMeta>());
89 auto const& tracks = proxy::getCollection<proxy::Tracks>(
90 e,
trkTag, proxy::withParallelData<recob::MCSFitResult>(
mcsTag));
93 for (
const auto& v : vertices) {
94 mf::LogVerbatim(
"ProxyExample") <<
"vertex pos=" << v->position() <<
" chi2=" << v->chi2();
98 for (
const auto& trackAssn : assocTracks) {
102 <<
"track with key=" << trackAssn.key() <<
" and length=" << trackAssn->Length()
103 <<
" has propDist from vertex=" << trackAssn.data().propDist();
106 const auto&
track = tracks[trackAssn.key()];
112 <<
"\tCountValidPoints=" <<
track->CountValidPoints() <<
" and nHits=" <<
track.nHits()
116 if (
track.nHits() < 50) {
119 <<
"\t\thit wire=" << h->WireID() <<
" peak time=" << h->PeakTime();
131 auto const& vertexHandle = e.getValidHandle<std::vector<recob::Vertex>>(
vtxTag);
132 auto const& vertexColl = *vertexHandle;
136 auto const& trackHandle = e.getValidHandle<std::vector<recob::Track>>(
trkTag);
138 auto const& mcsColl = *(e.getValidHandle<std::vector<recob::MCSFitResult>>(
mcsTag));
141 for (
size_t iv = 0; iv < vertexColl.size(); ++iv) {
146 auto const& assocTks = assocTracksWithMeta.at(iv);
147 auto const& assocTksMeta = assocTracksWithMeta.
data(iv);
148 for (
size_t itk = 0; itk < assocTks.size(); ++itk) {
154 <<
"track with key=" << trackAssn.
key() <<
" and length=" << trackAssn->
Length()
155 <<
" has propDist from vertex=" << trackMeta->
propDist();
159 const std::vector<recob::Hit const*>&
hits = assocHits.at(trackAssn.
key());
163 <<
"\tCountValidPoints=" << trackAssn->
CountValidPoints() <<
" and nHits=" << hits.size()
167 if (hits.size() < 50) {
170 <<
"\t\thit wire=" << h->WireID() <<
" peak time=" << h->PeakTime();
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
RecoProxyUsageExample & operator=(RecoProxyUsageExample const &)=delete
data_const_reference data(size_type i) const
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition of vertex object for LArSoft.
void analyze(art::Event const &e) override
unsigned int CountValidPoints() const
Various functions related to the presence and the number of (valid) points.
float bestMomentum() const
momentum for best direction fit
double Length(size_t p=0) const
Access to various track properties.
Example of analyzer accessing vertices, tracks, and hits, using RecoBaseProxy.
#define DEFINE_ART_MODULE(klass)
Offers proxy::Tracks and proxy::Track class for recob::Track access.
key_type key() const noexcept
Provides recob::Track data product.
Class storing the result of the Maximum Likelihood fit of Multiple Coulomb Scattering angles between ...
fhicl::Atom< art::InputTag > mcsInputTag
fhicl::Atom< art::InputTag > trackInputTag
2D representation of charge deposited in the TDC/wire plane
fhicl::Atom< art::InputTag > vertexInputTag
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:
RecoProxyUsageExample(Parameters const &p)