9 #ifndef CLUSTERCRAWLERALG_H 10 #define CLUSTERCRAWLERALG_H 29 class DetectorClocksData;
30 class DetectorPropertiesData;
40 static constexpr
unsigned int CTPpad = 1000;
42 EncodeCTP(
unsigned int cryo,
unsigned int tpc,
unsigned int plane)
44 return cryo * CTPpad * CTPpad + tpc * CTPpad + plane;
54 return {CTP / (CTPpad * CTPpad), CTP / CTPpad % CTPpad, CTP % CTPpad};
118 std::vector<recob::Hit>
const& srchits);
123 std::vector<short>
const&
130 std::vector<recob::Hit>&&
137 std::vector<recob::Hit>
144 std::vector<ClusterStore>
const&
151 std::vector<VtxStore>
const&
158 std::vector<Vtx3Store>
const&
186 std::vector<unsigned short>
250 std::vector<ClusterStore>
tcl;
251 std::vector<VtxStore>
vtx;
328 bool ClusterHitsOK(
short nHitChk);
330 void AddHit(
unsigned int kwire,
bool& HitOK,
bool& SigOK);
332 void AddLAHit(
unsigned int kwire,
bool& ChkCharge,
bool& HitOK,
bool& SigOK);
336 void FitClusterChg();
338 void FitClusterMid(
unsigned short it1,
unsigned int iht,
short nhit);
339 void FitClusterMid(std::vector<unsigned int>& hitVec,
unsigned int iht,
short nhit);
345 void KillGarbageClusters();
352 void ChkMerge12(
unsigned short it1,
unsigned short it2,
bool& didit);
354 void DoMerge(
unsigned short it1,
unsigned short it2,
short ProcCode);
359 void ChkClusterNearbyHits(
bool prt);
361 void MergeHits(
const unsigned int theHit,
bool& didMerge);
363 void FixMultipletLocalIndices(
size_t begin,
size_t end,
short int multiplicity = -1);
368 void CheckClusterHitFrac(
bool prt);
377 void MakeClusterObsolete(
unsigned short icl);
379 void RestoreObsoleteCluster(
unsigned short icl);
382 void RemoveObsoleteHits();
389 void FindStarVertices();
392 void ChkVertex(
float fvw,
float fvt,
unsigned short it1,
unsigned short it2,
short topo);
394 void ClusterVertex(
unsigned short it2);
396 void VertexCluster(
unsigned short ivx);
398 void RefineVertexClusters(
unsigned short ivx);
400 bool VtxClusterSplit();
402 bool CrawlVtxChk(
unsigned int kwire);
407 void VtxConstraint(
unsigned int iwire,
410 unsigned int& useHit,
413 void FitVtx(
unsigned short iv);
415 void FitAllVtx(CTP_t inCTP);
442 void GetHitRange(CTP_t CTP);
446 void TmpGet(
unsigned short it1);
448 void CalculateAveHitWidth();
450 void FclTrimUS(
unsigned short nTrim);
453 bool SplitCluster(
unsigned short icl,
unsigned short pos,
unsigned short ivx);
456 unsigned int DeadWireCount(
unsigned int inWire1,
unsigned int inWire2);
458 bool ChkMergedClusterHitFrac(
unsigned short it1,
unsigned short it2);
461 void PrintVertices();
463 bool ChkSignal(
unsigned int iht,
unsigned int jht);
464 bool ChkSignal(
unsigned int wire1,
float time1,
unsigned int wire2,
float time2);
466 float AngleFactor(
float slope);
469 float EndKinkAngle();
473 float DoCA(
short icl,
unsigned short end,
float vwire,
float vtick);
475 float ClusterVertexChi(
short icl,
unsigned short end,
unsigned short ivx);
477 float PointVertexChi(
float wire,
float tick,
unsigned short ivx);
482 std::pair<size_t, size_t> FindHitMultiplet(
size_t iHit)
const;
484 void CheckHitClusterAssociations();
493 #endif // ifndef CLUSTERCRAWLERALG_H float fScaleF
scale factor from Tick/Wire to dx/du
std::vector< short > hitNear
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
float fAveChg
average charge at leading edge of cluster
std::vector< ClusterStore > tcl
the clusters we are creating
std::vector< std::pair< int, int > > WireHitRange
std::vector< float > fTimeDelta
max time difference for matching
struct of temporary 2D vertices (end points)
std::vector< float > fChgCut
charge difference cut for adding a hit to a cluster
std::vector< Vtx3Store > vtx3
the 3D vertices we are reconstructing
float clBeginChg
begin average charge
std::vector< unsigned short > fMinWirAfterSkip
std::vector< recob::Hit > GetHits()
Returns the collection of reconstructed hits.
int fDebugWire
set to the Begin Wire and Hit of a cluster to print
The data type to uniquely identify a Plane.
std::vector< ClusterStore > const & GetClusters() const
Returns a constant reference to the clusters found.
float clEndSlp
slope at the end (= US end = low wire number)
std::vector< unsigned short > fMaxWirSkip
max number of wires that can be skipped while crawling
bool fRefineVertexClusters
CryostatID_t Cryostat
Index of cryostat.
struct of temporary clusters
std::vector< float > fMinAmp
expected minimum signal in each wire plane
Cluster finding and building.
CTP_t clCTP
Cryostat/TPC/Plane code.
std::vector< float > fMergeChgCut
max charge ratio for matching
float fHitErrFac
hit time error = fHitErrFac * hit RMS used for cluster fit
art::ServiceHandle< geo::Geometry const > geom
float fKillGarbageClusters
struct of temporary 3D vertices
float fAveHitWidth
average width (EndTick - StartTick) of hits
art framework interface to geometry description
static geo::PlaneID DecodeCTP(CTP_t CTP)
float fHitMinAmp
< ignore hits with Amp < this value
int fDebugHit
out detailed information while crawling
std::vector< bool > fLACrawl
Crawl Large Angle clusters on pass?
std::vector< short > inClus
Hit used in cluster (-1 = obsolete, 0 = free)
unsigned int fLastWire
the last wire with a hit
std::vector< float > fChiCut
stop adding hits to clusters if chisq too high
float fChgNearWindow
window (ticks) for finding nearby charge
unsigned short fNumPass
number of passes over the hit collection
std::vector< recob::Hit > && YieldHits()
Returns (and loses) the collection of reconstructed hits.
std::vector< VtxStore > const & GetEndPoints() const
Returns a constant reference to the 2D end points found.
float fMergeOverlapAngCut
angle cut for merging overlapping clusters
unsigned int fFirstWire
the first wire with a hit
float DeadWireCount(const TCSlice &slc, const TrajPoint &tp1, const TrajPoint &tp2)
static CTP_t EncodeCTP(const geo::PlaneID &planeID)
unsigned int clEndWir
begin wire
float fVertex2DCut
2D vtx -> cluster matching cut (chisq/dof)
std::vector< float > fKinkAngCut
kink angle cut made after fKinkChiRat
unsigned short fAllowNoHitWire
float fVertex3DCut
2D vtx -> 3D vtx matching cut (chisq/dof)
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
void MergeOverlap(std::string inFcnLabel, TCSlice &slc, const CTP_t &inCTP, bool prt)
unsigned short fLAClusMaxHitsFit
max hits fitted on a Large Angle cluster
std::string PrintHit(const TCHit &tch)
std::vector< float > fKinkChiRat
General LArSoft Utilities.
std::vector< bool > fFindVertices
run vertexing code after clustering?
The data type to uniquely identify a TPC.
PlaneID_t Plane
Index of the plane within its TPC.
float clBeginSlp
begin slope (= DS end = high wire number)
Definition of data types for geometry description.
std::vector< unsigned short > fMaxHitsFit
Max number of hits fitted.
std::array< short, 3 > Ptr2D
static CTP_t EncodeCTP(unsigned int cryo, unsigned int tpc, unsigned int plane)
float clChisq
chisq of the current fit
std::string fhitsModuleLabel
bool clLA
using Large Angle crawling code
std::vector< recob::Hit > fHits
our version of the hits
std::vector< unsigned short > fMinHits
Min number of hits to make a cluster.
Declaration of signal hit object.
float clEndChg
end average charge
std::vector< float > chifits
fit chisq for monitoring kinks, etc
Contains all timing reference information for the detector.
std::vector< Vtx3Store > const & GetVertices() const
Returns a constant reference to the 3D vertices found.
unsigned int clBeginWir
begin wire
std::vector< unsigned int > tclhits
float fLAClusAngleCut
call Large Angle Clustering code if > 0
std::vector< bool > mergeAvailable
set true if hit is with HitMergeChiCut of a neighbor hit
float fClProjErrFac
cluster projection error factor
float clBeginTim
begin time
float fVertex2DWireErrCut
CTP_t EncodeCTP(unsigned int cryo, unsigned int tpc, unsigned int plane)
unsigned int fFirstHit
first hit used
float clBeginChgNear
nearby charge
std::vector< float > chgNear
charge near a cluster on each wire
std::vector< VtxStore > vtx
the endpoints we are reconstructing
bool fFindHammerClusters
look for hammer type clusters
std::vector< short > const & GetinClus() const
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
2D representation of charge deposited in the TDC/wire plane
trkf::LinFitAlg fLinFitAlg
float clEndChgNear
nearby charge
TPCID_t TPC
Index of the TPC within its cryostat.
std::vector< unsigned int > fcl2hits
vector of hits used in the cluster
float fChgSlp
slope of the charge vs wire
LArSoft geometry interface.
std::vector< geo::WireID > fFilteredWires
std::vector< unsigned short > fNHitsAve
std::vector< bool > fDoMerge
try to merge clusters?