REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Public Member Functions | Private Member Functions | Private Attributes
TRestRadialStrippedMask Class Reference

Detailed Description

A class used to define a stripped mask pattern.

This class defines a stripped pattern. It defines a periodicity and a thickness for the strips. The method TRestRadialStrippedMask::GetRegion will return a unique id for each region in between strips.

The stripped structure is centered in (0,0) and it can be shifted using the offset defined inside TRestPatternMask. The pattern will be only delimited by the limits imposed inside TRestPatternMask.

Specific stripped metadata parameters

Common pattern metadata parameters

On top of the metadata class parameters, we may define common pattern parameters to induce an offset and rotation to the pattern.

Examples

Mask pattern RML definitions can be found inside the file REST_PATH/examples/masks.rml.

The following definition ilustrates a complete RML implementation of a TRestRadialStrippedMask.

<TRestRadialStrippedMask name="strongback" verboseLevel="warning">
<parameter name="maskRadius" value="30cm" />
<parameter name="offset" value="(5,5)cm" />
<parameter name="rotationAngle" value="30degrees" />
<parameter name="stripsAngle" value="60degrees" />
<parameter name="stripsThickness" value="2.5cm" />
A class used to define a stripped mask pattern.

The basic use of this class is provided by the TRestRadialStrippedMask::GetRegion method. For example:

TRestRadialStrippedMask mask("masks.rml", "radialStrips");
Int_t id = mask.GetRegion( 12.5, 4.3 );
std::cout << "Region id is : " << id << endl;

The following figure may be generated using the TRestPatternMask::DrawMonteCarlo method.

TRestRadialStrippedMask mask("masks.rml", "radialStrips");
TCanvas *c = mask.DrawMonteCarlo(30000);
c->Draw();
c->Print("radialstrippedmask.png");


REST-for-Physics - Software for Rare Event Searches Toolkit

History of developments:

2022-05: First implementation of TRestRadialStrippedMask Javier Galan

Author
: Javier Galan - javie.nosp@m.r.ga.nosp@m.lan@u.nosp@m.niza.nosp@m.r.es

Definition at line 29 of file TRestRadialStrippedMask.h.

#include <TRestRadialStrippedMask.h>

Inheritance diagram for TRestRadialStrippedMask:
TRestPatternMask TRestMetadata

Public Member Functions

 ClassDefOverride (TRestRadialStrippedMask, 1)
 
Int_t GetModulus ()
 It returns the modulus used to define a finite set of ids. More...
 
virtual Int_t GetRegion (Double_t &x, Double_t &y) override
 It returns a number identifying the region where the particle with coordinates (x,y) felt in. The method returns 0 if the particle hits the pattern. More...
 
Double_t GetStripsAngle ()
 It returns the gap/periodicity of the strips in degrees. More...
 
Double_t GetStripsThickness ()
 It returns the thickness of the strips in mm. More...
 
void PrintMask () override
 Prints on screen the information about the metadata members of TRestRingsMask, including common pattern headers, but without common metadata headers. More...
 
void PrintMaskMembers () override
 Prints on screen the information about the metadata members of TRestRingsMask, excluding common metadata headers. More...
 
void PrintMetadata () override
 Prints on screen the complete information about the metadata members from this class. More...
 
 TRestRadialStrippedMask ()
 Default constructor. More...
 
 TRestRadialStrippedMask (const char *cfgFileName, std::string name="")
 Constructor loading data from a config file. More...
 
 ~TRestRadialStrippedMask ()
 Default destructor. More...
 
- Public Member Functions inherited from TRestPatternMask
 ClassDefOverride (TRestPatternMask, 1)
 
TCanvas * DrawMonteCarlo (Int_t nSamples=10000)
 It generates a Monte Carlo with positions and paints them the returned canvas. Each unique region is associated with different colors. If there are too many colors, they might be repited for different region ids. More...
 
Double_t GetMaskRadius ()
 It returns the mask radius. More...
 
Int_t GetMaxRegions ()
 
TVector2 GetOffset ()
 It returns the rotation angle. More...
 
virtual Int_t GetRegion (Double_t &x, Double_t &y)
 To be implemented at the inherited class with the pattern and region identification logic. More...
 
Double_t GetRotationAngle ()
 It returns the rotation angle. More...
 
std::string GetType ()
 It returns the mask pattern type. More...
 
Bool_t HitsPattern (Double_t x, Double_t y)
 Returns true if the pattern was hit. If (x,y) it is inside a region then, the pattern was not hit by (x,y). More...
 
void PrintCommonPatternMembers ()
 Prints on screen the information about the metadata members without header. More...
 
virtual void PrintMask ()
 
virtual void PrintMaskMembers ()
 
void PrintMetadata () override
 Prints on screen the information about the metadata members of TRestPatternMask. More...
 
void SetMaskRadius (const Double_t &radius)
 It defines the mask radius. More...
 
void SetMaxRegions (Int_t regions)
 
void SetOffset (const TVector2 &offset)
 It defines the pattern offset. More...
 
void SetRotationAngle (const Double_t &angle)
 It defines the rotation angle. More...
 
 TRestPatternMask ()
 Default constructor. More...
 
 TRestPatternMask (const char *cfgFileName, std::string name="")
 Constructor loading data from a config file. More...
 
 ~TRestPatternMask ()
 Default destructor. More...
 

Private Member Functions

void Initialize () override
 Function to initialize input/output event members and define the section name. More...
 

Private Attributes

Double_t fInitialRadius = 20.
 The spacers structure will be effective from this radius, in mm. Default is from 20 mm. More...
 
Double_t fInternalRegionRadius = 0.
 Radius of an internal circular region defined inside the fInitialRadius. If 0, there will be no region. More...
 
