30 inline bool within(bounds
const& bnds,
double const value)
32 return bnds.minBound < value and value < bnds.maxBound;
42 std::string
const fLArG4ModuleLabel;
52 : SharedFilter{pset}, fLArG4ModuleLabel{pset.
get<std::string>(
"LArG4ModuleLabel",
"largeant")}
54 async<art::InEvent>();
61 fXBounds = {0., 2. * tpc.HalfWidth()};
62 fYBounds = {-tpc.HalfHeight(), tpc.HalfHeight()};
63 fZBounds = {0., tpc.Length()};
70 auto const& mcps = *evt.
getValidHandle<std::vector<simb::MCParticle>>(fLArG4ModuleLabel);
72 for (
auto const&
part : mcps) {
77 if (within(fXBounds,
part.EndX()) and within(fYBounds,
part.EndY()) and
78 within(fZBounds,
part.EndZ())) {
85 std::cout <<
"************* IN TPC *******************" << std::endl;
constexpr auto abs(T v)
Returns the absolute value of the argument.
#define DEFINE_ART_MODULE(klass)
ServiceHandle< T > serviceHandle() const
T get(std::string const &key) const
The geometry of one entire detector, as served by art.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
art framework interface to geometry description