ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
Filter_Combined Class Reference

#include <Filters.h>

Inheritance diagram for Filter_Combined:
Collaboration diagram for Filter_Combined:

Public Member Functions

 Filter_Combined (TrackFilter *f1, TrackFilter *f2)
 
void setRoi (TIDARoiDescriptor *r)
 
void containtracks (bool b=true)
 set / unset the flag to determine whether tracks should be fully contained in the RoI or not
More...
 
void containtracksPhi (bool b=true)
 set / unset to allow the strict phi containment to be used even if the full rigorous containement is not
More...
 
bool contains (const TIDA::Track *t, const TIDARoiDescriptor *r) const
 
bool select (const TIDA::Track *t, const TIDARoiDescriptor *r=0)
 
void setDebug (bool b)
 

Static Public Member Functions

static double outerphi (double pt, double phi, double r=1000)
 calculate the (very approximate) phi position for a track at a rafius r More...
 

Private Attributes

TrackFilterm_f1
 
TrackFilterm_f2
 
const TIDARoiDescriptorm_roi
 
bool m_debugPrintout
 
bool m_containPhi
 
bool m_contain
 

Detailed Description

Definition at line 225 of file Filters.h.

Constructor & Destructor Documentation

◆ Filter_Combined()

Filter_Combined::Filter_Combined ( TrackFilter f1,
TrackFilter f2 
)
inline

Definition at line 229 of file Filters.h.

229  :
230  m_f1(f1), m_f2(f2), m_roi(0),
231  m_debugPrintout(false),
232  m_containPhi(true),
233  m_contain(false)
234  { }

Member Function Documentation

◆ contains()

bool Filter_Combined::contains ( const TIDA::Track t,
const TIDARoiDescriptor r 
) const
inline

NB: This isn't actually correct - the tracks can bend out of the Roi even it the perigee phi is withing the Roi

NB: This is completely wrong, tracks could be completely contained within an Roi but failthis condition

includes calculation of approximate z position of the track at radius r and test if track within that z position at radius r

full check to determine whether a track is
fully contained in the Roi or not (when used in conjunction with contained_zed above)

now check phi taking account of the track transverse curvature

Definition at line 250 of file Filters.h.

