10 max_cell_gap_cut_ (p.
get<
int>(
"max_cell_gap_cut")),
11 max_plane_gap_cut_(p.
get<
int>(
"max_plane_gap_cut")),
12 track_min_beta_ (p.
get<double>(
"track_min_beta")),
13 track_max_beta_ (p.
get<double>(
"track_max_beta"))
32 std::map<std::string, mono::HitList> hitmap;
35 std::cout <<
"MF: (Total Hits, X Hits, Y Hits) = (" 37 <<
", " << hitmap[
"x"].size()
38 <<
", " << hitmap[
"y"].size()
46 hitmap[
"x_contained"];
53 for (
auto entry_hit = hitmap[
"x_surface"].cbegin();
54 entry_hit != hitmap[
"x_surface"].cend() && !
result;
58 mono::HitList::const_reverse_iterator until(entry_hit + 1);
60 auto contained_first =
find(hitmap[
"x_contained"], (*entry_hit)->TDC());
66 find(contained_first, hitmap[
"x_contained"].cend(), exit_hit->
TDC());
77 std::set<int> plane_set = { (*entry_hit)->Plane() };
78 std::set<int> cell_set = { (*entry_hit)->Cell() };
87 int32_t t_max_gap =
std::min(t_max_plane_gap, t_max_cell_gap);
89 unsigned n_contained_hit = 0;
90 bool contains_gap_exceeding_cut = std::any_of
91 (contained_first, contained_last,
94 if (hit->
TDC() > t_max_gap)
96 int64_t time_difference =
97 static_cast<int64_t
>(hit->
TDC()) -
100 if (hit->
TDC() > t_max_cell_gap)
102 double expected_cell =
111 if (hit->
TDC() > t_max_plane_gap)
113 double expected_plane =
126 cell_set.insert(hit->
Cell());
127 plane_set.insert(hit->
Plane());
133 if (contains_gap_exceeding_cut)
136 plane_set.insert(exit_hit->
Plane());
143 cell_set.insert(exit_hit->
Cell());
151 (contained_first, contained_last,
170 auto bound = std::stable_partition
171 (hits.begin(), hits.end(),
176 std::move(hits.begin(), bound, hitmap[
"x"].begin());
179 std::move(bound, hits.end(), hitmap[
"y"].begin());
185 (std::map<std::string, mono::HitList> & hitmap)
const 187 for (
auto const& x_hit : hitmap[
"x"])
190 find(hitmap[
"y"], x_hit->TDC() -
193 find(hitmap[
"y"], x_hit->TDC() +
200 if (y_match != y_last)
203 hitmap[
"x_contained"].push_back(x_hit);
208 hitmap[
"x_surface"].push_back(x_hit);
224 if (surface_y_match != y_last)
225 hitmap[
"x_surface"].push_back(x_hit);
236 int plane_difference =
237 static_cast<int>(x_hit->
Plane()) - static_cast<int>(y_hit->
Plane());
319 (
static_cast<double>(hit->
Plane()) -
349 (
static_cast<double>(hit->
Plane()) -
352 if (relative_hit_time >
356 if (relative_hit_time <
366 (std::set<int> collection,
int const&
object,
int const& max_gap_cut)
const 370 collection.insert(
object);
383 (std::set<int>
const& collection)
const 388 (collection.begin(), collection.end(), [&](
int object,
int next_object)
390 int gap = next_object - object;
404 (mono::HitList::const_iterator begin,
405 mono::HitList::const_iterator
end, int32_t tdc)
const 407 return std::lower_bound
410 {
return h->
TDC() < tdc_val; });
418 return find(hits.cbegin(), hits.cend(), tdc);
T max(const caf::Proxy< T > &a, T b)
const unsigned ROAD_HALF_WIDTH
int plane_difference() const
bool slope_plane_is_valid() const
unsigned max_plane() const
int32_t TDC() const
The time of the last baseline sample.
bool gap_exceeds_cut(std::set< int > collection, int const &object, int const &max_gap_cut) const
unsigned short Plane() const
A collection of associated CellHits.
const unsigned SURFACE_MAX_CELL
std::vector< art::Ptr< rb::CellHit > > HitList
unsigned distance(const T &t1, const T &t2)
void find_view_matched_hits(std::map< std::string, mono::HitList > &hitmap) const
bool slope_time_is_valid() const
const unsigned SURFACE_MAX_PLANE
virtual void Add(const art::Ptr< rb::CellHit > &cell, double weight=1)
const double ROAD_TIME_VARIATION
unsigned short Cell() const
double slope_plane_time() const
unsigned max_cell() const
mono::HitList::const_iterator find(mono::HitList const &hits, int32_t tdc) const
bool hit_is_on_surface(art::Ptr< rb::CellHit > const &hit) const
void split_by_view(mono::HitList hits, std::map< std::string, mono::HitList > &hitmap) const
const unsigned TRACK_MIN_UNIQUE_PLANES
bool hit_is_in_time_with_road(art::Ptr< rb::CellHit > const &hit, Track const &track) const
const unsigned VIEW_MATCH_PLANE_CUT
bool hit_is_between_track_end_points(art::Ptr< rb::CellHit > const &hit, Track const &track) const
art::Ptr< rb::CellHit > start_rb() const
const unsigned SURFACE_MIN_PLANE
bool make(std::vector< art::Ptr< rb::CellHit > > const &hits)
const double TRACK_MIN_DISTANCE
bool good_track(Track const &track) const
bool slope_cell_is_valid() const
double slope_cell_plane() const
double slope_time_plane() const
rb::Cluster monopole_hits_
double slope_time_cell() const
Cluster(fhicl::ParameterSet const &p)
unsigned min_cell() const
bool hit_is_on_road(art::Ptr< rb::CellHit > const &hit, Track const &track) const
int find_max_gap(std::set< int > const &collection) const
T min(const caf::Proxy< T > &a, T b)
const unsigned SURFACE_MIN_CELL
const unsigned VIEW_MATCH_TDC_CUT
double slope_cell_time() const
bool hits_are_view_matched(art::Ptr< rb::CellHit > const &x_hit, art::Ptr< rb::CellHit > const &y_hit) const
virtual void Clear()
Forget about all owned cell hits.
const unsigned TRACK_MIN_HITS
unsigned min_plane() const