REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestRingsMask.h
1/*************************************************************************
2 * This file is part of the REST software framework. *
3 * *
4 * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
5 * For more information see https://gifna.unizar.es/trex *
6 * *
7 * REST is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * REST is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have a copy of the GNU General Public License along with *
18 * REST in $REST_PATH/LICENSE. *
19 * If not, see https://www.gnu.org/licenses/. *
20 * For the list of contributors see $REST_PATH/CREDITS. *
21 *************************************************************************/
22
23#ifndef REST_TRestRingsMask
24#define REST_TRestRingsMask
25
26#include <TRestPatternMask.h>
27
30 private:
31 void Initialize() override;
32
34 Double_t fRingsGap = 0; //<
35
37 Double_t fRingsThickness = 0; //<
38
40 Int_t fNRings = 0; //<
41
43 Double_t fInitialRadius = 0; //<
44
46 std::vector<std::pair<Double_t, Double_t>> fRingsRadii; //<
47
48 public:
49 void GenerateRings();
50
51 virtual Int_t GetRegion(Double_t& x, Double_t& y) override;
52
54 Double_t GetRingsGap() { return fRingsGap; }
55
57 Double_t GetRingsThickness() { return fRingsThickness; }
58
60 Double_t GetNumberOfRings() { return fNRings; }
61
63 Double_t GetInitialRadius() { return fInitialRadius; }
64
66 void SetRadii(const std::vector<Double_t>& innerR, const std::vector<Double_t>& outterR) {
67 if (innerR.size() != outterR.size()) {
68 RESTWarning << "TRestRingsMask::SetRadii. Vectors have not the same size!" << RESTendl;
69 return;
70 }
71
72 for (unsigned int n = 0; n < innerR.size(); n++) {
73 std::pair<Double_t, Double_t> p(innerR[n], outterR[n]);
74 fRingsRadii.push_back(p);
75 }
76 }
77
78 void PrintMetadata() override;
79 void PrintMaskMembers() override;
80 void PrintMask() override;
81 void PrintRings();
82
84 TRestRingsMask(const char* cfgFileName, std::string name = "");
86
87 ClassDefOverride(TRestRingsMask, 1);
88};
89#endif
endl_t RESTendl
Termination flag object for TRestStringOutput.
An abstract class used to encapsulate different mask pattern class definitions.
A class used to define a rings mask pattern.
void GenerateRings()
It will initialize the variable fRingsRadii using the number of radius, initial radius,...
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 GetNumberOfRings()
It returns the number of rings to be generated.
void Initialize() override
Function to initialize input/output event members and define the section name.
Double_t fRingsGap
The periodity of the rings structure in mm. Optionally used to initialize the rings.
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.
void PrintMask() override
Prints on screen the information about the metadata members of TRestRingsMask, including common patte...
Double_t GetRingsGap()
It returns the gap/periodicity of the rings in mm.
TRestRingsMask()
Default constructor.
Double_t fRingsThickness
The width of the rings structure in mm. Optionally used to initialize the rings.
Double_t GetRingsThickness()
It returns the thickness of the rings in mm.
Double_t GetInitialRadius()
It returns the most inner ring radius.
void PrintMetadata() override
Prints on screen the information about the metadata members from this class.
~TRestRingsMask()
Default destructor.
Int_t fNRings
The number of rings inside the structure.
void PrintMaskMembers() override
Prints on screen the information about the metadata members of TRestRingsMask, excluding common metad...
Double_t fInitialRadius
The initial radius for the inner ring.
std::vector< std::pair< Double_t, Double_t > > fRingsRadii
A pair containing inner/outter radius for each ring.
void PrintRings()
Prints on screen the information about the metadata members of TRestRingsMask, excluding common metad...