80      for( 
iterator it=begin() ; it!=end() ; ++it )
 
 
   92      for( const_iterator it=begin() ; it!=end() ; ++it )
 
 
 
  109    for(  ; v2!=end() ; ++v1,++v2 ) {
 
 
  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 ) {
 
 
Data structure for polyline in three dimensions.
 
Data structure for position in three dimensions.
 
double getY() const
Get y position.
 
double getLength() const
Get length.
 
double getZ() const
Get z position.
 
double getX() const
Get x position.
 
Data structure for normalised vector in three dimensions.
 
double getDot(const JVersor3D &versor) const
Get dot product.
 
Interface for binary input.
 
Forward declaration of binary output.
 
Interface for binary output.
 
std::vector< JPosition3D > getPointsWithY(double y)
return all coordinates where the photon path has the given y
 
std::vector< JPosition3D > getPointsWithZ(double z)
return all coordinates where the photon path has the given z
 
bool hitsSphere(const JPosition3D &pos, double r)
Returns whether the photon path intersects a sphere of radius r at position pos.
 
JIO::JReader & read(JIO::JReader &in)
Read from input.
 
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...
 
string getString()
get a string with the path vertex positions
 
JPhotonPath()
default constructor
 
std::vector< JPosition3D > getPointsWithX(double x)
return all coordinates where the photon path has the given x
 
double getLength()
get the total path length
 
JPhotonPath(int _nscat)
constructor to actually be used
 
JIO::JWriter & write(JIO::JWriter &out) const
Write to output.
 
Auxiliary classes and methods for 2D geometrical objects and operations.
 
Auxiliary classes and methods for 3D geometrical objects and operations.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).