10 #ifndef GARG4_GARG4PARTICLEFILTERS_H 11 #define GARG4_GARG4PARTICLEFILTERS_H 16 #include "TGeoVolume.h" 17 #include "TGeoMatrix.h" 18 #include "TLorentzVector.h" 56 VolumeInfo_t(TGeoVolume
const* new_vol, TGeoCombiTrans
const* new_trans)
57 : vol(new_vol), trans(new_trans) {}
59 TGeoVolume
const*
vol;
72 : volumeInfo(
std::
move(volumes))
89 if (volumeInfo.empty())
return true;
91 for(
auto const&
info: volumeInfo) {
93 info.trans->MasterToLocal(pos.data(), local);
95 if (
info.vol->Contains(local))
return true;
101 {
return mustKeep(
Point_t{{ pos.X(), pos.Y(), pos.Z() }}); }
104 {
return mustKeep(
Point_t{{ pos.X(), pos.Y(), pos.Z() }}); }
115 #endif // GARG4_GARG4PARTICLEFILTERS_H bool mustKeep(TLorentzVector const &pos) const
bool mustKeep(TVector3 const &pos) const
std::vector< VolumeInfo_t > volumeInfo
all good volumes
TGeoVolume const * vol
ROOT volume.
TGeoCombiTrans const * trans
volume transformation (has both ways)
std::array< double, 3 > Point_t
bool mustKeep(Point_t const &pos) const
Returns whether a track along the specified point must be kept.
std::vector< VolumeInfo_t > AllVolumeInfo_t
General GArSoft Utilities.
PositionInVolumeFilter(std::vector< VolumeInfo_t > const &volumes)
Constructors: read the volumes from the specified list.
VolumeInfo_t(TGeoVolume const *new_vol, TGeoCombiTrans const *new_trans)
PositionInVolumeFilter(std::vector< VolumeInfo_t > &&volumes)
Use to keep particles with at least part of trajectory in a volume.