1#include "TrigScint/TrigScintTrackProducer.h"
10 max_delta_ = ps.
get<
double>(
12 max_delta_vert_ = ps.
get<
double>(
15 seeding_collection_ = ps.
get<std::string>(
16 "seeding_collection");
17 input_collections_ = ps.
get<std::vector<std::string>>(
18 "further_input_collections");
20 output_collection_ = ps.
get<std::string>(
"output_collection");
21 pass_name_ = ps.
get<std::string>(
"input_pass_name");
22 verbose_ = ps.
get<
int>(
"verbosity");
23 vert_bar_start_idx_ = ps.
get<
int>(
"vertical_bar_start_index");
24 n_bars_y_ = ps.
get<
int>(
"number_horizontal_bars");
25 bar_width_y_ = ps.
get<
double>(
"horizontal_bar_width");
26 bar_gap_y_ = ps.
get<
double>(
"horizontal_bar_gap");
27 n_bars_x_ = ps.
get<
int>(
"number_vertical_bars");
28 bar_width_x_ = ps.
get<
double>(
"vertical_bar_width");
29 bar_gap_x_ = ps.
get<
double>(
"vertical_bar_gap");
30 skip_last_ = ps.
get<
bool>(
"allow_skip_last_collection");
31 bar_length_y_ = ps.
get<
double>(
32 "horizontal_bar_length");
37 ldmx_log(info) <<
"In TrigScintTrackProducer: configure done!" << std::endl;
38 ldmx_log(info) <<
"Got parameters: \nSeeding: " << seeding_collection_
39 <<
"\nTolerance: " << max_delta_
40 <<
"\nInput: " << input_collections_.at(0) <<
" and "
41 << input_collections_.at(1)
42 <<
"\nInput pass name: " << pass_name_
43 <<
"\nAllow tracks with no hit in last collection: "
45 <<
"\nVertical bar start index: " << vert_bar_start_idx_
46 <<
"\nNumber of horizontal bars: " << n_bars_y_
47 <<
"\nHorizontal bar width: " << bar_width_y_
48 <<
"\nHorizontal bar gap: " << bar_gap_y_
49 <<
"\nNumber of vertical bars: " << n_bars_x_
50 <<
"\nVertical bar width: " << bar_width_x_
51 <<
"\nVertical bar gap: " << bar_gap_x_
52 <<
"\nOutput: " << output_collection_
53 <<
"\nVerbosity: " << verbose_;
56 y_conv_factor_ = (bar_width_y_ + bar_gap_y_) / 2.;
58 y_start_ = -(n_bars_y_ * (bar_width_y_ + bar_gap_y_) - bar_gap_y_) / 2.;
60 x_conv_factor_ = bar_width_x_ + bar_gap_x_;
62 x_start_ = -(n_bars_x_ * (bar_width_x_ + bar_gap_x_) - bar_gap_x_) / 2.;
77 <<
"TrigScintTrackProducer: produce() starts! Event number: "
78 <<
event.getEventHeader().getEventNumber();
80 if (!event.
exists(seeding_collection_, pass_name_)) {
81 ldmx_log(info) <<
"No collection called " << seeding_collection_
82 <<
"; skipping event";
87 if (!event.
exists(seeding_collection_, pass_name_)) {
88 ldmx_log(info) <<
"No collection called " << seeding_collection_
89 <<
"; skipping event";
93 seeding_collection_, pass_name_)};
94 uint num_seeds = seeds.size();
97 ldmx_log(debug) <<
"Got track seeding cluster collection "
98 << seeding_collection_ <<
" with " << num_seeds
102 if (!event.
exists(input_collections_.at(0), pass_name_)) {
103 ldmx_log(info) <<
"No collection called " << input_collections_.at(0)
104 <<
"; skipping event";
110 input_collections_.at(0), pass_name_)};
112 if (!event.
exists(input_collections_.at(1), pass_name_)) {
113 ldmx_log(info) <<
"No collection called "
114 << input_collections_.at(1)
116 <<
"; skipping event";
117 std::vector<ldmx::TrigScintTrack> empty{};
118 event.add(output_collection_, empty);
123 input_collections_.at(1), pass_name_)};
126 ldmx_log(debug) <<
"Got the other two pad collections:"
127 << input_collections_.at(0) <<
" with "
128 << clusters_pad1.size() <<
" entries, and "
129 << input_collections_.at(1) <<
" with "
130 << clusters_pad2.size() <<
" entries.";
132 std::vector<ldmx::TrigScintTrack> cleaned_tracks;
133 std::vector<ldmx::TrigScintTrack> cleaned_tracks_y;
134 std::vector<ldmx::TrigScintTrack> cleaned_tracks_x;
139 if (num_seeds && clusters_pad1.size()) {
144 for (
const auto& seed : seeds) {
147 float centroid = seed.getCentroid();
149 std::vector<ldmx::TrigScintTrack> track_candidates;
152 ldmx_log(debug) <<
"Got seed with centroid " << centroid;
158 for (
const auto& cluster1 : clusters_pad1) {
160 ldmx_log(debug) <<
"\tGot pad1 cluster with centroid "
161 << cluster1.getCentroid();
163 if ((fabs(cluster1.getCentroid() - centroid) < max_delta_ &&
164 centroid < vert_bar_start_idx_) ||
165 (centroid >= vert_bar_start_idx_ &&
166 cluster1.getCentroid() >= vert_bar_start_idx_ &&
167 seed.getCentroidX() == cluster1.getCentroidX())) {
171 if (centroid >= vert_bar_start_idx_ &&
172 seed.getCentroidY() < cluster1.getCentroidY()) {
175 ldmx_log(debug) <<
"\tSkipping impossible x cluster combination "
176 "with y flags (tag up) ("
177 << seed.getCentroidY() <<
" "
178 << cluster1.getCentroidY() <<
")";
186 ldmx_log(debug) <<
"\t\tIt is close enough!. Check pad2";
191 std::vector<ldmx::TrigScintCluster> cluster_vec = {seed, cluster1};
193 bool has_match_dn =
false;
195 for (
const auto& cluster2 : clusters_pad2) {
197 ldmx_log(debug) <<
"\tGot pad2 cluster with centroid "
198 << cluster2.getCentroid();
201 if ((fabs(cluster2.getCentroid() - centroid) < max_delta_ &&
202 centroid < vert_bar_start_idx_) ||
203 (centroid >= vert_bar_start_idx_ &&
204 cluster2.getCentroid() >= vert_bar_start_idx_ &&
205 fabs(seed.getCentroidX() - cluster2.getCentroidX()) <=
210 if (centroid >= vert_bar_start_idx_ &&
211 (seed.getCentroidY() < cluster2.getCentroidY() ||
212 cluster1.getCentroidY() >
213 cluster2.getCentroidY())) {
216 <<
"\tSkipping impossible x cluster combination with y "
217 "flags (tag up dn) ("
218 << seed.getCentroidY() <<
" " << cluster1.getCentroidY()
219 <<
" " << cluster2.getCentroidY() <<
")";
227 ldmx_log(debug) <<
"\t\tIt is close enough!. Make a track";
232 std::vector<ldmx::TrigScintCluster> three_cluster_vec = {
233 seed, cluster1, cluster2};
242 track_candidates.push_back(track);
248 if (!has_match_dn && skip_last_) {
251 track_candidates.push_back(track);
264 if (track_candidates.size() == 0)
continue;
267 float min_residual = 1000;
270 if (track_candidates.size() > 1) {
274 ldmx_log(debug) <<
"Got " << track_candidates.size()
275 <<
" tracks to check.";
278 for (uint idx = 0; idx < track_candidates.size(); idx++) {
279 if ((track_candidates.at(idx)).getResidual() < min_residual) {
282 (track_candidates.at(idx)).getResidual();
286 <<
"Track at index " << idx
287 <<
" has smallest residual so far: " << min_residual;
297 tracks_.push_back(track_candidates.at(keep_idx));
299 ldmx_log(debug) <<
"Kept track at index " << keep_idx;
300 ldmx_log(trace) << track_candidates.at(keep_idx);
306 if (tracks_.size() == 0) {
308 ldmx_log(debug) <<
"No tracks found!";
310 std::vector<ldmx::TrigScintTrack> empty{};
311 event.add(output_collection_, empty);
322 std::vector keep_indices(tracks_.size(), 1);
324 ldmx_log(debug) <<
"vector of indices to keep has size "
325 << keep_indices.size();
327 for (uint idx = tracks_.size() - 1; idx > 0; idx--) {
331 for (
int idx_comp = idx - 1; idx_comp >= 0; idx_comp--) {
333 ldmx_log(debug) <<
"In track disambiguation loop, idx points at "
334 << idx <<
" and prev idx points at " << idx_comp;
343 vert_bar_start_idx_))
345 2 * max_delta_vert_) &&
350 std::vector<ldmx::TrigScintCluster> consts_1 =
352 std::vector<ldmx::TrigScintCluster> consts_2 =
356 <<
"In track disambiguation loop, got the two tracks, "
357 "with nConstituents "
358 << consts_1.size() <<
" and " << consts_2.size()
359 <<
", respectively. ";
362 if (((consts_1[1].getCentroid() == consts_2[1].getCentroid() ||
363 ((consts_1.size() > 2) && (consts_2.size() > 2) &&
364 (consts_1[2].getCentroid() == consts_2[2].getCentroid()))) &&
368 ((consts_1[1].getCentroidX() == consts_2[1].getCentroidX()) ||
369 (consts_1[2].getCentroidX() == consts_2[2].getCentroidX()) ||
370 (consts_1[0].getCentroidX() ==
371 consts_2[0].getCentroidX())))) {
374 ldmx_log(debug) <<
"Found overlap! Tracks at index " << idx
375 <<
" and " << idx_comp;
376 ldmx_log(trace) << tracks_.at(idx);
377 ldmx_log(trace) << tracks_.at(idx_comp);
380 if (((fabs((tracks_.at(idx)).getResidualX() -
381 (tracks_.at(idx_comp)).getResidualX())) <
385 vert_bar_start_idx_)) {
387 }
else if (((tracks_.at(idx)).getResidual() <
388 (tracks_.at(idx_comp)).getResidual() &&
390 ((tracks_.at(idx)).getResidualX() <
391 (tracks_.at(idx_comp)).getResidualX() &&
395 keep_indices.at(idx_comp) = 0;
399 keep_indices.at(idx) = 0;
417 for (uint idx = 0; idx < tracks_.size(); idx++) {
419 ldmx_log(debug) <<
"keep flag for idx " << idx <<
" is "
420 << keep_indices.at(idx);
422 if (keep_indices.at(idx)) {
424 cleaned_tracks.push_back(tracks_.at(idx));
427 ldmx_log(debug) <<
"After cleaning, keeping track at index " << idx
428 <<
": Centroid = " << (tracks_.at(idx)).getCentroid()
430 << (tracks_.at(idx)).getCentroidX()
432 << (tracks_.at(idx)).getCentroidY()
433 <<
"; track PE = " << (tracks_.at(idx)).getPE()
440 for (uint idx = 0; idx < tracks_.size(); idx++) {
441 ldmx_log(debug) <<
"Keeping track at index " << idx <<
":"
447 ldmx_log(debug) <<
"Running track x,y matching ";
450 if (cleaned_tracks.size() > 0) {
451 matchXYTracks(cleaned_tracks);
452 std::vector<ldmx::TrigScintTrack> matched_tracks =
458 for (
auto trk : matched_tracks) {
469 if (trk.getCentroid() >= vert_bar_start_idx_)
470 cleaned_tracks_x.push_back(trk);
472 cleaned_tracks_y.push_back(trk);
475 float centr = trk.getCentroid();
476 std::string coll_str = centr >= vert_bar_start_idx_ ?
"X" :
"Y";
477 coll_str = output_collection_ + coll_str;
478 ldmx_log(debug) <<
"saving track with centroid " << centr
479 <<
" to output track collection " << coll_str;
488 <<
"Not all pads had clusters; (maybe) skipping tracking attempt";
492 ldmx_log(debug) <<
"Done with tracking step. ";
495 event.add(output_collection_, cleaned_tracks);
498 event.add(output_collection_ +
"Y", cleaned_tracks_y);
499 event.add(output_collection_ +
"X", cleaned_tracks_x);
507 std::vector<ldmx::TrigScintCluster> clusters) {
514 float centroid_x = 0;
515 float centroid_y = 0;
516 float beam_efrac = 0;
518 for (uint i = 0; i < clusters.size(); i++) {
519 centroid += (clusters.at(i)).getCentroid();
520 centroid_x += (clusters.at(i)).getCentroidX();
521 centroid_y += (clusters.at(i)).getCentroidY();
523 beam_efrac += (clusters.at(i)).getBeamEfrac();
524 pe += (clusters.at(i)).getPE();
526 centroid /= clusters.size();
527 centroid_x /= clusters.size();
528 if (centroid >= vert_bar_start_idx_) {
531 <<
" -- In makeTrack made vertical bar track with centroid "
532 << centroid <<
" and y flag sum " << centroid_y;
544 centroid_y = (centroid_y + 1) * 2 * n_bars_y_ / 8.;
548 if (verbose_) ldmx_log(debug) <<
" -- new centroidY = " << centroid_y;
550 centroid_y /= clusters.size();
552 beam_efrac /= clusters.size();
553 pe /= clusters.size();
556 for (uint i = 0; i < clusters.size(); i++)
557 residual += ((clusters.at(i)).getCentroid() - centroid) *
558 ((clusters.at(i)).getCentroid() - centroid);
559 residual = sqrt(residual / clusters.size());
561 float residual_x = 0;
562 if (centroid >= vert_bar_start_idx_) {
563 for (uint i = 0; i < clusters.size(); i++)
564 residual_x += ((clusters.at(i)).getCentroidX() - centroid_x) *
565 ((clusters.at(i)).getCentroidX() - centroid_x);
566 residual_x = sqrt(residual_x / clusters.size());
578 ldmx_log(debug) <<
" -- In makeTrack made track with centroid "
579 << centroid <<
" and residual " << residual <<
" and pe "
580 << pe <<
" from clusters with centroids";
581 for (uint i = 0; i < clusters.size(); i++)
582 ldmx_log(debug) <<
"\tpad " << i <<
": centroid "
583 << (clusters.at(i)).getCentroid();
590void TrigScintTrackProducer::matchXYTracks(
591 std::vector<ldmx::TrigScintTrack>& tracks) {
593 std::multimap<int, int>
595 std::multimap<int, int> x_idx_quad_map;
597 std::multimap<int, ldmx::TrigScintTrack> y_quad_map;
598 std::multimap<int, ldmx::TrigScintTrack> x_quad_map;
601 std::map<ldmx::TrigScintTrack, int> y_track_map;
602 std::map<ldmx::TrigScintTrack, int> x_track_map;
605 for (
auto trk : tracks) {
608 if (trk.getCentroidX() == -1) {
610 ldmx_log(debug) <<
" -- In matchXYTracks found y track at "
611 << trk.getCentroidY() <<
"; mapping to quad "
612 << (int)trk.getCentroidY() / (n_bars_y_ / 2)
613 <<
" with trk index " << trk_idx;
617 std::make_pair((
int)(trk.getCentroidY() / (n_bars_y_ / 2)), trk));
618 y_track_map[trk] = trk_idx;
619 y_idx_quad_map.insert(
620 std::make_pair((
int)(trk.getCentroidY() / (n_bars_y_ / 2)), trk_idx));
625 std::make_pair((
int)(trk.getCentroidY() / (n_bars_y_ / 2)), trk));
626 x_track_map[trk] = trk_idx;
627 x_idx_quad_map.insert(
628 std::make_pair((
int)(trk.getCentroidY() / (n_bars_y_ / 2)), trk_idx));
630 ldmx_log(debug) <<
" -- In matchXYTracks found x track at (x,y) = ("
631 << trk.getCentroidX() <<
", " << trk.getCentroidY()
632 <<
"); mapping to quad "
633 << (int)trk.getCentroidY() / (n_bars_y_ / 2)
634 <<
" with trk index " << trk_idx;
649 float sx0 = fabs(x_start_);
650 float sx0_vert = fabs(bar_length_y_ / 2);
654 float sy0 = fabs(y_start_) / 4.;
658 for (
auto yitr = y_quad_map.begin(); yitr != y_quad_map.end(); ++yitr) {
659 int n_yin_quad = y_quad_map.count((*yitr).first);
660 int n_xin_quad = x_quad_map.count((*yitr).first);
661 float y{-9999.}, sy{-9999.}, x{-9999.}, x1{-9999.}, x2{-9999.}, sx1{-9999.},
662 sx2{-9999.}, y1{-9999.}, y2{-9999.}, sy1{-9999.}, sy2{-9999.};
664 float y0 = (((*yitr).first * 8) * y_conv_factor_) + y_start_ + sy0;
671 if (n_xin_quad == 0) {
676 ldmx_log(debug) <<
"\t\t\t no x info in quad " << (*yitr).first
677 <<
"; will set x to middle of pad, pad half-width as "
678 "precision: set (x, sx)=("
679 << x <<
", " << sx <<
")";
681 else if (n_xin_quad ==
686 auto xitr = x_quad_map.find((*yitr).first);
687 x = ((*xitr).second).getCentroidX() * x_conv_factor_ + x_start_;
690 ldmx_log(debug) <<
"\t\t\t 1 x in quad " << (*yitr).first
691 <<
", getting (x, sx)=(" << x <<
", " << sx <<
")";
693 else if (n_xin_quad == 2) {
698 auto xitr1 = x_quad_map.lower_bound((*yitr).first);
699 auto xitr2 = x_quad_map.upper_bound((*yitr).first);
702 if (xitr1 != xitr2) {
703 x1 = ((*xitr1).second).getCentroidX() * x_conv_factor_ + x_start_;
704 x2 = ((*xitr2).second).getCentroidX() * x_conv_factor_ + x_start_;
705 sx1 = x_conv_factor_ / 2.;
711 ldmx_log(debug) <<
"\t\t -- 2 x in quad: setting y track x "
712 "coordinate to midpoint";
716 if (n_xin_quad >= 3) {
721 <<
"\t\t\t currently no x info assigned in ambiguous case of "
722 << n_xin_quad <<
"vertical bar track candidates in quad "
724 <<
"; will set x to middle of pad, pad half-width as "
725 "precision: set (x, sx)=("
726 << x <<
", " << sx <<
")";
731 if (n_yin_quad == 1) {
733 y = ((*yitr).second).getCentroidY() * y_conv_factor_ + y_start_;
734 sy = ((*yitr).second).getResidual() * y_conv_factor_;
737 if (sy == 0) sy = 1. / 2 * y_conv_factor_;
739 if (n_xin_quad <= 1) {
743 if (n_xin_quad == 1) {
744 auto xidx = x_idx_quad_map.find((*yitr).first);
745 tracks.at((*xidx).second).setPosition(x, y);
746 tracks.at((*xidx).second).setSigmaXY(sx, sy);
749 ldmx_log(debug) <<
"\t\t\t in quad " << (*yitr).first
750 <<
", set (x, y) = (" << x <<
", " << y
751 <<
") and (sx, sy) = " << sx <<
", " << sy <<
")";
752 auto yidx = y_idx_quad_map.find((*yitr).first);
753 tracks.at((*yidx).second).setPosition(x, y);
754 tracks.at((*yidx).second).setSigmaXY(sx, sy);
760 ldmx_log(debug) <<
"\t\t in quad " << (*yitr).first
761 <<
", not single x,y tracks: " << n_xin_quad
762 <<
" of x and " << n_yin_quad <<
" of y";
764 if (n_yin_quad == 2) {
767 auto yitr1 = y_quad_map.lower_bound((*yitr).first);
768 auto yitr2 = y_quad_map.upper_bound((*yitr).first);
770 y1 = ((*yitr1).second).getCentroidY() * y_conv_factor_ + y_start_;
771 y2 = ((*yitr2).second).getCentroidY() * y_conv_factor_ + y_start_;
772 sy1 = ((*yitr1).second).getResidual() * y_conv_factor_;
773 sy2 = ((*yitr2).second).getResidual() * y_conv_factor_;
774 if (sy1 == 0) sy1 = 1. / 2 * y_conv_factor_;
775 if (sy2 == 0) sy2 = 1. / 2 * y_conv_factor_;
777 sy = fabs(y1 - y2) / 2;
780 <<
"\t\t -- 2 y in quad: setting x track y coordinate to midpoint";
783 if ((n_xin_quad == 0 || n_xin_quad >= 3) &&
785 if (n_xin_quad == 0) {
787 ldmx_log(debug) <<
"\t\t -- No x tracks but 2 y tracks in quad: "
790 auto yidx1 = y_idx_quad_map.lower_bound((*yitr).first);
791 auto yidx2 = y_idx_quad_map.upper_bound((*yitr).first);
793 tracks.at((*yidx1).second).setPosition(x, y1);
794 tracks.at((*yidx1).second).setSigmaXY(sx, sy1);
795 tracks.at((*yidx2).second).setPosition(x, y2);
796 tracks.at((*yidx2).second).setSigmaXY(sx, sy2);
800 if (n_yin_quad == 1 &&
806 auto yidx = y_idx_quad_map.find((*yitr).first);
807 tracks.at((*yidx).second).setPosition(x, y);
808 tracks.at((*yidx).second).setSigmaXY(sx, sy);
810 int min_overlap_pe = 250;
811 if (((*yitr).second).getPE() < min_overlap_pe) {
818 ldmx_log(debug) <<
"\t\t -- Can't tell which x track should be "
819 "matched to single y track. Setting both x track "
820 "coordinates to y quadrant value:";
823 ldmx_log(debug) <<
"\t\t -- Found large PE count ("
824 << ((*yitr).second).getPE() <<
" > " << min_overlap_pe
825 <<
"), suggesting overlap! Setting both x track "
826 "coordinates to y track value:";
833 ldmx_log(debug) <<
"\t\t -- (x1, x2, y) = (" << x1 <<
", " << x2
834 <<
", " << y <<
") and (sx1, sx2, sy) = " << sx1 <<
", "
835 << sx2 <<
", " << sy <<
")";
838 auto xidx1 = x_idx_quad_map.lower_bound((*yitr).first);
839 auto xidx2 = x_idx_quad_map.upper_bound((*yitr).first);
841 tracks.at((*xidx1).second).setPosition(x1, y);
842 tracks.at((*xidx1).second).setSigmaXY(sx1, sy);
843 tracks.at((*xidx2).second).setPosition(x2, y);
844 tracks.at((*xidx2).second).setSigmaXY(sx2, sy);
847 else if (n_yin_quad == 2 && n_xin_quad == 1) {
852 auto xidx = x_idx_quad_map.find((*yitr).first);
853 tracks.at((*xidx).second).setPosition(x, y);
854 tracks.at((*xidx).second).setSigmaXY(sx, sy);
856 auto xitr = x_quad_map.lower_bound((*yitr).first);
857 int min_overlap_pe = 300;
858 if (((*xitr).second).getPE() < min_overlap_pe) {
861 <<
"\t\t just 1 x track with not-unusual PE in the quad -- can't "
862 "match; setting mid-point values for x ";
872 ldmx_log(debug) <<
"\t\t -- Found large PE count ("
873 << ((*xitr).second).getPE() <<
" > " << min_overlap_pe
874 <<
") in x track, suggesting overlap! Setting both y "
875 "track coordinates to x track value:";
878 ldmx_log(debug) <<
"\t\t -- (x, y1, y2) = (" << x <<
", " << y1 <<
", "
879 << y2 <<
") and (sx, sy1, sy2) = " << sx <<
", " << sy1
880 <<
", " << sy2 <<
")";
882 auto yidx1 = y_idx_quad_map.lower_bound((*yitr).first);
883 auto yidx2 = y_idx_quad_map.upper_bound((*yitr).first);
885 tracks.at((*yidx1).second).setPosition(x, y1);
886 tracks.at((*yidx1).second).setSigmaXY(sx, sy1);
887 tracks.at((*yidx2).second).setPosition(x, y2);
888 tracks.at((*yidx2).second).setSigmaXY(sx, sy2);
891 else if (n_yin_quad == 2 && n_xin_quad == 2) {
893 auto xidx1 = x_idx_quad_map.lower_bound((*yitr).first);
894 auto xidx2 = x_idx_quad_map.upper_bound((*yitr).first);
896 auto yidx1 = y_idx_quad_map.lower_bound((*yitr).first);
897 auto yidx2 = y_idx_quad_map.upper_bound((*yitr).first);
900 if (y_idx_quad_map.find((*yitr).first) == y_idx_quad_map.end())
901 ldmx_log(error) <<
"The two y tracks in the same quadrant at "
903 <<
" appear to not be found in the y track map! "
904 "investigate. Note that yidx1.first = "
906 <<
" and yidx2.first = " << (*yidx2).first;
908 tracks.at((*xidx1).second).setPosition(x1, y);
909 tracks.at((*xidx1).second).setSigmaXY(sx1, sy);
910 tracks.at((*xidx2).second).setPosition(x2, y);
911 tracks.at((*xidx2).second).setSigmaXY(sx2, sy);
913 tracks.at((*yidx1).second).setPosition(x, y1);
914 tracks.at((*yidx1).second).setSigmaXY(sx, sy1);
915 tracks.at((*yidx2).second).setPosition(x, y2);
916 tracks.at((*yidx2).second).setSigmaXY(sx, sy2);
919 ldmx_log(debug) <<
"\t\t -- in a 2 x 2 situaiton; midpoint y: " << y
920 <<
" for both x tracks, midpoint x: " << x
921 <<
" for both y tracks";
925 if (n_xin_quad > 2) {
927 ldmx_log(debug) <<
"\t\t -*-*-*- more than 2 x tracks in the same quad "
928 "-- nothing done about the x,y coordinates in this "
929 "situation -- implement if needed!!";
931 if (n_yin_quad > 2) {
933 ldmx_log(debug) <<
"\t\t -*-*-*- more than 2 y tracks in the same quad "
934 "-- nothing done about the x,y coordinates in this "
935 "situation -- implement if needed!!";
947 ldmx_log(debug) <<
"Process starts!";
953 ldmx_log(debug) <<
"Process ends!";
#define DECLARE_PRODUCER(CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
Implements an event buffer system for storing event data.
bool exists(const std::string &name, const std::string &passName, bool unique=true) const
Check for the existence of an object or collection with the given name and pass name in the event.
Class encapsulating parameters for configuring a processor.
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Stores cluster information from the trigger scintillator pads.
Represents a track of trigger scintillator clusters.
void setCentroidX(float centroid)
Set the x centroid of the track.
void setResidual(float resid)
Set the detector ID residual of the track.
float getCentroidX() const
Get the x centroid of the track.
void setCentroidY(float centroid)
Set the y centroid of the track.
void setPE(float pe)
Set the average cluster pe of the track.
float getCentroid() const
Get the detector ID centroid of the track.
void addConstituent(TrigScintCluster cl)
Add a cluster to the list of track constituents.
void setCentroid(float centroid)
Set the detector ID centroid of the track.
void setBeamEfrac(float e)
Set beam energy fraction of hit.
std::vector< ldmx::TrigScintCluster > getConstituents() const
Get the cluster constituents of the track.
void setResidualX(float resid)
Set the x residual of the track.
float getCentroidY() const
Get the y centroid of the track.
making tracks from trigger scintillator clusters
void configure(framework::config::Parameters &ps) override
Callback for the EventProcessor to configure itself from the given set of parameters.
void onProcessEnd() override
Callback for the EventProcessor to take any necessary action when the processing of events finishes,...
void produce(framework::Event &event) override
Process the event and put new data products into it.
void onProcessStart() override
Callback for the EventProcessor to take any necessary action when the processing of events starts,...