LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
trkmkr::OptionalOutputs Struct Reference

Struct holding optional TrackMaker outputs. More...

#include "TrackMaker.h"

Public Types

typedef std::pair< recob::SpacePoint, art::Ptr< recob::Hit > > SpHitPair
 

Public Member Functions

void addPoint (OptionalPointElement &ope)
 add one OptionalPointElement More...
 
void addPoint (OptionalPointElement &ope, art::Ptr< recob::Hit > hptr)
 add one OptionalPointElement and the corresponding hit More...
 
void reset ()
 reset the stored vectors More...
 
void initTrackFitInfos ()
 initialize the output vector of TrackFitHitInfos More...
 
void initSpacePoints ()
 initialize the output vector of SpHitPair More...
 
bool isTrackFitInfosInit ()
 check initialization of the output vector of TrackFitHitInfos More...
 
bool isSpacePointsInit ()
 check initialization of the output vector of SpHitPair More...
 
std::vector< recob::TrackFitHitInfotrackFitHitInfos ()
 get the output vector of TrackFitHitInfos by releasing and moving More...
 
std::vector< SpHitPairspacePointHitPairs ()
 get the output vector of SpHitPair by releasing and moving More...
 

Private Attributes

std::unique_ptr< std::vector< recob::TrackFitHitInfo > > outTrackFitHitInfos
 
std::unique_ptr< std::vector< SpHitPair > > outSpacePointHitPairs
 

Detailed Description

Struct holding optional TrackMaker outputs.

This struct holds the optional outputs of track making and hides their details to the actual track making tools. In this way, adding a new optional output will affect only those tools that produce such new ouput.

It stores a unique_ptr to the vector of each optional output object (meant to be per-track). Track making tools need to init the outional outputs they will produce, so that only the unique_ptrs that are needed are actually created. Functions are provided (called addPoint) to add point-by-point elements (see OptionalPointElement). When the output objects are returned, the unique_ptr is reset, so that no new elements should be added and a new initialization is needed.

Author
G. Cerati (FNAL, MicroBooNE)
Date
2017
Version
1.0

Definition at line 73 of file TrackMaker.h.

Member Typedef Documentation

Definition at line 75 of file TrackMaker.h.

Member Function Documentation

void trkmkr::OptionalOutputs::addPoint ( OptionalPointElement ope)
inline

add one OptionalPointElement

Definition at line 78 of file TrackMaker.h.

References trkmkr::OptionalPointElement::getTrackFitHitInfo(), and trkmkr::OptionalPointElement::isTrackFitInfoSet().

78  {
79  if (isTrackFitInfosInit() && ope.isTrackFitInfoSet()) {
80  outTrackFitHitInfos->push_back( ope.getTrackFitHitInfo() );
81  }
82  }
bool isTrackFitInfosInit()
check initialization of the output vector of TrackFitHitInfos
Definition: TrackMaker.h:110
std::unique_ptr< std::vector< recob::TrackFitHitInfo > > outTrackFitHitInfos
Definition: TrackMaker.h:124
void trkmkr::OptionalOutputs::addPoint ( OptionalPointElement ope,
art::Ptr< recob::Hit hptr 
)
inline

add one OptionalPointElement and the corresponding hit

Definition at line 84 of file TrackMaker.h.

References trkmkr::OptionalPointElement::getSpacePoint(), and trkmkr::OptionalPointElement::isSpacePointSet().

84  {
85  if (isSpacePointsInit() && ope.isSpacePointSet()) {
86  outSpacePointHitPairs->emplace_back(ope.getSpacePoint(), hptr);
87  }
88  addPoint(ope);
89  }
std::unique_ptr< std::vector< SpHitPair > > outSpacePointHitPairs
Definition: TrackMaker.h:125
void addPoint(OptionalPointElement &ope)
add one OptionalPointElement
Definition: TrackMaker.h:78
bool isSpacePointsInit()
check initialization of the output vector of SpHitPair
Definition: TrackMaker.h:112
void trkmkr::OptionalOutputs::initSpacePoints ( )
inline

initialize the output vector of SpHitPair

Definition at line 106 of file TrackMaker.h.

Referenced by TrackProducerFromTrack::produce(), TrackProducerFromTrackTrajectory::produce(), and TrackProducerFromPFParticle::produce().

106  {
107  outSpacePointHitPairs = std::make_unique< std::vector<SpHitPair> >();
108  }
std::unique_ptr< std::vector< SpHitPair > > outSpacePointHitPairs
Definition: TrackMaker.h:125
void trkmkr::OptionalOutputs::initTrackFitInfos ( )
inline

initialize the output vector of TrackFitHitInfos

Definition at line 102 of file TrackMaker.h.

