RayTraceBox class definiton.
More...
RayTraceBox class definiton.
Definition at line 38 of file RayTraceBox_tool.cc.
evgen::ldm::RayTraceBox::RayTraceBox |
( |
fhicl::ParameterSet const & |
pset | ) |
|
Constructor.
Definition at line 62 of file RayTraceBox_tool.cc.
void configure(const fhicl::ParameterSet &) override
Interface for configuring the particular algorithm tool.
IMeVPrtlStage(const char *name)
evgen::ldm::RayTraceBox::~RayTraceBox |
( |
| ) |
|
void evgen::ldm::RayTraceBox::configure |
( |
const fhicl::ParameterSet & |
| ) |
|
|
overridevirtual |
Interface for configuring the particular algorithm tool.
- Parameters
-
ParameterSet | The input set of parameters for configuration |
Implements evgen::ldm::IMeVPrtlStage.
Definition at line 75 of file RayTraceBox_tool.cc.
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;
88 std::cout <<
"X " << fBox.MinX() <<
" " << fBox.MaxX() << std::endl;
89 std::cout <<
"Y " << fBox.MinY() <<
" " << fBox.MaxY() << std::endl;
90 std::cout <<
"Z " << fBox.MinZ() <<
" " << fBox.MaxZ() << std::endl;
const geo::GeometryCore * geometry
geo::BoxBoundedGeo DetectorEnclosureBox(std::string const &name="volDetEnclosure") const
Description of geometry of one entire detector.
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
BEGIN_PROLOG could also be cout
bool evgen::ldm::RayTraceBox::IntersectDetector |
( |
MeVPrtlFlux & |
flux, |
|
|
std::array< TVector3, 2 > & |
intersection, |
|
|
double & |
weight |
|
) |
| |
|
overridevirtual |
Implements evgen::ldm::IRayTrace.
Definition at line 95 of file RayTraceBox_tool.cc.
96 std::vector<TVector3> box_intersections =
fBox.
GetIntersections(flux.pos.Vect(), flux.mom.Vect().Unit());
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};
std::string to_string(WindowPattern const &pattern)
std::vector< TVector3 > GetIntersections(TVector3 const &TrajectoryStart, TVector3 const &TrajectoryDirect) const
Calculates the entry and exit points of a trajectory on the box surface.
BEGIN_PROLOG could also be cout
double evgen::ldm::RayTraceBox::MaxWeight |
( |
| ) |
|
|
inlineoverridevirtual |
The documentation for this class was generated from the following file: