LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
Utils.h File Reference
#include <array>
#include <vector>
#include <bitset>
#include <utility>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include "messagefacility/MessageLogger/MessageLogger.h"
#include "larcoreobj/SimpleTypesAndConstants/geo_types.h"
#include "larevt/CalibrationDBI/Interface/ChannelStatusService.h"
#include "larevt/CalibrationDBI/Interface/ChannelStatusProvider.h"
#include "lardataobj/RecoBase/Hit.h"
#include "larreco/RecoAlg/TCAlg/DataStructs.h"
#include "larreco/RecoAlg/TCAlg/DebugStruct.h"
#include "larreco/RecoAlg/TCAlg/TCShower.h"
#include "larreco/RecoAlg/TCAlg/TCVertex.h"
#include "larreco/RecoAlg/TCAlg/PFPUtils.h"

Go to the source code of this file.

Namespaces

 tca
 

Enumerations

enum  tca::HitStatus_t { tca::kAllHits, tca::kUsedHits, tca::kUnusedHits }
 

Functions

void tca::DefineTjParents (TjStuff &tjs, const geo::TPCID &tpcid, bool prt)
 
float tca::MaxChargeAsymmetry (TjStuff &tjs, std::vector< int > &tjIDs)
 
int tca::PDGCodeVote (TjStuff &tjs, std::vector< int > &tjIDs, bool prt)
 
unsigned short tca::NumDeltaRays (const TjStuff &tjs, const Trajectory &tj)
 
unsigned short tca::NumDeltaRays (const TjStuff &tjs, std::vector< int > &tjIDs)
 
int tca::NeutrinoPrimaryTjID (const TjStuff &tjs, const Trajectory &tj)
 
int tca::PrimaryID (const TjStuff &tjs, const Trajectory &tj)
 
int tca::PrimaryID (const TjStuff &tjs, const PFPStruct &pfp)
 
bool tca::MergeTjIntoPFP (TjStuff &tjs, int mtjid, PFPStruct &pfp, bool prt)
 
bool tca::CompatibleMerge (TjStuff &tjs, std::vector< int > &tjIDs, bool prt)
 
bool tca::CompatibleMerge (TjStuff &tjs, const Trajectory &tj1, const Trajectory &tj2, bool prt)
 
float tca::OverlapFraction (TjStuff &tjs, const Trajectory &tj1, const Trajectory &tj2)
 
unsigned short tca::AngleRange (TjStuff &tjs, TrajPoint const &tp)
 
void tca::SetAngleCode (TjStuff &tjs, TrajPoint &tp)
 
unsigned short tca::AngleRange (TjStuff &tjs, float angle)
 
void tca::FitTraj (TjStuff &tjs, Trajectory &tj)
 
void tca::FitTraj (TjStuff &tjs, Trajectory &tj, unsigned short originPt, unsigned short npts, short fitDir, TrajPoint &tpFit)
 
float tca::TjDirFOM (const TjStuff &tjs, const Trajectory &tj, bool prt)
 
void tca::WatchHit (std::string someText, TjStuff &tjs, const unsigned int &wHit, short &wInTraj, const unsigned short &tjID)
 
unsigned short tca::GetPFPIndex (const TjStuff &tjs, int tjID)
 
unsigned short tca::MatchVecIndex (const TjStuff &tjs, int tjID)
 
void tca::ReleaseHits (TjStuff &tjs, Trajectory &tj)
 
void tca::UnsetUsedHits (TjStuff &tjs, TrajPoint &tp)
 
bool tca::StoreTraj (TjStuff &tjs, Trajectory &tj)
 
bool tca::InTrajOK (TjStuff &tjs, std::string someText)
 
void tca::CheckTrajBeginChg (TjStuff &tjs, unsigned short itj, bool prt)
 
void tca::TrimEndPts (std::string fcnLabel, TjStuff &tjs, Trajectory &tj, const std::vector< float > &fQualityCuts, bool prt)
 
void tca::ChkChgAsymmetry (TjStuff &tjs, Trajectory &tj, bool prt)
 
bool tca::SignalBetween (TjStuff &tjs, const TrajPoint &tp1, const TrajPoint &tp2, const float &MinWireSignalFraction, bool prt)
 
bool tca::SignalBetween (TjStuff &tjs, TrajPoint tp, float toPos0, const float &MinWireSignalFraction, bool prt)
 
float tca::ChgFracBetween (TjStuff &tjs, TrajPoint tp, float toPos0, bool prt)
 
bool tca::TrajHitsOK (TjStuff &tjs, const std::vector< unsigned int > &iHitsInMultiplet, const std::vector< unsigned int > &jHitsInMultiplet)
 
bool tca::TrajHitsOK (TjStuff &tjs, const unsigned int iht, const unsigned int jht)
 
float tca::ExpectedHitsRMS (TjStuff &tjs, const TrajPoint &tp)
 
bool tca::SignalAtTp (TjStuff &tjs, TrajPoint const &tp)
 
float tca::TpSumHitChg (TjStuff &tjs, TrajPoint const &tp)
 
