Public Member Functions | Protected Attributes | List of all members
genie::geometry::FidSphere Class Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/genie/v3_00_06_p01/Linux64bit+2.6-2.12-e17-debug/GENIE-Generator/src/Tools/Geometry/FidShape.h"

Inheritance diagram for genie::geometry::FidSphere:
genie::geometry::FidShape

Public Member Functions

 FidSphere (const TVector3 &center, Double_t radius)
 
RayIntercept Intercept (const TVector3 &start, const TVector3 &dir) const
 
void ConvertMaster2Top (const ROOTGeomAnalyzer *rgeom)
 
void Print (std::ostream &stream) const
 

Protected Attributes

TVector3 fCenter
 
Double_t fSRadius
 center of the sphere More...
 

Detailed Description

Definition at line 108 of file FidShape.h.

Constructor & Destructor Documentation

genie::geometry::FidSphere::FidSphere ( const TVector3 &  center,
Double_t  radius 
)
inline

Definition at line 110 of file FidShape.h.

References dir, Print(), febshutoff_auto::start, and runNovaSAM::stream.

110 : fCenter(center), fSRadius(radius) { ; }
Double_t radius
Double_t fSRadius
center of the sphere
Definition: FidShape.h:116

Member Function Documentation

void FidSphere::ConvertMaster2Top ( const ROOTGeomAnalyzer rgeom)
virtual

derived classes must implement the ConvertMaster2Top() method which transforms the shape specification from master coordinates to "top vol"

Implements genie::geometry::FidShape.

Definition at line 102 of file FidShape.cxx.

References genie::geometry::ROOTGeomAnalyzer::Master2Top().

103 {
104  rgeom->Master2Top(fCenter);
105 }
virtual void Master2Top(TVector3 &v) const
RayIntercept FidSphere::Intercept ( const TVector3 &  start,
const TVector3 &  dir 
) const
virtual

derived classes must implement the Intercept() method which calculates the entry/exit point of a ray w/ the shape

Implements genie::geometry::FidShape.

Definition at line 73 of file FidShape.cxx.

References d, dir, genie::geometry::RayIntercept::fDistIn, genie::geometry::RayIntercept::fDistOut, genie::geometry::RayIntercept::fIsHit, genie::geometry::RayIntercept::fSurfIn, genie::geometry::RayIntercept::fSurfOut, ana::Sqrt(), and febshutoff_auto::start.

74 {
75  // A new neutrino ray has been set, calculate the entrance/exit distances.
76  // This sets fDistIn/fDistOut for an sphere
77  RayIntercept intercept;
78 
79  TVector3 oc = fCenter - start;
80  Double_t loc2 = oc.Mag2();
81  Double_t r2 = fSRadius*fSRadius;
82  //LOG("GeomVolSel", pNOTICE) << " loc2 = " << loc2 << " r2 " << r2;
83  // if ( loc2 > r2 ) ray originates outside the sphere
84  const TVector3& d = dir;
85  Double_t d2 = d.Mag2();
86  Double_t tca = oc.Dot(d)/d2;
87  //if ( tca < 0.0 ) sphere _center_ behind the ray orgin
88  Double_t lhc2 = ( r2 -loc2 )/d2 + tca*tca;
89  if ( lhc2 < 0.0 ) return intercept; // ray misses the sphere
90  intercept.fIsHit = true;
91  Double_t lhc = TMath::Sqrt(lhc2);
92 
93  intercept.fDistIn = tca - lhc;
94  intercept.fSurfIn = 1;
95  intercept.fDistOut = tca + lhc;
96  intercept.fSurfOut = 1;
97 
98  return intercept;
99 }
Int_t fSurfOut
what surface was hit on way in
Definition: FidShape.h:55
Bool_t fIsHit
distance along ray to exit fid volume
Definition: FidShape.h:53
Int_t fSurfIn
was the volume hit
Definition: FidShape.h:54
Float_t d
Definition: plot.C:236
TDirectory * dir
Definition: macro.C:5
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:326
Double_t fDistOut
distance along ray to enter fid volume
Definition: FidShape.h:52
Double_t fSRadius
center of the sphere
Definition: FidShape.h:116
void FidSphere::Print ( std::ostream &  stream) const
virtual

Implements genie::geometry::FidShape.

Definition at line 108 of file FidShape.cxx.

109 {
110  stream << "FidSphere @ ["
111  << fCenter.X() << ","
112  << fCenter.Y() << ","
113  << fCenter.Z() << "] r = " << fSRadius;
114 }
Double_t fSRadius
center of the sphere
Definition: FidShape.h:116

Member Data Documentation

TVector3 genie::geometry::FidSphere::fCenter
protected

Definition at line 115 of file FidShape.h.

Double_t genie::geometry::FidSphere::fSRadius
protected

center of the sphere

Definition at line 116 of file FidShape.h.


The documentation for this class was generated from the following files: