9 #ifndef CLUSTERCRAWLERALG_H
10 #define CLUSTERCRAWLERALG_H
18 #include "art/Framework/Services/Registry/ServiceHandle.h"
29 class DetectorClocksData;
30 class DetectorPropertiesData;
40 static constexpr
unsigned int CTPpad = 1000;
118 std::vector<recob::Hit>
const& srchits);
123 std::vector<short>
const&
130 std::vector<recob::Hit>&&
133 return std::move(
fHits);
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>
245 art::ServiceHandle<geo::Geometry const>
geom;
250 std::vector<ClusterStore>
tcl;
251 std::vector<VtxStore>
vtx;
330 void AddHit(
unsigned int kwire,
bool& HitOK,
bool& SigOK);
332 void AddLAHit(
unsigned int kwire,
bool& ChkCharge,
bool& HitOK,
bool& SigOK);
338 void FitClusterMid(
unsigned short it1,
unsigned int iht,
short nhit);
339 void FitClusterMid(std::vector<unsigned int>& hitVec,
unsigned int iht,
short nhit);
352 void ChkMerge12(
unsigned short it1,
unsigned short it2,
bool& didit);
354 void DoMerge(
unsigned short it1,
unsigned short it2,
short ProcCode);
361 void MergeHits(
const unsigned int theHit,
bool& didMerge);
392 void ChkVertex(
float fvw,
float fvt,
unsigned short it1,
unsigned short it2,
short topo);
410 unsigned int& useHit,
413 void FitVtx(
unsigned short iv);
446 void TmpGet(
unsigned short it1);
453 bool SplitCluster(
unsigned short icl,
unsigned short pos,
unsigned short ivx);
456 unsigned int DeadWireCount(
unsigned int inWire1,
unsigned int inWire2);
463 bool ChkSignal(
unsigned int iht,
unsigned int jht);
464 bool ChkSignal(
unsigned int wire1,
float time1,
unsigned int wire2,
float time2);
473 float DoCA(
short icl,
unsigned short end,
float vwire,
float vtick);
478 std::string
PrintHit(
unsigned int iht);
493 #endif // ifndef CLUSTERCRAWLERALG_H
float fScaleF
scale factor from Tick/Wire to dx/du
std::vector< short > hitNear
bool ClusterHitsOK(short nHitChk)
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
void FitVtx(unsigned short iv)
void RemoveObsoleteHits()
Removes obsolete hits from hits, updating the indices.
void FitClusterMid(unsigned short it1, unsigned int iht, short nhit)
bool ChkSignal(unsigned int iht, unsigned int jht)
std::vector< float > fTimeDelta
max time difference for matching
struct of temporary 2D vertices (end points)
float clparerr[2]
cluster parameter errors
static bool areInSameMultiplet(recob::Hit const &first_hit, recob::Hit const &second_hit)
Returns whether the two hits belong to the same multiplet.
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.
void CheckClusterHitFrac(bool prt)
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)
static bool SortByMultiplet(recob::Hit const &a, recob::Hit const &b)
Comparison for sorting hits by wire and hit multiplet.
std::vector< unsigned short > fMaxWirSkip
max number of wires that can be skipped while crawling
bool fRefineVertexClusters
CryostatID_t Cryostat
Index of cryostat.
void MergeHits(const unsigned int theHit, bool &didMerge)
struct of temporary clusters
void FixMultipletLocalIndices(size_t begin, size_t end, short int multiplicity=-1)
Resets the local index and multiplicity of all the hits in [begin;end[.
std::vector< float > fMinAmp
expected minimum signal in each wire plane
CTP_t clCTP
Cryostat/TPC/Plane code.
std::vector< float > fMergeChgCut
max charge ratio for matching
float DoCA(short icl, unsigned short end, float vwire, float vtick)
float fHitErrFac
hit time error = fHitErrFac * hit RMS used for cluster fit
void GetHitRange(CTP_t CTP)
float AngleFactor(float slope)
art::ServiceHandle< geo::Geometry const > geom
void AddLAHit(unsigned int kwire, bool &ChkCharge, bool &HitOK, bool &SigOK)
float fKillGarbageClusters
struct of temporary 3D vertices
float fAveHitWidth
average width (EndTick - StartTick) of hits
void FclTrimUS(unsigned short nTrim)
bool CrawlVtxChk(unsigned int kwire)
static geo::PlaneID DecodeCTP(CTP_t CTP)
void DoMerge(unsigned short it1, unsigned short it2, short ProcCode)
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
void VtxMatch(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, geo::TPCID const &tpcid)
std::vector< float > fChiCut
stop adding hits to clusters if chisq too high
float ClusterVertexChi(short icl, unsigned short end, unsigned short ivx)
float fChgNearWindow
window (ticks) for finding nearby charge
static constexpr unsigned int CTPpad
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
static CTP_t EncodeCTP(const geo::PlaneID &planeID)
unsigned int clEndWir
begin wire
float fVertex2DCut
2D vtx -> cluster matching cut (chisq/dof)
void FindHammerClusters(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop)
std::vector< float > fKinkAngCut
kink angle cut made after fKinkChiRat
unsigned short fAllowNoHitWire
float fVertex3DCut
2D vtx -> 3D vtx matching cut (chisq/dof)
auto end(FixedBins< T, C > const &) noexcept
void VtxConstraint(unsigned int iwire, unsigned int ihit, unsigned int jwire, unsigned int &useHit, bool &doConstrain)
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
void CalculateAveHitWidth()
unsigned short fLAClusMaxHitsFit
max hits fitted on a Large Angle cluster
void MakeClusterObsolete(unsigned short icl)
Marks the cluster as obsolete and frees hits still associated with it.
std::vector< float > fKinkChiRat
void RestoreObsoleteCluster(unsigned short icl)
Restores an obsolete cluster.
void TmpGet(unsigned short it1)
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::pair< size_t, size_t > FindHitMultiplet(size_t iHit) const
std::vector< unsigned short > fMaxHitsFit
Max number of hits fitted.
std::array< short, 3 > Ptr2D
std::string PrintHit(unsigned int iht)
static CTP_t EncodeCTP(unsigned int cryo, unsigned int tpc, unsigned int plane)
float clChisq
chisq of the current fit
std::string fhitsModuleLabel
auto begin(FixedBins< T, C > const &) noexcept
void CheckHitClusterAssociations()
void KillGarbageClusters()
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
void ClusterVertex(unsigned short it2)
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
bool SplitCluster(unsigned short icl, unsigned short pos, unsigned short ivx)
void RunCrawler(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, std::vector< recob::Hit > const &srchits)
float fClProjErrFac
cluster projection error factor
float clBeginTim
begin time
float fVertex2DWireErrCut
void Vtx3ClusterSplit(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, geo::TPCID const &tpcid)
void AddHit(unsigned int kwire, bool &HitOK, bool &SigOK)
unsigned int fFirstHit
first hit used
float clBeginChgNear
nearby charge
void ChkMerge12(unsigned short it1, unsigned short it2, bool &didit)
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
void FitAllVtx(CTP_t inCTP)
std::vector< short > const & GetinClus() const
2D representation of charge deposited in the TDC/wire plane
bool ChkMergedClusterHitFrac(unsigned short it1, unsigned short it2)
trkf::LinFitAlg fLinFitAlg
float clEndChgNear
nearby charge
TPCID_t TPC
Index of the TPC within its cryostat.
void VertexCluster(unsigned short ivx)
std::vector< unsigned int > fcl2hits
vector of hits used in the cluster
float fChgSlp
slope of the charge vs wire
void RefineVertexClusters(unsigned short ivx)
void ChkVertex(float fvw, float fvt, unsigned short it1, unsigned short it2, short topo)
float PointVertexChi(float wire, float tick, unsigned short ivx)
unsigned int DeadWireCount()
art framework interface to geometry description
std::vector< geo::WireID > fFilteredWires
void ChkClusterNearbyHits(bool prt)
std::vector< unsigned short > fNHitsAve
std::vector< bool > fDoMerge
try to merge clusters?
void Vtx3ClusterMatch(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, geo::TPCID const &tpcid)
bool CheckHitDuplicates(std::string location, std::string marker="") const
Returns true if there are no duplicates in the hit list for next cluster.
ClusterCrawlerAlg(fhicl::ParameterSet const &pset)