MURE
Loading...
Searching...
No Matches
MureTimeEnergyGrid.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 MURETimeEnergyGrid_H
20#define MURETimeEnergyGrid_H
21#include <string>
22#include <utility>
23#include <vector>
24#include <sstream>
25#include <fstream>
26
27using namespace std;
34
40{
41 public:
42
43 typedef pair < double, double > BinRange;
44
46 MureTimeEnergyGrid(int Number);
48 virtual MureTimeEnergyGrid *Clone() = 0;
49 virtual ~MureTimeEnergyGrid();
50
51 void AddEnergy(double Energy);
52 void AddTime(double Time);
53
54 void AddEnergy(int NumberOfBins, BinRange Range);
55 void AddTime(int NumberOfBins, BinRange Range);
56
57
58 virtual void Print(ofstream &Out) = 0;
59 virtual string GetName() = 0;
60 vector < double > &GetEnergyBins();
61 vector < double > &GetTimeBins();
62 int GetEnergySize() const;
63 int GetTimeSize() const;
64 int GetNumber() const;
65 void SetNumber(int num)
66 {
67 fNumber = num;
68 }
69
70 void SetFirstBinUpperBound(bool flag)
71 {
73 }
75 {
77 }
78
79 void SetEType(int type)
80 {
81 fEType = type;
82 }
83 void SetTType(int type)
84 {
85 fTType = type;
86 }
88 {
89 return fEType;
90 }
92 {
93 return fTType;
94 }
95
96
97 protected:
98 int fNumber;
99 int fEType;
100 int fTType;
101
102 vector < double > fEnergyBins;
103 vector < double > fTimeBins;
105 int fNbinE;
106 int fNbinT;
107};
108
109#endif // MURETimeEnergyGrid_H
Define a Time and/or Energy Grid for tallies (abstract class)
Definition MureTimeEnergyGrid.hxx:40
int GetTimeSize() const
return either fNbinT or fTimeBins.size()
Definition MureTimeEnergyGrid.cxx:135
void SetNumber(int num)
Definition MureTimeEnergyGrid.hxx:65
virtual MureTimeEnergyGrid * Clone()=0
clone method
bool fIsFirstBinUpperBound
true if the first bin is a upper bound bin
Definition MureTimeEnergyGrid.hxx:104
vector< double > & GetEnergyBins()
Definition MureTimeEnergyGrid.cxx:83
void SetFirstBinUpperBound(bool flag)
Definition MureTimeEnergyGrid.hxx:70
int fNumber
the grid number
Definition MureTimeEnergyGrid.hxx:98
void SetEType(int type)
Definition MureTimeEnergyGrid.hxx:79
void AddEnergy(double Energy)
add Energy to the energy vector
Definition MureTimeEnergyGrid.cxx:96
int GetEType()
Definition MureTimeEnergyGrid.hxx:87
bool IsFirstBinUpperBound()
Definition MureTimeEnergyGrid.hxx:74
int fEType
1=bin by bin, 2=equal bin width for E
Definition MureTimeEnergyGrid.hxx:99
virtual void Print(ofstream &Out)=0
void SetTType(int type)
Definition MureTimeEnergyGrid.hxx:83
int GetTType()
Definition MureTimeEnergyGrid.hxx:91
virtual string GetName()=0
int fNbinE
number of energy bins
Definition MureTimeEnergyGrid.hxx:105
virtual ~MureTimeEnergyGrid()
destructor
Definition MureTimeEnergyGrid.cxx:70
pair< double, double > BinRange
Min and Max value.
Definition MureTimeEnergyGrid.hxx:43
vector< double > fEnergyBins
Energy (eV) grid values.
Definition MureTimeEnergyGrid.hxx:102
int GetEnergySize() const
return either fNbinE or fEnergyBins.size()
Definition MureTimeEnergyGrid.cxx:128
MureTimeEnergyGrid()
default constructor.
Definition MureTimeEnergyGrid.cxx:28
int fNbinT
number of time bins
Definition MureTimeEnergyGrid.hxx:106
vector< double > & GetTimeBins()
Definition MureTimeEnergyGrid.cxx:90
int GetNumber() const
Definition MureTimeEnergyGrid.cxx:77
vector< double > fTimeBins
time (s) grid values
Definition MureTimeEnergyGrid.hxx:103
int fTType
1=bin by bin, 2=equal bin width for T
Definition MureTimeEnergyGrid.hxx:100
void AddTime(double Time)
add Time to the energy vector
Definition MureTimeEnergyGrid.cxx:103
the namespace of the Standard C++

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