32 #include "TLorentzVector.h" 37 class ROOTGeomAnalyzer;
65 PlaneParam(Double_t ain=0, Double_t
bin=0, Double_t cin=0, Double_t din=0)
66 {
a = ain;
b =
bin;
c = cin;
d = din; Normalize(); }
68 {
a = abcd[0];
b = abcd[1];
c = abcd[2];
d = abcd[3]; Normalize(); }
71 { Double_t
mag = TMath::Sqrt(
a*
a+
b*
b+
c*
c);
72 if (mag>0) {
a /= mag;
b /= mag; c /= mag;
d /= mag; } }
73 Double_t
Vn(
const TVector3& raybase)
const 74 {
return raybase.X()*
a + raybase.Y()*
b + raybase.Z()*
c +
d; }
75 Double_t
Vd(
const TVector3& raycos)
const 76 {
return raycos.Px()*
a + raycos.Py()*
b + raycos.Pz()*
c; }
77 Bool_t
IsValid()
const {
return (
a != 0 ||
b != 0 ||
c != 0 ); }
79 void Print(std::ostream&
stream)
const;
80 friend std::ostream&
operator<< (std::ostream& stream,
97 virtual RayIntercept Intercept(
const TVector3& start,
const TVector3&
dir)
const = 0;
101 virtual void Print(std::ostream&
stream)
const = 0;
102 friend std::ostream&
operator<< (std::ostream& stream,
109 FidSphere(
const TVector3&
center, Double_t radius) : fCenter(center), fSRadius(radius) { ; }
110 RayIntercept Intercept(
const TVector3& start,
const TVector3&
dir)
const;
112 void Print(std::ostream&
stream)
const;
122 : fCylBase(base), fCylAxis(axis), fCylRadius(radius), fCylCap1(cap1), fCylCap2(cap2) { ; }
123 RayIntercept Intercept(
const TVector3& start,
const TVector3&
dir)
const;
124 RayIntercept InterceptUncapped(
const TVector3& start,
const TVector3& dir)
const;
126 void Print(std::ostream&
stream)
const;
141 void clear() { fPolyFaces.clear(); }
142 RayIntercept Intercept(
const TVector3& start,
const TVector3&
dir)
const;
144 void Print(std::ostream&
stream)
const;
152 #endif // _FID_SHAPE_H_ Some simple volumes that know how to calculate where a ray intercepts them.
Int_t fSurfOut
what surface was hit on way in
Double_t Vn(const TVector3 &raybase) const
THE MAIN GENIE PROJECT NAMESPACE
Bool_t fIsHit
distance along ray to exit fid volume
PlaneParam(Double_t ain=0, Double_t bin=0, Double_t cin=0, Double_t din=0)
PlaneParam fCylCap1
radius of cylinder
FidPolyhedron()
convex polyhedron is made of multiple planar equations
Int_t fSurfIn
was the volume hit
A ROOT/GEANT4 geometry driver.
PlaneParam(Double_t *abcd)
Double_t fCylRadius
direction cosines of cylinder axis
TVector3 fCylAxis
base point on cylinder axis
FidCylinder(const TVector3 &base, const TVector3 &axis, Double_t radius, const PlaneParam &cap1, const PlaneParam &cap2)
Double_t fDistOut
distance along ray to enter fid volume
QTextStream & bin(QTextStream &s)
Double_t fSRadius
center of the sphere
std::vector< PlaneParam > fPolyFaces
PlaneParam fCylCap2
define a plane for 1st cylinder cap
FidSphere(const TVector3 ¢er, Double_t radius)
void push_back(const PlaneParam &pln)
std::ostream & operator<<(std::ostream &stream, const genie::geometry::PlaneParam &pparam)
Double_t Vd(const TVector3 &raycos) const