Fork me on GitHub

source: git/external/HepMC3/rootIO/src/Streamers.cc@ b30245b

Last change on this file since b30245b was b30245b, checked in by Andrii Verbytskyi <averbyts@…>, 3 years ago

Added root support to HepMC3

  • Property mode set to 100644
File size: 1.3 KB
Line 
1// -*- C++ -*-
2//
3// This file is part of HepMC
4// Copyright (C) 2014-2019 The HepMC collaboration (see AUTHORS for details)
5//
6/**
7 * @file Streamers.cc
8 * @brief Implementation of \b methods GenEvent::Streamer and GenRunInfo::Streamer
9 *
10 */
11
12#include "HepMC3/GenEvent.h"
13
14#include "HepMC3/Data/GenEventData.h"
15#include "HepMC3/Data/GenRunInfoData.h"
16
17#ifdef HEPMC3_ROOTIO
18#include "TBuffer.h"
19#include "TClass.h"
20#endif
21
22
23namespace HepMC3 {
24
25#ifdef HEPMC3_ROOTIO
26
27void GenEvent::Streamer(TBuffer &b) {
28 if (b.IsReading()) {
29 GenEventData data;
30
31 b.ReadClassBuffer(TClass::GetClass("HepMC3::GenEventData"), &data);
32
33 read_data(data);
34 } else {
35 // fill the GenEventData structures
36 GenEventData data;
37 write_data(data);
38
39 b.WriteClassBuffer(TClass::GetClass("HepMC3::GenEventData"), &data);
40 }
41}
42
43
44void GenRunInfo::Streamer(TBuffer &b) {
45 if (b.IsReading()) {
46 GenRunInfoData data;
47
48 b.ReadClassBuffer(TClass::GetClass("HepMC3::GenRunInfoData"), &data);
49
50 read_data(data);
51 } else {
52 // fill the GenRunInfo structures
53 GenRunInfoData data;
54 write_data(data);
55
56 b.WriteClassBuffer(TClass::GetClass("HepMC3::GenRunInfoData"), &data);
57 }
58}
59
60#endif
61
62} // namespace HepMC3
Note: See TracBrowser for help on using the repository browser.