23#ifndef _TRestAxionOptics
24#define _TRestAxionOptics
26#include <TRestAxionOpticsMirror.h>
27#include <TRestCombinedMask.h>
28#include <TRestMetadata.h>
146 virtual Double_t
FindFocal(Double_t from, Double_t to, Double_t energy, Double_t precision = 1,
147 Bool_t recalculate =
false, Int_t particles = 5000);
149 Double_t
CalculateSpotSize(Double_t energy, Double_t z, Int_t particles = 15000);
151 TPad*
CreatePad(Int_t nx = 1, Int_t ny = 1);
155 TPad*
DrawScatterMaps(Double_t z, Double_t energy = 0, Double_t deviation = 0, Int_t particles = 1000,
156 Double_t focalHint = 7500);
158 TPad*
DrawDensityMaps(Double_t z, Double_t energy = 0, Double_t deviation = 0, Int_t particles = 1000,
159 Double_t focalHint = 7500);
161 Double_t
PropagatePhoton(
const TVector3& pos,
const TVector3& dir, Double_t energy);
A metadata class accessing the Henke database to load reflectivity data.
An abstract class to define common optics parameters and methods.
TVector3 GetLastGoodPosition()
It returns the last valid particle position known in the particle tracking.
Bool_t fSecondInteraction
During the photon propagation it tells us if the photon interacted in the second mirror.
void PrintEntranceMask()
Prints on screen the mask used on the entrance optics plane.
virtual Double_t FindFocal(Double_t from, Double_t to, Double_t energy, Double_t precision=1, Bool_t recalculate=false, Int_t particles=5000)
It implements a generic method to identify the optimum focal point. It can be reimplemented at each s...
void PrintPhotonTrackingSummary()
Prints the positions taken by the photon after ray-tracing that should have been updated using the me...
TVector3 fMiddlePosition
The particle position at the optics plane middle.
Int_t fCurrentMirror
During the photon propagation it keeps track of the active mirror shell.
TPad * fPad
A pad pointer to be used by the drawing methods.
TRestCombinedMask * fMiddleMask
The middle optical mask that defines a pattern with regions identified with a number.
Bool_t IsSecondMirrorReflection()
It returns true if the photon got reflected in the second mirror.
std::vector< std::vector< Double_t > > fOpticsData
The optics data table extracted from fOpticsFile.
TVector3 fMiddleDirection
The particle position at the optics plane middle.
Double_t PropagatePhoton(const TVector3 &pos, const TVector3 &dir, Double_t energy)
Propagating photon.
virtual Int_t SecondMirrorReflection(const TVector3 &pos, const TVector3 &dir)=0
It updates the values fSecondInteractionPosition and fExitDirection. Returns 0 if is not in region.
Bool_t fFirstInteraction
During the photon propagation it tells us if the photon interacted in the first mirror.
TVector3 fExitDirection
The particle position at the optics plane exit.
Double_t PropagateMonteCarloPhoton(Double_t energy, Double_t deviation)
It will produce a MonteCarlo photon spatially distributed in XY as defined by the GetRadialLimits met...
TRestCombinedMask * fExitMask
The exit optical mask that defines a pattern with regions identified with a number.
TRestCombinedMask *const & GetMiddleMask() const
Returns a pointer to access directly the middle mask information.
Double_t GetEntranceAngle()
It returns the entrance angle to the optical axis (in radians).
virtual void Initialize()
Initialization of TRestAxionOptics members.
Double_t GetPhotonReflectivity(Double_t energy)
A prototype method to be implemented by specific optics to draw an schematic including the mirrors ge...
TRestAxionOpticsMirror * fMirrorProperties
The mirror properties.
Int_t TransportToEntrance(const TVector3 &pos, const TVector3 &dir)
It moves the incoming particle at the entrance of the optics plane and returns the region number wher...
Int_t TransportToMiddle(const TVector3 &pos, const TVector3 &dir)
It moves the incoming particle to the middle of the optics plane and returns the region number where ...
virtual std::pair< Double_t, Double_t > GetRadialLimits()=0
It returns the lower/higher radius range where photons are allowed.
TRestAxionOptics()
Default constructor.
virtual Double_t GetEntrancePositionZ()=0
It returns the entrance Z-position defined by the optical axis.
Bool_t IsFirstMirrorReflection()
It returns true if the photon got reflected in the first mirror.
TVector3 fExitPosition
The particle position at the optics plane exit.
Double_t fMirrorLength
The mirror length. If all mirrors got the same length. Otherwise will be zero.
TPad * CreatePad(Int_t nx=1, Int_t ny=1)
A prototype method to be implemented by specific optics to draw an schematic including the mirrors ge...
Double_t fFocal
The calculated focal in mm. It is updated by the method TRestAxionOptics::FindFocal.
void PrintMasks()
Prints on screen the 3-optical masks used on the optics planes.
TVector3 fEntrancePosition
The particle position at the optics plane entrance.
TPad * DrawParticleTracks(Double_t deviation=0, Int_t particles=10)
A method to draw an optics schematic including the mirrors geometry, and few photon tracks....
TVector3 GetMiddleDirection()
Returns the middle position from the latest propagated photon.
std::string fOpticsFile
An optics file that contains all the specific optics parameters.
TVector3 GetExitDirection()
Returns the exit position from the latest propagated photon.
void InitFromConfigFile()
Initialization of TRestAxionOptics field members through a RML file.
TPad * DrawDensityMaps(Double_t z, Double_t energy=0, Double_t deviation=0, Int_t particles=1000, Double_t focalHint=7500)
It implements a generic method to identify the optimum focal point. It can be reimplemented at each s...
void PrintMiddleMask()
Prints on screen the mask used on the middle optics plane.
TVector3 GetLastGoodDirection()
It returns the last valid particle direction known in the particle tracking.
TVector3 fSecondInteractionPosition
The particle position at the back mirror interaction point.
TVector3 GetEntranceDirection()
Returns the entrance position from the latest propagated photon.
TRestCombinedMask * fEntranceMask
The entrance optical mask that defines a pattern with regions identified with a number.
TRestCombinedMask *const & GetEntranceMask() const
Returns a pointer to access directly the entrance mask information.
virtual void SetMirror()=0
It must be implemented at the inherited optics, making use of fEntrancePosition.
virtual Double_t GetExitPositionZ()=0
It returns the exit Z-position defined by the optical axis.
TVector3 GetMiddlePosition()
Returns the middle position from the latest propagated photon.
void ResetPositions()
It reinitializes particle positions and directions at the different optical regions.
void PrintMirror()
Prints on screen the 3-optical masks used on the optics planes.
TVector3 GetExitPosition()
Returns the exit position from the latest propagated photon.
TRandom3 * fRandom
Random number generator.
void PrintExitMask()
Prints on screen the mask used on the exit optics plane.
TRestCombinedMask *const & GetExitMask() const
Returns a pointer to access directly the exit mask information.
Int_t TransportToExit(const TVector3 &pos, const TVector3 &dir)
It moves the incoming particle to the exit of the optics plane and returns the region number where th...
TVector3 GetEntrancePosition()
Returns the entrance position from the latest propagated photon.
virtual TPad * DrawMirrors()=0
It draws the mirrors using a TGraph. To be implemented at the inherited class.
virtual Int_t FirstMirrorReflection(const TVector3 &pos, const TVector3 &dir)=0
It updates the values fFirstInteractionPosition and fMiddleDirection. Returns 0 if is not in region.
TPad * DrawScatterMaps(Double_t z, Double_t energy=0, Double_t deviation=0, Int_t particles=1000, Double_t focalHint=7500)
It implements a generic method to identify the optimum focal point. It can be reimplemented at each s...
Int_t GetMirror()
It returns the mirror index to be used in the photon reflection.
~TRestAxionOptics()
Default destructor.
TVector3 fOriginPosition
The particle position at the origin.
TRestAxionOpticsMirror *const & GetMirrorProperties() const
Returns a pointer to access directly the exit mask information.
Double_t CalculateSpotSize(Double_t energy, Double_t z, Int_t particles=15000)
It measures the spot size through Monte Carlo at a given plane given by z. If z=0 this method will ch...
Int_t GetNumberOfReflections()
It returns the total number of reflections. Considering maximum 1-reflection per mirror.
TVector3 fFirstInteractionPosition
The particle position at the front mirror interaction point.
void PrintMetadata()
Prints on screen the information about the metadata members of TRestAxionOptics.
TVector3 fEntranceDirection
The particle position at the optics plane entrance.
A class used to define and generate a combined structure mask.