Go to the documentation of this file.    1 #ifndef H_J_PHOTON_PATH 
    2 #define H_J_PHOTON_PATH 
   80       for( 
iterator it=begin() ; it!=end() ; ++it )
 
   92       for( const_iterator it=begin() ; it!=end() ; ++it )
 
  109     for(  ; v2!=end() ; ++v1,++v2 ) {
 
  111       L += (*v2-*v1).getLength() ;
 
  125     for( 
unsigned int i=1 ; i<size() ; ++i ) {
 
  128       if( (v1.
getX()>x) != (v2.
getX()>x) ) {
 
  130         res.push_back( v1+frac*(v2-v1) ) ;
 
  138     for( 
unsigned int i=0 ; i<size() ; ++i ) {
 
  140       if( i+1!=size() ) oss << 
", " ;
 
  149     for( 
unsigned int i=1 ; i<size() ; ++i ) {
 
  152       if( (v1.
getY()>y) != (v2.
getY()>y) ) {
 
  154         res.push_back( v1+frac*(v2-v1) ) ;
 
  164     for( 
unsigned int i=1 ; i<size() ; ++i ) {
 
  167       if( (v1.
getZ()>z) != (v2.
getZ()>z) ) {
 
  169         res.push_back( v1+frac*(v2-v1) ) ;
 
  178     for( 
unsigned int i=1 ; i<size() ; ++i ) {
 
  189       double r_to_center = to_center.
getLength() ;
 
  192       double ct = dir_seg.
getDot(dir_to_center) ;
 
  195       if( 1-ct*ct > 
r*
r/(r_to_center*r_to_center) ) {
 
  204       double D = sqrt( r_to_center*r_to_center*(ct*ct-1) + 
r*
r ) ;
 
  205       double xi1 = -r_to_center*ct + D ;
 
  206       if( xi1>0 && xi1<Lseg ) 
return true ;
 
  207       double xi2 = -r_to_center*ct - D ;
 
  208       if( xi2>0 && xi2<Lseg ) 
return true ;
 
  215     for( 
unsigned int i=1 ; i<size() ; ++i ) {
 
  226       double r_to_center = to_center.
getLength() ;
 
  229       double ct = dir_seg.
getDot(dir_to_center) ;
 
  232       if( 1-ct*ct > 
r*
r/(r_to_center*r_to_center) ) {
 
  241       double D = sqrt( r_to_center*r_to_center*(ct*ct-1) + 
r*
r ) ;
 
  244       double xi1 = -r_to_center*ct + D ;
 
  245       if( xi1<0 || xi1>Lseg ) {
 
  250       double xi2 = -r_to_center*ct - D ;
 
  252       if( xi2>0 && xi2<Lseg ) {
 
  254         if( xi2<xi1 ) xi1 = xi2 ;
 
  257       if( xi1>0 && xi1<Lseg ) {
 
 
std::vector< JPosition3D > getPointsWithZ(double z)
return all coordinates where the photon path has the given z
 
Interface for binary input.
 
std::vector< JPosition3D > getPointsWithY(double y)
return all coordinates where the photon path has the given y
 
Forward declaration of binary output.
 
double getZ() const
Get z position.
 
JPosition3D getSphereHitPosition(const JPosition3D &pos, double r)
Returns the position where the photon hits a sphere of radius r at position pos. If the photon does n...
 
Data structure for normalised vector in three dimensions.
 
double getLength()
get the total path length
 
Auxiliary classes and methods for 2D geometrical objects and operations.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
Data structure for position in three dimensions.
 
Interface for binary output.
 
double getDot(const JVersor3D &versor) const
Get dot product.
 
std::vector< JPosition3D > getPointsWithX(double x)
return all coordinates where the photon path has the given x
 
JIO::JReader & read(JIO::JReader &in)
Read from input.
 
double getY() const
Get y position.
 
JPhotonPath(int _nscat)
constructor to actually be used
 
Auxiliary classes and methods for 3D geometrical objects and operations.
 
JIO::JWriter & write(JIO::JWriter &out) const
Write to output.
 
double getX() const
Get x position.
 
Data structure for polyline in three dimensions.
 
bool hitsSphere(const JPosition3D &pos, double r)
Returns whether the photon path intersects a sphere of radius r at position pos.
 
double getLength() const
Get length.
 
JPhotonPath()
default constructor
 
string getString()
get a string with the path vertex positions