1#include "TrigScint/TrigScintTrackProducer.h"
10 max_delta_ = ps.
get<
double>(
12 max_delta_vert= ps.
get<
double>(
"delta_vert_max");
14 seeding_collection_ = ps.
get<std::string>(
15 "seeding_collection");
16 input_collections_ = ps.
get<std::vector<std::string>>(
17 "further_input_collections");
19 output_collection_ = ps.
get<std::string>(
"output_collection");
20 pass_name_ = ps.
get<std::string>(
"input_pass_name");
21 verbose_ = ps.
get<
int>(
"verbosity");
22 vert_bar_start_idx_ = ps.
get<
int>(
"vertical_bar_start_index");
23 n_bars_y_ = ps.
get<
int>(
"number_horizontal_bars");
24 bar_width_y_ = ps.
get<
double>(
"horizontal_bar_width");
25 bar_gap_y_ = ps.
get<
double>(
"horizontal_bar_gap");
26 n_bars_x_ = ps.
get<
int>(
"number_vertical_bars");
27 bar_width_x_ = ps.
get<
double>(
"vertical_bar_width");
28 bar_gap_x_ = ps.
get<
double>(
"vertical_bar_gap");
29 skip_last_ = ps.
get<
bool>(
"allow_skip_last_collection");
30 bar_length_y_=ps.
get<
double>(
"horizontal_bar_length");
35 ldmx_log(info) <<
"In TrigScintTrackProducer: configure done!" << std::endl;
36 ldmx_log(info) <<
"Got parameters: \nSeeding: " << seeding_collection_
37 <<
"\nTolerance: " << max_delta_
38 <<
"\nInput: " << input_collections_.at(0) <<
" and "
39 << input_collections_.at(1)
40 <<
"\nInput pass name: " << pass_name_
41 <<
"\nAllow tracks with no hit in last collection: "
43 <<
"\nVertical bar start index: " << vert_bar_start_idx_
44 <<
"\nNumber of horizontal bars: " << n_bars_y_
45 <<
"\nHorizontal bar width: " << bar_width_y_
46 <<
"\nHorizontal bar gap: " << bar_gap_y_
47 <<
"\nNumber of vertical bars: " << n_bars_x_
48 <<
"\nVertical bar width: " << bar_width_x_
49 <<
"\nVertical bar gap: " << bar_gap_x_
50 <<
"\nOutput: " << output_collection_
51 <<
"\nVerbosity: " << verbose_;
54 y_conv_factor_ = (bar_width_y_ + bar_gap_y_) / 2.;
56 y_start_ = -(n_bars_y_ * (bar_width_y_ + bar_gap_y_) - bar_gap_y_) / 2.;
58 x_conv_factor_ = bar_width_x_ + bar_gap_x_;
60 x_start_ = -(n_bars_x_ * (bar_width_x_ + bar_gap_x_) - bar_gap_x_) / 2.;
75 <<
"TrigScintTrackProducer: produce() starts! Event number: "
76 <<
event.getEventHeader().getEventNumber();
78 if (!event.
exists(seeding_collection_, pass_name_)) {
79 ldmx_log(info) <<
"No collection called " << seeding_collection_
80 <<
"; skipping event";
85 if (!event.
exists(seeding_collection_, pass_name_)) {
86 ldmx_log(info) <<
"No collection called " << seeding_collection_
87 <<
"; skipping event";
91 seeding_collection_, pass_name_)};
92 uint num_seeds = seeds.size();
95 ldmx_log(debug) <<
"Got track seeding cluster collection "
96 << seeding_collection_ <<
" with " << num_seeds
100 if (!event.
exists(input_collections_.at(0), pass_name_)) {
101 ldmx_log(info) <<
"No collection called " << input_collections_.at(0)
102 <<
"; skipping event";
108 input_collections_.at(0), pass_name_)};
110 if (!event.
exists(input_collections_.at(1), pass_name_)) {
111 ldmx_log(info) <<
"No collection called "
112 << input_collections_.at(1)
114 <<
"; skipping event";
115 std::vector<ldmx::TrigScintTrack> empty{};
116 event.add(output_collection_, empty);
121 input_collections_.at(1), pass_name_)};
124 ldmx_log(debug) <<
"Got the other two pad collections:"
125 << input_collections_.at(0) <<
" with "
126 << clusters_pad1.size() <<
" entries, and "
127 << input_collections_.at(1) <<
" with "
128 << clusters_pad2.size() <<
" entries.";
130 std::vector<ldmx::TrigScintTrack> cleaned_tracks;
131 std::vector<ldmx::TrigScintTrack> cleaned_tracks_y;
132 std::vector<ldmx::TrigScintTrack> cleaned_tracks_x;
137 if (num_seeds && clusters_pad1.size()) {
142 for (
const auto &seed : seeds) {
145 float centroid = seed.getCentroid();
147 std::vector<ldmx::TrigScintTrack> track_candidates;
150 ldmx_log(debug) <<
"Got seed with centroid " << centroid;
156 for (
const auto &cluster1 : clusters_pad1) {
158 ldmx_log(debug) <<
"\tGot pad1 cluster with centroid "
159 << cluster1.getCentroid();
161 if ((fabs(cluster1.getCentroid() - centroid) < max_delta_ &&
162 centroid < vert_bar_start_idx_) ||
163 (centroid >= vert_bar_start_idx_ && cluster1.getCentroid() >= vert_bar_start_idx_ &&
164 seed.getCentroidX() == cluster1.getCentroidX())) {
168 if (centroid >= vert_bar_start_idx_ &&
169 seed.getCentroidY() < cluster1.getCentroidY()) {
172 ldmx_log(debug) <<
"\tSkipping impossible x cluster combination "
173 "with y flags (tag up) ("
174 << seed.getCentroidY() <<
" "
175 << cluster1.getCentroidY() <<
")";
183 ldmx_log(debug) <<
"\t\tIt is close enough!. Check pad2";
188 std::vector<ldmx::TrigScintCluster> cluster_vec = {seed, cluster1};
190 bool has_match_dn =
false;
192 for (
const auto &cluster2 : clusters_pad2) {
194 ldmx_log(debug) <<
"\tGot pad2 cluster with centroid "
195 << cluster2.getCentroid();
198 if ((fabs(cluster2.getCentroid() - centroid) < max_delta_ &&
199 centroid < vert_bar_start_idx_) ||
200 (centroid >= vert_bar_start_idx_ && cluster2.getCentroid() >= vert_bar_start_idx_ &&
201 fabs(seed.getCentroidX() - cluster2.getCentroidX()) <= max_delta_vert)) {
205 if (centroid >= vert_bar_start_idx_ &&
206 (seed.getCentroidY() < cluster2.getCentroidY() ||
207 cluster1.getCentroidY() >
208 cluster2.getCentroidY())) {
211 <<
"\tSkipping impossible x cluster combination with y "
212 "flags (tag up dn) ("
213 << seed.getCentroidY() <<
" " << cluster1.getCentroidY()
214 <<
" " << cluster2.getCentroidY() <<
")";
222 ldmx_log(debug) <<
"\t\tIt is close enough!. Make a track";
227 std::vector<ldmx::TrigScintCluster> three_cluster_vec = {
228 seed, cluster1, cluster2};
237 track_candidates.push_back(track);
243 if (!has_match_dn && skip_last_) {
246 track_candidates.push_back(track);
259 if (track_candidates.size() == 0)
continue;
262 float min_residual = 1000;
265 if (track_candidates.size() > 1) {
269 ldmx_log(debug) <<
"Got " << track_candidates.size()
270 <<
" tracks to check.";
273 for (uint idx = 0; idx < track_candidates.size(); idx++) {
274 if ((track_candidates.at(idx)).getResidual() < min_residual) {
277 (track_candidates.at(idx)).getResidual();
281 <<
"Track at index " << idx
282 <<
" has smallest residual so far: " << min_residual;
292 tracks_.push_back(track_candidates.at(keep_idx));
294 ldmx_log(debug) <<
"Kept track at index " << keep_idx;
295 ldmx_log(trace) << track_candidates.at(keep_idx);
301 if (tracks_.size() == 0) {
303 ldmx_log(debug) <<
"No tracks found!";
305 std::vector<ldmx::TrigScintTrack> empty{};
306 event.add(output_collection_, empty);
317 std::vector keep_indices(tracks_.size(), 1);
319 ldmx_log(debug) <<
"vector of indices to keep has size "
320 << keep_indices.size();
322 for (uint idx = tracks_.size() - 1; idx > 0; idx--) {
326 for (
int idx_comp = idx - 1; idx_comp >= 0; idx_comp--) {
328 ldmx_log(debug) <<
"In track disambiguation loop, idx points at "
329 << idx <<
" and prev idx points at " << idx_comp;
336 3 * max_delta_) && (track.
getCentroid()<vert_bar_start_idx_))
340 std::vector<ldmx::TrigScintCluster> consts_1 =
342 std::vector<ldmx::TrigScintCluster> consts_2 =
346 <<
"In track disambiguation loop, got the two tracks, "
347 "with nConstituents "
348 << consts_1.size() <<
" and " << consts_2.size()
349 <<
", respectively. ";
352 if (((consts_1[1].getCentroid() == consts_2[1].getCentroid() ||
353 ((consts_1.size() > 2) && (consts_2.size() > 2) &&
354 (consts_1[2].getCentroid() == consts_2[2].getCentroid()))) && (track.
getCentroid()<vert_bar_start_idx_)) ||
356 ((track.
getCentroid()>=vert_bar_start_idx_) && ((consts_1[1].getCentroidX() == consts_2[1].getCentroidX()) ||
357 (consts_1[2].getCentroidX() == consts_2[2].getCentroidX())
358 || (consts_1[0].getCentroidX() == consts_2[0].getCentroidX())))) {
361 ldmx_log(debug) <<
"Found overlap! Tracks at index " << idx
362 <<
" and " << idx_comp;
363 ldmx_log(trace) << tracks_.at(idx);
364 ldmx_log(trace) << tracks_.at(idx_comp);
367 if (((fabs((tracks_.at(idx)).getResidualX() -(tracks_.at(idx_comp)).getResidualX()))< 0.01)
370 }
else if (((tracks_.at(idx)).getResidual() <(tracks_.at(idx_comp)).getResidual() && (track.
getCentroid()<vert_bar_start_idx_)) ||
371 ((tracks_.at(idx)).getResidualX() <(tracks_.at(idx_comp)).getResidualX() && (track.
getCentroid()>=vert_bar_start_idx_))) {
374 keep_indices.at(idx_comp) = 0;
378 keep_indices.at(idx) = 0;
396 for (uint idx = 0; idx < tracks_.size(); idx++) {
398 ldmx_log(debug) <<
"keep flag for idx " << idx <<
" is "
399 << keep_indices.at(idx);
401 if (keep_indices.at(idx)) {
403 cleaned_tracks.push_back(tracks_.at(idx));
406 ldmx_log(debug) <<
"After cleaning, keeping track at index " << idx
407 <<
": Centroid = " << (tracks_.at(idx)).getCentroid()
409 << (tracks_.at(idx)).getCentroidX()
411 << (tracks_.at(idx)).getCentroidY()
412 <<
"; track PE = " << (tracks_.at(idx)).getPE()
419 for (uint idx = 0; idx < tracks_.size(); idx++) {
420 ldmx_log(debug) <<
"Keeping track at index " << idx <<
":"
426 ldmx_log(debug) <<
"Running track x,y matching ";
429 if (cleaned_tracks.size() > 0) {
430 matchXYTracks(cleaned_tracks);
431 std::vector<ldmx::TrigScintTrack> matched_tracks =
437 for (
auto trk : matched_tracks) {
448 if (trk.getCentroid() >= vert_bar_start_idx_)
449 cleaned_tracks_x.push_back(trk);
451 cleaned_tracks_y.push_back(trk);
454 float centr = trk.getCentroid();
455 std::string coll_str = centr >= vert_bar_start_idx_ ?
"X" :
"Y";
456 coll_str = output_collection_ + coll_str;
457 ldmx_log(debug) <<
"saving track with centroid " << centr
458 <<
" to output track collection " << coll_str;
467 <<
"Not all pads had clusters; (maybe) skipping tracking attempt";
471 ldmx_log(debug) <<
"Done with tracking step. ";
474 event.add(output_collection_, cleaned_tracks);
477 event.add(output_collection_ +
"Y", cleaned_tracks_y);
478 event.add(output_collection_ +
"X", cleaned_tracks_x);
486 std::vector<ldmx::TrigScintCluster> clusters) {
493 float centroid_x = 0;
494 float centroid_y = 0;
495 float beam_efrac = 0;
497 for (uint i = 0; i < clusters.size(); i++) {
498 centroid += (clusters.at(i)).getCentroid();
499 centroid_x += (clusters.at(i)).getCentroidX();
500 centroid_y += (clusters.at(i)).getCentroidY();
502 beam_efrac += (clusters.at(i)).getBeamEfrac();
503 pe += (clusters.at(i)).getPE();
505 centroid /= clusters.size();
506 centroid_x /= clusters.size();
507 if (centroid >= vert_bar_start_idx_) {
510 <<
" -- In makeTrack made vertical bar track with centroid "
511 << centroid <<
" and y flag sum " << centroid_y;
523 centroid_y = (centroid_y + 1) * 2 * n_bars_y_ / 8.;
527 if (verbose_) ldmx_log(debug) <<
" -- new centroidY = " << centroid_y;
529 centroid_y /= clusters.size();
531 beam_efrac /= clusters.size();
532 pe /= clusters.size();
535 for (uint i = 0; i < clusters.size(); i++)
536 residual += ((clusters.at(i)).getCentroid() - centroid) *
537 ((clusters.at(i)).getCentroid() - centroid);
538 residual = sqrt(residual / clusters.size());
541 float residual_x = 0;
542 if (centroid>=vert_bar_start_idx_) {
543 for (uint i = 0; i < clusters.size(); i++)
544 residual_x += ((clusters.at(i)).getCentroidX() - centroid_x) *
545 ((clusters.at(i)).getCentroidX() - centroid_x);
546 residual_x = sqrt(residual_x / clusters.size());
559 ldmx_log(debug) <<
" -- In makeTrack made track with centroid "
560 << centroid <<
" and residual " << residual <<
" and pe "
561 << pe <<
" from clusters with centroids";
562 for (uint i = 0; i < clusters.size(); i++)
563 ldmx_log(debug) <<
"\tpad " << i <<
": centroid "
564 << (clusters.at(i)).getCentroid();
571void TrigScintTrackProducer::matchXYTracks(
572 std::vector<ldmx::TrigScintTrack> &tracks) {
574 std::multimap<int, int>
576 std::multimap<int, int> x_idx_quad_map;
578 std::multimap<int, ldmx::TrigScintTrack> y_quad_map;
579 std::multimap<int, ldmx::TrigScintTrack> x_quad_map;
582 std::map<ldmx::TrigScintTrack, int> y_track_map;
583 std::map<ldmx::TrigScintTrack, int> x_track_map;
586 for (
auto trk : tracks) {
589 if (trk.getCentroidX() == -1) {
591 ldmx_log(debug) <<
" -- In matchXYTracks found y track at "
592 << trk.getCentroidY() <<
"; mapping to quad "
593 << (int)trk.getCentroidY() / (n_bars_y_/2) <<
" with trk index "
597 y_quad_map.insert(std::make_pair((
int)(trk.getCentroidY() / (n_bars_y_/2)), trk));
598 y_track_map[trk] = trk_idx;
599 y_idx_quad_map.insert(
600 std::make_pair((
int)(trk.getCentroidY() / (n_bars_y_/2)), trk_idx));
604 x_quad_map.insert(std::make_pair((
int)(trk.getCentroidY() / (n_bars_y_/2)), trk));
605 x_track_map[trk] = trk_idx;
606 x_idx_quad_map.insert(
607 std::make_pair((
int)(trk.getCentroidY() / (n_bars_y_/2)), trk_idx));
609 ldmx_log(debug) <<
" -- In matchXYTracks found x track at (x,y) = ("
610 << trk.getCentroidX() <<
", " << trk.getCentroidY()
611 <<
"); mapping to quad " << (int)trk.getCentroidY() / (n_bars_y_/2)
612 <<
" with trk index " << trk_idx;
627 float sx0 = fabs(x_start_);
628 float sx0_vert=fabs(bar_length_y_/2);
632 float sy0 = fabs(y_start_) / 4.;
636 for (
auto yitr = y_quad_map.begin(); yitr != y_quad_map.end(); ++yitr) {
637 int n_yin_quad = y_quad_map.count((*yitr).first);
638 int n_xin_quad = x_quad_map.count((*yitr).first);
639 float y{-9999.}, sy{-9999.}, x{-9999.}, x1{-9999.}, x2{-9999.}, sx1{-9999.},
640 sx2{-9999.}, y1{-9999.}, y2{-9999.}, sy1{-9999.}, sy2{-9999.};
642 float y0 = (((*yitr).first * 8)*y_conv_factor_ )+y_start_+ sy0;
649 if (n_xin_quad == 0) {
654 ldmx_log(debug) <<
"\t\t\t no x info in quad " << (*yitr).first
655 <<
"; will set x to middle of pad, pad half-width as "
656 "precision: set (x, sx)=("
657 << x <<
", " << sx <<
")";
659 else if (n_xin_quad ==
664 auto xitr = x_quad_map.find((*yitr).first);
665 x = ((*xitr).second).getCentroidX() * x_conv_factor_ + x_start_;
668 ldmx_log(debug) <<
"\t\t\t 1 x in quad " << (*yitr).first
669 <<
", getting (x, sx)=(" << x <<
", " << sx <<
")";
671 else if (n_xin_quad == 2) {
676 auto xitr1 = x_quad_map.lower_bound((*yitr).first);
677 auto xitr2 = x_quad_map.upper_bound((*yitr).first);
680 if (xitr1 != xitr2) {
681 x1 = ((*xitr1).second).getCentroidX() * x_conv_factor_ + x_start_;
682 x2 = ((*xitr2).second).getCentroidX() * x_conv_factor_ + x_start_;
683 sx1 = x_conv_factor_ / 2.;
686 sx = fabs(x1 - x2) / 2;
688 ldmx_log(debug) <<
"\t\t -- 2 x in quad: setting y track x "
689 "coordinate to midpoint";
693 if (n_xin_quad >= 3) {
697 ldmx_log(debug) <<
"\t\t\t currently no x info assigned in ambiguous case of "
699 <<
"vertical bar track candidates in quad " << (*yitr).first
700 <<
"; will set x to middle of pad, pad half-width as "
701 "precision: set (x, sx)=("
702 << x <<
", " << sx <<
")";
707 if (n_yin_quad == 1) {
709 y = ((*yitr).second).getCentroidY() * y_conv_factor_ + y_start_;
710 sy = ((*yitr).second).getResidual() * y_conv_factor_;
713 if (sy == 0) sy = 1. / 2 * y_conv_factor_;
715 if (n_xin_quad <= 1) {
720 auto xidx = x_idx_quad_map.find((*yitr).first);
721 tracks.at((*xidx).second).setPosition(x, y);
722 tracks.at((*xidx).second).setSigmaXY(sx, sy);
725 ldmx_log(debug) <<
"\t\t\t in quad " << (*yitr).first
726 <<
", set (x, y) = (" << x <<
", " << y
727 <<
") and (sx, sy) = " << sx <<
", " << sy <<
")";
728 auto yidx = y_idx_quad_map.find((*yitr).first);
729 tracks.at((*yidx).second).setPosition(x, y);
730 tracks.at((*yidx).second).setSigmaXY(sx, sy);
736 ldmx_log(debug) <<
"\t\t in quad " << (*yitr).first
737 <<
", not single x,y tracks: " << n_xin_quad
738 <<
" of x and " << n_yin_quad <<
" of y";
740 if (n_yin_quad == 2) {
743 auto yitr1 = y_quad_map.lower_bound((*yitr).first);
744 auto yitr2 = y_quad_map.upper_bound((*yitr).first);
746 y1 = ((*yitr1).second).getCentroidY() * y_conv_factor_ + y_start_;
747 y2 = ((*yitr2).second).getCentroidY() * y_conv_factor_ + y_start_;
748 sy1 = ((*yitr1).second).getResidual() * y_conv_factor_;
749 sy2 = ((*yitr2).second).getResidual() * y_conv_factor_;
750 if (sy1 == 0) sy1 = 1. / 2 * y_conv_factor_;
751 if (sy2 == 0) sy2 = 1. / 2 * y_conv_factor_;
753 sy = fabs(y1 - y2) / 2 ;
756 <<
"\t\t -- 2 y in quad: setting x track y coordinate to midpoint";
759 if ((n_xin_quad == 0 || n_xin_quad >= 3) && (n_yin_quad == 2)) {
760 if (n_xin_quad == 0){
763 <<
"\t\t -- No x tracks but 2 y tracks in quad: unusual behaviour";
765 auto yidx1 = y_idx_quad_map.lower_bound((*yitr).first);
766 auto yidx2 = y_idx_quad_map.upper_bound((*yitr).first);
768 tracks.at((*yidx1).second).setPosition(x, y1);
769 tracks.at((*yidx1).second).setSigmaXY(sx, sy1);
770 tracks.at((*yidx2).second).setPosition(x, y2);
771 tracks.at((*yidx2).second).setSigmaXY(sx, sy2);
775 if (n_yin_quad == 1 &&
781 auto yidx = y_idx_quad_map.find((*yitr).first);
782 tracks.at((*yidx).second).setPosition(x, y);
783 tracks.at((*yidx).second).setSigmaXY(sx, sy);
785 int min_overlap_pe = 250;
786 if (((*yitr).second).getPE() < min_overlap_pe) {
793 ldmx_log(debug) <<
"\t\t -- Can't tell which x track should be "
794 "matched to single y track. Setting both x track "
795 "coordinates to y quadrant value:";
798 ldmx_log(debug) <<
"\t\t -- Found large PE count ("
799 << ((*yitr).second).getPE() <<
" > " << min_overlap_pe
800 <<
"), suggesting overlap! Setting both x track "
801 "coordinates to y track value:";
808 ldmx_log(debug) <<
"\t\t -- (x1, x2, y) = (" << x1 <<
", " << x2
809 <<
", " << y <<
") and (sx1, sx2, sy) = " << sx1 <<
", "
810 << sx2 <<
", " << sy <<
")";
813 auto xidx1 = x_idx_quad_map.lower_bound((*yitr).first);
814 auto xidx2 = x_idx_quad_map.upper_bound((*yitr).first);
816 tracks.at((*xidx1).second).setPosition(x1, y);
817 tracks.at((*xidx1).second).setSigmaXY(sx1, sy);
818 tracks.at((*xidx2).second).setPosition(x2, y);
819 tracks.at((*xidx2).second).setSigmaXY(sx2, sy);
822 else if (n_yin_quad == 2 && n_xin_quad == 1) {
827 auto xidx = x_idx_quad_map.find((*yitr).first);
828 tracks.at((*xidx).second).setPosition(x, y);
829 tracks.at((*xidx).second).setSigmaXY(sx, sy);
831 auto xitr = x_quad_map.lower_bound((*yitr).first);
832 int min_overlap_pe = 300;
833 if (((*xitr).second).getPE() < min_overlap_pe) {
836 <<
"\t\t just 1 x track with not-unusual PE in the quad -- can't "
837 "match; setting mid-point values for x ";
847 ldmx_log(debug) <<
"\t\t -- Found large PE count ("
848 << ((*xitr).second).getPE() <<
" > " << min_overlap_pe
849 <<
") in x track, suggesting overlap! Setting both y "
850 "track coordinates to x track value:";
853 ldmx_log(debug) <<
"\t\t -- (x, y1, y2) = (" << x <<
", " << y1 <<
", "
854 << y2 <<
") and (sx, sy1, sy2) = " << sx <<
", " << sy1
855 <<
", " << sy2 <<
")";
857 auto yidx1 = y_idx_quad_map.lower_bound((*yitr).first);
858 auto yidx2 = y_idx_quad_map.upper_bound((*yitr).first);
860 tracks.at((*yidx1).second).setPosition(x, y1);
861 tracks.at((*yidx1).second).setSigmaXY(sx, sy1);
862 tracks.at((*yidx2).second).setPosition(x, y2);
863 tracks.at((*yidx2).second).setSigmaXY(sx, sy2);
866 else if (n_yin_quad == 2 && n_xin_quad == 2) {
868 auto xidx1 = x_idx_quad_map.lower_bound((*yitr).first);
869 auto xidx2 = x_idx_quad_map.upper_bound((*yitr).first);
871 auto yidx1 = y_idx_quad_map.lower_bound((*yitr).first);
872 auto yidx2 = y_idx_quad_map.upper_bound((*yitr).first);
875 if (y_idx_quad_map.find((*yitr).first) == y_idx_quad_map.end())
876 ldmx_log(error) <<
"The two y tracks in the same quadrant at "
878 <<
" appear to not be found in the y track map! "
879 "investigate. Note that yidx1.first = "
881 <<
" and yidx2.first = " << (*yidx2).first;
883 tracks.at((*xidx1).second).setPosition(x1, y);
884 tracks.at((*xidx1).second).setSigmaXY(sx1, sy);
885 tracks.at((*xidx2).second).setPosition(x2, y);
886 tracks.at((*xidx2).second).setSigmaXY(sx2, sy);
888 tracks.at((*yidx1).second).setPosition(x, y1);
889 tracks.at((*yidx1).second).setSigmaXY(sx, sy1);
890 tracks.at((*yidx2).second).setPosition(x, y2);
891 tracks.at((*yidx2).second).setSigmaXY(sx, sy2);
894 ldmx_log(debug) <<
"\t\t -- in a 2 x 2 situaiton; midpoint y: " << y
895 <<
" for both x tracks, midpoint x: " << x
896 <<
" for both y tracks";
900 if (n_xin_quad > 2) {
902 ldmx_log(debug) <<
"\t\t -*-*-*- more than 2 x tracks in the same quad "
903 "-- nothing done about the x,y coordinates in this "
904 "situation -- implement if needed!!";
906 if (n_yin_quad > 2) {
908 ldmx_log(debug) <<
"\t\t -*-*-*- more than 2 y tracks in the same quad "
909 "-- nothing done about the x,y coordinates in this "
910 "situation -- implement if needed!!";
922 ldmx_log(debug) <<
"Process starts!";
928 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,...