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, min(), mps_fire::result, CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::SpatialRange::xBegin, CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::SpatialRange::xEnd, CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::SpatialRange::yBegin, CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::SpatialRange::yEnd, CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::SpatialRange::zBegin, and CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::SpatialRange::zEnd.
200 bool initialized =
false;
204 const float xBegin =
hit.getX() - 0.5f*
hit.getXWidth(), xEnd =
hit.getX() + 0.5f*
hit.getXWidth();
205 const float yBegin =
hit.getY() - 0.5f*
hit.getYWidth(), yEnd =
hit.getY() + 0.5f*
hit.getYWidth();
206 const float zBegin =
hit.getZ() - 0.5f*
hit.getZWidth(), zEnd =
hit.getZ() + 0.5f*
hit.getZWidth();
209 result.xBegin = xBegin;
211 result.yBegin = yBegin;
213 result.zBegin = zBegin;
218 result.xBegin =
std::min(result.xBegin, xBegin);
219 result.xEnd =
std::max(result.xEnd, xEnd);
220 result.yBegin =
std::min(result.yBegin, yBegin);
221 result.yEnd =
std::max(result.yEnd, yEnd);
222 result.zBegin =
std::min(result.zBegin, zBegin);
223 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 reco::FormulaEvaluator::evaluate(), f, mps_fire::i, CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::DimensionParameters::rangeBegin, CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::DimensionParameters::rangeEnd, CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::resolution_, CTPPSTimingTrackRecognition< TRACK_TYPE, HIT_TYPE >::thresholdFromMaximum_, and HiIsolationCommonParameters_cff::track.
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;
139 const float center = getHitCenter(
hit), rangeWidth = getHitRangeWidth(
hit);
140 std::vector<double> params{center, rangeWidth,
sigma_};
141 for (
unsigned int i = 0;
i < hitProfile.size(); ++
i)
145 bool underThreshold =
true;
146 float rangeMaximum = -1.0f;
147 bool trackRangeFound =
false;
148 int trackRangeBegin = 0, trackRangeEnd = 0;
151 for (
unsigned int i = 0;
i < hitProfile.size();
i++) {
152 if (hitProfile[
i] > rangeMaximum)
153 rangeMaximum = hitProfile[
i];
156 if (underThreshold && hitProfile[
i] >
threshold_) {
157 underThreshold =
false;
159 rangeMaximum = hitProfile[
i];
163 else if (!underThreshold && hitProfile[
i] <=
threshold_) {
164 underThreshold =
true;
166 trackRangeFound =
true;
170 if (trackRangeFound) {
173 bool underTrackThreshold =
true;
175 for (
int j = trackRangeBegin; j <= trackRangeEnd; j++) {
176 if (underTrackThreshold && hitProfile[j] > trackThreshold) {
177 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_