template<typename TRACK_TYPE, typename HIT_TYPE>
class CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >
Class intended to perform general CTPPS timing detectors track recognition, as well as construction of specialized classes (for now CTPPSDiamond and TotemTiming local tracks).
Definition at line 31 of file CTPPSTimingTrackRecognition.h.
template<class TRACK_TYPE , class HIT_TYPE >
Retrieve the bounds of a 3D range in which all hits from given collection are contained.
- Parameters
-
[in] | hits | hits collection to retrieve the range from |
Definition at line 198 of file CTPPSTimingTrackRecognition.h.
References SiStripPI::max, SiStripPI::min, mps_fire::result, hit::x, CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::SpatialRange::xBegin, CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::SpatialRange::xEnd, hit::y, CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::SpatialRange::yBegin, CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::SpatialRange::yEnd, hit::z, CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::SpatialRange::zBegin, and CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::SpatialRange::zEnd.
199 bool initialized =
false;
202 for (
const auto&
hit : hits) {
203 const float xBegin =
hit.
x() - 0.5f *
hit.xWidth(), xEnd =
hit.
x() + 0.5f *
hit.xWidth();
204 const float yBegin =
hit.
y() - 0.5f *
hit.yWidth(), yEnd =
hit.
y() + 0.5f *
hit.yWidth();
205 const float zBegin =
hit.
z() - 0.5f *
hit.zWidth(), zEnd =
hit.
z() + 0.5f *
hit.zWidth();
208 result.xBegin = xBegin;
210 result.yBegin = yBegin;
212 result.zBegin = zBegin;
217 result.xBegin =
std::min(result.xBegin, xBegin);
218 result.xEnd =
std::max(result.xEnd, xEnd);
219 result.yBegin =
std::min(result.yBegin, yBegin);
220 result.yEnd =
std::max(result.yEnd, yEnd);
221 result.zBegin =
std::min(result.zBegin, zBegin);
222 result.zEnd =
std::max(result.zEnd, zEnd);
template<class TRACK_TYPE, class HIT_TYPE>
void CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::producePartialTracks |
( |
const HitVector & |
hits, |
|
|
const DimensionParameters & |
param, |
|
|
float(*)(const HIT_TYPE &) |
getHitCenter, |
|
|
float(*)(const HIT_TYPE &) |
getHitRangeWidth, |
|
|
void(*)(TRACK_TYPE &, float) |
setTrackCenter, |
|
|
void(*)(TRACK_TYPE &, float) |
setTrackSigma, |
|
|
TrackVector & |
result |
|
) |
| |
|
inlineprotected |
Produce all partial tracks from given set with regard to single dimension.
- Parameters
-
[in] | hits | vector of hits from which the tracks are created |
[in] | param | describe all parameters used by 1D track recognition algorithm |
[in] | getHitCenter | function extracting hit's center in the dimension that the partial tracks relate to |
[in] | getHitRangeWidth | analogue to getHitCenter, but extracts hit's width in specific dimension |
[in] | setTrackCenter | function used to set track's position in considered dimension |
[in] | setTrackSigma | function used to set track's sigma in considered dimension |
[out] | result | vector to which produced tracks are appended |
Definition at line 119 of file CTPPSTimingTrackRecognition.h.
References mps_fire::i, submitPVValidationJobs::params, CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::DimensionParameters::rangeBegin, and CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::DimensionParameters::rangeEnd.
127 int numberOfTracks = 0;
129 const float profileRangeMargin =
sigma_ * 3.;
130 const float profileRangeBegin = param.rangeBegin - profileRangeMargin;
131 const float profileRangeEnd = param.rangeEnd + profileRangeMargin;
133 std::vector<float> hitProfile((profileRangeEnd - profileRangeBegin) * invResolution + 1, 0.);
135 *hitProfile.rbegin() = -1.f;
138 for (
auto const&
hit : hits) {
139 const float center = getHitCenter(
hit), rangeWidth = getHitRangeWidth(
hit);
141 for (
unsigned int i = 0;
i < hitProfile.size(); ++
i)
146 bool underThreshold =
true;
147 float rangeMaximum = -1.0f;
148 bool trackRangeFound =
false;
149 int trackRangeBegin = 0, trackRangeEnd = 0;
152 for (
unsigned int i = 0;
i < hitProfile.size();
i++) {
153 if (hitProfile[
i] > rangeMaximum)
154 rangeMaximum = hitProfile[
i];
157 if (underThreshold && hitProfile[
i] >
threshold_) {
158 underThreshold =
false;
160 rangeMaximum = hitProfile[
i];
164 else if (!underThreshold && hitProfile[
i] <=
threshold_) {
165 underThreshold =
true;
167 trackRangeFound =
true;
171 if (trackRangeFound) {
174 bool underTrackThreshold =
true;
176 for (
int j = trackRangeBegin;
j <= trackRangeEnd;
j++) {
177 if (underTrackThreshold && hitProfile[
j] > trackThreshold) {
178 underTrackThreshold =
false;
180 }
else if (!underTrackThreshold && hitProfile[
j] <= trackThreshold) {
181 underTrackThreshold =
true;
183 float leftMargin = profileRangeBegin +
resolution_ * trackBegin;
184 float rightMargin = profileRangeBegin +
resolution_ *
j;
185 setTrackCenter(track, 0.5
f * (leftMargin + rightMargin));
186 setTrackSigma(track, 0.5
f * (rightMargin - leftMargin));
191 trackRangeFound =
false;
const float thresholdFromMaximum_
reco::FormulaEvaluator pixelEfficiencyFunction_