116#include "TRestSpiderMask.h"
176 Double_t d = TMath::Sqrt(x * x + y * y);
184 Double_t cos_angle = y / d;
222 std::pair<Double_t, Double_t> additional_negative = {-1, -1};
227 Double_t angle_down = angle -
fArmsWidth / 2.;
230 if (angle_down < 0) {
231 additional_negative = {2 * TMath::Pi() + angle_down, 2 * TMath::Pi()};
234 }
else if (angle_up > TMath::Pi() && angle_down < TMath::Pi()) {
237 }
else if (angle_up < TMath::Pi()) {
239 }
else if (angle_down >= TMath::Pi()) {
245 }
while (angle + 1.e-3 < 2 * TMath::Pi());
247 if (additional_negative.first != -1 && additional_negative.second != -1)
250 RESTDebug <<
"Printing positive spider angles" <<
RESTendl;
251 RESTDebug <<
"-------------------------------" <<
RESTendl;
253 RESTDebug <<
"n : " << n <<
" from : " << 180 *
fPositiveRanges[n].first / TMath::Pi() <<
" to "
257 RESTDebug <<
"Printing negative spider angles" <<
RESTendl;
258 RESTDebug <<
"-------------------------------" <<
RESTendl;
260 RESTDebug <<
"n : " << n <<
" from : " << 180 *
fNegativeRanges[n].first / TMath::Pi() <<
" to "
274 RESTDebug <<
"Printing positive spider angles" <<
RESTendl;
275 RESTDebug <<
"-------------------------------" <<
RESTendl;
277 RESTDebug <<
"n : " << n <<
" from : " <<
fPositiveRanges[n].first <<
" to "
281 RESTDebug <<
"Printing negative spider cosines" <<
RESTendl;
282 RESTDebug <<
"--------------------------------" <<
RESTendl;
284 RESTDebug <<
"n : " << n <<
" from : " <<
fNegativeRanges[n].first <<
" to "
322 RESTMetadata <<
"-------------------------------" <<
RESTendl;
324 RESTDebug <<
"n : " << n <<
" from : " << 180 *
fPositiveRanges[n].first / TMath::Pi() <<
" to "
328 RESTMetadata <<
"Positive ranges : {";
330 if (n > 0) RESTMetadata <<
", ";
335 RESTMetadata <<
"Negative ranges : {";
337 if (n > 0) RESTMetadata <<
", ";
An abstract class used to encapsulate different mask pattern class definitions.
void SetType(const std::string &type)
It defines the mask type. To be called by the inherited class constructor.
Int_t fMaxRegions
The maximum number of regions allowed in each mask.
void PrintMetadata() override
Prints on screen the information about the metadata members of TRestPatternMask.
virtual Int_t GetRegion(Double_t &x, Double_t &y)
To be implemented at the inherited class with the pattern and region identification logic.
void PrintCommonPatternMembers()
Prints on screen the information about the metadata members without header.
A class used to define and generate a spider structure mask.
void GenerateSpider()
This method is used to initialize the spider arm angles data members that are used to determine if a ...
Double_t fInternalRegionRadius
Radius of an internal circular region defined inside the fInitialRadius. If 0, there will be no regio...
void PrintMetadata() override
Prints on screen the complete information about the metadata members from this class.
virtual Int_t GetRegion(Double_t &x, Double_t &y) override
It returns a number identifying the region where the particle with coordinates (x,...
Double_t fArmsSeparationAngle
The angle between two consecutive spider arms measured in radians.
std::vector< std::pair< Double_t, Double_t > > fPositiveRanges
Used internally to define the forbidden (cosine) angular ranges imposed by the spider structure (0,...
void PrintMask() override
Prints on screen the information about the metadata members from this class, including common pattern...
Double_t fArmsWidth
The width of each specific spider arm. Measured in radians. Default is 2.5 degrees.
Double_t fInitialRadius
The spider structure will be effective from this radius, in mm. Default is from 20 mm.
std::vector< std::pair< Double_t, Double_t > > fNegativeRanges
Used internally to define the forbidden (cosine) ang. ranges imposed by the spider structure (Pi,...
void Initialize() override
Function to initialize input/output event members and define the section name.
void PrintMaskMembers() override
Prints on screen the information about the metadata members from this class, excluding common metadat...
~TRestSpiderMask()
Default destructor.
TRestSpiderMask()
Default constructor.
@ REST_Info
+show most of the information for each steps