114#include "TRestAxionWolterOptics.h"
123#include "TRestPhysics.h"
153 RESTDebug <<
"Entering TRestAxionWolterOptics constructor( cfgFileName, name )" <<
RESTendl;
180 for (
unsigned int n = 0; n <
fAlpha.size(); n++)
188 if (
fAlpha.size() == 0)
return;
200 for (
unsigned int n = 0; n <
fAlpha.size(); n++)
210 std::vector<Double_t> inner, outer;
211 for (
unsigned int n = 0; n <
fR1.size() - 1; n++) {
213 outer.push_back(
fR1[n + 1]);
229 for (
unsigned int n = 0; n <
fR3.size() - 1; n++) {
231 outer.push_back(
fR3[n + 1]);
247 for (
unsigned int n = 0; n <
fR5.size() - 1; n++) {
249 outer.push_back(
fR5[n + 1]);
269 RESTDebug <<
"--> Entering TRestAxionWolterOptics::FirstMirrorReflection" <<
RESTendl;
270 RESTDebug <<
"Mirror: " << mirror <<
RESTendl;
272 RESTError <<
"TRestAxionWolterOptics::FirstMirrorReflection. Mirror index cannot be negative!"
277 if (mirror >= 0 && (
unsigned int)mirror >=
fFrontVertex.size()) {
278 RESTError <<
"TRestAxionWolterOptics::FirstMirrorReflection. Mirror index above number of mirrors!"
294 RESTDebug <<
"TRestAxionWolterOptics::FirstMirrorReflection. No interaction!" <<
RESTendl;
302 RESTDebug <<
"Cone normal: (" << coneNormal.X() <<
", " << coneNormal.Y() <<
", " << coneNormal.Z() <<
")"
307 RESTDebug <<
"<-- Exiting TRestAxionWolterOptics::FirstMirrorReflection" <<
RESTendl;
320 RESTError <<
"TRestAxionWolterOptics::FirstMirrorReflection. Mirror index cannot be negative!"
325 if (mirror >= 0 && (
unsigned int)mirror >=
fFrontVertex.size()) {
326 RESTError <<
"TRestAxionWolterOptics::FirstMirrorReflection. Mirror index above number of mirrors!"
340 RESTDebug <<
"TRestAxionWolterOptics::SecondMirrorReflection. No interaction!" <<
RESTendl;
367 RESTWarning <<
"TRestAxionWolterOptics requires usually a TRestSpiderMask definition" <<
RESTendl;
384 if (
fR3.size() > 0) {
385 for (
unsigned int n = 0; n <
fR3.size(); n++) {
389 std::cout <<
"## R1\tdelta R1\tR3\tR5\tdelta R5\talpha\tCosAlpha\tFrontVertex\tBackVertex"
392 std::cout <<
fR1[n] <<
"\t" << dR1 <<
"\t" <<
fR3[n] <<
"\t" <<
fR5[n] <<
"\t" << dR5 <<
"\t"
418 std::vector<TGraph*> graphCollection;
419 for (
unsigned int mirror = 0; mirror <
fR3.size(); mirror++) {
420 TGraph* gr =
new TGraph();
424 gr->SetPoint(0, -lX,
fR1[mirror]);
425 gr->SetPoint(1, 0,
fR3[mirror]);
426 gr->SetPoint(2, lX,
fR5[mirror]);
428 gr->GetXaxis()->SetLimits(-3.5 * lX, 3.5 * lX);
429 gr->GetHistogram()->SetMaximum(
fR1.back() * 1.15);
430 gr->GetHistogram()->SetMinimum(
fR1.front() * 0.8);
432 gr->GetXaxis()->SetTitle(
"Z [mm]");
433 gr->GetXaxis()->SetTitleSize(0.04);
434 gr->GetXaxis()->SetLabelSize(0.04);
435 gr->GetXaxis()->SetNdivisions(5);
436 gr->GetYaxis()->SetTitle(
"R [mm]");
437 gr->GetYaxis()->SetTitleOffset(1.4);
438 gr->GetYaxis()->SetTitleSize(0.04);
439 gr->GetYaxis()->SetLabelSize(0.04);
441 gr->SetLineColor(20 + mirror % 20);
An abstract class to define common optics parameters and methods.
Bool_t fSecondInteraction
During the photon propagation it tells us if the photon interacted in the second mirror.
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.
TVector3 fMiddleDirection
The particle position at the optics plane middle.
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.
TRestCombinedMask * fExitMask
The exit optical mask that defines a pattern with regions identified with a number.
virtual void Initialize()
Initialization of TRestAxionOptics members.
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...
void InitFromConfigFile()
Initialization of TRestAxionOptics field members through a RML file.
TVector3 fSecondInteractionPosition
The particle position at the back mirror interaction point.
TRestCombinedMask * fEntranceMask
The entrance optical mask that defines a pattern with regions identified with a number.
TRandom3 * fRandom
Random number generator.
Int_t GetMirror()
It returns the mirror index to be used in the photon reflection.
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 that calculates the reflection path of X-rays through a Wolter 1 telescope.
std::vector< Double_t > fXSep
std::vector< Double_t > fBackVertex
The Z-position of the cone vertex defined by the back mirrors.
TRestRingsMask * fEntranceRingsMask
The rings structure to be used at entrance as an optical opaque mask.
Double_t GetEntrancePositionZ() override
It returns the entrance Z-position defined by the optical axis.
std::vector< Double_t > fR3
Radius R3 in mm. See schematic figure.
std::vector< Double_t > fR4
Radius R4 in mm. See schematic figure.
std::vector< Double_t > fAlpha
Mirror angle (alpha) in radians. See schematic figure.
std::vector< Double_t > GetR4()
It returns a vector with the values of R4.
TRestAxionWolterOptics()
Default constructor.
std::vector< Double_t > GetThickness()
It returns a vector with the values of mirror thickness.
std::vector< Double_t > GetR2()
It returns a vector with the values of R2.
std::vector< Double_t > fThickness
Mirror thickness in mm. See schematic figure.
void PrintSpider()
It prints out the spider mask common to all the optical planes.
void InitFromConfigFile() override
Initialization of TRestAxionWolterOptics field members through a RML file.
TRestRingsMask * fExitRingsMask
The rings structure to be used at entrance as an optical opaque mask.
Int_t SecondMirrorReflection(const TVector3 &pos, const TVector3 &dir) override
Implementation of first mirror interaction. It updates fSecondInteractionPosition and fExitDirection ...
TRestRingsMask * fMiddleRingsMask
The rings structure to be used at entrance as an optical opaque mask.
void PrintMetadata() override
Prints on screen the information about the metadata members of TRestAxionWolterOptics.
std::vector< Double_t > fCosAlpha
Mirror pre-calculated cosine angle (alpha). See schematic figure.
std::vector< Double_t > GetR5()
It returns a vector with the values of R5.
void PrintParameters()
It prints out the Wolter (relevant) parameters extracted from the optics data file,...
std::vector< Double_t > GetAlpha()
It returns a vector with the values of alpha.
std::vector< Double_t > fR2
Radius R2 in mm. See schematic figure.
TPad * DrawMirrors() override
A method to to draw an optics schematic including the mirrors geometry.
std::vector< Double_t > fR5
Radius R5 in mm. See schematic figure.
Int_t FirstMirrorReflection(const TVector3 &pos, const TVector3 &dir) override
Implementation of first mirror interaction. It updates fFirstInteractionPosition and fMiddleDirection...
TRestSpiderMask * fSpiderMask
The spider structure to be used as an optical opaque mask (common to all planes)
std::vector< Double_t > GetR3()
It returns a vector with the values of R3.
std::vector< Double_t > fCosAlpha_3
Mirror pre-calculated cosine angle (alpha). See schematic figure.
std::vector< Double_t > fR1
Entrance radius R1 in mm. See schematic figure.
~TRestAxionWolterOptics()
Default destructor.
std::vector< Double_t > GetR1()
It returns a vector with the values of R1.
void Initialize() override
Initialization of TRestAxionWolterOptics members.
std::vector< Double_t > fFrontVertex
The Z-position of the cone vertex defined by the front mirrors.
Double_t GetExitPositionZ() override
It returns the exit Z-position defined by the optical axis.
A class used to define a rings mask pattern.
void SetRadii(const std::vector< Double_t > &innerR, const std::vector< Double_t > &outterR)
It allows to redefine the inner and outter rings radii directly.
A class used to define and generate a spider structure mask.
void PrintMetadata() override
Prints on screen the complete information about the metadata members from this class.
@ REST_Info
+show most of the information for each steps
This namespace serves to define physics constants and other basic physical operations.
TVector3 MoveByDistance(const TVector3 &pos, const TVector3 &dir, Double_t d)
This method transports a position pos by a distance d in the direction defined by dir.
TVector3 GetConeNormal(const TVector3 &pos, const Double_t alpha, const Double_t R=0)
This method will return a vector that is normal to the cone surface. The position pos should be at th...
Double_t GetConeVectorIntersection(const TVector3 &pos, const TVector3 &dir, const TVector3 &d, const TVector3 &v, const Double_t cosTheta)
This method will find the intersection of the trajectory defined by the vector starting at pos and mo...
TVector3 GetVectorReflection(const TVector3 &dir, const TVector3 &n)
This method will return the reflected vector respect to a plane defined by its normal vector n....