1#include "RootFile/RootFileWriter.h"
4#include "TBufferFile.h"
5#include "RootEventData/TJobInfo.h"
6#include "IRawFile/RawFileExceptions.h"
7#include "DistBossUtil/DistBossCode.h"
15 m_file =
new TFile(fname.c_str(),
"RECREATE");
16 m_tree =
new TTree(
"Event",
"Event");
17 m_jtree =
new TTree(
"JobInfoTree",
"Job info");
24 if ( m_file->IsOpen() ) {
38 m_stat = *((
int*)pevt);
43 throw RawExMessage(
"[RootFileWriter] Get an invalid DistBossCode!");
47 TBufferFile buffer(TBuffer::kRead, size, ((
char*)pevt+4), kFALSE);
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);
68 m_jtree->Branch(
"JobInfo",&m_jobInfo);
73 if ( m_file->IsZombie() || (!m_file->IsOpen()) ) {
74 std::cout<<
"ROOT File: " << m_fname <<
" bad status in RootFileWriter" << std::endl;
78 int nb = m_tree->Fill();
80 std::cerr <<
"RootFileWriter: error in fill tree " << m_tree->GetName() << std::endl;
87 m_file = m_tree->GetCurrentFile();
94 m_jobInfo->
setBossVer( getenv(
"BES_RELEASE") );
112std::string RootFileWriter::getJobOptions()
114 string opts(
"JobOptions Place Holder\n");
118std::string RootFileWriter::getDecayOptions()
120 string opts(
"DecayOptions Place Holder\n");
int writeEvent(void *pevt, int size)
virtual ~RootFileWriter()
const std::string WriterArgType
RootFileWriter(WriterArgType &fname)
TEvtRecObject * m_evtRecObject
TRecTrackEvent * m_rectrackEvt
void copy(TBossFullEvent *obj)
void setBossVer(string ver)
void setDecayOptions(string opt)
void addJobOptions(string opt)