250  {
251 
252  if ( r==0 ) {
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 
277  if ( m_contain || m_containPhi ) {
278 
281 
282  double rexit = 0;
283  double zexit = 0;
284 
285  // double tantheta = TIDARoiDescriptor::exitpoint( t->z0(), t->eta(), zexit, rexit );
286 
287  TIDARoiDescriptor::exitpoint( t->z0(), t->eta(), zexit, rexit );
288 
292 
293  double cross0 = zexit*r->rMinusZed() - rexit*r->zedMinusR();
294  double cross1 = zexit*r->rPlusZed() - rexit*r->zedPlusR();
295 
296  if ( m_contain ) {
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  }

◆ containtracks()

void Filter_Combined::containtracks ( bool  b = true)
inline

set / unset the flag to determine whether tracks should be fully contained in the RoI or not

Definition at line 242 of file Filters.h.

242 { m_contain=b; }

◆ containtracksPhi()

void Filter_Combined::containtracksPhi ( bool  b = true)
inline

set / unset to allow the strict phi containment to be used even if the full rigorous containement is not

Definition at line 247 of file Filters.h.

247 { m_containPhi=b; }

◆ outerphi()

static double Filter_Combined::outerphi ( double  pt,
double  phi,
double  r = 1000 
)
inlinestatic

calculate the (very approximate) phi position for a track at a rafius r

track (signed) radius of curvature

make sure it escapes the radius in question

calculate new position

wrap to -pi to pi

Definition at line 356 of file Filters.h.

356  {
357 
359 
360  double mqR = 10*pt/(2.99792458*2); // 2.998=speed of light, 2=Atlas B field
361 
362  double ratio = 0.5*r/mqR;
363 
364  double newphi = phi;
365 
368  if ( std::fabs(ratio)>1 ) return 0;
369 
371  newphi -= std::asin( ratio );
372 
374  while ( newphi<-M_PI ) newphi += 2*M_PI;
375  while ( newphi> M_PI ) newphi -= 2*M_PI;
376 
377  return newphi;
378 
379  }

◆ select()

bool Filter_Combined::select ( const TIDA::Track t,
const TIDARoiDescriptor r = 0 
)
inlinevirtual

no roi so just return the and of the input filters

Implements TrackFilter.

Definition at line 326 of file Filters.h.

326  {
327 
328  if ( r!=0 ) m_roi = r;
329 
330  if ( m_debugPrintout ) {
331  std::cout << "\tFilter: " << this << "\tfilter1 " << m_f1->select(t,m_roi) << "\tfilter2 " << m_f2->select(t,m_roi) << "\troi " << m_roi << std::endl;
332  }
333 
335  if ( m_roi==0 ) return ( m_f1->select(t,r) && m_f2->select(t,r) );
336  else {
337 
338  if ( m_debugPrintout ) {
339  std::cout << "\tFilter::filter1 " << m_f1->select(t,m_roi) << "\tfilter2 " << m_f2->select(t,m_roi) << "\troi " << *m_roi << std::endl;
340  }
341 
342  if ( contains( t, m_roi ) ) return ( m_f1->select(t,m_roi) && m_f2->select(t,m_roi) );
343  else return false;
344 
345  }
346  }

◆ setDebug()

void Filter_Combined::setDebug ( bool  b)
inline

Definition at line 348 of file Filters.h.

348 { m_debugPrintout=b; }

◆ setRoi()

void Filter_Combined::setRoi ( TIDARoiDescriptor r)
inline

Definition at line 236 of file Filters.h.

236 { m_roi = r; }

Member Data Documentation

◆ m_contain

bool Filter_Combined::m_contain
private

Definition at line 391 of file Filters.h.

◆ m_containPhi

bool Filter_Combined::m_containPhi
private

Definition at line 390 of file Filters.h.

◆ m_debugPrintout

bool Filter_Combined::m_debugPrintout
private

Definition at line 388 of file Filters.h.

◆ m_f1

TrackFilter* Filter_Combined::m_f1
private

Definition at line 383 of file Filters.h.

◆ m_f2

TrackFilter* Filter_Combined::m_f2
private

Definition at line 384 of file Filters.h.

◆ m_roi

const TIDARoiDescriptor* Filter_Combined::m_roi
private

Definition at line 386 of file Filters.h.


The documentation for this class was generated from the following file:
beamspotman.r
def r
Definition: beamspotman.py:676
Filter_Combined::m_f2
TrackFilter * m_f2
Definition: Filters.h:384
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
TIDARoiDescriptor::exitpoint
static double exitpoint(double tz0, double teta, double &zexit, double &rexit)
Definition: TIDARoiDescriptor.cxx:32
test_pyathena.pt
pt
Definition: test_pyathena.py:11
M_PI
#define M_PI
Definition: ActiveFraction.h:11
Filter_Combined::outerphi
static double outerphi(double pt, double phi, double r=1000)
calculate the (very approximate) phi position for a track at a rafius r
Definition: Filters.h:356
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Filter_Combined::contains
bool contains(const TIDA::Track *t, const TIDARoiDescriptor *r) const
Definition: Filters.h:250
TrackFilter::select
virtual bool select(const TIDA::Track *t, const TIDARoiDescriptor *r=0)=0
read_hist_ntuple.f2
f2
Definition: read_hist_ntuple.py:20
Filter_Combined::m_debugPrintout
bool m_debugPrintout
Definition: Filters.h:388
lumiFormat.i
int i
Definition: lumiFormat.py:85
Filter_Combined::m_containPhi
bool m_containPhi
Definition: Filters.h:390
Filter_Combined::m_contain
bool m_contain
Definition: Filters.h:391
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
python.compareTCTs.ratio
ratio
Definition: compareTCTs.py:295
Filter_Combined::m_f1
TrackFilter * m_f1
Definition: Filters.h:383
Filter_Combined::m_roi
const TIDARoiDescriptor * m_roi
Definition: Filters.h:386
read_hist_ntuple.f1
f1
Definition: read_hist_ntuple.py:4