Namespaces | Functions
Utils.cxx File Reference
#include "larreco/RecoAlg/TCAlg/Utils.h"
#include "larsim/MCCheater/ParticleInventoryService.h"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include "art/Framework/Services/Registry/ServiceHandle.h"
#include "larcorealg/Geometry/GeometryCore.h"
#include "larcorealg/Geometry/TPCGeo.h"
#include "larcoreobj/SimpleTypesAndConstants/RawTypes.h"
#include "larcoreobj/SimpleTypesAndConstants/geo_types.h"
#include "lardataalg/DetectorInfo/DetectorClocks.h"
#include "lardataalg/DetectorInfo/DetectorPropertiesData.h"
#include "lardataobj/RecoBase/Hit.h"
#include "larevt/CalibrationDBI/Interface/ChannelStatusProvider.h"
#include "larevt/CalibrationDBI/Interface/ChannelStatusService.h"
#include "larreco/RecoAlg/TCAlg/DebugStruct.h"
#include "larreco/RecoAlg/TCAlg/PFPUtils.h"
#include "larreco/RecoAlg/TCAlg/StepUtils.h"
#include "larreco/RecoAlg/TCAlg/TCShower.h"
#include "larreco/RecoAlg/TCAlg/TCVertex.h"
#include "nusimdata/SimulationBase/MCParticle.h"
#include <algorithm>
#include <array>
#include <bitset>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>

Go to the source code of this file.

Namespaces

 tca
 

Functions

bool valsDecreasing (const SortEntry &c1, const SortEntry &c2)
 
