18 #include "cetlib_except/exception.h" 61 bool interactionDesired(
false);
64 auto const& [cryostat, tpc] = std::make_tuple(geom->
Cryostat(), geom->
TPC());
68 std::vector<art::Ptr<simb::MCTruth>> mclist;
75 std::set<art::Ptr<simb::MCTruth>> mctSetGENIE;
76 for (
size_t i = 0; i < mctruthListHandle->size(); ++i) {
78 if (mctSetGENIE.find(mct_ptr) == mctSetGENIE.end()) mctSetGENIE.insert(mct_ptr);
93 xmin = tpc.HalfWidth() - cryostat.HalfWidth();
94 xmax = tpc.HalfWidth() + cryostat.HalfWidth();
95 ymin = -cryostat.HalfHeight();
96 ymax = cryostat.HalfHeight();
97 zmin = tpc.Length() / 2. - tpc.Length() / 2.;
98 zmax = tpc.Length() / 2. + tpc.Length() / 2.;
103 xmax = 2. * tpc.HalfWidth();
104 ymin = -tpc.HalfHeight();
105 ymax = tpc.HalfHeight();
112 for (
size_t i = 0; i < mcpHandle->size() && !inTPC; ++i) {
115 if (mctSetGENIE.find(mct) == mctSetGENIE.end()) {
125 int n =
part->NumberTrajectoryPoints();
126 for (
int j = 0; j < n && !inTPC; ++j) {
128 TVector3 pos =
part->Position(j).Vect();
129 if (pos.X() >= xmin && pos.X() <= xmax && pos.Y() >= ymin && pos.Y() <= ymax &&
130 pos.Z() >= zmin && pos.Z() <= zmax) {
131 interactionDesired =
true;
132 std::cout <<
"FilterNoDirtNeutrinos: Genie daughter found in TPC. G4Particle " 140 return interactionDesired;
std::string fLArG4ModuleLabel
std::string fGenModuleLabel
bool fKeepCryostatNeutrinos
#define DEFINE_ART_MODULE(klass)
CryostatGeo const & Cryostat(CryostatID const &cryoid=details::cryostat_zero) const
Returns the specified cryostat.
FilterNoDirtNeutrinos(fhicl::ParameterSet const &pset)
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
EDFilter(fhicl::ParameterSet const &pset)
bool filter(art::Event &) override
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
TPCGeo const & TPC(TPCID const &tpcid=details::tpc_zero) const
Returns the specified TPC.
art framework interface to geometry description