Int_t fModulus = 10
 It defines the maximum number of cells/regions in each axis. More...
 
Double_t fStripsAngle = TMath::Pi() / 3
 The periodity of the stripped structure in radians. More...
 
Double_t fStripsThickness = 0.5
 The width of the stripped structure in mm. More...
 

Additional Inherited Members

- Protected Member Functions inherited from TRestPatternMask
Int_t ApplyCommonMaskTransformation (Double_t &x, Double_t &y)
 It produces an effective mask rotation and translation for the point x,y. More...
 
void SetType (const std::string &type)
 It defines the mask type. To be called by the inherited class constructor. More...
 
- Protected Attributes inherited from TRestPatternMask
Double_t fMaskRadius = 0
 The maximum mask radius in mm (if 0 it will be infinite) More...
 
Int_t fMaxRegions = 100
 The maximum number of regions allowed in each mask. More...
 

Constructor & Destructor Documentation

◆ TRestRadialStrippedMask() [1/2]

TRestRadialStrippedMask::TRestRadialStrippedMask ( )

Default constructor.

Definition at line 116 of file TRestRadialStrippedMask.cxx.

◆ TRestRadialStrippedMask() [2/2]

TRestRadialStrippedMask::TRestRadialStrippedMask ( const char *  cfgFileName,
std::string  name = "" 
)

Constructor loading data from a config file.

If no configuration path is defined using TRestMetadata::SetConfigFilePath the path to the config file must be specified using full path, absolute or relative.

The default behaviour is that the config file must be specified with full path, absolute or relative.

Parameters
cfgFileNameA const char* giving the path to an RML file.
nameThe name of the specific metadata. It will be used to find the corresponding TRestRadialStrippedMask section inside the RML.

Definition at line 132 of file TRestRadialStrippedMask.cxx.

◆ ~TRestRadialStrippedMask()

TRestRadialStrippedMask::~TRestRadialStrippedMask ( )

Default destructor.

Definition at line 144 of file TRestRadialStrippedMask.cxx.

Member Function Documentation

◆ GetModulus()

Int_t TRestRadialStrippedMask::GetModulus ( )
inline

It returns the modulus used to define a finite set of ids.

Definition at line 58 of file TRestRadialStrippedMask.h.

◆ GetRegion()

Int_t TRestRadialStrippedMask::GetRegion ( Double_t &  x,
Double_t &  y 
)
overridevirtual

It returns a number identifying the region where the particle with coordinates (x,y) felt in. The method returns 0 if the particle hits the pattern.

The particle will be counter-rotated to emulate the mask rotation using the method TRestPatternMask::ApplyCommonMaskTransformation

phi determines the region where the point is found

Checking if we hit an arm

Reimplemented from TRestPatternMask.

Definition at line 163 of file TRestRadialStrippedMask.cxx.

◆ GetStripsAngle()

Double_t TRestRadialStrippedMask::GetStripsAngle ( )
inline

It returns the gap/periodicity of the strips in degrees.

Definition at line 52 of file TRestRadialStrippedMask.h.

◆ GetStripsThickness()

Double_t TRestRadialStrippedMask::GetStripsThickness ( )
inline

It returns the thickness of the strips in mm.

Definition at line 55 of file TRestRadialStrippedMask.h.

◆ Initialize()

void TRestRadialStrippedMask::Initialize ( )
overrideprivatevirtual

Function to initialize input/output event members and define the section name.

Reimplemented from TRestMetadata.

Definition at line 150 of file TRestRadialStrippedMask.cxx.

◆ PrintMask()

void TRestRadialStrippedMask::PrintMask ( )
overridevirtual

Prints on screen the information about the metadata members of TRestRingsMask, including common pattern headers, but without common metadata headers.

Reimplemented from TRestPatternMask.

Definition at line 208 of file TRestRadialStrippedMask.cxx.

◆ PrintMaskMembers()

void TRestRadialStrippedMask::PrintMaskMembers ( )
overridevirtual

Prints on screen the information about the metadata members of TRestRingsMask, excluding common metadata headers.

Reimplemented from TRestPatternMask.

Definition at line 218 of file TRestRadialStrippedMask.cxx.

◆ PrintMetadata()

void TRestRadialStrippedMask::PrintMetadata ( )
overridevirtual

Prints on screen the complete information about the metadata members from this class.

Reimplemented from TRestPatternMask.

Definition at line 197 of file TRestRadialStrippedMask.cxx.

Field Documentation

◆ fInitialRadius

Double_t TRestRadialStrippedMask::fInitialRadius = 20.
private

The spacers structure will be effective from this radius, in mm. Default is from 20 mm.

Definition at line 40 of file TRestRadialStrippedMask.h.

◆ fInternalRegionRadius

Double_t TRestRadialStrippedMask::fInternalRegionRadius = 0.
private

Radius of an internal circular region defined inside the fInitialRadius. If 0, there will be no region.

Definition at line 43 of file TRestRadialStrippedMask.h.

◆ fModulus

Int_t TRestRadialStrippedMask::fModulus = 10
private

It defines the maximum number of cells/regions in each axis.

Definition at line 46 of file TRestRadialStrippedMask.h.

◆ fStripsAngle

Double_t TRestRadialStrippedMask::fStripsAngle = TMath::Pi() / 3
private

The periodity of the stripped structure in radians.

Definition at line 34 of file TRestRadialStrippedMask.h.

◆ fStripsThickness

Double_t TRestRadialStrippedMask::fStripsThickness = 0.5
private

The width of the stripped structure in mm.

Definition at line 37 of file TRestRadialStrippedMask.h.


The documentation for this class was generated from the following files: