#include <RootFileWriter.h>
Definition at line 11 of file RootFileWriter.h.
◆ WriterArgType
◆ RootFileWriter()
Definition at line 10 of file RootFileWriter.cxx.
11 : m_fname( fname),
12 m_firstRound( true ),
13 m_stat(0)
14{
15 m_file = new TFile(fname.c_str(), "RECREATE");
16 m_tree = new TTree("Event","Event");
17 m_jtree = new TTree("JobInfoTree", "Job info");
20}
Referenced by RootFileWriter().
◆ ~RootFileWriter()
RootFileWriter::~RootFileWriter |
( |
| ) |
|
|
virtual |
Definition at line 22 of file RootFileWriter.cxx.
23{
24 if ( m_file->IsOpen() ) {
26 }
27
28 delete m_file;
29
30
31 delete m_evt;
32 delete m_jobInfo;
33}
◆ close()
int RootFileWriter::close |
( |
| ) |
|
Definition at line 92 of file RootFileWriter.cxx.
93{
94 m_jobInfo->
setBossVer( getenv(
"BES_RELEASE") );
97 m_jtree->Fill();
98
99 m_file->Write();
100 m_file->Close();
101
102 m_stat = 1;
103
104 return 0;
105}
void setBossVer(string ver)
void setDecayOptions(string opt)
void addJobOptions(string opt)
Referenced by main(), and ~RootFileWriter().
◆ stat()
int RootFileWriter::stat |
( |
| ) |
|
◆ writeEvent()
int RootFileWriter::writeEvent |
( |
void * |
pevt, |
|
|
int |
size |
|
) |
| |
Definition at line 35 of file RootFileWriter.cxx.
36{
37 if ( size == 4 ) {
38 m_stat = *((int*)pevt);
41 }
42 else {
43 throw RawExMessage(
"[RootFileWriter] Get an invalid DistBossCode!");
44 }
45 }
46
47 TBufferFile buffer(TBuffer::kRead, size, ((char*)pevt+4), kFALSE);
49
51
52
53
54
55
56
57
58 if ( m_firstRound ) {
60 if (m_evt->
m_digiEvt) m_tree->Branch(
"TDigiEvent",
"TDigiEvent",&m_evt->
m_digiEvt,3200000,1);
61 if (m_evt->
m_dstEvt) m_tree->Branch(
"TDstEvent",
"TDstEvent", &m_evt->
m_dstEvt, 3200000, 1);
62 if (m_evt->
m_mcEvt) m_tree->Branch(
"TMcEvent",
"TMcEvent",&m_evt->
m_mcEvt,3200000,1);
63 if (m_evt->
m_trigEvt) m_tree->Branch(
"TTrigEvent",
"TTrigEvent",&m_evt->
m_trigEvt,3200000,1);
64 if (m_evt->
m_hltEvt) m_tree->Branch(
"THltEvent",
"THltEvent",&m_evt->
m_hltEvt,3200000,1);
67
68 m_jtree->Branch("JobInfo",&m_jobInfo);
69
70 m_firstRound = false;
71 }
72
73 if ( m_file->IsZombie() || (!m_file->IsOpen()) ) {
74 std::cout<<"ROOT File: " << m_fname << " bad status in RootFileWriter" << std::endl;
75 exit(1);
76 }
77
78 int nb = m_tree->Fill();
79 if ( nb == -1 ) {
80 std::cerr << "RootFileWriter: error in fill tree " << m_tree->GetName() << std::endl;
81 exit(1);
82 }
83
84 delete evt;
85
87 m_file = m_tree->GetCurrentFile();
88
89 return nb;
90}
TRecTrackEvent * m_rectrackEvt
TEvtRecObject * m_evtRecObject
void copy(TBossFullEvent *obj)
Referenced by main().
The documentation for this class was generated from the following files: