114 #include "TRestAxionTrueWolterOptics.h"
123 #include "TRestPhysics.h"
153 RESTDebug <<
"Entering TRestAxionTrueWolterOptics 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 TRestAxionTrueWolterOptics::FirstMirrorReflection" <<
RESTendl;
270 RESTDebug <<
"Mirror: " << mirror <<
RESTendl;
272 RESTError <<
"TRestAxionTrueWolterOptics::FirstMirrorReflection. Mirror index cannot be negative!"
277 if (mirror >= 0 && (
unsigned int)mirror >=
fFrontVertex.size()) {
279 <<
"TRestAxionTrueWolterOptics::FirstMirrorReflection. Mirror index above number of mirrors!"
294 RESTDebug <<
"TRestAxionTrueWolterOptics::FirstMirrorReflection. No interaction!" <<
RESTendl;
301 TVector3 paraNormal =
303 RESTDebug <<
"Parabolic normal: (" << paraNormal.X() <<
", " << paraNormal.Y() <<
", " << paraNormal.Z()
308 RESTDebug <<
"<-- Exiting TRestAxionTrueWolterOptics::FirstMirrorReflection" <<
RESTendl;
321 RESTError <<
"TRestAxionTrueWolterOptics::FirstMirrorReflection. Mirror index cannot be negative!"
326 if (mirror >= 0 && (
unsigned int)mirror >=
fFrontVertex.size()) {
328 <<
"TRestAxionTrueWolterOptics::FirstMirrorReflection. Mirror index above number of mirrors!"
334 Double_t focal =
fR3[mirror] / TMath::Tan(4 *
fAlpha[mirror]);
335 Double_t beta = 3 *
fAlpha[mirror];
343 RESTDebug <<
"TRestAxionTrueWolterOptics::SecondMirrorReflection. No interaction!" <<
RESTendl;
350 TVector3 hyperNormal =
371 RESTWarning <<
"TRestAxionTrueWolterOptics requires usually a TRestSpiderMask definition" <<
RESTendl;
388 if (
fR3.size() > 0) {
389 for (
unsigned int n = 0; n <
fR3.size(); n++) {
393 std::cout <<
"## R1\tdelta R1\tR3\tR5\tdelta R5\talpha\tCosAlpha\tFrontVertex\tBackVertex"
396 std::cout <<
fR1[n] <<
"\t" << dR1 <<
"\t" <<
fR3[n] <<
"\t" <<
fR5[n] <<
"\t" << dR5 <<
"\t"
422 std::vector<TGraph*> graphCollection;
423 for (
unsigned int mirror = 0; mirror <
fR3.size(); mirror++) {
424 TGraph* gr =
new TGraph();
428 gr->SetPoint(0, -lX,
fR1[mirror]);
429 gr->SetPoint(1, 0,
fR3[mirror]);
430 gr->SetPoint(2, lX,
fR5[mirror]);
432 gr->GetXaxis()->SetLimits(-3.5 * lX, 3.5 * lX);
433 gr->GetHistogram()->SetMaximum(
fR1.back() * 1.15);
434 gr->GetHistogram()->SetMinimum(
fR1.front() * 0.8);
436 gr->GetXaxis()->SetTitle(
"Z [mm]");
437 gr->GetXaxis()->SetTitleSize(0.04);
438 gr->GetXaxis()->SetLabelSize(0.04);
439 gr->GetXaxis()->SetNdivisions(5);
440 gr->GetYaxis()->SetTitle(
"R [mm]");
441 gr->GetYaxis()->SetTitleOffset(1.4);
442 gr->GetYaxis()->SetTitleSize(0.04);
443 gr->GetYaxis()->SetLabelSize(0.04);
445 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 > fR5
Radius R5 in mm. See schematic figure.
Int_t SecondMirrorReflection(const TVector3 &pos, const TVector3 &dir) override
Implementation of first mirror interaction. It updates fSecondInteractionPosition and fExitDirection ...
std::vector< Double_t > fXSep
std::vector< Double_t > GetAlpha()
It returns a vector with the values of alpha.
Double_t GetEntrancePositionZ() override
It returns the entrance Z-position defined by the optical axis.
std::vector< Double_t > fThickness
Mirror thickness in mm. See schematic figure.
TRestSpiderMask * fSpiderMask
The spider structure to be used as an optical opaque mask (common to all planes)
std::vector< Double_t > fR2
Radius R2 in mm. See schematic figure.
std::vector< Double_t > fR1
Entrance radius R1 in mm. See schematic figure.
std::vector< Double_t > GetR3()
It returns a vector with the values of R3.
void Initialize() override
Initialization of TRestAxionTrueWolterOptics members.
std::vector< Double_t > GetR5()
It returns a vector with the values of R5.
std::vector< Double_t > fAlpha
Mirror angle (alpha) in radians. See schematic figure.
std::vector< Double_t > fR3
Radius R3 in mm. See schematic figure.
std::vector< Double_t > GetR1()
It returns a vector with the values of R1.
~TRestAxionTrueWolterOptics()
Default destructor.
std::vector< Double_t > fCosAlpha_3
Mirror pre-calculated cosine angle (alpha). See schematic figure.
Int_t FirstMirrorReflection(const TVector3 &pos, const TVector3 &dir) override
Implementation of first mirror interaction. It updates fFirstInteractionPosition and fMiddleDirection...
void InitFromConfigFile() override
Initialization of TRestAxionTrueWolterOptics field members through a RML file.
std::vector< Double_t > fR4
Radius R4 in mm. See schematic figure.
void PrintParameters()
It prints out the Wolter (relevant) parameters extracted from the optics data file,...
void PrintMetadata() override
Prints on screen the information about the metadata members of TRestAxionTrueWolterOptics.
TRestRingsMask * fEntranceRingsMask
The rings structure to be used at entrance as an optical opaque mask.
std::vector< Double_t > GetR2()
It returns a vector with the values of R2.
Double_t GetExitPositionZ() override
It returns the exit Z-position defined by the optical axis.
void PrintSpider()
It prints out the spider mask common to all the optical planes.
TRestAxionTrueWolterOptics()
Default constructor.
std::vector< Double_t > fFrontVertex
The Z-position of the cone vertex defined by the front mirrors.
TRestRingsMask * fExitRingsMask
The rings structure to be used at entrance as an optical opaque mask.
std::vector< Double_t > fBackVertex
The Z-position of the cone vertex defined by the back mirrors.
std::vector< Double_t > GetThickness()
It returns a vector with the values of mirror thickness.
TRestRingsMask * fMiddleRingsMask
The rings structure to be used at entrance as an optical opaque mask.
std::vector< Double_t > GetR4()
It returns a vector with the values of R4.
TPad * DrawMirrors() override
A method to to draw an optics schematic including the mirrors geometry.
std::vector< Double_t > fCosAlpha
Mirror pre-calculated cosine angle (alpha). See schematic figure.
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 GetHyperbolicVectorIntersection(const TVector3 &pos, const TVector3 &dir, const Double_t beta, const Double_t R3, const Double_t focal)
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 GetParabolicVectorIntersection(const TVector3 &pos, const TVector3 &dir, const Double_t alpha, const Double_t R3)
TVector3 GetParabolicNormal(const TVector3 &pos, const Double_t alpha, const Double_t R3)
This method returns the normal vector on a parabolic surface pointing towards the inside of the parab...
TVector3 GetHyperbolicNormal(const TVector3 &pos, const Double_t beta, const Double_t R3, const Double_t focal)
This method returns the normal vector on a hyperbolic surface pointing towards the inside of the hype...
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....