NB: This isn't actually correct - the tracks can bend out of the Roi even it the perigee phi is withing the Roi
includes calculation of approximate z position of the track at radius r and test if track within that z position at radius r
250 {
251
253 std::cerr << "Filter_Combined::contains() called with null roidescriptor" << std::endl;
254 return true;
255 }
256
257 if (
r->composite() ) {
258 for (
unsigned i=
r->size() ; i-- ; )
if (
contains( t,
r->at(i) ) )
return true;
259 }
260 else {
261
262 if (
r->isFullscan() )
return true;
263
264 bool contained_phi = false;
265
268 if (
r->phiMinus()<
r->phiPlus() ) contained_phi = (
t->phi()>
r->phiMinus() &&
t->phi()<
r->phiPlus() );
269 else contained_phi = (
t->phi()>
r->phiMinus() ||
t->phi()<
r->phiPlus() );
270
271 bool contained_zed = (
t->z0()>
r->zedMinus() &&
t->z0()<
r->zedPlus() );
272
275 bool contained_eta = (
t->eta()<
r->etaPlus() &&
t->eta()>
r->etaMinus() );
276
278
281
282 double rexit = 0;
283 double zexit = 0;
284
285
286
288
292
293 double cross0 = zexit*
r->rMinusZed() - rexit*
r->zedMinusR();
294 double cross1 = zexit*
r->rPlusZed() - rexit*
r->zedPlusR();
295
297 if ( cross0>0 && cross1<0 ) contained_eta=true;
298 else contained_eta=false;
299 }
300
302
303 double newphi =
outerphi(
t->pT(),
t->phi(), rexit );
304
305 if ( newphi==0 ) return false;
306
307 if (
r->phiMinus()<
r->phiPlus() ) contained_phi &= ( newphi>
r->phiMinus() && newphi<r->phiPlus() );
308 else contained_phi &= ( newphi>
r->phiMinus() || newphi<r->phiPlus() );
309
310 }
311
312 if ( contained_eta &&
313 contained_phi &&
314 contained_zed ) {
315 if (
m_debugPrintout ) std::cout <<
"\tFilter::inside roi" << std::endl;
316 return true;
317 }
318
319 }
320
321 return false;
322
323 }
static double outerphi(double pt, double phi, double r=1000)
calculate the (very approximate) phi position for a track at a rafius r
bool contains(const TIDA::Track *t, const TIDARoiDescriptor *r) const
static double exitpoint(double tz0, double teta, double &zexit, double &rexit)