116 double vtx[3] = {position.X(), position.Y(), position.Z()};
118 art::ServiceHandle<geo::Geometry> geom;
119 geo::TPCID idtpc = geom->FindTPCAtPosition(vtx);
121 if (geom->HasTPC(idtpc))
124 double minx = tpcgeo.
MinX();
double maxx = tpcgeo.
MaxX();
125 double miny = tpcgeo.
MinY();
double maxy = tpcgeo.
MaxY();
126 double minz = tpcgeo.
MinZ();
double maxz = tpcgeo.
MaxZ();
128 for (
size_t c = 0; c < geom->Ncryostats(); c++)
131 for (
size_t t = 0; t < cryostat.
NTPC(); t++)
134 if (tpcg.
MinX() < minx) minx = tpcg.
MinX();
135 if (tpcg.
MaxX() > maxx) maxx = tpcg.
MaxX();
136 if (tpcg.
MinY() < miny) miny = tpcg.
MinY();
137 if (tpcg.
MaxY() > maxy) maxy = tpcg.
MaxY();
138 if (tpcg.
MinZ() < minz) minz = tpcg.
MinZ();
139 if (tpcg.
MaxZ() > maxz) maxz = tpcg.
MaxZ();
144 double dista = fabs(minx - position.X());
145 double distb = fabs(position.X() - maxx);
146 if ((position.X() > minx) && (position.X() < maxx) &&
147 (dista > distance_buffer) && (distb > distance_buffer)) inside =
true;
149 dista = fabs(maxy - position.Y());
150 distb = fabs(position.Y() - miny);
151 if (inside && (position.Y() > miny) && (position.Y() < maxy) &&
152 (dista > distance_buffer) && (distb > distance_buffer)) inside =
true;
155 dista = fabs(maxz - position.Z());
156 distb = fabs(position.Z() - minz);
157 if (inside && (position.Z() > minz) && (position.Z() < maxz) &&
158 (dista > distance_buffer) && (distb > distance_buffer)) inside =
true;
double MinX() const
Returns the world x coordinate of the start of the box.
Geometry information for a single TPC.
double MaxX() const
Returns the world x coordinate of the end of the box.
Geometry information for a single cryostat.
double MinZ() const
Returns the world z coordinate of the start of the box.
unsigned int NTPC() const
Number of TPCs in this cryostat.
const PlaneGeo & GetElement(PlaneID const &planeid) const
The data type to uniquely identify a TPC.
double MaxY() const
Returns the world y coordinate of the end of the box.
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc'th TPC in the cryostat.
double MaxZ() const
Returns the world z coordinate of the end of the box.
double MinY() const
Returns the world y coordinate of the start of the box.