Jpp  18.3.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DomCrossing.hh
Go to the documentation of this file.
1 /**
2  * \author mdejong
3  */
4 
5  /**
6  * Class to check whether a photon emitted from a position along the
7  * z-axis crosses a DOM (approximated by a disc)
8  * first, inefficient version
9  */
10 
11  class DomCrossing {
12 
13  private:
14  double __Rdom;
15  public:
16 
17  DomCrossing(const double Rdom):__Rdom(Rdom)
18  {}
20  {}
21 
22  bool operator()(const double theta,
23  const double phi,
24  const double z,
25  const double R,
26  const double dscat)
27  {
28  using namespace JGEOMETRY3D;
29 
30  const JVector3D p0(R,0,0);
31  const JVector3D n(sin(theta),0,cos(theta));
32  const JVector3D l0(0,0,z);
33  const JVector3D l(sin(theta)*cos(phi),sin(theta)*sin(phi),cos(theta));
34 
35  const double d = JVector3D(p0-l0).getDot(n)/l.getDot(n);
36 
37  if(d<0) return false;
38 
39  const JVector3D crossing = l0+JVector3D(l.getX()*d,l.getY()*d,l.getZ()*d);
40 
41  const double hitdist = (p0-crossing).getLength();
42 
43  const double dist = sqrt(z*z+R*R);
44 
45  if(hitdist<__Rdom&&dscat>=dist) return true;
46  else return false;
47 
48  }
49 
50  };
51 
52  // DomCrossing shadow;
then usage set_variable ACOUSTICS_WORKDIR $WORKDIR set_variable FORMULA sin([0]+2 *$PI *([1]+[2]*x)*x)" set_variable DY 1.0e-8 mkdir $WORKDIR for DETECTOR in $DETECTORS[*]
const int n
Definition: JPolint.hh:786
bool operator()(const double theta, const double phi, const double z, const double R, const double dscat)
Definition: DomCrossing.hh:22
Data structure for vector in three dimensions.
Definition: JVector3D.hh:34
double __Rdom
Definition: DomCrossing.hh:14
double getY() const
Get y position.
Definition: JVector3D.hh:104
Class to check whether a photon emitted from a position along the z-axis crosses a DOM (approximated ...
Definition: DomCrossing.hh:11
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition: JDataQuality.sh:41
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:47
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getDot(const JVector3D &vector) const
Get dot product.
Definition: JVector3D.hh:282
double getZ() const
Get z position.
Definition: JVector3D.hh:115
DomCrossing(const double Rdom)
Definition: DomCrossing.hh:17