LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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)
 Constructors: read the volumes from the specified list. More...
 

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 46 of file ParticleFilters.h.

Member Typedef Documentation

Definition at line 61 of file ParticleFilters.h.

using util::PositionInVolumeFilter::Point_t = std::array<double, 3>

Definition at line 48 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 66 of file ParticleFilters.h.

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

Constructors: read the volumes from the specified list.

Parameters
volumeslist of interesting volumes

Definition at line 67 of file ParticleFilters.h.

67 : volumeInfo(std::move(volumes)) {}
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 80 of file ParticleFilters.h.

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

Definition at line 94 of file ParticleFilters.h.

95  {
96  return mustKeep(Point_t{{pos.X(), pos.Y(), pos.Z()}});
97  }
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 99 of file ParticleFilters.h.

100  {
101  return mustKeep(Point_t{{pos.X(), pos.Y(), pos.Z()}});
102  }
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 105 of file ParticleFilters.h.


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