LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
lar::dump Namespace Reference

Namespace for LArSoft dumping utilities. More...

Namespaces

 details
 

Classes

struct  ArrayDumper
 Dumps the first N elements of an array. More...
 
struct  ArrayDumper< T * >
 
struct  VectorDumper
 Manipulator managing the dump of the vector content into a stream. More...
 
struct  VectorDumper< T * >
 
struct  VectorDumper< T[3]>
 

Functions

template<size_t N, typename Array >
auto array (Array const &a)
 Returns a manipulator which will print the specified array. More...
 
template<typename Vector >
auto vector (Vector const &v)
 Returns a manipulator which will print the specified array. More...
 
template<typename Vector3D >
auto vector3D (Vector3D const &v)
 Returns a manipulator which will print the specified vector. More...
 
template<typename Stream , typename Array >
Stream & operator<< (Stream &&out, ArrayDumper< Array > &&manip)
 Dumps the array contained in the manipulator into a stream. More...
 
template<typename Stream , typename Vector >
Stream & operator<< (Stream &&out, VectorDumper< Vector > &&manip)
 Dumps the vector contained in the manipulator into a stream. More...
 
template<typename String , typename Vector >
String operator+ (String const &s, VectorDumper< Vector > const &manip)
 Concatenates a vector to the specified string. More...
 
template<typename Vector >
std::string operator+ (const char *s, VectorDumper< Vector > const &manip)
 Creates a string with s concatenated to the rendered vector. More...
 
template<typename String , typename Vector >
String operator+ (VectorDumper< Vector > const &manip, String const &s)
 
template<typename Vector >
std::string operator+ (VectorDumper< Vector > const &manip, const char *s)
 Creates a string with the rendered vector concatenated to s. More...
 
template<typename String , typename Vector >
String & operator+= (String &s, VectorDumper< Vector > const &manip)
 Appends a string rendering of a vector to the specified string. More...
 

Detailed Description

Namespace for LArSoft dumping utilities.

Function Documentation

template<size_t N, typename Array >
auto lar::dump::array ( Array const &  a)

Returns a manipulator which will print the specified array.

Template Parameters
Nthe number of entries to be printed
Arraythe type of array to be printed
Parameters
athe array to be printed
Returns
a manipulator

Example of usage:

double const data[5] = { 1., 2., 3., 4., 6. };
std::cout << "Data: " << lar::dump::array<5>(data) << std::endl;

will produce an output like:

Data: { 1; 2; 3; 4; 6 }

Addition of specific classes can be achieved via specialization of the class ArrayDumper.

Requirements

  • the type Array is required to respond to a global function cbegin() (like std::cbegin()) with a forward iterator
  • the value type of the iterator returned by the aforementioned Array method must have its insertion operator into a stream defined
  • the array a must not fall out of scope until the insertion into the stream happens

Definition at line 228 of file DumpUtils.h.

Referenced by evgen::MARLEYHelper::fhicl_sequence_to_json(), and geo::vect::details::makeIndexSeqImpl().

228 { return ArrayDumper<Array>(a, N); }
template<typename String , typename Vector >
String lar::dump::operator+ ( String const &  s,
VectorDumper< Vector > const &  manip 
)

Concatenates a vector to the specified string.

Template Parameters
Stringa string type that can handle "addition" to std::string
Vector3Dthe type of 3D vector to be printed
Parameters
sthe string
manipthe manipulator containing the vector to be printed
Returns
a new string with s concatenated to a rendering of the vector
See also
VectorDumper

Example of usage:

TVector3 pos;
std::runtime_error e("Position: " + lar::dump::vector3D(pos));
std::cout << e.what() << std::endl;

will produce an output like:

Position: { 0; 0; 0 }

Requirements

  • the type Vector3D is required to provide constant accessor methods returning the vector components, called X(), Y() and Z()
  • the values returned by the aforementioned Vector3D methods must have their insertion operator into Stream defined

Definition at line 404 of file DumpUtils.h.

405  { return s + std::string(manip);}
Float_t s
Definition: plot.C:23
template<typename Vector >
std::string lar::dump::operator+ ( const char *  s,
VectorDumper< Vector > const &  manip 
)

Creates a string with s concatenated to the rendered vector.

