All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
util::PositionInVolumeFilter Class Reference

Use to keep particles with at least part of trajectory in a volume. More...

#include <ParticleFilters.h>

Inheritance diagram for util::PositionInVolumeFilter:
util::KeepByPositionFilterTag

Classes

struct  VolumeInfo_t
 

Public Types

using Point_t = std::array< double, 3 >
 
using AllVolumeInfo_t = std::vector< VolumeInfo_t >
 

Public Member Functions

bool mustKeep (Point_t const &pos) const
 Returns whether a track along the specified point must be kept. More...
 
bool mustKeep (TVector3 const &pos) const
 
bool mustKeep (TLorentzVector const &pos) const
 
 PositionInVolumeFilter (std::vector< VolumeInfo_t > const &volumes)
 Constructors: read the volumes from the specified list. More...
 
 PositionInVolumeFilter (std::vector< VolumeInfo_t > &&volumes)
 

Protected Attributes

std::vector< VolumeInfo_tvolumeInfo
 all good volumes More...
 

Detailed Description

Use to keep particles with at least part of trajectory in a volume.


Author
Matt Bass, Gianluca Petrillo

The class stores a list of pointers to volumes to consider. If a point specified in the mustKeep() call is within one of the blessed volumes, the whole track it belongs to must to be kept.

No condition for prompt rejection is provided.

Definition at line 48 of file ParticleFilters.h.

Member Typedef Documentation

Definition at line 63 of file ParticleFilters.h.

Definition at line 51 of file ParticleFilters.h.

Constructor & Destructor Documentation

util::PositionInVolumeFilter::PositionInVolumeFilter ( std::vector< VolumeInfo_t > const &  volumes)
inline

Constructors: read the volumes from the specified list.

Parameters
volumeslist of interesting volumes

Definition at line 68 of file ParticleFilters.h.

69  : volumeInfo(volumes)
70  {}
std::vector< VolumeInfo_t > volumeInfo
all good volumes
util::PositionInVolumeFilter::PositionInVolumeFilter ( std::vector< VolumeInfo_t > &&  volumes)
inline

Definition at line 71 of file ParticleFilters.h.

72  : volumeInfo(std::move(volumes))
73  {}
std::vector< VolumeInfo_t > volumeInfo
all good volumes

Member Function Documentation

bool util::PositionInVolumeFilter::mustKeep ( Point_t const &  pos) const
inline

Returns whether a track along the specified point must be kept.

Parameters
pospoint on the track, a [x,y,z] array in "Geant4 coordinates" whether a track along the specified point must be kept

If the return value is true, the track must be kept. If the return value is false, no decision can be made yet. If no decision is made after the track is over, the track should be dropped.

Definition at line 86 of file ParticleFilters.h.

87  {
88  // if no volume is specified, it means we don't filter
89  if (volumeInfo.empty()) return true;
90  double local[3];
91  for(auto const& info: volumeInfo) {
92  // transform the point to relative to the volume
93  info.trans->MasterToLocal(pos.data(), local);
94  // containment check
95  if (info.vol->Contains(local)) return true;
96  } // for volumes
97  return false;
98  } // mustKeep()
std::vector< VolumeInfo_t > volumeInfo
all good volumes
then local
bool util::PositionInVolumeFilter::mustKeep ( TVector3 const &  pos) const
inline

Definition at line 100 of file ParticleFilters.h.

101  { return mustKeep(Point_t{{ pos.X(), pos.Y(), pos.Z() }}); }
bool mustKeep(Point_t const &pos) const
Returns whether a track along the specified point must be kept.
recob::tracking::Point_t Point_t
bool util::PositionInVolumeFilter::mustKeep ( TLorentzVector const &  pos) const
inline

Definition at line 103 of file ParticleFilters.h.

104  { return mustKeep(Point_t{{ pos.X(), pos.Y(), pos.Z() }}); }
bool mustKeep(Point_t const &pos) const
Returns whether a track along the specified point must be kept.
recob::tracking::Point_t Point_t

Member Data Documentation

std::vector<VolumeInfo_t> util::PositionInVolumeFilter::volumeInfo
protected

all good volumes

Definition at line 108 of file ParticleFilters.h.


The documentation for this class was generated from the following file: