REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestCombinedMask.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_TRestCombinedMask
24#define REST_TRestCombinedMask
25
26#include <TRestPatternMask.h>
27
30 private:
31 std::vector<TRestPatternMask*> fMasks;
32
33 public:
34 void Initialize() override;
35
36 void AddMask(TRestPatternMask* mask) { fMasks.push_back(mask); }
37
38 TRestPatternMask* const& GetMask(unsigned int index) const {
39 if (index < fMasks.size()) {
40 return fMasks[index];
41 }
42 if (index == 0) RESTError << "TRestCombinedMask does not contain any masks" << RESTendl;
43 return fMasks[0];
44 }
45
46 Int_t GetRegion(Double_t& x, Double_t& y) override;
47
48 void InitFromConfigFile() override;
49
50 void PrintMetadata() override;
51 void PrintMaskMembers() override;
52 void PrintMask() override;
53
55 TRestCombinedMask(const char* cfgFileName, std::string name = "");
57
58 ClassDefOverride(TRestCombinedMask, 1);
59};
60#endif
A class used to define and generate a combined structure mask.
void PrintMaskMembers() override
Prints on screen the information about the metadata members from this class excluding common metadata...
TRestCombinedMask()
Default constructor.
void PrintMask() override
Prints on screen the information about the metadata members from this class, including common pattern...
void InitFromConfigFile() override
Implements class initialization through RML.
Int_t GetRegion(Double_t &x, Double_t &y) override
It returns a number identifying the region where the particle with coordinates (x,...
void PrintMetadata() override
Prints on screen the complete information about the metadata members from this class.
~TRestCombinedMask()
Default destructor.
void Initialize() override
Function to initialize input/output event members and define the section name.
endl_t RESTendl
Termination flag object for TRestStringOutput.
An abstract class used to encapsulate different mask pattern class definitions.