19 #include "fhiclcpp/ParameterSet.h"
20 #include "cetlib_except/exception.h"
29 static const double tol = 1
e-4;
33 inline bool equal(
double a,
double b)
50 double xyz1[3] = {0.}, xyz2[3] = {0.};
51 double local[3] = {0.};
55 if(xyz1[2] != xyz2[2])
56 return xyz1[2] < xyz2[2];
57 else if(xyz1[1] != xyz2[1])
58 return xyz1[1] < xyz2[1];
60 return xyz1[0] < xyz2[0];
189 if (!
equal(c1.Z(), c2.Z()))
return c1.Z() < c2.Z();
194 if (!
equal(c1.Y(), c2.Y())) {
204 bool const decreasingY = ((
e1.Y() - c1.Y()) > 0) == ((
e1.Z() - c1.Z()) > 0);
205 if (decreasingY)
return c1.Y() > c2.Y();
206 else return c1.Y() < c2.Y();
212 if (!
equal(c1.X(), c2.X())) {
214 throw cet::exception(
"GeoObjectSorterSBND")
215 <<
"Wires differ only for x coordinate... this is not SBND any more!\n";
231 : fDetVersion(p.
get<
std::string>(
"DetectorVersion",
"SBND"))
237 (std::vector<geo::CryostatGeo>& cgeo)
const
242 (std::vector<geo::OpDetGeo> & opdet)
const
249 { std::sort(tgeo.begin(), tgeo.end(),
TPCSorter); }
279 (std::vector<geo::WireGeo>& wgeo)
const
280 { std::sort(wgeo.begin(), wgeo.end(),
WireSorter); }
287 (std::vector<geo::AuxDetGeo>& adgeo)
const
293 (std::vector<geo::AuxDetSensitiveGeo>& adsgeo)
const
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
Encapsulate the construction of a single cyostat.
virtual void SortAuxDetSensitive(std::vector< geo::AuxDetSensitiveGeo > &adsgeo) const override
Geometry information for a single TPC.
virtual void SortCryostats(std::vector< geo::CryostatGeo > &cgeo) const override
double CenterX() const
Returns the world x coordinate of the center of the box.
virtual void SortAuxDets(std::vector< geo::AuxDetGeo > &adgeo) const override
Point GetBoxCenter() const
Returns the centre of the box representing the plane.
bool TPCSorter(geo::TPCGeo const &t1, geo::TPCGeo const &t2)
double CenterZ() const
Returns the world z coordinate of the center of the box.
static bool OpDetsSorter(geo::OpDetGeo const &t1, geo::OpDetGeo const &t2)
virtual void SortWires(std::vector< geo::WireGeo > &wgeo) const override
Geometry information for a single cryostat.
GeoObjectSorterSBND(fhicl::ParameterSet const &p)
bool PlaneSorter(geo::PlaneGeo const &p1, geo::PlaneGeo const &p2)
virtual void SortPlanes(std::vector< geo::PlaneGeo > &pgeo, geo::DriftDirection_t driftDir) const override
virtual void SortOpDets(std::vector< geo::OpDetGeo > &opdet) const override
enum geo::driftdir DriftDirection_t
Drift direction: positive or negative.
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
bool CryostatSorter(geo::CryostatGeo const &c1, geo::CryostatGeo const &c2)
Encapsulate the geometry of an auxiliary detector.
Encapsulate the geometry of a wire.
Encapsulate the geometry of an optical detector.
bool equal(double a, double b)
Comparison tolerance, in centimeters.
virtual void SortTPCs(std::vector< geo::TPCGeo > &tgeo) const override
Encapsulate the construction of a single detector plane.
double CenterY() const
Returns the world y coordinate of the center of the box.
void GetEnd(double *xyz) const
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
bool WireSorter(geo::WireGeo const &w1, geo::WireGeo const &w2)
void LocalToWorld(const double *opdet, double *world) const
Transform point from local optical detector frame to world frame.
physics associatedGroupsWithLeft p1
Encapsulate the construction of a single detector plane.