52 fhicl::Comment(
"data product tag for track momentum reconstruction")
94 auto const& vertices = proxy::getCollection<std::vector<recob::Vertex> >(
e,
vtxTag,proxy::withAssociatedMeta<recob::Track, recob::VertexAssnMeta>());
98 auto const& tracks = proxy::getCollection<proxy::Tracks>(
e,
trkTag,proxy::withParallelData<recob::MCSFitResult>(
mcsTag));
101 for (
const auto& v : vertices) {
102 mf::LogVerbatim(
"ProxyExample") <<
"vertex pos=" << v->position() <<
" chi2=" << v->chi2();
106 for (
const auto& trackAssn : assocTracks) {
109 mf::LogVerbatim(
"ProxyExample") <<
"track with key=" << trackAssn.key() <<
" and length=" << trackAssn->Length() <<
" has propDist from vertex=" << trackAssn.data().propDist();
112 const auto&
track = tracks[trackAssn.key()];
120 if (
track.nHits()<50) {
122 mf::LogVerbatim(
"ProxyExample") <<
"\t\thit wire=" << h->WireID() <<
" peak time=" << h->PeakTime();
134 auto const& vertexHandle = e.getValidHandle<std::vector<recob::Vertex> >(
vtxTag);
135 auto const& vertexColl = *vertexHandle;
139 auto const& trackHandle = e.getValidHandle<std::vector<recob::Track> >(
trkTag);
141 auto const& mcsColl = *(e.getValidHandle<std::vector<recob::MCSFitResult> >(
mcsTag));
144 for (
size_t iv=0; iv<vertexColl.size(); ++iv) {
149 auto const& assocTks = assocTracksWithMeta.at(iv);
150 auto const& assocTksMeta = assocTracksWithMeta.
data(iv);
151 for (
size_t itk=0;itk<assocTks.size();++itk) {
156 mf::LogVerbatim(
"ProxyExample") <<
"track with key=" << trackAssn.
key() <<
" and length=" << trackAssn->
Length() <<
" has propDist from vertex=" << trackMeta->
propDist();
160 const std::vector<recob::Hit const*>&
hits = assocHits.at(trackAssn.
key());
166 if (hits.size()<50) {
168 mf::LogVerbatim(
"ProxyExample") <<
"\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
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)
Provides recob::Track data product.
EDAnalyzer(Table< Config > const &config)
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
Offers proxy::Tracks and proxy::Track class for recob::Track access.
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)