9 #ifndef CLUSTERCRAWLERALG_H 10 #define CLUSTERCRAWLERALG_H 42 static constexpr
unsigned int CTPpad = 1000;
44 (
unsigned int cryo,
unsigned int tpc,
unsigned int plane)
45 {
return cryo * CTPpad*CTPpad + tpc * CTPpad +
plane; }
49 {
return { CTP / (CTPpad*
CTPpad), CTP / CTPpad % CTPpad, CTP % CTPpad }; }
111 void RunCrawler(std::vector<recob::Hit>
const& srchits);
220 std::vector< ClusterStore >
tcl;
221 std::vector< VtxStore >
vtx;
300 void AddHit(
unsigned int kwire,
bool& HitOK,
bool& SigOK);
302 void AddLAHit(
unsigned int kwire,
bool& ChkCharge,
bool& HitOK,
bool& SigOK);
308 void FitClusterMid(
unsigned short it1,
unsigned int iht,
short nhit);
309 void FitClusterMid(std::vector<unsigned int>& hitVec,
unsigned int iht,
short nhit);
322 void ChkMerge12(
unsigned short it1,
unsigned short it2,
bool& didit);
331 void MergeHits(
const unsigned int theHit,
bool& didMerge);
334 (
size_t begin,
size_t end,
short int multiplicity = -1);
363 void ChkVertex(
float fvw,
float fvt,
unsigned short it1,
unsigned short it2,
short topo);
378 void VtxConstraint(
unsigned int iwire,
unsigned int ihit,
unsigned int jwire,
unsigned int& useHit,
bool& doConstrain);
380 void FitVtx(
unsigned short iv);
406 void TmpGet(
unsigned short it1);
413 bool SplitCluster(
unsigned short icl,
unsigned short pos,
unsigned short ivx);
416 unsigned int DeadWireCount(
unsigned int inWire1,
unsigned int inWire2);
423 bool ChkSignal(
unsigned int iht,
unsigned int jht);
424 bool ChkSignal(
unsigned int wire1,
float time1,
unsigned int wire2,
float time2);
433 float DoCA(
short icl,
unsigned short end,
float vwire,
float vtick);
438 std::string
PrintHit(
unsigned int iht);
455 #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< Vtx3Store > vtx3
the 3D vertices we are reconstructing
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)
virtual void reconfigure(fhicl::ParameterSet const &pset)
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
float clBeginChg
begin average charge
std::vector< unsigned short > fMinWirAfterSkip
after skipping
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 FindHammerClusters()
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
art::ServiceHandle< geo::Geometry > geom
Cluster finding and building.
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)
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?
void Vtx3ClusterMatch(geo::TPCID const &tpcid)
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 ClusterVertexChi(short icl, unsigned short end, unsigned short ivx)
float fChgNearWindow
window (ticks) for finding nearby charge
void VtxMatch(geo::TPCID const &tpcid)
static constexpr unsigned int CTPpad
std::vector< ClusterStore > tcl
the clusters we are creating
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)
std::vector< VtxStore > vtx
the endpoints we are reconstructing
void RunCrawler(std::vector< recob::Hit > const &srchits)
std::vector< evd::details::RawDigitInfo_t >::const_iterator begin(RawDigitCacheDataClass const &cache)
std::vector< float > fKinkAngCut
kink angle cut made after fKinkChiRat
unsigned short fAllowNoHitWire
float fVertex3DCut
2D vtx -> 3D vtx matching cut (chisq/dof)
void VtxConstraint(unsigned int iwire, unsigned int ihit, unsigned int jwire, unsigned int &useHit, bool &doConstrain)
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)
short clStopCode
8 = SPECIAL CODE FOR STEP CRAWLING
static CTP_t EncodeCTP(unsigned int cryo, unsigned int tpc, unsigned int plane)
float clChisq
chisq of the current fit
std::string fhitsModuleLabel
void CheckHitClusterAssociations()
std::vector< std::pair< int, int > > WireHitRange
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
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
void Vtx3ClusterSplit(geo::TPCID const &tpcid)
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)
float fClProjErrFac
cluster projection error factor
float clBeginTim
begin time
float fVertex2DWireErrCut
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)
float fHitMergeChiCut
is < cut. Set < 0 for no merging
std::vector< float > chgNear
charge near a cluster on each wire
bool fFindHammerClusters
look for hammer type clusters
void FitAllVtx(CTP_t inCTP)
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
std::vector< short > const & GetinClus() const
Returns (and loses) the collection of reconstructed hits.
float fChgNearCut
to define a shower-like cluster
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
set to > 2 to do a charge fit using fNHitsAve hits
std::vector< bool > fDoMerge
try to merge clusters?
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)