Referenced by TrackProducerFromTrack::produce(), TrackProducerFromTrackTrajectory::produce(), TrackProducerFromPFParticle::produce(), trkf::KalmanFilterTrajectoryFitter::produce(), and trkf::KalmanFilterFinalTrackFitter::produce().

102  {
103  outTrackFitHitInfos = std::make_unique< std::vector<recob::TrackFitHitInfo> >();
104  }
std::unique_ptr< std::vector< recob::TrackFitHitInfo > > outTrackFitHitInfos
Definition: TrackMaker.h:124
bool trkmkr::OptionalOutputs::isSpacePointsInit ( )
inline

check initialization of the output vector of SpHitPair

Definition at line 112 of file TrackMaker.h.

112 { return bool(outSpacePointHitPairs); }
std::unique_ptr< std::vector< SpHitPair > > outSpacePointHitPairs
Definition: TrackMaker.h:125
bool trkmkr::OptionalOutputs::isTrackFitInfosInit ( )
inline

check initialization of the output vector of TrackFitHitInfos

Definition at line 110 of file TrackMaker.h.

Referenced by trkf::TrackKalmanFitter::fillResult(), and trkmkr::KalmanFilterFitTrackMaker::restoreInputPoints().

110 { return bool(outTrackFitHitInfos); }
std::unique_ptr< std::vector< recob::TrackFitHitInfo > > outTrackFitHitInfos
Definition: TrackMaker.h:124
void trkmkr::OptionalOutputs::reset ( void  )
inline

reset the stored vectors

Definition at line 91 of file TrackMaker.h.

91  {
92  if (isTrackFitInfosInit()) {
93  outTrackFitHitInfos.reset();
95  }
96  if (isSpacePointsInit()) {
97  outSpacePointHitPairs.reset();
99  }
100  }
void initTrackFitInfos()
initialize the output vector of TrackFitHitInfos
Definition: TrackMaker.h:102
std::unique_ptr< std::vector< SpHitPair > > outSpacePointHitPairs
Definition: TrackMaker.h:125
bool isTrackFitInfosInit()
check initialization of the output vector of TrackFitHitInfos
Definition: TrackMaker.h:110
std::unique_ptr< std::vector< recob::TrackFitHitInfo > > outTrackFitHitInfos
Definition: TrackMaker.h:124
void initSpacePoints()
initialize the output vector of SpHitPair
Definition: TrackMaker.h:106
bool isSpacePointsInit()
check initialization of the output vector of SpHitPair
Definition: TrackMaker.h:112
std::vector<SpHitPair> trkmkr::OptionalOutputs::spacePointHitPairs ( )
inline

get the output vector of SpHitPair by releasing and moving

Definition at line 119 of file TrackMaker.h.

References tmp.

Referenced by TrackProducerFromTrack::produce(), TrackProducerFromTrackTrajectory::produce(), and TrackProducerFromPFParticle::produce().

119  {
120  if (!isSpacePointsInit()) throw std::logic_error("outSpacePointHitPairs is not available (any more?).");
121  auto tmp = *outSpacePointHitPairs; outSpacePointHitPairs.reset(); return tmp;
122  }
Float_t tmp
Definition: plot.C:37
std::unique_ptr< std::vector< SpHitPair > > outSpacePointHitPairs
Definition: TrackMaker.h:125
bool isSpacePointsInit()
check initialization of the output vector of SpHitPair
Definition: TrackMaker.h:112
std::vector<recob::TrackFitHitInfo> trkmkr::OptionalOutputs::trackFitHitInfos ( )
inline

get the output vector of TrackFitHitInfos by releasing and moving

Definition at line 114 of file TrackMaker.h.

References tmp.

Referenced by TrackProducerFromTrack::produce(), TrackProducerFromTrackTrajectory::produce(), TrackProducerFromPFParticle::produce(), trkf::KalmanFilterTrajectoryFitter::produce(), and trkf::KalmanFilterFinalTrackFitter::produce().

114  {
115  if (!isTrackFitInfosInit()) throw std::logic_error("outTrackFitHitInfos is not available (any more?).");
116  auto tmp = *outTrackFitHitInfos; outTrackFitHitInfos.reset(); return tmp;
117  }
Float_t tmp
Definition: plot.C:37
bool isTrackFitInfosInit()
check initialization of the output vector of TrackFitHitInfos
Definition: TrackMaker.h:110
std::unique_ptr< std::vector< recob::TrackFitHitInfo > > outTrackFitHitInfos
Definition: TrackMaker.h:124

Member Data Documentation

std::unique_ptr< std::vector<SpHitPair> > trkmkr::OptionalOutputs::outSpacePointHitPairs
private

Definition at line 125 of file TrackMaker.h.

std::unique_ptr< std::vector<recob::TrackFitHitInfo> > trkmkr::OptionalOutputs::outTrackFitHitInfos
private

Definition at line 124 of file TrackMaker.h.


The documentation for this struct was generated from the following file: