LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
Utils.cxx File Reference
#include "larreco/RecoAlg/TCAlg/Utils.h"
#include "larcorealg/CoreUtils/NumericUtils.h"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include "larsim/MCCheater/ParticleInventoryService.h"

Go to the source code of this file.

Classes

struct  SortEntry
 

Namespaces

 tca
 

Functions

bool valDecreasing (SortEntry c1, SortEntry c2)
 
bool valIncreasing (SortEntry c1, SortEntry c2)
 
void tca::MakeHaloTj (TCSlice &slc, Trajectory &muTj, bool prt)
 
void tca::DefineTjParents (TCSlice &slc, bool prt)
 
float tca::MaxChargeAsymmetry (TCSlice &slc, std::vector< int > &tjIDs)
 
int tca::PDGCodeVote (TCSlice &slc, std::vector< int > &tjIDs, bool prt)
 
unsigned short tca::NumDeltaRays (TCSlice &slc, const Trajectory &tj)
 
unsigned short tca::NumDeltaRays (TCSlice &slc, std::vector< int > &tjIDs)
 
int tca::NeutrinoPrimaryTjID (TCSlice &slc, const Trajectory &tj)
 
int tca::PrimaryID (TCSlice &slc, const Trajectory &tj)
 
int tca::PrimaryUID (TCSlice &slc, const PFPStruct &pfp)
 
bool tca::MergeTjIntoPFP (TCSlice &slc, int mtjid, PFPStruct &pfp, bool prt)
 
bool tca::CompatibleMerge (TCSlice &slc, std::vector< int > &tjIDs, bool prt)
 
bool tca::CompatibleMerge (TCSlice &slc, const Trajectory &tj1, const Trajectory &tj2, bool prt)
 
float tca::OverlapFraction (TCSlice &slc, const Trajectory &tj1, const Trajectory &tj2)
 
unsigned short tca::AngleRange (TrajPoint const &tp)
 
void tca::SetAngleCode (TrajPoint &tp)
 
unsigned short tca::AngleRange (float angle)
 
void tca::FitTraj (TCSlice &slc, Trajectory &tj)
 
void tca::FitTraj (TCSlice &slc, Trajectory &tj, unsigned short originPt, unsigned short npts, short fitDir, TrajPoint &tpFit)
 
float tca::TjDirFOM (TCSlice &slc, const Trajectory &tj, bool prt)
 
void tca::Reverse3DMatchTjs (TCSlice &slc, PFPStruct &pfp, bool prt)
 
unsigned short tca::GetPFPIndex (TCSlice &slc, int tjID)
 
unsigned short tca::MatchVecIndex (TCSlice &slc, int tjID)
 
void tca::ReleaseHits (TCSlice &slc, Trajectory &tj)
 
void tca::UnsetUsedHits (TCSlice &slc, TrajPoint &tp)
 
bool tca::StoreTraj (TCSlice &slc, Trajectory &tj)
 
void tca::ChgSlope (TCSlice &slc, Trajectory &tj, float &slope, float &slopeErr, float &chiDOF)
 
void tca::ChgSlope (TCSlice &slc, Trajectory &tj, unsigned short fromPt, unsigned short toPt, float &slope, float &slopeErr, float &chiDOF)
 
bool tca::InTrajOK (TCSlice &slc, std::string someText)
 
void tca::CheckTrajBeginChg (TCSlice &slc, unsigned short itj)
 
void tca::TrimEndPts (std::string fcnLabel, TCSlice &slc, Trajectory &tj, const std::vector< float > &fQualityCuts, bool prt)
 
void tca::ChkChgAsymmetry (TCSlice &slc, Trajectory &tj, bool prt)
 
bool tca::SignalBetween (TCSlice &slc, const TrajPoint &tp1, const TrajPoint &tp2, const float &MinWireSignalFraction)
 
bool tca::SignalBetween (TCSlice &slc, TrajPoint tp, float toPos0, const float &MinWireSignalFraction)
 
float tca::ChgFracBetween (TCSlice &slc, TrajPoint tp, float toPos0)
 
bool tca::TrajHitsOK (TCSlice &slc, const std::vector< unsigned int > &iHitsInMultiplet, const std::vector< unsigned int > &jHitsInMultiplet)
 
bool tca::TrajHitsOK (TCSlice &slc, const unsigned int iht, const unsigned int jht)
 
float tca::ExpectedHitsRMS (TCSlice &slc, const TrajPoint &tp)
 
bool tca::SignalAtTp (TCSlice &slc, const TrajPoint &tp)
 
float tca::TpSumHitChg (TCSlice &slc, TrajPoint const &tp)
 
unsigned short tca::NumPtsWithCharge (TCSlice &slc, const Trajectory &tj, bool includeDeadWires)
 
unsigned short tca::NumPtsWithCharge (TCSlice &slc, const Trajectory &tj, bool includeDeadWires, unsigned short firstPt, unsigned short lastPt)
 
float tca::DeadWireCount (TCSlice &slc, const TrajPoint &tp1, const TrajPoint &tp2)
 
float tca::DeadWireCount (TCSlice &slc, const float &inWirePos1, const float &inWirePos2, CTP_t tCTP)
 
unsigned short tca::PDGCodeIndex (int PDGCode)
 
void tca::MakeTrajectoryObsolete (TCSlice &slc, unsigned int itj)
 
void tca::RestoreObsoleteTrajectory (TCSlice &slc, unsigned int itj)
 
void tca::MergeGhostTjs (TCSlice &slc, CTP_t inCTP)
 
bool tca::SplitTraj (TCSlice &slc, unsigned short itj, float XPos, bool makeVx2, bool prt)
 
bool tca::SplitTraj (TCSlice &slc, unsigned short itj, unsigned short pos, unsigned short ivx, bool prt)
 
void tca::TrajPointTrajDOCA (TCSlice &slc, TrajPoint const &tp, Trajectory const &tj, unsigned short &closePt, float &minSep)
 
bool tca::TrajTrajDOCA (TCSlice &slc, const Trajectory &tj1, const Trajectory &tj2, unsigned short &ipt1, unsigned short &ipt2, float &minSep)
 
bool tca::TrajTrajDOCA (TCSlice &slc, const Trajectory &tj1, const Trajectory &tj2, unsigned short &ipt1, unsigned short &ipt2, float &minSep, bool considerDeadWires)
 
float tca::HitSep2 (TCSlice &slc, unsigned int iht, unsigned int jht)
 
unsigned short tca::CloseEnd (TCSlice &slc, const Trajectory &tj, const Point2_t &pos)
 
float tca::PointTrajSep2 (float wire, float time, TrajPoint const &tp)
 
float tca::PointTrajDOCA (TCSlice &slc, unsigned int iht, TrajPoint const &tp)
 
float tca::PointTrajDOCA (TCSlice &slc, float wire, float time, TrajPoint const &tp)
 
float tca::PointTrajDOCA2 (TCSlice &slc, float wire, float time, TrajPoint const &tp)
 
void tca::TrajIntersection (TrajPoint const &tp1, TrajPoint const &tp2, Point2_t &pos)
 
void tca::TrajIntersection (TrajPoint const &tp1, TrajPoint const &tp2, float &x, float &y)
 
float tca::MaxTjLen (TCSlice &slc, std::vector< int > &tjIDs)
 
float tca::TrajLength (Trajectory &tj)
 
float tca::PosSep (const Point2_t &pos1, const Point2_t &pos2)
 
float tca::PosSep2 (const Point2_t &pos1, const Point2_t &pos2)
 
float tca::TrajPointSeparation (TrajPoint &tp1, TrajPoint &tp2)
 
bool tca::TrajClosestApproach (Trajectory const &tj, float x, float y, unsigned short &closePt, float &DOCA)
 
float tca::TwoTPAngle (TrajPoint &tp1, TrajPoint &tp2)
 
std::vector< unsigned int > tca::PutTrajHitsInVector (Trajectory const &tj, HitStatus_t hitRequest)
 
void tca::TagJunkTj (TCSlice &slc, Trajectory &tj, bool prt)
 
bool tca::HasDuplicateHits (TCSlice &slc, Trajectory const &tj, bool prt)
 
void tca::MoveTPToWire (TrajPoint &tp, float wire)
 
std::vector< unsigned int > tca::FindCloseHits (TCSlice &slc, std::array< int, 2 > const &wireWindow, Point2_t const &timeWindow, const unsigned short plane, HitStatus_t hitRequest, bool usePeakTime, bool &hitsNear)
 
