24 inline double square(
const double tosquare) {
27 double dist(
const std::pair<Amg::Vector3D,Amg::Vector3D>& pairofpos) {
29 return std::sqrt(square(
diff.x())+square(
diff.y())+square(
diff.z()));
37 static const InterfaceID IID_ITrackPairsSelector(
"InDet::TrackPairsSelector", 1, 0);
41 const std::string&
name,
45 declareInterface<TrackPairsSelector>(
this);
50 return IID_ITrackPairsSelector;
59 return StatusCode::FAILURE;
66 return StatusCode::FAILURE;
71 return StatusCode::SUCCESS;
76 return StatusCode::SUCCESS;
91 if (!(
m_helpertool->momFraction(perPos, perNeg))) pass =
false;
115 if(nclusNeg>0 && nclusPos>0) sCase = 0;
116 if((nclusNeg>0 && nclusPos==0) || (nclusNeg==0 && nclusPos>0)) sCase = 1;
117 if(nclusNeg==0 && nclusPos==0) sCase = 2;
133 ATH_MSG_WARNING(
"Track Particle does not contain first Measurement track parameters");
147 ATH_MSG_WARNING(
"Track Particle does not contain first Measurement track parameters");
151 double firstRpos = parPos.
position().perp();
152 double firstRneg = parNeg.
position().perp();
155 double detaCut = 0.0;
158 }
else if(sCase == 1) {
160 }
else if(sCase == 2) {
161 if(fabs(perPos->
eta())<0.6 && fabs(perNeg->
eta())<0.6) detaCut = 10000.;
171 double dinit = 1000.;
174 }
else if(sCase == 1) {
176 }
else if(sCase == 2) {
184 double maxDist = 1000.;
187 }
else if(sCase == 1) {
189 }
else if(sCase == 2) {
194 std::optional<Trk::ITrkDistanceFinder::TwoPoints>
result
197 if (!
result)
return false;
219 if (!(
m_helpertool->momFraction(perPos, perNeg))) pass =
false;
222 double init_pos = 0.;
double init_neg = 0.;
225 if(!mb_pos || !mb_neg) {pass =
false;
return pass;}
227 init_pos = (*itp_pos)->globalPosition().perp();
229 init_neg = (*itp_neg)->globalPosition().perp();
232 if ((init_neg<=m_maxR && init_pos>
m_maxR) || (init_neg>
m_maxR && init_pos<=
m_maxR)) sCase = 1;
236 double detaCut = 0.0;
239 }
else if(sCase == 1) {
241 }
else if(sCase == 2) {
250 double dinit = 1000.;
253 }
else if(sCase == 1) {
255 }
else if(sCase == 2) {
258 if(fabs(init_pos - init_neg) > dinit) pass =
false;
261 double maxDist = 1000.;
264 }
else if(sCase == 1) {
266 }
else if(sCase == 2) {
270 double newDistance = 1000000.;
271 std::optional<Trk::ITrkDistanceFinder::TwoPoints>
result
277 newDistance = dist (
result.value());
278 if (newDistance>maxDist) pass =
false;
282 double d_beta = (perPos->momentum().dot(perNeg->momentum())) /
283 (perPos->momentum().mag() * perNeg->momentum().mag());
290 std::map<std::string, float>
294 return {{
"minimumDistanceTrk", cache.
m_distance},