219 unsigned n_new_points = n_new_branch_trajpoints - n_old_branch_trajpoints;
221 unsigned n_hits = trunk_hits.size();
229 unsigned i_hit_trunk = 0;
230 for (; i_hit_trunk < n_hits; i_hit_trunk++) {
235 if (thm->
Index() == std::numeric_limits<unsigned int>::max() || !trunk_trk.
HasValidPoint(thm->
Index()))
continue;
248 std::vector<art::Ptr<recob::Hit>> branch_wire_hits;
249 std::vector<const recob::TrackHitMeta *> branch_wire_hmetas;
250 for (
unsigned i_hit_branch = 0; i_hit_branch < branch_hits.size(); i_hit_branch++) {
251 art::Ptr<recob::Hit> b_hit = branch_hits[i_hit_branch];
252 if (b_hit->WireID() == hit.
WireID()) {
253 branch_wire_hits.push_back(b_hit);
254 branch_wire_hmetas.push_back(branch_hmeta[i_hit_branch]);
260 bool valid_tp =
false;
261 unsigned i_hit_branch = 0;
262 if (branch_wire_hits.size()) {
264 for (; i_hit_branch < branch_wire_hits.size(); i_hit_branch++) {
265 if (branch_wire_hmetas[i_hit_branch]->Index() != std::numeric_limits<unsigned int>::max() &&
266 old_branch_trk.
HasValidPoint(branch_wire_hmetas[i_hit_branch]->Index())) {
276 if (this_point_past_branch_start && valid_tp) {
284 if (!branch_wire_hits.size()) {
285 branch_wire_hits =
SplitTrunkHits(dprop, trunk_hits, i_hit_trunk, trunk_hmeta, trunk_trk, new_branch_trk);
302 recob::TrackHitMeta new_branch_meta(branch_wire_hmetas[i_hit_branch]->Index() + n_new_points);
303 ret.
branch_hits.push_back(*branch_wire_hits[i_hit_branch]);
310 else if (branch_wire_hits.size()) {
311 art::Ptr<recob::Hit> new_branch_hit = *std::max_element(branch_wire_hits.begin(), branch_wire_hits.end(),
312 [
this, dprop, new_branch_trk](
auto const &lhs,
auto const &rhs) {
349 for (; i_hit_trunk < n_hits; i_hit_trunk++) {
350 const recob::Hit &hit = *trunk_hits[i_hit_trunk];
354 if (thm->
Index() == std::numeric_limits<unsigned int>::max() || !trunk_trk.
HasValidPoint(thm->
Index()))
continue;
362 for (
unsigned i_hit_branch = 0; i_hit_branch < branch_hits.size(); i_hit_branch++) {
365 if (branch_hmeta[i_hit_branch]->Index() == std::numeric_limits<unsigned int>::max() ||
366 !old_branch_trk.
HasValidPoint(branch_hmeta[i_hit_branch]->Index())) {
372 for (
unsigned j_hit_branch = 0; j_hit_branch < n_split_hits; j_hit_branch++) {
373 if (ret.
branch_hits[j_hit_branch].WireID() == branch_hits[i_hit_branch]->WireID()) {
382 ret.
branch_hits.push_back(*branch_hits[i_hit_branch]);
short int LocalIndex() const
How well do we believe we know this hit?
geo::SigType_t SignalType() const
Signal type for the plane of the hit.
geo::WireID WireID() const
float RMS() const
RMS of the hit shape, in tick units.
Point_t const & LocationAtPoint(size_t i) const
std::vector< recob::TrackHitMeta > trunk_hmetas
float SigmaPeakAmplitude() const
Uncertainty on estimated amplitude of the hit at its peak, in ADC units.
float SigmaIntegral() const
bool HasValidPoint(size_t i) const
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
int DegreesOfFreedom() const
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
geo::View_t View() const
View for the plane of the hit.
float GoodnessOfFit() const
Degrees of freedom in the determination of the hit signal shape (-1 by default)
std::vector< recob::TrackHitMeta > branch_hmetas
short int Multiplicity() const
How many hits could this one be shared with.
std::pair< int, float > ClosestTrajectoryPoint(const detinfo::DetectorPropertiesData &dprop, const recob::Track &trk, const recob::Hit &hit)
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
std::vector< recob::Hit > trunk_hits
std::vector< art::Ptr< recob::Hit > > SplitTrunkHits(const detinfo::DetectorPropertiesData &dprop, const std::vector< art::Ptr< recob::Hit >> &trunk_hits, unsigned main_hit_ind, const std::vector< const recob::TrackHitMeta * > &trunk_hmetas, const recob::Track &trunk_trk, const recob::Track &branch_trk)
raw::TDCtick_t StartTick() const
Initial tdc tick for hit.
raw::TDCtick_t EndTick() const
Final tdc tick for hit.
float PeakTime() const
Time of the signal peak, in tick units.
float SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
float SigmaPeakTime() const
Uncertainty for the signal peak, in tick units.
2D representation of charge deposited in the TDC/wire plane
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
std::vector< recob::Hit > branch_hits