bool valsIncreasing (const SortEntry &c1, const 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 (const TCSlice &slc, const std::vector< int > &tjIDs)
 
int tca::NeutrinoPrimaryTjID (const TCSlice &slc, const Trajectory &tj)
 
int tca::PrimaryID (const TCSlice &slc, const Trajectory &tj)
 
int tca::PrimaryUID (const TCSlice &slc, const PFPStruct &pfp)
 
bool tca::MergeTjIntoPFP (TCSlice &slc, int mtjid, PFPStruct &pfp, bool prt)
 
float tca::PointPull (TCSlice &slc, Point2_t pos, float chg, const Trajectory &tj)
 
bool tca::CompatibleMerge (const TCSlice &slc, std::vector< int > &tjIDs, bool prt)
 
bool tca::CompatibleMerge (const TCSlice &slc, const Trajectory &tj1, const Trajectory &tj2, bool prt)
 
float tca::OverlapFraction (const 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)
 
unsigned short tca::GetPFPIndex (const 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::FitPar (const TCSlice &slc, const Trajectory &tj, unsigned short originPt, unsigned short npts, short fitDir, ParFit &pFit, unsigned short usePar)
 
bool tca::InTrajOK (TCSlice &slc, std::string someText)
 
void tca::CheckTrajBeginChg (TCSlice &slc, unsigned short itj)
 
bool tca::BraggSplit (TCSlice &slc, unsigned short itj)
 
void tca::TrimHiChgEndPts (TCSlice &slc, Trajectory &tj, bool prt)
 
void tca::TrimEndPts (std::string fcnLabel, TCSlice &slc, Trajectory &tj, const std::vector< float > &fQualityCuts, bool prt)
 
void tca::ChkEndKink (TCSlice &slc, Trajectory &tj, bool prt)
 
void tca::ChkChgAsymmetry (TCSlice &slc, Trajectory &tj, bool prt)
 
bool tca::SignalBetween (const TCSlice &slc, const TrajPoint &tp1, const TrajPoint &tp2, const float &MinWireSignalFraction)
 
bool tca::SignalBetween (const TCSlice &slc, TrajPoint tp, float toPos0, const float &MinWireSignalFraction)
 
float tca::ChgFracBetween (const 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::SignalAtTpInSlc (const TCSlice &slc, const TrajPoint &tp)
 
bool tca::SignalAtTp (TrajPoint &tp)
 
bool tca::NearbySrcHit (geo::PlaneID plnID, unsigned int wire, float loTick, float hiTick)
 
float tca::TpSumHitChg (const TCSlice &slc, TrajPoint const &tp)
 
unsigned short tca::NumPtsWithCharge (const TCSlice &slc, const Trajectory &tj, bool includeDeadWires)
 
unsigned short tca::NumPtsWithCharge (const TCSlice &slc, const Trajectory &tj, bool includeDeadWires, unsigned short firstPt, unsigned short lastPt)
 
float tca::DeadWireCount (const TCSlice &slc, const TrajPoint &tp1, const TrajPoint &tp2)
 
float tca::DeadWireCount (const 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 (detinfo::DetectorPropertiesData const &detProp, 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 (const TCSlice &slc, TrajPoint const &tp, Trajectory const &tj, unsigned short &closePt, float &minSep)
 
bool tca::TrajTrajDOCA (const TCSlice &slc, const Trajectory &tj1, const Trajectory &tj2, unsigned short &ipt1, unsigned short &ipt2, float &minSep)
 
bool tca::TrajTrajDOCA (const TCSlice &slc, const Trajectory &tj1, const Trajectory &tj2, unsigned short &ipt1, unsigned short &ipt2, float &minSep, bool considerDeadWires)
 
float tca::HitSep2 (const TCSlice &slc, unsigned int iht, unsigned int jht)
 
unsigned short tca::CloseEnd (const TCSlice &slc, const Trajectory &tj, const Point2_t &pos)
 
float tca::PointTrajSep2 (float wire, float time, TrajPoint const &tp)
 
float tca::PointTrajDOCA (const TCSlice &slc, unsigned int iht, TrajPoint const &tp)
 
float tca::PointTrajDOCA (const TCSlice &slc, float wire, float time, TrajPoint const &tp)
 
float tca::PointTrajDOCA2 (const 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 (const TCSlice &slc, std::vector< int > &tjIDs)
 
float tca::TrajLength (const 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 (const TrajPoint &tp1, const TrajPoint &tp2)
 
bool tca::TrajClosestApproach (Trajectory const &tj, float x, float y, unsigned short &closePt, float &DOCA)
 
float tca::TwoTPAngle (const TrajPoint &tp1, const TrajPoint &tp2)
 
std::vector< unsigned int > tca::PutHitsInVector (const TCSlice &slc, PFPStruct const &pfp, HitStatus_t hitRequest)
 
std::vector< unsigned int > tca::PutTrajHitsInVector (const Trajectory &tj, HitStatus_t hitRequest)
 
void tca::TagJunkTj (TCSlice &slc, Trajectory &tj, bool prt)
 
bool tca::HasDuplicateHits (const TCSlice &slc, Trajectory const &tj, bool prt)
 
void tca::MoveTPToWire (TrajPoint &tp, float wire)
 
std::vector< unsigned int > tca::FindCloseHits (const 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)
 
unsigned short tca::NearbyCleanPt (const TCSlice &slc, const Trajectory &tj, unsigned short end)
 
std::vector< int > tca::FindCloseTjs (const TCSlice &slc, const TrajPoint &fromTp, const TrajPoint &toTp, const float &maxDelta)
 
float tca::KinkSignificance (TCSlice &slc, Trajectory &tj1, unsigned short end1, Trajectory &tj2, unsigned short end2, unsigned short nPtsFit, bool useChg, bool prt)
 
float tca::KinkSignificance (TCSlice &slc, Trajectory &tj, unsigned short kinkPt, unsigned short nPtsFit, bool useChg, bool prt)
 
float tca::ElectronLikelihood (const TCSlice &slc, const Trajectory &tj)
 
float tca::ChgFracNearPos (const 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 (const TCSlice &slc, const std::vector< int > &tjIDs)
 
short tca::MCSMom (const TCSlice &slc, const Trajectory &tj)
 
short tca::MCSMom (const TCSlice &slc, const Trajectory &tj, unsigned short firstPt, unsigned short lastPt)
 
unsigned short tca::NearestPtWithChg (const TCSlice &slc, const Trajectory &tj, unsigned short thePt)
 
float tca::MCSThetaRMS (const TCSlice &slc, const Trajectory &tj)
 
double tca::MCSThetaRMS (const TCSlice &slc, const Trajectory &tj, unsigned short firstPt, unsigned short lastPt)
 
void tca::TjDeltaRMS (const TCSlice &slc, const Trajectory &tj, unsigned short firstPt, unsigned short lastPt, double &rms, unsigned short &cnt)
 
void tca::SetTPEnvironment (TCSlice &slc, CTP_t inCTP)
 
void tca::UpdateTjChgProperties (std::string inFcnLabel, TCSlice &slc, Trajectory &tj, bool prt)
 
void tca::UpdateVxEnvironment (TCSlice &slc)
 
void tca::UpdateVxEnvironment (TCSlice &slc, VtxStore &vx2, bool prt)
 
TrajPoint tca::MakeBareTP (detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, const Point3_t &pos, CTP_t inCTP)
 
TrajPoint tca::MakeBareTP (detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, const Point3_t &pos, const Vector3_t &dir, CTP_t inCTP)
 
bool tca::MakeBareTrajPoint (const TCSlice &slc, unsigned int fromHit, unsigned int toHit, TrajPoint &tp)
 
bool tca::MakeBareTrajPoint (const 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 (const 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 (const TCSlice &slc, const TrajPoint &tp, HitStatus_t hitRequest)
 
float tca::TPHitsRMSTick (const TCSlice &slc, const TrajPoint &tp, HitStatus_t hitRequest)
 
float tca::HitsRMSTime (const TCSlice &slc, const std::vector< unsigned int > &hitsInMultiplet, HitStatus_t hitRequest)
 
float tca::HitsRMSTick (const TCSlice &slc, const std::vector< unsigned int > &hitsInMultiplet, HitStatus_t hitRequest)
 
float tca::HitsPosTime (const TCSlice &slc, const std::vector< unsigned int > &hitsInMultiplet, float &sum, HitStatus_t hitRequest)
 
float tca::HitsPosTick (const TCSlice &slc, const std::vector< unsigned int > &hitsInMultiplet, float &sum, HitStatus_t hitRequest)
 
unsigned short tca::NumUsedHitsInTj (const TCSlice &slc, const Trajectory &tj)
 
unsigned short tca::NumHitsInTP (const TrajPoint &tp, HitStatus_t hitRequest)
 
void tca::SetPDGCode (TCSlice &slc, unsigned short itj)
 
void tca::SetPDGCode (TCSlice &slc, Trajectory &tj)
 
bool tca::AnalyzeHits ()
 
bool tca::LongPulseHit (const recob::Hit &hit)
 
void tca::FillWireHitRange (geo::TPCID inTPCID)
 
bool tca::FillWireHitRange (detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, 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::PrintDebugMode ()
 
void tca::PrintAll (detinfo::DetectorPropertiesData const &detProp, std::string someText)
 
void tca::PrintP (std::string someText, mf::LogVerbatim &myprt, PFPStruct &pfp, bool &printHeader)
 
void tca::Print3V (detinfo::DetectorPropertiesData const &detProp, std::string someText, mf::LogVerbatim &myprt, Vtx3Store &vx3, bool &printHeader)
 
void tca::Print2V (std::string someText, mf::LogVerbatim &myprt, VtxStore &vx2, bool &printHeader)
 
void tca::Print3S (detinfo::DetectorPropertiesData const &detProp, std::string someText, mf::LogVerbatim &myprt, ShowerStruct3D &ss3)
 
void tca::PrintT (std::string someText, mf::LogVerbatim &myprt, Trajectory &tj, bool &printHeader)
 
void tca::PrintAllTraj (detinfo::DetectorPropertiesData const &detProp, std::string someText, TCSlice &slc, unsigned short itj, unsigned short ipt, bool prtVtx)
 
void tca::PrintTrajectory (std::string someText, const TCSlice &slc, const Trajectory &tj, unsigned short tPoint)
 
void tca::PrintTPHeader (std::string someText)
 
void tca::PrintTP (std::string someText, const TCSlice &slc, unsigned short ipt, short dir, unsigned short pass, const TrajPoint &tp)
 
std::string tca::TPEnvString (const TrajPoint &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::PrintEndFlag (const PFPStruct &pfp, unsigned short end)
 
std::string tca::PrintEndFlag (const Trajectory &tj, unsigned short end)
 
std::string tca::PrintHitShort (const TCHit &tch)
 
std::string tca::PrintHit (const TCHit &tch)
 
std::string tca::PrintPos (const TCSlice &slc, const TrajPoint &tp)
 
std::string tca::PrintPos (const TCSlice &slc, const Point2_t &pos)
 

Function Documentation

bool valsDecreasing ( const SortEntry c1,
const SortEntry c2 
)

Definition at line 38 of file Utils.cxx.

38 { return c1.val > c2.val;}
float val
Definition: DataStructs.h:38
bool valsIncreasing ( const SortEntry c1,
const SortEntry c2 
)

Definition at line 39 of file Utils.cxx.

39 { return c1.val < c2.val;}
float val
Definition: DataStructs.h:38