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>();
62 fYBounds = {-geom->DetHalfHeight(), geom->DetHalfHeight()};
63 fZBounds = {0., geom->DetLength()};
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;
Length_t DetHalfWidth(TPCID const &tpcid=tpc_zero) const
Returns the half width of the active volume of the specified TPC.
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