Definition at line 409 of file DumpUtils.h.

410  { return std::string(s) + manip;}
Float_t s
Definition: plot.C:23
template<typename String , typename Vector >
String lar::dump::operator+ ( VectorDumper< Vector > const &  manip,
String const &  s 
)
See also
documentation of function with arguments swapped.

Definition at line 414 of file DumpUtils.h.

References s.

415  { return std::string(manip) + s;}
Float_t s
Definition: plot.C:23
template<typename Vector >
std::string lar::dump::operator+ ( VectorDumper< Vector > const &  manip,
const char *  s 
)

Creates a string with the rendered vector concatenated to s.

Definition at line 419 of file DumpUtils.h.

420  { return manip + std::string(s);}
Float_t s
Definition: plot.C:23
template<typename String , typename Vector >
String& lar::dump::operator+= ( String &  s,
VectorDumper< Vector > const &  manip 
)
template<typename Stream , typename Array >
Stream& lar::dump::operator<< ( Stream &&  out,
ArrayDumper< Array > &&  manip 
)

Dumps the array contained in the manipulator into a stream.

Template Parameters
Streamthe type of output stream
Arraythe type of array to be printed
NPrintthe number of element of the array to be printed
Parameters
outthe output stream
manipthe manipulator containing the array to be printed
Returns
a reference to the output stream
See also
ArrayDumper

Example of usage:

double const data[5] = { 1., 2., 3., 4., 6. };
std::cout << "Position: " << lar::dump::array<5>(data) << std::endl;

will produce an output like:

Position: { 1, 2, 3, 4, 5 }

Requirements

  • the type Vector3D is required to provide constant accessor methods returning the vector components, called X(), Y() and Z()
  • the values returned by the aforementioned Vector3D methods must have their insertion operator into Stream defined

Definition at line 336 of file DumpUtils.h.

337  { manip(std::forward<Stream>(out)); return out; }
template<typename Stream , typename Vector >
Stream& lar::dump::operator<< ( Stream &&  out,
VectorDumper< Vector > &&  manip 
)

Dumps the vector contained in the manipulator into a stream.

Template Parameters
Streamthe type of output stream
Vector3Dthe type of 3D vector to be printed
Parameters
outthe output stream
manipthe manipulator containing the vector to be printed
Returns
a reference to the output stream
See also
VectorDumper

Example of usage:

TVector3 pos;
std::cout << "Position: " << lar::dump::vector3D(pos) << std::endl;

will produce an output like:

Position: { 0; 0; 0 }

Requirements

  • the type Vector3D is required to provide constant accessor methods returning the vector components, called X(), Y() and Z()
  • the values returned by the aforementioned Vector3D methods must have their insertion operator into Stream defined

Definition at line 370 of file DumpUtils.h.

371  { manip(std::forward<Stream>(out)); return out; }
template<typename Vector >
auto lar::dump::vector ( Vector const &  v)

Returns a manipulator which will print the specified array.

Template Parameters
Vectortype of vector to be printed
Parameters
vthe vector to be printed
Returns
a manipulator

Example of usage:

std::vector<double> data = { 1., 2., 3., 4., 6. };
std::cout << "Data: " << lar::dump::vector(data) << std::endl;

will produce an output like:

Data: { 1; 2; 3; 4; 6 }

Addition of specific classes can be achieved via specialization of the class ArrayDumper.

Requirements

  • a method Vector::size() const must be available returning the number of elements in the vector
  • the type Vector is required to respond to a global function cbegin() (like std::cbegin()) with a forward iterator
  • the value type returned by the aforementioned Vector method must have its insertion operator into a stream defined
  • the vector v must not fall out of scope until the insertion into the stream happens

Definition at line 265 of file DumpUtils.h.

