ComPWA
Common Partial-Wave-Analysis Framework
AsciiHeaderIO.hpp
Go to the documentation of this file.
1
// Copyright (c) 2013 The ComPWA Team.
2
// This file is part of the ComPWA framework, check
3
// https://github.com/ComPWA/ComPWA/license.txt for details.
4
5
#ifndef COMPWA_DATA_ASCIIHEADER_HPP_
6
#define COMPWA_DATA_ASCIIHEADER_HPP_
7
8
#include <string>
9
#include <vector>
10
11
namespace
ComPWA
{
12
namespace
Data {
13
namespace
Ascii {
14
21
class
AsciiHeader
{
22
public
:
23
AsciiHeader
(std::vector<int>
PIDs
= {}, std::string
Unit
=
"GeV"
,
24
bool
EnergyFirst
=
false
)
25
:
PIDs
(
PIDs
),
Unit
(Unit),
EnergyFirst
(EnergyFirst) {}
26
29
static
std::string
extractHeaderContent
(std::istream &InputStream);
30
40
void
importYAML
(
const
std::string &HeaderContent);
41
void
importYAML
(std::istream &InputStream) {
42
importYAML
(
extractHeaderContent
(InputStream));
43
}
44
48
void
dumpToYAML
(std::ostream &os)
const
;
49
50
const
std::vector<int>
getFinalStatePIDs
()
const
{
return
PIDs
; }
51
bool
isEnergyFirst
()
const
{
return
EnergyFirst
; }
52
const
std::string &
getUnit
()
const
{
return
Unit
; }
53
54
private
:
55
std::vector<int>
PIDs
;
56
std::string
Unit
;
57
bool
EnergyFirst
;
58
};
59
60
}
// namespace Ascii
61
}
// namespace Data
62
}
// namespace ComPWA
63
64
#endif
ComPWA::Data::Ascii::AsciiHeader::Unit
std::string Unit
Definition:
AsciiHeaderIO.hpp:56
ComPWA::Data::Ascii::AsciiHeader::importYAML
void importYAML(const std::string &HeaderContent)
Set data members by reading a YAML-like string (including newlines).
Definition:
AsciiHeaderIO.cpp:85
ComPWA::Data::Ascii::AsciiHeader::EnergyFirst
bool EnergyFirst
Definition:
AsciiHeaderIO.hpp:57
ComPWA
Definition:
Efficiency.cpp:7
ComPWA::Data::Ascii::AsciiHeader::isEnergyFirst
bool isEnergyFirst() const
Definition:
AsciiHeaderIO.hpp:51
ComPWA::Data::Ascii::AsciiHeader
Representation of data contained in an ASCII header.
Definition:
AsciiHeaderIO.hpp:21
ComPWA::Data::Ascii::AsciiHeader::dumpToYAML
void dumpToYAML(std::ostream &os) const
Serialise data members to YAML format, embedded in XML header tags.
Definition:
AsciiHeaderIO.cpp:118
ComPWA::Data::Ascii::AsciiHeader::PIDs
std::vector< int > PIDs
Definition:
AsciiHeaderIO.hpp:55
ComPWA::Data::Ascii::AsciiHeader::getUnit
const std::string & getUnit() const
Definition:
AsciiHeaderIO.hpp:52
ComPWA::Data::Ascii::AsciiHeader::importYAML
void importYAML(std::istream &InputStream)
Definition:
AsciiHeaderIO.hpp:41
ComPWA::Data::Ascii::AsciiHeader::getFinalStatePIDs
const std::vector< int > getFinalStatePIDs() const
Definition:
AsciiHeaderIO.hpp:50
ComPWA::Data::Ascii::AsciiHeader::extractHeaderContent
static std::string extractHeaderContent(std::istream &InputStream)
Extract the part that is between the XML/HTML tags <header>...</header> including newlines...
Definition:
AsciiHeaderIO.cpp:36
ComPWA::Data::Ascii::AsciiHeader::AsciiHeader
AsciiHeader(std::vector< int > PIDs={}, std::string Unit="GeV", bool EnergyFirst=false)
Definition:
AsciiHeaderIO.hpp:23
Data
Ascii
AsciiHeaderIO.hpp
Generated on Mon Jun 22 2020 13:03:33 for ComPWA by
1.8.13