BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TBossFullEvent.cxx
Go to the documentation of this file.
2#include "TClass.h"
3#include "TBuffer.h"
4#include <iostream>
5
7
9 : m_mask(0),
10 m_EvtHeader(0),
11 m_digiEvt(0),
12 m_dstEvt(0),
13 m_mcEvt(0),
14 m_trigEvt(0),
15 m_hltEvt(0),
16 m_rectrackEvt(0),
17 m_evtRecObject(0)
18{
19}
20
21#define SafeDeleteObject(ObjType, var) \
22 if ( m_mask & has##ObjType ) { \
23 delete var; \
24 }
25
27{
28 SafeDeleteObject(EvtHeader, m_EvtHeader);
34 SafeDeleteObject(RecTrackEvent, m_rectrackEvt);
36}
37
38#define SafePrintObject(ObjType, var) \
39 if ( m_mask & has##ObjType ) { \
40 var->Print(); \
41 }
42
43void TBossFullEvent::Print(Option_t *option) const
44{
45 std::cout << "=============================================" << std::endl
46 << "TBossFullEvent mask: 0x" << std::hex << m_mask << std::dec << std::endl
47 << "---------------------------------------------" << std::endl;
48
49 SafePrintObject(EvtHeader, m_EvtHeader);
55 SafePrintObject(RecTrackEvent, m_rectrackEvt);
57
58 std::cout << "=============================================" << std::endl;
59}
60
62{
63 m_mask = obj->m_mask;
65 m_digiEvt = obj->m_digiEvt;
66 m_dstEvt = obj->m_dstEvt;
67 m_mcEvt = obj->m_mcEvt;
68 m_trigEvt = obj->m_trigEvt;
69 m_hltEvt = obj->m_hltEvt;
72}
73
74#define SafeReadObject(ObjType, var) \
75 if ( m_mask & has##ObjType ) { \
76 var = (T##ObjType*)R__b.ReadObject(T##ObjType::Class()); \
77 }
78
79#define SafeWriteObject(ObjType, var) \
80 if ( m_mask & has##ObjType ) { \
81 R__b.WriteObject(var); \
82 }
83
84void TBossFullEvent::Streamer(TBuffer &R__b)
85{
86 if ( R__b.IsReading() ) {
87 R__b >> m_mask;
88 SafeReadObject(EvtHeader, m_EvtHeader);
94 SafeReadObject(RecTrackEvent, m_rectrackEvt);
96 }
97 else {
98 R__b << m_mask;
99 SafeWriteObject(EvtHeader, m_EvtHeader);
105 SafeWriteObject(RecTrackEvent, m_rectrackEvt);
107 }
108}
#define SafePrintObject(ObjType, var)
#define SafeWriteObject(ObjType, var)
#define SafeReadObject(ObjType, var)
ClassImp(TBossFullEvent) TBossFullEvent
#define SafeDeleteObject(ObjType, var)
Definition: McEvent.h:8
TRecTrackEvent * m_rectrackEvt
THltEvent * m_hltEvt
virtual ~TBossFullEvent()
TDstEvent * m_dstEvt
TEvtRecObject * m_evtRecObject
TDigiEvent * m_digiEvt
TTrigEvent * m_trigEvt
void Print(Option_t *option="") const
TMcEvent * m_mcEvt
void copy(TBossFullEvent *obj)
TEvtHeader * m_EvtHeader