Module: Detector

This module calculates the possible angles for a particle flying throw a 5 layer detector.
To use this module, it’s enough to create one instance of Detector and use the function Detector.detect (vector).

Classes:
Detector
Layer

Detector:
Functions:
__init__()
detect (vector)

__init__():
Creates 5 instances of CLayer with initvalues {100, 110, 120, 130, 140} which represents the (z-)position of the Layers.

detect (vector):
Loop over all Layers the function CLayer.detect (vector).
Arguments:
phi, theta: represents the angles of the particle starting from the source
phi is for the x-axis [-pi,pi]
theta is for the y-axis [-pi,pi]

Return:
Returns a numpy array with 5 entries, each Tuple has 2 Tuples with a higher and a lower angle bound.
This means:
e.g. returnvalue [a][b][c]
a – [0,4] select Layer
b – 0 is phi, 1 is theta
c – 0 is the upper bound, 1 the lower bound

If a Layer is not hit, the Tuple is “None”
e.g. returnvalue [a] is “((None, None)( None, None))”

Layer:
Functions:
__init__(Position)
detect (vector)

__init__(Position):
Just copy the argument.
Arguments:
Position: Location of the Layer at the z-axis

detect (vector):
Calculate the bounds of hit grid.
Arguments:
phi, theta: represents the angles of the particle starting from the source
phi is for the x-axis [-pi,pi]
theta is for the y-axis [-pi,pi]
Return:
Returns 2 Tuples with a higher and a lower angle bound.
This means:
e.g. returnvalue [a][b]
a – 0 is phi, 1 is theta
b – 0 is the upper bound, 1 the lower bound

If this Layer is not hit, the Tuple is “((None, None)( None, None))”