MURE
Loading...
Searching...
No Matches
SerpentTallyData.hxx
Go to the documentation of this file.
1/*
2 This file is part of MURE,
3 Copyright (C) 2007-2021 MURE developers.
4
5 MURE is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 MURE is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with MURE. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef SERPENTTALLYDATA_HXX
20#define SERPENTTALLYDATA_HXX
21#include <libValErr/ValErr.hxx>
22#include <string>
23#include <vector>
24#include <map>
25#include <utility>
26#include <sstream>
27#include <fstream>
28#include <algorithm>
29
30//#include "Mock.h"
31#include "MUREGlobal.hxx"
32#include "MiscFunction.hxx"
33
35
41namespace Serpent
42{
43
45
63{
64 public:
65 const static unsigned NUMBER_OF_COLUMNS = 3;
68 void SetName(const string &name);
69 int GetTallyNumber();
70 void SetTallyNumber(int number);
71 double GetBin(unsigned binNumber);
72 string Print();
73 void Add(double value, unsigned columnIndex);
74
75 int GetSize();
76
77 private:
78 typedef vector < double > Column;
79 const static unsigned VALUE_COLUMN_INDEX = 1;
81 string fName;
82 vector < Column *> *fBins;
83};
84
86
95{
96 public:
97 static const unsigned NUMBER_OF_INDEXES = 10;
98 BinResult();
99 ValErr_t GetValErr();
100 void SetValErr(double value, double error);
101 void AddIndex(unsigned index);
102 int GetCellBinIndex();
103 int GetReactionBinIndex();
104 int GetETBinIndex();
105 int GetIndex(unsigned pos);
106 ~BinResult();
107 string Print();
108
109 private:
110 static const unsigned ET_NUM_POS = 1;
111 static const unsigned CELL_NUM_POS = 3;
112 static const unsigned REACTION_NUM_POS = 6;
113 vector < int > fBinIndices;
114 ValErr_t *fData;
115};
116
118
127{
128 public:
129 TallyResult();
130 ~TallyResult();
131 ValErr_t Get(int CellNum = 0, int ReactionNum = 0, int ETNum = 0);
132 ValErr_t GetValErr(int index);
133 static TallyResult *Merge(vector < TallyResult *> *tallies);
134 int GetNumberOfBins();
135 void SetName(const string &name);
136 string GetName()
137 {
138 return fName;
139 }
140 void SetNumber(int number);
142 {
143 return fNumber;
144 }
145 float *GetETValues() const;
146 int GetETSize() const;
147 void SetETSize(int size);
148 void AddBin(BinResult *bin);
149 void AllocateET();
150 void SetETBin(int index, double value);
151 string PrintBin(int index);
152
153 private:
154 string fName;
156 vector < BinResult *> fBins;
157 float *fEV;
158 int fEN;
159
160};
161
162typedef vector < TallyResult *> TallyDatabase;
163typedef vector < EnergyGridResult *> EnergyGridTable;
164
166
174{
175 public:
176 TallyData();
177 ~TallyData();
178
179 void Clear();
181 {
182 return fTallyData;
183 }
185 {
186 return fEnergyTable;
187 }
189 {
190 fTallyData -> push_back(tally);
191 }
193 {
194 fEnergyTable -> push_back(et);
195 }
197 {
198 return int(fTallyData -> size());
199 }
201 {
202 return int(fEnergyTable -> size());
203 }
205 {
206 return fTallyData -> at(index);
207 }
209 {
210 return fEnergyTable -> at(index);
211 }
212
213 private:
216};
217
218}
219#endif // SERPENTTALLYDATA_HXX
Header file for vector operation, Regression and FindFitParameters functions.
Definition SerpentTallyData.hxx:95
static const unsigned NUMBER_OF_INDEXES
Definition SerpentTallyData.hxx:97
vector< int > fBinIndices
Definition SerpentTallyData.hxx:113
int GetReactionBinIndex()
gets Reaction Bin Index
Definition SerpentTallyData.cxx:152
int GetETBinIndex()
gets Energy Grid Bin Index
Definition SerpentTallyData.cxx:158
int GetIndex(unsigned pos)
gets Index from row "pos"
Definition SerpentTallyData.cxx:164
ValErr_t GetValErr()
returns value read from bin
Definition SerpentTallyData.cxx:128
void AddIndex(unsigned index)
adds next bin index
Definition SerpentTallyData.cxx:140
~BinResult()
destructor
Definition SerpentTallyData.cxx:121
static const unsigned REACTION_NUM_POS
Definition SerpentTallyData.hxx:112
string Print()
Printing method used when multi-run data is merged into one file.
Definition SerpentTallyData.cxx:170
int GetCellBinIndex()
gets Cell Bin Index
Definition SerpentTallyData.cxx:146
void SetValErr(double value, double error)
sets value read from bin
Definition SerpentTallyData.cxx:134
static const unsigned ET_NUM_POS
Definition SerpentTallyData.hxx:110
BinResult()
constructor
Definition SerpentTallyData.cxx:115
static const unsigned CELL_NUM_POS
Definition SerpentTallyData.hxx:111
ValErr_t * fData
Definition SerpentTallyData.hxx:114
Definition SerpentTallyData.hxx:63
static const unsigned NUMBER_OF_COLUMNS
number of column fro the grid
Definition SerpentTallyData.hxx:65
int GetSize()
returns number of rows in energy grid.
Definition SerpentTallyData.cxx:105
vector< Column * > * fBins
Definition SerpentTallyData.hxx:82
string Print()
Printing method used when multi-run data is merged into one file.
Definition SerpentTallyData.cxx:80
void SetTallyNumber(int number)
sets detector number associated with energy grid
Definition SerpentTallyData.cxx:66
int fTallyNumber
tally number associated to the grid
Definition SerpentTallyData.hxx:80
double GetBin(unsigned binNumber)
gets top-limit of energy at defined position
Definition SerpentTallyData.cxx:72
vector< double > Column
Definition SerpentTallyData.hxx:78
string fName
tally name
Definition SerpentTallyData.hxx:81
int GetTallyNumber()
gets detector number associated with energy grid
Definition SerpentTallyData.cxx:60
EnergyGridResult()
constructor
Definition SerpentTallyData.cxx:35
void SetName(const string &name)
sets detector name
Definition SerpentTallyData.cxx:54
void Add(double value, unsigned columnIndex)
adds energy grid record to certain column.
Definition SerpentTallyData.cxx:99
static const unsigned VALUE_COLUMN_INDEX
only column 1 (middle) is relevant
Definition SerpentTallyData.hxx:79
~EnergyGridResult()
destructor
Definition SerpentTallyData.cxx:43
Definition SerpentTallyData.hxx:174
TallyDatabase * GetTallyDatabase()
Definition SerpentTallyData.hxx:180
int GetNumberOfET()
Definition SerpentTallyData.hxx:200
EnergyGridTable * GetEnergyGridTable()
Definition SerpentTallyData.hxx:184
void AddTally(TallyResult *tally)
Definition SerpentTallyData.hxx:188
int GetNumberOfTallies()
Definition SerpentTallyData.hxx:196
void Clear()
clears data
Definition SerpentTallyData.cxx:375
void AddET(EnergyGridResult *et)
Definition SerpentTallyData.hxx:192
EnergyGridResult * GetET(int index)
Definition SerpentTallyData.hxx:208
TallyDatabase * fTallyData
Definition SerpentTallyData.hxx:214
TallyResult * GetTally(int index)
Definition SerpentTallyData.hxx:204
EnergyGridTable * fEnergyTable
Definition SerpentTallyData.hxx:215
~TallyData()
destructor
Definition SerpentTallyData.cxx:357
TallyData()
constructor
Definition SerpentTallyData.cxx:350
Definition SerpentTallyData.hxx:127
ValErr_t Get(int CellNum=0, int ReactionNum=0, int ETNum=0)
returns value read from bin (accesed by cell, reaction or energy grid index, safe)
Definition SerpentTallyData.cxx:213
int fNumber
tally number
Definition SerpentTallyData.hxx:155
void SetNumber(int number)
sets tally number
Definition SerpentTallyData.cxx:240
void AddBin(BinResult *bin)
adds bin read
Definition SerpentTallyData.cxx:264
vector< BinResult * > fBins
Definition SerpentTallyData.hxx:156
int GetNumberOfBins()
returns number of bins read for this detector
Definition SerpentTallyData.cxx:246
~TallyResult()
destructor
Definition SerpentTallyData.cxx:200
int GetNumber()
Definition SerpentTallyData.hxx:141
int fEN
Definition SerpentTallyData.hxx:158
float * fEV
Definition SerpentTallyData.hxx:157
void AllocateET()
allocates memory for energy grid data
Definition SerpentTallyData.cxx:270
int GetETSize() const
gets size of energy grid data
Definition SerpentTallyData.cxx:258
string fName
tally name
Definition SerpentTallyData.hxx:154
void SetETSize(int size)
sets size of energy grid data
Definition SerpentTallyData.cxx:282
string PrintBin(int index)
Printing method for bin used when multi-run data is merged into one file.
Definition SerpentTallyData.cxx:288
ValErr_t GetValErr(int index)
returns value read from bin (accesed by arbitrary index, unsafe)
Definition SerpentTallyData.cxx:228
void SetName(const string &name)
sets tally name
Definition SerpentTallyData.cxx:234
string GetName()
Definition SerpentTallyData.hxx:136
static TallyResult * Merge(vector< TallyResult * > *tallies)
merge results of 2 tallies
Definition SerpentTallyData.cxx:294
float * GetETValues() const
return energy grid data in form of float array associated with this detector
Definition SerpentTallyData.cxx:252
void SetETBin(int index, double value)
changes entry of energy grid data
Definition SerpentTallyData.cxx:276
TallyResult()
constructor
Definition SerpentTallyData.cxx:191
the namespace use to couple MURE and Serpent
vector< EnergyGridResult * > EnergyGridTable
Definition SerpentTallyData.hxx:163
vector< TallyResult * > TallyDatabase
Definition SerpentTallyData.hxx:162

MURE Project, documentation generated by Doxygen 1.9.7 - Fri Jan 19 2024