21 for (
size_t tpc_i = 0; tpc_i < cryostat.
NTPC(); tpc_i++)
77 return InFiducial(point, fiducial, fiducial, fiducial, fiducial, fiducialTop, fiducial);
81 double maxXCut,
double maxYCut,
double maxZCut){
84 double xmax =
fMaxX - maxXCut;
85 double ymin =
fMinY + minYCut;
86 double ymax =
fMaxY - maxYCut;
87 double zmin =
fMinZ + minZCut;
88 double zmax =
fMaxZ - maxZCut;
93 if(x>xmin && x<xmax && y>ymin && y<ymax && z>zmin && z<zmax)
return true;
102 if(hits.size() == 0)
return -1;
103 int tpc = hits[0]->WireID().TPC;
104 for(
size_t i = 0; i < hits.size(); i++){
105 if((
int)hits[i]->WireID().TPC != tpc)
return -1;
113 if(hits.size() == 0)
return 0;
122 if(
std::abs(driftDirection) != 1) driftDirection = 0;
123 return driftDirection;
129 if(hits.size() == 0)
return std::make_pair(0, 0);
137 return std::make_pair(tpcGeo.
MinX(), tpcGeo.
MaxX());
142 if(point.X() < (tpc.
MinX()-buffer) || point.X() > (tpc.
MaxX()+buffer)
143 || point.Y() < (tpc.
MinY()-buffer) || point.Y() > (tpc.
MaxY()+buffer)
144 || point.Z() < (tpc.
MinZ()-buffer) || point.Z() > (tpc.
MaxZ()+buffer))
return false;
151 std::vector<double> dists;
160 std::sort(dists.begin(), dists.end());
169 for(
size_t i = 0; i < particle.NumberTrajectoryPoints(); i++){
170 double x = particle.Vx(i);
171 double y = particle.Vy(i);
172 double z = particle.Vz(i);
183 for(
size_t i = 0; i < particle.NumberTrajectoryPoints(); i++){
184 double x = particle.Vx(i);
185 double y = particle.Vy(i);
186 double z = particle.Vz(i);
198 bool startOutside =
false;
199 bool endOutside =
false;
200 for(
size_t i = 0; i < particle.NumberTrajectoryPoints(); i++){
201 double x = particle.Vx(i);
202 double y = particle.Vy(i);
203 double z = particle.Vz(i);
207 else if(i == 0) startOutside =
true;
208 else if(i == particle.NumberTrajectoryPoints()-1) endOutside =
true;
210 if(enters && (startOutside || endOutside))
return true;
218 bool startOutside =
false;
219 bool endOutside =
false;
220 for(
size_t i = 0; i < particle.NumberTrajectoryPoints(); i++){
221 double x = particle.Vx(i);
222 double y = particle.Vy(i);
223 double z = particle.Vz(i);
227 else if(i == 0) startOutside =
true;
228 else if(i == particle.NumberTrajectoryPoints()-1) endOutside =
true;
230 if(startOutside && enters && endOutside)
return true;
237 for(
size_t i = 0; i < particle.NumberTrajectoryPoints()-1; i++){
238 double x = particle.Vx(i);
239 double y = particle.Vy(i);
240 double z = particle.Vz(i);
241 double x1 = particle.Vx(i+1);
242 double y1 = particle.Vy(i+1);
243 double z1 = particle.Vz(i+1);
246 if(x <= fMinX && x1 >=
fMinX)
return true;
248 if(x <= fMaxX && x1 >=
fMaxX)
return true;
257 TVector3 start (-99999, -99999, -99999);
258 TVector3
end (-99999, -99999, -99999);
259 for(
size_t i = 0; i < particle.NumberTrajectoryPoints(); i++){
260 double x = particle.Vx(i);
261 double y = particle.Vy(i);
262 double z = particle.Vz(i);
266 start.SetXYZ(x, y, z);
271 return std::make_pair(start, end);
277 TVector3 point, disp;
278 for(
size_t i = 0; i < particle.NumberTrajectoryPoints(); i++){
279 double x = particle.Vx(i);
280 double y = particle.Vy(i);
281 double z = particle.Vz(i);
283 point.SetXYZ(x, y, z);
286 length += disp.Mag();
process_name opflash particleana ie ie ie z
bool CrossesVolume(const simb::MCParticle &particle)
CryostatGeo const & GetElement(geo::CryostatID const &cryoid) const
bool IsContained(const simb::MCParticle &particle)
process_name opflash particleana ie x
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.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
bool InsideTPC(geo::Point_t point, const geo::TPCGeo &tpc, double buffer=0.)
process_name pandoraGausCryo1 vertexChargeCryo1 vertexStubCryo1 xmin
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
process_name opflash particleana ie ie y
bool InVolume(const simb::MCParticle &particle)
bool CrossesApa(const simb::MCParticle &particle)
double TpcLength(const simb::MCParticle &particle)
auto end(FixedBins< T, C > const &) noexcept
double MinZ() const
Returns the world z coordinate of the start of the box.
bool EntersVolume(const simb::MCParticle &particle)
unsigned int NTPC() const
Number of TPCs in this cryostat.
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
The data type to uniquely identify a TPC.
int DetectedInTPC(std::vector< art::Ptr< recob::Hit >> hits)
double MaxY() const
Returns the world y coordinate of the end of the box.
constexpr TPCID const & asTPCID() const
Conversion to TPCID (for convenience of notation).
geo::GeometryCore const * fGeometryService
std::pair< double, double > XLimitsFromHits(std::vector< art::Ptr< recob::Hit >> hits)
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc'th TPC in the cryostat.
short int DetectDriftDirection() const
Returns the expected drift direction based on geometry.
double MaxZ() const
Returns the world z coordinate of the end of the box.
int DriftDirectionFromHits(std::vector< art::Ptr< recob::Hit >> hits)
double MinDistToWall(geo::Point_t point)
stream1 can override from command line with o or output services user sbnd
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
double MinY() const
Returns the world y coordinate of the start of the box.
std::pair< TVector3, TVector3 > CrossingPoints(const simb::MCParticle &particle)
bool InFiducial(geo::Point_t point, double fiducial)