master
a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models
Loading...
Searching...
No Matches
ObjectLine.cpp
Go to the documentation of this file.
1
/*
2
* ObjectLine.cpp
3
*
4
* Created on: Jun 25, 2012
5
* Author: Ben O'Leary (benjamin.oleary@gmail.com)
6
* Copyright 2012 Ben O'Leary
7
*
8
* This file is part of LesHouchesParserClasses, released under the
9
* GNU General Public License. Please see the accompanying
10
* README.LHPC_CPP.txt file for a full list of files, brief documentation
11
* on how to use these classes, and further details on the license.
12
*/
13
14
#include "
LHCO.hpp
"
15
16
namespace
LHPC
17
{
18
namespace
LHCO
19
{
20
int
const
ObjectLine::minimumNumberOfEntries
( 9 );
21
// this is the minimum number of numbers expected for a valid line.
22
23
ObjectLine::ObjectLine
() :
24
lineNumber( -1 ),
25
objectType( -1 ),
26
valueVector( 11,
27
BOL
::UsefulStuff::notANumber )
28
{
29
// just an initialization list.
30
}
31
32
ObjectLine::ObjectLine
(
ObjectLine
const
& copySource ) :
33
lineNumber( copySource.lineNumber ),
34
objectType( copySource.objectType ),
35
valueVector( copySource.valueVector )
36
{
37
// just an initialization list.
38
}
39
40
ObjectLine::~ObjectLine
()
41
{
42
// does nothing.
43
}
44
45
46
ObjectLine
const
*
47
ObjectLine::recordLine
(
int
const
lineNumber,
48
BOL::VectorlikeArray< std::string >
const
& lineAsStrings )
49
// this interprets a string as the data it is meant to correspond to. it
50
// assumes that it has been given enough numbers.
51
{
52
if
(
minimumNumberOfEntries
<= lineAsStrings.
getSize
() )
53
{
54
valueVector
.assign( lineAsStrings.
getSize
(),
55
BOL::UsefulStuff::notANumber
);
56
}
57
else
58
{
59
valueVector
.assign(
minimumNumberOfEntries
,
60
BOL::UsefulStuff::notANumber
);
61
}
62
this->lineNumber =
lineNumber
;
63
valueVector
[ 0 ] = (double)
lineNumber
;
64
objectType
=
BOL::StringParser::stringToInt
( lineAsStrings[ 1 ] );
65
valueVector
[ 1 ] = (double)
objectType
;
66
for
(
int
whichElement( 2 );
67
lineAsStrings.
getLastIndex
() >= whichElement;
68
++whichElement )
69
{
70
valueVector
[ whichElement ]
71
=
BOL::StringParser::stringToDouble
( lineAsStrings[ whichElement ] );
72
}
73
return
this
;
74
}
75
76
}
77
78
}
LHCO.hpp
BOL::StringParser::stringToDouble
static double stringToDouble(std::string const &stringToInterpret)
Definition
StringParser.hpp:422
BOL::StringParser::stringToInt
static int stringToInt(std::string const &stringToInterpret)
Definition
StringParser.hpp:414
BOL::UsefulStuff::notANumber
static double const notANumber
Definition
UsefulStuff.hpp:28
BOL::VectorlikeArray< std::string >
BOL::VectorlikeArray::getSize
int getSize() const
Definition
VectorlikeArray.hpp:280
BOL::VectorlikeArray::getLastIndex
int getLastIndex() const
Definition
VectorlikeArray.hpp:289
LHPC::LHCO::ObjectLine
Definition
ObjectLine.hpp:26
LHPC::LHCO::ObjectLine::~ObjectLine
~ObjectLine()
Definition
ObjectLine.cpp:40
LHPC::LHCO::ObjectLine::minimumNumberOfEntries
static int const minimumNumberOfEntries
Definition
ObjectLine.hpp:118
LHPC::LHCO::ObjectLine::recordLine
ObjectLine const * recordLine(int const lineNumber, BOL::VectorlikeArray< std::string > const &lineAsStrings)
Definition
ObjectLine.cpp:47
LHPC::LHCO::ObjectLine::objectType
int objectType
Definition
ObjectLine.hpp:123
LHPC::LHCO::ObjectLine::valueVector
std::vector< double > valueVector
Definition
ObjectLine.hpp:132
LHPC::LHCO::ObjectLine::ObjectLine
ObjectLine()
Definition
ObjectLine.cpp:23
LHPC::LHCO::ObjectLine::lineNumber
int lineNumber
Definition
ObjectLine.hpp:121
BOL
Definition
ArgumentParser.hpp:23
LHPC
Definition
FourMomentum.hpp:24
LHPC
source
LHCO
ObjectLine.cpp
Generated on Tue Aug 4 2026 for $\texttt{HEPfit}$ using
1.9.8