bool tca::FindCloseHits (TCSlice &slc, TrajPoint &tp, float const &maxDelta, HitStatus_t hitRequest)
 
std::vector< int > tca::FindCloseTjs (TCSlice &slc, const TrajPoint &fromTp, const TrajPoint &toTp, const float &maxDelta)
 
float tca::ElectronLikelihood (TCSlice &slc, Trajectory &tj, float &asym)
 
float tca::ChgFracNearPos (TCSlice &slc, const Point2_t &pos, const std::vector< int > &tjIDs)
 
float tca::MaxHitDelta (TCSlice &slc, Trajectory &tj)
 
void tca::ReverseTraj (TCSlice &slc, Trajectory &tj)
 
bool tca::PointInsideEnvelope (const Point2_t &Point, const std::vector< Point2_t > &Envelope)
 
bool tca::SetMag (Vector2_t &v1, double mag)
 
void tca::FindAlongTrans (Point2_t pos1, Vector2_t dir1, Point2_t pos2, Point2_t &alongTrans)
 
double tca::DeltaAngle (const Point2_t &p1, const Point2_t &p2)
 
double tca::DeltaAngle2 (double Ang1, double Ang2)
 
double tca::DeltaAngle (double Ang1, double Ang2)
 
void tca::SetEndPoints (Trajectory &tj)
 
bool tca::TrajIsClean (TCSlice &slc, Trajectory &tj, bool prt)
 
short tca::MCSMom (TCSlice &slc, const std::vector< int > &tjIDs)
 
short tca::MCSMom (TCSlice &slc, Trajectory &tj)
 
short tca::MCSMom (TCSlice &slc, Trajectory &tj, unsigned short firstPt, unsigned short lastPt)
 
unsigned short tca::NearestPtWithChg (TCSlice &slc, Trajectory &tj, unsigned short thePt)
 
float tca::MCSThetaRMS (TCSlice &slc, Trajectory &tj)
 
double tca::MCSThetaRMS (TCSlice &slc, Trajectory &tj, unsigned short firstPt, unsigned short lastPt)
 
void tca::TjDeltaRMS (TCSlice &slc, Trajectory &tj, unsigned short firstPt, unsigned short lastPt, double &rms, unsigned short &cnt)
 
void tca::TagDeltaRays (TCSlice &slc, const CTP_t &inCTP)
 
void tca::UpdateTjChgProperties (std::string inFcnLabel, TCSlice &slc, Trajectory &tj, bool prt)
 
void tca::UpdateVxEnvironment (std::string inFcnLabel, TCSlice &slc, VtxStore &vx2, bool prt)
 
TrajPoint tca::MakeBareTP (TCSlice &slc, Point3_t &pos, Vector3_t &dir, CTP_t inCTP)
 
bool tca::MakeBareTrajPoint (TCSlice &slc, unsigned int fromHit, unsigned int toHit, TrajPoint &tp)
 
bool tca::MakeBareTrajPoint (TCSlice &slc, float fromWire, float fromTick, float toWire, float toTick, CTP_t tCTP, TrajPoint &tp)
 
bool tca::MakeBareTrajPoint (const Point2_t &fromPos, const Point2_t &toPos, TrajPoint &tpOut)
 
bool tca::MakeBareTrajPoint (TCSlice &slc, const TrajPoint &tpIn1, const TrajPoint &tpIn2, TrajPoint &tpOut)
 
unsigned short tca::FarEnd (TCSlice &slc, const Trajectory &tj, const Point2_t &pos)
 
Vector2_t tca::PointDirection (const Point2_t p1, const Point2_t p2)
 
float tca::TPHitsRMSTime (TCSlice &slc, TrajPoint &tp, HitStatus_t hitRequest)
 
float tca::TPHitsRMSTick (TCSlice &slc, TrajPoint &tp, HitStatus_t hitRequest)
 
float tca::HitsRMSTime (TCSlice &slc, const std::vector< unsigned int > &hitsInMultiplet, HitStatus_t hitRequest)
 
float tca::HitsRMSTick (TCSlice &slc, const std::vector< unsigned int > &hitsInMultiplet, HitStatus_t hitRequest)
 
