English Français

Documentation / Developer's manual

Available modules

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / DataServer: TPermutation.h Source File
Uranie / DataServer  v4.10.0
/* @license-end */
TPermutation.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2024 CEA/DES
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Lesser General Public License as published
6 // by the Free Software Foundation, either version 3 of the License, or any
7 // later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
24 #ifndef TPERMUTATION_H
25 #define TPERMUTATION_H
26 
28 #include "TEventList.h"
29 #include "TPatternsEventList.h"
30 #include "TRandom.h"
31 #include "TTree.h"
32 
34 #include "DataServer.h"
35 
36 namespace URANIE
37 {
38  namespace DataServer
39  {
40  class TPermutation: public TEventList
41  {
42 
43  public:
44  //---------------------------------------------
48  TPermutation();
51  TPermutation(const char *name, const char *title, Int_t initsize, Bool_t bExact=kFALSE);
52 
54  virtual ~TPermutation();
56 
57  //---------------------------------------------
61  virtual void Enter(Long64_t entry);
64 
67  virtual void enter(Long64_t entry)
68  {
69  Enter(entry);
70  }
71 
72  virtual void generatePermutation(Int_t *vecindexes, Option_t *option="");
73 
74 
76 
77  //---------------------------------------------
81 
87  void setSeed(Int_t ind = 0);
89  Int_t getSeed()
90  {
91  return _nSeed;
92  }
93 
95  Bool_t getExact() {
96  return _bExact;
97  }
98  TString getArchiveName() {
99  return _sArchiveName;
100  }
101 
102  TTree *getExactTree() {
103  return _ntdOfExact;
104  }
105 
106  TTree *getSampledTree() {
107  return _ntdOfSampled;
108  }
109 
111 
112  //---------------------------------------------
116  void setLog()
117  {
118  _blog = kTRUE;
119  }
120  void unsetLog()
121  {
122  _blog = kFALSE;
123  }
124  void changeLog()
125  {
126  _blog = _blog ? kFALSE : kTRUE;
127  }
128  Bool_t getLog()
129  {
130  return _blog;
131  }
132  virtual void Print(Option_t *option = "") const;
133  void printLog(Option_t *option = "")
134  {
135  Print(option);
136  }
138 
139 
140  private:
141  // methods
142  void fillAllPermutations();
143 
144  void generateBySwapping(Option_t *option="");
145 
146  Bool_t isPermutationAlreadyExist();
147 
148  // Attributes
149  protected:
150  Int_t _nSeed;
151  Long64_t _nMaxSize;
152  Bool_t _bExact;
153  TString _sArchiveName;
154  TTree *_ntdOfExact;
156  Long64_t _nExactIndex;
157  TTree *_ntdOfSampled;
158  Int_t *_vecCurrent;
159  public:
160  Bool_t _blog;
161 
162  ClassDef(TPermutation, ID_DATASERVER)
163  };
164 
165  } // End Of namespace DataServer
166 } // End Of namespace URANIE
167 
168 #endif
169 // End Of File
ROOT.
Definition: TAttribute.h:104
Bool_t getLog()
Definition: TPermutation.h:128
TTree * _ntdOfSampled
TTree of all the permutations.
Definition: TPermutation.h:157
virtual ~TPermutation()
Default destructor.
TString getArchiveName()
Definition: TPermutation.h:98
void unsetLog()
Definition: TPermutation.h:120
virtual void generatePermutation(Int_t *vecindexes, Option_t *option="")
Definition: TPermutation.h:40
void generateBySwapping(Option_t *option="")
Bool_t _blog
Definition: TPermutation.h:160
Int_t _nSeed
The seed parameter.
Definition: TPermutation.h:150
Bool_t _bExact
Boolean to set exact or not exact list of permutation.
Definition: TPermutation.h:152
Int_t getSeed()
Returns the seed value.
Definition: TPermutation.h:89
TTree * getSampledTree()
Definition: TPermutation.h:106
void changeLog()
Definition: TPermutation.h:124
virtual void enter(Long64_t entry)
Enter element entry into the list.
Definition: TPermutation.h:67
virtual void Print(Option_t *option="") const
void setLog()
Definition: TPermutation.h:116
TPatternsEventList * _pelExactMixed
The indexes permuted of the exact permutation list.
Definition: TPermutation.h:155
Interface of the class URANIE::DataServer::TPatternsEventList.
TString _sArchiveName
The name of the ROOT File.
Definition: TPermutation.h:153
Description of the class TPatternsEventList.
Definition: TPatternsEventList.h:62
TTree * _ntdOfExact
TTree of all the permutations.
Definition: TPermutation.h:154
TPermutation()
Default constructor.
virtual void Enter(Long64_t entry)
Enter element entry into the list.
void setSeed(Int_t ind=0)
Init the seed.
Int_t * _vecCurrent
The current permutation.
Definition: TPermutation.h:158
TTree * getExactTree()
Definition: TPermutation.h:102
void printLog(Option_t *option="")
Definition: TPermutation.h:133
Long64_t _nExactIndex
The current position.
Definition: TPermutation.h:156
Long64_t _nMaxSize
The total size of Exact method.
Definition: TPermutation.h:151
Bool_t getExact()
Return the exact attribute.
Definition: TPermutation.h:95