Referenced by showerreco::ShowerRecoManager::Algo(), ClusteringValidation::ClusterAnalyser::Analyse(), trkf::SpacePointAna::analyze(), shower::EMShowerAlg::AssociateClustersAndTracks(), pma::ProjectionMatchingAlg::autoFlip(), btutil::MCMatchAlg::BTAlg(), trkf::KalmanFilterAlg::buildTrack(), calo::LinearEnergyAlg::CalculateClusterEnergy(), cluster::HoughBaseAlg::ChargeInfo_t::ChargeInfo_t(), shower::EMShowerAlg::CheckIsolatedHits(), shower::EMShowerAlg::CheckShowerHits(), shower::EMShowerAlg::CheckShowerPlanes(), genf::GFTrack::clearFailedHits(), shower::EMShowerAlg::ConstructTrack(), cluster::BlurredClusteringAlg::ConvertBinsToClusters(), cluster::BlurredClusteringAlg::ConvertRecobHitsToVector(), tf::Graph::create(), util::CreateAssn(), evgb::util::CreateAssn(), hit::RFFHitFitter::CreateMergeVector(), fhicl::detail::ValidateThenSet::delegated_parameter(), noisefilteralg::WireCellNoiseFilter::DoNoiseFilter(), trkf::Track3DKalmanSPS::dQdxCalc(), trkf::KalmanFilterAlg::extendTrack(), cluster::HoughBaseAlg::FastTransform(), lariov::SimpleChannelStatus::FillGoodChannels(), shower::EMShowerAlg::FinddEdx(), shower::EMShowerAlg::FindInitialTrack(), shower::EMShowerAlg::FindOrderOfHits(), shower::EMShowerAlg::FindShowerStart(), cluster::SmallClusterFinderAlg::FindSmallClusters(), shower::EMShowerAlg::FindTrueParticle(), ClusteringValidation::ClusterAnalyser::FindTrueTrack(), trkf::Geometric3DVertexFitter::Geometric3DVertexFitter(), geo::vect::details::BoundCoordGetter< CoordHelper, StoredVector >::get(), lar_pandora::LArPandoraEvent::GetAssociationMap(), img::DataProviderAlg::getDriftIndex(), lar_pandora::LArPandoraEvent::GetFilteredAssociationMap(), trkf::BezierTrackerModule::GetHitsFromClusters(), pma::PMAlgTrackingBase::getKinks(), cluster::ClusterMergeHelper::GetManager(), cluster::BlurredClusteringAlg::GetMinSize(), evwgh::WeightCalc::GetName(), shower::EMShowerAlg::GetPlanePermutations(), trkf::BezierTrackerAlgorithm::GetSeedFinderAlgorithm(), trkf::SeedFinderAlgorithm::GetSeedsFromSortedHits(), cheat::BackTracker::GetSetOfEveIds(), trkf::SeedFinderModule::GetSortedHitsFromClusters(), trkf::SeedFinderAlgorithm::GetSpacePointAlg(), pma::PMAlgVertexing::getVertices(), shower::TrackShowerSeparationAlg::Gradient(), groupTPCsByDriftDir(), pma::Track3D::HasTPC(), cheat::BackTracker::HitToEveTrackIDEs(), cheat::BackTracker::HitToXYZ(), pma::PMAlgTracker::init(), trkmkr::TrackMaker::initEvent(), trkmkr::KalmanFilterFitTrackMaker::initEvent(), anab::FVectorWriter< N >::initOutputs(), pma::ProjectionMatchingAlg::isContained(), GFException::isFatal(), lar_pandora::LArPandoraHelper::IsVisible(), detinfo::LArPropertiesStandard::LArPropertiesStandard(), pma::Track3D::Length(), shower::EMShowerAlg::MakeInitialTrack(), cluster::BlurredClusteringAlg::MakeKernels(), shower::EMShowerAlg::MakeShower(), shower::EMShowerAlg::MakeSpacePoints(), trkmkr::TrackMaker::makeTrack(), trkmkr::KalmanFilterFitTrackMaker::makeTrack(), pma::PMAlgTracker::matchCluster(), btutil::MCBTAlg::MCBTAlg(), cmtool::CMManagerBase::MergeTillConverge(), art::detail::mix_offset< cet::map_vector< P > >::offset(), geo::vect::details::BoundCoordGetter< CoordHelper, StoredVector >::operator Scalar_t(), mvapid::MVAAlg::SumDistance2::operator()(), geo::vect::details::BoundCoordManager< CoordHelper, StoredVector >::operator*=(), geo::vect::details::BoundCoordManager< CoordHelper, StoredVector >::operator+=(), geo::vect::details::BoundCoordManager< CoordHelper, StoredVector >::operator-=(), geo::vect::details::BoundCoordManager< CoordHelper, StoredVector >::operator/=(), geo::vect::details::BoundCoordManager< CoordHelper, StoredVector >::operator=(), cheat::PhotonBackTracker::OpHitToSimSDPs(), cheat::PhotonBackTracker::OpHitToTrackID(), shower::EMShowerAlg::OrderShowerHits(), trkf::BezierTrackerAlgorithm::OrganizeSeedsIntoTracks(), nnet::PointIdAlg::outputLabels(), cmtool::PlaneClusterCombinations(), trk::TrackContainmentAlg::ProcessTracks(), trkf::TCTrack::produce(), trkf::SpacePointFinder::produce(), trkf::SpacePointCheater::produce(), sppt::TTSpacePointFinder::produce(), cluster::BlurredClustering::produce(), trkf::SpacePts::produce(), shower::EMShower::produce(), trkf::TrackKalmanCheater::produce(), vertex::PrimaryVertexFinder::produce(), trkf::TrackStitcher::produce(), trkf::Track3DKalman::produce(), evd::GraphCluster::produce(), pma::ProjectionMatchingAlg::ProjectionMatchingAlg(), cheat::BackTrackerService::provider(), cheat::PhotonBackTrackerService::provider(), shower::EMShowerAlg::RelativeWireWidth(), calo::TrackCalorimetryAlg::ReserveInternalVectors(), tf::Graph::run(), nnet::ModelInterface::Run(), nnet::TfModelInterface::Run(), cluster::BlurredClusteringAlg::SaveImage(), evd::HitSelector::SaveSeedLines(), cluster::SmallClusterFinderAlg::SelectLocalHitlist(), shower::TrackShowerSeparationAlg::SelectShowerHits(), cluster::ClusterMatchAlg::SetMCTruthModName(), cluster::ClusterMergeAlg::SetSquaredDistanceCut(), cluster::ClusterMergeAlg::SetTime2Cm(), shower::EMShowerAlg::ShowerCentre(), shower::EMShowerAlg::ShowerDirection(), shower::EMShowerAlg::ShowerHitRMS(), shower::EMShowerAlg::ShowerHitRMSGradient(), shower::TrackShowerSeparationAlg::SpacePointsRMS(), cluster::ClusterMatchAlg::StoreSpacePoints(), recob::Track::Track(), trkf::TrackKalmanFitter::TrackKalmanFitter(), shower::EMShowerAlg::WorstPlane(), lar_pandora::LArPandoraEvent::WriteAssociation(), art::OutputModule::writeProductDescriptionRegistry(), cmtool::CMatchBookKeeper::~CMatchBookKeeper(), cmtool::CMergeBookKeeper::~CMergeBookKeeper(), cmtool::CMergeHelper::~CMergeHelper(), btutil::MCMatchAlg::~MCMatchAlg(), nnet::ModelInterface::~ModelInterface(), trkf::StitchAlg::~StitchAlg(), trk::TrackContainmentAlg::~TrackContainmentAlg(), and geoalgo::Trajectory::~Trajectory().

265 { return ArrayDumper<Vector>(v, v.size()); }
template<typename Vector3D >
auto lar::dump::vector3D ( Vector3D const &  v)

Returns a manipulator which will print the specified vector.

Template Parameters
Vector3Dthe type of 3D vector to be printed
Parameters
vthe vector to be printed
Returns
a manipulator

Example of usage:

TVector3 pos;
std::cout << "Position: " << lar::dump::vector3D(pos) << std::endl;

will produce an output like:

Position: { 0; 0; 0 }

Addition of specific classes can be achieved via specialization of the class VectorDumper.

Requirements

  • the type Vector3D is required to provide constant accessor methods returning the vector components, called X(), Y() and Z()
  • the values returned by the aforementioned Vector3D methods must have their insertion operator into a stream defined
  • the vector v must not fall out of scope until the insertion into the stream happens

Definition at line 301 of file DumpUtils.h.

Referenced by checkTPCcoords(), detectGlobalDriftDir(), and sim::dump::DumpMCParticle().

301 { return VectorDumper<Vector3D>(v); }