Falaise
4.0.1
SuperNEMO Software Toolkit
falaise
snemo
datamodels
event_header.h
Go to the documentation of this file.
1
// -*- mode: c++ ; -*-
2
/// \file falaise/snemo/datamodels/event_header.h
3
/* Author (s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
4
* Creation date: 2010-11-07
5
* Last modified: 2014-01-27
6
*
7
* License:
8
*
9
* Description:
10
*
11
* Event header
12
*
13
*/
14
15
#ifndef FALAISE_SNEMO_DATAMODEL_EVENT_HEADER_H
16
#define FALAISE_SNEMO_DATAMODEL_EVENT_HEADER_H 1
17
18
// Third party:
19
// - Boost :
20
#include <boost/cstdint.hpp>
21
#include <boost/serialization/access.hpp>
22
// - Bayeux/datatools :
23
#include <
datatools/event_id.h
>
24
#include <
datatools/i_clear.h
>
25
#include <
datatools/i_serializable.h
>
26
#include <
datatools/i_tree_dump.h
>
27
#include <
datatools/properties.h
>
28
29
// This project:
30
#include <
falaise/snemo/datamodels/timestamp.h
>
31
32
namespace
snemo
{
33
34
namespace
datamodel {
35
36
/// \brief A event header class to be embedded as a bank in a 'datatools::things' event record.
37
class
event_header
:
public
datatools::i_serializable
,
38
public
datatools::i_clear
,
39
public
datatools::i_tree_dumpable
{
40
public
:
41
/// \brief Generation type of the event record
42
enum
generation_type
{
43
GENERATION_INVALID
= -1,
///< Invalid generation type
44
GENERATION_REAL
= 0,
///< Real event from the detector's DAQ
45
GENERATION_SIMULATED
= 1
///< Simulated event from the MC application
46
};
47
48
/// Return the default label/name of a 'event header' bank
49
static
const
std::string &
event_header_label
();
50
51
/// Return the event ID
52
const
datatools::event_id
&
get_id
()
const
;
53
54
/// Return the mutable event ID
55
datatools::event_id
&
grab_id
();
56
57
/// Set the event ID
58
void
set_id
(
const
datatools::event_id
&);
59
60
/// Return the constant list of properties
61
const
datatools::properties
&
get_properties
()
const
;
62
63
/// Return the mutable list of properties
64
datatools::properties
&
grab_properties
();
65
66
/// Set the list of properties
67
void
set_properties
(
const
datatools::properties
&);
68
69
/// Return the timestamp
70
const
snemo::datamodel::timestamp
&
get_timestamp
()
const
;
71
72
/// Return the mutable timestamp
73
snemo::datamodel::timestamp
&
grab_timestamp
();
74
75
/// Set the timestamp
76
void
set_timestamp
(
const
snemo::datamodel::timestamp
&);
77
78
/// Return the generation
79
generation_type
get_generation
()
const
;
80
81
/// Set the generation
82
void
set_generation
(
generation_type
);
83
84
/// Check if event record is real (collected by the experiment DAQ)
85
bool
is_real
()
const
;
86
87
/// Check if event record is simulated
88
bool
is_simulated
()
const
;
89
90
/// Constructor
91
event_header
();
92
93
/// Destructor
94
virtual
~event_header
();
95
96
/// Clear the event header internal data
97
virtual
void
clear
();
98
99
/// Smart print
100
virtual
void
tree_dump
(std::ostream &out_ = std::clog,
const
std::string &title_ =
""
,
101
const
std::string &indent_ =
""
,
bool
inherit_ =
false
)
const
;
102
103
/// Basic print
104
void
dump
()
const
;
105
106
private
:
107
datatools::event_id
_id_;
//!< Run/Event ID
108
generation_type
_generation_;
//!< Generation flag
109
snemo::datamodel::timestamp
_timestamp_;
//!< Reference time of the event
110
datatools::properties
_properties_;
//!< Dictionary of properties
111
112
DATATOOLS_SERIALIZATION_DECLARATION
()
113
};
114
115
}
// end of namespace datamodel
116
117
}
// end of namespace snemo
118
119
#include <boost/serialization/export.hpp>
120
BOOST_CLASS_EXPORT_KEY2(
snemo::datamodel::event_header
,
"snemo::datamodel::event_header"
)
121
122
// Class version:
123
#include <boost/serialization/version.hpp>
124
BOOST_CLASS_VERSION(
snemo::datamodel::event_header
, 1)
125
126
#endif // FALAISE_SNEMO_DATAMODEL_EVENT_HEADER_H
datatools::i_serializable
snemo::datamodel::event_header::set_generation
void set_generation(generation_type)
Set the generation.
snemo::datamodel::event_header::grab_properties
datatools::properties & grab_properties()
Return the mutable list of properties.
snemo::datamodel::event_header::tree_dump
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
datatools::i_tree_dumpable
snemo::datamodel::event_header::get_generation
generation_type get_generation() const
Return the generation.
snemo::datamodel::event_header::dump
void dump() const
Basic print.
snemo::datamodel::event_header::set_id
void set_id(const datatools::event_id &)
Set the event ID.
i_serializable.h
timestamp.h
DATATOOLS_SERIALIZATION_DECLARATION
#define DATATOOLS_SERIALIZATION_DECLARATION()
snemo::datamodel::timestamp
A class to handle time stamp.
Definition:
timestamp.h:32
snemo::datamodel::event_header::GENERATION_REAL
Real event from the detector's DAQ.
Definition:
event_header.h:44
snemo::datamodel::event_header::is_simulated
bool is_simulated() const
Check if event record is simulated.
i_tree_dump.h
snemo::datamodel::event_header::event_header
event_header()
Constructor.
snemo::datamodel::event_header::GENERATION_SIMULATED
Simulated event from the MC application.
Definition:
event_header.h:45
snemo::datamodel::event_header::is_real
bool is_real() const
Check if event record is real (collected by the experiment DAQ)
snemo::datamodel::event_header::get_id
const datatools::event_id & get_id() const
Return the event ID.
snemo
Definition:
calo_tapered_scin_box_model.h:54
snemo::datamodel::event_header::event_header_label
static const std::string & event_header_label()
Return the default label/name of a 'event header' bank.
datatools::i_clear
snemo::datamodel::event_header::set_timestamp
void set_timestamp(const snemo::datamodel::timestamp &)
Set the timestamp.
snemo::datamodel::event_header
A event header class to be embedded as a bank in a 'datatools::things' event record.
Definition:
event_header.h:37
properties.h
i_clear.h
snemo::datamodel::event_header::~event_header
virtual ~event_header()
Destructor.
snemo::datamodel::event_header::generation_type
generation_type
Generation type of the event record.
Definition:
event_header.h:42
snemo::datamodel::event_header::get_properties
const datatools::properties & get_properties() const
Return the constant list of properties.
snemo::datamodel::event_header::GENERATION_INVALID
Invalid generation type.
Definition:
event_header.h:43
event_id.h
snemo::datamodel::event_header::get_timestamp
const snemo::datamodel::timestamp & get_timestamp() const
Return the timestamp.
snemo::datamodel::event_header::clear
virtual void clear()
Clear the event header internal data.
snemo::datamodel::event_header::grab_id
datatools::event_id & grab_id()
Return the mutable event ID.
snemo::datamodel::event_header::set_properties
void set_properties(const datatools::properties &)
Set the list of properties.
datatools::event_id
snemo::datamodel::event_header::grab_timestamp
snemo::datamodel::timestamp & grab_timestamp()
Return the mutable timestamp.
datatools::properties
Generated by
1.8.15