unsigned short tca::NumPtsWithCharge (const TjStuff &tjs, const Trajectory &tj, bool includeDeadWires)
 
unsigned short tca::NumPtsWithCharge (const TjStuff &tjs, const Trajectory &tj, bool includeDeadWires, unsigned short firstPt, unsigned short lastPt)
 
float tca::DeadWireCount (const TjStuff &tjs, const TrajPoint &tp1, const TrajPoint &tp2)
 
float tca::DeadWireCount (const TjStuff &tjs, const float &inWirePos1, const float &inWirePos2, CTP_t tCTP)
 
unsigned short tca::PDGCodeIndex (TjStuff &tjs, int PDGCode)
 
void tca::MakeTrajectoryObsolete (TjStuff &tjs, unsigned int itj)
 
void tca::RestoreObsoleteTrajectory (TjStuff &tjs, unsigned int itj)
 
void tca::MergeGhostTjs (TjStuff &tjs, CTP_t inCTP)
 
bool tca::SplitTraj (TjStuff &tjs, unsigned short itj, unsigned short pos, unsigned short ivx, bool prt)
 
bool tca::SplitTraj (TjStuff &tjs, unsigned short itj, float XPos, bool makeVx2, bool prt)
 
bool tca::TrajClosestApproach (Trajectory const &tj, float x, float y, unsigned short &closePt, float &DOCA)
 
float tca::PointTrajDOCA (TjStuff const &tjs, unsigned int iht, TrajPoint const &tp)
 
float tca::PointTrajDOCA (TjStuff const &tjs, float wire, float time, TrajPoint const &tp)
 
float tca::PointTrajDOCA2 (TjStuff const &tjs, float wire, float time, TrajPoint const &tp)
 
bool tca::FindCloseHits (TjStuff const &tjs, TrajPoint &tp, float const &maxDelta, HitStatus_t hitRequest)
 
std::vector< unsigned int > tca::FindCloseHits (TjStuff const &tjs, std::array< int, 2 > const &wireWindow, Point2_t const &timeWindow, const unsigned short plane, HitStatus_t hitRequest, bool usePeakTime, bool &hitsNear)
 
std::vector< int > tca::FindCloseTjs (const TjStuff &tjs, const TrajPoint &fromTp, const TrajPoint &toTp, const float &maxDelta)
 
float tca::ChgFracNearPos (TjStuff &tjs, const Point2_t &pos, const std::vector< int > &tjIDs)
 
float tca::MaxHitDelta (TjStuff &tjs, Trajectory &tj)
 
void tca::ReverseTraj (TjStuff &tjs, Trajectory &tj)
 
unsigned short tca::CloseEnd (TjStuff &tjs, const Trajectory &tj, const Point2_t &pos)
 
float tca::PointTrajSep2 (float wire, float time, TrajPoint const &tp)
 
float tca::PosSep (const Point2_t &pos1, const Point2_t &pos2)
 
float tca::PosSep2 (const Point2_t &pos1, const Point2_t &pos2)
 
void tca::TrajPointTrajDOCA (TjStuff &tjs, TrajPoint const &tp, Trajectory const &tj, unsigned short &closePt, float &minSep)
 
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 (TjStuff const &tjs, std::vector< int > &tjIDs)
 
float tca::TrajPointSeparation (TrajPoint &tp1, TrajPoint &tp2)
 
float tca::TrajLength (Trajectory &tj)
 
float tca::HitSep2 (TjStuff &tjs, unsigned int iht, unsigned int jht)
 
bool tca::TrajTrajDOCA (const TjStuff &tjs, const Trajectory &tj1, const Trajectory &tj2, unsigned short &ipt1, unsigned short &ipt2, float &minSep)
 
bool tca::TrajTrajDOCA (const TjStuff &tjs, const Trajectory &tj1, const Trajectory &tj2, unsigned short &ipt1, unsigned short &ipt2, float &minSep, bool considerDeadWires)
 
float tca::TwoTPAngle (TrajPoint &tp1, TrajPoint &tp2)
 
void tca::TagJunkTj (TjStuff const &tjs, Trajectory &tj, bool prt)
 
std::vector< unsigned int > tca::PutTrajHitsInVector (Trajectory const &tj, HitStatus_t hitRequest)
 
bool tca::HasDuplicateHits (TjStuff const &tjs, Trajectory const &tj, bool prt)
 
void tca::MoveTPToWire (TrajPoint &tp, float wire)
 
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::DotProd (const Vector2_t &v1, const Vector2_t &v2)
 
double tca::DeltaAngle (double Ang1, double Ang2)
 
double tca::DeltaAngle2 (double Ang1, double Ang2)
 
double tca::DeltaAngle (const Point2_t &p1, const Point2_t &p2)
 
void tca::SetEndPoints (TjStuff &tjs, Trajectory &tj)
 
float tca::TPHitsRMSTick (TjStuff &tjs, TrajPoint &tp, HitStatus_t hitRequest)
 
float tca::TPHitsRMSTime (TjStuff &tjs, TrajPoint &tp, HitStatus_t hitRequest)
 
