9 #ifndef CLUSTERCRAWLERALG_H 10 #define CLUSTERCRAWLERALG_H 29 class DetectorClocksData;
30 class DetectorPropertiesData;
40 static constexpr
unsigned int CTPpad = 1000;
41 static CTP_t
EncodeCTP(
unsigned int cryo,
unsigned int tpc,
unsigned int plane)
43 return cryo * CTPpad * CTPpad + tpc * CTPpad + plane;
51 return {CTP / (CTPpad * CTPpad), CTP / CTPpad % CTPpad, CTP % CTPpad};
115 std::vector<recob::Hit>
const& srchits);
120 std::vector<short>
const&
GetinClus()
const {
return inClus; }
123 std::vector<recob::Hit>&&
YieldHits() {
return std::move(fHits); }
126 std::vector<recob::Hit>
GetHits() {
return fHits; }
129 std::vector<ClusterStore>
const&
GetClusters()
const {
return tcl; }
135 std::vector<Vtx3Store>
const&
GetVertices()
const {
return vtx3; }
153 std::vector<float> fChiCut;
156 std::vector<float> fKinkAngCut;
159 std::vector<unsigned short>
162 std::vector<bool> fDoMerge;
190 float fMergeOverlapAngCut;
223 std::vector<ClusterStore>
tcl;
224 std::vector<VtxStore>
vtx;
301 bool ClusterHitsOK(
short nHitChk);
303 void AddHit(
unsigned int kwire,
bool& HitOK,
bool& SigOK);
305 void AddLAHit(
unsigned int kwire,
bool& ChkCharge,
bool& HitOK,
bool& SigOK);
309 void FitClusterChg();
311 void FitClusterMid(
unsigned short it1,
unsigned int iht,
short nhit);
312 void FitClusterMid(std::vector<unsigned int>& hitVec,
unsigned int iht,
short nhit);
318 void KillGarbageClusters();
325 void ChkMerge12(
unsigned short it1,
unsigned short it2,
bool& didit);
327 void DoMerge(
unsigned short it1,
unsigned short it2,
short ProcCode);
332 void ChkClusterNearbyHits(
bool prt);
334 void MergeHits(
const unsigned int theHit,
bool& didMerge);
336 void FixMultipletLocalIndices(
size_t begin,
size_t end,
short int multiplicity = -1);
341 void CheckClusterHitFrac(
bool prt);
350 void MakeClusterObsolete(
unsigned short icl);
352 void RestoreObsoleteCluster(
unsigned short icl);
355 void RemoveObsoleteHits();
362 void FindStarVertices();
365 void ChkVertex(
float fvw,
float fvt,
unsigned short it1,
unsigned short it2,
short topo);
367 void ClusterVertex(
unsigned short it2);
369 void VertexCluster(
unsigned short ivx);
371 void RefineVertexClusters(
unsigned short ivx);
373 bool VtxClusterSplit();
375 bool CrawlVtxChk(
unsigned int kwire);
380 void VtxConstraint(
unsigned int iwire,
383 unsigned int& useHit,
386 void FitVtx(
unsigned short iv);
388 void FitAllVtx(CTP_t inCTP);
408 void GetHitRange(CTP_t CTP);
412 void TmpGet(
unsigned short it1);
414 void CalculateAveHitWidth();
416 void FclTrimUS(
unsigned short nTrim);
419 bool SplitCluster(
unsigned short icl,
unsigned short pos,
unsigned short ivx);
422 unsigned int DeadWireCount(
unsigned int inWire1,
unsigned int inWire2);
424 bool ChkMergedClusterHitFrac(
unsigned short it1,
unsigned short it2);
427 void PrintVertices();
429 bool ChkSignal(
unsigned int iht,
unsigned int jht);
430 bool ChkSignal(
unsigned int wire1,
float time1,
unsigned int wire2,
float time2);
432 float AngleFactor(
float slope);
435 float EndKinkAngle();
437 bool CheckHitDuplicates(std::string location, std::string marker =
"")
const;
439 float DoCA(
short icl,
unsigned short end,
float vwire,
float vtick);
441 float ClusterVertexChi(
short icl,
unsigned short end,
unsigned short ivx);
443 float PointVertexChi(
float wire,
float tick,
unsigned short ivx);
444 std::string
PrintHit(
unsigned int iht);
448 std::pair<size_t, size_t> FindHitMultiplet(
size_t iHit)
const;
450 void CheckHitClusterAssociations();
459 #endif // ifndef CLUSTERCRAWLERALG_H float fScaleF
scale factor from Tick/Wire to dx/du
std::vector< short > hitNear
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.
Declaration of signal hit object.
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.
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
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
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
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.
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)
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.
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
Returns (and loses) the collection of reconstructed hits.
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
Namespace collecting geometry-related classes utilities.
art framework interface to geometry description
std::vector< geo::WireID > fFilteredWires
std::vector< unsigned short > fNHitsAve