All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Functions
MergedTrackIdentifier_module.cc File Reference
#include "art/Framework/Core/EDProducer.h"
#include "art/Framework/Core/ModuleMacros.h"
#include "art/Framework/Principal/Event.h"
#include "art/Framework/Principal/Handle.h"
#include "art/Framework/Principal/Run.h"
#include "art/Framework/Principal/SubRun.h"
#include "canvas/Utilities/InputTag.h"
#include "fhiclcpp/ParameterSet.h"
#include "messagefacility/MessageLogger/MessageLogger.h"
#include "lardata/Utilities/AssociationUtil.h"
#include "lardataobj/Utilities/sparse_vector.h"
#include "larcoreobj/SimpleTypesAndConstants/RawTypes.h"
#include "larcorealg/Geometry/Exceptions.h"
#include "lardataobj/RecoBase/PFParticle.h"
#include "lardataobj/RecoBase/Slice.h"
#include "lardataobj/RecoBase/Vertex.h"
#include "lardataobj/RecoBase/Track.h"
#include "lardataobj/RecoBase/TrackTrajectory.h"
#include "lardataobj/RecoBase/Trajectory.h"
#include "lardataobj/RecoBase/Wire.h"
#include "lardataobj/RecoBase/Hit.h"
#include "lardataobj/RecoBase/TrackHitMeta.h"
#include "larcore/Geometry/Geometry.h"
#include "larcore/CoreUtils/ServiceUtil.h"
#include "larcorealg/Geometry/GeometryCore.h"
#include "lardataalg/DetectorInfo/DetectorPropertiesStandard.h"
#include "lardata/DetectorInfoServices/DetectorPropertiesService.h"
#include "larpandora/LArPandoraInterface/LArPandoraHelper.h"
#include <memory>
#include "sbnobj/Common/Reco/MergedTrackInfo.hh"

Go to the source code of this file.

Classes

class  sbn::MergedTrackIdentifier
 

Namespaces

 sbn
 This module creates Common Analysis Files.
 

Functions

TVector3 MeanDirection (const recob::Vertex &vtx, const recob::Track &trk)
 

Function Documentation

TVector3 MeanDirection ( const recob::Vertex vtx,
const recob::Track trk 
)

Definition at line 88 of file MergedTrackIdentifier_module.cc.

88  {
89  TVector3 start(vtx.position().x(), vtx.position().y(), vtx.position().z());
90 
91  TVector3 avg_dir(0., 0., 0.);
92 
93  for (unsigned i_tp = trk.FirstValidPoint(); i_tp < trk.NumberTrajectoryPoints(); i_tp = trk.NextValidPoint(i_tp+1)) {
94  TVector3 p = trk.LocationAtPoint<TVector3>(i_tp);
95  avg_dir += (p - start).Unit();
96  }
97 
98  return avg_dir.Unit();
99 
100 }
Point_t const & LocationAtPoint(size_t i) const
pdgs p
Definition: selectors.fcl:22
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
size_t FirstValidPoint() const
size_t NextValidPoint(size_t index) const
const Point_t & position() const
Return vertex 3D position.
Definition: Vertex.h:60