float tca::HitsRMSTick (TjStuff &tjs, const std::vector< unsigned int > &hitsInMultiplet, HitStatus_t hitRequest)
 
float tca::HitsRMSTime (TjStuff &tjs, const std::vector< unsigned int > &hitsInMultiplet, HitStatus_t hitRequest)
 
float tca::HitsPosTick (TjStuff &tjs, const std::vector< unsigned int > &hitsInMultiplet, float &sum, HitStatus_t hitRequest)
 
float tca::HitsPosTime (TjStuff &tjs, const std::vector< unsigned int > &hitsInMultiplet, float &sum, HitStatus_t hitRequest)
 
unsigned short tca::NumHitsInTP (const TrajPoint &tp, HitStatus_t hitRequest)
 
unsigned short tca::NumUsedHitsInTj (const TjStuff &tjs, const Trajectory &tj)
 
unsigned short tca::NearestPtWithChg (TjStuff &tjs, Trajectory &tj, unsigned short thePt)
 
short tca::MCSMom (const TjStuff &tjs, const std::vector< int > &tjIDs)
 
short tca::MCSMom (TjStuff &tjs, Trajectory &tj)
 
short tca::MCSMom (TjStuff &tjs, Trajectory &tj, unsigned short firstPt, unsigned short lastPt)
 
double tca::MCSThetaRMS (TjStuff &tjs, Trajectory &tj, unsigned short firstPt, unsigned short lastPt)
 
float tca::MCSThetaRMS (TjStuff &tjs, Trajectory &tj)
 
void tca::TjDeltaRMS (TjStuff &tjs, Trajectory &tj, unsigned short firstPt, unsigned short lastPt, double &rms, unsigned short &cnt)
 
bool tca::TrajIsClean (TjStuff &tjs, Trajectory &tj, bool prt)
 
void tca::TagDeltaRays (TjStuff &tjs, const CTP_t &inCTP)
 
void tca::TagMuonDirections (TjStuff &tjs, short debugWorkID)
 
void tca::UpdateTjChgProperties (std::string inFcnLabel, TjStuff &tjs, Trajectory &tj, bool prt)
 
void tca::UpdateVxEnvironment (std::string inFcnLabel, TjStuff &tjs, VtxStore &vx2, bool prt)
 
TrajPoint tca::MakeBareTP (TjStuff &tjs, Point3_t &pos, Vector3_t &dir, CTP_t inCTP)
 
bool tca::MakeBareTrajPoint (const TjStuff &tjs, unsigned int fromHit, unsigned int toHit, TrajPoint &tp)
 
bool tca::MakeBareTrajPoint (const TjStuff &tjs, 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 (const TjStuff &tjs, const TrajPoint &tpIn1, const TrajPoint &tpIn2, TrajPoint &tpOut)
 
unsigned short tca::FarEnd (const TjStuff &tjs, const Trajectory &tj, const Point2_t &pos)
 
Vector2_t tca::PointDirection (const Point2_t p1, const Point2_t p2)
 
void tca::SetPDGCode (TjStuff &tjs, Trajectory &tj)
 
void tca::SetPDGCode (TjStuff &tjs, unsigned short itj)
 
bool tca::FillWireHitRange (TjStuff &tjs, const geo::TPCID &tpcid)
 
bool tca::CheckWireHitRange (const TjStuff &tjs)
 
bool tca::WireHitRangeOK (const TjStuff &tjs, const CTP_t &inCTP)
 
bool tca::MergeAndStore (TjStuff &tjs, unsigned int itj1, unsigned int itj2, bool doPrt)
 
std::vector< int > tca::GetAssns (const TjStuff &tjs, std::string type1Name, int id, std::string type2Name)
 
template<typename T >
std::vector< T > tca::SetIntersection (const std::vector< T > &set1, const std::vector< T > &set2)
 
template<typename T >
std::vector< T > tca::SetDifference (const std::vector< T > &set1, const std::vector< T > &set2)
 
void tca::PrintTrajectory (std::string someText, const TjStuff &tjs, const Trajectory &tj, unsigned short tPoint)
 
void tca::PrintAllTraj (std::string someText, const TjStuff &tjs, const DebugStuff &debug, unsigned short itj, unsigned short ipt, bool prtVtx)
 
void tca::PrintHeader (std::string someText)
 
void tca::PrintTrajPoint (std::string someText, const TjStuff &tjs, unsigned short ipt, short dir, unsigned short pass, TrajPoint const &tp)
 
void tca::PrintPFP (std::string someText, const TjStuff &tjs, const PFPStruct &pfp, bool printHeader)
 
void tca::PrintPFPs (std::string someText, const TjStuff &tjs)
 
void tca::PrintClusters ()
 
std::string tca::PrintHit (const TCHit &hit)
 
std::string tca::PrintHitShort (const TCHit &hit)
 
std::string tca::PrintPos (const TjStuff &tjs, const TrajPoint &tp)
 
std::string tca::PrintPos (const TjStuff &tjs, const Point2_t &pos)
 
std::string tca::PrintStopFlag (const Trajectory &tj, unsigned short end)