6 #include "art/Framework/Principal/Event.h"
7 #include "art/Framework/Principal/Handle.h"
8 #include "art/Framework/Services/Registry/ServiceHandle.h"
9 #include "art/Persistency/Common/PtrMaker.h"
10 #include "art/Utilities/ToolMacros.h"
11 #include "cetlib/cpu_timer.h"
12 #include "fhiclcpp/ParameterSet.h"
13 #include "messagefacility/MessageLogger/MessageLogger.h"
51 void configure(
const fhicl::ParameterSet&)
override;
77 if (pset.has_key(
"Box")) {
78 std::array<double, 6> box_config = pset.get<std::array<double, 6>>(
"Box");
80 fBox =
geo::BoxBoundedGeo(box_config[0], box_config[1], box_config[2], box_config[3], box_config[4], box_config[5]);
87 std::cout <<
"Detector Box." << std::endl;
98 if (box_intersections.size() != 2)
return false;
100 TVector3
A = box_intersections[0];
101 TVector3 B = box_intersections[1];
104 if ((flux.
pos.Vect() -
A).Mag() < (A-B).Mag() && (flux.
pos.Vect() - B).Mag() < (A-B).Mag()) {
105 throw cet::exception(
"RayTraceBox Exception",
"Input portal flux starts inside detector volume: "
113 if (flux.
mom.Vect().Unit().Dot((A - flux.
pos.Vect()).Unit()) < 0.) {
114 std::cout <<
"RAYTRACE: MeVPrtl points wrong way" << std::endl;
118 if ((flux.
pos.Vect() -
A).Mag() < (flux.
pos.Vect() - B).Mag()) {
119 intersection = {
A, B};
122 intersection = {B, A};
Utilities related to art service access.
const geo::GeometryCore * geometry
double MinX() const
Returns the world x coordinate of the start of the box.
geo::BoxBoundedGeo DetectorEnclosureBox(std::string const &name="volDetEnclosure") const
double MaxX() const
Returns the world x coordinate of the end of the box.
bool IntersectDetector(MeVPrtlFlux &flux, std::array< TVector3, 2 > &intersection, double &weight) override
double MaxWeight() override
Access the description of detector geometry.
double MinZ() const
Returns the world z coordinate of the start of the box.
IMeVPrtlStage interface class definiton. General interface behind each stage. Provides random number ...
Description of geometry of one entire detector.
IRayTrace interface class definiton.
Provides a base class aware of world box coordinates.
double MaxY() const
Returns the world y coordinate of the end of the box.
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
RayTraceBox class definiton.
std::string to_string(WindowPattern const &pattern)
double MaxZ() const
Returns the world z coordinate of the end of the box.
~RayTraceBox()
Destructor.
RayTraceBox(fhicl::ParameterSet const &pset)
Constructor.
std::vector< TVector3 > GetIntersections(TVector3 const &TrajectoryStart, TVector3 const &TrajectoryDirect) const
Calculates the entry and exit points of a trajectory on the box surface.
void configure(const fhicl::ParameterSet &) override
Interface for configuring the particular algorithm tool.
This provides an interface for an art tool which ray traces "Prtl" (massive) particles from their pro...
double MinY() const
Returns the world y coordinate of the start of the box.
art framework interface to geometry description
BEGIN_PROLOG could also be cout