float tca::HitsPosTime (TCSlice &slc, const std::vector< unsigned int > &hitsInMultiplet, float &sum, HitStatus_t hitRequest)
 
float tca::HitsPosTick (TCSlice &slc, const std::vector< unsigned int > &hitsInMultiplet, float &sum, HitStatus_t hitRequest)
 
unsigned short tca::NumUsedHitsInTj (TCSlice &slc, const Trajectory &tj)
 
unsigned short tca::NumHitsInTP (const TrajPoint &tp, HitStatus_t hitRequest)
 
void tca::SetPDGCode (TCSlice &slc, unsigned short itj, bool tjDone)
 
void tca::SetPDGCode (TCSlice &slc, Trajectory &tj, bool tjDone)
 
bool tca::AnalyzeHits ()
 
bool tca::LongPulseHit (const recob::Hit &hit)
 
bool tca::FillWireHitRange (TCSlice &slc)
 
bool tca::WireHitRangeOK (TCSlice &slc, const CTP_t &inCTP)
 
bool tca::MergeAndStore (TCSlice &slc, unsigned int itj1, unsigned int itj2, bool doPrt)
 
std::vector< int > tca::GetAssns (TCSlice &slc, std::string type1Name, int id, std::string type2Name)
 
bool tca::StartTraj (TCSlice &slc, Trajectory &tj, unsigned int fromhit, unsigned int tohit, unsigned short pass)
 
bool tca::StartTraj (TCSlice &slc, Trajectory &tj, float fromWire, float fromTick, float toWire, float toTick, CTP_t &tCTP, unsigned short pass)
 
std::pair< unsigned short, unsigned short > tca::GetSliceIndex (std::string typeName, int uID)
 
bool tca::Fit2D (short mode, Point2_t inPt, float &inPtErr, Vector2_t &outVec, Vector2_t &outVecErr, float &chiDOF)
 
bool tca::DecodeDebugString (std::string strng)
 
void tca::DumpTj ()
 
void tca::PrintAll (std::string someText, const std::vector< simb::MCParticle * > &mcpList)
 
void tca::PrintP (std::string someText, mf::LogVerbatim &myprt, PFPStruct &pfp, bool &printHeader)
 
void tca::Print3V (std::string someText, mf::LogVerbatim &myprt, Vtx3Store &vx3)
 
void tca::Print2V (std::string someText, mf::LogVerbatim &myprt, VtxStore &vx2)
 
void tca::Print3S (std::string someText, mf::LogVerbatim &myprt, ShowerStruct3D &ss3)
 
void tca::PrintT (std::string someText, mf::LogVerbatim &myprt, Trajectory &tj, bool &printHeader)
 
void tca::PrintAllTraj (std::string someText, TCSlice &slc, unsigned short itj, unsigned short ipt, bool prtVtx)
 
void tca::PrintTrajectory (std::string someText, TCSlice &slc, const Trajectory &tj, unsigned short tPoint)
 
void tca::PrintHeader (std::string someText)
 
void tca::PrintTrajPoint (std::string someText, TCSlice &slc, unsigned short ipt, short dir, unsigned short pass, TrajPoint const &tp)
 
void tca::PrintPFP (std::string someText, TCSlice &slc, const PFPStruct &pfp, bool printHeader)
 
void tca::PrintPFPs (std::string someText, TCSlice &slc)
 
std::string tca::PrintStopFlag (const Trajectory &tj, unsigned short end)
 
std::string tca::PrintHitShort (const TCHit &tch)
 
std::string tca::PrintHit (const TCHit &tch)
 
std::string tca::PrintPos (TCSlice &slc, const TrajPoint &tp)
 
std::string tca::PrintPos (TCSlice &slc, const Point2_t &pos)
 

Function Documentation

bool valDecreasing ( SortEntry  c1,
SortEntry  c2 
)

Definition at line 14 of file Utils.cxx.

References SortEntry::val.

Referenced by tca::DefineTjParents().

14 { return (c1.val > c2.val);}
float val
Definition: StepUtils.cxx:6
bool valIncreasing ( SortEntry  c1,
SortEntry  c2 
)

Definition at line 15 of file Utils.cxx.

References SortEntry::val.

15 { return (c1.val < c2.val);}
float val
Definition: StepUtils.cxx:6